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;
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));
793 unsigned int isSigned : 1;
794 unsigned int constant : 1;
795 unsigned int truth : 1;
796 unsigned int byReference : 1;
797 unsigned int extraParam : 1;
798 unsigned int directClassAccess : 1;
799 unsigned int computing : 1;
800 unsigned int keepCast : 1;
801 unsigned int passAsTemplate : 1;
802 unsigned int dllExport : 1;
803 unsigned int attrStdcall : 1;
804 unsigned int declaredWithStruct : 1;
805 } __attribute__ ((gcc_struct));
807 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
809 struct __ecereNameSpace__ecere__com__Class
811 struct __ecereNameSpace__ecere__com__Class * prev;
812 struct __ecereNameSpace__ecere__com__Class * next;
818 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
819 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
822 struct __ecereNameSpace__ecere__com__Class * base;
823 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
824 struct __ecereNameSpace__ecere__sys__BinaryTree members;
825 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
826 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
827 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
828 struct __ecereNameSpace__ecere__sys__OldList derivatives;
832 struct __ecereNameSpace__ecere__com__Instance * module;
833 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
834 char * dataTypeString;
835 struct Type * dataType;
837 int defaultAlignment;
838 void (* Initialize)();
840 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
841 char * designerClass;
842 unsigned int noExpansion;
843 char * defaultProperty;
844 unsigned int comRedefinition;
846 unsigned int isRemote;
847 unsigned int internalDecl;
849 unsigned int computeSize;
851 int destructionWatchOffset;
853 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
854 int inheritanceAccess;
857 struct __ecereNameSpace__ecere__sys__OldList conversions;
858 struct __ecereNameSpace__ecere__sys__OldList templateParams;
859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
860 struct __ecereNameSpace__ecere__com__Class * templateClass;
861 struct __ecereNameSpace__ecere__sys__OldList templatized;
863 unsigned int isInstanceClass;
864 } __attribute__ ((gcc_struct));
866 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
868 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
870 struct __ecereNameSpace__ecere__com__Instance
873 struct __ecereNameSpace__ecere__com__Class * _class;
875 } __attribute__ ((gcc_struct));
877 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
879 struct __ecereNameSpace__ecere__com__DataMember
881 struct __ecereNameSpace__ecere__com__DataMember * prev;
882 struct __ecereNameSpace__ecere__com__DataMember * next;
884 unsigned int isProperty;
887 struct __ecereNameSpace__ecere__com__Class * _class;
888 char * dataTypeString;
889 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
890 struct Type * dataType;
894 struct __ecereNameSpace__ecere__sys__OldList members;
895 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
898 } __attribute__ ((gcc_struct));
900 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
902 struct __ecereNameSpace__ecere__com__SerialBuffer
904 unsigned char * _buffer;
908 } __attribute__ ((gcc_struct));
910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
912 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
918 char * dataTypeString;
919 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
920 } __attribute__ ((gcc_struct));
921 struct __ecereNameSpace__ecere__com__DataValue expression;
927 struct __ecereNameSpace__ecere__com__DataMember * member;
928 struct __ecereNameSpace__ecere__com__Property * prop;
929 struct __ecereNameSpace__ecere__com__Method * method;
930 } __attribute__ ((gcc_struct));
931 } __attribute__ ((gcc_struct));
932 } __attribute__ ((gcc_struct));
933 } __attribute__ ((gcc_struct));
935 void exit(int status);
937 void * calloc(size_t nmemb, size_t size);
939 void free(void * ptr);
941 void * malloc(size_t size);
943 void * realloc(void * ptr, size_t size);
945 long int strtol(const char * nptr, char ** endptr, int base);
947 long long int strtoll(const char * nptr, char ** endptr, int base);
949 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
953 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
956 typedef union YYSTYPE
961 struct Identifier * id;
962 struct Expression * exp;
963 struct Specifier * specifier;
964 struct __ecereNameSpace__ecere__sys__OldList * list;
965 struct Enumerator * enumerator;
966 struct Declarator * declarator;
967 struct Pointer * pointer;
968 struct Initializer * initializer;
969 struct InitDeclarator * initDeclarator;
970 struct TypeName * typeName;
971 struct Declaration * declaration;
972 struct Statement * stmt;
973 struct FunctionDefinition * function;
974 struct External * external;
975 struct Context * context;
976 struct AsmField * asmField;
977 struct Attrib * attrib;
978 struct ExtDecl * extDecl;
979 struct Attribute * attribute;
980 struct Instantiation * instance;
981 struct MembersInit * membersInit;
982 struct MemberInit * memberInit;
983 struct ClassFunction * classFunction;
984 struct ClassDefinition * _class;
985 struct ClassDef * classDef;
986 struct PropertyDef * prop;
988 struct Symbol * symbol;
989 struct PropertyWatch * propertyWatch;
990 struct TemplateParameter * templateParameter;
991 struct TemplateArgument * templateArgument;
992 struct TemplateDatatype * templateDatatype;
993 struct DBTableEntry * dbtableEntry;
994 struct DBIndexItem * dbindexItem;
995 struct DBTableDef * dbtableDef;
996 } __attribute__ ((gcc_struct)) YYSTYPE;
998 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1002 struct Enumerator * prev;
1003 struct Enumerator * next;
1004 struct Location loc;
1005 struct Identifier * id;
1006 struct Expression * exp;
1007 } __attribute__ ((gcc_struct));
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1011 struct InitDeclarator
1013 struct InitDeclarator * prev;
1014 struct InitDeclarator * next;
1015 struct Location loc;
1016 struct Declarator * declarator;
1017 struct Initializer * initializer;
1018 } __attribute__ ((gcc_struct));
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1024 struct AsmField * prev;
1025 struct AsmField * next;
1026 struct Location loc;
1028 struct Expression * expression;
1029 } __attribute__ ((gcc_struct));
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1037 struct ClassFunction
1039 struct ClassFunction * prev;
1040 struct ClassFunction * next;
1041 struct Location loc;
1042 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1043 struct Declarator * declarator;
1044 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1045 struct Statement * body;
1046 struct __ecereNameSpace__ecere__com__Class * _class;
1047 struct __ecereNameSpace__ecere__sys__OldList attached;
1050 struct Symbol * propSet;
1051 unsigned int isVirtual;
1052 unsigned int isConstructor;
1053 unsigned int isDestructor;
1054 unsigned int dontMangle;
1057 } __attribute__ ((gcc_struct));
1059 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1063 struct MembersInit * prev;
1064 struct MembersInit * next;
1065 struct Location loc;
1069 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1070 struct ClassFunction * function;
1071 } __attribute__ ((gcc_struct));
1072 } __attribute__ ((gcc_struct));
1074 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1078 struct MemberInit * prev;
1079 struct MemberInit * next;
1080 struct Location loc;
1081 struct Location realLoc;
1082 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1083 struct Initializer * initializer;
1085 unsigned int variable;
1086 unsigned int takeOutExp;
1087 } __attribute__ ((gcc_struct));
1089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1093 struct PropertyDef * prev;
1094 struct PropertyDef * next;
1095 struct Location loc;
1096 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1097 struct Declarator * declarator;
1098 struct Identifier * id;
1099 struct Statement * getStmt;
1100 struct Statement * setStmt;
1101 struct Statement * issetStmt;
1102 struct Symbol * symbol;
1103 unsigned int conversion;
1104 unsigned int isWatchable;
1105 struct Expression * category;
1106 } __attribute__ ((gcc_struct));
1108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1110 struct PropertyWatch
1112 struct PropertyWatch * prev;
1113 struct PropertyWatch * next;
1114 struct Location loc;
1115 struct Statement * compound;
1116 struct __ecereNameSpace__ecere__sys__OldList * properties;
1117 unsigned int deleteWatch;
1118 } __attribute__ ((gcc_struct));
1120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1124 struct ClassDef * prev;
1125 struct ClassDef * next;
1126 struct Location loc;
1130 struct Declaration * decl;
1131 struct ClassFunction * function;
1132 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1133 struct PropertyDef * propertyDef;
1134 struct PropertyWatch * propertyWatch;
1136 struct Identifier * defaultProperty;
1139 struct Identifier * id;
1140 struct Initializer * initializer;
1141 } __attribute__ ((gcc_struct));
1142 } __attribute__ ((gcc_struct));
1145 } __attribute__ ((gcc_struct));
1147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1149 struct DBTableEntry;
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1155 extern YYSTYPE yylval;
1157 extern struct Location yylloc;
1159 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1161 extern int returnCode;
1163 extern struct Expression * parsedExpression;
1165 extern unsigned int yydebug;
1167 void SetYydebug(unsigned int b)
1172 extern unsigned int echoOn;
1174 void resetScanner();
1178 int expression_yyparse();
1180 static struct Statement * curCompound;
1182 struct External * curExternal, * afterExternal;
1184 static struct Type * curSwitchType;
1186 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1188 struct __ecereNameSpace__ecere__com__Class * thisClass;
1190 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1195 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1200 static char * thisNameSpace;
1202 struct __ecereNameSpace__ecere__com__Class * containerClass;
1204 unsigned int thisClassParams = 0x1;
1206 unsigned int internalValueCounter;
1208 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1210 extern size_t strlen(const char * );
1212 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1214 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1216 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1218 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1220 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1222 void PrintExpression(struct Expression * exp, char * string)
1225 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1229 OutputExpression(exp, f);
1230 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1231 count = strlen(string);
1232 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);
1233 string[count] = '\0';
1234 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1238 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1240 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1242 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1244 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1246 if(!param->baseType)
1248 if(param->dataTypeString)
1249 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1251 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1253 return param->baseType;
1255 return (((void *)0));
1258 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1260 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1262 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1266 if(type1->kind == type2->kind)
1276 if(type1->passAsTemplate && !type2->passAsTemplate)
1278 return type1->isSigned != type2->isSigned;
1280 return type1->_class != type2->_class;
1282 return NeedCast(type1->type, type2->type);
1290 extern int strcmp(const char * , const char * );
1292 extern struct Context * curContext;
1294 extern struct Context * topContext;
1296 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1298 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);
1300 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1302 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);
1304 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);
1306 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1308 struct __ecereNameSpace__ecere__com__ClassProperty
1311 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1312 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1313 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1315 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1316 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1317 char * dataTypeString;
1318 struct Type * dataType;
1319 unsigned int constant;
1320 } __attribute__ ((gcc_struct));
1322 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1324 extern struct Expression * QMkExpId(char * id);
1326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1328 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1330 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1331 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1336 char * dataTypeString;
1338 } __attribute__ ((gcc_struct));
1339 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1341 } __attribute__ ((gcc_struct));
1343 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1345 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1347 extern void FreeIdentifier(struct Identifier * id);
1349 void ProcessExpressionType(struct Expression * exp);
1351 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1353 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1355 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1357 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1359 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1361 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1363 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1365 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1367 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1369 if(exp->type == 0 && exp->identifier)
1371 struct Identifier * id = exp->identifier;
1372 struct Context * ctx;
1373 struct Symbol * symbol = (((void *)0));
1375 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1377 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1379 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1384 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1386 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1387 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1388 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1389 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1393 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1395 if(!prop && !method)
1396 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1397 if(!prop && !method && !member)
1399 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1401 if(prop || method || member || classProp)
1404 exp->member.member = id;
1405 exp->member.memberType = 0;
1406 exp->member.exp = QMkExpId("this");
1407 exp->addedThis = 0x1;
1409 else if(_class && _class->templateParams.first)
1411 struct __ecereNameSpace__ecere__com__Class * sClass;
1413 for(sClass = _class; sClass; sClass = sClass->base)
1415 if(sClass->templateParams.first)
1417 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1419 for(param = sClass->templateParams.first; param; param = param->next)
1421 if(param->type == 2 && !strcmp(param->name, id->string))
1423 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1427 struct Declarator * decl;
1428 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1430 FreeIdentifier(exp->member.member);
1431 ProcessExpressionType(argExp);
1432 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1433 exp->expType = ProcessType(specs, decl);
1435 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1446 extern int sprintf(char * , char * , ...);
1448 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1450 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1452 char * PrintInt(long long result)
1456 if(result > (((long long)0x7fffffffffffffffLL)))
1457 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1459 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1460 return __ecereNameSpace__ecere__sys__CopyString(temp);
1463 char * PrintUInt(uint64 result)
1467 if(result > (0xffffffff))
1468 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1469 else if(result > (((int)0x7fffffff)))
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1472 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1473 return __ecereNameSpace__ecere__sys__CopyString(temp);
1476 char * PrintInt64(long long result)
1480 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1481 return __ecereNameSpace__ecere__sys__CopyString(temp);
1484 char * PrintUInt64(uint64 result)
1488 if(result > (((long long)0x7fffffffffffffffLL)))
1489 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1491 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1492 return __ecereNameSpace__ecere__sys__CopyString(temp);
1495 char * PrintHexUInt(uint64 result)
1499 if(result > (0xffffffff))
1500 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1502 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1503 return __ecereNameSpace__ecere__sys__CopyString(temp);
1506 char * PrintHexUInt64(uint64 result)
1510 if(result > (0xffffffff))
1511 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1513 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1514 return __ecereNameSpace__ecere__sys__CopyString(temp);
1517 char * PrintShort(short result)
1521 sprintf(temp, "%d", (unsigned short)result);
1522 return __ecereNameSpace__ecere__sys__CopyString(temp);
1525 char * PrintUShort(unsigned short result)
1529 if(result > (unsigned short)32767)
1530 sprintf(temp, "0x%X", (int)result);
1532 sprintf(temp, "%d", (int)result);
1533 return __ecereNameSpace__ecere__sys__CopyString(temp);
1536 extern int isprint(int c);
1538 char * PrintChar(char result)
1542 if(result > (char)0 && isprint(result))
1543 sprintf(temp, "'%c'", result);
1544 else if(result < (char)0)
1545 sprintf(temp, "%d", (int)result);
1547 sprintf(temp, "0x%X", (unsigned char)result);
1548 return __ecereNameSpace__ecere__sys__CopyString(temp);
1551 char * PrintUChar(unsigned char result)
1555 sprintf(temp, "0x%X", result);
1556 return __ecereNameSpace__ecere__sys__CopyString(temp);
1559 char * PrintFloat(float result)
1563 sprintf(temp, "%.16ff", result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 char * PrintDouble(double result)
1571 sprintf(temp, "%.16f", result);
1572 return __ecereNameSpace__ecere__sys__CopyString(temp);
1575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1579 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1580 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1581 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1582 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1583 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1584 unsigned int (* Neg)(struct Expression *, struct Operand *);
1585 unsigned int (* Inc)(struct Expression *, struct Operand *);
1586 unsigned int (* Dec)(struct Expression *, struct Operand *);
1587 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1599 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* Not)(struct Expression *, struct Operand *);
1605 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1612 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1614 } __attribute__ ((gcc_struct));
1616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1622 unsigned int ptrSize;
1635 } __attribute__ ((gcc_struct));
1637 } __attribute__ ((gcc_struct));
1639 struct Operand GetOperand(struct Expression * exp);
1641 unsigned int GetInt(struct Expression * exp, int * value2)
1643 struct Operand op2 = GetOperand(exp);
1645 if(op2.kind == 3 && op2.type->isSigned)
1647 else if(op2.kind == 3)
1648 *value2 = (int)op2.ui;
1649 else if(op2.kind == 4 && op2.type->isSigned)
1650 *value2 = (int)op2.i64;
1651 else if(op2.kind == 4)
1652 *value2 = (int)op2.ui64;
1653 else if(op2.kind == 23 && op2.type->isSigned)
1654 *value2 = (int)op2.i64;
1655 else if(op2.kind == 23)
1656 *value2 = (int)op2.ui64;
1657 else if(op2.kind == 22 && op2.type->isSigned)
1658 *value2 = (int)op2.i64;
1659 else if(op2.kind == 22)
1660 *value2 = (int)op2.ui64;
1661 else if(op2.kind == 2 && op2.type->isSigned)
1662 *value2 = (int)op2.s;
1663 else if(op2.kind == 2)
1664 *value2 = (int)op2.us;
1665 else if(op2.kind == 1 && op2.type->isSigned)
1666 *value2 = (int)op2.c;
1667 else if(op2.kind == 1)
1668 *value2 = (int)op2.uc;
1669 else if(op2.kind == 6)
1670 *value2 = (int)op2.f;
1671 else if(op2.kind == 7)
1672 *value2 = (int)op2.d;
1673 else if(op2.kind == 13)
1674 *value2 = (int)op2.ui64;
1680 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1682 struct Operand op2 = GetOperand(exp);
1684 if(op2.kind == 3 && op2.type->isSigned)
1685 *value2 = (unsigned int)op2.i;
1686 else if(op2.kind == 3)
1688 else if(op2.kind == 4 && op2.type->isSigned)
1689 *value2 = (unsigned int)op2.i64;
1690 else if(op2.kind == 4)
1691 *value2 = (unsigned int)op2.ui64;
1692 else if(op2.kind == 23 && op2.type->isSigned)
1693 *value2 = (unsigned int)op2.i64;
1694 else if(op2.kind == 23)
1695 *value2 = (unsigned int)op2.ui64;
1696 else if(op2.kind == 22 && op2.type->isSigned)
1697 *value2 = (unsigned int)op2.i64;
1698 else if(op2.kind == 22)
1699 *value2 = (unsigned int)op2.ui64;
1700 else if(op2.kind == 2 && op2.type->isSigned)
1701 *value2 = (unsigned int)op2.s;
1702 else if(op2.kind == 2)
1703 *value2 = (unsigned int)op2.us;
1704 else if(op2.kind == 1 && op2.type->isSigned)
1705 *value2 = (unsigned int)op2.c;
1706 else if(op2.kind == 1)
1707 *value2 = (unsigned int)op2.uc;
1708 else if(op2.kind == 6)
1709 *value2 = (unsigned int)op2.f;
1710 else if(op2.kind == 7)
1711 *value2 = (unsigned int)op2.d;
1712 else if(op2.kind == 13)
1713 *value2 = (unsigned int)op2.ui64;
1719 unsigned int GetInt64(struct Expression * exp, long long * value2)
1721 struct Operand op2 = GetOperand(exp);
1723 if(op2.kind == 3 && op2.type->isSigned)
1724 *value2 = (long long)op2.i;
1725 else if(op2.kind == 3)
1726 *value2 = (long long)op2.ui;
1727 else if(op2.kind == 4 && op2.type->isSigned)
1729 else if(op2.kind == 4)
1730 *value2 = (long long)op2.ui64;
1731 else if(op2.kind == 23 && op2.type->isSigned)
1733 else if(op2.kind == 23)
1734 *value2 = (long long)op2.ui64;
1735 else if(op2.kind == 22 && op2.type->isSigned)
1737 else if(op2.kind == 22)
1738 *value2 = (long long)op2.ui64;
1739 else if(op2.kind == 2 && op2.type->isSigned)
1740 *value2 = (long long)op2.s;
1741 else if(op2.kind == 2)
1742 *value2 = (long long)op2.us;
1743 else if(op2.kind == 1 && op2.type->isSigned)
1744 *value2 = (long long)op2.c;
1745 else if(op2.kind == 1)
1746 *value2 = (long long)op2.uc;
1747 else if(op2.kind == 6)
1748 *value2 = (long long)op2.f;
1749 else if(op2.kind == 7)
1750 *value2 = (long long)op2.d;
1751 else if(op2.kind == 13)
1752 *value2 = (long long)op2.ui64;
1758 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1760 struct Operand op2 = GetOperand(exp);
1762 if(op2.kind == 3 && op2.type->isSigned)
1763 *value2 = (uint64)op2.i;
1764 else if(op2.kind == 3)
1765 *value2 = (uint64)op2.ui;
1766 else if(op2.kind == 4 && op2.type->isSigned)
1767 *value2 = (uint64)op2.i64;
1768 else if(op2.kind == 4)
1770 else if(op2.kind == 23 && op2.type->isSigned)
1771 *value2 = (uint64)op2.i64;
1772 else if(op2.kind == 23)
1774 else if(op2.kind == 22 && op2.type->isSigned)
1775 *value2 = (uint64)op2.i64;
1776 else if(op2.kind == 22)
1778 else if(op2.kind == 2 && op2.type->isSigned)
1779 *value2 = (uint64)op2.s;
1780 else if(op2.kind == 2)
1781 *value2 = (uint64)op2.us;
1782 else if(op2.kind == 1 && op2.type->isSigned)
1783 *value2 = (uint64)op2.c;
1784 else if(op2.kind == 1)
1785 *value2 = (uint64)op2.uc;
1786 else if(op2.kind == 6)
1787 *value2 = (uint64)op2.f;
1788 else if(op2.kind == 7)
1789 *value2 = (uint64)op2.d;
1790 else if(op2.kind == 13)
1797 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1799 struct Operand op2 = GetOperand(exp);
1801 if(op2.kind == 3 && op2.type->isSigned)
1802 *value2 = (intptr_t)op2.i;
1803 else if(op2.kind == 3)
1804 *value2 = (intptr_t)op2.ui;
1805 else if(op2.kind == 4 && op2.type->isSigned)
1806 *value2 = (intptr_t)op2.i64;
1807 else if(op2.kind == 4)
1808 *value2 = (intptr_t)op2.ui64;
1809 else if(op2.kind == 23 && op2.type->isSigned)
1810 *value2 = (intptr_t)op2.i64;
1811 else if(op2.kind == 23)
1812 *value2 = (intptr_t)op2.ui64;
1813 else if(op2.kind == 22 && op2.type->isSigned)
1814 *value2 = (intptr_t)op2.i64;
1815 else if(op2.kind == 22)
1816 *value2 = (intptr_t)op2.ui64;
1817 else if(op2.kind == 2 && op2.type->isSigned)
1818 *value2 = (intptr_t)op2.s;
1819 else if(op2.kind == 2)
1820 *value2 = (intptr_t)op2.us;
1821 else if(op2.kind == 1 && op2.type->isSigned)
1822 *value2 = (intptr_t)op2.c;
1823 else if(op2.kind == 1)
1824 *value2 = (intptr_t)op2.uc;
1825 else if(op2.kind == 6)
1826 *value2 = (intptr_t)op2.f;
1827 else if(op2.kind == 7)
1828 *value2 = (intptr_t)op2.d;
1829 else if(op2.kind == 13)
1830 *value2 = (intptr_t)op2.ui64;
1836 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1838 struct Operand op2 = GetOperand(exp);
1840 if(op2.kind == 3 && op2.type->isSigned)
1841 *value2 = (uintptr_t)op2.i;
1842 else if(op2.kind == 3)
1843 *value2 = (uintptr_t)op2.ui;
1844 else if(op2.kind == 4 && op2.type->isSigned)
1845 *value2 = (uintptr_t)op2.i64;
1846 else if(op2.kind == 4)
1847 *value2 = (uintptr_t)op2.ui64;
1848 else if(op2.kind == 23 && op2.type->isSigned)
1849 *value2 = (uintptr_t)op2.i64;
1850 else if(op2.kind == 23)
1851 *value2 = (uintptr_t)op2.ui64;
1852 else if(op2.kind == 22 && op2.type->isSigned)
1853 *value2 = (uintptr_t)op2.i64;
1854 else if(op2.kind == 22)
1855 *value2 = (uintptr_t)op2.ui64;
1856 else if(op2.kind == 2 && op2.type->isSigned)
1857 *value2 = (uintptr_t)op2.s;
1858 else if(op2.kind == 2)
1859 *value2 = (uintptr_t)op2.us;
1860 else if(op2.kind == 1 && op2.type->isSigned)
1861 *value2 = (uintptr_t)op2.c;
1862 else if(op2.kind == 1)
1863 *value2 = (uintptr_t)op2.uc;
1864 else if(op2.kind == 6)
1865 *value2 = (uintptr_t)op2.f;
1866 else if(op2.kind == 7)
1867 *value2 = (uintptr_t)op2.d;
1868 else if(op2.kind == 13)
1869 *value2 = (uintptr_t)op2.ui64;
1875 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1877 struct Operand op2 = GetOperand(exp);
1879 if(op2.kind == 3 && op2.type->isSigned)
1880 *value2 = (ssize_t)op2.i;
1881 else if(op2.kind == 3)
1882 *value2 = (ssize_t)op2.ui;
1883 else if(op2.kind == 4 && op2.type->isSigned)
1884 *value2 = (ssize_t)op2.i64;
1885 else if(op2.kind == 4)
1886 *value2 = (ssize_t)op2.ui64;
1887 else if(op2.kind == 23 && op2.type->isSigned)
1888 *value2 = (ssize_t)op2.i64;
1889 else if(op2.kind == 23)
1890 *value2 = (ssize_t)op2.ui64;
1891 else if(op2.kind == 22 && op2.type->isSigned)
1892 *value2 = (ssize_t)op2.i64;
1893 else if(op2.kind == 22)
1894 *value2 = (ssize_t)op2.ui64;
1895 else if(op2.kind == 2 && op2.type->isSigned)
1896 *value2 = (ssize_t)op2.s;
1897 else if(op2.kind == 2)
1898 *value2 = (ssize_t)op2.us;
1899 else if(op2.kind == 1 && op2.type->isSigned)
1900 *value2 = (ssize_t)op2.c;
1901 else if(op2.kind == 1)
1902 *value2 = (ssize_t)op2.uc;
1903 else if(op2.kind == 6)
1904 *value2 = (ssize_t)op2.f;
1905 else if(op2.kind == 7)
1906 *value2 = (ssize_t)op2.d;
1907 else if(op2.kind == 13)
1908 *value2 = (ssize_t)op2.ui64;
1914 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1916 struct Operand op2 = GetOperand(exp);
1918 if(op2.kind == 3 && op2.type->isSigned)
1919 *value2 = (size_t)op2.i;
1920 else if(op2.kind == 3)
1921 *value2 = (size_t)op2.ui;
1922 else if(op2.kind == 4 && op2.type->isSigned)
1923 *value2 = (size_t)op2.i64;
1924 else if(op2.kind == 4)
1925 *value2 = (size_t)op2.ui64;
1926 else if(op2.kind == 23 && op2.type->isSigned)
1927 *value2 = (size_t)op2.i64;
1928 else if(op2.kind == 23)
1929 *value2 = (size_t)op2.ui64;
1930 else if(op2.kind == 22 && op2.type->isSigned)
1931 *value2 = (size_t)op2.i64;
1932 else if(op2.kind == 22)
1933 *value2 = (size_t)op2.ui64;
1934 else if(op2.kind == 2 && op2.type->isSigned)
1935 *value2 = (size_t)op2.s;
1936 else if(op2.kind == 2)
1937 *value2 = (size_t)op2.us;
1938 else if(op2.kind == 1 && op2.type->isSigned)
1939 *value2 = (size_t)op2.c;
1940 else if(op2.kind == 1)
1941 *value2 = (size_t)op2.uc;
1942 else if(op2.kind == 6)
1943 *value2 = (size_t)op2.f;
1944 else if(op2.kind == 7)
1945 *value2 = (size_t)op2.d;
1946 else if(op2.kind == 13)
1947 *value2 = (size_t)op2.ui64;
1953 unsigned int GetShort(struct Expression * exp, short * value2)
1955 struct Operand op2 = GetOperand(exp);
1957 if(op2.kind == 3 && op2.type->isSigned)
1958 *value2 = (short)op2.i;
1959 else if(op2.kind == 3)
1960 *value2 = (short)op2.ui;
1961 else if(op2.kind == 4 && op2.type->isSigned)
1962 *value2 = (short)op2.i64;
1963 else if(op2.kind == 4)
1964 *value2 = (short)op2.ui64;
1965 else if(op2.kind == 23 && op2.type->isSigned)
1966 *value2 = (short)op2.i64;
1967 else if(op2.kind == 23)
1968 *value2 = (short)op2.ui64;
1969 else if(op2.kind == 22 && op2.type->isSigned)
1970 *value2 = (short)op2.i64;
1971 else if(op2.kind == 22)
1972 *value2 = (short)op2.ui64;
1973 else if(op2.kind == 2 && op2.type->isSigned)
1975 else if(op2.kind == 2)
1976 *value2 = (short)op2.us;
1977 else if(op2.kind == 1 && op2.type->isSigned)
1978 *value2 = (short)op2.c;
1979 else if(op2.kind == 1)
1980 *value2 = (short)op2.uc;
1981 else if(op2.kind == 6)
1982 *value2 = (short)op2.f;
1983 else if(op2.kind == 7)
1984 *value2 = (short)op2.d;
1985 else if(op2.kind == 13)
1986 *value2 = (short)op2.ui64;
1992 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1994 struct Operand op2 = GetOperand(exp);
1996 if(op2.kind == 3 && op2.type->isSigned)
1997 *value2 = (unsigned short)op2.i;
1998 else if(op2.kind == 3)
1999 *value2 = (unsigned short)op2.ui;
2000 else if(op2.kind == 4 && op2.type->isSigned)
2001 *value2 = (unsigned short)op2.i64;
2002 else if(op2.kind == 4)
2003 *value2 = (unsigned short)op2.ui64;
2004 else if(op2.kind == 23 && op2.type->isSigned)
2005 *value2 = (unsigned short)op2.i64;
2006 else if(op2.kind == 23)
2007 *value2 = (unsigned short)op2.ui64;
2008 else if(op2.kind == 22 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.i64;
2010 else if(op2.kind == 22)
2011 *value2 = (unsigned short)op2.ui64;
2012 else if(op2.kind == 2 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.s;
2014 else if(op2.kind == 2)
2016 else if(op2.kind == 1 && op2.type->isSigned)
2017 *value2 = (unsigned short)op2.c;
2018 else if(op2.kind == 1)
2019 *value2 = (unsigned short)op2.uc;
2020 else if(op2.kind == 6)
2021 *value2 = (unsigned short)op2.f;
2022 else if(op2.kind == 7)
2023 *value2 = (unsigned short)op2.d;
2024 else if(op2.kind == 13)
2025 *value2 = (unsigned short)op2.ui64;
2031 unsigned int GetChar(struct Expression * exp, char * value2)
2033 struct Operand op2 = GetOperand(exp);
2035 if(op2.kind == 3 && op2.type->isSigned)
2036 *value2 = (char)op2.i;
2037 else if(op2.kind == 3)
2038 *value2 = (char)op2.ui;
2039 else if(op2.kind == 4 && op2.type->isSigned)
2040 *value2 = (char)op2.i64;
2041 else if(op2.kind == 4)
2042 *value2 = (char)op2.ui64;
2043 else if(op2.kind == 23 && op2.type->isSigned)
2044 *value2 = (char)op2.i64;
2045 else if(op2.kind == 23)
2046 *value2 = (char)op2.ui64;
2047 else if(op2.kind == 22 && op2.type->isSigned)
2048 *value2 = (char)op2.i64;
2049 else if(op2.kind == 22)
2050 *value2 = (char)op2.ui64;
2051 else if(op2.kind == 2 && op2.type->isSigned)
2052 *value2 = (char)op2.s;
2053 else if(op2.kind == 2)
2054 *value2 = (char)op2.us;
2055 else if(op2.kind == 1 && op2.type->isSigned)
2057 else if(op2.kind == 1)
2058 *value2 = (char)op2.uc;
2059 else if(op2.kind == 6)
2060 *value2 = (char)op2.f;
2061 else if(op2.kind == 7)
2062 *value2 = (char)op2.d;
2063 else if(op2.kind == 13)
2064 *value2 = (char)op2.ui64;
2070 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2072 struct Operand op2 = GetOperand(exp);
2074 if(op2.kind == 3 && op2.type->isSigned)
2075 *value2 = (unsigned char)op2.i;
2076 else if(op2.kind == 3)
2077 *value2 = (unsigned char)op2.ui;
2078 else if(op2.kind == 4 && op2.type->isSigned)
2079 *value2 = (unsigned char)op2.i64;
2080 else if(op2.kind == 4)
2081 *value2 = (unsigned char)op2.ui64;
2082 else if(op2.kind == 23 && op2.type->isSigned)
2083 *value2 = (unsigned char)op2.i64;
2084 else if(op2.kind == 23)
2085 *value2 = (unsigned char)op2.ui64;
2086 else if(op2.kind == 22 && op2.type->isSigned)
2087 *value2 = (unsigned char)op2.i64;
2088 else if(op2.kind == 22)
2089 *value2 = (unsigned char)op2.ui64;
2090 else if(op2.kind == 2 && op2.type->isSigned)
2091 *value2 = (unsigned char)op2.s;
2092 else if(op2.kind == 2)
2093 *value2 = (unsigned char)op2.us;
2094 else if(op2.kind == 1 && op2.type->isSigned)
2095 *value2 = (unsigned char)op2.c;
2096 else if(op2.kind == 1)
2098 else if(op2.kind == 6)
2099 *value2 = (unsigned char)op2.f;
2100 else if(op2.kind == 7)
2101 *value2 = (unsigned char)op2.d;
2102 else if(op2.kind == 13)
2103 *value2 = (unsigned char)op2.ui64;
2109 unsigned int GetFloat(struct Expression * exp, float * value2)
2111 struct Operand op2 = GetOperand(exp);
2113 if(op2.kind == 3 && op2.type->isSigned)
2114 *value2 = (float)(float)op2.i;
2115 else if(op2.kind == 3)
2116 *value2 = (float)(float)op2.ui;
2117 else if(op2.kind == 4 && op2.type->isSigned)
2118 *value2 = (float)(float)op2.i64;
2119 else if(op2.kind == 4)
2120 *value2 = (float)(float)op2.ui64;
2121 else if(op2.kind == 23 && op2.type->isSigned)
2122 *value2 = (float)(float)op2.i64;
2123 else if(op2.kind == 23)
2124 *value2 = (float)(float)op2.ui64;
2125 else if(op2.kind == 22 && op2.type->isSigned)
2126 *value2 = (float)(float)op2.i64;
2127 else if(op2.kind == 22)
2128 *value2 = (float)(float)op2.ui64;
2129 else if(op2.kind == 2 && op2.type->isSigned)
2130 *value2 = (float)(float)op2.s;
2131 else if(op2.kind == 2)
2132 *value2 = (float)(float)op2.us;
2133 else if(op2.kind == 1 && op2.type->isSigned)
2134 *value2 = (float)(float)op2.c;
2135 else if(op2.kind == 1)
2136 *value2 = (float)(float)op2.uc;
2137 else if(op2.kind == 6)
2138 *value2 = (float)op2.f;
2139 else if(op2.kind == 7)
2140 *value2 = (float)op2.d;
2141 else if(op2.kind == 13)
2142 *value2 = (float)(float)op2.ui64;
2148 unsigned int GetDouble(struct Expression * exp, double * value2)
2150 struct Operand op2 = GetOperand(exp);
2152 if(op2.kind == 3 && op2.type->isSigned)
2153 *value2 = (double)(double)op2.i;
2154 else if(op2.kind == 3)
2155 *value2 = (double)(double)op2.ui;
2156 else if(op2.kind == 4 && op2.type->isSigned)
2157 *value2 = (double)(double)op2.i64;
2158 else if(op2.kind == 4)
2159 *value2 = (double)(double)op2.ui64;
2160 else if(op2.kind == 23 && op2.type->isSigned)
2161 *value2 = (double)(double)op2.i64;
2162 else if(op2.kind == 23)
2163 *value2 = (double)(double)op2.ui64;
2164 else if(op2.kind == 22 && op2.type->isSigned)
2165 *value2 = (double)(double)op2.i64;
2166 else if(op2.kind == 22)
2167 *value2 = (double)(double)op2.ui64;
2168 else if(op2.kind == 2 && op2.type->isSigned)
2169 *value2 = (double)(double)op2.s;
2170 else if(op2.kind == 2)
2171 *value2 = (double)(double)op2.us;
2172 else if(op2.kind == 1 && op2.type->isSigned)
2173 *value2 = (double)(double)op2.c;
2174 else if(op2.kind == 1)
2175 *value2 = (double)(double)op2.uc;
2176 else if(op2.kind == 6)
2177 *value2 = (double)op2.f;
2178 else if(op2.kind == 7)
2179 *value2 = (double)op2.d;
2180 else if(op2.kind == 13)
2181 *value2 = (double)(double)op2.ui64;
2187 void ComputeExpression(struct Expression * exp);
2189 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2191 extern int targetBits;
2193 int ComputeTypeSize(struct Type * type);
2195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2197 struct __ecereNameSpace__ecere__com__BitMember
2199 struct __ecereNameSpace__ecere__com__BitMember * prev;
2200 struct __ecereNameSpace__ecere__com__BitMember * next;
2202 unsigned int isProperty;
2205 struct __ecereNameSpace__ecere__com__Class * _class;
2206 char * dataTypeString;
2207 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2208 struct Type * dataType;
2213 } __attribute__ ((gcc_struct));
2215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2217 struct __ecereNameSpace__ecere__sys__OldLink
2219 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2220 struct __ecereNameSpace__ecere__sys__OldLink * next;
2222 } __attribute__ ((gcc_struct));
2224 void FinishTemplatesContext(struct Context * context);
2226 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2228 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2229 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2231 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))
2234 int unionMemberOffset = 0;
2239 member->memberOffset = 0;
2240 if(targetBits < sizeof(void *) * 8)
2241 member->structAlignment = 0;
2243 else if(targetBits < sizeof(void *) * 8)
2244 _class->structAlignment = 0;
2245 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2246 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2247 if(!member && _class->destructionWatchOffset)
2248 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2250 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2252 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2254 if(!dataMember->isProperty)
2256 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2258 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2264 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2266 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2268 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2270 if(!isMember && _class->type == 2 && dataMember->dataType)
2272 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2276 ComputeTypeSize(dataMember->dataType);
2277 if(bitMember->pos == -1)
2278 bitMember->pos = _class->memberOffset;
2279 if(!bitMember->size)
2280 bitMember->size = dataMember->dataType->size * 8;
2281 _class->memberOffset = bitMember->pos + bitMember->size;
2282 for(d = 0; d < bitMember->size; d++)
2288 bitMember->mask = mask << bitMember->pos;
2290 else if(dataMember->type == 0 && dataMember->dataType)
2295 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2296 ComputeTypeSize(dataMember->dataType);
2297 if(dataMember->dataType->bitFieldCount)
2299 bitFields += dataMember->dataType->bitFieldCount;
2306 int size = (bitFields + 7) / 8;
2310 int __simpleStruct0;
2314 int __simpleStruct0;
2316 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2317 if(member->memberOffset % alignment)
2318 member->memberOffset += alignment - (member->memberOffset % alignment);
2320 dataMember->offset = member->memberOffset;
2321 if(member->type == 1)
2322 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2325 member->memberOffset += size;
2332 int __simpleStruct0;
2334 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2335 if(_class->memberOffset % alignment)
2336 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2338 dataMember->offset = _class->memberOffset;
2339 _class->memberOffset += size;
2343 size = dataMember->dataType->size;
2344 alignment = dataMember->dataType->alignment;
2348 int __simpleStruct0;
2352 int __simpleStruct0;
2354 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2355 if(member->memberOffset % alignment)
2356 member->memberOffset += alignment - (member->memberOffset % alignment);
2358 dataMember->offset = member->memberOffset;
2359 if(member->type == 1)
2360 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2363 member->memberOffset += size;
2370 int __simpleStruct0;
2372 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2373 if(_class->memberOffset % alignment)
2374 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2376 dataMember->offset = _class->memberOffset;
2377 _class->memberOffset += size;
2384 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2385 alignment = dataMember->structAlignment;
2388 int __simpleStruct0;
2392 int __simpleStruct0;
2394 if(member->memberOffset % alignment)
2395 member->memberOffset += alignment - (member->memberOffset % alignment);
2396 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2398 dataMember->offset = member->memberOffset;
2399 if(member->type == 1)
2400 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2402 member->memberOffset += dataMember->memberOffset;
2408 int __simpleStruct0;
2410 if(_class->memberOffset % alignment)
2411 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2412 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2414 dataMember->offset = _class->memberOffset;
2415 _class->memberOffset += dataMember->memberOffset;
2423 int size = (bitFields + 7) / 8;
2427 int __simpleStruct0;
2431 int __simpleStruct0;
2433 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2434 if(member->memberOffset % alignment)
2435 member->memberOffset += alignment - (member->memberOffset % alignment);
2437 if(member->type == 1)
2438 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2441 member->memberOffset += size;
2448 int __simpleStruct0;
2450 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2451 if(_class->memberOffset % alignment)
2452 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2454 _class->memberOffset += size;
2459 if(member && member->type == 1)
2461 member->memberOffset = unionMemberOffset;
2465 if(_class->type != 2)
2469 if(_class->structAlignment)
2471 if(_class->memberOffset % _class->structAlignment)
2472 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2474 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2477 struct __ecereNameSpace__ecere__com__Property * prop;
2479 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2481 if(prop->isProperty && prop->isWatchable)
2483 prop->watcherOffset = _class->structSize;
2484 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2489 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2491 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2493 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2495 if(deriv->computeSize)
2497 deriv->offset = _class->structSize;
2498 deriv->memberOffset = 0;
2499 deriv->structSize = deriv->offset;
2500 ComputeClassMembers(deriv, 0x0);
2508 FinishTemplatesContext(context);
2511 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2513 struct __ecereNameSpace__ecere__com__NameSpace
2516 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2517 struct __ecereNameSpace__ecere__com__NameSpace * left;
2518 struct __ecereNameSpace__ecere__com__NameSpace * right;
2520 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2521 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2522 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2523 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2524 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2525 } __attribute__ ((gcc_struct));
2527 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2529 struct __ecereNameSpace__ecere__com__Module
2531 struct __ecereNameSpace__ecere__com__Instance * application;
2532 struct __ecereNameSpace__ecere__sys__OldList classes;
2533 struct __ecereNameSpace__ecere__sys__OldList defines;
2534 struct __ecereNameSpace__ecere__sys__OldList functions;
2535 struct __ecereNameSpace__ecere__sys__OldList modules;
2536 struct __ecereNameSpace__ecere__com__Instance * prev;
2537 struct __ecereNameSpace__ecere__com__Instance * next;
2543 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2544 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2545 } __attribute__ ((gcc_struct));
2547 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2549 struct __ecereNameSpace__ecere__com__Class * _class;
2550 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2552 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2553 ComputeModuleClasses(subModule->data);
2554 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2555 ComputeClassMembers(_class, 0x0);
2558 extern unsigned int inCompiler;
2560 extern void Compiler_Error(char * format, ...);
2562 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2564 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2566 int ComputeTypeSize(struct Type * type)
2568 unsigned int size = type ? type->size : 0;
2570 if(!size && type && !type->computing)
2572 type->computing = 0x1;
2576 type->alignment = size = sizeof(char);
2579 type->alignment = size = sizeof(int);
2582 type->alignment = size = sizeof(long long);
2585 type->alignment = size = targetBits / 8;
2588 type->alignment = size = targetBits / 8;
2591 type->alignment = size = sizeof(long);
2594 type->alignment = size = sizeof(short);
2597 type->alignment = size = sizeof(float);
2600 type->alignment = size = sizeof(double);
2604 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2606 if(_class && _class->type == 1)
2608 ComputeClassMembers(_class, 0x0);
2609 type->alignment = _class->structAlignment;
2610 size = _class->structSize;
2611 if(type->alignment && size % type->alignment)
2612 size += type->alignment - (size % type->alignment);
2614 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2616 if(!_class->dataType)
2617 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2618 size = type->alignment = ComputeTypeSize(_class->dataType);
2621 size = type->alignment = targetBits / 8;
2626 size = type->alignment = targetBits / 8;
2629 if(type->arraySizeExp)
2631 ProcessExpressionType(type->arraySizeExp);
2632 ComputeExpression(type->arraySizeExp);
2633 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)))
2635 struct Location oldLoc = yylloc;
2636 char expression[10240];
2638 expression[0] = '\0';
2639 type->arraySizeExp->expType = (((void *)0));
2640 yylloc = type->arraySizeExp->loc;
2642 PrintExpression(type->arraySizeExp, expression);
2643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2646 GetInt(type->arraySizeExp, &type->arraySize);
2648 else if(type->enumClass)
2650 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2652 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2655 type->arraySize = 0;
2659 type->arraySize = 0;
2661 size = ComputeTypeSize(type->type) * type->arraySize;
2663 type->alignment = type->type->alignment;
2667 struct Type * member;
2669 for(member = type->members.first; member; member = member->next)
2671 int __simpleStruct0, __simpleStruct1;
2672 unsigned int addSize = ComputeTypeSize(member);
2674 member->offset = size;
2675 if(member->alignment && size % member->alignment)
2676 member->offset += member->alignment - (size % member->alignment);
2677 size = member->offset;
2678 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2681 if(type->alignment && size % type->alignment)
2682 size += type->alignment - (size % type->alignment);
2687 struct Type * member;
2689 for(member = type->members.first; member; member = member->next)
2691 int __simpleStruct0, __simpleStruct1;
2692 unsigned int addSize = ComputeTypeSize(member);
2694 member->offset = size;
2695 if(member->alignment && size % member->alignment)
2696 member->offset += member->alignment - (size % member->alignment);
2697 size = member->offset;
2698 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2699 size = ((size > addSize) ? size : addSize);
2701 if(type->alignment && size % type->alignment)
2702 size += type->alignment - (size % type->alignment);
2707 struct TemplateParameter * param = type->templateParameter;
2708 struct Type * baseType = ProcessTemplateParameterType(param);
2712 size = ComputeTypeSize(baseType);
2713 type->alignment = baseType->alignment;
2716 type->alignment = size = sizeof(uint64);
2721 type->alignment = size = sizeof(enum
2729 type->alignment = size = targetBits / 8;
2734 type->computing = 0x0;
2739 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2741 extern struct Identifier * MkIdentifier(char * string);
2743 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2745 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2747 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2749 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2751 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2753 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2755 extern void FreeType(struct Type * type);
2757 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2759 extern struct Specifier * MkSpecifier(int specifier);
2761 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2763 extern struct Expression * MkExpConstant(char * string);
2765 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)
2767 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2768 unsigned int totalSize = 0;
2769 unsigned int maxSize = 0;
2770 int alignment, size;
2771 struct __ecereNameSpace__ecere__com__DataMember * member;
2772 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2775 *addedPadding = 0x0;
2776 if(!isMember && _class->base)
2778 maxSize = _class->structSize;
2780 if(_class->type == 1 || _class->type == 5)
2781 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2784 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2786 if(maxSize > baseSize)
2787 maxSize -= baseSize;
2793 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2795 if(!member->isProperty)
2797 switch(member->type)
2801 if(member->dataTypeString)
2803 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2804 struct Declarator * decl;
2806 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2807 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2808 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2809 if(!member->dataType)
2810 member->dataType = ProcessType(specs, decl);
2811 ReplaceThisClassSpecifiers(specs, topClass);
2813 struct Type * type = ProcessType(specs, decl);
2815 DeclareType(member->dataType, 0x0, 0x0);
2818 ComputeTypeSize(member->dataType);
2819 size = member->dataType->size;
2820 alignment = member->dataType->alignment;
2823 if(totalSize % alignment)
2824 totalSize += alignment - (totalSize % alignment);
2833 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2836 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2837 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2838 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2839 alignment = member->structAlignment;
2842 if(totalSize % alignment)
2843 totalSize += alignment - (totalSize % alignment);
2853 unsigned int __simpleStruct0;
2855 if(topMember && topMember->type == 1)
2856 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2858 *retSize += totalSize;
2860 else if(totalSize < maxSize && _class->type != 1000)
2862 int autoPadding = 0;
2864 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2865 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2866 if(totalSize + autoPadding < maxSize)
2868 char sizeString[50];
2870 sprintf(sizeString, "%d", maxSize - totalSize);
2871 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2873 *addedPadding = 0x1;
2877 FinishTemplatesContext(context);
2878 return topMember ? topMember->memberID : _class->memberID;
2881 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2883 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2884 unsigned int totalSize = 0;
2885 struct __ecereNameSpace__ecere__com__DataMember * member;
2886 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2888 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2889 DeclareMembers(_class->base, 0x0);
2890 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2892 if(!member->isProperty)
2894 switch(member->type)
2898 if(!member->dataType && member->dataTypeString)
2899 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2900 if(member->dataType)
2901 DeclareType(member->dataType, 0x0, 0x0);
2907 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2914 FinishTemplatesContext(context);
2915 return topMember ? topMember->memberID : _class->memberID;
2918 extern struct Symbol * FindClass(char * name);
2920 extern char * strchr(const char * , int);
2922 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2924 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2926 extern void FreeClassDef(struct ClassDef * def);
2928 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2930 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2932 extern char * strcpy(char * , const char * );
2934 extern void MangleClassName(char * className);
2936 extern void DeclareClass(struct Symbol * classSym, char * className);
2938 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2940 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2942 void DeclareStruct(char * name, unsigned int skipNoHead)
2944 struct External * external = (((void *)0));
2945 struct Symbol * classSym = FindClass(name);
2947 if(!inCompiler || !classSym)
2949 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2951 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2953 struct Declaration * decl;
2954 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2955 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2956 char structName[1024];
2958 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2959 classSym->declaring++;
2960 if(strchr(classSym->string, '<'))
2962 if(classSym->registered->templateClass)
2964 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2965 classSym->declaring--;
2969 DeclareMembers(classSym->registered, 0x0);
2970 structName[0] = (char)0;
2971 FullClassNameCat(structName, name, 0x0);
2974 unsigned int addedPadding = 0x0;
2976 classSym->declaredStructSym = 0x1;
2977 declarations = MkList();
2978 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2979 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2981 FreeList(declarations, FreeClassDef);
2982 declarations = (((void *)0));
2985 if(skipNoHead || declarations)
2987 if(external && external->declaration)
2989 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2990 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2992 if(classSym->structExternal)
2993 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2995 classSym->id = curExternal->symbol->idCode;
2996 classSym->idCode = curExternal->symbol->idCode;
3002 external = MkExternalDeclaration((((void *)0)));
3003 specifiers = MkList();
3004 declarators = MkList();
3005 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3006 external->declaration = decl = MkDeclaration(specifiers, declarators);
3007 if(decl->symbol && !decl->symbol->pointerExternal)
3008 decl->symbol->pointerExternal = external;
3009 if(classSym->registered && classSym->registered->type == 1)
3011 char className[1024];
3013 strcpy(className, "__ecereClass_");
3014 FullClassNameCat(className, classSym->string, 0x1);
3015 MangleClassName(className);
3016 DeclareClass(classSym, className);
3017 external->symbol = classSym;
3018 classSym->pointerExternal = external;
3019 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3020 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3024 char className[1024];
3026 strcpy(className, "__ecereClass_");
3027 FullClassNameCat(className, classSym->string, 0x1);
3028 MangleClassName(className);
3029 classSym->structExternal = external;
3030 DeclareClass(classSym, className);
3031 external->symbol = classSym;
3033 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3036 classSym->declaring--;
3038 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3040 classSym->declaring++;
3042 if(classSym->registered)
3043 DeclareMembers(classSym->registered, 0x0);
3045 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3047 if(classSym->structExternal)
3048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3050 classSym->id = curExternal->symbol->idCode;
3051 classSym->idCode = curExternal->symbol->idCode;
3053 classSym->declaring--;
3057 extern char * strcat(char * , const char * );
3059 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3061 extern struct ModuleImport * mainModule;
3063 extern struct Specifier * MkSpecifierName(char * name);
3065 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3067 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3069 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3071 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3073 extern void FreeDeclarator(struct Declarator * decl);
3075 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3077 struct PropertyImport
3079 struct PropertyImport * prev;
3080 struct PropertyImport * next;
3082 unsigned int isVirtual;
3083 unsigned int hasSet;
3084 unsigned int hasGet;
3085 } __attribute__ ((gcc_struct));
3087 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3089 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3091 struct Symbol * symbol = prop->symbol;
3092 char propName[1024];
3094 strcpy(setName, "__ecereProp_");
3095 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3096 strcat(setName, "_Set_");
3097 FullClassNameCat(setName, prop->name, 0x1);
3098 strcpy(getName, "__ecereProp_");
3099 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3100 strcat(getName, "_Get_");
3101 FullClassNameCat(getName, prop->name, 0x1);
3102 strcpy(propName, "__ecereProp_");
3103 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3104 strcat(propName, "_");
3105 FullClassNameCat(propName, prop->name, 0x1);
3106 MangleClassName(getName);
3107 MangleClassName(setName);
3108 MangleClassName(propName);
3109 if(prop->_class->type == 1)
3110 DeclareStruct(prop->_class->fullName, 0x0);
3111 if(!symbol || curExternal->symbol->idCode < symbol->id)
3113 unsigned int imported = 0x0;
3114 unsigned int dllImport = 0x0;
3116 if(!symbol || symbol->_import)
3120 struct Symbol * classSym;
3122 if(!prop->_class->symbol)
3123 prop->_class->symbol = FindClass(prop->_class->fullName);
3124 classSym = prop->_class->symbol;
3125 if(classSym && !classSym->_import)
3127 struct ModuleImport * module;
3129 if(prop->_class->module)
3130 module = FindModule(prop->_class->module);
3132 module = mainModule;
3133 classSym->_import = __extension__ ({
3134 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3136 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3140 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3141 symbol->_import = (struct ClassImport *)__extension__ ({
3142 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3144 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3150 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3155 struct Context * context = SetupTemplatesContext(prop->_class);
3157 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3158 FinishTemplatesContext(context);
3162 if(!symbol->externalGet || symbol->externalGet->type == 0)
3164 struct Declaration * decl;
3165 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3166 struct Declarator * d;
3167 struct __ecereNameSpace__ecere__sys__OldList * params;
3168 struct Specifier * spec;
3169 struct External * external;
3170 struct Declarator * typeDecl;
3171 unsigned int simple = 0x0;
3173 specifiers = MkList();
3174 declarators = MkList();
3176 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3177 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3179 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3181 struct Context * context = SetupTemplatesContext(prop->_class);
3183 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3184 FinishTemplatesContext(context);
3186 for(spec = (*specifiers).first; spec; spec = spec->next)
3190 if((!typeDecl || typeDecl->type == 1))
3192 struct Symbol * classSym = spec->symbol;
3194 symbol->_class = classSym->registered;
3195 if(classSym->registered && classSym->registered->type == 1)
3197 DeclareStruct(spec->name, 0x0);
3204 d = PlugDeclarator(typeDecl, d);
3207 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3208 specifiers = MkList();
3210 d = MkDeclaratorFunction(d, params);
3212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3213 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3214 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3216 ListAdd(specifiers, MkSpecifier(VOID));
3217 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3218 decl = MkDeclaration(specifiers, declarators);
3219 external = MkExternalDeclaration(decl);
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3221 external->symbol = symbol;
3222 symbol->externalGet = external;
3223 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3225 FreeDeclarator(typeDecl);
3229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3234 if(!symbol->externalSet || symbol->externalSet->type == 0)
3236 struct Declaration * decl;
3237 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3238 struct Declarator * d;
3239 struct __ecereNameSpace__ecere__sys__OldList * params;
3240 struct Specifier * spec;
3241 struct External * external;
3242 struct Declarator * typeDecl;
3244 declarators = MkList();
3246 if(!prop->conversion || prop->_class->type == 1)
3248 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3250 specifiers = MkList();
3252 struct Context * context = SetupTemplatesContext(prop->_class);
3254 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3255 FinishTemplatesContext(context);
3257 ListAdd(params, MkTypeName(specifiers, d));
3258 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3260 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3261 d = MkDeclaratorFunction(d, params);
3262 for(spec = (*specifiers).first; spec; spec = spec->next)
3266 if((!typeDecl || typeDecl->type == 1))
3268 struct Symbol * classSym = spec->symbol;
3270 symbol->_class = classSym->registered;
3271 if(classSym->registered && classSym->registered->type == 1)
3272 DeclareStruct(spec->name, 0x0);
3276 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3277 specifiers = MkList();
3279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3280 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3282 if(!prop->conversion || prop->_class->type == 1)
3283 ListAdd(specifiers, MkSpecifier(VOID));
3285 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3286 decl = MkDeclaration(specifiers, declarators);
3287 external = MkExternalDeclaration(decl);
3288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3289 external->symbol = symbol;
3290 symbol->externalSet = external;
3291 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3298 if(!symbol->externalPtr)
3300 struct Declaration * decl;
3301 struct External * external;
3302 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3308 ListAdd(specifiers, MkSpecifierName("Property"));
3310 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3312 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3315 strcpy(propName, "__ecerePropM_");
3316 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3317 strcat(propName, "_");
3318 FullClassNameCat(propName, prop->name, 0x1);
3319 MangleClassName(propName);
3320 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3322 decl = MkDeclaration(specifiers, list);
3324 external = MkExternalDeclaration(decl);
3325 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3326 external->symbol = symbol;
3327 symbol->externalPtr = external;
3331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3333 symbol->id = curExternal->symbol->idCode;
3337 struct Type * Dereference(struct Type * source)
3339 struct Type * type = (((void *)0));
3343 if(source->kind == 13 || source->kind == 12)
3345 type = source->type;
3346 source->type->refCount++;
3348 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3350 type = __extension__ ({
3351 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3353 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3356 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3362 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3367 static struct Type * Reference(struct Type * source)
3369 struct Type * type = (((void *)0));
3373 type = __extension__ ({
3374 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3376 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3383 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);
3385 extern void * memcpy(void * , const void * , size_t size);
3387 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3389 extern void FreeExpression(struct Expression * exp);
3391 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3393 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);
3395 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3397 extern struct Type * MkClassType(char * name);
3399 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);
3401 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)
3403 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3404 unsigned int found = 0x0;
3405 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3406 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3407 unsigned int freeType = 0x0;
3409 yylloc = member->loc;
3414 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3418 dataMember = *curMember;
3424 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3425 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3426 int _subMemberStackPos = 0;
3429 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3432 dataMember = thisMember;
3433 if(curMember && thisMember->memberAccess == 1)
3435 *curMember = thisMember;
3436 *curClass = thisMember->_class;
3437 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3438 *subMemberStackPos = _subMemberStackPos;
3444 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3445 if(method && method->type == 1)
3448 method = (((void *)0));
3453 struct Type * type = (((void *)0));
3457 if(!dataMember->dataType && dataMember->dataTypeString)
3459 struct Context * context = SetupTemplatesContext(_class);
3461 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3462 FinishTemplatesContext(context);
3464 type = dataMember->dataType;
3468 if(!method->dataType)
3469 ProcessMethodType(method);
3470 type = method->dataType;
3472 if(ident && ident->next)
3474 for(ident = ident->next; ident && type; ident = ident->next)
3478 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3480 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3482 type = dataMember->dataType;
3484 else if(type->kind == 9 || type->kind == 10)
3486 struct Type * memberType;
3488 for(memberType = type->members.first; memberType; memberType = memberType->next)
3490 if(!strcmp(memberType->name, ident->string))
3499 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3502 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3503 struct __ecereNameSpace__ecere__com__Class * sClass;
3505 for(sClass = _class; sClass; sClass = sClass->base)
3508 if(sClass->templateClass)
3509 sClass = sClass->templateClass;
3510 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3512 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3514 for(sClass = sClass->base; sClass; sClass = sClass->base)
3516 if(sClass->templateClass)
3517 sClass = sClass->templateClass;
3518 id += sClass->templateParams.count;
3529 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3531 if(arg.dataTypeString)
3533 type = ProcessTypeString(arg.dataTypeString, 0x0);
3535 if(type && _class->templateClass)
3536 type->passAsTemplate = 0x1;
3543 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3545 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3546 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3550 char templateString[1024];
3551 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3553 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3554 for(cClass = expClass; cClass; cClass = cClass->base)
3558 if(cClass->templateClass)
3559 cClass = cClass->templateClass;
3560 for(param = cClass->templateParams.first; param; param = param->next)
3563 struct __ecereNameSpace__ecere__com__Class * sClass;
3564 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3566 for(sClass = cClass->base; sClass; sClass = sClass->base)
3568 if(sClass->templateClass)
3569 sClass = sClass->templateClass;
3570 id += sClass->templateParams.count;
3572 arg = expClass->templateArgs[id];
3573 for(sClass = _class; sClass; sClass = sClass->base)
3575 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3577 struct __ecereNameSpace__ecere__com__Class * nextClass;
3579 if(sClass->templateClass)
3580 sClass = sClass->templateClass;
3581 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3583 if(nextClass->templateClass)
3584 nextClass = nextClass->templateClass;
3585 p += nextClass->templateParams.count;
3587 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3589 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3591 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3593 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3594 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3608 char expString[1024];
3609 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3610 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3611 struct Expression * exp;
3612 char * string = PrintHexUInt64(arg.expression.ui64);
3614 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3615 ProcessExpressionType(exp);
3616 ComputeExpression(exp);
3617 expString[0] = '\0';
3618 PrintExpression(exp, expString);
3619 strcat(argument, expString);
3620 FreeExpression(exp);
3625 strcat(argument, arg.member->name);
3630 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3631 strcat(argument, arg.dataTypeString);
3638 strcat(templateString, ", ");
3639 if(lastParam != p - 1)
3641 strcat(templateString, param->name);
3642 strcat(templateString, " = ");
3644 strcat(templateString, argument);
3653 int len = strlen(templateString);
3655 if(templateString[len - 1] == '<')
3659 if(templateString[len - 1] == '>')
3660 templateString[len++] = ' ';
3661 templateString[len++] = '>';
3663 templateString[len++] = '\0';
3666 struct Context * context = SetupTemplatesContext(_class);
3670 type = ProcessTypeString(templateString, 0x0);
3672 FinishTemplatesContext(context);
3675 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3677 ProcessExpressionType(member->initializer->exp);
3678 if(!member->initializer->exp->expType)
3682 char expString[10240];
3684 expString[0] = '\0';
3685 PrintExpression(member->initializer->exp, expString);
3686 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3687 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3690 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3695 else if(member->initializer)
3697 ProcessInitializer(member->initializer, type);
3704 if(_class && _class->type == 3)
3706 if(member->initializer)
3708 struct Type * type = MkClassType(_class->fullName);
3710 ProcessInitializer(member->initializer, type);
3716 if(member->initializer)
3718 ProcessInitializer(member->initializer, (((void *)0)));
3724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3730 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3734 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3739 extern struct Identifier * GetDeclId(struct Declarator * decl);
3741 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);
3743 extern void FreeSpecifier(struct Specifier * spec);
3745 static void ProcessFunction(struct FunctionDefinition * function);
3747 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3749 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3751 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3753 extern void FreeClassFunction(struct ClassFunction * func);
3755 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3757 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3759 void ProcessInstantiationType(struct Instantiation * inst)
3764 struct MembersInit * members;
3765 struct Symbol * classSym;
3766 struct __ecereNameSpace__ecere__com__Class * _class;
3768 classSym = inst->_class->symbol;
3769 _class = classSym ? classSym->registered : (((void *)0));
3770 if(!_class || _class->type != 5)
3771 DeclareStruct(inst->_class->name, 0x0);
3772 afterExternal = afterExternal ? afterExternal : curExternal;
3774 ProcessExpressionType(inst->exp);
3775 inst->isConstant = 0x1;
3778 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3779 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3780 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3781 int subMemberStackPos = 0;
3783 for(members = (*inst->members).first; members; members = members->next)
3785 switch(members->type)
3790 static unsigned int instMethodID = 0;
3791 struct External * external = curExternal;
3792 struct Context * context = curContext;
3793 struct Declarator * declarator = members->function->declarator;
3794 struct Identifier * nameID = GetDeclId(declarator);
3795 char * unmangled = nameID ? nameID->string : (((void *)0));
3796 struct Expression * exp;
3797 struct External * createdExternal = (((void *)0));
3803 strcpy(name, "__ecereInstMeth_");
3804 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3806 strcat(name, nameID->string);
3808 sprintf(number, "_%08d", instMethodID++);
3809 strcat(name, number);
3810 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3814 struct Symbol * symbol = declarator->symbol;
3815 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3817 if(method && method->type == 1)
3819 symbol->method = method;
3820 ProcessMethodType(method);
3821 if(!symbol->type->thisClass)
3823 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3825 if(!currentClass->symbol)
3826 currentClass->symbol = FindClass(currentClass->fullName);
3827 symbol->type->thisClass = currentClass->symbol;
3832 _class->symbol = FindClass(_class->fullName);
3833 symbol->type->thisClass = _class->symbol;
3836 DeclareType(symbol->type, 0x1, 0x1);
3840 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3843 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3846 FreeSpecifier(nameID->_class);
3847 nameID->_class = (((void *)0));
3851 struct Type * type = declarator->symbol->type;
3852 struct External * oldExternal = curExternal;
3854 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3856 struct External * externalDecl;
3858 externalDecl = MkExternalDeclaration((((void *)0)));
3859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3860 if(createdExternal->function)
3862 ProcessFunction(createdExternal->function);
3864 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3866 externalDecl->declaration = decl;
3867 if(decl->symbol && !decl->symbol->pointerExternal)
3868 decl->symbol->pointerExternal = externalDecl;
3869 declarator->symbol->pointerExternal = externalDecl;
3876 curExternal = declarator->symbol->pointerExternal;
3877 ProcessFunction((struct FunctionDefinition *)members->function);
3879 curExternal = external;
3880 curContext = context;
3883 FreeClassFunction(members->function);
3884 exp = QMkExpId(name);
3886 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3887 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3893 if(members->dataMembers && classSym)
3895 struct MemberInit * member;
3896 struct Location oldyyloc = yylloc;
3898 for(member = (*members->dataMembers).first; member; member = member->next)
3900 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3901 if(member->initializer && !member->initializer->isConstant)
3902 inst->isConstant = 0x0;
3914 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3918 if(type->kind == 11)
3920 struct Type * param;
3924 for(param = type->params.first; param; param = param->next)
3925 DeclareType(param, declarePointers, 0x1);
3927 DeclareType(type->returnType, declarePointers, 0x1);
3929 else if(type->kind == 13 && declarePointers)
3930 DeclareType(type->type, declarePointers, 0x0);
3931 else if(type->kind == 8)
3933 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3934 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3936 else if(type->kind == 9 || type->kind == 10)
3938 struct Type * member;
3940 for(member = type->members.first; member; member = member->next)
3941 DeclareType(member, 0x0, 0x0);
3943 else if(type->kind == 12)
3944 DeclareType(type->arrayType, declarePointers, 0x0);
3948 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3950 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3952 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3954 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3955 struct __ecereNameSpace__ecere__com__Class * sClass;
3957 for(sClass = _class; sClass; sClass = sClass->base)
3960 if(sClass->templateClass)
3961 sClass = sClass->templateClass;
3962 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3964 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3966 for(sClass = sClass->base; sClass; sClass = sClass->base)
3968 if(sClass->templateClass)
3969 sClass = sClass->templateClass;
3970 id += sClass->templateParams.count;
3981 arg = &_class->templateArgs[id];
3982 if(arg && param->type == 0)
3983 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3988 extern struct Context * PushContext(void);
3990 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3992 struct TemplatedType
3995 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3996 struct __ecereNameSpace__ecere__sys__BTNode * left;
3997 struct __ecereNameSpace__ecere__sys__BTNode * right;
3999 struct TemplateParameter * param;
4000 } __attribute__ ((gcc_struct));
4002 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4004 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4006 struct Context * context = PushContext();
4008 context->templateTypesOnly = 0x1;
4009 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4011 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4013 for(; param; param = param->next)
4015 if(param->type == 0 && param->identifier)
4017 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4019 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4025 struct __ecereNameSpace__ecere__com__Class * sClass;
4027 for(sClass = _class; sClass; sClass = sClass->base)
4029 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4031 for(p = sClass->templateParams.first; p; p = p->next)
4035 struct TemplateParameter * param = p->param;
4036 struct TemplatedType * type;
4040 p->param = param = __extension__ ({
4041 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4043 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4046 type = __extension__ ({
4047 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4049 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4051 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4059 extern void PopContext(struct Context * ctx);
4061 extern void FreeContext(struct Context * context);
4063 void FinishTemplatesContext(struct Context * context)
4065 PopContext(context);
4066 FreeContext(context);
4067 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4070 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4072 if(!method->dataType)
4074 struct Context * context = SetupTemplatesContext(method->_class);
4076 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4077 FinishTemplatesContext(context);
4078 if(method->type != 1 && method->dataType)
4080 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4082 if(!method->_class->symbol)
4083 method->_class->symbol = FindClass(method->_class->fullName);
4084 method->dataType->thisClass = method->_class->symbol;
4090 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4094 struct Context * context = SetupTemplatesContext(prop->_class);
4096 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4097 FinishTemplatesContext(context);
4101 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4103 extern void FreeTypeName(struct TypeName * typeName);
4105 static void ProcessDeclarator(struct Declarator * decl);
4107 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4109 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4113 struct MethodImport * prev;
4114 struct MethodImport * next;
4116 unsigned int isVirtual;
4117 } __attribute__ ((gcc_struct));
4119 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4121 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4123 struct Symbol * symbol = method->symbol;
4125 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4127 unsigned int imported = 0x0;
4128 unsigned int dllImport = 0x0;
4130 if(!method->dataType)
4131 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4132 if(!symbol || symbol->_import || method->type == 1)
4134 if(!symbol || method->type == 1)
4136 struct Symbol * classSym;
4138 if(!method->_class->symbol)
4139 method->_class->symbol = FindClass(method->_class->fullName);
4140 classSym = method->_class->symbol;
4141 if(!classSym->_import)
4143 struct ModuleImport * module;
4145 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4146 module = FindModule(method->_class->module);
4148 module = mainModule;
4149 classSym->_import = __extension__ ({
4150 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4152 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4158 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4160 if(!symbol->_import)
4162 symbol->_import = (struct ClassImport *)__extension__ ({
4163 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4165 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4171 symbol->type = method->dataType;
4173 symbol->type->refCount++;
4176 if(!method->dataType->dllExport)
4179 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4183 if(method->type != 1 && method->dataType)
4184 DeclareType(method->dataType, 0x1, 0x1);
4185 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4187 struct Declaration * decl;
4188 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4189 struct Declarator * d;
4190 struct Declarator * funcDecl;
4191 struct External * external;
4193 specifiers = MkList();
4194 declarators = MkList();
4196 ListAdd(specifiers, MkSpecifier(EXTERN));
4197 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4198 ListAdd(specifiers, MkSpecifier(STATIC));
4199 if(method->type == 1)
4201 ListAdd(specifiers, MkSpecifier(INT));
4202 d = MkDeclaratorIdentifier(MkIdentifier(name));
4206 d = MkDeclaratorIdentifier(MkIdentifier(name));
4208 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4210 struct Context * context = SetupTemplatesContext(method->_class);
4212 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4213 FinishTemplatesContext(context);
4215 funcDecl = GetFuncDecl(d);
4218 struct Specifier * spec, * next;
4220 for(spec = (*specifiers).first; spec; spec = next)
4225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4226 FreeSpecifier(spec);
4230 if(method->dataType && !method->dataType->staticMethod)
4232 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4234 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4235 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")));
4236 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4237 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4239 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4241 struct TypeName * param = (*funcDecl->function.parameters).first;
4243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4244 FreeTypeName(param);
4246 if(!funcDecl->function.parameters)
4247 funcDecl->function.parameters = MkList();
4248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4252 ProcessDeclarator(d);
4253 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4254 decl = MkDeclaration(specifiers, declarators);
4255 ReplaceThisClassSpecifiers(specifiers, method->_class);
4256 if(symbol->pointerExternal)
4258 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4261 *functionSymbol = *symbol;
4262 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4263 if(functionSymbol->type)
4264 functionSymbol->type->refCount++;
4266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4267 symbol->pointerExternal->symbol = functionSymbol;
4269 external = MkExternalDeclaration(decl);
4271 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4272 external->symbol = symbol;
4273 symbol->pointerExternal = external;
4277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4279 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4283 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4285 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4287 unsigned int first = 0x1;
4289 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4291 char className[1024];
4293 strcpy(className, _class->fullName);
4294 for(param = _class->templateParams.first; param; param = param->next)
4298 strcat(className, "<");
4300 strcat(className, ", ");
4301 if(lastParam + 1 != p)
4303 strcat(className, param->name);
4304 strcat(className, " = ");
4306 strcat(className, param->name);
4314 int len = strlen(className);
4316 if(className[len - 1] == '>')
4317 className[len++] = ' ';
4318 className[len++] = '>';
4319 className[len++] = '\0';
4321 return __ecereNameSpace__ecere__sys__CopyString(className);
4324 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4327 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4329 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4331 unsigned int first = 0x1;
4333 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4335 char className[1024];
4337 strcpy(className, _class->fullName);
4338 for(param = _class->templateParams.first; param; param = param->next)
4342 strcat(className, "<");
4344 strcat(className, ", ");
4345 if(lastParam + 1 != p)
4347 strcat(className, param->name);
4348 strcat(className, " = ");
4350 strcat(className, param->name);
4358 int len = strlen(className);
4360 if(className[len - 1] == '>')
4361 className[len++] = ' ';
4362 className[len++] = '>';
4363 className[len++] = '\0';
4365 return MkClassType(className);
4369 return MkClassType(_class->fullName);
4373 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4375 if(specs != (((void *)0)) && _class)
4377 struct Specifier * spec;
4379 for(spec = specs->first; spec; spec = spec->next)
4381 if(spec->type == 0 && spec->specifier == THISCLASS)
4384 spec->name = ReplaceThisClass(_class);
4385 spec->symbol = FindClass(spec->name);
4391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4393 struct __ecereNameSpace__ecere__com__GlobalFunction
4395 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4396 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4399 struct __ecereNameSpace__ecere__com__Instance * module;
4400 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4401 char * dataTypeString;
4402 struct Type * dataType;
4404 } __attribute__ ((gcc_struct));
4406 extern struct Context * globalContext;
4408 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4410 struct FunctionImport
4412 struct FunctionImport * prev;
4413 struct FunctionImport * next;
4415 } __attribute__ ((gcc_struct));
4417 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4419 struct Symbol * symbol = function->symbol;
4421 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4423 unsigned int imported = 0x0;
4424 unsigned int dllImport = 0x0;
4426 if(!function->dataType)
4428 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4429 if(!function->dataType->thisClass)
4430 function->dataType->staticMethod = 0x1;
4436 struct ModuleImport * module = FindModule(function->module);
4438 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4441 if(!function->dataType->dllExport)
4443 symbol->_import = (struct ClassImport *)__extension__ ({
4444 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4446 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4452 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4453 if(!symbol->type->thisClass)
4454 symbol->type->staticMethod = 0x1;
4457 imported = symbol->_import ? 0x1 : 0x0;
4458 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4461 DeclareType(function->dataType, 0x1, 0x1);
4464 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4466 struct Declaration * decl;
4467 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4468 struct Declarator * d;
4469 struct Declarator * funcDecl;
4470 struct External * external;
4472 specifiers = MkList();
4473 declarators = MkList();
4474 ListAdd(specifiers, MkSpecifier(EXTERN));
4475 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4477 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4478 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4479 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4481 struct Specifier * spec;
4483 for(spec = (*specifiers).first; spec; spec = spec->next)
4484 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4486 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4487 FreeSpecifier(spec);
4491 funcDecl = GetFuncDecl(d);
4492 if(funcDecl && !funcDecl->function.parameters)
4494 funcDecl->function.parameters = MkList();
4495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4497 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4499 struct Context * oldCtx = curContext;
4501 curContext = globalContext;
4502 decl = MkDeclaration(specifiers, declarators);
4503 curContext = oldCtx;
4505 if(symbol->pointerExternal)
4507 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4510 *functionSymbol = *symbol;
4511 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4512 if(functionSymbol->type)
4513 functionSymbol->type->refCount++;
4515 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4516 symbol->pointerExternal->symbol = functionSymbol;
4518 external = MkExternalDeclaration(decl);
4520 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4521 external->symbol = symbol;
4522 symbol->pointerExternal = external;
4526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4529 symbol->id = curExternal->symbol->idCode;
4532 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4535 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4540 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4541 struct __ecereNameSpace__ecere__sys__BTNode * left;
4542 struct __ecereNameSpace__ecere__sys__BTNode * right;
4544 struct __ecereNameSpace__ecere__com__Instance * module;
4545 char * dataTypeString;
4546 struct Type * dataType;
4549 } __attribute__ ((gcc_struct));
4551 void DeclareGlobalData(struct GlobalData * data)
4553 struct Symbol * symbol = data->symbol;
4555 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4560 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4563 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4564 DeclareType(data->dataType, 0x1, 0x1);
4567 if(!symbol->pointerExternal)
4569 struct Declaration * decl;
4570 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4571 struct Declarator * d;
4572 struct External * external;
4574 specifiers = MkList();
4575 declarators = MkList();
4576 ListAdd(specifiers, MkSpecifier(EXTERN));
4577 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4578 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4579 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4580 decl = MkDeclaration(specifiers, declarators);
4581 external = MkExternalDeclaration(decl);
4583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4584 external->symbol = symbol;
4585 symbol->pointerExternal = external;
4589 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4592 symbol->id = curExternal->symbol->idCode;
4599 struct Conversion * prev, * next;
4600 struct __ecereNameSpace__ecere__com__Property * convert;
4602 struct Type * resultType;
4603 } __attribute__ ((gcc_struct));
4605 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4607 extern void Compiler_Warning(char * format, ...);
4609 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4611 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)
4615 if(source->kind == 20 && dest->kind != 20)
4617 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4622 if(dest->kind == 20 && source->kind != 20)
4624 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4629 if(dest->classObjectType == 2)
4631 if(source->classObjectType != 3)
4635 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4643 if(source->classObjectType == 3)
4645 if(dest->classObjectType == 3 && source->classObjectType != 2)
4648 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4650 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4653 if(dest->kind == 14 && source->kind != 0)
4655 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))
4657 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))
4659 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4661 if(source->_class->registered && source->_class->registered->type == 3)
4663 if(conversions != (((void *)0)))
4665 if(source->_class->registered == dest->_class->registered)
4670 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4672 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4674 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4676 if(sourceBase == destBase)
4680 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))
4684 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4686 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4693 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4697 if(source->kind == 8)
4699 struct __ecereNameSpace__ecere__com__Class * _class;
4701 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4703 struct __ecereNameSpace__ecere__com__Property * convert;
4705 for(convert = _class->conversions.first; convert; convert = convert->next)
4707 if(convert->memberAccess == 1 || _class->module == privateModule)
4709 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4711 if(!convert->dataType)
4712 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4713 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4715 if(!conversions && !convert->Get)
4717 else if(conversions != (((void *)0)))
4719 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))
4723 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4736 struct __ecereNameSpace__ecere__com__Class * _class;
4738 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4740 struct __ecereNameSpace__ecere__com__Property * convert;
4742 for(convert = _class->conversions.first; convert; convert = convert->next)
4744 if(convert->memberAccess == 1 || _class->module == privateModule)
4746 if(!convert->dataType)
4747 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4748 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4750 if(!conversions && !convert->Set)
4752 else if(conversions != (((void *)0)))
4754 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))
4758 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4760 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4768 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4770 if(!dest->_class->registered->dataType)
4771 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4772 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4774 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4781 if(source->kind == 8)
4783 struct __ecereNameSpace__ecere__com__Class * _class;
4785 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4787 struct __ecereNameSpace__ecere__com__Property * convert;
4789 for(convert = _class->conversions.first; convert; convert = convert->next)
4791 if(convert->memberAccess == 1 || _class->module == privateModule)
4793 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4795 if(!convert->dataType)
4796 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4797 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4799 if(!conversions && !convert->Get)
4801 else if(conversions != (((void *)0)))
4803 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))
4807 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4817 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4819 if(!source->_class->registered->dataType)
4820 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4821 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4828 if(source->kind == 8 || source->kind == 19)
4830 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4832 else if(dest->kind == 7 && source->kind == 6)
4834 else if(dest->kind == 2 && source->kind == 1)
4836 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4838 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4840 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4842 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4844 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))
4846 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))
4848 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)))
4850 struct Type * paramSource, * paramDest;
4852 if(dest->kind == 16)
4853 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4854 if(source->kind == 16)
4855 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4856 if(dest->kind == 13 && dest->type->kind == 11)
4858 if(source->kind == 13 && source->type->kind == 11)
4859 source = source->type;
4860 if(dest->kind == 16)
4861 dest = dest->method->dataType;
4862 if(source->kind == 16)
4863 source = source->method->dataType;
4864 paramSource = source->params.first;
4865 if(paramSource && paramSource->kind == 0)
4866 paramSource = (((void *)0));
4867 paramDest = dest->params.first;
4868 if(paramDest && paramDest->kind == 0)
4869 paramDest = (((void *)0));
4870 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4872 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))))
4874 if(paramDest && paramDest->kind == 8)
4875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4877 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4880 paramDest = paramDest->next;
4882 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4884 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4888 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4890 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4896 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4905 paramSource = paramSource->next;
4911 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4919 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4927 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4929 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4932 for(; paramDest; paramDest = paramDest->next)
4936 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4940 struct Type * paramDestType = paramDest;
4941 struct Type * paramSourceType = paramSource;
4942 struct Type * type = paramDestType;
4944 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4947 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4948 struct __ecereNameSpace__ecere__com__Class * sClass;
4950 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4953 if(sClass->templateClass)
4954 sClass = sClass->templateClass;
4955 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4957 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4959 for(sClass = sClass->base; sClass; sClass = sClass->base)
4961 if(sClass->templateClass)
4962 sClass = sClass->templateClass;
4963 id += sClass->templateParams.count;
4974 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4976 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4979 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)))
4984 PrintType(paramDest, type, 0x0, 0x1);
4985 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4986 if(paramDestType != paramDest)
4987 FreeType(paramDestType);
4990 if(paramDestType != paramDest)
4991 FreeType(paramDestType);
4993 paramSource = paramSource->next;
4997 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5002 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5006 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5008 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5015 static void FreeConvert(struct Conversion * convert)
5017 if(convert->resultType)
5018 FreeType(convert->resultType);
5021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5023 struct __ecereNameSpace__ecere__com__BTNamedLink
5026 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5027 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5028 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5031 } __attribute__ ((gcc_struct));
5033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5035 struct __ecereNameSpace__ecere__com__EnumClassData
5037 struct __ecereNameSpace__ecere__sys__OldList values;
5039 } __attribute__ ((gcc_struct));
5041 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5043 struct __ecereNameSpace__ecere__sys__NamedLink
5045 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5046 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5049 } __attribute__ ((gcc_struct));
5051 extern void FreeExpContents(struct Expression * exp);
5053 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5055 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5057 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5059 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5061 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5063 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5065 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5067 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)))
5069 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5071 if(_class->type == 4)
5073 struct __ecereNameSpace__ecere__sys__OldList converts =
5077 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5081 _class->symbol = FindClass(_class->fullName);
5082 type->_class = _class->symbol;
5083 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5085 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5086 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5090 struct __ecereNameSpace__ecere__com__Class * baseClass;
5092 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5094 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5096 for(value = e->values.first; value; value = value->next)
5098 if(!strcmp(value->name, string))
5103 FreeExpContents(sourceExp);
5104 FreeType(sourceExp->expType);
5105 sourceExp->isConstant = 0x1;
5106 sourceExp->expType = MkClassType(baseClass->fullName);
5110 sourceExp->type = 2;
5111 if(!strcmp(baseClass->dataTypeString, "int"))
5112 sprintf(constant, "%d", (int)value->data);
5114 sprintf(constant, "0x%X", (int)value->data);
5115 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5117 while(converts.first)
5119 struct Conversion * convert = converts.first;
5121 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5124 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5132 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5135 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)))
5136 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5141 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5143 struct __ecereNameSpace__ecere__com__SubModule
5145 struct __ecereNameSpace__ecere__com__SubModule * prev;
5146 struct __ecereNameSpace__ecere__com__SubModule * next;
5147 struct __ecereNameSpace__ecere__com__Instance * module;
5149 } __attribute__ ((gcc_struct));
5151 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5153 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5155 if(searchFor == searchIn)
5157 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5159 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5161 if(ModuleVisibility(subModule->module, searchFor))
5168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5170 struct __ecereNameSpace__ecere__com__Application
5175 unsigned int isGUIApp;
5176 struct __ecereNameSpace__ecere__sys__OldList allModules;
5177 char * parsedCommand;
5178 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5179 } __attribute__ ((gcc_struct));
5181 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5183 struct __ecereNameSpace__ecere__com__Instance * module;
5185 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))
5187 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))
5189 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))
5191 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)
5193 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5199 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5201 void ReadString(char * output, char * string);
5203 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5205 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5207 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5209 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5211 struct Type * source = sourceExp->expType;
5212 struct Type * realDest = dest;
5213 struct Type * backupSourceExpType = (((void *)0));
5215 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5217 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5219 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5221 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5223 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5225 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5227 if(sourceBase == destBase)
5233 struct __ecereNameSpace__ecere__sys__OldList * specs;
5234 unsigned int flag = 0x0;
5235 long long value = (((int)0x7fffffff));
5239 if(sourceExp->type == 2)
5241 if(source->isSigned)
5242 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5244 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5246 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5248 if(source->isSigned)
5249 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5251 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5253 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5256 source = __extension__ ({
5257 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5259 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5264 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5266 if(_class && _class->type == 3)
5268 if(source->kind != 8)
5270 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5271 struct Type * tempDest, * tempSource;
5273 for(; _class->base->type != 1000; _class = _class->base)
5276 tempDest = tempType;
5279 _class->symbol = FindClass(_class->fullName);
5280 tempType->_class = _class->symbol;
5281 tempType->truth = dest->truth;
5282 if(tempType->_class)
5283 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5284 backupSourceExpType = sourceExp->expType;
5285 sourceExp->expType = dest;
5288 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5291 if(_class && _class->type == 2 && source->kind != 8)
5293 if(!dest->_class->registered->dataType)
5294 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5295 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5298 FreeType(sourceExp->expType);
5299 source = sourceExp->expType = MkClassType(dest->_class->string);
5303 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5305 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5306 struct Declarator * decl;
5309 ReadString(string, sourceExp->string);
5310 decl = SpecDeclFromString(string, specs, (((void *)0)));
5311 FreeExpContents(sourceExp);
5312 FreeType(sourceExp->expType);
5313 sourceExp->type = 26;
5314 sourceExp->_classExp.specifiers = specs;
5315 sourceExp->_classExp.decl = decl;
5316 sourceExp->expType = dest;
5320 if(backupSourceExpType)
5321 FreeType(backupSourceExpType);
5325 else if(source->kind == 8)
5327 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5329 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5333 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5334 struct Type * tempDest, * tempSource;
5336 if(!source->_class->registered->dataType)
5337 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5338 for(; _class->base->type != 1000; _class = _class->base)
5341 tempSource = tempType;
5343 tempType->_class = FindClass(_class->fullName);
5344 tempType->truth = source->truth;
5345 tempType->classObjectType = source->classObjectType;
5346 if(tempType->_class)
5347 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5348 if(conversions->last)
5350 ((struct Conversion *)conversions->last)->resultType = dest;
5353 FreeType(sourceExp->expType);
5354 sourceExp->expType = MkClassType(_class->fullName);
5355 sourceExp->expType->truth = source->truth;
5356 sourceExp->expType->classObjectType = source->classObjectType;
5357 if(!sourceExp->destType)
5359 FreeType(sourceExp->destType);
5360 sourceExp->destType = sourceExp->expType;
5361 if(sourceExp->expType)
5362 sourceExp->expType->refCount++;
5364 if(!_class->dataType)
5365 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5367 dest = MkClassType(source->_class->string);
5368 dest->truth = source->truth;
5369 dest->classObjectType = source->classObjectType;
5371 source = _class->dataType;
5373 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5379 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5388 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5390 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5392 if(_class->type == 0 || _class->type == 5)
5394 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5396 *newExp = *sourceExp;
5397 if(sourceExp->destType)
5398 sourceExp->destType->refCount++;
5399 if(sourceExp->expType)
5400 sourceExp->expType->refCount++;
5401 sourceExp->type = 11;
5402 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5403 sourceExp->cast.exp = newExp;
5404 FreeType(sourceExp->expType);
5405 sourceExp->expType = (((void *)0));
5406 ProcessExpressionType(sourceExp);
5409 FreeType(sourceExp->expType);
5410 sourceExp->expType = dest;
5415 if(backupSourceExpType)
5416 FreeType(backupSourceExpType);
5419 if(!_class->dataType)
5420 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5422 dest = _class->dataType;
5425 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5427 specs = MkListOne(MkSpecifier(DOUBLE));
5429 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5431 specs = MkListOne(MkSpecifier(FLOAT));
5433 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5437 ListAdd(specs, MkSpecifier(UNSIGNED));
5438 ListAdd(specs, MkSpecifier(INT64));
5440 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5444 ListAdd(specs, MkSpecifier(UNSIGNED));
5445 ListAdd(specs, MkSpecifier(INT));
5447 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5451 ListAdd(specs, MkSpecifier(UNSIGNED));
5452 ListAdd(specs, MkSpecifier(SHORT));
5454 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5458 ListAdd(specs, MkSpecifier(UNSIGNED));
5459 ListAdd(specs, MkSpecifier(CHAR));
5465 if(backupSourceExpType)
5467 if(sourceExp->expType)
5468 FreeType(sourceExp->expType);
5469 sourceExp->expType = backupSourceExpType;
5474 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))
5476 specs = MkListOne(MkSpecifier(DOUBLE));
5478 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5480 specs = MkListOne(MkSpecifier(FLOAT));
5482 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)))
5486 ListAdd(specs, MkSpecifier(UNSIGNED));
5487 ListAdd(specs, MkSpecifier(CHAR));
5489 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)))))
5493 ListAdd(specs, MkSpecifier(UNSIGNED));
5494 ListAdd(specs, MkSpecifier(SHORT));
5496 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5500 ListAdd(specs, MkSpecifier(UNSIGNED));
5501 ListAdd(specs, MkSpecifier(INT));
5503 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5507 ListAdd(specs, MkSpecifier(UNSIGNED));
5508 ListAdd(specs, MkSpecifier(INT64));
5510 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5512 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5518 if(backupSourceExpType)
5520 if(sourceExp->expType)
5521 FreeType(sourceExp->expType);
5522 sourceExp->expType = backupSourceExpType;
5528 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5530 *newExp = *sourceExp;
5531 newExp->prev = (((void *)0));
5532 newExp->next = (((void *)0));
5533 if(sourceExp->destType)
5534 sourceExp->destType->refCount++;
5535 if(sourceExp->expType)
5536 sourceExp->expType->refCount++;
5537 sourceExp->type = 11;
5538 if(realDest->kind == 8)
5540 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5541 FreeList(specs, FreeSpecifier);
5544 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5545 if(newExp->type == 4)
5547 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5550 sourceExp->cast.exp = newExp;
5551 FreeType(sourceExp->expType);
5552 sourceExp->expType = (((void *)0));
5553 ProcessExpressionType(sourceExp);
5556 FreeList(specs, FreeSpecifier);
5559 if(backupSourceExpType)
5560 FreeType(backupSourceExpType);
5565 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5566 sourceExp = (*sourceExp->list).last;
5567 if(sourceExp->type == 0)
5569 struct Identifier * id = sourceExp->identifier;
5573 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5575 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5576 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5580 for(; _class && _class->type == 4; _class = _class->base)
5582 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5583 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5585 for(value = e->values.first; value; value = value->next)
5587 if(!strcmp(value->name, id->string))
5592 FreeExpContents(sourceExp);
5593 FreeType(sourceExp->expType);
5594 sourceExp->isConstant = 0x1;
5595 sourceExp->expType = MkClassType(_class->fullName);
5599 sourceExp->type = 2;
5600 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5601 sprintf(constant, "%d", (int)value->data);
5603 sprintf(constant, "0x%X", (int)value->data);
5604 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5612 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5619 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5621 int value2 = op2->i;
5624 exp->string = PrintInt(op1->i + value2);
5627 exp->expType = op1->type;
5629 op1->type->refCount++;
5634 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5636 unsigned int value2 = op2->ui;
5639 exp->string = PrintUInt(op1->ui + value2);
5642 exp->expType = op1->type;
5644 op1->type->refCount++;
5649 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5651 short value2 = op2->s;
5654 exp->string = PrintShort(op1->s + value2);
5657 exp->expType = op1->type;
5659 op1->type->refCount++;
5664 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5666 unsigned short value2 = op2->us;
5669 exp->string = PrintUShort(op1->us + value2);
5672 exp->expType = op1->type;
5674 op1->type->refCount++;
5679 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5681 char value2 = op2->c;
5684 exp->string = PrintChar(op1->c + value2);
5687 exp->expType = op1->type;
5689 op1->type->refCount++;
5694 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5696 unsigned char value2 = op2->uc;
5699 exp->string = PrintUChar(op1->uc + value2);
5702 exp->expType = op1->type;
5704 op1->type->refCount++;
5709 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5711 float value2 = op2->f;
5714 exp->string = PrintFloat(op1->f + value2);
5717 exp->expType = op1->type;
5719 op1->type->refCount++;
5724 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5726 double value2 = op2->d;
5729 exp->string = PrintDouble(op1->d + value2);
5732 exp->expType = op1->type;
5734 op1->type->refCount++;
5739 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5741 int value2 = op2->i;
5744 exp->string = PrintInt(op1->i - value2);
5747 exp->expType = op1->type;
5749 op1->type->refCount++;
5754 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5756 unsigned int value2 = op2->ui;
5759 exp->string = PrintUInt(op1->ui - value2);
5762 exp->expType = op1->type;
5764 op1->type->refCount++;
5769 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5771 short value2 = op2->s;
5774 exp->string = PrintShort(op1->s - value2);
5777 exp->expType = op1->type;
5779 op1->type->refCount++;
5784 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5786 unsigned short value2 = op2->us;
5789 exp->string = PrintUShort(op1->us - value2);
5792 exp->expType = op1->type;
5794 op1->type->refCount++;
5799 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5801 char value2 = op2->c;
5804 exp->string = PrintChar(op1->c - value2);
5807 exp->expType = op1->type;
5809 op1->type->refCount++;
5814 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5816 unsigned char value2 = op2->uc;
5819 exp->string = PrintUChar(op1->uc - value2);
5822 exp->expType = op1->type;
5824 op1->type->refCount++;
5829 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5831 float value2 = op2->f;
5834 exp->string = PrintFloat(op1->f - value2);
5837 exp->expType = op1->type;
5839 op1->type->refCount++;
5844 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5846 double value2 = op2->d;
5849 exp->string = PrintDouble(op1->d - value2);
5852 exp->expType = op1->type;
5854 op1->type->refCount++;
5859 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5861 int value2 = op2->i;
5864 exp->string = PrintInt(op1->i * value2);
5867 exp->expType = op1->type;
5869 op1->type->refCount++;
5874 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5876 unsigned int value2 = op2->ui;
5879 exp->string = PrintUInt(op1->ui * value2);
5882 exp->expType = op1->type;
5884 op1->type->refCount++;
5889 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5891 short value2 = op2->s;
5894 exp->string = PrintShort(op1->s * value2);
5897 exp->expType = op1->type;
5899 op1->type->refCount++;
5904 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5906 unsigned short value2 = op2->us;
5909 exp->string = PrintUShort(op1->us * value2);
5912 exp->expType = op1->type;
5914 op1->type->refCount++;
5919 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5921 char value2 = op2->c;
5924 exp->string = PrintChar(op1->c * value2);
5927 exp->expType = op1->type;
5929 op1->type->refCount++;
5934 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5936 unsigned char value2 = op2->uc;
5939 exp->string = PrintUChar(op1->uc * value2);
5942 exp->expType = op1->type;
5944 op1->type->refCount++;
5949 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5951 float value2 = op2->f;
5954 exp->string = PrintFloat(op1->f * value2);
5957 exp->expType = op1->type;
5959 op1->type->refCount++;
5964 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5966 double value2 = op2->d;
5969 exp->string = PrintDouble(op1->d * value2);
5972 exp->expType = op1->type;
5974 op1->type->refCount++;
5979 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5981 int value2 = op2->i;
5984 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5987 exp->expType = op1->type;
5989 op1->type->refCount++;
5994 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5996 unsigned int value2 = op2->ui;
5999 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6002 exp->expType = op1->type;
6004 op1->type->refCount++;
6009 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6011 short value2 = op2->s;
6014 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6017 exp->expType = op1->type;
6019 op1->type->refCount++;
6024 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6026 unsigned short value2 = op2->us;
6029 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6032 exp->expType = op1->type;
6034 op1->type->refCount++;
6039 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6041 char value2 = op2->c;
6044 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6047 exp->expType = op1->type;
6049 op1->type->refCount++;
6054 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6056 unsigned char value2 = op2->uc;
6059 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6062 exp->expType = op1->type;
6064 op1->type->refCount++;
6069 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6071 float value2 = op2->f;
6074 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6077 exp->expType = op1->type;
6079 op1->type->refCount++;
6084 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6086 double value2 = op2->d;
6089 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6092 exp->expType = op1->type;
6094 op1->type->refCount++;
6099 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6101 int value2 = op2->i;
6104 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6107 exp->expType = op1->type;
6109 op1->type->refCount++;
6114 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6116 unsigned int value2 = op2->ui;
6119 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6122 exp->expType = op1->type;
6124 op1->type->refCount++;
6129 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6131 short value2 = op2->s;
6134 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6137 exp->expType = op1->type;
6139 op1->type->refCount++;
6144 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6146 unsigned short value2 = op2->us;
6149 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6152 exp->expType = op1->type;
6154 op1->type->refCount++;
6159 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6161 char value2 = op2->c;
6164 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6167 exp->expType = op1->type;
6169 op1->type->refCount++;
6174 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6176 unsigned char value2 = op2->uc;
6179 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6182 exp->expType = op1->type;
6184 op1->type->refCount++;
6189 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6192 exp->string = PrintInt(-op1->i);
6195 exp->expType = op1->type;
6197 op1->type->refCount++;
6202 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6205 exp->string = PrintUInt(-op1->ui);
6208 exp->expType = op1->type;
6210 op1->type->refCount++;
6215 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6218 exp->string = PrintShort(-op1->s);
6221 exp->expType = op1->type;
6223 op1->type->refCount++;
6228 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6231 exp->string = PrintUShort(-op1->us);
6234 exp->expType = op1->type;
6236 op1->type->refCount++;
6241 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6244 exp->string = PrintChar(-op1->c);
6247 exp->expType = op1->type;
6249 op1->type->refCount++;
6254 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6257 exp->string = PrintUChar(-op1->uc);
6260 exp->expType = op1->type;
6262 op1->type->refCount++;
6267 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6270 exp->string = PrintFloat(-op1->f);
6273 exp->expType = op1->type;
6275 op1->type->refCount++;
6280 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6283 exp->string = PrintDouble(-op1->d);
6286 exp->expType = op1->type;
6288 op1->type->refCount++;
6293 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6296 exp->string = PrintInt(++op1->i);
6299 exp->expType = op1->type;
6301 op1->type->refCount++;
6306 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6309 exp->string = PrintUInt(++op1->ui);
6312 exp->expType = op1->type;
6314 op1->type->refCount++;
6319 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6322 exp->string = PrintShort(++op1->s);
6325 exp->expType = op1->type;
6327 op1->type->refCount++;
6332 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6335 exp->string = PrintUShort(++op1->us);
6338 exp->expType = op1->type;
6340 op1->type->refCount++;
6345 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6348 exp->string = PrintChar(++op1->c);
6351 exp->expType = op1->type;
6353 op1->type->refCount++;
6358 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6361 exp->string = PrintUChar(++op1->uc);
6364 exp->expType = op1->type;
6366 op1->type->refCount++;
6371 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6374 exp->string = PrintFloat(++op1->f);
6377 exp->expType = op1->type;
6379 op1->type->refCount++;
6384 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6387 exp->string = PrintDouble(++op1->d);
6390 exp->expType = op1->type;
6392 op1->type->refCount++;
6397 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6400 exp->string = PrintInt(--op1->i);
6403 exp->expType = op1->type;
6405 op1->type->refCount++;
6410 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6413 exp->string = PrintUInt(--op1->ui);
6416 exp->expType = op1->type;
6418 op1->type->refCount++;
6423 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6426 exp->string = PrintShort(--op1->s);
6429 exp->expType = op1->type;
6431 op1->type->refCount++;
6436 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6439 exp->string = PrintUShort(--op1->us);
6442 exp->expType = op1->type;
6444 op1->type->refCount++;
6449 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6452 exp->string = PrintChar(--op1->c);
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6465 exp->string = PrintUChar(--op1->uc);
6468 exp->expType = op1->type;
6470 op1->type->refCount++;
6475 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6478 exp->string = PrintFloat(--op1->f);
6481 exp->expType = op1->type;
6483 op1->type->refCount++;
6488 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6491 exp->string = PrintDouble(--op1->d);
6494 exp->expType = op1->type;
6496 op1->type->refCount++;
6501 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6503 int value2 = op2->i;
6506 exp->string = PrintInt(op1->i = value2);
6509 exp->expType = op1->type;
6511 op1->type->refCount++;
6516 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6518 unsigned int value2 = op2->ui;
6521 exp->string = PrintUInt(op1->ui = value2);
6524 exp->expType = op1->type;
6526 op1->type->refCount++;
6531 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6533 short value2 = op2->s;
6536 exp->string = PrintShort(op1->s = value2);
6539 exp->expType = op1->type;
6541 op1->type->refCount++;
6546 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6548 unsigned short value2 = op2->us;
6551 exp->string = PrintUShort(op1->us = value2);
6554 exp->expType = op1->type;
6556 op1->type->refCount++;
6561 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6563 char value2 = op2->c;
6566 exp->string = PrintChar(op1->c = value2);
6569 exp->expType = op1->type;
6571 op1->type->refCount++;
6576 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6578 unsigned char value2 = op2->uc;
6581 exp->string = PrintUChar(op1->uc = value2);
6584 exp->expType = op1->type;
6586 op1->type->refCount++;
6591 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6593 float value2 = op2->f;
6596 exp->string = PrintFloat(op1->f = value2);
6599 exp->expType = op1->type;
6601 op1->type->refCount++;
6606 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6608 double value2 = op2->d;
6611 exp->string = PrintDouble(op1->d = value2);
6614 exp->expType = op1->type;
6616 op1->type->refCount++;
6621 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6623 int value2 = op2->i;
6626 exp->string = PrintInt(op1->i += value2);
6629 exp->expType = op1->type;
6631 op1->type->refCount++;
6636 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6638 unsigned int value2 = op2->ui;
6641 exp->string = PrintUInt(op1->ui += value2);
6644 exp->expType = op1->type;
6646 op1->type->refCount++;
6651 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6653 short value2 = op2->s;
6656 exp->string = PrintShort(op1->s += value2);
6659 exp->expType = op1->type;
6661 op1->type->refCount++;
6666 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6668 unsigned short value2 = op2->us;
6671 exp->string = PrintUShort(op1->us += value2);
6674 exp->expType = op1->type;
6676 op1->type->refCount++;
6681 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6683 char value2 = op2->c;
6686 exp->string = PrintChar(op1->c += value2);
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6698 unsigned char value2 = op2->uc;
6701 exp->string = PrintUChar(op1->uc += value2);
6704 exp->expType = op1->type;
6706 op1->type->refCount++;
6711 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6713 float value2 = op2->f;
6716 exp->string = PrintFloat(op1->f += value2);
6719 exp->expType = op1->type;
6721 op1->type->refCount++;
6726 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6728 double value2 = op2->d;
6731 exp->string = PrintDouble(op1->d += value2);
6734 exp->expType = op1->type;
6736 op1->type->refCount++;
6741 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6743 int value2 = op2->i;
6746 exp->string = PrintInt(op1->i -= value2);
6749 exp->expType = op1->type;
6751 op1->type->refCount++;
6756 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6758 unsigned int value2 = op2->ui;
6761 exp->string = PrintUInt(op1->ui -= value2);
6764 exp->expType = op1->type;
6766 op1->type->refCount++;
6771 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6773 short value2 = op2->s;
6776 exp->string = PrintShort(op1->s -= value2);
6779 exp->expType = op1->type;
6781 op1->type->refCount++;
6786 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6788 unsigned short value2 = op2->us;
6791 exp->string = PrintUShort(op1->us -= value2);
6794 exp->expType = op1->type;
6796 op1->type->refCount++;
6801 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6803 char value2 = op2->c;
6806 exp->string = PrintChar(op1->c -= value2);
6809 exp->expType = op1->type;
6811 op1->type->refCount++;
6816 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6818 unsigned char value2 = op2->uc;
6821 exp->string = PrintUChar(op1->uc -= value2);
6824 exp->expType = op1->type;
6826 op1->type->refCount++;
6831 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6833 float value2 = op2->f;
6836 exp->string = PrintFloat(op1->f -= value2);
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6848 double value2 = op2->d;
6851 exp->string = PrintDouble(op1->d -= value2);
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6863 int value2 = op2->i;
6866 exp->string = PrintInt(op1->i *= value2);
6869 exp->expType = op1->type;
6871 op1->type->refCount++;
6876 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6878 unsigned int value2 = op2->ui;
6881 exp->string = PrintUInt(op1->ui *= value2);
6884 exp->expType = op1->type;
6886 op1->type->refCount++;
6891 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6893 short value2 = op2->s;
6896 exp->string = PrintShort(op1->s *= value2);
6899 exp->expType = op1->type;
6901 op1->type->refCount++;
6906 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6908 unsigned short value2 = op2->us;
6911 exp->string = PrintUShort(op1->us *= value2);
6914 exp->expType = op1->type;
6916 op1->type->refCount++;
6921 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6923 char value2 = op2->c;
6926 exp->string = PrintChar(op1->c *= value2);
6929 exp->expType = op1->type;
6931 op1->type->refCount++;
6936 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6938 unsigned char value2 = op2->uc;
6941 exp->string = PrintUChar(op1->uc *= value2);
6944 exp->expType = op1->type;
6946 op1->type->refCount++;
6951 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6953 float value2 = op2->f;
6956 exp->string = PrintFloat(op1->f *= value2);
6959 exp->expType = op1->type;
6961 op1->type->refCount++;
6966 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6968 double value2 = op2->d;
6971 exp->string = PrintDouble(op1->d *= value2);
6974 exp->expType = op1->type;
6976 op1->type->refCount++;
6981 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6983 int value2 = op2->i;
6986 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6989 exp->expType = op1->type;
6991 op1->type->refCount++;
6996 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6998 unsigned int value2 = op2->ui;
7001 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7004 exp->expType = op1->type;
7006 op1->type->refCount++;
7011 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7013 short value2 = op2->s;
7016 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7019 exp->expType = op1->type;
7021 op1->type->refCount++;
7026 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7028 unsigned short value2 = op2->us;
7031 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7034 exp->expType = op1->type;
7036 op1->type->refCount++;
7041 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7043 char value2 = op2->c;
7046 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7049 exp->expType = op1->type;
7051 op1->type->refCount++;
7056 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7058 unsigned char value2 = op2->uc;
7061 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7064 exp->expType = op1->type;
7066 op1->type->refCount++;
7071 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7073 float value2 = op2->f;
7076 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7079 exp->expType = op1->type;
7081 op1->type->refCount++;
7086 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7088 double value2 = op2->d;
7091 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7094 exp->expType = op1->type;
7096 op1->type->refCount++;
7101 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7103 int value2 = op2->i;
7106 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7109 exp->expType = op1->type;
7111 op1->type->refCount++;
7116 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7118 unsigned int value2 = op2->ui;
7121 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7124 exp->expType = op1->type;
7126 op1->type->refCount++;
7131 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7133 short value2 = op2->s;
7136 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7139 exp->expType = op1->type;
7141 op1->type->refCount++;
7146 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7148 unsigned short value2 = op2->us;
7151 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7154 exp->expType = op1->type;
7156 op1->type->refCount++;
7161 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7163 char value2 = op2->c;
7166 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7169 exp->expType = op1->type;
7171 op1->type->refCount++;
7176 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7178 unsigned char value2 = op2->uc;
7181 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7184 exp->expType = op1->type;
7186 op1->type->refCount++;
7191 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7193 int value2 = op2->i;
7196 exp->string = PrintInt(op1->i & value2);
7199 exp->expType = op1->type;
7201 op1->type->refCount++;
7206 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7208 unsigned int value2 = op2->ui;
7211 exp->string = PrintUInt(op1->ui & value2);
7214 exp->expType = op1->type;
7216 op1->type->refCount++;
7221 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7223 short value2 = op2->s;
7226 exp->string = PrintShort(op1->s & value2);
7229 exp->expType = op1->type;
7231 op1->type->refCount++;
7236 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7238 unsigned short value2 = op2->us;
7241 exp->string = PrintUShort(op1->us & value2);
7244 exp->expType = op1->type;
7246 op1->type->refCount++;
7251 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7253 char value2 = op2->c;
7256 exp->string = PrintChar(op1->c & value2);
7259 exp->expType = op1->type;
7261 op1->type->refCount++;
7266 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7268 unsigned char value2 = op2->uc;
7271 exp->string = PrintUChar(op1->uc & value2);
7274 exp->expType = op1->type;
7276 op1->type->refCount++;
7281 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7283 int value2 = op2->i;
7286 exp->string = PrintInt(op1->i | value2);
7289 exp->expType = op1->type;
7291 op1->type->refCount++;
7296 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7298 unsigned int value2 = op2->ui;
7301 exp->string = PrintUInt(op1->ui | value2);
7304 exp->expType = op1->type;
7306 op1->type->refCount++;
7311 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7313 short value2 = op2->s;
7316 exp->string = PrintShort(op1->s | value2);
7319 exp->expType = op1->type;
7321 op1->type->refCount++;
7326 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7328 unsigned short value2 = op2->us;
7331 exp->string = PrintUShort(op1->us | value2);
7334 exp->expType = op1->type;
7336 op1->type->refCount++;
7341 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7343 char value2 = op2->c;
7346 exp->string = PrintChar(op1->c | value2);
7349 exp->expType = op1->type;
7351 op1->type->refCount++;
7356 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7358 unsigned char value2 = op2->uc;
7361 exp->string = PrintUChar(op1->uc | value2);
7364 exp->expType = op1->type;
7366 op1->type->refCount++;
7371 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7373 int value2 = op2->i;
7376 exp->string = PrintInt(op1->i ^ value2);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7388 unsigned int value2 = op2->ui;
7391 exp->string = PrintUInt(op1->ui ^ value2);
7394 exp->expType = op1->type;
7396 op1->type->refCount++;
7401 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7403 short value2 = op2->s;
7406 exp->string = PrintShort(op1->s ^ value2);
7409 exp->expType = op1->type;
7411 op1->type->refCount++;
7416 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7418 unsigned short value2 = op2->us;
7421 exp->string = PrintUShort(op1->us ^ value2);
7424 exp->expType = op1->type;
7426 op1->type->refCount++;
7431 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7433 char value2 = op2->c;
7436 exp->string = PrintChar(op1->c ^ value2);
7439 exp->expType = op1->type;
7441 op1->type->refCount++;
7446 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7448 unsigned char value2 = op2->uc;
7451 exp->string = PrintUChar(op1->uc ^ value2);
7454 exp->expType = op1->type;
7456 op1->type->refCount++;
7461 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7463 int value2 = op2->i;
7466 exp->string = PrintInt(op1->i << value2);
7469 exp->expType = op1->type;
7471 op1->type->refCount++;
7476 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7478 unsigned int value2 = op2->ui;
7481 exp->string = PrintUInt(op1->ui << value2);
7484 exp->expType = op1->type;
7486 op1->type->refCount++;
7491 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7493 short value2 = op2->s;
7496 exp->string = PrintShort(op1->s << value2);
7499 exp->expType = op1->type;
7501 op1->type->refCount++;
7506 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7508 unsigned short value2 = op2->us;
7511 exp->string = PrintUShort(op1->us << value2);
7514 exp->expType = op1->type;
7516 op1->type->refCount++;
7521 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7523 char value2 = op2->c;
7526 exp->string = PrintChar(op1->c << value2);
7529 exp->expType = op1->type;
7531 op1->type->refCount++;
7536 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7538 unsigned char value2 = op2->uc;
7541 exp->string = PrintUChar(op1->uc << value2);
7544 exp->expType = op1->type;
7546 op1->type->refCount++;
7551 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7553 int value2 = op2->i;
7556 exp->string = PrintInt(op1->i >> value2);
7559 exp->expType = op1->type;
7561 op1->type->refCount++;
7566 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7568 unsigned int value2 = op2->ui;
7571 exp->string = PrintUInt(op1->ui >> value2);
7574 exp->expType = op1->type;
7576 op1->type->refCount++;
7581 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7583 short value2 = op2->s;
7586 exp->string = PrintShort(op1->s >> value2);
7589 exp->expType = op1->type;
7591 op1->type->refCount++;
7596 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7598 unsigned short value2 = op2->us;
7601 exp->string = PrintUShort(op1->us >> value2);
7604 exp->expType = op1->type;
7606 op1->type->refCount++;
7611 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7613 char value2 = op2->c;
7616 exp->string = PrintChar(op1->c >> value2);
7619 exp->expType = op1->type;
7621 op1->type->refCount++;
7626 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7628 unsigned char value2 = op2->uc;
7631 exp->string = PrintUChar(op1->uc >> value2);
7634 exp->expType = op1->type;
7636 op1->type->refCount++;
7641 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7644 exp->string = PrintInt(~op1->i);
7647 exp->expType = op1->type;
7649 op1->type->refCount++;
7654 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7657 exp->string = PrintUInt(~op1->ui);
7660 exp->expType = op1->type;
7662 op1->type->refCount++;
7667 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7670 exp->string = PrintShort(~op1->s);
7673 exp->expType = op1->type;
7675 op1->type->refCount++;
7680 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7683 exp->string = PrintUShort(~op1->us);
7686 exp->expType = op1->type;
7688 op1->type->refCount++;
7693 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7696 exp->string = PrintChar(~op1->c);
7699 exp->expType = op1->type;
7701 op1->type->refCount++;
7706 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7709 exp->string = PrintUChar(~op1->uc);
7712 exp->expType = op1->type;
7714 op1->type->refCount++;
7719 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7721 int value2 = op2->i;
7724 exp->string = PrintInt(op1->i &= value2);
7727 exp->expType = op1->type;
7729 op1->type->refCount++;
7734 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7736 unsigned int value2 = op2->ui;
7739 exp->string = PrintUInt(op1->ui &= value2);
7742 exp->expType = op1->type;
7744 op1->type->refCount++;
7749 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7751 short value2 = op2->s;
7754 exp->string = PrintShort(op1->s &= value2);
7757 exp->expType = op1->type;
7759 op1->type->refCount++;
7764 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7766 unsigned short value2 = op2->us;
7769 exp->string = PrintUShort(op1->us &= value2);
7772 exp->expType = op1->type;
7774 op1->type->refCount++;
7779 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7781 char value2 = op2->c;
7784 exp->string = PrintChar(op1->c &= value2);
7787 exp->expType = op1->type;
7789 op1->type->refCount++;
7794 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7796 unsigned char value2 = op2->uc;
7799 exp->string = PrintUChar(op1->uc &= value2);
7802 exp->expType = op1->type;
7804 op1->type->refCount++;
7809 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7811 int value2 = op2->i;
7814 exp->string = PrintInt(op1->i |= value2);
7817 exp->expType = op1->type;
7819 op1->type->refCount++;
7824 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7826 unsigned int value2 = op2->ui;
7829 exp->string = PrintUInt(op1->ui |= value2);
7832 exp->expType = op1->type;
7834 op1->type->refCount++;
7839 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7841 short value2 = op2->s;
7844 exp->string = PrintShort(op1->s |= value2);
7847 exp->expType = op1->type;
7849 op1->type->refCount++;
7854 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7856 unsigned short value2 = op2->us;
7859 exp->string = PrintUShort(op1->us |= value2);
7862 exp->expType = op1->type;
7864 op1->type->refCount++;
7869 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7871 char value2 = op2->c;
7874 exp->string = PrintChar(op1->c |= value2);
7877 exp->expType = op1->type;
7879 op1->type->refCount++;
7884 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7886 unsigned char value2 = op2->uc;
7889 exp->string = PrintUChar(op1->uc |= value2);
7892 exp->expType = op1->type;
7894 op1->type->refCount++;
7899 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7901 int value2 = op2->i;
7904 exp->string = PrintInt(op1->i ^= value2);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7916 unsigned int value2 = op2->ui;
7919 exp->string = PrintUInt(op1->ui ^= value2);
7922 exp->expType = op1->type;
7924 op1->type->refCount++;
7929 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7931 short value2 = op2->s;
7934 exp->string = PrintShort(op1->s ^= value2);
7937 exp->expType = op1->type;
7939 op1->type->refCount++;
7944 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7946 unsigned short value2 = op2->us;
7949 exp->string = PrintUShort(op1->us ^= value2);
7952 exp->expType = op1->type;
7954 op1->type->refCount++;
7959 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7961 char value2 = op2->c;
7964 exp->string = PrintChar(op1->c ^= value2);
7967 exp->expType = op1->type;
7969 op1->type->refCount++;
7974 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7976 unsigned char value2 = op2->uc;
7979 exp->string = PrintUChar(op1->uc ^= value2);
7982 exp->expType = op1->type;
7984 op1->type->refCount++;
7989 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7991 int value2 = op2->i;
7994 exp->string = PrintInt(op1->i <<= value2);
7997 exp->expType = op1->type;
7999 op1->type->refCount++;
8004 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8006 unsigned int value2 = op2->ui;
8009 exp->string = PrintUInt(op1->ui <<= value2);
8012 exp->expType = op1->type;
8014 op1->type->refCount++;
8019 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8021 short value2 = op2->s;
8024 exp->string = PrintShort(op1->s <<= value2);
8027 exp->expType = op1->type;
8029 op1->type->refCount++;
8034 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8036 unsigned short value2 = op2->us;
8039 exp->string = PrintUShort(op1->us <<= value2);
8042 exp->expType = op1->type;
8044 op1->type->refCount++;
8049 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8051 char value2 = op2->c;
8054 exp->string = PrintChar(op1->c <<= value2);
8057 exp->expType = op1->type;
8059 op1->type->refCount++;
8064 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8066 unsigned char value2 = op2->uc;
8069 exp->string = PrintUChar(op1->uc <<= value2);
8072 exp->expType = op1->type;
8074 op1->type->refCount++;
8079 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8081 int value2 = op2->i;
8084 exp->string = PrintInt(op1->i >>= value2);
8087 exp->expType = op1->type;
8089 op1->type->refCount++;
8094 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8096 unsigned int value2 = op2->ui;
8099 exp->string = PrintUInt(op1->ui >>= value2);
8102 exp->expType = op1->type;
8104 op1->type->refCount++;
8109 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8111 short value2 = op2->s;
8114 exp->string = PrintShort(op1->s >>= value2);
8117 exp->expType = op1->type;
8119 op1->type->refCount++;
8124 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8126 unsigned short value2 = op2->us;
8129 exp->string = PrintUShort(op1->us >>= value2);
8132 exp->expType = op1->type;
8134 op1->type->refCount++;
8139 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8141 char value2 = op2->c;
8144 exp->string = PrintChar(op1->c >>= value2);
8147 exp->expType = op1->type;
8149 op1->type->refCount++;
8154 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8156 unsigned char value2 = op2->uc;
8159 exp->string = PrintUChar(op1->uc >>= value2);
8162 exp->expType = op1->type;
8164 op1->type->refCount++;
8169 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8172 exp->string = PrintInt(!op1->i);
8175 exp->expType = op1->type;
8177 op1->type->refCount++;
8182 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8185 exp->string = PrintUInt(!op1->ui);
8188 exp->expType = op1->type;
8190 op1->type->refCount++;
8195 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8198 exp->string = PrintShort(!op1->s);
8201 exp->expType = op1->type;
8203 op1->type->refCount++;
8208 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8211 exp->string = PrintUShort(!op1->us);
8214 exp->expType = op1->type;
8216 op1->type->refCount++;
8221 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8224 exp->string = PrintChar(!op1->c);
8227 exp->expType = op1->type;
8229 op1->type->refCount++;
8234 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8237 exp->string = PrintUChar(!op1->uc);
8240 exp->expType = op1->type;
8242 op1->type->refCount++;
8247 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 int value2 = op2->i;
8252 exp->string = PrintInt(op1->i == value2);
8255 exp->expType = op1->type;
8257 op1->type->refCount++;
8262 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 unsigned int value2 = op2->ui;
8267 exp->string = PrintUInt(op1->ui == value2);
8270 exp->expType = op1->type;
8272 op1->type->refCount++;
8277 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 short value2 = op2->s;
8282 exp->string = PrintShort(op1->s == value2);
8285 exp->expType = op1->type;
8287 op1->type->refCount++;
8292 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 unsigned short value2 = op2->us;
8297 exp->string = PrintUShort(op1->us == value2);
8300 exp->expType = op1->type;
8302 op1->type->refCount++;
8307 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 char value2 = op2->c;
8312 exp->string = PrintChar(op1->c == value2);
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 unsigned char value2 = op2->uc;
8327 exp->string = PrintUChar(op1->uc == value2);
8330 exp->expType = op1->type;
8332 op1->type->refCount++;
8337 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 float value2 = op2->f;
8342 exp->string = PrintFloat(op1->f == value2);
8345 exp->expType = op1->type;
8347 op1->type->refCount++;
8352 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 double value2 = op2->d;
8357 exp->string = PrintDouble(op1->d == value2);
8360 exp->expType = op1->type;
8362 op1->type->refCount++;
8367 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 int value2 = op2->i;
8372 exp->string = PrintInt(op1->i != value2);
8375 exp->expType = op1->type;
8377 op1->type->refCount++;
8382 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 unsigned int value2 = op2->ui;
8387 exp->string = PrintUInt(op1->ui != value2);
8390 exp->expType = op1->type;
8392 op1->type->refCount++;
8397 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 short value2 = op2->s;
8402 exp->string = PrintShort(op1->s != value2);
8405 exp->expType = op1->type;
8407 op1->type->refCount++;
8412 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 unsigned short value2 = op2->us;
8417 exp->string = PrintUShort(op1->us != value2);
8420 exp->expType = op1->type;
8422 op1->type->refCount++;
8427 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 char value2 = op2->c;
8432 exp->string = PrintChar(op1->c != value2);
8435 exp->expType = op1->type;
8437 op1->type->refCount++;
8442 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 unsigned char value2 = op2->uc;
8447 exp->string = PrintUChar(op1->uc != value2);
8450 exp->expType = op1->type;
8452 op1->type->refCount++;
8457 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 float value2 = op2->f;
8462 exp->string = PrintFloat(op1->f != value2);
8465 exp->expType = op1->type;
8467 op1->type->refCount++;
8472 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 double value2 = op2->d;
8477 exp->string = PrintDouble(op1->d != value2);
8480 exp->expType = op1->type;
8482 op1->type->refCount++;
8487 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 int value2 = op2->i;
8492 exp->string = PrintInt(op1->i && value2);
8495 exp->expType = op1->type;
8497 op1->type->refCount++;
8502 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 unsigned int value2 = op2->ui;
8507 exp->string = PrintUInt(op1->ui && value2);
8510 exp->expType = op1->type;
8512 op1->type->refCount++;
8517 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 short value2 = op2->s;
8522 exp->string = PrintShort(op1->s && value2);
8525 exp->expType = op1->type;
8527 op1->type->refCount++;
8532 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 unsigned short value2 = op2->us;
8537 exp->string = PrintUShort(op1->us && value2);
8540 exp->expType = op1->type;
8542 op1->type->refCount++;
8547 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 char value2 = op2->c;
8552 exp->string = PrintChar(op1->c && value2);
8555 exp->expType = op1->type;
8557 op1->type->refCount++;
8562 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 unsigned char value2 = op2->uc;
8567 exp->string = PrintUChar(op1->uc && value2);
8570 exp->expType = op1->type;
8572 op1->type->refCount++;
8577 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 float value2 = op2->f;
8582 exp->string = PrintFloat(op1->f && value2);
8585 exp->expType = op1->type;
8587 op1->type->refCount++;
8592 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 double value2 = op2->d;
8597 exp->string = PrintDouble(op1->d && value2);
8600 exp->expType = op1->type;
8602 op1->type->refCount++;
8607 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 int value2 = op2->i;
8612 exp->string = PrintInt(op1->i || value2);
8615 exp->expType = op1->type;
8617 op1->type->refCount++;
8622 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 unsigned int value2 = op2->ui;
8627 exp->string = PrintUInt(op1->ui || value2);
8630 exp->expType = op1->type;
8632 op1->type->refCount++;
8637 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 short value2 = op2->s;
8642 exp->string = PrintShort(op1->s || value2);
8645 exp->expType = op1->type;
8647 op1->type->refCount++;
8652 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 unsigned short value2 = op2->us;
8657 exp->string = PrintUShort(op1->us || value2);
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 char value2 = op2->c;
8672 exp->string = PrintChar(op1->c || value2);
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 unsigned char value2 = op2->uc;
8687 exp->string = PrintUChar(op1->uc || value2);
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 float value2 = op2->f;
8702 exp->string = PrintFloat(op1->f || value2);
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 double value2 = op2->d;
8717 exp->string = PrintDouble(op1->d || value2);
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 int value2 = op2->i;
8732 exp->string = PrintInt(op1->i > value2);
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 unsigned int value2 = op2->ui;
8747 exp->string = PrintUInt(op1->ui > value2);
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 short value2 = op2->s;
8762 exp->string = PrintShort(op1->s > value2);
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 unsigned short value2 = op2->us;
8777 exp->string = PrintUShort(op1->us > value2);
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 char value2 = op2->c;
8792 exp->string = PrintChar(op1->c > value2);
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 unsigned char value2 = op2->uc;
8807 exp->string = PrintUChar(op1->uc > value2);
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 float value2 = op2->f;
8822 exp->string = PrintFloat(op1->f > value2);
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 double value2 = op2->d;
8837 exp->string = PrintDouble(op1->d > value2);
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 int value2 = op2->i;
8852 exp->string = PrintInt(op1->i < value2);
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 unsigned int value2 = op2->ui;
8867 exp->string = PrintUInt(op1->ui < value2);
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 short value2 = op2->s;
8882 exp->string = PrintShort(op1->s < value2);
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 unsigned short value2 = op2->us;
8897 exp->string = PrintUShort(op1->us < value2);
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 char value2 = op2->c;
8912 exp->string = PrintChar(op1->c < value2);
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8924 unsigned char value2 = op2->uc;
8927 exp->string = PrintUChar(op1->uc < value2);
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8939 float value2 = op2->f;
8942 exp->string = PrintFloat(op1->f < value2);
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8954 double value2 = op2->d;
8957 exp->string = PrintDouble(op1->d < value2);
8960 exp->expType = op1->type;
8962 op1->type->refCount++;
8967 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8969 int value2 = op2->i;
8972 exp->string = PrintInt(op1->i >= value2);
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8984 unsigned int value2 = op2->ui;
8987 exp->string = PrintUInt(op1->ui >= value2);
8990 exp->expType = op1->type;
8992 op1->type->refCount++;
8997 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8999 short value2 = op2->s;
9002 exp->string = PrintShort(op1->s >= value2);
9005 exp->expType = op1->type;
9007 op1->type->refCount++;
9012 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9014 unsigned short value2 = op2->us;
9017 exp->string = PrintUShort(op1->us >= value2);
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 char value2 = op2->c;
9032 exp->string = PrintChar(op1->c >= value2);
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 unsigned char value2 = op2->uc;
9047 exp->string = PrintUChar(op1->uc >= value2);
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 float value2 = op2->f;
9062 exp->string = PrintFloat(op1->f >= value2);
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 double value2 = op2->d;
9077 exp->string = PrintDouble(op1->d >= value2);
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 int value2 = op2->i;
9092 exp->string = PrintInt(op1->i <= value2);
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 unsigned int value2 = op2->ui;
9107 exp->string = PrintUInt(op1->ui <= value2);
9110 exp->expType = op1->type;
9112 op1->type->refCount++;
9117 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 short value2 = op2->s;
9122 exp->string = PrintShort(op1->s <= value2);
9125 exp->expType = op1->type;
9127 op1->type->refCount++;
9132 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9134 unsigned short value2 = op2->us;
9137 exp->string = PrintUShort(op1->us <= value2);
9140 exp->expType = op1->type;
9142 op1->type->refCount++;
9147 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9149 char value2 = op2->c;
9152 exp->string = PrintChar(op1->c <= value2);
9155 exp->expType = op1->type;
9157 op1->type->refCount++;
9162 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 unsigned char value2 = op2->uc;
9167 exp->string = PrintUChar(op1->uc <= value2);
9170 exp->expType = op1->type;
9172 op1->type->refCount++;
9177 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 float value2 = op2->f;
9182 exp->string = PrintFloat(op1->f <= value2);
9185 exp->expType = op1->type;
9187 op1->type->refCount++;
9192 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9194 double value2 = op2->d;
9197 exp->string = PrintDouble(op1->d <= value2);
9200 exp->expType = op1->type;
9202 op1->type->refCount++;
9207 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9210 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9213 exp->expType = op1->type;
9215 op1->type->refCount++;
9220 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9223 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9226 exp->expType = op1->type;
9228 op1->type->refCount++;
9233 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9236 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9239 exp->expType = op1->type;
9241 op1->type->refCount++;
9246 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9249 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9252 exp->expType = op1->type;
9254 op1->type->refCount++;
9259 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9262 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9265 exp->expType = op1->type;
9267 op1->type->refCount++;
9272 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9275 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9278 exp->expType = op1->type;
9280 op1->type->refCount++;
9285 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9288 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9291 exp->expType = op1->type;
9293 op1->type->refCount++;
9298 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9301 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9304 exp->expType = op1->type;
9306 op1->type->refCount++;
9311 struct OpTable intOps =
9313 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
9316 struct OpTable uintOps =
9318 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
9321 struct OpTable shortOps =
9323 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
9326 struct OpTable ushortOps =
9328 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
9331 struct OpTable floatOps =
9333 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
9336 struct OpTable doubleOps =
9338 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
9341 struct OpTable charOps =
9343 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
9346 struct OpTable ucharOps =
9348 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
9351 void ReadString(char * output, char * string)
9353 int len = strlen(string);
9355 unsigned int quoted = 0x0, escaped = 0x0;
9357 for(c = 0; c < len; c++)
9359 char ch = string[c];
9415 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9417 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9419 extern double strtod(char * , char * * );
9421 struct Operand GetOperand(struct Expression * exp)
9427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9430 struct Type * type = exp->expType;
9434 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9436 if(!type->_class->registered->dataType)
9437 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9438 type = type->_class->registered->dataType;
9440 op.kind = type->kind;
9441 op.type = exp->expType;
9442 if(exp->isConstant && exp->type == 2)
9448 if(exp->constant[0] == '\'')
9449 op.c = exp->constant[1];
9450 else if(type->isSigned)
9452 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9457 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9465 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9470 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9478 op.i = strtol(exp->constant, (((void *)0)), 0);
9483 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9491 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9496 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9504 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9509 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9517 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9522 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9528 op.f = (float)strtod(exp->constant, (((void *)0)));
9532 op.d = (double)strtod(exp->constant, (((void *)0)));
9538 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9548 int __ecereVMethodID_class_OnGetString;
9550 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9552 static void UnusedFunction()
9556 ((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);
9559 extern int __ecereVMethodID_class_OnGetString;
9561 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9563 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9565 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9567 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9568 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9571 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9572 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9574 void * ptr = inst->data + dataMember->offset + offset;
9575 char * result = (((void *)0));
9577 exp->loc = member->loc = inst->loc;
9578 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9579 if(!dataMember->dataType)
9580 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9581 type = dataMember->dataType;
9584 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9586 if(_class->type == 4)
9588 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9592 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9593 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9595 for(item = e->values.first; item; item = item->next)
9597 if((int)item->data == *(int *)ptr)
9599 result = item->name;
9605 exp->identifier = MkIdentifier(result);
9607 exp->destType = MkClassType(_class->fullName);
9608 ProcessExpressionType(exp);
9612 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9614 if(!_class->dataType)
9615 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9616 type = _class->dataType;
9625 FreeExpContents(exp);
9626 exp->constant = PrintFloat(*(float *)ptr);
9632 FreeExpContents(exp);
9633 exp->constant = PrintDouble(*(double *)ptr);
9639 FreeExpContents(exp);
9640 exp->constant = PrintInt(*(int *)ptr);
9646 FreeExpContents(exp);
9647 exp->constant = PrintInt64(*(long long *)ptr);
9653 FreeExpContents(exp);
9654 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9660 FreeExpContents(exp);
9661 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9666 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9669 ListAdd(memberList, member);
9671 if(parentDataMember->type == 1)
9676 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9678 void PopulateInstance(struct Instantiation * inst)
9680 struct Symbol * classSym = inst->_class->symbol;
9681 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9682 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9683 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9686 inst->members = MkListOne(MkMembersInitList(memberList));
9688 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
9689 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9691 if(!dataMember->isProperty)
9693 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9694 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9697 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9698 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9700 void * ptr = inst->data + dataMember->offset;
9701 char * result = (((void *)0));
9703 exp->loc = member->loc = inst->loc;
9704 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9705 if(!dataMember->dataType)
9706 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9707 type = dataMember->dataType;
9710 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9712 if(_class->type == 4)
9714 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9718 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9719 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9721 for(item = e->values.first; item; item = item->next)
9723 if((int)item->data == *(int *)ptr)
9725 result = item->name;
9732 exp->identifier = MkIdentifier(result);
9734 exp->destType = MkClassType(_class->fullName);
9735 ProcessExpressionType(exp);
9738 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9740 if(!_class->dataType)
9741 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9742 type = _class->dataType;
9751 exp->constant = PrintFloat(*(float *)ptr);
9757 exp->constant = PrintDouble(*(double *)ptr);
9763 exp->constant = PrintInt(*(int *)ptr);
9769 exp->constant = PrintInt64(*(long long *)ptr);
9775 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9780 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9783 ListAdd(memberList, member);
9789 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);
9791 extern void FreeInstance(struct Instantiation * inst);
9793 void ComputeInstantiation(struct Expression * exp)
9795 struct Instantiation * inst = exp->instance;
9796 struct MembersInit * members;
9797 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9798 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9799 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9800 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9801 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9802 int subMemberStackPos = 0;
9805 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9809 if(_class->type == 0 || _class->type == 5)
9810 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9812 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9816 for(members = (*inst->members).first; members; members = members->next)
9818 switch(members->type)
9822 if(members->dataMembers)
9824 struct MemberInit * member;
9826 for(member = (*members->dataMembers).first; member; member = member->next)
9828 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9829 unsigned int found = 0x0;
9830 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9831 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9832 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9833 unsigned int dataMemberOffset;
9837 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9840 if(curMember->isProperty)
9841 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9844 dataMember = curMember;
9845 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9846 if(_class->type == 0)
9847 dataMemberOffset += _class->base->structSize;
9854 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9858 if(prop->memberAccess == 1)
9860 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9861 curClass = prop->_class;
9866 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9867 int _subMemberStackPos = 0;
9869 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9873 if(dataMember->memberAccess == 1)
9875 curMember = dataMember;
9876 curClass = dataMember->_class;
9877 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
9878 subMemberStackPos = _subMemberStackPos;
9883 if(found && member->initializer && member->initializer->type == 0)
9885 struct Expression * value = member->initializer->exp;
9886 struct Type * type = (((void *)0));
9887 unsigned int deepMember = 0x0;
9891 type = prop->dataType;
9895 if(!dataMember->dataType)
9896 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9897 type = dataMember->dataType;
9899 if(ident && ident->next)
9902 for(ident = ident->next; ident && type; ident = ident->next)
9906 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9908 type = prop->dataType;
9911 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9913 type = dataMember->dataType;
9916 else if(type->kind == 9 || type->kind == 10)
9918 struct Type * memberType;
9920 for(memberType = type->members.first; memberType; memberType = memberType->next)
9922 if(!strcmp(memberType->name, ident->string))
9933 FreeType(value->destType);
9934 value->destType = type;
9937 ComputeExpression(value);
9939 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9943 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9945 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9947 if(!_class->dataType)
9948 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9949 type = _class->dataType;
9954 void * ptr = inst->data + dataMemberOffset;
9956 if(value->type == 2)
9962 GetInt(value, (int *)ptr);
9967 GetInt64(value, (long long *)ptr);
9972 GetIntPtr(value, (intptr_t *)ptr);
9977 GetIntSize(value, (ssize_t *)ptr);
9982 GetFloat(value, (float *)ptr);
9987 GetDouble(value, (double *)ptr);
9992 else if(value->type == 1)
9996 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9998 if(_class->type == 1)
10000 ComputeTypeSize(type);
10001 if(value->instance->data)
10002 memcpy(ptr, value->instance->data, type->size);
10009 if(value->type == 1 && value->instance->data)
10011 if(type->kind == 8)
10013 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10015 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
10017 void (* Set)(void *, void *) = (void *)prop->Set;
10019 Set(inst->data, value->instance->data);
10020 PopulateInstance(inst);
10024 else if(value->type == 2)
10030 void (* Set)(void *, double) = (void *)prop->Set;
10032 Set(inst->data, strtod(value->constant, (((void *)0))));
10037 void (* Set)(void *, float) = (void *)prop->Set;
10039 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10044 void (* Set)(void *, int) = (void *)prop->Set;
10046 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10051 void (* Set)(void *, long long) = (void *)prop->Set;
10053 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10058 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10060 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10065 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10067 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10072 else if(value->type == 3)
10076 ReadString(temp, value->string);
10077 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10081 else if(!deepMember && type && _class->type == 3)
10085 if(value->type == 2)
10087 if(type->kind == 8)
10089 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10091 if(_class->type == 3)
10093 if(!_class->dataType)
10094 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10095 type = _class->dataType;
10103 float (* Set)(float) = (void *)prop->Set;
10105 GetFloat(member->initializer->exp, &fValue);
10106 exp->constant = PrintFloat(Set(fValue));
10113 double (* Set)(double) = (void *)prop->Set;
10115 GetDouble(member->initializer->exp, &dValue);
10116 exp->constant = PrintDouble(Set(dValue));
10124 else if(!deepMember && type && _class->type == 2)
10128 if(value->type == 1 && value->instance->data)
10130 unsigned int (* Set)(void *) = (void *)prop->Set;
10132 bits = Set(value->instance->data);
10134 else if(value->type == 2)
10138 else if(dataMember)
10140 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10141 struct Type * type;
10144 GetInt(value, &part);
10145 bits = (bits & ~bitMember->mask);
10146 if(!bitMember->dataType)
10147 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10148 type = bitMember->dataType;
10149 if(type->kind == 8 && type->_class && type->_class->registered)
10151 if(!type->_class->registered->dataType)
10152 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10153 type = type->_class->registered->dataType;
10159 bits |= ((char)part << bitMember->pos);
10161 bits |= ((unsigned char)part << bitMember->pos);
10165 bits |= ((short)part << bitMember->pos);
10167 bits |= ((unsigned short)part << bitMember->pos);
10172 bits |= (part << bitMember->pos);
10174 bits |= ((unsigned int)part << bitMember->pos);
10178 bits |= ((long long)part << bitMember->pos);
10180 bits |= ((uint64)part << bitMember->pos);
10185 bits |= ((intptr_t)part << bitMember->pos);
10189 bits |= ((uintptr_t)part << bitMember->pos);
10195 bits |= ((ssize_t)part << bitMember->pos);
10199 bits |= ((size_t)part << bitMember->pos);
10208 if(_class && _class->type == 3)
10210 ComputeExpression(member->initializer->exp);
10211 exp->constant = member->initializer->exp->constant;
10213 member->initializer->exp->constant = (((void *)0));
10223 if(_class && _class->type == 2)
10225 exp->constant = PrintHexUInt(bits);
10230 FreeInstance(inst);
10234 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10236 if(exp->op.op == SIZEOF)
10238 FreeExpContents(exp);
10240 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10250 struct Expression * exp2 = exp->op.exp2;
10252 exp->op.exp2 = (((void *)0));
10253 FreeExpContents(exp);
10254 FreeType(exp->expType);
10255 FreeType(exp->destType);
10257 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10263 FreeExpContents(exp);
10264 op1->ops.Neg(exp, op1);
10268 if(op1->ops.BitNot)
10270 FreeExpContents(exp);
10271 op1->ops.BitNot(exp, op1);
10277 FreeExpContents(exp);
10278 op1->ops.Not(exp, op1);
10290 FreeExpContents(exp);
10291 op1->ops.Add(exp, op1, op2);
10297 FreeExpContents(exp);
10298 op1->ops.Sub(exp, op1, op2);
10304 FreeExpContents(exp);
10305 op1->ops.Mul(exp, op1, op2);
10311 FreeExpContents(exp);
10312 op1->ops.Div(exp, op1, op2);
10318 FreeExpContents(exp);
10319 op1->ops.Mod(exp, op1, op2);
10325 if(op1->ops.BitAnd)
10327 FreeExpContents(exp);
10328 op1->ops.BitAnd(exp, op1, op2);
10335 FreeExpContents(exp);
10336 op1->ops.BitOr(exp, op1, op2);
10340 if(op1->ops.BitXor)
10342 FreeExpContents(exp);
10343 op1->ops.BitXor(exp, op1, op2);
10347 if(op1->ops.LShift)
10349 FreeExpContents(exp);
10350 op1->ops.LShift(exp, op1, op2);
10354 if(op1->ops.RShift)
10356 FreeExpContents(exp);
10357 op1->ops.RShift(exp, op1, op2);
10363 FreeExpContents(exp);
10364 op1->ops.Equ(exp, op1, op2);
10370 FreeExpContents(exp);
10371 op1->ops.Nqu(exp, op1, op2);
10377 FreeExpContents(exp);
10378 op1->ops.And(exp, op1, op2);
10384 FreeExpContents(exp);
10385 op1->ops.Or(exp, op1, op2);
10391 FreeExpContents(exp);
10392 op1->ops.Grt(exp, op1, op2);
10398 FreeExpContents(exp);
10399 op1->ops.Sma(exp, op1, op2);
10403 if(op1->ops.GrtEqu)
10405 FreeExpContents(exp);
10406 op1->ops.GrtEqu(exp, op1, op2);
10410 if(op1->ops.SmaEqu)
10412 FreeExpContents(exp);
10413 op1->ops.SmaEqu(exp, op1, op2);
10421 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
10423 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10425 void ComputeExpression(struct Expression * exp)
10427 char expString[10240];
10429 expString[0] = '\0';
10434 ComputeInstantiation(exp);
10439 struct Expression * exp1, * exp2 = (((void *)0));
10440 struct Operand op1 =
10444 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10447 struct Operand op2 =
10451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10456 ComputeExpression(exp->op.exp2);
10459 ComputeExpression(exp->op.exp1);
10460 exp1 = exp->op.exp1;
10461 exp2 = exp->op.exp2;
10462 op1 = GetOperand(exp1);
10464 op1.type->refCount++;
10467 op2 = GetOperand(exp2);
10469 op2.type->refCount++;
10474 exp1 = exp->op.exp2;
10475 op1 = GetOperand(exp1);
10477 op1.type->refCount++;
10479 CallOperator(exp, exp1, exp2, &op1, &op2);
10481 FreeType(op1.type);
10483 FreeType(op2.type);
10489 struct Expression * e, * n;
10491 for(e = (*exp->list).first; e; e = n)
10496 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10498 ComputeExpression(e);
10499 FreeType(exp->expType);
10500 FreeType(exp->destType);
10502 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10503 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10514 struct Expression * memberExp = exp->member.exp;
10515 struct Identifier * memberID = exp->member.member;
10516 struct Type * type;
10518 ComputeExpression(exp->member.exp);
10519 type = exp->member.exp->expType;
10522 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)));
10523 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10524 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10525 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10527 if(type->kind == 19 && exp->member.exp->type == 26)
10528 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10532 struct Symbol * classSym;
10535 PrintTypeNoConst(type, string, 0x0, 0x1);
10536 classSym = FindClass(string);
10537 _class = classSym ? classSym->registered : (((void *)0));
10539 if(exp->member.member)
10541 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10543 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10545 if(!prop && !member && _class && exp->member.member)
10547 struct Symbol * classSym = FindClass(exp->member.member->string);
10549 convertTo = _class;
10550 _class = classSym ? classSym->registered : (((void *)0));
10551 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10557 struct Type * type = prop->dataType;
10559 if(_class->type == 3)
10561 if(type->kind == 8)
10563 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10565 if(_class->type == 3)
10567 if(!_class->dataType)
10568 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10569 type = _class->dataType;
10577 float (* Get)(float) = (void *)prop->Get;
10579 GetFloat(exp->member.exp, &value);
10580 exp->constant = PrintFloat(Get ? Get(value) : value);
10587 double (* Get)(double);
10589 GetDouble(exp->member.exp, &value);
10591 Get = (void *)prop->Set;
10593 Get = (void *)prop->Get;
10594 exp->constant = PrintDouble(Get ? Get(value) : value);
10604 struct Expression * value = exp->member.exp;
10605 struct Type * type;
10607 if(!prop->dataType)
10608 ProcessPropertyType(prop);
10609 type = prop->dataType;
10613 else if(_class->type == 1)
10619 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10621 if(propertyClass->type == 1 && value->type == 1)
10623 void (* Set)(void *, void *) = (void *)prop->Set;
10625 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10626 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10627 exp->instance->_class = MkSpecifierName(_class->fullName);
10628 exp->instance->loc = exp->loc;
10630 Set(exp->instance->data, value->instance->data);
10631 PopulateInstance(exp->instance);
10638 void (* Set)(void *, int) = (void *)prop->Set;
10640 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10641 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10642 exp->instance->_class = MkSpecifierName(_class->fullName);
10643 exp->instance->loc = exp->loc;
10645 GetInt(value, &intValue);
10646 Set(exp->instance->data, intValue);
10647 PopulateInstance(exp->instance);
10652 long long intValue;
10653 void (* Set)(void *, long long) = (void *)prop->Set;
10655 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10656 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10657 exp->instance->_class = MkSpecifierName(_class->fullName);
10658 exp->instance->loc = exp->loc;
10660 GetInt64(value, &intValue);
10661 Set(exp->instance->data, intValue);
10662 PopulateInstance(exp->instance);
10668 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10670 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10671 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10672 exp->instance->_class = MkSpecifierName(_class->fullName);
10673 exp->instance->loc = exp->loc;
10675 GetIntPtr(value, &intValue);
10676 Set(exp->instance->data, intValue);
10677 PopulateInstance(exp->instance);
10683 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10685 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10686 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10687 exp->instance->_class = MkSpecifierName(_class->fullName);
10688 exp->instance->loc = exp->loc;
10690 GetIntSize(value, &intValue);
10691 Set(exp->instance->data, intValue);
10692 PopulateInstance(exp->instance);
10697 double doubleValue;
10698 void (* Set)(void *, double) = (void *)prop->Set;
10700 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10701 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10702 exp->instance->_class = MkSpecifierName(_class->fullName);
10703 exp->instance->loc = exp->loc;
10705 GetDouble(value, &doubleValue);
10706 Set(exp->instance->data, doubleValue);
10707 PopulateInstance(exp->instance);
10712 else if(_class->type == 2)
10718 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10720 if(propertyClass->type == 1 && value->instance->data)
10722 unsigned int (* Set)(void *) = (void *)prop->Set;
10723 unsigned int bits = Set(value->instance->data);
10725 exp->constant = PrintHexUInt(bits);
10729 else if(_class->type == 2)
10731 unsigned int value;
10732 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10735 GetUInt(exp->member.exp, &value);
10737 exp->constant = PrintHexUInt(bits);
10746 if(_class->type == 2)
10748 unsigned int value;
10750 GetUInt(exp->member.exp, &value);
10755 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10757 if(_class->type == 1)
10759 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10761 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10762 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10763 exp->instance->_class = MkSpecifierName(_class->fullName);
10764 exp->instance->loc = exp->loc;
10766 Get(value, exp->instance->data);
10767 PopulateInstance(exp->instance);
10769 else if(_class->type == 2)
10771 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10772 uint64 bits = Get(value);
10774 exp->constant = PrintHexUInt64(bits);
10781 else if(_class->type == 1)
10783 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10789 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10791 if(_class->type == 1 && value)
10793 void (* Get)(void *, void *) = (void *)prop->Get;
10795 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10796 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10797 exp->instance->_class = MkSpecifierName(_class->fullName);
10798 exp->instance->loc = exp->loc;
10800 Get(value, exp->instance->data);
10801 PopulateInstance(exp->instance);
10812 exp->isConstant = 0x0;
10821 FreeExpression(memberExp);
10822 FreeIdentifier(memberID);
10828 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10830 FreeExpContents(exp);
10831 exp->constant = PrintUInt(ComputeTypeSize(type));
10838 struct Symbol * classSym = exp->_class->symbol;
10840 if(classSym && classSym->registered)
10842 if(classSym->registered->fixed)
10844 FreeSpecifier(exp->_class);
10845 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10850 char className[1024];
10852 strcpy(className, "__ecereClass_");
10853 FullClassNameCat(className, classSym->string, 0x1);
10854 MangleClassName(className);
10855 FreeExpContents(exp);
10857 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10858 exp->member.member = MkIdentifier("structSize");
10865 struct Type * type;
10866 struct Expression * e = exp;
10868 if(exp->type == 11)
10871 ComputeExpression(exp->cast.exp);
10874 if(e && exp->expType)
10876 type = exp->expType;
10877 if(type->kind == 8)
10879 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10881 if(_class && (_class->type == 3 || _class->type == 2))
10883 if(!_class->dataType)
10884 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10885 type = _class->dataType;
10895 GetChar(e, &value);
10896 FreeExpContents(exp);
10897 exp->constant = PrintChar(value);
10902 unsigned char value;
10904 GetUChar(e, &value);
10905 FreeExpContents(exp);
10906 exp->constant = PrintUChar(value);
10915 GetShort(e, &value);
10916 FreeExpContents(exp);
10917 exp->constant = PrintShort(value);
10922 unsigned short value;
10924 GetUShort(e, &value);
10925 FreeExpContents(exp);
10926 exp->constant = PrintUShort(value);
10936 FreeExpContents(exp);
10937 exp->constant = PrintInt(value);
10942 unsigned int value;
10944 GetUInt(e, &value);
10945 FreeExpContents(exp);
10946 exp->constant = PrintUInt(value);
10955 GetInt64(e, &value);
10956 FreeExpContents(exp);
10957 exp->constant = PrintInt64(value);
10964 GetUInt64(e, &value);
10965 FreeExpContents(exp);
10966 exp->constant = PrintUInt64(value);
10975 GetIntPtr(e, &value);
10976 FreeExpContents(exp);
10977 exp->constant = PrintInt64((long long)value);
10984 GetUIntPtr(e, &value);
10985 FreeExpContents(exp);
10986 exp->constant = PrintUInt64((uint64)value);
10995 GetIntSize(e, &value);
10996 FreeExpContents(exp);
10997 exp->constant = PrintInt64((long long)value);
11004 GetUIntSize(e, &value);
11005 FreeExpContents(exp);
11006 exp->constant = PrintUInt64((uint64)value);
11014 GetFloat(e, &value);
11015 FreeExpContents(exp);
11016 exp->constant = PrintFloat(value);
11024 GetDouble(e, &value);
11025 FreeExpContents(exp);
11026 exp->constant = PrintDouble(value);
11036 struct Operand op1 =
11040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11043 struct Operand op2 =
11047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11050 struct Operand op3 =
11054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11059 ComputeExpression((*exp->cond.exp).last);
11060 if(exp->cond.elseExp)
11061 ComputeExpression(exp->cond.elseExp);
11063 ComputeExpression(exp->cond.cond);
11064 op1 = GetOperand(exp->cond.cond);
11066 op1.type->refCount++;
11067 op2 = GetOperand((*exp->cond.exp).last);
11069 op2.type->refCount++;
11070 op3 = GetOperand(exp->cond.elseExp);
11072 op3.type->refCount++;
11075 FreeExpContents(exp);
11076 op1.ops.Cond(exp, &op1, &op2, &op3);
11079 FreeType(op1.type);
11081 FreeType(op2.type);
11083 FreeType(op3.type);
11089 void ApplyAnyObjectLogic(struct Expression * e);
11091 extern void CopyTypeInto(struct Type * type, struct Type * src);
11093 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11095 unsigned int result = 0x1;
11099 struct __ecereNameSpace__ecere__sys__OldList converts =
11103 struct Conversion * convert;
11105 if(destType->kind == 0)
11107 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11111 for(convert = converts.first; convert; convert = convert->next)
11113 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11117 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11118 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11121 newExp->destType = (((void *)0));
11125 exp->addedThis = 0x1;
11126 exp->member.exp = newExp;
11127 FreeType(exp->member.exp->expType);
11128 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11129 exp->member.exp->expType->classObjectType = objectType;
11130 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11131 exp->member.memberType = 1;
11132 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11133 exp->needCast = 0x1;
11135 exp->expType->refCount++;
11136 ApplyAnyObjectLogic(exp->member.exp);
11142 exp->addedThis = 0x1;
11143 exp->member.exp = newExp;
11144 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11146 newExp->byReference = 0x1;
11148 FreeType(exp->member.exp->expType);
11149 exp->member.exp->expType = (((void *)0));
11150 if(convert->convert->dataType)
11152 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11153 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11154 exp->member.exp->expType->refCount = 1;
11155 exp->member.exp->expType->classObjectType = objectType;
11156 ApplyAnyObjectLogic(exp->member.exp);
11158 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11159 exp->member.memberType = 4;
11160 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11161 exp->needCast = 0x1;
11162 if(convert->resultType)
11163 convert->resultType->refCount++;
11169 FreeType(exp->expType);
11172 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11173 exp->needCast = 0x1;
11175 exp->expType->refCount++;
11179 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11180 exp->needCast = 0x1;
11181 if(convert->resultType)
11182 convert->resultType->refCount++;
11186 if(exp->isConstant && inCompiler)
11187 ComputeExpression(exp);
11188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11190 if(!result && exp->expType && converts.count)
11192 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11194 if(!result && exp->expType && exp->destType)
11196 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))
11203 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11205 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11207 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11209 void CheckTemplateTypes(struct Expression * exp)
11211 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11213 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11214 struct Statement * compound;
11215 struct Context * context;
11219 exp->destType->refCount++;
11221 exp->expType->refCount++;
11222 newExp->prev = (((void *)0));
11223 newExp->next = (((void *)0));
11224 switch(exp->expType->kind)
11227 if(exp->destType->classObjectType)
11230 exp->destType->refCount--;
11232 exp->expType->refCount--;
11233 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11237 struct __ecereNameSpace__ecere__sys__OldList * specs;
11238 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11239 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11241 context = PushContext();
11242 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11243 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11244 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11246 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11247 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11248 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11249 exp->compound->compound.context = context;
11250 PopContext(context);
11255 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11256 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11260 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11262 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11263 struct Statement * compound;
11264 struct Context * context;
11268 exp->destType->refCount++;
11270 exp->expType->refCount++;
11271 newExp->prev = (((void *)0));
11272 newExp->next = (((void *)0));
11273 switch(exp->expType->kind)
11276 if(exp->destType->classObjectType)
11279 exp->destType->refCount--;
11281 exp->expType->refCount--;
11282 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11286 struct __ecereNameSpace__ecere__sys__OldList * specs;
11287 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11288 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11290 context = PushContext();
11291 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11292 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11293 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11295 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11296 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11297 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11298 exp->compound->compound.context = context;
11299 PopContext(context);
11304 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11307 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11308 ProcessExpressionType((*exp->list).first);
11314 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11315 newExp->needCast = 0x1;
11316 ProcessExpressionType((*exp->list).first);
11322 if(exp->expType->kind == 20)
11324 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11328 FreeType(exp->destType);
11329 FreeType(exp->expType);
11330 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11334 if(newExp->type == 8 && newExp->member.memberType == 3)
11338 exp->op.exp1 = (((void *)0));
11339 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11343 char typeString[1024];
11344 struct Declarator * decl;
11345 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11347 typeString[0] = '\0';
11348 PrintType(exp->expType, typeString, 0x0, 0x0);
11349 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11351 exp->cast.typeName = MkTypeName(specs, decl);
11352 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11353 exp->cast.exp->needCast = 0x1;
11361 extern int strncmp(const char * , const char * , size_t n);
11363 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11365 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11367 int nsLen = strlen(nameSpace);
11368 struct Symbol * symbol;
11370 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)))
11372 char * s = symbol->string;
11374 if(!strncmp(s, nameSpace, nsLen))
11379 for(c = strlen(s) - 1; c >= 0; c--)
11382 namePart = s + c + 1;
11383 if(!strcmp(namePart, name))
11391 return (((void *)0));
11394 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11397 char nameSpace[1024];
11399 unsigned int gotColon = 0x0;
11401 nameSpace[0] = '\0';
11402 for(c = strlen(name) - 1; c >= 0; c--)
11408 namePart = name + c + 1;
11409 while(c >= 0 && name[c] == ':')
11413 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11417 memcpy(nameSpace, name, c + 1);
11418 nameSpace[c + 1] = (char)0;
11419 return ScanWithNameSpace(tree, nameSpace, namePart);
11423 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11429 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11433 return ScanWithNameSpace(tree, "", namePart);
11435 return (((void *)0));
11438 static void ProcessDeclaration(struct Declaration * decl);
11440 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11442 struct Context * ctx;
11443 struct Symbol * symbol = (((void *)0));
11445 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11447 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11449 symbol = (((void *)0));
11452 char curName[1024];
11454 strcpy(curName, thisNameSpace);
11455 strcat(curName, "::");
11456 strcat(curName, name);
11457 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11460 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11463 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11464 if(symbol || ctx == endContext)
11467 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11469 if(symbol->pointerExternal->type == 0)
11471 struct FunctionDefinition * function = symbol->pointerExternal->function;
11472 struct Context * tmpContext = curContext;
11474 curContext = (((void *)0));
11475 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11476 curContext = tmpContext;
11477 symbol->pointerExternal->symbol = symbol;
11478 DeclareType(symbol->type, 0x1, 0x1);
11479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11480 symbol->id = curExternal->symbol->idCode;
11482 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11485 symbol->id = curExternal->symbol->idCode;
11491 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11493 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11494 ListAdd(specs, MkSpecifier(UNSIGNED));
11499 if(type->_class->registered)
11501 if(!type->_class->registered->dataType)
11502 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11503 GetTypeSpecs(type->_class->registered->dataType, specs);
11508 ListAdd(specs, MkSpecifier(DOUBLE));
11511 ListAdd(specs, MkSpecifier(FLOAT));
11514 ListAdd(specs, MkSpecifier(CHAR));
11517 ListAdd(specs, MkSpecifier(SHORT));
11520 ListAdd(specs, MkSpecifier(INT64));
11523 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11526 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11530 ListAdd(specs, MkSpecifier(INT));
11535 static void PrintArraySize(struct Type * arrayType, char * string)
11541 if(arrayType->enumClass)
11542 strcat(size, arrayType->enumClass->string);
11543 else if(arrayType->arraySizeExp)
11544 PrintExpression(arrayType->arraySizeExp, size);
11546 strcat(string, size);
11549 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
11553 if(printConst && type->constant)
11554 strcat(string, "const ");
11559 struct Symbol * c = type->_class;
11561 if(type->classObjectType == 2)
11562 strcat(string, "typed_object");
11563 else if(type->classObjectType == 3)
11564 strcat(string, "any_object");
11568 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
11570 if(type->byReference)
11571 strcat(string, " &");
11575 strcat(string, "void");
11578 strcat(string, type->isSigned ? "int" : "uint");
11581 strcat(string, type->isSigned ? "int64" : "uint64");
11584 strcat(string, type->isSigned ? "intptr" : "uintptr");
11587 strcat(string, type->isSigned ? "intsize" : "uintsize");
11590 strcat(string, type->isSigned ? "char" : "byte");
11593 strcat(string, type->isSigned ? "short" : "uint16");
11596 strcat(string, "float");
11599 strcat(string, "double");
11604 strcat(string, "struct ");
11605 strcat(string, type->enumName);
11607 else if(type->typeName)
11608 strcat(string, type->typeName);
11611 struct Type * member;
11613 strcat(string, "struct { ");
11614 for(member = type->members.first; member; member = member->next)
11616 PrintType(member, string, 0x1, fullName);
11617 strcat(string, "; ");
11619 strcat(string, "}");
11625 strcat(string, "union ");
11626 strcat(string, type->enumName);
11628 else if(type->typeName)
11629 strcat(string, type->typeName);
11632 strcat(string, "union ");
11633 strcat(string, "(unnamed)");
11639 strcat(string, "enum ");
11640 strcat(string, type->enumName);
11642 else if(type->typeName)
11643 strcat(string, type->typeName);
11645 strcat(string, "int");
11648 strcat(string, "...");
11651 strcat(string, "subclass(");
11652 strcat(string, type->_class ? type->_class->string : "int");
11653 strcat(string, ")");
11656 strcat(string, type->templateParameter->identifier->string);
11659 strcat(string, "thisclass");
11662 strcat(string, "__builtin_va_list");
11668 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11670 static void PrintName(struct Type * type, char * string, unsigned int fullName)
11672 if(type->name && type->name[0])
11675 strcat(string, type->name);
11678 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11684 strcat(string, name);
11689 static void PrintAttribs(struct Type * type, char * string)
11693 if(type->dllExport)
11694 strcat(string, "dllexport ");
11695 if(type->attrStdcall)
11696 strcat(string, "stdcall ");
11700 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
11702 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11704 struct Type * attrType = (((void *)0));
11706 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
11707 PrintAttribs(type, string);
11708 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
11709 strcat(string, " const");
11710 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
11711 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11712 strcat(string, " (");
11713 if(type->kind == 13)
11715 if(type->type->kind == 11 || type->type->kind == 16)
11716 PrintAttribs(type->type, string);
11718 if(type->kind == 13)
11720 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
11721 strcat(string, "*");
11723 strcat(string, " *");
11725 if(printConst && type->constant && type->kind == 13)
11726 strcat(string, " const");
11729 PrintTypeSpecs(type, string, fullName, printConst);
11732 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
11734 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11735 strcat(string, ")");
11736 if(type->kind == 12)
11737 PrintArraySize(type, string);
11738 else if(type->kind == 11)
11740 struct Type * param;
11742 strcat(string, "(");
11743 for(param = type->params.first; param; param = param->next)
11745 PrintType(param, string, 0x1, fullName);
11747 strcat(string, ", ");
11749 strcat(string, ")");
11751 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11752 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
11755 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
11757 PrePrintType(type, string, fullName, (((void *)0)), printConst);
11758 if(type->thisClass || (printName && type->name && type->name[0]))
11759 strcat(string, " ");
11760 if((type->thisClass || type->staticMethod))
11762 struct Symbol * _class = type->thisClass;
11764 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
11766 if(type->classObjectType == 1)
11767 strcat(string, "class");
11769 strcat(string, type->byReference ? "typed_object&" : "typed_object");
11771 else if(_class && _class->string)
11773 char * s = _class->string;
11779 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
11785 strcat(string, name);
11788 strcat(string, "::");
11790 if(printName && type->name)
11791 PrintName(type, string, fullName);
11792 PostPrintType(type, string, fullName);
11793 if(type->bitFieldCount)
11797 sprintf(count, ":%d", type->bitFieldCount);
11798 strcat(string, count);
11802 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11804 _PrintType(type, string, printName, fullName, 0x1);
11807 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11809 _PrintType(type, string, printName, fullName, 0x0);
11812 static struct Type * FindMember(struct Type * type, char * string)
11814 struct Type * memberType;
11816 for(memberType = type->members.first; memberType; memberType = memberType->next)
11818 if(!memberType->name)
11820 struct Type * subType = FindMember(memberType, string);
11825 else if(!strcmp(memberType->name, string))
11828 return (((void *)0));
11831 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11833 struct Type * memberType;
11835 for(memberType = type->members.first; memberType; memberType = memberType->next)
11837 if(!memberType->name)
11839 struct Type * subType = FindMember(memberType, string);
11843 *offset += memberType->offset;
11847 else if(!strcmp(memberType->name, string))
11849 *offset += memberType->offset;
11853 return (((void *)0));
11856 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11858 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11860 struct Expression * ParseExpressionString(char * expression)
11862 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11863 ((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));
11864 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11866 parsedExpression = (((void *)0));
11868 expression_yyparse();
11869 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11870 return parsedExpression;
11873 extern char * QMkString(char * source);
11875 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11877 struct Identifier * id = exp->identifier;
11878 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11879 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11880 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11881 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11883 if(_class && _class->type == 4)
11885 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11886 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11890 struct __ecereNameSpace__ecere__com__Class * baseClass;
11892 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11894 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11896 for(value = e->values.first; value; value = value->next)
11898 if(!strcmp(value->name, id->string))
11903 char constant[256];
11905 FreeExpContents(exp);
11907 exp->isConstant = 0x1;
11908 if(!strcmp(baseClass->dataTypeString, "int"))
11909 sprintf(constant, "%d", (int)value->data);
11911 sprintf(constant, "0x%X", (int)value->data);
11912 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11913 exp->expType = MkClassType(baseClass->fullName);
11921 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11923 ProcessMethodType(method);
11924 exp->expType = __extension__ ({
11925 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11927 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11931 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11933 if(!prop->dataType)
11934 ProcessPropertyType(prop);
11935 exp->expType = prop->dataType;
11937 prop->dataType->refCount++;
11940 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11942 if(!member->dataType)
11943 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11944 exp->expType = member->dataType;
11945 if(member->dataType)
11946 member->dataType->refCount++;
11949 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11951 if(!classProp->dataType)
11952 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11953 if(classProp->constant)
11955 FreeExpContents(exp);
11956 exp->isConstant = 0x1;
11957 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11960 exp->constant = QMkString((char *)classProp->Get(_class));
11964 char constant[256];
11967 sprintf(constant, "%d", (int)classProp->Get(_class));
11968 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11974 exp->expType = classProp->dataType;
11975 if(classProp->dataType)
11976 classProp->dataType->refCount++;
11982 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11984 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11985 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11986 struct __ecereNameSpace__ecere__com__NameSpace * child;
11990 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)))
11992 data = ScanGlobalData(child, name);
12000 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
12002 extern char * strncpy(char * , const char * , size_t n);
12004 static struct GlobalData * FindGlobalData(char * name)
12007 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12009 nameSpace = globalData;
12010 for(c = 0; name[c]; c++)
12012 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
12014 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
12015 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
12017 strncpy(spaceName, name + start, c - start);
12018 spaceName[c - start] = '\0';
12019 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
12020 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
12022 return (((void *)0));
12023 nameSpace = newSpace;
12031 return ScanGlobalData(nameSpace, name + start);
12033 return (((void *)0));
12036 static int definedExpStackPos;
12038 static void * definedExpStack[512];
12040 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
12042 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
12044 FreeExpContents(checkedExp);
12045 FreeType(checkedExp->expType);
12046 FreeType(checkedExp->destType);
12047 *checkedExp = *newExp;
12048 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12049 checkedExp->prev = prev;
12050 checkedExp->next = next;
12053 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
12055 extern int printf(char * , ...);
12057 void __ecereMethod_Expression_Clear();
12059 void ApplyAnyObjectLogic(struct Expression * e)
12061 struct Type * destType = e->destType;
12063 if(destType && (destType->classObjectType == 3))
12065 if(e && e->expType)
12067 struct Type * type = e->expType;
12068 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12070 if(type->kind == 8 && type->_class && type->_class->registered)
12072 _class = type->_class->registered;
12074 else if(type->kind == 19)
12076 _class = FindClass("ecere::com::Class")->registered;
12080 char string[1024] = "";
12081 struct Symbol * classSym;
12083 PrintTypeNoConst(type, string, 0x0, 0x1);
12084 classSym = FindClass(string);
12086 _class = classSym->registered;
12088 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
12090 if(!_class || strcmp(_class->fullName, "char *"))
12092 struct Expression * checkedExp = e, * newExp;
12094 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12096 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12098 if(checkedExp->type == 25)
12100 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12103 checkedExp = (*checkedExp->list).last;
12105 else if(checkedExp->type == 11)
12106 checkedExp = checkedExp->cast.exp;
12108 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12110 newExp = checkedExp->op.exp2;
12111 checkedExp->op.exp2 = (((void *)0));
12112 FreeExpContents(checkedExp);
12113 if(e->expType && e->expType->passAsTemplate)
12117 ComputeTypeSize(e->expType);
12118 sprintf(size, "%d", e->expType->size);
12119 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))))));
12121 ReplaceExpContents(checkedExp, newExp);
12122 e->byReference = 0x1;
12124 else if(!e->byReference || (_class && _class->type == 5))
12126 struct Expression * checkedExp, * newExp;
12129 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;
12131 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12133 struct Context * context = PushContext();
12134 struct Declarator * decl;
12135 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12136 char typeString[1024];
12137 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12139 typeString[0] = '\0';
12141 newExp->prev = (((void *)0));
12142 newExp->next = (((void *)0));
12143 newExp->expType = (((void *)0));
12144 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
12145 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12146 newExp->destType = ProcessType(specs, decl);
12147 curContext = context;
12151 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12154 sprintf(name, "__internalValue%03X", internalValueCounter++);
12155 if(!curCompound->compound.declarations)
12156 curCompound->compound.declarations = MkList();
12157 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12158 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12159 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12160 e->compound = MkCompoundStmt((((void *)0)), stmts);
12163 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12165 struct Type * type = e->destType;
12167 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12168 CopyTypeInto(e->destType, type);
12169 e->destType->refCount = 1;
12170 e->destType->classObjectType = 0;
12173 e->compound->compound.context = context;
12174 PopContext(context);
12175 curContext = context->parent;
12179 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12181 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12183 if(checkedExp->type == 25)
12185 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12188 checkedExp = (*checkedExp->list).last;
12190 else if(checkedExp->type == 11)
12191 checkedExp = checkedExp->cast.exp;
12194 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12196 *operand = *checkedExp;
12197 checkedExp->destType = (((void *)0));
12198 checkedExp->expType = (((void *)0));
12199 __ecereMethod_Expression_Clear(checkedExp);
12200 checkedExp->type = 4;
12201 checkedExp->op.op = '&';
12202 checkedExp->op.exp1 = (((void *)0));
12203 checkedExp->op.exp2 = operand;
12212 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))))
12214 if(e->expType->classObjectType && destType && destType->classObjectType)
12220 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12223 thisExp->prev = (((void *)0));
12224 thisExp->next = (((void *)0));
12225 __ecereMethod_Expression_Clear(e);
12227 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12228 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12229 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12231 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12232 CopyTypeInto(e->expType, thisExp->expType);
12233 e->expType->byReference = 0x0;
12234 e->expType->refCount = 1;
12235 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))
12237 e->expType->classObjectType = 0;
12242 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12244 if(destType->kind == 14)
12246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12248 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12250 unsigned int byReference = e->expType->byReference;
12251 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12252 struct Declarator * decl;
12253 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12254 char typeString[1024];
12255 struct Type * type;
12256 int backupClassObjectType;
12257 unsigned int backupByReference;
12259 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12263 backupClassObjectType = type->classObjectType;
12264 backupByReference = type->byReference;
12265 type->classObjectType = 0;
12266 type->byReference = 0x0;
12267 typeString[0] = '\0';
12268 PrintType(type, typeString, 0x0, 0x1);
12269 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12270 type->classObjectType = backupClassObjectType;
12271 type->byReference = backupByReference;
12273 thisExp->prev = (((void *)0));
12274 thisExp->next = (((void *)0));
12275 __ecereMethod_Expression_Clear(e);
12276 if((type->kind == 8 && type->_class && type->_class->registered && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12280 e->op.exp1 = (((void *)0));
12281 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12286 e->cast.typeName = MkTypeName(specs, decl);
12287 e->cast.exp = thisExp;
12288 e->byReference = 0x1;
12291 e->destType = destType;
12293 destType->refCount++;
12298 extern char * strstr(const char * , const char * );
12300 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12302 struct __ecereNameSpace__ecere__com__DefinedExpression
12304 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12305 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12308 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12309 } __attribute__ ((gcc_struct));
12311 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12313 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12315 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12317 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12319 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12321 extern struct Expression * CopyExpression(struct Expression * exp);
12323 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12325 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12327 static void ProcessStatement(struct Statement * stmt);
12329 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12331 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12333 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12335 extern char * sourceFile;
12337 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12339 void ProcessExpressionType(struct Expression * exp)
12341 unsigned int unresolved = 0x0;
12342 struct Location oldyylloc = yylloc;
12343 unsigned int notByReference = 0x0;
12345 if(!exp || exp->expType)
12352 struct Identifier * id = exp->identifier;
12356 if(id->_class && id->_class->name)
12358 id->classSym = id->_class->symbol;
12360 if(strstr(id->string, "__ecereClass") == id->string)
12362 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12365 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12367 ReplaceClassMembers(exp, thisClass);
12370 ProcessExpressionType(exp);
12373 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12378 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12382 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12388 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12391 ProcessExpressionType(exp);
12395 else if(currentClass && !id->_class)
12397 if(ResolveIdWithClass(exp, currentClass, 0x1))
12400 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12405 struct Type * type = symbol->type;
12406 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12408 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12410 struct Context * context = SetupTemplatesContext(_class);
12412 type = ReplaceThisClassType(_class);
12413 FinishTemplatesContext(context);
12415 type->refCount = 0;
12417 FreeSpecifier(id->_class);
12418 id->_class = (((void *)0));
12419 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12420 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12421 id->classSym = (((void *)0));
12422 exp->expType = type;
12425 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12426 exp->isConstant = 0x1;
12427 if(symbol->isParam || !strcmp(id->string, "this"))
12429 if(_class && _class->type == 1 && !type->declaredWithStruct)
12430 exp->byReference = 0x1;
12432 if(symbol->isIterator)
12434 if(symbol->isIterator == 3)
12437 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12438 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12439 exp->expType = (((void *)0));
12440 ProcessExpressionType(exp);
12442 else if(symbol->isIterator != 4)
12445 exp->member.exp = MkExpIdentifier(exp->identifier);
12446 exp->member.exp->expType = exp->expType;
12447 exp->member.member = MkIdentifier("data");
12448 exp->expType = (((void *)0));
12449 ProcessExpressionType(exp);
12456 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12458 if(thisNameSpace && !(id->_class && !id->_class->name))
12462 strcpy(name, thisNameSpace);
12463 strcat(name, "::");
12464 strcat(name, id->string);
12465 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12468 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12473 for(c = 0; c < definedExpStackPos; c++)
12474 if(definedExpStack[c] == definedExp)
12476 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12478 struct Location backupYylloc = yylloc;
12480 definedExpStack[definedExpStackPos++] = definedExp;
12481 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12482 ((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));
12483 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12485 parsedExpression = (((void *)0));
12487 expression_yyparse();
12488 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12489 yylloc = backupYylloc;
12490 if(parsedExpression)
12492 FreeIdentifier(id);
12494 exp->list = MkListOne(parsedExpression);
12495 parsedExpression->loc = yylloc;
12496 ProcessExpressionType(exp);
12497 definedExpStackPos--;
12500 definedExpStackPos--;
12506 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12512 struct GlobalData * data = (((void *)0));
12514 if(thisNameSpace && !(id->_class && !id->_class->name))
12518 strcpy(name, thisNameSpace);
12519 strcat(name, "::");
12520 strcat(name, id->string);
12521 data = FindGlobalData(name);
12524 data = FindGlobalData(id->string);
12527 DeclareGlobalData(data);
12528 exp->expType = data->dataType;
12530 data->dataType->refCount++;
12531 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12532 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12533 FreeSpecifier(id->_class);
12534 id->_class = (((void *)0));
12539 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12541 if(thisNameSpace && !(id->_class && !id->_class->name))
12545 strcpy(name, thisNameSpace);
12546 strcat(name, "::");
12547 strcat(name, id->string);
12548 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12551 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12556 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12557 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12559 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12560 strcpy(name, "__ecereFunction_");
12561 FullClassNameCat(name, id->string, 0x0);
12562 if(DeclareFunction(function, name))
12564 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12565 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12567 exp->expType = function->dataType;
12568 if(function->dataType)
12569 function->dataType->refCount++;
12570 FreeSpecifier(id->_class);
12571 id->_class = (((void *)0));
12583 struct __ecereNameSpace__ecere__com__Class * _class;
12585 if(!exp->instance->_class)
12587 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12589 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12592 ProcessInstantiationType(exp->instance);
12593 exp->isConstant = exp->instance->isConstant;
12594 if(exp->instance->_class)
12596 exp->expType = MkClassType(exp->instance->_class->name);
12604 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12606 exp->expType = type;
12607 if(exp->constant[0] == '\'')
12609 if((int)((unsigned char *)exp->constant)[1] > 127)
12612 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12615 ch = exp->constant[1];
12616 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12617 exp->constant = PrintUInt(ch);
12619 type->_class = FindClass("unichar");
12620 type->isSigned = 0x0;
12625 type->isSigned = 0x1;
12628 else if(strchr(exp->constant, '.'))
12630 char ch = exp->constant[strlen(exp->constant) - 1];
12636 type->isSigned = 0x1;
12640 if(exp->constant[0] == '0' && exp->constant[1])
12641 type->isSigned = 0x0;
12642 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12643 type->isSigned = 0x0;
12644 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12645 type->isSigned = 0x0;
12647 type->isSigned = 0x1;
12650 exp->isConstant = 0x1;
12651 if(exp->destType && exp->destType->kind == 7)
12653 else if(exp->destType && exp->destType->kind == 6)
12655 else if(exp->destType && exp->destType->kind == 4)
12662 exp->isConstant = 0x1;
12663 exp->expType = __extension__ ({
12664 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12666 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12667 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12669 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
12670 }), __ecereInstance2;
12676 ProcessExpressionType(exp->_new.size);
12677 exp->expType = __extension__ ({
12678 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12680 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12682 DeclareType(exp->expType->type, 0x0, 0x0);
12686 ProcessExpressionType(exp->_renew.size);
12687 ProcessExpressionType(exp->_renew.exp);
12688 exp->expType = __extension__ ({
12689 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12691 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12693 DeclareType(exp->expType->type, 0x0, 0x0);
12697 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12698 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12699 unsigned int useDestType = 0x0, useSideType = 0x0;
12700 struct Location oldyylloc = yylloc;
12701 unsigned int useSideUnit = 0x0;
12702 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
12744 if(exp->op.op != '*' || exp->op.exp1)
12751 if(exp->op.op == '&')
12753 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12755 struct Identifier * id = exp->op.exp2->identifier;
12756 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12758 if(symbol && symbol->isIterator == 2)
12761 exp->member.exp = exp->op.exp2;
12762 exp->member.member = MkIdentifier("key");
12763 exp->expType = (((void *)0));
12764 exp->op.exp2->expType = symbol->type;
12765 symbol->type->refCount++;
12766 ProcessExpressionType(exp);
12774 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))
12776 if(exp->op.exp1->destType)
12777 FreeType(exp->op.exp1->destType);
12778 exp->op.exp1->destType = exp->destType;
12780 exp->destType->refCount++;
12784 if(exp->op.exp1->destType)
12785 FreeType(exp->op.exp1->destType);
12786 exp->op.exp1->destType = dummy;
12789 if(exp->op.exp1->destType && exp->op.op != '=')
12790 exp->op.exp1->destType->count++;
12791 ProcessExpressionType(exp->op.exp1);
12792 if(exp->op.exp1->destType && exp->op.op != '=')
12793 exp->op.exp1->destType->count--;
12794 if(exp->op.exp1->destType == dummy)
12797 exp->op.exp1->destType = (((void *)0));
12799 type1 = exp->op.exp1->expType;
12803 char expString[10240];
12805 expString[0] = '\0';
12806 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12810 exp->op.exp2->destType = exp->op.exp1->expType;
12811 if(exp->op.exp1->expType)
12812 exp->op.exp1->expType->refCount++;
12816 exp->op.exp2->destType = exp->destType;
12818 exp->destType->refCount++;
12822 exp->expType = type1;
12827 PrintExpression(exp->op.exp2, expString);
12828 if(type1 && type1->kind == 13)
12830 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)
12831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12832 else if(exp->op.op == '=')
12834 if(exp->op.exp2->destType)
12835 FreeType(exp->op.exp2->destType);
12836 exp->op.exp2->destType = type1;
12843 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)
12847 if(exp->op.exp2->destType)
12848 FreeType(exp->op.exp2->destType);
12849 exp->op.exp2->destType = type1;
12856 exp->expType = type1;
12858 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)))
12860 if(exp->op.exp2->destType)
12861 FreeType(exp->op.exp2->destType);
12862 exp->op.exp2->destType = exp->destType;
12864 exp->destType->refCount++;
12868 if(exp->op.exp2->destType)
12869 FreeType(exp->op.exp2->destType);
12870 exp->op.exp2->destType = dummy;
12873 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12875 FreeType(exp->op.exp2->destType);
12876 exp->op.exp2->destType = type1;
12879 if(exp->op.exp2->destType && exp->op.op != '=')
12880 exp->op.exp2->destType->count++;
12881 ProcessExpressionType(exp->op.exp2);
12882 if(exp->op.exp2->destType && exp->op.op != '=')
12883 exp->op.exp2->destType->count--;
12884 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12886 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)
12888 if(exp->op.op != '=' && type1->type->kind == 0)
12889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12891 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)))
12893 if(exp->op.op == ADD_ASSIGN)
12894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12896 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))
12898 if(exp->op.op == ADD_ASSIGN)
12899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12901 else if(inCompiler)
12903 char type1String[1024];
12904 char type2String[1024];
12906 type1String[0] = '\0';
12907 type2String[0] = '\0';
12908 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12909 PrintType(type1, type2String, 0x0, 0x1);
12910 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12911 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12914 if(exp->op.exp2->destType == dummy)
12917 exp->op.exp2->destType = (((void *)0));
12919 type2 = exp->op.exp2->expType;
12922 if(exp->op.op == SIZEOF)
12924 exp->expType = __extension__ ({
12925 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12927 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
12929 exp->isConstant = 0x1;
12931 else if(exp->op.op == '*' && !exp->op.exp1)
12933 exp->expType = Dereference(type2);
12934 if(type2 && type2->kind == 8)
12935 notByReference = 0x1;
12937 else if(exp->op.op == '&' && !exp->op.exp1)
12938 exp->expType = Reference(type2);
12945 if(exp->op.exp1->destType)
12946 FreeType(exp->op.exp1->destType);
12947 exp->op.exp1->destType = MkClassType("bool");
12948 exp->op.exp1->destType->truth = 0x1;
12949 if(!exp->op.exp1->expType)
12950 ProcessExpressionType(exp->op.exp1);
12952 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12953 FreeType(exp->op.exp1->expType);
12954 exp->op.exp1->expType = MkClassType("bool");
12955 exp->op.exp1->expType->truth = 0x1;
12959 if(exp->op.exp2->destType)
12960 FreeType(exp->op.exp2->destType);
12961 exp->op.exp2->destType = MkClassType("bool");
12962 exp->op.exp2->destType->truth = 0x1;
12963 if(!exp->op.exp2->expType)
12964 ProcessExpressionType(exp->op.exp2);
12966 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12967 FreeType(exp->op.exp2->expType);
12968 exp->op.exp2->expType = MkClassType("bool");
12969 exp->op.exp2->expType->truth = 0x1;
12972 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")))))
12974 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12976 if(exp->op.exp2->destType)
12977 FreeType(exp->op.exp2->destType);
12978 exp->op.exp2->destType = type1;
12980 if(exp->op.exp1->destType)
12981 FreeType(exp->op.exp1->destType);
12982 exp->op.exp1->destType = type2;
12984 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)
12985 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);
12986 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12988 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12992 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12994 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12995 ProcessExpressionType(exp->op.exp1);
12996 if(type2->kind != 13)
12998 ProcessExpressionType(classExp);
12999 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"))))))));
13000 if(!exp->op.exp2->expType)
13001 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
13002 ProcessExpressionType(exp->op.exp2);
13006 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)))
13008 if(type1->kind != 8 && type1->type->kind == 0)
13009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13010 exp->expType = type1;
13014 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)))
13016 if(type2->kind != 8 && type2->type->kind == 0)
13017 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13018 exp->expType = type2;
13022 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))
13024 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
13028 unsigned int success = 0x0;
13030 if(type1->kind == 13 && type2->kind == 13)
13032 if(exp->op.op == '+')
13033 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
13034 else if(exp->op.op == '-')
13036 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
13038 exp->expType = __extension__ ({
13039 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13041 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
13044 if(type1->type->kind == 20)
13046 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13050 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13052 ProcessExpressionType(classExp);
13054 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")))))));
13055 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
13063 if(!success && exp->op.exp1->type == 2)
13065 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13068 FreeType(exp->expType);
13069 exp->expType = exp->op.exp1->destType;
13070 if(exp->op.exp1->destType)
13071 exp->op.exp1->destType->refCount++;
13074 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13077 FreeType(exp->expType);
13078 exp->expType = exp->op.exp2->destType;
13079 if(exp->op.exp2->destType)
13080 exp->op.exp2->destType->refCount++;
13086 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13089 FreeType(exp->expType);
13090 exp->expType = exp->op.exp2->destType;
13091 if(exp->op.exp2->destType)
13092 exp->op.exp2->destType->refCount++;
13095 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13098 FreeType(exp->expType);
13099 exp->expType = exp->op.exp1->destType;
13100 if(exp->op.exp1->destType)
13101 exp->op.exp1->destType->refCount++;
13107 char expString1[10240];
13108 char expString2[10240];
13112 expString1[0] = '\0';
13113 expString2[0] = '\0';
13118 PrintExpression(exp->op.exp1, expString1);
13119 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13120 PrintExpression(exp->op.exp2, expString2);
13121 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13122 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13123 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13125 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13129 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13131 if(exp->op.exp1->destType)
13132 FreeType(exp->op.exp1->destType);
13133 exp->op.exp1->destType = type2->_class->registered->dataType;
13134 if(type2->_class->registered->dataType)
13135 type2->_class->registered->dataType->refCount++;
13136 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13137 exp->expType = type2;
13141 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13143 if(exp->op.exp2->destType)
13144 FreeType(exp->op.exp2->destType);
13145 exp->op.exp2->destType = type1->_class->registered->dataType;
13146 if(type1->_class->registered->dataType)
13147 type1->_class->registered->dataType->refCount++;
13148 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13149 exp->expType = type1;
13155 unsigned int valid = 0x0;
13157 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13159 if(exp->op.exp2->destType)
13160 FreeType(exp->op.exp2->destType);
13161 if(!type1->_class->registered->dataType)
13162 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13163 exp->op.exp2->destType = type1->_class->registered->dataType;
13164 exp->op.exp2->destType->refCount++;
13165 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13166 type2 = exp->op.exp2->destType;
13167 exp->expType = type2;
13170 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13172 if(exp->op.exp1->destType)
13173 FreeType(exp->op.exp1->destType);
13174 if(!type2->_class->registered->dataType)
13175 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13176 exp->op.exp1->destType = type2->_class->registered->dataType;
13177 exp->op.exp1->destType->refCount++;
13178 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13179 type1 = exp->op.exp1->destType;
13180 exp->expType = type1;
13183 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13185 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13187 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13190 FreeType(exp->expType);
13191 exp->expType = exp->op.exp1->expType;
13192 if(exp->op.exp2->expType)
13193 exp->op.exp1->expType->refCount++;
13197 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13199 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13202 FreeType(exp->expType);
13203 exp->expType = exp->op.exp2->expType;
13204 if(exp->op.exp2->expType)
13205 exp->op.exp2->expType->refCount++;
13212 if(exp->op.exp2->destType)
13213 FreeType(exp->op.exp2->destType);
13214 exp->op.exp2->destType = type1;
13216 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13219 FreeType(exp->expType);
13220 exp->expType = exp->op.exp2->destType;
13221 if(exp->op.exp2->destType)
13222 exp->op.exp2->destType->refCount++;
13224 else if(type1 && type2)
13226 char expString1[10240];
13227 char expString2[10240];
13228 char type1String[1024];
13229 char type2String[1024];
13231 expString1[0] = '\0';
13232 expString2[0] = '\0';
13233 type1String[0] = '\0';
13234 type2String[0] = '\0';
13237 PrintExpression(exp->op.exp1, expString1);
13238 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13239 PrintExpression(exp->op.exp2, expString2);
13240 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13241 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13242 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13244 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13245 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13247 exp->expType = exp->op.exp1->expType;
13248 if(exp->op.exp1->expType)
13249 exp->op.exp1->expType->refCount++;
13251 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13253 exp->expType = exp->op.exp2->expType;
13254 if(exp->op.exp2->expType)
13255 exp->op.exp2->expType->refCount++;
13262 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13264 struct Type * oldType = exp->op.exp1->expType;
13266 exp->op.exp1->expType = (((void *)0));
13267 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13270 exp->op.exp1->expType = oldType;
13272 if(exp->op.exp1->destType)
13273 FreeType(exp->op.exp1->destType);
13274 exp->op.exp1->destType = type2;
13276 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13279 FreeType(exp->expType);
13280 exp->expType = exp->op.exp1->destType;
13281 if(exp->op.exp1->destType)
13282 exp->op.exp1->destType->refCount++;
13286 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13288 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13290 if(exp->op.exp1->destType)
13291 FreeType(exp->op.exp1->destType);
13292 exp->op.exp1->destType = type2->_class->registered->dataType;
13293 if(type2->_class->registered->dataType)
13294 type2->_class->registered->dataType->refCount++;
13295 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13297 if(exp->op.op == '!')
13299 exp->expType = MkClassType("bool");
13300 exp->expType->truth = 0x1;
13304 exp->expType = type2;
13309 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13311 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13313 if(exp->op.exp2->destType)
13314 FreeType(exp->op.exp2->destType);
13315 exp->op.exp2->destType = type1->_class->registered->dataType;
13316 if(type1->_class->registered->dataType)
13317 type1->_class->registered->dataType->refCount++;
13318 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13320 exp->expType = type1;
13326 if(exp->op.exp1 && !exp->op.exp1->expType)
13328 char expString[10000];
13330 expString[0] = '\0';
13333 PrintExpression(exp->op.exp1, expString);
13334 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13337 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13339 if(exp->op.exp2 && !exp->op.exp2->expType)
13341 char expString[10240];
13343 expString[0] = '\0';
13346 PrintExpression(exp->op.exp2, expString);
13347 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13350 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13354 FreeType(exp->expType);
13355 exp->expType = MkClassType("bool");
13356 exp->expType->truth = 0x1;
13358 if(exp->op.op != SIZEOF)
13359 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13360 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13362 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13364 yylloc = oldyylloc;
13371 struct Expression * e;
13373 exp->isConstant = 0x1;
13374 for(e = (*exp->list).first; e; e = e->next)
13376 unsigned int inced = 0x0;
13380 FreeType(e->destType);
13381 e->destType = exp->destType;
13384 exp->destType->refCount++;
13385 e->destType->count++;
13389 ProcessExpressionType(e);
13391 exp->destType->count--;
13392 if(!exp->expType && !e->next)
13394 exp->expType = e->expType;
13396 e->expType->refCount++;
13399 exp->isConstant = 0x0;
13401 e = (*exp->list).first;
13402 if(!e->next && e->type == 8)
13404 struct Expression * next = exp->next, * prev = exp->prev;
13406 FreeType(exp->expType);
13407 FreeType(exp->destType);
13408 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13412 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13413 ProcessExpressionType(exp);
13419 struct Expression * e;
13421 exp->isConstant = 0x1;
13422 ProcessExpressionType(exp->index.exp);
13423 if(!exp->index.exp->isConstant)
13424 exp->isConstant = 0x0;
13425 if(exp->index.exp->expType)
13427 struct Type * source = exp->index.exp->expType;
13429 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)
13431 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13433 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13434 if(exp->index.index && (*exp->index.index).last)
13436 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13440 for(e = (*exp->index.index).first; e; e = e->next)
13442 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13445 FreeType(e->destType);
13446 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13448 ProcessExpressionType(e);
13453 exp->isConstant = 0x0;
13456 exp->expType = Dereference(exp->index.exp->expType);
13458 DeclareType(exp->expType, 0x0, 0x0);
13463 struct Expression * e;
13464 struct Type * functionType;
13465 struct Type * methodType = (((void *)0));
13471 PrintExpression(exp->call.exp, name);
13472 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13474 PrintExpression(exp->call.exp, name);
13477 if(exp->call.exp->type == 0)
13479 struct Expression * idExp = exp->call.exp;
13480 struct Identifier * id = idExp->identifier;
13482 if(!strcmp(id->string, "__builtin_frame_address"))
13484 exp->expType = ProcessTypeString("void *", 0x1);
13485 if(exp->call.arguments && (*exp->call.arguments).first)
13486 ProcessExpressionType((*exp->call.arguments).first);
13489 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13491 exp->expType = ProcessTypeString("int", 0x1);
13492 if(exp->call.arguments && (*exp->call.arguments).first)
13493 ProcessExpressionType((*exp->call.arguments).first);
13496 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13498 struct Expression * a = (((void *)0));
13499 struct Expression * b = (((void *)0));
13500 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13502 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13504 a = (*exp->call.arguments).first;
13505 b = (*exp->call.arguments).last;
13509 else if((*exp->call.arguments).count == 1)
13511 a = (*exp->call.arguments).first;
13516 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13517 idExp->identifier = (((void *)0));
13518 FreeExpContents(exp);
13519 ProcessExpressionType(a);
13521 ProcessExpressionType(b);
13523 exp->list = MkList();
13524 if(a->expType && (!b || b->expType))
13526 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13530 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13531 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13532 struct Declaration * decl;
13533 char temp1[1024], temp2[1024];
13535 GetTypeSpecs(a->expType, specs);
13536 if(a && !a->isConstant && a->type != 0)
13538 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13539 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13540 tempExp1 = QMkExpId(temp1);
13541 tempExp1->expType = a->expType;
13543 a->expType->refCount++;
13544 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13546 if(b && !b->isConstant && b->type != 0)
13548 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13549 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13550 tempExp2 = QMkExpId(temp2);
13551 tempExp2->expType = b->expType;
13553 b->expType->refCount++;
13554 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13556 decl = MkDeclaration(specs, decls);
13557 if(!curCompound->compound.declarations)
13558 curCompound->compound.declarations = MkList();
13559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13563 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13565 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13567 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13568 exp->expType = a->expType;
13570 a->expType->refCount++;
13572 else if(!strcmp(id->string, "Abs"))
13574 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13575 exp->expType = a->expType;
13577 a->expType->refCount++;
13579 else if(!strcmp(id->string, "Sgn"))
13581 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"))))));
13582 exp->expType = ProcessTypeString("int", 0x0);
13584 FreeExpression(tempExp1);
13586 FreeExpression(tempExp2);
13587 FreeIdentifier(id);
13593 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13595 if(!exp->call.exp->destType)
13597 exp->call.exp->destType = dummy;
13600 ProcessExpressionType(exp->call.exp);
13601 if(exp->call.exp->destType == dummy)
13604 exp->call.exp->destType = (((void *)0));
13608 functionType = exp->call.exp->expType;
13609 if(functionType && functionType->kind == 16)
13611 methodType = functionType;
13612 functionType = methodType->method->dataType;
13613 if(exp->call.exp->expType->usedClass)
13615 char typeString[1024];
13617 typeString[0] = '\0';
13619 struct Symbol * back = functionType->thisClass;
13621 functionType->thisClass = (((void *)0));
13622 PrintType(functionType, typeString, 0x1, 0x1);
13623 functionType->thisClass = back;
13625 if(strstr(typeString, "thisclass"))
13627 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13628 struct Declarator * decl;
13631 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13633 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13634 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13635 thisClassParams = 0x0;
13636 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13638 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13640 thisClass = exp->call.exp->expType->usedClass;
13641 ProcessDeclarator(decl);
13642 thisClass = backupThisClass;
13644 thisClassParams = 0x1;
13645 functionType = ProcessType(specs, decl);
13646 functionType->refCount = 0;
13647 FinishTemplatesContext(context);
13649 FreeList(specs, FreeSpecifier);
13650 FreeDeclarator(decl);
13654 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13656 struct Type * type = functionType->type;
13658 if(!functionType->refCount)
13660 functionType->type = (((void *)0));
13661 FreeType(functionType);
13663 functionType = type;
13665 if(functionType && functionType->kind != 11)
13667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13669 else if(functionType)
13671 unsigned int emptyParams = 0x0, noParams = 0x0;
13672 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13673 struct Type * type = functionType->params.first;
13674 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13676 struct Location oldyylloc = yylloc;
13680 if(functionType->extraParam && e && functionType->thisClass)
13682 e->destType = MkClassType(functionType->thisClass->string);
13685 if(!functionType->staticMethod)
13687 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13689 type = MkClassType(memberExp->member.exp->expType->_class->string);
13692 e->destType = type;
13694 type = functionType->params.first;
13697 type->refCount = 0;
13699 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13701 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13704 e->destType = type;
13706 type = functionType->params.first;
13709 type->refCount = 0;
13712 if(type && type->kind == 0)
13715 if(!type->refCount)
13717 type = (((void *)0));
13719 for(; e; e = e->next)
13721 if(!type && !emptyParams)
13724 if(methodType && methodType->methodClass)
13725 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);
13727 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);
13730 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13732 struct Type * templatedType = (((void *)0));
13733 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13734 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13737 if(_class && _class->templateArgs)
13739 struct __ecereNameSpace__ecere__com__Class * sClass;
13741 for(sClass = _class; sClass; sClass = sClass->base)
13743 if(sClass->templateClass)
13744 sClass = sClass->templateClass;
13746 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13748 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13750 struct __ecereNameSpace__ecere__com__Class * nextClass;
13752 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13754 if(nextClass->templateClass)
13755 nextClass = nextClass->templateClass;
13756 id += nextClass->templateParams.count;
13766 if(curParam && _class->templateArgs[id].dataTypeString)
13768 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13771 struct Context * context = SetupTemplatesContext(_class);
13773 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13774 FinishTemplatesContext(context);
13776 e->destType = templatedType;
13779 templatedType->passAsTemplate = 0x1;
13784 e->destType = type;
13791 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13793 e->destType = type->prev;
13794 e->destType->refCount++;
13798 e->destType = type;
13803 if(type && type->kind != 14)
13805 struct Type * next = type->next;
13807 if(!type->refCount)
13812 if(type && type->kind != 14)
13814 if(methodType && methodType->methodClass)
13815 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);
13817 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);
13819 yylloc = oldyylloc;
13820 if(type && !type->refCount)
13825 functionType = __extension__ ({
13826 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13828 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13830 if(exp->call.exp->type == 0)
13832 char * string = exp->call.exp->identifier->string;
13836 struct Symbol * symbol;
13837 struct Location oldyylloc = yylloc;
13839 yylloc = exp->call.exp->identifier->loc;
13840 if(strstr(string, "__builtin_") == string)
13844 functionType->returnType = exp->destType;
13845 exp->destType->refCount++;
13849 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13850 symbol = __extension__ ({
13851 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13853 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13855 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13856 if(strstr(symbol->string, "::"))
13857 globalContext->hasNameSpace = 0x1;
13858 yylloc = oldyylloc;
13861 else if(exp->call.exp->type == 8)
13865 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13866 if(!functionType->returnType)
13868 functionType->returnType = __extension__ ({
13869 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13871 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13875 if(functionType && functionType->kind == 11)
13877 exp->expType = functionType->returnType;
13878 if(functionType->returnType)
13879 functionType->returnType->refCount++;
13880 if(!functionType->refCount)
13881 FreeType(functionType);
13883 if(exp->call.arguments)
13885 for(e = (*exp->call.arguments).first; e; e = e->next)
13887 struct Type * destType = e->destType;
13889 ProcessExpressionType(e);
13896 struct Type * type;
13897 struct Location oldyylloc = yylloc;
13898 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13900 exp->thisPtr = thisPtr;
13901 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13903 exp->member.member->classSym = exp->member.member->_class->symbol;
13905 ProcessExpressionType(exp->member.exp);
13906 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)
13908 exp->isConstant = 0x0;
13911 exp->isConstant = exp->member.exp->isConstant;
13912 type = exp->member.exp->expType;
13914 if(type && (type->kind == 20))
13916 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13917 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13921 for(param = _class->templateParams.first; param; param = param->next)
13923 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13927 if(param && param->defaultArg.member)
13929 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13933 struct Expression * expMember = exp->member.exp;
13934 struct Declarator * decl;
13935 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13936 char thisClassTypeString[1024];
13938 FreeIdentifier(exp->member.member);
13939 ProcessExpressionType(argExp);
13941 char * colon = strstr(param->defaultArg.memberString, "::");
13945 char className[1024];
13946 struct __ecereNameSpace__ecere__com__Class * sClass;
13948 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13949 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13952 strcpy(thisClassTypeString, _class->fullName);
13954 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13955 exp->expType = ProcessType(specs, decl);
13956 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13958 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13959 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13961 int paramCount = 0;
13962 int lastParam = -1;
13963 char templateString[1024];
13964 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13966 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13967 for(cClass = expClass; cClass; cClass = cClass->base)
13971 for(param = cClass->templateParams.first; param; param = param->next)
13974 struct __ecereNameSpace__ecere__com__Class * sClass;
13975 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13977 for(sClass = cClass->base; sClass; sClass = sClass->base)
13978 id += sClass->templateParams.count;
13979 arg = expClass->templateArgs[id];
13980 for(sClass = _class; sClass; sClass = sClass->base)
13982 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13984 struct __ecereNameSpace__ecere__com__Class * nextClass;
13986 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13987 p += nextClass->templateParams.count;
13988 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13990 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13992 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13994 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13995 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
14002 char argument[256];
14004 argument[0] = '\0';
14005 switch(param->type)
14009 char expString[1024];
14010 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14011 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14012 struct Expression * exp;
14013 char * string = PrintHexUInt64(arg.expression.ui64);
14015 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14016 ProcessExpressionType(exp);
14017 ComputeExpression(exp);
14018 expString[0] = '\0';
14019 PrintExpression(exp, expString);
14020 strcat(argument, expString);
14021 FreeExpression(exp);
14026 strcat(argument, arg.member->name);
14031 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14033 if(!strcmp(arg.dataTypeString, "thisclass"))
14034 strcat(argument, thisClassTypeString);
14036 strcat(argument, arg.dataTypeString);
14044 strcat(templateString, ", ");
14045 if(lastParam != p - 1)
14047 strcat(templateString, param->name);
14048 strcat(templateString, " = ");
14050 strcat(templateString, argument);
14059 int len = strlen(templateString);
14061 if(templateString[len - 1] == '>')
14062 templateString[len++] = ' ';
14063 templateString[len++] = '>';
14064 templateString[len++] = '\0';
14067 struct Context * context = SetupTemplatesContext(_class);
14069 FreeType(exp->expType);
14070 exp->expType = ProcessTypeString(templateString, 0x0);
14071 FinishTemplatesContext(context);
14075 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")))))))));
14078 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
14080 type = ProcessTemplateParameterType(type->templateParameter);
14083 if(type && (type->kind == 20))
14085 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
14087 struct Identifier * id = exp->member.member;
14088 int typeKind = type->kind;
14089 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));
14091 if(typeKind == 19 && exp->member.exp->type == 26)
14093 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14098 if(typeKind == 3 || typeKind == 15)
14099 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14102 if(type->kind == 8 && type->_class && type->_class->registered)
14104 _class = type->_class->registered;
14106 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
14108 _class = FindClass("char *")->registered;
14110 else if(type->kind == 13)
14112 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
14113 FreeType(exp->expType);
14114 exp->expType = ProcessTypeString("uintptr", 0x0);
14115 exp->byReference = 0x1;
14119 char string[1024] = "";
14120 struct Symbol * classSym;
14122 PrintTypeNoConst(type, string, 0x0, 0x1);
14123 classSym = FindClass(string);
14125 _class = classSym->registered;
14131 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14132 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14133 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14134 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14135 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14137 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14138 exp->member.memberType = 1;
14139 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14140 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14143 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14145 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14146 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14148 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14150 member = (((void *)0));
14152 if(!member && !prop)
14153 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14154 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14155 exp->member.thisPtr = 0x1;
14161 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14162 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14163 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14165 if(!prop && !member)
14167 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14170 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14171 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14172 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14177 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14178 prop = (((void *)0));
14180 member = (((void *)0));
14184 if(!prop && !member && !method)
14185 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14186 if(!prop && !member && !method)
14190 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14193 exp->member.memberType = 5;
14194 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14198 char structName[1024];
14199 struct Identifier * id = exp->member.member;
14200 struct Expression * classExp = exp->member.exp;
14203 FreeType(classExp->expType);
14204 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14205 strcpy(structName, "__ecereClassData_");
14206 FullClassNameCat(structName, type->_class->string, 0x0);
14208 exp->member.member = id;
14209 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"))))))));
14211 ProcessExpressionType(exp);
14217 struct Symbol * classSym = FindClass(id->string);
14221 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14224 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14230 exp->member.memberType = 1;
14231 if(!prop->dataType)
14232 ProcessPropertyType(prop);
14233 exp->expType = prop->dataType;
14235 prop->dataType->refCount++;
14239 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14241 FreeExpContents(exp);
14243 exp->identifier = MkIdentifier("class");
14244 ProcessExpressionType(exp);
14247 exp->member.memberType = 3;
14248 DeclareStruct(_class->fullName, 0x0);
14249 if(!member->dataType)
14251 struct Context * context = SetupTemplatesContext(_class);
14253 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14254 FinishTemplatesContext(context);
14256 exp->expType = member->dataType;
14257 if(member->dataType)
14258 member->dataType->refCount++;
14260 else if(revConvert)
14262 exp->member.memberType = 4;
14263 exp->expType = MkClassType(revConvert->_class->fullName);
14268 exp->member.memberType = 2;
14270 if(!method->dataType)
14271 ProcessMethodType(method);
14272 exp->expType = __extension__ ({
14273 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14275 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14277 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14278 exp->expType->usedClass = _class;
14280 else if(!classProp)
14282 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14284 FreeExpContents(exp);
14286 exp->identifier = MkIdentifier("class");
14287 ProcessExpressionType(exp);
14290 yylloc = exp->member.member->loc;
14291 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14293 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14295 if(_class && exp->expType)
14297 struct __ecereNameSpace__ecere__com__Class * tClass;
14300 while(tClass && !tClass->templateClass)
14301 tClass = tClass->base;
14302 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14305 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14306 struct __ecereNameSpace__ecere__com__Class * sClass;
14308 for(sClass = tClass; sClass; sClass = sClass->base)
14311 if(sClass->templateClass)
14312 sClass = sClass->templateClass;
14313 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14315 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14317 for(sClass = sClass->base; sClass; sClass = sClass->base)
14318 id += sClass->templateParams.count;
14326 if(curParam && tClass->templateArgs[id].dataTypeString)
14328 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14329 struct Context * context = SetupTemplatesContext(tClass);
14331 FreeType(exp->expType);
14332 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14335 if(exp->expType->kind == 21)
14337 FreeType(exp->expType);
14338 exp->expType = ReplaceThisClassType(_class);
14340 if(tClass->templateClass)
14341 exp->expType->passAsTemplate = 0x1;
14344 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14345 if(exp->destType->kind == 21)
14347 FreeType(exp->destType);
14348 exp->destType = ReplaceThisClassType(_class);
14352 FinishTemplatesContext(context);
14355 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14358 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14359 struct __ecereNameSpace__ecere__com__Class * sClass;
14361 for(sClass = tClass; sClass; sClass = sClass->base)
14364 if(sClass->templateClass)
14365 sClass = sClass->templateClass;
14366 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14368 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14370 for(sClass = sClass->base; sClass; sClass = sClass->base)
14371 id += sClass->templateParams.count;
14381 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14382 struct Context * context = SetupTemplatesContext(tClass);
14383 struct Type * basicType;
14385 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14388 if(basicType->kind == 21)
14390 FreeType(basicType);
14391 basicType = ReplaceThisClassType(_class);
14393 FreeType(exp->expType);
14394 exp->expType = __extension__ ({
14395 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14397 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14401 exp->destType = exp->expType;
14402 exp->destType->refCount++;
14405 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14406 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14407 struct Declarator * decl;
14409 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14412 exp->destType->refCount++;
14414 exp->expType->refCount++;
14416 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14417 exp->cast.exp = newExp;
14420 FinishTemplatesContext(context);
14423 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14425 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14429 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14432 int paramCount = 0;
14433 int lastParam = -1;
14434 char templateString[1024];
14435 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14437 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14438 while(cClass != expClass)
14440 struct __ecereNameSpace__ecere__com__Class * sClass;
14442 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14445 for(param = cClass->templateParams.first; param; param = param->next)
14447 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14450 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14451 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14453 while(cClassCur != tClass && !paramCur)
14455 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14457 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14459 cClassCur = sClassCur;
14460 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14462 if(!strcmp(paramCur->name, param->name))
14469 if(paramCur && paramCur->type == 0)
14470 arg = tClass->templateArgs[cp];
14472 arg = expClass->templateArgs[p];
14474 char argument[256];
14476 argument[0] = '\0';
14477 switch(param->type)
14481 char expString[1024];
14482 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14483 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14484 struct Expression * exp;
14485 char * string = PrintHexUInt64(arg.expression.ui64);
14487 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14488 ProcessExpressionType(exp);
14489 ComputeExpression(exp);
14490 expString[0] = '\0';
14491 PrintExpression(exp, expString);
14492 strcat(argument, expString);
14493 FreeExpression(exp);
14498 strcat(argument, arg.member->name);
14503 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14504 strcat(argument, arg.dataTypeString);
14511 strcat(templateString, ", ");
14512 if(lastParam != p - 1)
14514 strcat(templateString, param->name);
14515 strcat(templateString, " = ");
14517 strcat(templateString, argument);
14526 int len = strlen(templateString);
14528 if(templateString[len - 1] == '>')
14529 templateString[len++] = ' ';
14530 templateString[len++] = '>';
14531 templateString[len++] = '\0';
14533 FreeType(exp->expType);
14535 struct Context * context = SetupTemplatesContext(tClass);
14537 exp->expType = ProcessTypeString(templateString, 0x0);
14538 FinishTemplatesContext(context);
14545 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)");
14547 else if(type && (type->kind == 9 || type->kind == 10))
14549 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14553 exp->expType = memberType;
14555 memberType->refCount++;
14560 char expString[10240];
14562 expString[0] = '\0';
14565 PrintExpression(exp, expString);
14566 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14568 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14570 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14572 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14574 struct Identifier * id = exp->member.member;
14575 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));
14579 FreeType(exp->expType);
14580 exp->expType = ReplaceThisClassType(_class);
14584 yylloc = oldyylloc;
14589 struct Type * destType = exp->destType;
14591 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14593 exp->member.member->classSym = exp->member.member->_class->symbol;
14595 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14599 ProcessExpressionType(exp);
14606 struct Symbol * classSym = exp->_class->symbol;
14608 if(classSym && classSym->registered)
14610 if(classSym->registered->type == 5)
14615 DeclareStruct(classSym->string, 0x0);
14616 FreeSpecifier(exp->_class);
14618 FullClassNameCat(name, classSym->string, 0x0);
14619 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14623 if(classSym->registered->fixed)
14625 FreeSpecifier(exp->_class);
14626 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14631 char className[1024];
14633 strcpy(className, "__ecereClass_");
14634 FullClassNameCat(className, classSym->string, 0x1);
14635 MangleClassName(className);
14636 DeclareClass(classSym, className);
14637 FreeExpContents(exp);
14639 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14640 exp->member.member = MkIdentifier("structSize");
14644 exp->expType = __extension__ ({
14645 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14647 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14653 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14655 exp->expType = __extension__ ({
14656 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14658 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14660 exp->isConstant = 0x1;
14661 DeclareType(type, 0x0, 0x0);
14667 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14670 FreeType(exp->cast.exp->destType);
14671 exp->cast.exp->destType = type;
14673 ProcessExpressionType(exp->cast.exp);
14675 exp->expType = type;
14676 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14678 void * prev = exp->prev, * next = exp->next;
14679 struct Type * expType = exp->cast.exp->destType;
14680 struct Expression * castExp = exp->cast.exp;
14681 struct Type * destType = exp->destType;
14684 expType->refCount++;
14685 FreeType(exp->expType);
14686 FreeTypeName(exp->cast.typeName);
14688 FreeType(exp->expType);
14689 FreeType(exp->destType);
14690 exp->expType = expType;
14691 exp->destType = destType;
14692 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14698 exp->isConstant = exp->cast.exp->isConstant;
14704 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14706 exp->expType = type;
14711 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14713 ProcessExpressionType(exp->vaArg.exp);
14714 exp->expType = type;
14719 struct Expression * e;
14721 exp->isConstant = 0x1;
14722 FreeType(exp->cond.cond->destType);
14723 exp->cond.cond->destType = MkClassType("bool");
14724 exp->cond.cond->destType->truth = 0x1;
14725 ProcessExpressionType(exp->cond.cond);
14726 if(!exp->cond.cond->isConstant)
14727 exp->isConstant = 0x0;
14728 for(e = (*exp->cond.exp).first; e; e = e->next)
14732 FreeType(e->destType);
14733 e->destType = exp->destType;
14735 e->destType->refCount++;
14737 ProcessExpressionType(e);
14740 exp->expType = e->expType;
14742 e->expType->refCount++;
14745 exp->isConstant = 0x0;
14747 FreeType(exp->cond.elseExp->destType);
14748 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14749 if(exp->cond.elseExp->destType)
14750 exp->cond.elseExp->destType->refCount++;
14751 ProcessExpressionType(exp->cond.elseExp);
14752 if(!exp->cond.elseExp->isConstant)
14753 exp->isConstant = 0x0;
14758 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14760 struct Statement * last = (*exp->compound->compound.statements).last;
14762 if(last->type == 3 && last->expressions && (*last->expressions).last)
14764 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14766 exp->destType->refCount++;
14768 ProcessStatement(exp->compound);
14769 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14771 exp->expType->refCount++;
14777 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14779 if(spec && spec->type == 1)
14781 exp->expType = MkClassType(spec->name);
14782 exp->expType->kind = 19;
14783 exp->byReference = 0x1;
14787 exp->expType = MkClassType("ecere::com::Class");
14788 exp->byReference = 0x1;
14794 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14798 struct Identifier * id = exp->classData.id;
14799 char structName[1024];
14800 struct Expression * classExp;
14802 strcpy(structName, "__ecereClassData_");
14803 FullClassNameCat(structName, _class->fullName, 0x0);
14805 exp->member.member = id;
14806 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14807 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14809 classExp = MkExpIdentifier(MkIdentifier("class"));
14810 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"))))))));
14811 ProcessExpressionType(exp);
14818 struct Type * type = (((void *)0));
14819 char * typeString = (((void *)0));
14820 char typeStringBuf[1024];
14822 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))
14824 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14826 typeString = templateClass->templateArgs[2].dataTypeString;
14830 struct Expression * e;
14832 for(e = (*exp->list).first; e; e = e->next)
14834 ProcessExpressionType(e);
14844 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14848 e->expType = (((void *)0));
14849 e = (*exp->list).first;
14850 ProcessExpressionType(e);
14853 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14855 FreeType(e->expType);
14856 e->expType = (((void *)0));
14858 type = (((void *)0));
14866 FreeType(e->expType);
14867 e->expType = (((void *)0));
14873 typeStringBuf[0] = '\0';
14874 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
14875 typeString = typeStringBuf;
14877 type = (((void *)0));
14882 char templateString[1024];
14883 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14884 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14885 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14886 struct Expression * expExt;
14887 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14889 sprintf(templateString, "Container<%s>", typeString);
14892 struct Expression * e;
14894 type = ProcessTypeString(typeString, 0x0);
14895 while(e = (*exp->list).first)
14897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14898 e->destType = type;
14900 ProcessExpressionType(e);
14901 ListAdd(initializers, MkInitializerAssignment(e));
14904 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14906 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14907 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14908 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14909 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14910 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14911 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14912 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14913 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14914 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14915 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
14916 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14918 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
14920 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14921 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14922 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14923 exp->expType = ProcessTypeString(templateString, 0x0);
14925 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14926 ProcessExpressionType(expExt);
14930 exp->expType = ProcessTypeString("Container", 0x0);
14931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14936 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14938 FreeType(exp->expType);
14939 exp->expType = ReplaceThisClassType(thisClass);
14941 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14943 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14947 if(exp->expType->kind != 15)
14949 struct Type * member;
14950 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14952 FreeType(exp->expType);
14953 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14954 exp->expType->kind = symbol->type->kind;
14955 exp->expType->refCount++;
14956 exp->expType->enumName = enumName;
14957 exp->expType->members = symbol->type->members;
14958 for(member = symbol->type->members.first; member; member = member->next)
14959 member->refCount++;
14963 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14965 for(member = symbol->type->members.first; member; member = member->next)
14967 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14975 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14977 else if(exp->destType && !exp->destType->keepCast)
14979 if(!CheckExpressionType(exp, exp->destType, 0x0))
14981 if(!exp->destType->count || unresolved)
14986 if(exp->destType->kind != 14)
14993 char expString[10240];
14995 expString[0] = '\0';
14996 PrintType(exp->destType, type2, 0x0, 0x1);
14999 PrintExpression(exp, expString);
15000 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15003 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
15004 else if(exp->type != 16)
15005 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
15010 char expString[10240];
15012 expString[0] = '\0';
15015 PrintExpression(exp, expString);
15016 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15019 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
15020 else if(exp->type != 16)
15021 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15033 PrintType(exp->expType, type1, 0x0, 0x1);
15034 PrintType(exp->destType, type2, 0x0, 0x1);
15036 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)))
15040 char expString[10240];
15042 expString[0] = '\0';
15045 PrintExpression(exp, expString);
15046 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15048 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
15049 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
15050 FreeType(exp->expType);
15051 exp->destType->refCount++;
15052 exp->expType = exp->destType;
15057 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
15059 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15060 char typeString[1024];
15061 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15062 struct Declarator * decl;
15064 typeString[0] = '\0';
15067 exp->expType->refCount++;
15069 exp->expType->refCount++;
15071 newExp->destType = exp->expType;
15072 PrintType(exp->expType, typeString, 0x0, 0x0);
15073 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15074 exp->cast.typeName = MkTypeName(specs, decl);
15075 exp->cast.exp = newExp;
15078 else if(unresolved)
15080 if(exp->identifier->_class && exp->identifier->_class->name)
15081 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
15082 else if(exp->identifier->string && exp->identifier->string[0])
15083 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
15085 else if(!exp->expType && exp->type != 16)
15087 char expString[10240];
15089 expString[0] = '\0';
15092 PrintExpression(exp, expString);
15093 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15098 ApplyAnyObjectLogic(exp);
15099 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1)))
15101 exp->byReference = 0x1;
15103 yylloc = oldyylloc;
15106 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)
15110 *curMember = (*curMember)->next;
15111 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
15113 *curMember = subMemberStack[--(*subMemberStackPos)];
15114 *curMember = (*curMember)->next;
15116 while((*curMember) && (*curMember)->isProperty)
15117 *curMember = (*curMember)->next;
15118 if(subMemberStackPos)
15120 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15122 subMemberStack[(*subMemberStackPos)++] = *curMember;
15123 *curMember = (*curMember)->members.first;
15124 while(*curMember && (*curMember)->isProperty)
15125 *curMember = (*curMember)->next;
15133 if(subMemberStackPos && *subMemberStackPos)
15135 *curMember = subMemberStack[--(*subMemberStackPos)];
15136 *curMember = (*curMember)->next;
15140 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15142 if(*curClass == _class)
15144 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15146 *curMember = (*curClass)->membersAndProperties.first;
15148 while((*curMember) && (*curMember)->isProperty)
15149 *curMember = (*curMember)->next;
15150 if(subMemberStackPos)
15152 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15154 subMemberStack[(*subMemberStackPos)++] = *curMember;
15155 *curMember = (*curMember)->members.first;
15156 while(*curMember && (*curMember)->isProperty)
15157 *curMember = (*curMember)->next;
15164 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15169 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15171 if(init->exp && !init->exp->destType)
15173 FreeType(init->exp->destType);
15174 init->exp->destType = type;
15180 ProcessExpressionType(init->exp);
15181 init->isConstant = init->exp->isConstant;
15187 struct Expression * exp = init->exp;
15188 struct Instantiation * inst = exp->instance;
15189 struct MembersInit * members;
15192 init->list = MkList();
15195 for(members = (*inst->members).first; members; members = members->next)
15197 if(members->type == 0)
15199 struct MemberInit * member;
15201 for(member = (*members->dataMembers).first; member; member = member->next)
15203 ListAdd(init->list, member->initializer);
15204 member->initializer = (((void *)0));
15209 FreeExpression(exp);
15213 struct Initializer * i;
15214 struct Type * initializerType = (((void *)0));
15215 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15216 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15217 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15218 int subMemberStackPos = 0;
15220 if(type && type->kind == 12)
15221 initializerType = Dereference(type);
15222 else if(type && (type->kind == 9 || type->kind == 10))
15223 initializerType = type->members.first;
15224 for(i = (*init->list).first; i; i = i->next)
15226 if(type && type->kind == 8 && type->_class && type->_class->registered)
15228 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15231 if(!curMember->dataType)
15232 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15233 initializerType = curMember->dataType;
15236 ProcessInitializer(i, initializerType);
15237 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15238 initializerType = initializerType->next;
15240 init->isConstant = 0x0;
15242 if(type && type->kind == 12)
15243 FreeType(initializerType);
15244 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15253 extern struct Symbol * FindType(struct Context * ctx, char * name);
15255 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15257 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15263 if(spec->specifier == THISCLASS)
15268 spec->name = ReplaceThisClass(thisClass);
15269 spec->symbol = FindClass(spec->name);
15270 ProcessSpecifier(spec, declareStruct);
15277 struct Symbol * symbol = FindType(curContext, spec->name);
15280 DeclareType(symbol->type, 0x1, 0x1);
15281 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15282 DeclareStruct(spec->name, 0x0);
15287 struct Enumerator * e;
15291 for(e = (*spec->list).first; e; e = e->next)
15294 ProcessExpressionType(e->exp);
15302 if(spec->definitions)
15304 struct ClassDef * def;
15305 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15307 ProcessClass(spec->definitions, symbol);
15314 static void ProcessDeclarator(struct Declarator * decl)
15319 if(decl->identifier->classSym)
15321 FreeSpecifier(decl->identifier->_class);
15322 decl->identifier->_class = (((void *)0));
15326 if(decl->array.exp)
15327 ProcessExpressionType(decl->array.exp);
15334 if(decl->declarator)
15335 ProcessDeclarator(decl->declarator);
15336 if(decl->type == 4)
15338 struct Identifier * id = GetDeclId(decl);
15340 if(id && id->_class)
15342 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15344 if(!decl->function.parameters)
15345 decl->function.parameters = MkList();
15346 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15347 id->_class = (((void *)0));
15349 if(decl->function.parameters)
15351 struct TypeName * param;
15353 for(param = (*decl->function.parameters).first; param; param = param->next)
15355 if(param->qualifiers && (*param->qualifiers).first)
15357 struct Specifier * spec = (*param->qualifiers).first;
15359 if(spec && spec->specifier == TYPED_OBJECT)
15361 struct Declarator * d = param->declarator;
15362 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);
15364 FreeList(param->qualifiers, FreeSpecifier);
15365 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15366 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15367 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15370 else if(spec && spec->specifier == ANY_OBJECT)
15372 struct Declarator * d = param->declarator;
15374 FreeList(param->qualifiers, FreeSpecifier);
15375 param->qualifiers = MkListOne(MkSpecifier(VOID));
15376 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15378 else if(spec->specifier == THISCLASS)
15383 spec->name = ReplaceThisClass(thisClass);
15384 spec->symbol = FindClass(spec->name);
15385 ProcessSpecifier(spec, 0x0);
15389 if(param->declarator)
15390 ProcessDeclarator(param->declarator);
15398 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15400 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15402 static void ProcessDeclaration(struct Declaration * decl)
15404 yylloc = decl->loc;
15409 unsigned int declareStruct = 0x0;
15411 if(decl->declarators)
15413 struct InitDeclarator * d;
15415 for(d = (*decl->declarators).first; d; d = d->next)
15417 struct Type * type, * subType;
15419 ProcessDeclarator(d->declarator);
15420 type = ProcessType(decl->specifiers, d->declarator);
15423 ProcessInitializer(d->initializer, type);
15424 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15426 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15428 struct Instantiation * inst = d->initializer->exp->instance;
15430 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15431 d->initializer->exp->instance = (((void *)0));
15432 if(decl->specifiers)
15433 FreeList(decl->specifiers, FreeSpecifier);
15434 FreeList(decl->declarators, FreeInitDeclarator);
15441 for(subType = type; subType; )
15443 if(subType->kind == 8)
15445 declareStruct = 0x1;
15448 else if(subType->kind == 13)
15450 else if(subType->kind == 12)
15451 subType = subType->arrayType;
15460 if(decl->specifiers)
15462 struct Specifier * s;
15464 for(s = (*decl->specifiers).first; s; s = s->next)
15466 ProcessSpecifier(s, declareStruct);
15473 ProcessInstantiationType(decl->inst);
15478 struct Specifier * spec;
15479 struct Declarator * d;
15480 unsigned int declareStruct = 0x0;
15482 if(decl->declarators)
15484 for(d = (*decl->declarators).first; d; d = d->next)
15486 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15487 struct Type * subType;
15489 ProcessDeclarator(d);
15490 for(subType = type; subType; )
15492 if(subType->kind == 8)
15494 declareStruct = 0x1;
15497 else if(subType->kind == 13)
15499 else if(subType->kind == 12)
15500 subType = subType->arrayType;
15507 if(decl->specifiers)
15509 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15510 ProcessSpecifier(spec, declareStruct);
15517 static struct FunctionDefinition * curFunction;
15519 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15521 char propName[1024], propNameM[1024];
15522 char getName[1024], setName[1024];
15523 struct __ecereNameSpace__ecere__sys__OldList * args;
15525 DeclareProperty(prop, setName, getName);
15526 strcpy(propName, "__ecereProp_");
15527 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15528 strcat(propName, "_");
15529 FullClassNameCat(propName, prop->name, 0x1);
15530 MangleClassName(propName);
15531 strcpy(propNameM, "__ecerePropM_");
15532 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15533 strcat(propNameM, "_");
15534 FullClassNameCat(propNameM, prop->name, 0x1);
15535 MangleClassName(propNameM);
15536 if(prop->isWatchable)
15539 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15540 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15541 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15543 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15544 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15545 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15549 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15550 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15551 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15553 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15554 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15555 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15557 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15558 curFunction->propSet->fireWatchersDone = 0x1;
15561 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15563 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15565 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15567 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15569 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15571 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15573 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15575 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15577 static void ProcessStatement(struct Statement * stmt)
15579 yylloc = stmt->loc;
15583 ProcessStatement(stmt->labeled.stmt);
15586 if(stmt->caseStmt.exp)
15588 FreeType(stmt->caseStmt.exp->destType);
15589 stmt->caseStmt.exp->destType = curSwitchType;
15591 curSwitchType->refCount++;
15592 ProcessExpressionType(stmt->caseStmt.exp);
15593 ComputeExpression(stmt->caseStmt.exp);
15595 if(stmt->caseStmt.stmt)
15596 ProcessStatement(stmt->caseStmt.stmt);
15600 if(stmt->compound.context)
15602 struct Declaration * decl;
15603 struct Statement * s;
15604 struct Statement * prevCompound = curCompound;
15605 struct Context * prevContext = curContext;
15607 if(!stmt->compound.isSwitch)
15609 curCompound = stmt;
15610 curContext = stmt->compound.context;
15612 if(stmt->compound.declarations)
15614 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15615 ProcessDeclaration(decl);
15617 if(stmt->compound.statements)
15619 for(s = (*stmt->compound.statements).first; s; s = s->next)
15620 ProcessStatement(s);
15622 curContext = prevContext;
15623 curCompound = prevCompound;
15629 struct Expression * exp;
15631 if(stmt->expressions)
15633 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15634 ProcessExpressionType(exp);
15640 struct Expression * exp;
15642 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15643 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15644 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15645 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15647 ProcessExpressionType(exp);
15649 if(stmt->ifStmt.stmt)
15650 ProcessStatement(stmt->ifStmt.stmt);
15651 if(stmt->ifStmt.elseStmt)
15652 ProcessStatement(stmt->ifStmt.elseStmt);
15657 struct Type * oldSwitchType = curSwitchType;
15659 if(stmt->switchStmt.exp)
15661 struct Expression * exp;
15663 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15667 ProcessExpressionType(exp);
15670 curSwitchType = exp->expType;
15673 ProcessStatement(stmt->switchStmt.stmt);
15674 curSwitchType = oldSwitchType;
15679 if(stmt->whileStmt.exp)
15681 struct Expression * exp;
15683 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15684 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15685 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15686 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15688 ProcessExpressionType(exp);
15691 if(stmt->whileStmt.stmt)
15692 ProcessStatement(stmt->whileStmt.stmt);
15697 if(stmt->doWhile.exp)
15699 struct Expression * exp;
15701 if((*stmt->doWhile.exp).last)
15703 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15704 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15705 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15707 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15709 ProcessExpressionType(exp);
15712 if(stmt->doWhile.stmt)
15713 ProcessStatement(stmt->doWhile.stmt);
15718 struct Expression * exp;
15720 if(stmt->forStmt.init)
15721 ProcessStatement(stmt->forStmt.init);
15722 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15724 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15725 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15726 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15728 if(stmt->forStmt.check)
15729 ProcessStatement(stmt->forStmt.check);
15730 if(stmt->forStmt.increment)
15732 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15733 ProcessExpressionType(exp);
15735 if(stmt->forStmt.stmt)
15736 ProcessStatement(stmt->forStmt.stmt);
15741 struct Identifier * id = stmt->forEachStmt.id;
15742 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15743 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15744 struct Statement * block = stmt->forEachStmt.stmt;
15745 char iteratorType[1024];
15746 struct Type * source;
15747 struct Expression * e;
15748 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));
15749 struct Expression * arrayExp;
15750 char * typeString = (((void *)0));
15751 int builtinCount = 0;
15753 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15757 FreeType(e->destType);
15758 e->destType = ProcessTypeString("Container", 0x0);
15760 if(!isBuiltin || e->next)
15761 ProcessExpressionType(e);
15763 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15764 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15766 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15767 struct Symbol * symbol;
15768 struct Expression * expIt = (((void *)0));
15769 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15770 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15771 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15772 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15775 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15776 stmt->compound.context->parent = curContext;
15777 curContext = stmt->compound.context;
15778 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15780 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15781 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15783 isCustomAVLTree = 0x1;
15784 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15786 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15789 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15791 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15793 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15796 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15800 struct Declarator * decl;
15801 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15803 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15804 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15805 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15809 struct Type * type = (((void *)0));
15810 char typeStringBuf[1024];
15812 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15813 if(((struct Expression *)(*exp).last)->type == 11)
15815 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15818 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15820 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)
15822 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15824 typeString = templateClass->templateArgs[2].dataTypeString;
15826 else if(arrayExp->list)
15828 struct Expression * e;
15830 for(e = (*arrayExp->list).first; e; e = e->next)
15832 ProcessExpressionType(e);
15842 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15846 e->expType = (((void *)0));
15847 e = (*arrayExp->list).first;
15848 ProcessExpressionType(e);
15851 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15853 FreeType(e->expType);
15854 e->expType = (((void *)0));
15856 type = (((void *)0));
15864 FreeType(e->expType);
15865 e->expType = (((void *)0));
15871 typeStringBuf[0] = '\0';
15872 PrintType(type, typeStringBuf, 0x0, 0x1);
15873 typeString = typeStringBuf;
15879 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15880 struct Declarator * decl;
15881 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15885 struct Expression * e;
15887 builtinCount = (*arrayExp->list).count;
15888 type = ProcessTypeString(typeString, 0x0);
15889 while(e = (*arrayExp->list).first)
15891 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15892 e->destType = type;
15894 ProcessExpressionType(e);
15895 ListAdd(initializers, MkInitializerAssignment(e));
15898 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15900 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15901 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15902 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15903 FreeList(exp, FreeExpression);
15907 arrayExp->expType = ProcessTypeString("Container", 0x0);
15908 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15911 else if(isLinkList && !isList)
15913 struct Declarator * decl;
15914 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15916 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15917 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15918 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15920 else if(_class->templateArgs)
15923 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15925 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15926 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15928 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15929 if(block && block->type == 2 && block->compound.context)
15931 block->compound.context->parent = stmt->compound.context;
15935 block = MkIfStmt(filter, block, (((void *)0)));
15939 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));
15940 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15941 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15942 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15948 sprintf(count, "%d", builtinCount);
15949 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));
15950 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15951 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15952 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15954 else if(isLinkList && !isList)
15956 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15957 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15959 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15961 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));
15965 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15966 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15968 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));
15970 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15971 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15972 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15976 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15978 ProcessExpressionType(expIt);
15979 if((*stmt->compound.declarations).first)
15980 ProcessDeclaration((*stmt->compound.declarations).first);
15982 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15983 ProcessStatement(stmt);
15984 curContext = stmt->compound.context->parent;
15989 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
16001 struct Expression * exp;
16003 if(stmt->expressions)
16005 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16009 if(curFunction && !curFunction->type)
16010 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
16011 FreeType(exp->destType);
16012 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
16014 exp->destType->refCount++;
16016 ProcessExpressionType(exp);
16023 ProcessDeclaration(stmt->decl);
16028 struct AsmField * field;
16030 if(stmt->asmStmt.inputFields)
16032 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
16033 if(field->expression)
16034 ProcessExpressionType(field->expression);
16036 if(stmt->asmStmt.outputFields)
16038 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
16039 if(field->expression)
16040 ProcessExpressionType(field->expression);
16042 if(stmt->asmStmt.clobberedFields)
16044 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
16046 if(field->expression)
16047 ProcessExpressionType(field->expression);
16054 struct PropertyWatch * propWatch;
16055 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16056 struct Expression * object = stmt->_watch.object;
16057 struct Expression * watcher = stmt->_watch.watcher;
16060 ProcessExpressionType(watcher);
16062 ProcessExpressionType(object);
16065 if(watcher || thisClass)
16067 struct External * external = curExternal;
16068 struct Context * context = curContext;
16071 stmt->expressions = MkList();
16072 curExternal = external->prev;
16073 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16075 struct ClassFunction * func;
16076 char watcherName[1024];
16077 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
16078 struct External * createdExternal;
16079 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
16081 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
16082 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
16083 if(propWatch->deleteWatch)
16084 strcat(watcherName, "_delete");
16087 struct Identifier * propID;
16089 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16091 strcat(watcherName, "_");
16092 strcat(watcherName, propID->string);
16095 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
16097 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
16098 ProcessClassFunctionBody(func, propWatch->compound);
16099 propWatch->compound = (((void *)0));
16100 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
16101 createdExternal->symbol->idCode = external->symbol->idCode;
16102 curExternal = createdExternal;
16103 ProcessFunction(createdExternal->function);
16105 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
16107 externalDecl->declaration = decl;
16108 if(decl->symbol && !decl->symbol->pointerExternal)
16109 decl->symbol->pointerExternal = externalDecl;
16111 if(propWatch->deleteWatch)
16113 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16115 ListAdd(args, CopyExpression(object));
16116 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16117 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16118 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16122 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16123 struct Identifier * propID;
16125 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16127 char propName[1024];
16128 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16132 char getName[1024], setName[1024];
16133 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16135 DeclareProperty(prop, setName, getName);
16136 strcpy(propName, "__ecereProp_");
16137 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16138 strcat(propName, "_");
16139 FullClassNameCat(propName, prop->name, 0x1);
16140 ListAdd(args, CopyExpression(object));
16141 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16142 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16143 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16144 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16147 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16154 curExternal = external;
16155 curContext = context;
16157 FreeExpression(watcher);
16159 FreeExpression(object);
16160 FreeList(watches, FreePropertyWatch);
16163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16167 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16169 ProcessStatement(propWatch->compound);
16176 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16177 struct Expression * object = stmt->_watch.object;
16178 struct __ecereNameSpace__ecere__com__Class * _class;
16181 ProcessExpressionType(object);
16184 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16187 struct Identifier * propID;
16190 stmt->expressions = MkList();
16191 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16193 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16200 for(propID = (*watches).first; propID; propID = propID->next)
16202 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16206 CreateFireWatcher(prop, object, stmt);
16209 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16214 struct __ecereNameSpace__ecere__com__Property * prop;
16215 struct __ecereNameSpace__ecere__com__Class * base;
16217 for(base = _class; base; base = base->base)
16219 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16221 if(prop->isProperty && prop->isWatchable)
16223 CreateFireWatcher(prop, object, stmt);
16229 FreeExpression(object);
16230 FreeList(watches, FreeIdentifier);
16233 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16239 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16240 struct Expression * object = stmt->_watch.object;
16241 struct Expression * watcher = stmt->_watch.watcher;
16242 struct __ecereNameSpace__ecere__com__Class * _class;
16245 ProcessExpressionType(object);
16247 ProcessExpressionType(watcher);
16250 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16251 if(watcher || thisClass)
16255 struct Identifier * propID;
16258 stmt->expressions = MkList();
16261 struct __ecereNameSpace__ecere__sys__OldList * args;
16264 ListAdd(args, CopyExpression(object));
16265 ListAdd(args, MkExpConstant("0"));
16266 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16267 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16271 for(propID = (*watches).first; propID; propID = propID->next)
16273 char propName[1024];
16274 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16278 char getName[1024], setName[1024];
16279 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16281 DeclareProperty(prop, setName, getName);
16282 strcpy(propName, "__ecereProp_");
16283 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16284 strcat(propName, "_");
16285 FullClassNameCat(propName, prop->name, 0x1);
16286 MangleClassName(propName);
16287 ListAdd(args, CopyExpression(object));
16288 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16289 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16290 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16293 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16297 FreeExpression(object);
16299 FreeExpression(watcher);
16300 FreeList(watches, FreeIdentifier);
16303 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16306 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16313 extern struct Expression * QBrackets(struct Expression * exp);
16315 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16317 extern struct Declarator * QMkPtrDecl(char * id);
16319 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16321 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16323 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16325 static void ProcessFunction(struct FunctionDefinition * function)
16327 struct Identifier * id = GetDeclId(function->declarator);
16328 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16329 struct Type * type = symbol ? symbol->type : (((void *)0));
16330 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16331 struct Context * oldTopContext = topContext;
16333 yylloc = function->loc;
16334 if(type && type->thisClass)
16336 struct Symbol * classSym = type->thisClass;
16337 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16338 char className[1024];
16339 char structName[1024];
16340 struct Declarator * funcDecl;
16341 struct Symbol * thisSymbol;
16342 unsigned int typedObject = 0x0;
16344 if(_class && !_class->base)
16346 _class = currentClass;
16347 if(_class && !_class->symbol)
16348 _class->symbol = FindClass(_class->fullName);
16349 classSym = _class ? _class->symbol : (((void *)0));
16352 thisClass = _class;
16353 if(inCompiler && _class)
16355 if(type->kind == 11)
16357 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16359 struct Type * param = symbol->type->params.first;
16361 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16364 if(type->classObjectType != 1)
16366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16367 symbol->type->staticMethod = 0x1;
16368 symbol->type->thisClass = (((void *)0));
16369 symbol->type->extraParam = 0x0;
16372 strcpy(className, "__ecereClass_");
16373 FullClassNameCat(className, _class->fullName, 0x1);
16374 MangleClassName(className);
16375 structName[0] = (char)0;
16376 FullClassNameCat(structName, _class->fullName, 0x0);
16377 funcDecl = GetFuncDecl(function->declarator);
16380 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16382 struct TypeName * param = (*funcDecl->function.parameters).first;
16384 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16386 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16387 FreeTypeName(param);
16390 if(!function->propertyNoThis)
16392 struct TypeName * thisParam;
16394 if(type->classObjectType != 1)
16396 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16397 if(!funcDecl->function.parameters)
16398 funcDecl->function.parameters = MkList();
16399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16403 if(type->classObjectType != 1)
16405 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16406 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16408 thisParam = __extension__ ({
16409 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16411 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16413 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16417 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16419 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16421 funcDecl = GetFuncDecl(initDecl->declarator);
16424 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16426 struct TypeName * param = (*funcDecl->function.parameters).first;
16428 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16431 FreeTypeName(param);
16434 if(type->classObjectType != 1)
16436 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16438 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16440 if(!funcDecl->function.parameters)
16441 funcDecl->function.parameters = MkList();
16442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16450 if(type->classObjectType != 1)
16452 thisSymbol = __extension__ ({
16453 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16455 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16457 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16458 if(typedObject && thisSymbol->type)
16460 thisSymbol->type->classObjectType = 2;
16461 thisSymbol->type->byReference = type->byReference;
16465 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16467 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16470 struct __ecereNameSpace__ecere__com__Class * base;
16472 for(base = _class; base && base->type != 1000; base = base->next)
16474 for(member = base->membersAndProperties.first; member; member = member->next)
16475 if(!member->isProperty)
16481 for(member = _class->membersAndProperties.first; member; member = member->next)
16482 if(!member->isProperty)
16486 char pointerName[1024];
16487 struct Declaration * decl;
16488 struct Initializer * initializer;
16489 struct Expression * exp, * bytePtr;
16491 strcpy(pointerName, "__ecerePointer_");
16492 FullClassNameCat(pointerName, _class->fullName, 0x0);
16494 char className[1024];
16496 strcpy(className, "__ecereClass_");
16497 FullClassNameCat(className, classSym->string, 0x1);
16498 MangleClassName(className);
16499 DeclareClass(classSym, className);
16501 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16506 sprintf(string, "%d", _class->offset);
16507 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16511 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16513 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16514 exp->expType = __extension__ ({
16515 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16517 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16518 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16520 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16521 }), __ecereInstance2;
16525 yylloc = function->body->loc;
16526 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16528 struct Context * prevContext = curContext;
16530 curContext = function->body->compound.context;
16531 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16532 curContext = prevContext;
16534 decl->symbol = (((void *)0));
16535 if(!function->body->compound.declarations)
16536 function->body->compound.declarations = MkList();
16537 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16543 thisClass = (((void *)0));
16546 FreeSpecifier(id->_class);
16547 id->_class = (((void *)0));
16548 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16550 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16552 id = GetDeclId(initDecl->declarator);
16553 FreeSpecifier(id->_class);
16554 id->_class = (((void *)0));
16558 topContext = function->body->compound.context;
16560 struct FunctionDefinition * oldFunction = curFunction;
16562 curFunction = function;
16564 ProcessStatement(function->body);
16565 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16567 struct Statement * prevCompound = curCompound;
16568 struct Context * prevContext = curContext;
16569 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16571 if(!function->body->compound.statements)
16572 function->body->compound.statements = MkList();
16573 ListAdd(function->body->compound.statements, fireWatchers);
16574 curCompound = function->body;
16575 curContext = function->body->compound.context;
16576 ProcessStatement(fireWatchers);
16577 curContext = prevContext;
16578 curCompound = prevCompound;
16580 curFunction = oldFunction;
16582 if(function->declarator)
16584 ProcessDeclarator(function->declarator);
16586 topContext = oldTopContext;
16587 thisClass = oldThisClass;
16590 extern void FreeSymbol(struct Symbol * symbol);
16592 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16594 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16596 struct ClassDef * def;
16597 struct External * external = curExternal;
16598 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16600 for(def = definitions->first; def; def = def->next)
16604 if(def->function->declarator)
16605 curExternal = def->function->declarator->symbol->pointerExternal;
16607 curExternal = external;
16608 ProcessFunction((struct FunctionDefinition *)def->function);
16610 else if(def->type == 2)
16612 if(def->decl->type == 2)
16614 thisClass = regClass;
16615 ProcessInstantiationType(def->decl->inst);
16616 thisClass = (((void *)0));
16620 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16623 thisClass = regClass;
16624 ProcessDeclaration(def->decl);
16625 thisClass = backThisClass;
16628 else if(def->type == 1 && def->defProperties)
16630 struct MemberInit * defProperty;
16631 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);
16633 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16634 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16636 thisClass = regClass;
16637 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16638 thisClass = (((void *)0));
16640 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16641 FreeSymbol(thisSymbol);
16643 else if(def->type == 3 && def->propertyDef)
16645 struct PropertyDef * prop = def->propertyDef;
16647 thisClass = regClass;
16652 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16654 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16656 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16657 ProcessStatement(prop->setStmt);
16663 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16665 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16667 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16668 ProcessStatement(prop->getStmt);
16670 if(prop->issetStmt)
16674 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16676 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16678 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16679 ProcessStatement(prop->issetStmt);
16681 thisClass = (((void *)0));
16683 else if(def->type == 4 && def->propertyWatch)
16685 struct PropertyWatch * propertyWatch = def->propertyWatch;
16687 thisClass = regClass;
16688 if(propertyWatch->compound)
16690 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);
16692 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16693 curExternal = (((void *)0));
16694 ProcessStatement(propertyWatch->compound);
16696 thisClass = (((void *)0));
16701 void DeclareFunctionUtil(char * s)
16703 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16710 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16711 strcpy(name, "__ecereFunction_");
16712 FullClassNameCat(name, s, 0x0);
16713 DeclareFunction(function, name);
16717 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16719 void ComputeDataTypes()
16721 struct External * external;
16722 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16723 struct External * after = (((void *)0));
16725 currentClass = (((void *)0));
16726 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16727 for(external = (*ast).first; external; external = external->next)
16729 if(external->type == 1)
16731 struct Declaration * decl = external->declaration;
16735 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16739 struct InitDeclarator * initDecl = (*decls).first;
16743 struct Declarator * declarator = initDecl->declarator;
16745 if(declarator && declarator->type == 1)
16747 struct Identifier * id = declarator->identifier;
16749 if(id && id->string)
16751 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16753 external->symbol->id = -1001, external->symbol->idCode = -1001;
16763 temp->symbol = __extension__ ({
16764 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16766 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16768 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16769 curExternal = temp;
16770 DeclareFunctionUtil("eSystem_New");
16771 DeclareFunctionUtil("eSystem_New0");
16772 DeclareFunctionUtil("eSystem_Renew");
16773 DeclareFunctionUtil("eSystem_Renew0");
16774 DeclareFunctionUtil("eClass_GetProperty");
16775 DeclareStruct("ecere::com::Class", 0x0);
16776 DeclareStruct("ecere::com::Instance", 0x0);
16777 DeclareStruct("ecere::com::Property", 0x0);
16778 DeclareStruct("ecere::com::DataMember", 0x0);
16779 DeclareStruct("ecere::com::Method", 0x0);
16780 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16781 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16782 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16783 for(external = (*ast).first; external; external = external->next)
16785 afterExternal = curExternal = external;
16786 if(external->type == 0)
16788 currentClass = external->function->_class;
16789 ProcessFunction(external->function);
16791 else if(external->type == 1)
16793 currentClass = (((void *)0));
16794 ProcessDeclaration(external->declaration);
16796 else if(external->type == 2)
16798 struct ClassDefinition * _class = external->_class;
16800 currentClass = external->symbol->registered;
16801 if(_class->definitions)
16803 ProcessClass(_class->definitions, _class->symbol);
16807 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16808 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16811 else if(external->type == 4)
16813 thisNameSpace = external->id->string;
16816 currentClass = (((void *)0));
16817 thisNameSpace = (((void *)0));
16818 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16819 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16822 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);
16824 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16826 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16828 struct __ecereNameSpace__ecere__com__Class * class;
16830 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16831 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16832 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16833 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16834 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16835 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16836 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16837 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16838 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16839 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16840 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16841 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16842 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16843 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16844 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16845 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16846 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16847 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16848 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16849 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16850 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16851 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16852 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16853 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16854 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16855 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16856 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16857 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16858 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16859 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16860 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16861 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16862 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16863 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16864 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16865 __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);
16866 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16867 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16868 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16869 __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);
16870 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16871 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16872 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16873 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16874 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16875 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16876 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16877 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16878 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16879 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16880 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16881 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16882 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16883 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16884 __ecereClass_Conversion = class;
16885 __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);
16886 __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);
16887 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16888 __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);
16889 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16890 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16891 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16892 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16893 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16894 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16895 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16896 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16897 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16898 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16899 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
16900 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16901 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16902 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16903 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16904 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16905 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16906 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16909 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)