1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
57 struct __ecereNameSpace__ecere__sys__BTNode;
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
61 struct __ecereNameSpace__ecere__sys__BinaryTree
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
65 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (* FreeKey)(void * key);
67 } __attribute__ ((gcc_struct));
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
71 struct __ecereNameSpace__ecere__sys__OldList
78 } __attribute__ ((gcc_struct));
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
82 struct __ecereNameSpace__ecere__com__Method
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
92 struct __ecereNameSpace__ecere__com__Class * _class;
94 char * dataTypeString;
95 struct Type * dataType;
97 } __attribute__ ((gcc_struct));
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
101 struct __ecereNameSpace__ecere__com__Property
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
106 unsigned int isProperty;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char * dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (* Set)(void * , int);
114 int (* Get)(void * );
115 unsigned int (* IsSet)(void * );
119 unsigned int conversion;
120 unsigned int watcherOffset;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
135 } __attribute__ ((gcc_struct));
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
164 struct ClassDefinition
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList * definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
201 struct Instantiation * prev;
202 struct Instantiation * next;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList * members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char * data;
211 struct Location nameLoc;
212 struct Location insideLoc;
214 } __attribute__ ((gcc_struct));
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
220 struct Declaration * prev;
221 struct Declaration * next;
228 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList * declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
241 } __attribute__ ((gcc_struct));
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
247 struct Statement * prev;
248 struct Statement * next;
253 struct __ecereNameSpace__ecere__sys__OldList * expressions;
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
305 struct Specifier * spec;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
332 struct TypeName * prev;
333 struct TypeName * next;
335 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
336 struct Declarator * declarator;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
345 struct Initializer * prev;
346 struct Initializer * next;
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList * list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 struct Identifier * id;
356 } __attribute__ ((gcc_struct));
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
360 struct __ecereNameSpace__ecere__com__DataValue
375 } __attribute__ ((gcc_struct));
376 } __attribute__ ((gcc_struct));
378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
382 struct Expression * prev;
383 struct Expression * next;
391 struct Identifier * identifier;
392 } __attribute__ ((gcc_struct));
393 struct Statement * compound;
394 struct Instantiation * instance;
398 unsigned int intlString;
399 } __attribute__ ((gcc_struct));
400 struct __ecereNameSpace__ecere__sys__OldList * list;
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
423 struct Expression * exp;
424 struct Identifier * member;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct));
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
497 struct TemplateDatatype
499 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
500 struct Declarator * decl;
501 } __attribute__ ((gcc_struct));
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
505 struct TemplateArgument;
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
509 struct TemplateParameter
511 struct TemplateParameter * prev;
512 struct TemplateParameter * next;
515 struct Identifier * identifier;
518 struct TemplateDatatype * dataType;
520 } __attribute__ ((gcc_struct));
521 struct TemplateArgument * defaultArgument;
522 char * dataTypeString;
523 struct Type * baseType;
524 } __attribute__ ((gcc_struct));
526 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
530 struct Specifier * prev;
531 struct Specifier * next;
539 struct ExtDecl * extDecl;
541 struct Symbol * symbol;
542 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
543 } __attribute__ ((gcc_struct));
546 struct Identifier * id;
547 struct __ecereNameSpace__ecere__sys__OldList * list;
548 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
549 struct __ecereNameSpace__ecere__sys__OldList * definitions;
550 unsigned int addNameSpace;
551 struct Context * ctx;
552 struct ExtDecl * extDeclStruct;
553 } __attribute__ ((gcc_struct));
554 struct Expression * expression;
555 struct Specifier * _class;
556 struct TemplateParameter * templateParameter;
557 } __attribute__ ((gcc_struct));
558 } __attribute__ ((gcc_struct));
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
564 struct Identifier * prev;
565 struct Identifier * next;
567 struct Symbol * classSym;
568 struct Specifier * _class;
570 struct Identifier * badID;
571 } __attribute__ ((gcc_struct));
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
577 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
581 struct Declarator * prev;
582 struct Declarator * next;
585 struct Symbol * symbol;
586 struct Declarator * declarator;
589 struct Identifier * identifier;
592 struct Expression * exp;
593 struct Expression * posExp;
594 struct Attrib * attrib;
595 } __attribute__ ((gcc_struct)) structDecl;
598 struct Expression * exp;
599 struct Specifier * enumClass;
600 } __attribute__ ((gcc_struct)) array;
603 struct __ecereNameSpace__ecere__sys__OldList * parameters;
604 } __attribute__ ((gcc_struct)) function;
607 struct Pointer * pointer;
608 } __attribute__ ((gcc_struct)) pointer;
611 struct ExtDecl * extended;
612 } __attribute__ ((gcc_struct)) extended;
613 } __attribute__ ((gcc_struct));
614 } __attribute__ ((gcc_struct));
616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
618 struct FunctionDefinition
620 struct FunctionDefinition * prev;
621 struct FunctionDefinition * next;
623 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
624 struct Declarator * declarator;
625 struct __ecereNameSpace__ecere__sys__OldList * declarations;
626 struct Statement * body;
627 struct __ecereNameSpace__ecere__com__Class * _class;
628 struct __ecereNameSpace__ecere__sys__OldList attached;
631 struct Symbol * propSet;
633 unsigned int propertyNoThis;
634 } __attribute__ ((gcc_struct));
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
644 struct External * prev;
645 struct External * next;
648 struct Symbol * symbol;
651 struct FunctionDefinition * function;
652 struct ClassDefinition * _class;
653 struct Declaration * declaration;
655 struct Identifier * id;
656 struct DBTableDef * table;
657 } __attribute__ ((gcc_struct));
659 } __attribute__ ((gcc_struct));
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
665 struct ModuleImport * prev;
666 struct ModuleImport * next;
668 struct __ecereNameSpace__ecere__sys__OldList classes;
669 struct __ecereNameSpace__ecere__sys__OldList functions;
672 } __attribute__ ((gcc_struct));
674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
678 struct ClassImport * prev;
679 struct ClassImport * next;
681 struct __ecereNameSpace__ecere__sys__OldList methods;
682 struct __ecereNameSpace__ecere__sys__OldList properties;
685 } __attribute__ ((gcc_struct));
687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
692 struct Symbol * parent;
693 struct Symbol * left;
694 struct Symbol * right;
699 struct __ecereNameSpace__ecere__com__Method * method;
700 struct __ecereNameSpace__ecere__com__Property * _property;
701 struct __ecereNameSpace__ecere__com__Class * registered;
702 } __attribute__ ((gcc_struct));
709 struct External * pointerExternal;
710 struct External * structExternal;
711 } __attribute__ ((gcc_struct));
714 struct External * externalGet;
715 struct External * externalSet;
716 struct External * externalPtr;
717 struct External * externalIsSet;
718 } __attribute__ ((gcc_struct));
721 struct External * methodExternal;
722 struct External * methodCodeExternal;
723 } __attribute__ ((gcc_struct));
724 } __attribute__ ((gcc_struct));
725 unsigned int imported;
726 unsigned int declaredStructSym;
727 struct __ecereNameSpace__ecere__com__Class * _class;
728 unsigned int declaredStruct;
729 unsigned int needConstructor;
730 unsigned int needDestructor;
731 char * constructorName;
734 char * destructorName;
735 struct ModuleImport * module;
736 struct ClassImport * _import;
737 struct Location nameLoc;
738 unsigned int isParam;
739 unsigned int isRemote;
740 unsigned int isStruct;
741 unsigned int fireWatchersDone;
743 unsigned int classData;
744 unsigned int isStatic;
746 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
747 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
748 struct Context * ctx;
750 struct Expression * propCategory;
751 } __attribute__ ((gcc_struct));
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
762 struct Symbol * _class;
765 struct __ecereNameSpace__ecere__sys__OldList members;
767 } __attribute__ ((gcc_struct));
770 struct Type * returnType;
771 struct __ecereNameSpace__ecere__sys__OldList params;
772 struct Symbol * thisClass;
773 unsigned int staticMethod;
774 struct TemplateParameter * thisClassTemplate;
775 } __attribute__ ((gcc_struct));
778 struct __ecereNameSpace__ecere__com__Method * method;
779 struct __ecereNameSpace__ecere__com__Class * methodClass;
780 struct __ecereNameSpace__ecere__com__Class * usedClass;
781 } __attribute__ ((gcc_struct));
784 struct Type * arrayType;
786 struct Expression * arraySizeExp;
787 unsigned int freeExp;
788 struct Symbol * enumClass;
789 } __attribute__ ((gcc_struct));
791 struct TemplateParameter * templateParameter;
792 } __attribute__ ((gcc_struct));
802 unsigned int isSigned : 1;
803 unsigned int constant : 1;
804 unsigned int truth : 1;
805 unsigned int byReference : 1;
806 unsigned int extraParam : 1;
807 unsigned int directClassAccess : 1;
808 unsigned int computing : 1;
809 unsigned int keepCast : 1;
810 unsigned int passAsTemplate : 1;
811 unsigned int dllExport : 1;
812 unsigned int attrStdcall : 1;
813 unsigned int declaredWithStruct : 1;
814 unsigned int typedByReference : 1;
815 } __attribute__ ((gcc_struct));
817 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
819 struct __ecereNameSpace__ecere__com__Class
821 struct __ecereNameSpace__ecere__com__Class * prev;
822 struct __ecereNameSpace__ecere__com__Class * next;
828 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
829 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
832 struct __ecereNameSpace__ecere__com__Class * base;
833 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
834 struct __ecereNameSpace__ecere__sys__BinaryTree members;
835 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
836 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
837 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
838 struct __ecereNameSpace__ecere__sys__OldList derivatives;
842 struct __ecereNameSpace__ecere__com__Instance * module;
843 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
844 char * dataTypeString;
845 struct Type * dataType;
847 int defaultAlignment;
848 void (* Initialize)();
850 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
851 char * designerClass;
852 unsigned int noExpansion;
853 char * defaultProperty;
854 unsigned int comRedefinition;
857 unsigned int internalDecl;
859 unsigned int computeSize;
861 int destructionWatchOffset;
863 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
864 int inheritanceAccess;
867 struct __ecereNameSpace__ecere__sys__OldList conversions;
868 struct __ecereNameSpace__ecere__sys__OldList templateParams;
869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
870 struct __ecereNameSpace__ecere__com__Class * templateClass;
871 struct __ecereNameSpace__ecere__sys__OldList templatized;
873 unsigned int isInstanceClass;
874 unsigned int byValueSystemClass;
875 } __attribute__ ((gcc_struct));
877 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
879 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
881 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
883 struct __ecereNameSpace__ecere__com__Instance
886 struct __ecereNameSpace__ecere__com__Class * _class;
888 } __attribute__ ((gcc_struct));
890 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
892 struct __ecereNameSpace__ecere__com__DataMember
894 struct __ecereNameSpace__ecere__com__DataMember * prev;
895 struct __ecereNameSpace__ecere__com__DataMember * next;
897 unsigned int isProperty;
900 struct __ecereNameSpace__ecere__com__Class * _class;
901 char * dataTypeString;
902 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
903 struct Type * dataType;
907 struct __ecereNameSpace__ecere__sys__OldList members;
908 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
911 } __attribute__ ((gcc_struct));
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
915 struct __ecereNameSpace__ecere__com__SerialBuffer
917 unsigned char * _buffer;
921 } __attribute__ ((gcc_struct));
923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
925 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
931 char * dataTypeString;
932 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
933 } __attribute__ ((gcc_struct));
934 struct __ecereNameSpace__ecere__com__DataValue expression;
940 struct __ecereNameSpace__ecere__com__DataMember * member;
941 struct __ecereNameSpace__ecere__com__Property * prop;
942 struct __ecereNameSpace__ecere__com__Method * method;
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945 } __attribute__ ((gcc_struct));
946 } __attribute__ ((gcc_struct));
948 void exit(int status);
950 void * calloc(size_t nmemb, size_t size);
952 void free(void * ptr);
954 void * malloc(size_t size);
956 void * realloc(void * ptr, size_t size);
958 long int strtol(const char * nptr, char ** endptr, int base);
960 long long int strtoll(const char * nptr, char ** endptr, int base);
962 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
966 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, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
969 typedef union YYSTYPE
974 struct Identifier * id;
975 struct Expression * exp;
976 struct Specifier * specifier;
977 struct __ecereNameSpace__ecere__sys__OldList * list;
978 struct Enumerator * enumerator;
979 struct Declarator * declarator;
980 struct Pointer * pointer;
981 struct Initializer * initializer;
982 struct InitDeclarator * initDeclarator;
983 struct TypeName * typeName;
984 struct Declaration * declaration;
985 struct Statement * stmt;
986 struct FunctionDefinition * function;
987 struct External * external;
988 struct Context * context;
989 struct AsmField * asmField;
990 struct Attrib * attrib;
991 struct ExtDecl * extDecl;
992 struct Attribute * attribute;
993 struct Instantiation * instance;
994 struct MembersInit * membersInit;
995 struct MemberInit * memberInit;
996 struct ClassFunction * classFunction;
997 struct ClassDefinition * _class;
998 struct ClassDef * classDef;
999 struct PropertyDef * prop;
1001 struct Symbol * symbol;
1002 struct PropertyWatch * propertyWatch;
1003 struct TemplateParameter * templateParameter;
1004 struct TemplateArgument * templateArgument;
1005 struct TemplateDatatype * templateDatatype;
1006 struct DBTableEntry * dbtableEntry;
1007 struct DBIndexItem * dbindexItem;
1008 struct DBTableDef * dbtableDef;
1009 } __attribute__ ((gcc_struct)) YYSTYPE;
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1015 struct Enumerator * prev;
1016 struct Enumerator * next;
1017 struct Location loc;
1018 struct Identifier * id;
1019 struct Expression * exp;
1020 } __attribute__ ((gcc_struct));
1022 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1024 struct InitDeclarator
1026 struct InitDeclarator * prev;
1027 struct InitDeclarator * next;
1028 struct Location loc;
1029 struct Declarator * declarator;
1030 struct Initializer * initializer;
1031 } __attribute__ ((gcc_struct));
1033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1037 struct AsmField * prev;
1038 struct AsmField * next;
1039 struct Location loc;
1041 struct Expression * expression;
1042 struct Identifier * symbolic;
1043 } __attribute__ ((gcc_struct));
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1051 struct ClassFunction
1053 struct ClassFunction * prev;
1054 struct ClassFunction * next;
1055 struct Location loc;
1056 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1057 struct Declarator * declarator;
1058 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1059 struct Statement * body;
1060 struct __ecereNameSpace__ecere__com__Class * _class;
1061 struct __ecereNameSpace__ecere__sys__OldList attached;
1064 struct Symbol * propSet;
1065 unsigned int isVirtual;
1066 unsigned int isConstructor;
1067 unsigned int isDestructor;
1068 unsigned int dontMangle;
1071 } __attribute__ ((gcc_struct));
1073 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1077 struct MembersInit * prev;
1078 struct MembersInit * next;
1079 struct Location loc;
1083 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1084 struct ClassFunction * function;
1085 } __attribute__ ((gcc_struct));
1086 } __attribute__ ((gcc_struct));
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1092 struct MemberInit * prev;
1093 struct MemberInit * next;
1094 struct Location loc;
1095 struct Location realLoc;
1096 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1097 struct Initializer * initializer;
1099 unsigned int variable;
1100 unsigned int takeOutExp;
1101 } __attribute__ ((gcc_struct));
1103 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1107 struct PropertyDef * prev;
1108 struct PropertyDef * next;
1109 struct Location loc;
1110 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1111 struct Declarator * declarator;
1112 struct Identifier * id;
1113 struct Statement * getStmt;
1114 struct Statement * setStmt;
1115 struct Statement * issetStmt;
1116 struct Symbol * symbol;
1117 struct Expression * category;
1120 unsigned int conversion : 1;
1121 unsigned int isWatchable : 1;
1122 unsigned int isDBProp : 1;
1123 } __attribute__ ((gcc_struct));
1124 } __attribute__ ((gcc_struct));
1126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1128 struct PropertyWatch
1130 struct PropertyWatch * prev;
1131 struct PropertyWatch * next;
1132 struct Location loc;
1133 struct Statement * compound;
1134 struct __ecereNameSpace__ecere__sys__OldList * properties;
1135 unsigned int deleteWatch;
1136 } __attribute__ ((gcc_struct));
1138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1142 struct ClassDef * prev;
1143 struct ClassDef * next;
1144 struct Location loc;
1148 struct Declaration * decl;
1149 struct ClassFunction * function;
1150 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1151 struct PropertyDef * propertyDef;
1152 struct PropertyWatch * propertyWatch;
1154 struct Identifier * defaultProperty;
1157 struct Identifier * id;
1158 struct Initializer * initializer;
1159 } __attribute__ ((gcc_struct));
1160 } __attribute__ ((gcc_struct));
1163 } __attribute__ ((gcc_struct));
1165 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1167 struct DBTableEntry;
1169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1173 extern YYSTYPE yylval;
1175 extern struct Location yylloc;
1177 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1179 extern int returnCode;
1181 extern struct Expression * parsedExpression;
1183 extern unsigned int yydebug;
1185 void SetYydebug(unsigned int b)
1190 extern unsigned int echoOn;
1192 void resetScanner();
1196 int expression_yyparse();
1198 static struct Statement * curCompound;
1200 struct External * curExternal, * afterExternal;
1202 static struct Type * curSwitchType;
1204 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1206 struct __ecereNameSpace__ecere__com__Class * thisClass;
1208 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1213 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1218 static char * thisNameSpace;
1220 struct __ecereNameSpace__ecere__com__Class * containerClass;
1222 unsigned int thisClassParams = 0x1;
1224 unsigned int internalValueCounter;
1226 extern unsigned int outputLineNumbers;
1228 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1230 extern size_t strlen(const char * );
1232 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1234 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1236 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1238 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1240 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1242 void PrintExpression(struct Expression * exp, char * string)
1245 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1247 unsigned int backOutputLineNumbers = outputLineNumbers;
1249 outputLineNumbers = 0x0;
1251 OutputExpression(exp, f);
1252 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1253 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1255 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1256 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1257 count = strlen(string);
1258 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1259 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1261 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1262 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1263 string[count] = '\0';
1264 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1265 outputLineNumbers = backOutputLineNumbers;
1269 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1271 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1273 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1275 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1277 if(!param->baseType)
1279 if(param->dataTypeString)
1280 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1282 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1284 return param->baseType;
1286 return (((void *)0));
1289 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1291 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1293 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1297 if(type1->kind == type2->kind)
1308 if(type1->passAsTemplate && !type2->passAsTemplate)
1310 return type1->isSigned != type2->isSigned;
1312 return type1->_class != type2->_class;
1314 return NeedCast(type1->type, type2->type);
1322 extern int strcmp(const char * , const char * );
1324 extern struct Context * curContext;
1326 extern struct Context * topContext;
1328 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1330 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);
1332 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1334 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);
1336 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);
1338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1340 struct __ecereNameSpace__ecere__com__ClassProperty
1343 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1344 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1345 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1347 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1348 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1349 char * dataTypeString;
1350 struct Type * dataType;
1351 unsigned int constant;
1352 } __attribute__ ((gcc_struct));
1354 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1356 extern struct Expression * QMkExpId(char * id);
1358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1360 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1362 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1363 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1368 char * dataTypeString;
1370 } __attribute__ ((gcc_struct));
1371 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1373 } __attribute__ ((gcc_struct));
1375 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1377 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1379 extern void FreeIdentifier(struct Identifier * id);
1381 void ProcessExpressionType(struct Expression * exp);
1383 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1385 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1387 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1389 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1391 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1393 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1395 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1397 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1399 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1401 if(exp->type == 0 && exp->identifier)
1403 struct Identifier * id = exp->identifier;
1404 struct Context * ctx;
1405 struct Symbol * symbol = (((void *)0));
1407 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1409 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1411 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1416 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1418 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1419 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1420 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1421 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1425 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1427 if(!prop && !method)
1428 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1429 if(!prop && !method && !member)
1431 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1433 if(prop || method || member || classProp)
1436 exp->member.member = id;
1437 exp->member.memberType = 0;
1438 exp->member.exp = QMkExpId("this");
1439 exp->addedThis = 0x1;
1441 else if(_class && _class->templateParams.first)
1443 struct __ecereNameSpace__ecere__com__Class * sClass;
1445 for(sClass = _class; sClass; sClass = sClass->base)
1447 if(sClass->templateParams.first)
1449 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1451 for(param = sClass->templateParams.first; param; param = param->next)
1453 if(param->type == 2 && !strcmp(param->name, id->string))
1455 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1459 struct Declarator * decl;
1460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1462 FreeIdentifier(exp->member.member);
1463 ProcessExpressionType(argExp);
1464 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1465 exp->expType = ProcessType(specs, decl);
1467 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1478 extern int sprintf(char * , char * , ...);
1480 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1482 extern char * strcat(char * , const char * );
1484 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1486 char * PrintInt(long long result)
1490 if(result > (((int)0x7fffffff)))
1491 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1494 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1496 return __ecereNameSpace__ecere__sys__CopyString(temp);
1499 char * PrintUInt(uint64 result)
1503 if(result > (0xffffffff))
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1505 else if(result > (((int)0x7fffffff)))
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1508 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1512 char * PrintInt64(long long result)
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1520 char * PrintUInt64(uint64 result)
1524 if(result > (((long long)0x7fffffffffffffffLL)))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 char * PrintHexUInt(uint64 result)
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 if(result > (0xffffffff))
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 char * PrintHexUInt64(uint64 result)
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1551 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1552 return __ecereNameSpace__ecere__sys__CopyString(temp);
1555 char * PrintShort(short result)
1559 sprintf(temp, "%d", (unsigned short)result);
1560 return __ecereNameSpace__ecere__sys__CopyString(temp);
1563 char * PrintUShort(unsigned short result)
1567 if(result > (unsigned short)32767)
1568 sprintf(temp, "0x%X", (int)result);
1570 sprintf(temp, "%d", (int)result);
1571 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 extern int isprint(int c);
1576 char * PrintChar(char result)
1580 if(result > (char)0 && isprint(result))
1581 sprintf(temp, "'%c'", result);
1582 else if(result < (char)0)
1583 sprintf(temp, "%d", (int)result);
1585 sprintf(temp, "0x%X", (unsigned char)result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1589 char * PrintUChar(unsigned char result)
1593 sprintf(temp, "0x%X", result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1597 extern char * strcpy(char * , const char * );
1599 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1601 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1603 extern int (* __ecereProp_float_Get_signBit)(float this);
1605 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1607 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1609 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1611 char * PrintFloat(float result)
1615 if(__ecereProp_float_Get_isInf(result))
1617 if(__ecereProp_float_Get_signBit(result))
1618 strcpy(temp, "-inf");
1620 strcpy(temp, "inf");
1622 else if(__ecereProp_float_Get_isNan(result))
1624 if(__ecereProp_float_Get_signBit(result))
1625 strcpy(temp, "-nan");
1627 strcpy(temp, "nan");
1630 sprintf(temp, "%.16ff", result);
1631 return __ecereNameSpace__ecere__sys__CopyString(temp);
1634 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1636 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1638 extern int (* __ecereProp_double_Get_signBit)(double this);
1640 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1642 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1644 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1646 char * PrintDouble(double result)
1650 if(__ecereProp_double_Get_isInf(result))
1652 if(__ecereProp_double_Get_signBit(result))
1653 strcpy(temp, "-inf");
1655 strcpy(temp, "inf");
1657 else if(__ecereProp_double_Get_isNan(result))
1659 if(__ecereProp_double_Get_signBit(result))
1660 strcpy(temp, "-nan");
1662 strcpy(temp, "nan");
1665 sprintf(temp, "%.16f", result);
1666 return __ecereNameSpace__ecere__sys__CopyString(temp);
1669 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1673 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* Neg)(struct Expression *, struct Operand *);
1679 unsigned int (* Inc)(struct Expression *, struct Operand *);
1680 unsigned int (* Dec)(struct Expression *, struct Operand *);
1681 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1693 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* Not)(struct Expression *, struct Operand *);
1699 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1708 } __attribute__ ((gcc_struct));
1710 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1716 unsigned int ptrSize;
1729 } __attribute__ ((gcc_struct));
1731 } __attribute__ ((gcc_struct));
1733 unsigned int GetOpInt(struct Operand * op2, int * value2)
1735 if(op2->kind == 3 && op2->type->isSigned)
1737 else if(op2->kind == 3)
1738 *value2 = (int)op2->ui;
1739 else if(op2->kind == 4 && op2->type->isSigned)
1740 *value2 = (int)op2->i64;
1741 else if(op2->kind == 4)
1742 *value2 = (int)op2->ui64;
1743 else if(op2->kind == 23 && op2->type->isSigned)
1744 *value2 = (int)op2->i64;
1745 else if(op2->kind == 23)
1746 *value2 = (int)op2->ui64;
1747 else if(op2->kind == 22 && op2->type->isSigned)
1748 *value2 = (int)op2->i64;
1749 else if(op2->kind == 22)
1750 *value2 = (int)op2->ui64;
1751 else if(op2->kind == 2 && op2->type->isSigned)
1752 *value2 = (int)op2->s;
1753 else if(op2->kind == 2)
1754 *value2 = (int)op2->us;
1755 else if(op2->kind == 1 && op2->type->isSigned)
1756 *value2 = (int)op2->c;
1757 else if(op2->kind == 24 || op2->kind == 1)
1758 *value2 = (int)op2->uc;
1759 else if(op2->kind == 6)
1760 *value2 = (int)op2->f;
1761 else if(op2->kind == 7)
1762 *value2 = (int)op2->d;
1763 else if(op2->kind == 13)
1764 *value2 = (int)op2->ui64;
1770 struct Operand GetOperand(struct Expression * exp);
1772 unsigned int GetInt(struct Expression * exp, int * value2)
1774 struct Operand op2 = GetOperand(exp);
1776 return GetOpInt(&op2, value2);
1779 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1781 if(op2->kind == 3 && op2->type->isSigned)
1782 *value2 = (unsigned int)op2->i;
1783 else if(op2->kind == 3)
1785 else if(op2->kind == 4 && op2->type->isSigned)
1786 *value2 = (unsigned int)op2->i64;
1787 else if(op2->kind == 4)
1788 *value2 = (unsigned int)op2->ui64;
1789 else if(op2->kind == 23 && op2->type->isSigned)
1790 *value2 = (unsigned int)op2->i64;
1791 else if(op2->kind == 23)
1792 *value2 = (unsigned int)op2->ui64;
1793 else if(op2->kind == 22 && op2->type->isSigned)
1794 *value2 = (unsigned int)op2->i64;
1795 else if(op2->kind == 22)
1796 *value2 = (unsigned int)op2->ui64;
1797 else if(op2->kind == 2 && op2->type->isSigned)
1798 *value2 = (unsigned int)op2->s;
1799 else if(op2->kind == 2)
1800 *value2 = (unsigned int)op2->us;
1801 else if(op2->kind == 1 && op2->type->isSigned)
1802 *value2 = (unsigned int)op2->c;
1803 else if(op2->kind == 24 || op2->kind == 1)
1804 *value2 = (unsigned int)op2->uc;
1805 else if(op2->kind == 6)
1806 *value2 = (unsigned int)op2->f;
1807 else if(op2->kind == 7)
1808 *value2 = (unsigned int)op2->d;
1809 else if(op2->kind == 13)
1810 *value2 = (unsigned int)op2->ui64;
1816 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1818 struct Operand op2 = GetOperand(exp);
1820 return GetOpUInt(&op2, value2);
1823 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1825 if(op2->kind == 3 && op2->type->isSigned)
1826 *value2 = (long long)op2->i;
1827 else if(op2->kind == 3)
1828 *value2 = (long long)op2->ui;
1829 else if(op2->kind == 4 && op2->type->isSigned)
1831 else if(op2->kind == 4)
1832 *value2 = (long long)op2->ui64;
1833 else if(op2->kind == 23 && op2->type->isSigned)
1835 else if(op2->kind == 23)
1836 *value2 = (long long)op2->ui64;
1837 else if(op2->kind == 22 && op2->type->isSigned)
1839 else if(op2->kind == 22)
1840 *value2 = (long long)op2->ui64;
1841 else if(op2->kind == 2 && op2->type->isSigned)
1842 *value2 = (long long)op2->s;
1843 else if(op2->kind == 2)
1844 *value2 = (long long)op2->us;
1845 else if(op2->kind == 1 && op2->type->isSigned)
1846 *value2 = (long long)op2->c;
1847 else if(op2->kind == 24 || op2->kind == 1)
1848 *value2 = (long long)op2->uc;
1849 else if(op2->kind == 6)
1850 *value2 = (long long)op2->f;
1851 else if(op2->kind == 7)
1852 *value2 = (long long)op2->d;
1853 else if(op2->kind == 13)
1854 *value2 = (long long)op2->ui64;
1860 unsigned int GetInt64(struct Expression * exp, long long * value2)
1862 struct Operand op2 = GetOperand(exp);
1864 return GetOpInt64(&op2, value2);
1867 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1869 if(op2->kind == 3 && op2->type->isSigned)
1870 *value2 = (uint64)op2->i;
1871 else if(op2->kind == 3)
1872 *value2 = (uint64)op2->ui;
1873 else if(op2->kind == 4 && op2->type->isSigned)
1874 *value2 = (uint64)op2->i64;
1875 else if(op2->kind == 4)
1876 *value2 = op2->ui64;
1877 else if(op2->kind == 23 && op2->type->isSigned)
1878 *value2 = (uint64)op2->i64;
1879 else if(op2->kind == 23)
1880 *value2 = op2->ui64;
1881 else if(op2->kind == 22 && op2->type->isSigned)
1882 *value2 = (uint64)op2->i64;
1883 else if(op2->kind == 22)
1884 *value2 = op2->ui64;
1885 else if(op2->kind == 2 && op2->type->isSigned)
1886 *value2 = (uint64)op2->s;
1887 else if(op2->kind == 2)
1888 *value2 = (uint64)op2->us;
1889 else if(op2->kind == 1 && op2->type->isSigned)
1890 *value2 = (uint64)op2->c;
1891 else if(op2->kind == 24 || op2->kind == 1)
1892 *value2 = (uint64)op2->uc;
1893 else if(op2->kind == 6)
1894 *value2 = (uint64)op2->f;
1895 else if(op2->kind == 7)
1896 *value2 = (uint64)op2->d;
1897 else if(op2->kind == 13)
1898 *value2 = op2->ui64;
1904 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1906 struct Operand op2 = GetOperand(exp);
1908 return GetOpUInt64(&op2, value2);
1911 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1913 if(op2->kind == 3 && op2->type->isSigned)
1914 *value2 = (intptr_t)op2->i;
1915 else if(op2->kind == 3)
1916 *value2 = (intptr_t)op2->ui;
1917 else if(op2->kind == 4 && op2->type->isSigned)
1918 *value2 = (intptr_t)op2->i64;
1919 else if(op2->kind == 4)
1920 *value2 = (intptr_t)op2->ui64;
1921 else if(op2->kind == 23 && op2->type->isSigned)
1922 *value2 = (intptr_t)op2->i64;
1923 else if(op2->kind == 23)
1924 *value2 = (intptr_t)op2->ui64;
1925 else if(op2->kind == 22 && op2->type->isSigned)
1926 *value2 = (intptr_t)op2->i64;
1927 else if(op2->kind == 22)
1928 *value2 = (intptr_t)op2->ui64;
1929 else if(op2->kind == 2 && op2->type->isSigned)
1930 *value2 = (intptr_t)op2->s;
1931 else if(op2->kind == 2)
1932 *value2 = (intptr_t)op2->us;
1933 else if(op2->kind == 1 && op2->type->isSigned)
1934 *value2 = (intptr_t)op2->c;
1935 else if(op2->kind == 24 || op2->kind == 1)
1936 *value2 = (intptr_t)op2->uc;
1937 else if(op2->kind == 6)
1938 *value2 = (intptr_t)op2->f;
1939 else if(op2->kind == 7)
1940 *value2 = (intptr_t)op2->d;
1941 else if(op2->kind == 13)
1942 *value2 = (intptr_t)op2->ui64;
1948 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1950 struct Operand op2 = GetOperand(exp);
1952 return GetOpIntPtr(&op2, value2);
1955 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1957 if(op2->kind == 3 && op2->type->isSigned)
1958 *value2 = (uintptr_t)op2->i;
1959 else if(op2->kind == 3)
1960 *value2 = (uintptr_t)op2->ui;
1961 else if(op2->kind == 4 && op2->type->isSigned)
1962 *value2 = (uintptr_t)op2->i64;
1963 else if(op2->kind == 4)
1964 *value2 = (uintptr_t)op2->ui64;
1965 else if(op2->kind == 23 && op2->type->isSigned)
1966 *value2 = (uintptr_t)op2->i64;
1967 else if(op2->kind == 23)
1968 *value2 = (uintptr_t)op2->ui64;
1969 else if(op2->kind == 22 && op2->type->isSigned)
1970 *value2 = (uintptr_t)op2->i64;
1971 else if(op2->kind == 22)
1972 *value2 = (uintptr_t)op2->ui64;
1973 else if(op2->kind == 2 && op2->type->isSigned)
1974 *value2 = (uintptr_t)op2->s;
1975 else if(op2->kind == 2)
1976 *value2 = (uintptr_t)op2->us;
1977 else if(op2->kind == 1 && op2->type->isSigned)
1978 *value2 = (uintptr_t)op2->c;
1979 else if(op2->kind == 24 || op2->kind == 1)
1980 *value2 = (uintptr_t)op2->uc;
1981 else if(op2->kind == 6)
1982 *value2 = (uintptr_t)op2->f;
1983 else if(op2->kind == 7)
1984 *value2 = (uintptr_t)op2->d;
1985 else if(op2->kind == 13)
1986 *value2 = (uintptr_t)op2->ui64;
1992 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1994 struct Operand op2 = GetOperand(exp);
1996 return GetOpUIntPtr(&op2, value2);
1999 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2001 if(op2->kind == 3 && op2->type->isSigned)
2002 *value2 = (ssize_t)op2->i;
2003 else if(op2->kind == 3)
2004 *value2 = (ssize_t)op2->ui;
2005 else if(op2->kind == 4 && op2->type->isSigned)
2006 *value2 = (ssize_t)op2->i64;
2007 else if(op2->kind == 4)
2008 *value2 = (ssize_t)op2->ui64;
2009 else if(op2->kind == 23 && op2->type->isSigned)
2010 *value2 = (ssize_t)op2->i64;
2011 else if(op2->kind == 23)
2012 *value2 = (ssize_t)op2->ui64;
2013 else if(op2->kind == 22 && op2->type->isSigned)
2014 *value2 = (ssize_t)op2->i64;
2015 else if(op2->kind == 22)
2016 *value2 = (ssize_t)op2->ui64;
2017 else if(op2->kind == 2 && op2->type->isSigned)
2018 *value2 = (ssize_t)op2->s;
2019 else if(op2->kind == 2)
2020 *value2 = (ssize_t)op2->us;
2021 else if(op2->kind == 1 && op2->type->isSigned)
2022 *value2 = (ssize_t)op2->c;
2023 else if(op2->kind == 24 || op2->kind == 1)
2024 *value2 = (ssize_t)op2->uc;
2025 else if(op2->kind == 6)
2026 *value2 = (ssize_t)op2->f;
2027 else if(op2->kind == 7)
2028 *value2 = (ssize_t)op2->d;
2029 else if(op2->kind == 13)
2030 *value2 = (ssize_t)op2->ui64;
2036 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2038 struct Operand op2 = GetOperand(exp);
2040 return GetOpIntSize(&op2, value2);
2043 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2045 if(op2->kind == 3 && op2->type->isSigned)
2046 *value2 = (size_t)op2->i;
2047 else if(op2->kind == 3)
2048 *value2 = (size_t)op2->ui;
2049 else if(op2->kind == 4 && op2->type->isSigned)
2050 *value2 = (size_t)op2->i64;
2051 else if(op2->kind == 4)
2052 *value2 = (size_t)op2->ui64;
2053 else if(op2->kind == 23 && op2->type->isSigned)
2054 *value2 = (size_t)op2->i64;
2055 else if(op2->kind == 23)
2056 *value2 = (size_t)op2->ui64;
2057 else if(op2->kind == 22 && op2->type->isSigned)
2058 *value2 = (size_t)op2->i64;
2059 else if(op2->kind == 22)
2060 *value2 = (size_t)op2->ui64;
2061 else if(op2->kind == 2 && op2->type->isSigned)
2062 *value2 = (size_t)op2->s;
2063 else if(op2->kind == 2)
2064 *value2 = (size_t)op2->us;
2065 else if(op2->kind == 1 && op2->type->isSigned)
2066 *value2 = (size_t)op2->c;
2067 else if(op2->kind == 24 || op2->kind == 1)
2068 *value2 = (size_t)op2->uc;
2069 else if(op2->kind == 6)
2070 *value2 = (size_t)op2->f;
2071 else if(op2->kind == 7)
2072 *value2 = (size_t)op2->d;
2073 else if(op2->kind == 13)
2074 *value2 = (size_t)op2->ui64;
2080 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2082 struct Operand op2 = GetOperand(exp);
2084 return GetOpUIntSize(&op2, value2);
2087 unsigned int GetOpShort(struct Operand * op2, short * value2)
2089 if(op2->kind == 3 && op2->type->isSigned)
2090 *value2 = (short)op2->i;
2091 else if(op2->kind == 3)
2092 *value2 = (short)op2->ui;
2093 else if(op2->kind == 4 && op2->type->isSigned)
2094 *value2 = (short)op2->i64;
2095 else if(op2->kind == 4)
2096 *value2 = (short)op2->ui64;
2097 else if(op2->kind == 23 && op2->type->isSigned)
2098 *value2 = (short)op2->i64;
2099 else if(op2->kind == 23)
2100 *value2 = (short)op2->ui64;
2101 else if(op2->kind == 22 && op2->type->isSigned)
2102 *value2 = (short)op2->i64;
2103 else if(op2->kind == 22)
2104 *value2 = (short)op2->ui64;
2105 else if(op2->kind == 2 && op2->type->isSigned)
2107 else if(op2->kind == 2)
2108 *value2 = (short)op2->us;
2109 else if(op2->kind == 1 && op2->type->isSigned)
2110 *value2 = (short)op2->c;
2111 else if(op2->kind == 24 || op2->kind == 1)
2112 *value2 = (short)op2->uc;
2113 else if(op2->kind == 6)
2114 *value2 = (short)op2->f;
2115 else if(op2->kind == 7)
2116 *value2 = (short)op2->d;
2117 else if(op2->kind == 13)
2118 *value2 = (short)op2->ui64;
2124 unsigned int GetShort(struct Expression * exp, short * value2)
2126 struct Operand op2 = GetOperand(exp);
2128 return GetOpShort(&op2, value2);
2131 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2133 if(op2->kind == 3 && op2->type->isSigned)
2134 *value2 = (unsigned short)op2->i;
2135 else if(op2->kind == 3)
2136 *value2 = (unsigned short)op2->ui;
2137 else if(op2->kind == 4 && op2->type->isSigned)
2138 *value2 = (unsigned short)op2->i64;
2139 else if(op2->kind == 4)
2140 *value2 = (unsigned short)op2->ui64;
2141 else if(op2->kind == 23 && op2->type->isSigned)
2142 *value2 = (unsigned short)op2->i64;
2143 else if(op2->kind == 23)
2144 *value2 = (unsigned short)op2->ui64;
2145 else if(op2->kind == 22 && op2->type->isSigned)
2146 *value2 = (unsigned short)op2->i64;
2147 else if(op2->kind == 22)
2148 *value2 = (unsigned short)op2->ui64;
2149 else if(op2->kind == 2 && op2->type->isSigned)
2150 *value2 = (unsigned short)op2->s;
2151 else if(op2->kind == 2)
2153 else if(op2->kind == 1 && op2->type->isSigned)
2154 *value2 = (unsigned short)op2->c;
2155 else if(op2->kind == 24 || op2->kind == 1)
2156 *value2 = (unsigned short)op2->uc;
2157 else if(op2->kind == 6)
2158 *value2 = (unsigned short)op2->f;
2159 else if(op2->kind == 7)
2160 *value2 = (unsigned short)op2->d;
2161 else if(op2->kind == 13)
2162 *value2 = (unsigned short)op2->ui64;
2168 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2170 struct Operand op2 = GetOperand(exp);
2172 return GetOpUShort(&op2, value2);
2175 unsigned int GetOpChar(struct Operand * op2, char * value2)
2177 if(op2->kind == 3 && op2->type->isSigned)
2178 *value2 = (char)op2->i;
2179 else if(op2->kind == 3)
2180 *value2 = (char)op2->ui;
2181 else if(op2->kind == 4 && op2->type->isSigned)
2182 *value2 = (char)op2->i64;
2183 else if(op2->kind == 4)
2184 *value2 = (char)op2->ui64;
2185 else if(op2->kind == 23 && op2->type->isSigned)
2186 *value2 = (char)op2->i64;
2187 else if(op2->kind == 23)
2188 *value2 = (char)op2->ui64;
2189 else if(op2->kind == 22 && op2->type->isSigned)
2190 *value2 = (char)op2->i64;
2191 else if(op2->kind == 22)
2192 *value2 = (char)op2->ui64;
2193 else if(op2->kind == 2 && op2->type->isSigned)
2194 *value2 = (char)op2->s;
2195 else if(op2->kind == 2)
2196 *value2 = (char)op2->us;
2197 else if(op2->kind == 1 && op2->type->isSigned)
2199 else if(op2->kind == 24 || op2->kind == 1)
2200 *value2 = (char)op2->uc;
2201 else if(op2->kind == 6)
2202 *value2 = (char)op2->f;
2203 else if(op2->kind == 7)
2204 *value2 = (char)op2->d;
2205 else if(op2->kind == 13)
2206 *value2 = (char)op2->ui64;
2212 unsigned int GetChar(struct Expression * exp, char * value2)
2214 struct Operand op2 = GetOperand(exp);
2216 return GetOpChar(&op2, value2);
2219 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2221 if(op2->kind == 3 && op2->type->isSigned)
2222 *value2 = (unsigned char)op2->i;
2223 else if(op2->kind == 3)
2224 *value2 = (unsigned char)op2->ui;
2225 else if(op2->kind == 4 && op2->type->isSigned)
2226 *value2 = (unsigned char)op2->i64;
2227 else if(op2->kind == 4)
2228 *value2 = (unsigned char)op2->ui64;
2229 else if(op2->kind == 23 && op2->type->isSigned)
2230 *value2 = (unsigned char)op2->i64;
2231 else if(op2->kind == 23)
2232 *value2 = (unsigned char)op2->ui64;
2233 else if(op2->kind == 22 && op2->type->isSigned)
2234 *value2 = (unsigned char)op2->i64;
2235 else if(op2->kind == 22)
2236 *value2 = (unsigned char)op2->ui64;
2237 else if(op2->kind == 2 && op2->type->isSigned)
2238 *value2 = (unsigned char)op2->s;
2239 else if(op2->kind == 2)
2240 *value2 = (unsigned char)op2->us;
2241 else if(op2->kind == 1 && op2->type->isSigned)
2242 *value2 = (unsigned char)op2->c;
2243 else if(op2->kind == 24 || op2->kind == 1)
2245 else if(op2->kind == 6)
2246 *value2 = (unsigned char)op2->f;
2247 else if(op2->kind == 7)
2248 *value2 = (unsigned char)op2->d;
2249 else if(op2->kind == 13)
2250 *value2 = (unsigned char)op2->ui64;
2256 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2258 struct Operand op2 = GetOperand(exp);
2260 return GetOpUChar(&op2, value2);
2263 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2265 if(op2->kind == 3 && op2->type->isSigned)
2266 *value2 = (float)(float)op2->i;
2267 else if(op2->kind == 3)
2268 *value2 = (float)(float)op2->ui;
2269 else if(op2->kind == 4 && op2->type->isSigned)
2270 *value2 = (float)(float)op2->i64;
2271 else if(op2->kind == 4)
2272 *value2 = (float)(float)op2->ui64;
2273 else if(op2->kind == 23 && op2->type->isSigned)
2274 *value2 = (float)(float)op2->i64;
2275 else if(op2->kind == 23)
2276 *value2 = (float)(float)op2->ui64;
2277 else if(op2->kind == 22 && op2->type->isSigned)
2278 *value2 = (float)(float)op2->i64;
2279 else if(op2->kind == 22)
2280 *value2 = (float)(float)op2->ui64;
2281 else if(op2->kind == 2 && op2->type->isSigned)
2282 *value2 = (float)(float)op2->s;
2283 else if(op2->kind == 2)
2284 *value2 = (float)(float)op2->us;
2285 else if(op2->kind == 1 && op2->type->isSigned)
2286 *value2 = (float)(float)op2->c;
2287 else if(op2->kind == 24 || op2->kind == 1)
2288 *value2 = (float)(float)op2->uc;
2289 else if(op2->kind == 6)
2290 *value2 = (float)op2->f;
2291 else if(op2->kind == 7)
2292 *value2 = (float)op2->d;
2293 else if(op2->kind == 13)
2294 *value2 = (float)(float)op2->ui64;
2300 unsigned int GetFloat(struct Expression * exp, float * value2)
2302 struct Operand op2 = GetOperand(exp);
2304 return GetOpFloat(&op2, value2);
2307 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2309 if(op2->kind == 3 && op2->type->isSigned)
2310 *value2 = (double)(double)op2->i;
2311 else if(op2->kind == 3)
2312 *value2 = (double)(double)op2->ui;
2313 else if(op2->kind == 4 && op2->type->isSigned)
2314 *value2 = (double)(double)op2->i64;
2315 else if(op2->kind == 4)
2316 *value2 = (double)(double)op2->ui64;
2317 else if(op2->kind == 23 && op2->type->isSigned)
2318 *value2 = (double)(double)op2->i64;
2319 else if(op2->kind == 23)
2320 *value2 = (double)(double)op2->ui64;
2321 else if(op2->kind == 22 && op2->type->isSigned)
2322 *value2 = (double)(double)op2->i64;
2323 else if(op2->kind == 22)
2324 *value2 = (double)(double)op2->ui64;
2325 else if(op2->kind == 2 && op2->type->isSigned)
2326 *value2 = (double)(double)op2->s;
2327 else if(op2->kind == 2)
2328 *value2 = (double)(double)op2->us;
2329 else if(op2->kind == 1 && op2->type->isSigned)
2330 *value2 = (double)(double)op2->c;
2331 else if(op2->kind == 24 || op2->kind == 1)
2332 *value2 = (double)(double)op2->uc;
2333 else if(op2->kind == 6)
2334 *value2 = (double)op2->f;
2335 else if(op2->kind == 7)
2336 *value2 = (double)op2->d;
2337 else if(op2->kind == 13)
2338 *value2 = (double)(double)op2->ui64;
2344 unsigned int GetDouble(struct Expression * exp, double * value2)
2346 struct Operand op2 = GetOperand(exp);
2348 return GetOpDouble(&op2, value2);
2351 void ComputeExpression(struct Expression * exp);
2353 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2355 extern int targetBits;
2357 int ComputeTypeSize(struct Type * type);
2359 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2361 struct __ecereNameSpace__ecere__com__BitMember
2363 struct __ecereNameSpace__ecere__com__BitMember * prev;
2364 struct __ecereNameSpace__ecere__com__BitMember * next;
2366 unsigned int isProperty;
2369 struct __ecereNameSpace__ecere__com__Class * _class;
2370 char * dataTypeString;
2371 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2372 struct Type * dataType;
2377 } __attribute__ ((gcc_struct));
2379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2381 struct __ecereNameSpace__ecere__sys__OldLink
2383 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2384 struct __ecereNameSpace__ecere__sys__OldLink * next;
2386 } __attribute__ ((gcc_struct));
2388 void FinishTemplatesContext(struct Context * context);
2390 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2392 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2393 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2395 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))
2398 int unionMemberOffset = 0;
2403 member->memberOffset = 0;
2404 if(targetBits < sizeof(void *) * 8)
2405 member->structAlignment = 0;
2407 else if(targetBits < sizeof(void *) * 8)
2408 _class->structAlignment = 0;
2409 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2410 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2411 if(!member && _class->destructionWatchOffset)
2412 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2414 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2416 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2418 if(!dataMember->isProperty)
2420 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2422 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2428 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2430 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2432 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2434 if(!isMember && _class->type == 2 && dataMember->dataType)
2436 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2440 ComputeTypeSize(dataMember->dataType);
2441 if(bitMember->pos == -1)
2442 bitMember->pos = _class->memberOffset;
2443 if(!bitMember->size)
2444 bitMember->size = dataMember->dataType->size * 8;
2445 _class->memberOffset = bitMember->pos + bitMember->size;
2446 for(d = 0; d < bitMember->size; d++)
2452 bitMember->mask = mask << bitMember->pos;
2454 else if(dataMember->type == 0 && dataMember->dataType)
2459 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2460 ComputeTypeSize(dataMember->dataType);
2461 if(dataMember->dataType->bitFieldCount)
2463 bitFields += dataMember->dataType->bitFieldCount;
2470 int size = (bitFields + 7) / 8;
2474 int __simpleStruct0;
2478 int __simpleStruct0;
2480 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2481 if(member->memberOffset % alignment)
2482 member->memberOffset += alignment - (member->memberOffset % alignment);
2484 dataMember->offset = member->memberOffset;
2485 if(member->type == 1)
2486 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2489 member->memberOffset += size;
2496 int __simpleStruct0;
2498 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2499 if(_class->memberOffset % alignment)
2500 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2502 dataMember->offset = _class->memberOffset;
2503 _class->memberOffset += size;
2507 size = dataMember->dataType->size;
2508 alignment = dataMember->dataType->alignment;
2512 int __simpleStruct0;
2516 int __simpleStruct0;
2518 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2519 if(member->memberOffset % alignment)
2520 member->memberOffset += alignment - (member->memberOffset % alignment);
2522 dataMember->offset = member->memberOffset;
2523 if(member->type == 1)
2524 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2527 member->memberOffset += size;
2534 int __simpleStruct0;
2536 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2537 if(_class->memberOffset % alignment)
2538 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2540 dataMember->offset = _class->memberOffset;
2541 _class->memberOffset += size;
2548 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2549 alignment = dataMember->structAlignment;
2552 int __simpleStruct0;
2556 int __simpleStruct0;
2558 if(member->memberOffset % alignment)
2559 member->memberOffset += alignment - (member->memberOffset % alignment);
2560 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2562 dataMember->offset = member->memberOffset;
2563 if(member->type == 1)
2564 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2566 member->memberOffset += dataMember->memberOffset;
2572 int __simpleStruct0;
2574 if(_class->memberOffset % alignment)
2575 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2576 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2578 dataMember->offset = _class->memberOffset;
2579 _class->memberOffset += dataMember->memberOffset;
2587 int size = (bitFields + 7) / 8;
2591 int __simpleStruct0;
2595 int __simpleStruct0;
2597 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2598 if(member->memberOffset % alignment)
2599 member->memberOffset += alignment - (member->memberOffset % alignment);
2601 if(member->type == 1)
2602 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2605 member->memberOffset += size;
2612 int __simpleStruct0;
2614 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2615 if(_class->memberOffset % alignment)
2616 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2618 _class->memberOffset += size;
2623 if(member && member->type == 1)
2625 member->memberOffset = unionMemberOffset;
2629 if(_class->type != 2)
2633 if(_class->structAlignment)
2635 if(_class->memberOffset % _class->structAlignment)
2636 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2638 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2641 struct __ecereNameSpace__ecere__com__Property * prop;
2643 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2645 if(prop->isProperty && prop->isWatchable)
2647 prop->watcherOffset = _class->structSize;
2648 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2653 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2655 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2657 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2659 if(deriv->computeSize)
2661 deriv->offset = _class->structSize;
2662 deriv->memberOffset = 0;
2663 deriv->structSize = deriv->offset;
2664 ComputeClassMembers(deriv, 0x0);
2672 FinishTemplatesContext(context);
2675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2677 struct __ecereNameSpace__ecere__com__NameSpace
2680 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2681 struct __ecereNameSpace__ecere__com__NameSpace * left;
2682 struct __ecereNameSpace__ecere__com__NameSpace * right;
2684 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2685 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2686 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2687 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2688 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2689 } __attribute__ ((gcc_struct));
2691 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2693 struct __ecereNameSpace__ecere__com__Module
2695 struct __ecereNameSpace__ecere__com__Instance * application;
2696 struct __ecereNameSpace__ecere__sys__OldList classes;
2697 struct __ecereNameSpace__ecere__sys__OldList defines;
2698 struct __ecereNameSpace__ecere__sys__OldList functions;
2699 struct __ecereNameSpace__ecere__sys__OldList modules;
2700 struct __ecereNameSpace__ecere__com__Instance * prev;
2701 struct __ecereNameSpace__ecere__com__Instance * next;
2707 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2708 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2709 } __attribute__ ((gcc_struct));
2711 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2713 struct __ecereNameSpace__ecere__com__Class * _class;
2714 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2716 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2717 ComputeModuleClasses(subModule->data);
2718 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2719 ComputeClassMembers(_class, 0x0);
2722 extern unsigned int inCompiler;
2724 extern void Compiler_Error(char * format, ...);
2726 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2728 int ComputeTypeSize(struct Type * type)
2730 unsigned int size = type ? type->size : 0;
2732 if(!size && type && !type->computing)
2734 type->computing = 0x1;
2738 type->alignment = size = sizeof(char);
2741 type->alignment = size = sizeof(char);
2744 type->alignment = size = sizeof(int);
2747 type->alignment = size = sizeof(long long);
2750 type->alignment = size = targetBits / 8;
2753 type->alignment = size = targetBits / 8;
2756 type->alignment = size = sizeof(long);
2759 type->alignment = size = sizeof(short);
2762 type->alignment = size = sizeof(float);
2765 type->alignment = size = sizeof(double);
2769 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2771 if(_class && _class->type == 1)
2773 ComputeClassMembers(_class, 0x0);
2774 type->alignment = _class->structAlignment;
2775 size = _class->structSize;
2776 if(type->alignment && size % type->alignment)
2777 size += type->alignment - (size % type->alignment);
2779 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2781 if(!_class->dataType)
2782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2783 size = type->alignment = ComputeTypeSize(_class->dataType);
2786 size = type->alignment = targetBits / 8;
2791 size = type->alignment = targetBits / 8;
2794 if(type->arraySizeExp)
2796 ProcessExpressionType(type->arraySizeExp);
2797 ComputeExpression(type->arraySizeExp);
2798 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)))
2800 struct Location oldLoc = yylloc;
2801 char expression[10240];
2803 expression[0] = '\0';
2804 type->arraySizeExp->expType = (((void *)0));
2805 yylloc = type->arraySizeExp->loc;
2807 PrintExpression(type->arraySizeExp, expression);
2808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2811 GetInt(type->arraySizeExp, &type->arraySize);
2813 else if(type->enumClass)
2815 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2817 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2820 type->arraySize = 0;
2824 type->arraySize = 0;
2826 size = ComputeTypeSize(type->type) * type->arraySize;
2828 type->alignment = type->type->alignment;
2832 struct Type * member;
2834 for(member = type->members.first; member; member = member->next)
2836 int __simpleStruct0, __simpleStruct1;
2837 unsigned int addSize = ComputeTypeSize(member);
2839 member->offset = size;
2840 if(member->alignment && size % member->alignment)
2841 member->offset += member->alignment - (size % member->alignment);
2842 size = member->offset;
2843 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2846 if(type->alignment && size % type->alignment)
2847 size += type->alignment - (size % type->alignment);
2852 struct Type * member;
2854 for(member = type->members.first; member; member = member->next)
2856 int __simpleStruct0, __simpleStruct1;
2857 unsigned int addSize = ComputeTypeSize(member);
2859 member->offset = size;
2860 if(member->alignment && size % member->alignment)
2861 member->offset += member->alignment - (size % member->alignment);
2862 size = member->offset;
2863 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2864 size = ((size > addSize) ? size : addSize);
2866 if(type->alignment && size % type->alignment)
2867 size += type->alignment - (size % type->alignment);
2872 struct TemplateParameter * param = type->templateParameter;
2873 struct Type * baseType = ProcessTemplateParameterType(param);
2877 size = ComputeTypeSize(baseType);
2878 type->alignment = baseType->alignment;
2881 type->alignment = size = sizeof(uint64);
2886 type->alignment = size = sizeof(enum
2894 type->alignment = size = targetBits / 8;
2899 type->computing = 0x0;
2904 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2906 extern struct Identifier * MkIdentifier(char * string);
2908 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2910 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2912 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2914 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2916 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2918 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2920 extern void FreeType(struct Type * type);
2922 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2924 extern struct Specifier * MkSpecifier(int specifier);
2926 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2928 extern struct Expression * MkExpConstant(char * string);
2930 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)
2932 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2933 unsigned int totalSize = 0;
2934 unsigned int maxSize = 0;
2935 int alignment, size;
2936 struct __ecereNameSpace__ecere__com__DataMember * member;
2937 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2940 *addedPadding = 0x0;
2941 if(!isMember && _class->base)
2943 maxSize = _class->structSize;
2945 if(_class->type == 1 || _class->type == 5)
2946 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2949 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2951 if(maxSize > baseSize)
2952 maxSize -= baseSize;
2958 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2960 if(!member->isProperty)
2962 switch(member->type)
2966 if(member->dataTypeString)
2968 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2969 struct Declarator * decl;
2971 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2972 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2973 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2974 if(!member->dataType)
2975 member->dataType = ProcessType(specs, decl);
2976 ReplaceThisClassSpecifiers(specs, topClass);
2978 struct Type * type = ProcessType(specs, decl);
2980 DeclareType(member->dataType, 0x0, 0x0);
2983 ComputeTypeSize(member->dataType);
2984 size = member->dataType->size;
2985 alignment = member->dataType->alignment;
2988 if(totalSize % alignment)
2989 totalSize += alignment - (totalSize % alignment);
2998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3001 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3002 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3003 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
3004 alignment = member->structAlignment;
3007 if(totalSize % alignment)
3008 totalSize += alignment - (totalSize % alignment);
3018 unsigned int __simpleStruct0;
3020 if(topMember && topMember->type == 1)
3021 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3023 *retSize += totalSize;
3025 else if(totalSize < maxSize && _class->type != 1000)
3027 int autoPadding = 0;
3029 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3030 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3031 if(totalSize + autoPadding < maxSize)
3033 char sizeString[50];
3035 sprintf(sizeString, "%d", maxSize - totalSize);
3036 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3038 *addedPadding = 0x1;
3042 FinishTemplatesContext(context);
3043 return topMember ? topMember->memberID : _class->memberID;
3046 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3048 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3049 unsigned int totalSize = 0;
3050 struct __ecereNameSpace__ecere__com__DataMember * member;
3051 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3053 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3054 DeclareMembers(_class->base, 0x0);
3055 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3057 if(!member->isProperty)
3059 switch(member->type)
3063 if(!member->dataType && member->dataTypeString)
3064 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3065 if(member->dataType)
3066 DeclareType(member->dataType, 0x0, 0x0);
3072 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3079 FinishTemplatesContext(context);
3080 return topMember ? topMember->memberID : _class->memberID;
3083 extern struct Symbol * FindClass(char * name);
3085 extern char * strchr(const char * , int);
3087 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3089 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3091 extern void FreeClassDef(struct ClassDef * def);
3093 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3095 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3097 extern void MangleClassName(char * className);
3099 extern void DeclareClass(struct Symbol * classSym, char * className);
3101 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3103 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3105 void DeclareStruct(char * name, unsigned int skipNoHead)
3107 struct External * external = (((void *)0));
3108 struct Symbol * classSym = FindClass(name);
3110 if(!inCompiler || !classSym)
3112 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3114 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3116 struct Declaration * decl;
3117 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3118 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3119 char structName[1024];
3120 struct Specifier * spec = (((void *)0));
3122 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3123 classSym->declaring++;
3124 if(strchr(classSym->string, '<'))
3126 if(classSym->registered->templateClass)
3128 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3129 classSym->declaring--;
3133 DeclareMembers(classSym->registered, 0x0);
3134 structName[0] = (char)0;
3135 FullClassNameCat(structName, name, 0x0);
3136 if(external && external->declaration && external->declaration->specifiers)
3138 for(spec = (*external->declaration->specifiers).first; spec; spec = spec->next)
3140 if(spec->type == 3 || spec->type == 4)
3144 if(!skipNoHead && (!spec || !spec->definitions))
3146 unsigned int addedPadding = 0x0;
3148 classSym->declaredStructSym = 0x1;
3149 declarations = MkList();
3150 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3151 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3153 FreeList(declarations, FreeClassDef);
3154 declarations = (((void *)0));
3157 if(skipNoHead || declarations)
3162 spec->definitions = declarations;
3163 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3165 if(classSym->structExternal)
3166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3168 classSym->id = curExternal->symbol->idCode;
3169 classSym->idCode = curExternal->symbol->idCode;
3175 external = MkExternalDeclaration((((void *)0)));
3176 specifiers = MkList();
3177 declarators = MkList();
3178 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3179 external->declaration = decl = MkDeclaration(specifiers, declarators);
3180 if(decl->symbol && !decl->symbol->pointerExternal)
3181 decl->symbol->pointerExternal = external;
3182 if(classSym->registered && classSym->registered->type == 1)
3184 char className[1024];
3186 strcpy(className, "__ecereClass_");
3187 FullClassNameCat(className, classSym->string, 0x1);
3188 MangleClassName(className);
3189 DeclareClass(classSym, className);
3190 external->symbol = classSym;
3191 classSym->pointerExternal = external;
3192 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3193 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3197 char className[1024];
3199 strcpy(className, "__ecereClass_");
3200 FullClassNameCat(className, classSym->string, 0x1);
3201 MangleClassName(className);
3202 classSym->structExternal = external;
3203 DeclareClass(classSym, className);
3204 external->symbol = classSym;
3206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3209 classSym->declaring--;
3211 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3213 classSym->declaring++;
3215 if(classSym->registered)
3216 DeclareMembers(classSym->registered, 0x0);
3218 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3220 if(classSym->structExternal)
3221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3222 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3223 classSym->id = curExternal->symbol->idCode;
3224 classSym->idCode = curExternal->symbol->idCode;
3226 classSym->declaring--;
3230 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3232 extern struct ModuleImport * mainModule;
3234 extern struct Specifier * MkSpecifierName(char * name);
3236 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3238 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3240 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3242 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3244 extern void FreeDeclarator(struct Declarator * decl);
3246 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3248 struct PropertyImport
3250 struct PropertyImport * prev;
3251 struct PropertyImport * next;
3253 unsigned int isVirtual;
3254 unsigned int hasSet;
3255 unsigned int hasGet;
3256 } __attribute__ ((gcc_struct));
3258 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3260 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3262 struct Symbol * symbol = prop->symbol;
3263 char propName[1024];
3265 strcpy(setName, "__ecereProp_");
3266 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3267 strcat(setName, "_Set_");
3268 FullClassNameCat(setName, prop->name, 0x1);
3269 strcpy(getName, "__ecereProp_");
3270 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3271 strcat(getName, "_Get_");
3272 FullClassNameCat(getName, prop->name, 0x1);
3273 strcpy(propName, "__ecereProp_");
3274 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3275 strcat(propName, "_");
3276 FullClassNameCat(propName, prop->name, 0x1);
3277 MangleClassName(getName);
3278 MangleClassName(setName);
3279 MangleClassName(propName);
3280 if(prop->_class->type == 1)
3281 DeclareStruct(prop->_class->fullName, 0x0);
3282 if(!symbol || curExternal->symbol->idCode < symbol->id)
3284 unsigned int imported = 0x0;
3285 unsigned int dllImport = 0x0;
3287 if(!symbol || symbol->_import)
3291 struct Symbol * classSym;
3293 if(!prop->_class->symbol)
3294 prop->_class->symbol = FindClass(prop->_class->fullName);
3295 classSym = prop->_class->symbol;
3296 if(classSym && !classSym->_import)
3298 struct ModuleImport * module;
3300 if(prop->_class->module)
3301 module = FindModule(prop->_class->module);
3303 module = mainModule;
3304 classSym->_import = __extension__ ({
3305 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3307 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3311 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3312 symbol->_import = (struct ClassImport *)__extension__ ({
3313 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3315 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3321 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 24)))->importType != 1)
3326 struct Context * context = SetupTemplatesContext(prop->_class);
3328 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3329 FinishTemplatesContext(context);
3333 if(!symbol->externalGet || symbol->externalGet->type == 0)
3335 struct Declaration * decl;
3336 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3337 struct Declarator * d;
3338 struct __ecereNameSpace__ecere__sys__OldList * params;
3339 struct Specifier * spec;
3340 struct External * external;
3341 struct Declarator * typeDecl;
3342 unsigned int simple = 0x0;
3344 specifiers = MkList();
3345 declarators = MkList();
3347 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3348 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3350 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3352 struct Context * context = SetupTemplatesContext(prop->_class);
3354 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3355 FinishTemplatesContext(context);
3357 for(spec = (*specifiers).first; spec; spec = spec->next)
3361 if((!typeDecl || typeDecl->type == 1))
3363 struct Symbol * classSym = spec->symbol;
3365 symbol->_class = classSym->registered;
3366 if(classSym->registered && classSym->registered->type == 1)
3368 DeclareStruct(spec->name, 0x0);
3375 d = PlugDeclarator(typeDecl, d);
3378 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3379 specifiers = MkList();
3381 d = MkDeclaratorFunction(d, params);
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3384 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3387 ListAdd(specifiers, MkSpecifier(VOID));
3388 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3389 decl = MkDeclaration(specifiers, declarators);
3390 external = MkExternalDeclaration(decl);
3391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3392 external->symbol = symbol;
3393 symbol->externalGet = external;
3394 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3396 FreeDeclarator(typeDecl);
3400 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3405 if(!symbol->externalSet || symbol->externalSet->type == 0)
3407 struct Declaration * decl;
3408 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3409 struct Declarator * d;
3410 struct __ecereNameSpace__ecere__sys__OldList * params;
3411 struct Specifier * spec;
3412 struct External * external;
3413 struct Declarator * typeDecl;
3415 declarators = MkList();
3417 if(!prop->conversion || prop->_class->type == 1)
3419 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3421 specifiers = MkList();
3423 struct Context * context = SetupTemplatesContext(prop->_class);
3425 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3426 FinishTemplatesContext(context);
3428 ListAdd(params, MkTypeName(specifiers, d));
3429 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3431 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3432 d = MkDeclaratorFunction(d, params);
3433 for(spec = (*specifiers).first; spec; spec = spec->next)
3437 if((!typeDecl || typeDecl->type == 1))
3439 struct Symbol * classSym = spec->symbol;
3441 symbol->_class = classSym->registered;
3442 if(classSym->registered && classSym->registered->type == 1)
3443 DeclareStruct(spec->name, 0x0);
3447 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3448 specifiers = MkList();
3450 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3451 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3453 if(!prop->conversion || prop->_class->type == 1)
3454 ListAdd(specifiers, MkSpecifier(VOID));
3456 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3457 decl = MkDeclaration(specifiers, declarators);
3458 external = MkExternalDeclaration(decl);
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3460 external->symbol = symbol;
3461 symbol->externalSet = external;
3462 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3466 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3469 if(!symbol->externalPtr)
3471 struct Declaration * decl;
3472 struct External * external;
3473 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3476 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3479 ListAdd(specifiers, MkSpecifierName("Property"));
3481 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3483 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3486 strcpy(propName, "__ecerePropM_");
3487 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3488 strcat(propName, "_");
3489 FullClassNameCat(propName, prop->name, 0x1);
3490 MangleClassName(propName);
3491 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3493 decl = MkDeclaration(specifiers, list);
3495 external = MkExternalDeclaration(decl);
3496 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3497 external->symbol = symbol;
3498 symbol->externalPtr = external;
3502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3504 symbol->id = curExternal->symbol->idCode;
3508 struct Type * Dereference(struct Type * source)
3510 struct Type * type = (((void *)0));
3514 if(source->kind == 13 || source->kind == 12)
3516 type = source->type;
3517 source->type->refCount++;
3519 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3521 type = __extension__ ({
3522 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3524 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3527 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3533 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3538 static struct Type * Reference(struct Type * source)
3540 struct Type * type = (((void *)0));
3544 type = __extension__ ({
3545 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3547 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3554 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);
3556 extern void * memcpy(void * , const void * , size_t size);
3558 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3560 extern void FreeExpression(struct Expression * exp);
3562 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3564 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);
3566 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3568 extern struct Type * MkClassType(char * name);
3570 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);
3572 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)
3574 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3575 unsigned int found = 0x0;
3576 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3577 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3578 unsigned int freeType = 0x0;
3580 yylloc = member->loc;
3585 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3589 dataMember = *curMember;
3595 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3596 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3597 int _subMemberStackPos = 0;
3600 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3603 dataMember = thisMember;
3604 if(curMember && thisMember->memberAccess == 1)
3606 *curMember = thisMember;
3607 *curClass = thisMember->_class;
3608 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3609 *subMemberStackPos = _subMemberStackPos;
3615 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3616 if(method && method->type == 1)
3619 method = (((void *)0));
3624 struct Type * type = (((void *)0));
3628 if(!dataMember->dataType && dataMember->dataTypeString)
3630 struct Context * context = SetupTemplatesContext(_class);
3632 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3633 FinishTemplatesContext(context);
3635 type = dataMember->dataType;
3639 if(!method->dataType)
3640 ProcessMethodType(method);
3641 type = method->dataType;
3643 if(ident && ident->next)
3645 for(ident = ident->next; ident && type; ident = ident->next)
3649 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3651 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3653 type = dataMember->dataType;
3655 else if(type->kind == 9 || type->kind == 10)
3657 struct Type * memberType;
3659 for(memberType = type->members.first; memberType; memberType = memberType->next)
3661 if(!strcmp(memberType->name, ident->string))
3670 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3673 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3674 struct __ecereNameSpace__ecere__com__Class * sClass;
3676 for(sClass = _class; sClass; sClass = sClass->base)
3679 if(sClass->templateClass)
3680 sClass = sClass->templateClass;
3681 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3683 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3685 for(sClass = sClass->base; sClass; sClass = sClass->base)
3687 if(sClass->templateClass)
3688 sClass = sClass->templateClass;
3689 id += sClass->templateParams.count;
3700 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3702 if(arg.dataTypeString)
3704 type = ProcessTypeString(arg.dataTypeString, 0x0);
3706 if(type && _class->templateClass)
3707 type->passAsTemplate = 0x1;
3714 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3716 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3717 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3721 char templateString[1024];
3722 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3724 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3725 for(cClass = expClass; cClass; cClass = cClass->base)
3729 if(cClass->templateClass)
3730 cClass = cClass->templateClass;
3731 for(param = cClass->templateParams.first; param; param = param->next)
3734 struct __ecereNameSpace__ecere__com__Class * sClass;
3735 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3737 for(sClass = cClass->base; sClass; sClass = sClass->base)
3739 if(sClass->templateClass)
3740 sClass = sClass->templateClass;
3741 id += sClass->templateParams.count;
3743 arg = expClass->templateArgs[id];
3744 for(sClass = _class; sClass; sClass = sClass->base)
3746 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3748 struct __ecereNameSpace__ecere__com__Class * nextClass;
3750 if(sClass->templateClass)
3751 sClass = sClass->templateClass;
3752 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3754 if(nextClass->templateClass)
3755 nextClass = nextClass->templateClass;
3756 p += nextClass->templateParams.count;
3758 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3760 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3762 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3764 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3765 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3779 char expString[1024];
3780 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3781 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3782 struct Expression * exp;
3783 char * string = PrintHexUInt64(arg.expression.ui64);
3785 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3786 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3787 ProcessExpressionType(exp);
3788 ComputeExpression(exp);
3789 expString[0] = '\0';
3790 PrintExpression(exp, expString);
3791 strcat(argument, expString);
3792 FreeExpression(exp);
3797 strcat(argument, arg.member->name);
3802 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3803 strcat(argument, arg.dataTypeString);
3810 strcat(templateString, ", ");
3811 if(lastParam != p - 1)
3813 strcat(templateString, param->name);
3814 strcat(templateString, " = ");
3816 strcat(templateString, argument);
3825 int len = strlen(templateString);
3827 if(templateString[len - 1] == '<')
3831 if(templateString[len - 1] == '>')
3832 templateString[len++] = ' ';
3833 templateString[len++] = '>';
3835 templateString[len++] = '\0';
3838 struct Context * context = SetupTemplatesContext(_class);
3842 type = ProcessTypeString(templateString, 0x0);
3844 FinishTemplatesContext(context);
3847 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3849 ProcessExpressionType(member->initializer->exp);
3850 if(!member->initializer->exp->expType)
3854 char expString[10240];
3856 expString[0] = '\0';
3857 PrintExpression(member->initializer->exp, expString);
3858 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3862 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3864 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3867 else if(member->initializer)
3869 ProcessInitializer(member->initializer, type);
3876 if(_class && _class->type == 3)
3878 if(member->initializer)
3880 struct Type * type = MkClassType(_class->fullName);
3882 ProcessInitializer(member->initializer, type);
3888 if(member->initializer)
3890 ProcessInitializer(member->initializer, (((void *)0)));
3896 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3902 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3911 extern struct Identifier * GetDeclId(struct Declarator * decl);
3913 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);
3915 extern void FreeSpecifier(struct Specifier * spec);
3917 static void ProcessFunction(struct FunctionDefinition * function);
3919 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3921 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3923 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3925 extern void FreeClassFunction(struct ClassFunction * func);
3927 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3929 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3931 void ProcessInstantiationType(struct Instantiation * inst)
3936 struct MembersInit * members;
3937 struct Symbol * classSym;
3938 struct __ecereNameSpace__ecere__com__Class * _class;
3940 classSym = inst->_class->symbol;
3941 _class = classSym ? classSym->registered : (((void *)0));
3942 if(!_class || _class->type != 5)
3943 DeclareStruct(inst->_class->name, 0x0);
3944 afterExternal = afterExternal ? afterExternal : curExternal;
3946 ProcessExpressionType(inst->exp);
3947 inst->isConstant = 0x1;
3950 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3951 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3952 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3953 int subMemberStackPos = 0;
3955 for(members = (*inst->members).first; members; members = members->next)
3957 switch(members->type)
3962 static unsigned int instMethodID = 0;
3963 struct External * external = curExternal;
3964 struct Context * context = curContext;
3965 struct Declarator * declarator = members->function->declarator;
3966 struct Identifier * nameID = GetDeclId(declarator);
3967 char * unmangled = nameID ? nameID->string : (((void *)0));
3968 struct Expression * exp;
3969 struct External * createdExternal = (((void *)0));
3975 strcpy(name, "__ecereInstMeth_");
3976 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3978 strcat(name, nameID->string);
3980 sprintf(number, "_%08d", instMethodID++);
3981 strcat(name, number);
3982 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3986 struct Symbol * symbol = declarator->symbol;
3987 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3989 if(method && method->type == 1)
3991 symbol->method = method;
3992 ProcessMethodType(method);
3993 if(!symbol->type->thisClass)
3995 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3997 if(!currentClass->symbol)
3998 currentClass->symbol = FindClass(currentClass->fullName);
3999 symbol->type->thisClass = currentClass->symbol;
4004 _class->symbol = FindClass(_class->fullName);
4005 symbol->type->thisClass = _class->symbol;
4008 DeclareType(symbol->type, 0x1, 0x1);
4012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4015 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4018 FreeSpecifier(nameID->_class);
4019 nameID->_class = (((void *)0));
4023 struct Type * type = declarator->symbol->type;
4024 struct External * oldExternal = curExternal;
4026 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4028 struct External * externalDecl;
4030 externalDecl = MkExternalDeclaration((((void *)0)));
4031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4032 if(createdExternal->function)
4034 ProcessFunction(createdExternal->function);
4036 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4038 externalDecl->declaration = decl;
4039 if(decl->symbol && !decl->symbol->pointerExternal)
4040 decl->symbol->pointerExternal = externalDecl;
4041 declarator->symbol->pointerExternal = externalDecl;
4048 curExternal = declarator->symbol->pointerExternal;
4049 ProcessFunction((struct FunctionDefinition *)members->function);
4051 curExternal = external;
4052 curContext = context;
4055 FreeClassFunction(members->function);
4056 exp = QMkExpId(name);
4058 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4059 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4065 if(members->dataMembers && classSym)
4067 struct MemberInit * member;
4068 struct Location oldyyloc = yylloc;
4070 for(member = (*members->dataMembers).first; member; member = member->next)
4072 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4073 if(member->initializer && !member->initializer->isConstant)
4074 inst->isConstant = 0x0;
4086 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4090 if(type->kind == 11)
4092 struct Type * param;
4096 for(param = type->params.first; param; param = param->next)
4097 DeclareType(param, declarePointers, 0x1);
4099 DeclareType(type->returnType, declarePointers, 0x1);
4101 else if(type->kind == 13 && declarePointers)
4102 DeclareType(type->type, declarePointers, 0x0);
4103 else if(type->kind == 8)
4105 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4106 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4108 else if(type->kind == 9 || type->kind == 10)
4110 struct Type * member;
4112 for(member = type->members.first; member; member = member->next)
4113 DeclareType(member, 0x0, 0x0);
4115 else if(type->kind == 12)
4116 DeclareType(type->arrayType, declarePointers, 0x0);
4120 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4122 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4124 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4126 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4127 struct __ecereNameSpace__ecere__com__Class * sClass;
4129 for(sClass = _class; sClass; sClass = sClass->base)
4132 if(sClass->templateClass)
4133 sClass = sClass->templateClass;
4134 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4136 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4138 for(sClass = sClass->base; sClass; sClass = sClass->base)
4140 if(sClass->templateClass)
4141 sClass = sClass->templateClass;
4142 id += sClass->templateParams.count;
4153 arg = &_class->templateArgs[id];
4154 if(arg && param->type == 0)
4155 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4160 extern struct Context * PushContext(void);
4162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4164 struct TemplatedType
4167 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4168 struct __ecereNameSpace__ecere__sys__BTNode * left;
4169 struct __ecereNameSpace__ecere__sys__BTNode * right;
4171 struct TemplateParameter * param;
4172 } __attribute__ ((gcc_struct));
4174 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4176 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4178 struct Context * context = PushContext();
4180 context->templateTypesOnly = 0x1;
4181 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4183 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4185 for(; param; param = param->next)
4187 if(param->type == 0 && param->identifier)
4189 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4191 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4197 struct __ecereNameSpace__ecere__com__Class * sClass;
4199 for(sClass = _class; sClass; sClass = sClass->base)
4201 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4203 for(p = sClass->templateParams.first; p; p = p->next)
4207 struct TemplateParameter * param = p->param;
4208 struct TemplatedType * type;
4212 p->param = param = __extension__ ({
4213 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4215 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4218 type = __extension__ ({
4219 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4221 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4223 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4231 extern void PopContext(struct Context * ctx);
4233 extern void FreeContext(struct Context * context);
4235 void FinishTemplatesContext(struct Context * context)
4237 PopContext(context);
4238 FreeContext(context);
4239 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4242 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4244 if(!method->dataType)
4246 struct Context * context = SetupTemplatesContext(method->_class);
4248 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4249 FinishTemplatesContext(context);
4250 if(method->type != 1 && method->dataType)
4252 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4254 if(!method->_class->symbol)
4255 method->_class->symbol = FindClass(method->_class->fullName);
4256 method->dataType->thisClass = method->_class->symbol;
4262 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4266 struct Context * context = SetupTemplatesContext(prop->_class);
4268 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4269 FinishTemplatesContext(context);
4273 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4275 extern void FreeTypeName(struct TypeName * typeName);
4277 static void ProcessDeclarator(struct Declarator * decl);
4279 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4285 struct MethodImport * prev;
4286 struct MethodImport * next;
4288 unsigned int isVirtual;
4289 } __attribute__ ((gcc_struct));
4291 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4293 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4295 struct Symbol * symbol = method->symbol;
4297 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4299 unsigned int imported = 0x0;
4300 unsigned int dllImport = 0x0;
4302 if(!method->dataType)
4303 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4304 if(!symbol || symbol->_import || method->type == 1)
4306 if(!symbol || method->type == 1)
4308 struct Symbol * classSym;
4310 if(!method->_class->symbol)
4311 method->_class->symbol = FindClass(method->_class->fullName);
4312 classSym = method->_class->symbol;
4313 if(!classSym->_import)
4315 struct ModuleImport * module;
4317 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4318 module = FindModule(method->_class->module);
4320 module = mainModule;
4321 classSym->_import = __extension__ ({
4322 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4324 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4330 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4332 if(!symbol->_import)
4334 symbol->_import = (struct ClassImport *)__extension__ ({
4335 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4337 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4343 symbol->type = method->dataType;
4345 symbol->type->refCount++;
4348 if(!method->dataType->dllExport)
4351 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 24)))->importType != 1)
4355 if(method->type != 1 && method->dataType)
4356 DeclareType(method->dataType, 0x1, 0x1);
4357 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4359 struct Declaration * decl;
4360 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4361 struct Declarator * d;
4362 struct Declarator * funcDecl;
4363 struct External * external;
4365 specifiers = MkList();
4366 declarators = MkList();
4368 ListAdd(specifiers, MkSpecifier(EXTERN));
4369 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4370 ListAdd(specifiers, MkSpecifier(STATIC));
4371 if(method->type == 1)
4373 ListAdd(specifiers, MkSpecifier(INT));
4374 d = MkDeclaratorIdentifier(MkIdentifier(name));
4378 d = MkDeclaratorIdentifier(MkIdentifier(name));
4380 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4382 struct Context * context = SetupTemplatesContext(method->_class);
4384 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4385 FinishTemplatesContext(context);
4387 funcDecl = GetFuncDecl(d);
4390 struct Specifier * spec, * next;
4392 for(spec = (*specifiers).first; spec; spec = next)
4397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4398 FreeSpecifier(spec);
4402 if(method->dataType && !method->dataType->staticMethod)
4404 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4406 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4407 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")));
4408 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4409 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4411 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4413 struct TypeName * param = (*funcDecl->function.parameters).first;
4415 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4416 FreeTypeName(param);
4418 if(!funcDecl->function.parameters)
4419 funcDecl->function.parameters = MkList();
4420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4424 ProcessDeclarator(d);
4425 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4426 decl = MkDeclaration(specifiers, declarators);
4427 ReplaceThisClassSpecifiers(specifiers, method->_class);
4428 if(symbol->pointerExternal)
4430 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4433 *functionSymbol = *symbol;
4434 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4435 if(functionSymbol->type)
4436 functionSymbol->type->refCount++;
4438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4439 symbol->pointerExternal->symbol = functionSymbol;
4441 external = MkExternalDeclaration(decl);
4443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4444 external->symbol = symbol;
4445 symbol->pointerExternal = external;
4449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4451 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4455 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4457 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4459 unsigned int first = 0x1;
4461 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4463 char className[1024];
4465 strcpy(className, _class->fullName);
4466 for(param = _class->templateParams.first; param; param = param->next)
4470 strcat(className, "<");
4472 strcat(className, ", ");
4473 if(lastParam + 1 != p)
4475 strcat(className, param->name);
4476 strcat(className, " = ");
4478 strcat(className, param->name);
4486 int len = strlen(className);
4488 if(className[len - 1] == '>')
4489 className[len++] = ' ';
4490 className[len++] = '>';
4491 className[len++] = '\0';
4493 return __ecereNameSpace__ecere__sys__CopyString(className);
4496 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4499 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4501 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4503 unsigned int first = 0x1;
4505 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4507 char className[1024];
4509 strcpy(className, _class->fullName);
4510 for(param = _class->templateParams.first; param; param = param->next)
4514 strcat(className, "<");
4516 strcat(className, ", ");
4517 if(lastParam + 1 != p)
4519 strcat(className, param->name);
4520 strcat(className, " = ");
4522 strcat(className, param->name);
4530 int len = strlen(className);
4532 if(className[len - 1] == '>')
4533 className[len++] = ' ';
4534 className[len++] = '>';
4535 className[len++] = '\0';
4537 return MkClassType(className);
4541 return MkClassType(_class->fullName);
4545 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4547 if(specs != (((void *)0)) && _class)
4549 struct Specifier * spec;
4551 for(spec = specs->first; spec; spec = spec->next)
4553 if(spec->type == 0 && spec->specifier == THISCLASS)
4556 spec->name = ReplaceThisClass(_class);
4557 spec->symbol = FindClass(spec->name);
4563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4565 struct __ecereNameSpace__ecere__com__GlobalFunction
4567 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4568 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4571 struct __ecereNameSpace__ecere__com__Instance * module;
4572 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4573 char * dataTypeString;
4574 struct Type * dataType;
4576 } __attribute__ ((gcc_struct));
4578 extern struct Context * globalContext;
4580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4582 struct FunctionImport
4584 struct FunctionImport * prev;
4585 struct FunctionImport * next;
4587 } __attribute__ ((gcc_struct));
4589 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4591 struct Symbol * symbol = function->symbol;
4593 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4595 unsigned int imported = 0x0;
4596 unsigned int dllImport = 0x0;
4598 if(!function->dataType)
4600 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4601 if(!function->dataType->thisClass)
4602 function->dataType->staticMethod = 0x1;
4608 struct ModuleImport * module = FindModule(function->module);
4610 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4613 if(!function->dataType->dllExport)
4615 symbol->_import = (struct ClassImport *)__extension__ ({
4616 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4618 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4620 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4624 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4625 if(!symbol->type->thisClass)
4626 symbol->type->staticMethod = 0x1;
4629 imported = symbol->_import ? 0x1 : 0x0;
4630 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4633 DeclareType(function->dataType, 0x1, 0x1);
4636 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4638 struct Declaration * decl;
4639 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4640 struct Declarator * d;
4641 struct Declarator * funcDecl;
4642 struct External * external;
4644 specifiers = MkList();
4645 declarators = MkList();
4646 ListAdd(specifiers, MkSpecifier(EXTERN));
4647 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4649 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4650 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4651 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4653 struct Specifier * spec;
4655 for(spec = (*specifiers).first; spec; spec = spec->next)
4656 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4658 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4659 FreeSpecifier(spec);
4663 funcDecl = GetFuncDecl(d);
4664 if(funcDecl && !funcDecl->function.parameters)
4666 funcDecl->function.parameters = MkList();
4667 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4669 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4671 struct Context * oldCtx = curContext;
4673 curContext = globalContext;
4674 decl = MkDeclaration(specifiers, declarators);
4675 curContext = oldCtx;
4677 if(symbol->pointerExternal)
4679 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4682 *functionSymbol = *symbol;
4683 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4684 if(functionSymbol->type)
4685 functionSymbol->type->refCount++;
4687 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4688 symbol->pointerExternal->symbol = functionSymbol;
4690 external = MkExternalDeclaration(decl);
4692 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4693 external->symbol = symbol;
4694 symbol->pointerExternal = external;
4698 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4701 symbol->id = curExternal->symbol->idCode;
4704 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4707 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4712 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4713 struct __ecereNameSpace__ecere__sys__BTNode * left;
4714 struct __ecereNameSpace__ecere__sys__BTNode * right;
4716 struct __ecereNameSpace__ecere__com__Instance * module;
4717 char * dataTypeString;
4718 struct Type * dataType;
4721 } __attribute__ ((gcc_struct));
4723 void DeclareGlobalData(struct GlobalData * data)
4725 struct Symbol * symbol = data->symbol;
4727 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4732 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4735 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4736 DeclareType(data->dataType, 0x1, 0x1);
4739 if(!symbol->pointerExternal)
4741 struct Declaration * decl;
4742 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4743 struct Declarator * d;
4744 struct External * external;
4746 specifiers = MkList();
4747 declarators = MkList();
4748 ListAdd(specifiers, MkSpecifier(EXTERN));
4749 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4750 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4751 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4752 decl = MkDeclaration(specifiers, declarators);
4753 external = MkExternalDeclaration(decl);
4755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4756 external->symbol = symbol;
4757 symbol->pointerExternal = external;
4761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4764 symbol->id = curExternal->symbol->idCode;
4771 struct Conversion * prev, * next;
4772 struct __ecereNameSpace__ecere__com__Property * convert;
4774 struct Type * resultType;
4775 } __attribute__ ((gcc_struct));
4777 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4779 extern void Compiler_Warning(char * format, ...);
4781 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4783 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)
4787 if(source->kind == 20 && dest->kind != 20)
4789 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4794 if(dest->kind == 20 && source->kind != 20)
4796 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4801 if(dest->classObjectType == 2)
4803 if(source->classObjectType != 3)
4807 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4815 if(source->classObjectType == 3)
4817 if(dest->classObjectType == 3 && source->classObjectType != 2)
4820 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4822 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4825 if(dest->kind == 14 && source->kind != 0)
4827 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))
4829 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))
4831 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4833 if(source->_class->registered && source->_class->registered->type == 3)
4835 if(conversions != (((void *)0)))
4837 if(source->_class->registered == dest->_class->registered)
4842 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4844 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4846 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4848 if(sourceBase == destBase)
4852 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))
4856 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))
4858 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4865 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4869 if(source->kind == 8)
4871 struct __ecereNameSpace__ecere__com__Class * _class;
4873 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4875 struct __ecereNameSpace__ecere__com__Property * convert;
4877 for(convert = _class->conversions.first; convert; convert = convert->next)
4879 if(convert->memberAccess == 1 || _class->module == privateModule)
4881 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4883 if(!convert->dataType)
4884 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4885 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1))
4887 if(!conversions && !convert->Get)
4889 else if(conversions != (((void *)0)))
4891 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))
4895 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4908 struct __ecereNameSpace__ecere__com__Class * _class;
4910 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4912 struct __ecereNameSpace__ecere__com__Property * convert;
4914 for(convert = _class->conversions.first; convert; convert = convert->next)
4916 if(convert->memberAccess == 1 || _class->module == privateModule)
4918 if(!convert->dataType)
4919 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4920 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4922 if(!conversions && !convert->Set)
4924 else if(conversions != (((void *)0)))
4926 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))
4930 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4932 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4940 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4942 if(!dest->_class->registered->dataType)
4943 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4944 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4946 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0))
4953 if(source->kind == 8)
4955 struct __ecereNameSpace__ecere__com__Class * _class;
4957 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4959 struct __ecereNameSpace__ecere__com__Property * convert;
4961 for(convert = _class->conversions.first; convert; convert = convert->next)
4963 if(convert->memberAccess == 1 || _class->module == privateModule)
4965 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4967 if(!convert->dataType)
4968 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4969 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1))
4971 if(!conversions && !convert->Get)
4973 else if(conversions != (((void *)0)))
4975 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))
4979 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4989 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4991 if(!source->_class->registered->dataType)
4992 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4993 if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
4995 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->_class->registered->dataType->kind == 8, source->_class->registered->dataType->kind == 8, 0x0, 0x0))
4997 else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
5003 if(source->kind == 8 || source->kind == 19)
5005 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5007 else if(dest->kind == 7 && source->kind == 6)
5009 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5011 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5013 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5015 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5017 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5019 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
5021 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5023 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)))
5025 struct Type * paramSource, * paramDest;
5027 if(dest->kind == 16)
5028 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5029 if(source->kind == 16)
5030 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5031 if(dest->kind == 13 && dest->type->kind == 11)
5033 if(source->kind == 13 && source->type->kind == 11)
5034 source = source->type;
5035 if(dest->kind == 16)
5036 dest = dest->method->dataType;
5037 if(source->kind == 16)
5038 source = source->method->dataType;
5039 paramSource = source->params.first;
5040 if(paramSource && paramSource->kind == 0)
5041 paramSource = (((void *)0));
5042 paramDest = dest->params.first;
5043 if(paramDest && paramDest->kind == 0)
5044 paramDest = (((void *)0));
5045 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5047 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))))
5049 if(paramDest && paramDest->kind == 8)
5050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5055 paramDest = paramDest->next;
5057 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5059 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5063 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5065 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5071 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5080 paramSource = paramSource->next;
5086 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5088 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5094 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5102 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5104 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5107 for(; paramDest; paramDest = paramDest->next)
5111 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5115 struct Type * paramDestType = paramDest;
5116 struct Type * paramSourceType = paramSource;
5117 struct Type * type = paramDestType;
5119 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5122 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5123 struct __ecereNameSpace__ecere__com__Class * sClass;
5125 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5128 if(sClass->templateClass)
5129 sClass = sClass->templateClass;
5130 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5132 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5134 for(sClass = sClass->base; sClass; sClass = sClass->base)
5136 if(sClass->templateClass)
5137 sClass = sClass->templateClass;
5138 id += sClass->templateParams.count;
5149 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5151 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5154 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)))
5159 PrintType(paramDest, type, 0x0, 0x1);
5160 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5161 if(paramDestType != paramDest)
5162 FreeType(paramDestType);
5165 if(paramDestType != paramDest)
5166 FreeType(paramDestType);
5168 paramSource = paramSource->next;
5172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5177 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5181 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5183 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5190 static void FreeConvert(struct Conversion * convert)
5192 if(convert->resultType)
5193 FreeType(convert->resultType);
5196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5198 struct __ecereNameSpace__ecere__com__BTNamedLink
5201 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5202 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5203 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5206 } __attribute__ ((gcc_struct));
5208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5210 struct __ecereNameSpace__ecere__com__EnumClassData
5212 struct __ecereNameSpace__ecere__sys__OldList values;
5214 } __attribute__ ((gcc_struct));
5216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5218 struct __ecereNameSpace__ecere__sys__NamedLink
5220 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5221 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5224 } __attribute__ ((gcc_struct));
5226 extern void FreeExpContents(struct Expression * exp);
5228 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5230 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5232 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5234 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5236 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5238 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5240 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5242 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)))
5244 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5246 if(_class->type == 4)
5248 struct __ecereNameSpace__ecere__sys__OldList converts =
5252 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5256 _class->symbol = FindClass(_class->fullName);
5257 type->_class = _class->symbol;
5258 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5260 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5261 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5265 struct __ecereNameSpace__ecere__com__Class * baseClass;
5267 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5269 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5271 for(value = e->values.first; value; value = value->next)
5273 if(!strcmp(value->name, string))
5278 FreeExpContents(sourceExp);
5279 FreeType(sourceExp->expType);
5280 sourceExp->isConstant = 0x1;
5281 sourceExp->expType = MkClassType(baseClass->fullName);
5285 sourceExp->type = 2;
5286 if(!strcmp(baseClass->dataTypeString, "int"))
5287 sprintf(constant, "%d", (int)value->data);
5289 sprintf(constant, "0x%X", (int)value->data);
5290 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5292 while(converts.first)
5294 struct Conversion * convert = converts.first;
5296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5299 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5307 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5310 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)))
5311 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5316 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5318 struct __ecereNameSpace__ecere__com__SubModule
5320 struct __ecereNameSpace__ecere__com__SubModule * prev;
5321 struct __ecereNameSpace__ecere__com__SubModule * next;
5322 struct __ecereNameSpace__ecere__com__Instance * module;
5324 } __attribute__ ((gcc_struct));
5326 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5328 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5330 if(searchFor == searchIn)
5332 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5334 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5336 if(ModuleVisibility(subModule->module, searchFor))
5343 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5345 struct __ecereNameSpace__ecere__com__Application
5350 unsigned int isGUIApp;
5351 struct __ecereNameSpace__ecere__sys__OldList allModules;
5352 char * parsedCommand;
5353 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5354 } __attribute__ ((gcc_struct));
5356 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5358 struct __ecereNameSpace__ecere__com__Instance * module;
5360 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))
5362 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))
5364 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))
5366 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)
5368 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5374 extern struct Expression * CopyExpression(struct Expression * exp);
5376 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5378 void ReadString(char * output, char * string);
5380 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5382 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5384 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5386 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5388 struct Type * source;
5389 struct Type * realDest = dest;
5390 struct Type * backupSourceExpType = (((void *)0));
5391 struct Expression * computedExp = sourceExp;
5394 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5396 computedExp = CopyExpression(sourceExp);
5397 ComputeExpression(computedExp);
5399 source = sourceExp->expType;
5400 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5402 if(computedExp != sourceExp)
5404 FreeExpression(computedExp);
5405 computedExp = sourceExp;
5410 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5412 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5414 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5416 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5418 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5420 if(sourceBase == destBase)
5422 if(computedExp != sourceExp)
5424 FreeExpression(computedExp);
5425 computedExp = sourceExp;
5434 struct __ecereNameSpace__ecere__sys__OldList * specs;
5435 unsigned int flag = 0x0;
5436 long long value = (((int)0x7fffffff));
5439 if(computedExp->type == 2)
5441 if(source->isSigned)
5442 value = strtoll(computedExp->constant, (((void *)0)), 0);
5444 value = strtoull(computedExp->constant, (((void *)0)), 0);
5446 else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
5448 if(source->isSigned)
5449 value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
5451 value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
5453 if(computedExp != sourceExp)
5455 FreeExpression(computedExp);
5456 computedExp = sourceExp;
5458 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5461 source = __extension__ ({
5462 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5464 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5469 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5471 if(_class && _class->type == 3)
5473 if(source->kind != 8)
5475 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5476 struct Type * tempDest, * tempSource;
5478 for(; _class->base->type != 1000; _class = _class->base)
5481 tempDest = tempType;
5484 _class->symbol = FindClass(_class->fullName);
5485 tempType->_class = _class->symbol;
5486 tempType->truth = dest->truth;
5487 if(tempType->_class)
5488 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5489 backupSourceExpType = sourceExp->expType;
5490 sourceExp->expType = dest;
5493 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5496 if(_class && _class->type == 2 && source->kind != 8)
5498 if(!dest->_class->registered->dataType)
5499 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5500 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5503 FreeType(sourceExp->expType);
5504 source = sourceExp->expType = MkClassType(dest->_class->string);
5508 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5510 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5511 struct Declarator * decl;
5514 ReadString(string, sourceExp->string);
5515 decl = SpecDeclFromString(string, specs, (((void *)0)));
5516 FreeExpContents(sourceExp);
5517 FreeType(sourceExp->expType);
5518 sourceExp->type = 24;
5519 sourceExp->_classExp.specifiers = specs;
5520 sourceExp->_classExp.decl = decl;
5521 sourceExp->expType = dest;
5525 if(backupSourceExpType)
5526 FreeType(backupSourceExpType);
5530 else if(source->kind == 8)
5532 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5534 if(_class && (_class->type == 3 || _class->type == 2))
5538 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5539 struct Type * tempDest, * tempSource;
5541 if(!source->_class->registered->dataType)
5542 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5543 for(; _class->base->type != 1000; _class = _class->base)
5546 tempSource = tempType;
5548 tempType->_class = FindClass(_class->fullName);
5549 tempType->truth = source->truth;
5550 tempType->classObjectType = source->classObjectType;
5551 if(tempType->_class)
5552 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5553 if(conversions->last)
5555 ((struct Conversion *)conversions->last)->resultType = dest;
5558 FreeType(sourceExp->expType);
5559 sourceExp->expType = MkClassType(_class->fullName);
5560 sourceExp->expType->truth = source->truth;
5561 sourceExp->expType->classObjectType = source->classObjectType;
5562 if(!sourceExp->destType)
5564 FreeType(sourceExp->destType);
5565 sourceExp->destType = sourceExp->expType;
5566 if(sourceExp->expType)
5567 sourceExp->expType->refCount++;
5569 if(!_class->dataType)
5570 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5572 dest = MkClassType(source->_class->string);
5573 dest->truth = source->truth;
5574 dest->classObjectType = source->classObjectType;
5576 source = _class->dataType;
5578 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5584 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5593 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5594 unsigned int fittingValue = 0x0;
5596 if(_class && _class->type == 4)
5598 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5599 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5601 if(c && value >= 0 && value <= c->largest)
5604 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5606 if(_class->type == 0 || _class->type == 5)
5608 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5610 *newExp = *sourceExp;
5611 if(sourceExp->destType)
5612 sourceExp->destType->refCount++;
5613 if(sourceExp->expType)
5614 sourceExp->expType->refCount++;
5615 sourceExp->type = 11;
5616 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5617 sourceExp->cast.exp = newExp;
5618 FreeType(sourceExp->expType);
5619 sourceExp->expType = (((void *)0));
5620 ProcessExpressionType(sourceExp);
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = dest;
5629 if(backupSourceExpType)
5630 FreeType(backupSourceExpType);
5633 if(!_class->dataType)
5634 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5636 dest = _class->dataType;
5639 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5641 specs = MkListOne(MkSpecifier(DOUBLE));
5643 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5645 specs = MkListOne(MkSpecifier(FLOAT));
5647 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5651 ListAdd(specs, MkSpecifier(UNSIGNED));
5652 ListAdd(specs, MkSpecifier(INT64));
5654 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5658 ListAdd(specs, MkSpecifier(UNSIGNED));
5659 ListAdd(specs, MkSpecifier(INT));
5661 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5665 ListAdd(specs, MkSpecifier(UNSIGNED));
5666 ListAdd(specs, MkSpecifier(SHORT));
5668 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5672 ListAdd(specs, MkSpecifier(UNSIGNED));
5673 ListAdd(specs, MkSpecifier(CHAR));
5679 if(backupSourceExpType)
5681 if(sourceExp->expType)
5682 FreeType(sourceExp->expType);
5683 sourceExp->expType = backupSourceExpType;
5688 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 == 24 || source->kind == 1))
5690 specs = MkListOne(MkSpecifier(DOUBLE));
5692 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5694 specs = MkListOne(MkSpecifier(FLOAT));
5696 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5699 ListAdd(specs, MkSpecifier(BOOL));
5701 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5705 ListAdd(specs, MkSpecifier(UNSIGNED));
5706 ListAdd(specs, MkSpecifier(CHAR));
5708 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5712 ListAdd(specs, MkSpecifier(UNSIGNED));
5713 ListAdd(specs, MkSpecifier(SHORT));
5715 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5719 ListAdd(specs, MkSpecifier(UNSIGNED));
5720 ListAdd(specs, MkSpecifier(INT));
5722 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5726 ListAdd(specs, MkSpecifier(UNSIGNED));
5727 ListAdd(specs, MkSpecifier(INT64));
5729 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5731 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5737 if(backupSourceExpType)
5739 if(sourceExp->expType)
5740 FreeType(sourceExp->expType);
5741 sourceExp->expType = backupSourceExpType;
5745 if(!flag && !sourceExp->opDestType)
5747 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5749 *newExp = *sourceExp;
5750 newExp->prev = (((void *)0));
5751 newExp->next = (((void *)0));
5752 if(sourceExp->destType)
5753 sourceExp->destType->refCount++;
5754 if(sourceExp->expType)
5755 sourceExp->expType->refCount++;
5756 sourceExp->type = 11;
5757 if(realDest->kind == 8)
5759 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5760 FreeList(specs, FreeSpecifier);
5763 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5764 if(newExp->type == 4)
5766 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5769 sourceExp->cast.exp = newExp;
5770 FreeType(sourceExp->expType);
5771 sourceExp->expType = (((void *)0));
5772 ProcessExpressionType(sourceExp);
5775 FreeList(specs, FreeSpecifier);
5778 if(backupSourceExpType)
5779 FreeType(backupSourceExpType);
5784 if(computedExp != sourceExp)
5786 FreeExpression(computedExp);
5787 computedExp = sourceExp;
5789 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5790 sourceExp = (*sourceExp->list).last;
5791 if(sourceExp->type == 0)
5793 struct Identifier * id = sourceExp->identifier;
5797 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5799 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5800 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5804 for(; _class && _class->type == 4; _class = _class->base)
5806 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5807 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5809 for(value = e->values.first; value; value = value->next)
5811 if(!strcmp(value->name, id->string))
5816 FreeExpContents(sourceExp);
5817 FreeType(sourceExp->expType);
5818 sourceExp->isConstant = 0x1;
5819 sourceExp->expType = MkClassType(_class->fullName);
5823 sourceExp->type = 2;
5824 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5825 sprintf(constant, "%d", (int)value->data);
5827 sprintf(constant, "0x%X", (int)value->data);
5828 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5837 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5848 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5850 int value2 = op2->i;
5853 exp->string = PrintInt((op1->i + value2));
5856 exp->expType = op1->type;
5858 op1->type->refCount++;
5863 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5865 unsigned int value2 = op2->ui;
5868 exp->string = PrintUInt((op1->ui + value2));
5871 exp->expType = op1->type;
5873 op1->type->refCount++;
5878 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5880 long long value2 = op2->i64;
5883 exp->string = PrintInt64((op1->i64 + value2));
5886 exp->expType = op1->type;
5888 op1->type->refCount++;
5893 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5895 uint64 value2 = op2->ui64;
5898 exp->string = PrintUInt64((op1->ui64 + value2));
5901 exp->expType = op1->type;
5903 op1->type->refCount++;
5908 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5910 short value2 = op2->s;
5913 exp->string = PrintShort((op1->s + value2));
5916 exp->expType = op1->type;
5918 op1->type->refCount++;
5923 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5925 unsigned short value2 = op2->us;
5928 exp->string = PrintUShort((op1->us + value2));
5931 exp->expType = op1->type;
5933 op1->type->refCount++;
5938 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5940 char value2 = op2->c;
5943 exp->string = PrintChar((op1->c + value2));
5946 exp->expType = op1->type;
5948 op1->type->refCount++;
5953 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5955 unsigned char value2 = op2->uc;
5958 exp->string = PrintUChar((op1->uc + value2));
5961 exp->expType = op1->type;
5963 op1->type->refCount++;
5968 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5970 float value2 = op2->f;
5973 exp->string = PrintFloat((float)(op1->f + value2));
5976 exp->expType = op1->type;
5978 op1->type->refCount++;
5983 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5985 double value2 = op2->d;
5988 exp->string = PrintDouble((double)(op1->d + value2));
5991 exp->expType = op1->type;
5993 op1->type->refCount++;
5998 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 int value2 = op2->i;
6003 exp->string = PrintInt((op1->i - value2));
6006 exp->expType = op1->type;
6008 op1->type->refCount++;
6013 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 unsigned int value2 = op2->ui;
6018 exp->string = PrintUInt((op1->ui - value2));
6021 exp->expType = op1->type;
6023 op1->type->refCount++;
6028 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 long long value2 = op2->i64;
6033 exp->string = PrintInt64((op1->i64 - value2));
6036 exp->expType = op1->type;
6038 op1->type->refCount++;
6043 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6045 uint64 value2 = op2->ui64;
6048 exp->string = PrintUInt64((op1->ui64 - value2));
6051 exp->expType = op1->type;
6053 op1->type->refCount++;
6058 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6060 short value2 = op2->s;
6063 exp->string = PrintShort((op1->s - value2));
6066 exp->expType = op1->type;
6068 op1->type->refCount++;
6073 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6075 unsigned short value2 = op2->us;
6078 exp->string = PrintUShort((op1->us - value2));
6081 exp->expType = op1->type;
6083 op1->type->refCount++;
6088 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6090 char value2 = op2->c;
6093 exp->string = PrintChar((op1->c - value2));
6096 exp->expType = op1->type;
6098 op1->type->refCount++;
6103 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6105 unsigned char value2 = op2->uc;
6108 exp->string = PrintUChar((op1->uc - value2));
6111 exp->expType = op1->type;
6113 op1->type->refCount++;
6118 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6120 float value2 = op2->f;
6123 exp->string = PrintFloat((float)(op1->f - value2));
6126 exp->expType = op1->type;
6128 op1->type->refCount++;
6133 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6135 double value2 = op2->d;
6138 exp->string = PrintDouble((double)(op1->d - value2));
6141 exp->expType = op1->type;
6143 op1->type->refCount++;
6148 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6150 int value2 = op2->i;
6153 exp->string = PrintInt((op1->i * value2));
6156 exp->expType = op1->type;
6158 op1->type->refCount++;
6163 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6165 unsigned int value2 = op2->ui;
6168 exp->string = PrintUInt((op1->ui * value2));
6171 exp->expType = op1->type;
6173 op1->type->refCount++;
6178 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6180 long long value2 = op2->i64;
6183 exp->string = PrintInt64((op1->i64 * value2));
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6195 uint64 value2 = op2->ui64;
6198 exp->string = PrintUInt64((op1->ui64 * value2));
6201 exp->expType = op1->type;
6203 op1->type->refCount++;
6208 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6210 short value2 = op2->s;
6213 exp->string = PrintShort((op1->s * value2));
6216 exp->expType = op1->type;
6218 op1->type->refCount++;
6223 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6225 unsigned short value2 = op2->us;
6228 exp->string = PrintUShort((op1->us * value2));
6231 exp->expType = op1->type;
6233 op1->type->refCount++;
6238 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6240 char value2 = op2->c;
6243 exp->string = PrintChar((op1->c * value2));
6246 exp->expType = op1->type;
6248 op1->type->refCount++;
6253 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6255 unsigned char value2 = op2->uc;
6258 exp->string = PrintUChar((op1->uc * value2));
6261 exp->expType = op1->type;
6263 op1->type->refCount++;
6268 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6270 float value2 = op2->f;
6273 exp->string = PrintFloat((float)(op1->f * value2));
6276 exp->expType = op1->type;
6278 op1->type->refCount++;
6283 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6285 double value2 = op2->d;
6288 exp->string = PrintDouble((double)(op1->d * value2));
6291 exp->expType = op1->type;
6293 op1->type->refCount++;
6298 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6300 int value2 = op2->i;
6303 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6306 exp->expType = op1->type;
6308 op1->type->refCount++;
6313 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6315 unsigned int value2 = op2->ui;
6318 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6321 exp->expType = op1->type;
6323 op1->type->refCount++;
6328 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6330 long long value2 = op2->i64;
6333 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6345 uint64 value2 = op2->ui64;
6348 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6351 exp->expType = op1->type;
6353 op1->type->refCount++;
6358 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6360 short value2 = op2->s;
6363 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6366 exp->expType = op1->type;
6368 op1->type->refCount++;
6373 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6375 unsigned short value2 = op2->us;
6378 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6381 exp->expType = op1->type;
6383 op1->type->refCount++;
6388 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6390 char value2 = op2->c;
6393 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6396 exp->expType = op1->type;
6398 op1->type->refCount++;
6403 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6405 unsigned char value2 = op2->uc;
6408 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6411 exp->expType = op1->type;
6413 op1->type->refCount++;
6418 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6420 float value2 = op2->f;
6423 exp->string = PrintFloat(op1->f / value2);
6426 exp->expType = op1->type;
6428 op1->type->refCount++;
6433 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6435 double value2 = op2->d;
6438 exp->string = PrintDouble(op1->d / value2);
6441 exp->expType = op1->type;
6443 op1->type->refCount++;
6448 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6450 int value2 = op2->i;
6453 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6456 exp->expType = op1->type;
6458 op1->type->refCount++;
6463 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6465 unsigned int value2 = op2->ui;
6468 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6471 exp->expType = op1->type;
6473 op1->type->refCount++;
6478 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6480 long long value2 = op2->i64;
6483 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6486 exp->expType = op1->type;
6488 op1->type->refCount++;
6493 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6495 uint64 value2 = op2->ui64;
6498 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6501 exp->expType = op1->type;
6503 op1->type->refCount++;
6508 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6510 short value2 = op2->s;
6513 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6516 exp->expType = op1->type;
6518 op1->type->refCount++;
6523 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6525 unsigned short value2 = op2->us;
6528 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6531 exp->expType = op1->type;
6533 op1->type->refCount++;
6538 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6540 char value2 = op2->c;
6543 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6546 exp->expType = op1->type;
6548 op1->type->refCount++;
6553 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6555 unsigned char value2 = op2->uc;
6558 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6561 exp->expType = op1->type;
6563 op1->type->refCount++;
6568 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6571 exp->string = PrintInt((-op1->i));
6574 exp->expType = op1->type;
6576 op1->type->refCount++;
6581 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6584 exp->string = PrintUInt((unsigned int)(-op1->ui));
6587 exp->expType = op1->type;
6589 op1->type->refCount++;
6594 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6597 exp->string = PrintInt64((-op1->i64));
6600 exp->expType = op1->type;
6602 op1->type->refCount++;
6607 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6610 exp->string = PrintUInt64((uint64)(-op1->ui64));
6613 exp->expType = op1->type;
6615 op1->type->refCount++;
6620 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6623 exp->string = PrintShort((-op1->s));
6626 exp->expType = op1->type;
6628 op1->type->refCount++;
6633 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6636 exp->string = PrintUShort((unsigned short)(-op1->us));
6639 exp->expType = op1->type;
6641 op1->type->refCount++;
6646 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6649 exp->string = PrintChar((-op1->c));
6652 exp->expType = op1->type;
6654 op1->type->refCount++;
6659 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6662 exp->string = PrintUChar((unsigned char)(-op1->uc));
6665 exp->expType = op1->type;
6667 op1->type->refCount++;
6672 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6675 exp->string = PrintFloat((float)(-op1->f));
6678 exp->expType = op1->type;
6680 op1->type->refCount++;
6685 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6688 exp->string = PrintDouble((double)(-op1->d));
6691 exp->expType = op1->type;
6693 op1->type->refCount++;
6698 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6701 exp->string = PrintInt((++op1->i));
6704 exp->expType = op1->type;
6706 op1->type->refCount++;
6711 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6714 exp->string = PrintUInt((++op1->ui));
6717 exp->expType = op1->type;
6719 op1->type->refCount++;
6724 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6727 exp->string = PrintInt64((++op1->i64));
6730 exp->expType = op1->type;
6732 op1->type->refCount++;
6737 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6740 exp->string = PrintUInt64((++op1->ui64));
6743 exp->expType = op1->type;
6745 op1->type->refCount++;
6750 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6753 exp->string = PrintShort((++op1->s));
6756 exp->expType = op1->type;
6758 op1->type->refCount++;
6763 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6766 exp->string = PrintUShort((++op1->us));
6769 exp->expType = op1->type;
6771 op1->type->refCount++;
6776 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6779 exp->string = PrintChar((++op1->c));
6782 exp->expType = op1->type;
6784 op1->type->refCount++;
6789 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6792 exp->string = PrintUChar((++op1->uc));
6795 exp->expType = op1->type;
6797 op1->type->refCount++;
6802 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6805 exp->string = PrintFloat((float)(++op1->f));
6808 exp->expType = op1->type;
6810 op1->type->refCount++;
6815 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6818 exp->string = PrintDouble((double)(++op1->d));
6821 exp->expType = op1->type;
6823 op1->type->refCount++;
6828 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6831 exp->string = PrintInt((--op1->i));
6834 exp->expType = op1->type;
6836 op1->type->refCount++;
6841 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6844 exp->string = PrintUInt((--op1->ui));
6847 exp->expType = op1->type;
6849 op1->type->refCount++;
6854 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6857 exp->string = PrintInt64((--op1->i64));
6860 exp->expType = op1->type;
6862 op1->type->refCount++;
6867 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6870 exp->string = PrintUInt64((--op1->ui64));
6873 exp->expType = op1->type;
6875 op1->type->refCount++;
6880 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6883 exp->string = PrintShort((--op1->s));
6886 exp->expType = op1->type;
6888 op1->type->refCount++;
6893 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6896 exp->string = PrintUShort((--op1->us));
6899 exp->expType = op1->type;
6901 op1->type->refCount++;
6906 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6909 exp->string = PrintChar((--op1->c));
6912 exp->expType = op1->type;
6914 op1->type->refCount++;
6919 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6922 exp->string = PrintUChar((--op1->uc));
6925 exp->expType = op1->type;
6927 op1->type->refCount++;
6932 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6935 exp->string = PrintFloat((float)(--op1->f));
6938 exp->expType = op1->type;
6940 op1->type->refCount++;
6945 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6948 exp->string = PrintDouble((double)(--op1->d));
6951 exp->expType = op1->type;
6953 op1->type->refCount++;
6958 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6960 int value2 = op2->i;
6963 exp->string = PrintInt((op1->i = value2));
6966 exp->expType = op1->type;
6968 op1->type->refCount++;
6973 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6975 unsigned int value2 = op2->ui;
6978 exp->string = PrintUInt((op1->ui = value2));
6981 exp->expType = op1->type;
6983 op1->type->refCount++;
6988 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6990 long long value2 = op2->i64;
6993 exp->string = PrintInt64((op1->i64 = value2));
6996 exp->expType = op1->type;
6998 op1->type->refCount++;
7003 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7005 uint64 value2 = op2->ui64;
7008 exp->string = PrintUInt64((op1->ui64 = value2));
7011 exp->expType = op1->type;
7013 op1->type->refCount++;
7018 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7020 short value2 = op2->s;
7023 exp->string = PrintShort((op1->s = value2));
7026 exp->expType = op1->type;
7028 op1->type->refCount++;
7033 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7035 unsigned short value2 = op2->us;
7038 exp->string = PrintUShort((op1->us = value2));
7041 exp->expType = op1->type;
7043 op1->type->refCount++;
7048 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7050 char value2 = op2->c;
7053 exp->string = PrintChar((op1->c = value2));
7056 exp->expType = op1->type;
7058 op1->type->refCount++;
7063 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7065 unsigned char value2 = op2->uc;
7068 exp->string = PrintUChar((op1->uc = value2));
7071 exp->expType = op1->type;
7073 op1->type->refCount++;
7078 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7080 float value2 = op2->f;
7083 exp->string = PrintFloat((float)(op1->f = value2));
7086 exp->expType = op1->type;
7088 op1->type->refCount++;
7093 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7095 double value2 = op2->d;
7098 exp->string = PrintDouble((double)(op1->d = value2));
7101 exp->expType = op1->type;
7103 op1->type->refCount++;
7108 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7110 int value2 = op2->i;
7113 exp->string = PrintInt((op1->i += value2));
7116 exp->expType = op1->type;
7118 op1->type->refCount++;
7123 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7125 unsigned int value2 = op2->ui;
7128 exp->string = PrintUInt((op1->ui += value2));
7131 exp->expType = op1->type;
7133 op1->type->refCount++;
7138 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7140 long long value2 = op2->i64;
7143 exp->string = PrintInt64((op1->i64 += value2));
7146 exp->expType = op1->type;
7148 op1->type->refCount++;
7153 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7155 uint64 value2 = op2->ui64;
7158 exp->string = PrintUInt64((op1->ui64 += value2));
7161 exp->expType = op1->type;
7163 op1->type->refCount++;
7168 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7170 short value2 = op2->s;
7173 exp->string = PrintShort((op1->s += value2));
7176 exp->expType = op1->type;
7178 op1->type->refCount++;
7183 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7185 unsigned short value2 = op2->us;
7188 exp->string = PrintUShort((op1->us += value2));
7191 exp->expType = op1->type;
7193 op1->type->refCount++;
7198 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7200 char value2 = op2->c;
7203 exp->string = PrintChar((op1->c += value2));
7206 exp->expType = op1->type;
7208 op1->type->refCount++;
7213 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7215 unsigned char value2 = op2->uc;
7218 exp->string = PrintUChar((op1->uc += value2));
7221 exp->expType = op1->type;
7223 op1->type->refCount++;
7228 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7230 float value2 = op2->f;
7233 exp->string = PrintFloat((float)(op1->f += value2));
7236 exp->expType = op1->type;
7238 op1->type->refCount++;
7243 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7245 double value2 = op2->d;
7248 exp->string = PrintDouble((double)(op1->d += value2));
7251 exp->expType = op1->type;
7253 op1->type->refCount++;
7258 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7260 int value2 = op2->i;
7263 exp->string = PrintInt((op1->i -= value2));
7266 exp->expType = op1->type;
7268 op1->type->refCount++;
7273 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7275 unsigned int value2 = op2->ui;
7278 exp->string = PrintUInt((op1->ui -= value2));
7281 exp->expType = op1->type;
7283 op1->type->refCount++;
7288 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7290 long long value2 = op2->i64;
7293 exp->string = PrintInt64((op1->i64 -= value2));
7296 exp->expType = op1->type;
7298 op1->type->refCount++;
7303 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7305 uint64 value2 = op2->ui64;
7308 exp->string = PrintUInt64((op1->ui64 -= value2));
7311 exp->expType = op1->type;
7313 op1->type->refCount++;
7318 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7320 short value2 = op2->s;
7323 exp->string = PrintShort((op1->s -= value2));
7326 exp->expType = op1->type;
7328 op1->type->refCount++;
7333 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7335 unsigned short value2 = op2->us;
7338 exp->string = PrintUShort((op1->us -= value2));
7341 exp->expType = op1->type;
7343 op1->type->refCount++;
7348 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7350 char value2 = op2->c;
7353 exp->string = PrintChar((op1->c -= value2));
7356 exp->expType = op1->type;
7358 op1->type->refCount++;
7363 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7365 unsigned char value2 = op2->uc;
7368 exp->string = PrintUChar((op1->uc -= value2));
7371 exp->expType = op1->type;
7373 op1->type->refCount++;
7378 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7380 float value2 = op2->f;
7383 exp->string = PrintFloat((float)(op1->f -= value2));
7386 exp->expType = op1->type;
7388 op1->type->refCount++;
7393 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7395 double value2 = op2->d;
7398 exp->string = PrintDouble((double)(op1->d -= value2));
7401 exp->expType = op1->type;
7403 op1->type->refCount++;
7408 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7410 int value2 = op2->i;
7413 exp->string = PrintInt((op1->i *= value2));
7416 exp->expType = op1->type;
7418 op1->type->refCount++;
7423 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7425 unsigned int value2 = op2->ui;
7428 exp->string = PrintUInt((op1->ui *= value2));
7431 exp->expType = op1->type;
7433 op1->type->refCount++;
7438 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7440 long long value2 = op2->i64;
7443 exp->string = PrintInt64((op1->i64 *= value2));
7446 exp->expType = op1->type;
7448 op1->type->refCount++;
7453 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7455 uint64 value2 = op2->ui64;
7458 exp->string = PrintUInt64((op1->ui64 *= value2));
7461 exp->expType = op1->type;
7463 op1->type->refCount++;
7468 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7470 short value2 = op2->s;
7473 exp->string = PrintShort((op1->s *= value2));
7476 exp->expType = op1->type;
7478 op1->type->refCount++;
7483 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7485 unsigned short value2 = op2->us;
7488 exp->string = PrintUShort((op1->us *= value2));
7491 exp->expType = op1->type;
7493 op1->type->refCount++;
7498 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7500 char value2 = op2->c;
7503 exp->string = PrintChar((op1->c *= value2));
7506 exp->expType = op1->type;
7508 op1->type->refCount++;
7513 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7515 unsigned char value2 = op2->uc;
7518 exp->string = PrintUChar((op1->uc *= value2));
7521 exp->expType = op1->type;
7523 op1->type->refCount++;
7528 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7530 float value2 = op2->f;
7533 exp->string = PrintFloat((float)(op1->f *= value2));
7536 exp->expType = op1->type;
7538 op1->type->refCount++;
7543 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7545 double value2 = op2->d;
7548 exp->string = PrintDouble((double)(op1->d *= value2));
7551 exp->expType = op1->type;
7553 op1->type->refCount++;
7558 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7560 int value2 = op2->i;
7563 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7566 exp->expType = op1->type;
7568 op1->type->refCount++;
7573 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7575 unsigned int value2 = op2->ui;
7578 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7581 exp->expType = op1->type;
7583 op1->type->refCount++;
7588 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7590 long long value2 = op2->i64;
7593 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7596 exp->expType = op1->type;
7598 op1->type->refCount++;
7603 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7605 uint64 value2 = op2->ui64;
7608 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7611 exp->expType = op1->type;
7613 op1->type->refCount++;
7618 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7620 short value2 = op2->s;
7623 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7626 exp->expType = op1->type;
7628 op1->type->refCount++;
7633 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7635 unsigned short value2 = op2->us;
7638 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7641 exp->expType = op1->type;
7643 op1->type->refCount++;
7648 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7650 char value2 = op2->c;
7653 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7656 exp->expType = op1->type;
7658 op1->type->refCount++;
7663 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7665 unsigned char value2 = op2->uc;
7668 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7680 float value2 = op2->f;
7683 exp->string = PrintFloat(op1->f /= value2);
7686 exp->expType = op1->type;
7688 op1->type->refCount++;
7693 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7695 double value2 = op2->d;
7698 exp->string = PrintDouble(op1->d /= value2);
7701 exp->expType = op1->type;
7703 op1->type->refCount++;
7708 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7710 int value2 = op2->i;
7713 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7716 exp->expType = op1->type;
7718 op1->type->refCount++;
7723 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7725 unsigned int value2 = op2->ui;
7728 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7731 exp->expType = op1->type;
7733 op1->type->refCount++;
7738 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7740 long long value2 = op2->i64;
7743 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7746 exp->expType = op1->type;
7748 op1->type->refCount++;
7753 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7755 uint64 value2 = op2->ui64;
7758 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7761 exp->expType = op1->type;
7763 op1->type->refCount++;
7768 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7770 short value2 = op2->s;
7773 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7776 exp->expType = op1->type;
7778 op1->type->refCount++;
7783 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7785 unsigned short value2 = op2->us;
7788 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7791 exp->expType = op1->type;
7793 op1->type->refCount++;
7798 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7800 char value2 = op2->c;
7803 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7806 exp->expType = op1->type;
7808 op1->type->refCount++;
7813 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7815 unsigned char value2 = op2->uc;
7818 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7821 exp->expType = op1->type;
7823 op1->type->refCount++;
7828 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7830 int value2 = op2->i;
7833 exp->string = PrintInt((op1->i & value2));
7836 exp->expType = op1->type;
7838 op1->type->refCount++;
7843 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7845 unsigned int value2 = op2->ui;
7848 exp->string = PrintUInt((op1->ui & value2));
7851 exp->expType = op1->type;
7853 op1->type->refCount++;
7858 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7860 long long value2 = op2->i64;
7863 exp->string = PrintInt64((op1->i64 & value2));
7866 exp->expType = op1->type;
7868 op1->type->refCount++;
7873 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7875 uint64 value2 = op2->ui64;
7878 exp->string = PrintUInt64((op1->ui64 & value2));
7881 exp->expType = op1->type;
7883 op1->type->refCount++;
7888 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7890 short value2 = op2->s;
7893 exp->string = PrintShort((op1->s & value2));
7896 exp->expType = op1->type;
7898 op1->type->refCount++;
7903 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7905 unsigned short value2 = op2->us;
7908 exp->string = PrintUShort((op1->us & value2));
7911 exp->expType = op1->type;
7913 op1->type->refCount++;
7918 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7920 char value2 = op2->c;
7923 exp->string = PrintChar((op1->c & value2));
7926 exp->expType = op1->type;
7928 op1->type->refCount++;
7933 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7935 unsigned char value2 = op2->uc;
7938 exp->string = PrintUChar((op1->uc & value2));
7941 exp->expType = op1->type;
7943 op1->type->refCount++;
7948 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7950 int value2 = op2->i;
7953 exp->string = PrintInt((op1->i | value2));
7956 exp->expType = op1->type;
7958 op1->type->refCount++;
7963 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7965 unsigned int value2 = op2->ui;
7968 exp->string = PrintUInt((op1->ui | value2));
7971 exp->expType = op1->type;
7973 op1->type->refCount++;
7978 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7980 long long value2 = op2->i64;
7983 exp->string = PrintInt64((op1->i64 | value2));
7986 exp->expType = op1->type;
7988 op1->type->refCount++;
7993 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7995 uint64 value2 = op2->ui64;
7998 exp->string = PrintUInt64((op1->ui64 | value2));
8001 exp->expType = op1->type;
8003 op1->type->refCount++;
8008 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8010 short value2 = op2->s;
8013 exp->string = PrintShort((op1->s | value2));
8016 exp->expType = op1->type;
8018 op1->type->refCount++;
8023 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8025 unsigned short value2 = op2->us;
8028 exp->string = PrintUShort((op1->us | value2));
8031 exp->expType = op1->type;
8033 op1->type->refCount++;
8038 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8040 char value2 = op2->c;
8043 exp->string = PrintChar((op1->c | value2));
8046 exp->expType = op1->type;
8048 op1->type->refCount++;
8053 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8055 unsigned char value2 = op2->uc;
8058 exp->string = PrintUChar((op1->uc | value2));
8061 exp->expType = op1->type;
8063 op1->type->refCount++;
8068 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8070 int value2 = op2->i;
8073 exp->string = PrintInt((op1->i ^ value2));
8076 exp->expType = op1->type;
8078 op1->type->refCount++;
8083 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8085 unsigned int value2 = op2->ui;
8088 exp->string = PrintUInt((op1->ui ^ value2));
8091 exp->expType = op1->type;
8093 op1->type->refCount++;
8098 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8100 long long value2 = op2->i64;
8103 exp->string = PrintInt64((op1->i64 ^ value2));
8106 exp->expType = op1->type;
8108 op1->type->refCount++;
8113 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8115 uint64 value2 = op2->ui64;
8118 exp->string = PrintUInt64((op1->ui64 ^ value2));
8121 exp->expType = op1->type;
8123 op1->type->refCount++;
8128 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 short value2 = op2->s;
8133 exp->string = PrintShort((op1->s ^ value2));
8136 exp->expType = op1->type;
8138 op1->type->refCount++;
8143 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 unsigned short value2 = op2->us;
8148 exp->string = PrintUShort((op1->us ^ value2));
8151 exp->expType = op1->type;
8153 op1->type->refCount++;
8158 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 char value2 = op2->c;
8163 exp->string = PrintChar((op1->c ^ value2));
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 unsigned char value2 = op2->uc;
8178 exp->string = PrintUChar((op1->uc ^ value2));
8181 exp->expType = op1->type;
8183 op1->type->refCount++;
8188 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 int value2 = op2->i;
8193 exp->string = PrintInt((op1->i << value2));
8196 exp->expType = op1->type;
8198 op1->type->refCount++;
8203 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 unsigned int value2 = op2->ui;
8208 exp->string = PrintUInt((op1->ui << value2));
8211 exp->expType = op1->type;
8213 op1->type->refCount++;
8218 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8220 long long value2 = op2->i64;
8223 exp->string = PrintInt64((op1->i64 << value2));
8226 exp->expType = op1->type;
8228 op1->type->refCount++;
8233 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8235 uint64 value2 = op2->ui64;
8238 exp->string = PrintUInt64((op1->ui64 << value2));
8241 exp->expType = op1->type;
8243 op1->type->refCount++;
8248 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 short value2 = op2->s;
8253 exp->string = PrintShort((op1->s << value2));
8256 exp->expType = op1->type;
8258 op1->type->refCount++;
8263 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 unsigned short value2 = op2->us;
8268 exp->string = PrintUShort((op1->us << value2));
8271 exp->expType = op1->type;
8273 op1->type->refCount++;
8278 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 char value2 = op2->c;
8283 exp->string = PrintChar((op1->c << value2));
8286 exp->expType = op1->type;
8288 op1->type->refCount++;
8293 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 unsigned char value2 = op2->uc;
8298 exp->string = PrintUChar((op1->uc << value2));
8301 exp->expType = op1->type;
8303 op1->type->refCount++;
8308 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 int value2 = op2->i;
8313 exp->string = PrintInt((op1->i >> value2));
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 unsigned int value2 = op2->ui;
8328 exp->string = PrintUInt((op1->ui >> value2));
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 long long value2 = op2->i64;
8343 exp->string = PrintInt64((op1->i64 >> value2));
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 uint64 value2 = op2->ui64;
8358 exp->string = PrintUInt64((op1->ui64 >> value2));
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 short value2 = op2->s;
8373 exp->string = PrintShort((op1->s >> value2));
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 unsigned short value2 = op2->us;
8388 exp->string = PrintUShort((op1->us >> value2));
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 char value2 = op2->c;
8403 exp->string = PrintChar((op1->c >> value2));
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 unsigned char value2 = op2->uc;
8418 exp->string = PrintUChar((op1->uc >> value2));
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8431 exp->string = PrintInt((~op1->i));
8434 exp->expType = op1->type;
8436 op1->type->refCount++;
8441 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8444 exp->string = PrintUInt((unsigned int)(~op1->ui));
8447 exp->expType = op1->type;
8449 op1->type->refCount++;
8454 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8457 exp->string = PrintInt64((long long)(~op1->i64));
8460 exp->expType = op1->type;
8462 op1->type->refCount++;
8467 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8470 exp->string = PrintUInt64((uint64)(~op1->ui64));
8473 exp->expType = op1->type;
8475 op1->type->refCount++;
8480 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8483 exp->string = PrintShort((short)(~op1->s));
8486 exp->expType = op1->type;
8488 op1->type->refCount++;
8493 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8496 exp->string = PrintUShort((unsigned short)(~op1->us));
8499 exp->expType = op1->type;
8501 op1->type->refCount++;
8506 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8509 exp->string = PrintChar((char)(~op1->c));
8512 exp->expType = op1->type;
8514 op1->type->refCount++;
8519 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8522 exp->string = PrintUChar((unsigned char)(~op1->uc));
8525 exp->expType = op1->type;
8527 op1->type->refCount++;
8532 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 int value2 = op2->i;
8537 exp->string = PrintInt((op1->i &= value2));
8540 exp->expType = op1->type;
8542 op1->type->refCount++;
8547 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 unsigned int value2 = op2->ui;
8552 exp->string = PrintUInt((op1->ui &= value2));
8555 exp->expType = op1->type;
8557 op1->type->refCount++;
8562 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 long long value2 = op2->i64;
8567 exp->string = PrintInt64((op1->i64 &= value2));
8570 exp->expType = op1->type;
8572 op1->type->refCount++;
8577 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 uint64 value2 = op2->ui64;
8582 exp->string = PrintUInt64((op1->ui64 &= value2));
8585 exp->expType = op1->type;
8587 op1->type->refCount++;
8592 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 short value2 = op2->s;
8597 exp->string = PrintShort((op1->s &= value2));
8600 exp->expType = op1->type;
8602 op1->type->refCount++;
8607 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 unsigned short value2 = op2->us;
8612 exp->string = PrintUShort((op1->us &= value2));
8615 exp->expType = op1->type;
8617 op1->type->refCount++;
8622 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 char value2 = op2->c;
8627 exp->string = PrintChar((op1->c &= value2));
8630 exp->expType = op1->type;
8632 op1->type->refCount++;
8637 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 unsigned char value2 = op2->uc;
8642 exp->string = PrintUChar((op1->uc &= value2));
8645 exp->expType = op1->type;
8647 op1->type->refCount++;
8652 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 int value2 = op2->i;
8657 exp->string = PrintInt((op1->i |= value2));
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 unsigned int value2 = op2->ui;
8672 exp->string = PrintUInt((op1->ui |= value2));
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 long long value2 = op2->i64;
8687 exp->string = PrintInt64((op1->i64 |= value2));
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 uint64 value2 = op2->ui64;
8702 exp->string = PrintUInt64((op1->ui64 |= value2));
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 short value2 = op2->s;
8717 exp->string = PrintShort((op1->s |= value2));
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 unsigned short value2 = op2->us;
8732 exp->string = PrintUShort((op1->us |= value2));
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 char value2 = op2->c;
8747 exp->string = PrintChar((op1->c |= value2));
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 unsigned char value2 = op2->uc;
8762 exp->string = PrintUChar((op1->uc |= value2));
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 int value2 = op2->i;
8777 exp->string = PrintInt((op1->i ^= value2));
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 unsigned int value2 = op2->ui;
8792 exp->string = PrintUInt((op1->ui ^= value2));
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 long long value2 = op2->i64;
8807 exp->string = PrintInt64((op1->i64 ^= value2));
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 uint64 value2 = op2->ui64;
8822 exp->string = PrintUInt64((op1->ui64 ^= value2));
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 short value2 = op2->s;
8837 exp->string = PrintShort((op1->s ^= value2));
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 unsigned short value2 = op2->us;
8852 exp->string = PrintUShort((op1->us ^= value2));
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 char value2 = op2->c;
8867 exp->string = PrintChar((op1->c ^= value2));
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 unsigned char value2 = op2->uc;
8882 exp->string = PrintUChar((op1->uc ^= value2));
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 int value2 = op2->i;
8897 exp->string = PrintInt((op1->i <<= value2));
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 unsigned int value2 = op2->ui;
8912 exp->string = PrintUInt((op1->ui <<= value2));
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8924 long long value2 = op2->i64;
8927 exp->string = PrintInt64((op1->i64 <<= value2));
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8939 uint64 value2 = op2->ui64;
8942 exp->string = PrintUInt64((op1->ui64 <<= value2));
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8954 short value2 = op2->s;
8957 exp->string = PrintShort((op1->s <<= value2));
8960 exp->expType = op1->type;
8962 op1->type->refCount++;
8967 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8969 unsigned short value2 = op2->us;
8972 exp->string = PrintUShort((op1->us <<= value2));
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8984 char value2 = op2->c;
8987 exp->string = PrintChar((op1->c <<= value2));
8990 exp->expType = op1->type;
8992 op1->type->refCount++;
8997 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8999 unsigned char value2 = op2->uc;
9002 exp->string = PrintUChar((op1->uc <<= value2));
9005 exp->expType = op1->type;
9007 op1->type->refCount++;
9012 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9014 int value2 = op2->i;
9017 exp->string = PrintInt((op1->i >>= value2));
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 unsigned int value2 = op2->ui;
9032 exp->string = PrintUInt((op1->ui >>= value2));
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 long long value2 = op2->i64;
9047 exp->string = PrintInt64((op1->i64 >>= value2));
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 uint64 value2 = op2->ui64;
9062 exp->string = PrintUInt64((op1->ui64 >>= value2));
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 short value2 = op2->s;
9077 exp->string = PrintShort((op1->s >>= value2));
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 unsigned short value2 = op2->us;
9092 exp->string = PrintUShort((op1->us >>= value2));
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 char value2 = op2->c;
9107 exp->string = PrintChar((op1->c >>= value2));
9110 exp->expType = op1->type;
9112 op1->type->refCount++;
9117 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 unsigned char value2 = op2->uc;
9122 exp->string = PrintUChar((op1->uc >>= value2));
9125 exp->expType = op1->type;
9127 op1->type->refCount++;
9132 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9135 exp->string = PrintInt((int)(!op1->i));
9138 exp->expType = op1->type;
9140 op1->type->refCount++;
9145 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9148 exp->string = PrintUInt((unsigned int)(!op1->ui));
9151 exp->expType = op1->type;
9153 op1->type->refCount++;
9158 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9161 exp->string = PrintInt64((long long)(!op1->i64));
9164 exp->expType = op1->type;
9166 op1->type->refCount++;
9171 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9174 exp->string = PrintUInt64((uint64)(!op1->ui64));
9177 exp->expType = op1->type;
9179 op1->type->refCount++;
9184 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9187 exp->string = PrintShort((short)(!op1->s));
9190 exp->expType = op1->type;
9192 op1->type->refCount++;
9197 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9200 exp->string = PrintUShort((unsigned short)(!op1->us));
9203 exp->expType = op1->type;
9205 op1->type->refCount++;
9210 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9213 exp->string = PrintChar((char)(!op1->c));
9216 exp->expType = op1->type;
9218 op1->type->refCount++;
9223 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9226 exp->string = PrintUChar((unsigned char)(!op1->uc));
9229 exp->expType = op1->type;
9231 op1->type->refCount++;
9236 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9238 int value2 = op2->i;
9241 exp->string = PrintInt((int)(op1->i == value2));
9244 exp->expType = op1->type;
9246 op1->type->refCount++;
9251 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9253 unsigned int value2 = op2->ui;
9256 exp->string = PrintUInt((unsigned int)(op1->ui == value2));
9259 exp->expType = op1->type;
9261 op1->type->refCount++;
9266 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9268 long long value2 = op2->i64;
9271 exp->string = PrintInt64((long long)(op1->i64 == value2));
9274 exp->expType = op1->type;
9276 op1->type->refCount++;
9281 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9283 uint64 value2 = op2->ui64;
9286 exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
9289 exp->expType = op1->type;
9291 op1->type->refCount++;
9296 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9298 short value2 = op2->s;
9301 exp->string = PrintShort((short)(op1->s == value2));
9304 exp->expType = op1->type;
9306 op1->type->refCount++;
9311 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9313 unsigned short value2 = op2->us;
9316 exp->string = PrintUShort((unsigned short)(op1->us == value2));
9319 exp->expType = op1->type;
9321 op1->type->refCount++;
9326 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9328 char value2 = op2->c;
9331 exp->string = PrintChar((char)(op1->c == value2));
9334 exp->expType = op1->type;
9336 op1->type->refCount++;
9341 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9343 unsigned char value2 = op2->uc;
9346 exp->string = PrintUChar((unsigned char)(op1->uc == value2));
9349 exp->expType = op1->type;
9351 op1->type->refCount++;
9356 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9358 float value2 = op2->f;
9361 exp->string = PrintFloat((float)(op1->f == value2));
9364 exp->expType = op1->type;
9366 op1->type->refCount++;
9371 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9373 double value2 = op2->d;
9376 exp->string = PrintDouble((double)(op1->d == value2));
9379 exp->expType = op1->type;
9381 op1->type->refCount++;
9386 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9388 int value2 = op2->i;
9391 exp->string = PrintInt((int)(op1->i != value2));
9394 exp->expType = op1->type;
9396 op1->type->refCount++;
9401 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9403 unsigned int value2 = op2->ui;
9406 exp->string = PrintUInt((unsigned int)(op1->ui != value2));
9409 exp->expType = op1->type;
9411 op1->type->refCount++;
9416 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9418 long long value2 = op2->i64;
9421 exp->string = PrintInt64((long long)(op1->i64 != value2));
9424 exp->expType = op1->type;
9426 op1->type->refCount++;
9431 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9433 uint64 value2 = op2->ui64;
9436 exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
9439 exp->expType = op1->type;
9441 op1->type->refCount++;
9446 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9448 short value2 = op2->s;
9451 exp->string = PrintShort((short)(op1->s != value2));
9454 exp->expType = op1->type;
9456 op1->type->refCount++;
9461 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9463 unsigned short value2 = op2->us;
9466 exp->string = PrintUShort((unsigned short)(op1->us != value2));
9469 exp->expType = op1->type;
9471 op1->type->refCount++;
9476 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9478 char value2 = op2->c;
9481 exp->string = PrintChar((char)(op1->c != value2));
9484 exp->expType = op1->type;
9486 op1->type->refCount++;
9491 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9493 unsigned char value2 = op2->uc;
9496 exp->string = PrintUChar((unsigned char)(op1->uc != value2));
9499 exp->expType = op1->type;
9501 op1->type->refCount++;
9506 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9508 float value2 = op2->f;
9511 exp->string = PrintFloat((float)(op1->f != value2));
9514 exp->expType = op1->type;
9516 op1->type->refCount++;
9521 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9523 double value2 = op2->d;
9526 exp->string = PrintDouble((double)(op1->d != value2));
9529 exp->expType = op1->type;
9531 op1->type->refCount++;
9536 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9538 int value2 = op2->i;
9541 exp->string = PrintInt((int)(op1->i && value2));
9544 exp->expType = op1->type;
9546 op1->type->refCount++;
9551 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9553 unsigned int value2 = op2->ui;
9556 exp->string = PrintUInt((unsigned int)(op1->ui && value2));
9559 exp->expType = op1->type;
9561 op1->type->refCount++;
9566 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9568 long long value2 = op2->i64;
9571 exp->string = PrintInt64((long long)(op1->i64 && value2));
9574 exp->expType = op1->type;
9576 op1->type->refCount++;
9581 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9583 uint64 value2 = op2->ui64;
9586 exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
9589 exp->expType = op1->type;
9591 op1->type->refCount++;
9596 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9598 short value2 = op2->s;
9601 exp->string = PrintShort((short)(op1->s && value2));
9604 exp->expType = op1->type;
9606 op1->type->refCount++;
9611 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9613 unsigned short value2 = op2->us;
9616 exp->string = PrintUShort((unsigned short)(op1->us && value2));
9619 exp->expType = op1->type;
9621 op1->type->refCount++;
9626 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9628 char value2 = op2->c;
9631 exp->string = PrintChar((char)(op1->c && value2));
9634 exp->expType = op1->type;
9636 op1->type->refCount++;
9641 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9643 unsigned char value2 = op2->uc;
9646 exp->string = PrintUChar((unsigned char)(op1->uc && value2));
9649 exp->expType = op1->type;
9651 op1->type->refCount++;
9656 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9658 float value2 = op2->f;
9661 exp->string = PrintFloat((float)(op1->f && value2));
9664 exp->expType = op1->type;
9666 op1->type->refCount++;
9671 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9673 double value2 = op2->d;
9676 exp->string = PrintDouble((double)(op1->d && value2));
9679 exp->expType = op1->type;
9681 op1->type->refCount++;
9686 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9688 int value2 = op2->i;
9691 exp->string = PrintInt((int)(op1->i || value2));
9694 exp->expType = op1->type;
9696 op1->type->refCount++;
9701 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9703 unsigned int value2 = op2->ui;
9706 exp->string = PrintUInt((unsigned int)(op1->ui || value2));
9709 exp->expType = op1->type;
9711 op1->type->refCount++;
9716 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9718 long long value2 = op2->i64;
9721 exp->string = PrintInt64((long long)(op1->i64 || value2));
9724 exp->expType = op1->type;
9726 op1->type->refCount++;
9731 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9733 uint64 value2 = op2->ui64;
9736 exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
9739 exp->expType = op1->type;
9741 op1->type->refCount++;
9746 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9748 short value2 = op2->s;
9751 exp->string = PrintShort((short)(op1->s || value2));
9754 exp->expType = op1->type;
9756 op1->type->refCount++;
9761 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9763 unsigned short value2 = op2->us;
9766 exp->string = PrintUShort((unsigned short)(op1->us || value2));
9769 exp->expType = op1->type;
9771 op1->type->refCount++;
9776 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9778 char value2 = op2->c;
9781 exp->string = PrintChar((char)(op1->c || value2));
9784 exp->expType = op1->type;
9786 op1->type->refCount++;
9791 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9793 unsigned char value2 = op2->uc;
9796 exp->string = PrintUChar((unsigned char)(op1->uc || value2));
9799 exp->expType = op1->type;
9801 op1->type->refCount++;
9806 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9808 float value2 = op2->f;
9811 exp->string = PrintFloat((float)(op1->f || value2));
9814 exp->expType = op1->type;
9816 op1->type->refCount++;
9821 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9823 double value2 = op2->d;
9826 exp->string = PrintDouble((double)(op1->d || value2));
9829 exp->expType = op1->type;
9831 op1->type->refCount++;
9836 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9838 int value2 = op2->i;
9841 exp->string = PrintInt((int)(op1->i > value2));
9844 exp->expType = op1->type;
9846 op1->type->refCount++;
9851 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9853 unsigned int value2 = op2->ui;
9856 exp->string = PrintUInt((unsigned int)(op1->ui > value2));
9859 exp->expType = op1->type;
9861 op1->type->refCount++;
9866 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9868 long long value2 = op2->i64;
9871 exp->string = PrintInt64((long long)(op1->i64 > value2));
9874 exp->expType = op1->type;
9876 op1->type->refCount++;
9881 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9883 uint64 value2 = op2->ui64;
9886 exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
9889 exp->expType = op1->type;
9891 op1->type->refCount++;
9896 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9898 short value2 = op2->s;
9901 exp->string = PrintShort((short)(op1->s > value2));
9904 exp->expType = op1->type;
9906 op1->type->refCount++;
9911 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9913 unsigned short value2 = op2->us;
9916 exp->string = PrintUShort((unsigned short)(op1->us > value2));
9919 exp->expType = op1->type;
9921 op1->type->refCount++;
9926 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9928 char value2 = op2->c;
9931 exp->string = PrintChar((char)(op1->c > value2));
9934 exp->expType = op1->type;
9936 op1->type->refCount++;
9941 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9943 unsigned char value2 = op2->uc;
9946 exp->string = PrintUChar((unsigned char)(op1->uc > value2));
9949 exp->expType = op1->type;
9951 op1->type->refCount++;
9956 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9958 float value2 = op2->f;
9961 exp->string = PrintFloat((float)(op1->f > value2));
9964 exp->expType = op1->type;
9966 op1->type->refCount++;
9971 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9973 double value2 = op2->d;
9976 exp->string = PrintDouble((double)(op1->d > value2));
9979 exp->expType = op1->type;
9981 op1->type->refCount++;
9986 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9988 int value2 = op2->i;
9991 exp->string = PrintInt((int)(op1->i < value2));
9994 exp->expType = op1->type;
9996 op1->type->refCount++;
10001 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10003 unsigned int value2 = op2->ui;
10006 exp->string = PrintUInt((unsigned int)(op1->ui < value2));
10009 exp->expType = op1->type;
10011 op1->type->refCount++;
10016 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10018 long long value2 = op2->i64;
10021 exp->string = PrintInt64((long long)(op1->i64 < value2));
10024 exp->expType = op1->type;
10026 op1->type->refCount++;
10031 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10033 uint64 value2 = op2->ui64;
10036 exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
10039 exp->expType = op1->type;
10041 op1->type->refCount++;
10046 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10048 short value2 = op2->s;
10051 exp->string = PrintShort((short)(op1->s < value2));
10054 exp->expType = op1->type;
10056 op1->type->refCount++;
10061 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10063 unsigned short value2 = op2->us;
10066 exp->string = PrintUShort((unsigned short)(op1->us < value2));
10069 exp->expType = op1->type;
10071 op1->type->refCount++;
10076 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10078 char value2 = op2->c;
10081 exp->string = PrintChar((char)(op1->c < value2));
10084 exp->expType = op1->type;
10086 op1->type->refCount++;
10091 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10093 unsigned char value2 = op2->uc;
10096 exp->string = PrintUChar((unsigned char)(op1->uc < value2));
10099 exp->expType = op1->type;
10101 op1->type->refCount++;
10106 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10108 float value2 = op2->f;
10111 exp->string = PrintFloat((float)(op1->f < value2));
10114 exp->expType = op1->type;
10116 op1->type->refCount++;
10121 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10123 double value2 = op2->d;
10126 exp->string = PrintDouble((double)(op1->d < value2));
10129 exp->expType = op1->type;
10131 op1->type->refCount++;
10136 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10138 int value2 = op2->i;
10141 exp->string = PrintInt((int)(op1->i >= value2));
10144 exp->expType = op1->type;
10146 op1->type->refCount++;
10151 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10153 unsigned int value2 = op2->ui;
10156 exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
10159 exp->expType = op1->type;
10161 op1->type->refCount++;
10166 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10168 long long value2 = op2->i64;
10171 exp->string = PrintInt64((long long)(op1->i64 >= value2));
10174 exp->expType = op1->type;
10176 op1->type->refCount++;
10181 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10183 uint64 value2 = op2->ui64;
10186 exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
10189 exp->expType = op1->type;
10191 op1->type->refCount++;
10196 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10198 short value2 = op2->s;
10201 exp->string = PrintShort((short)(op1->s >= value2));
10204 exp->expType = op1->type;
10206 op1->type->refCount++;
10211 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10213 unsigned short value2 = op2->us;
10216 exp->string = PrintUShort((unsigned short)(op1->us >= value2));
10219 exp->expType = op1->type;
10221 op1->type->refCount++;
10226 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10228 char value2 = op2->c;
10231 exp->string = PrintChar((char)(op1->c >= value2));
10234 exp->expType = op1->type;
10236 op1->type->refCount++;
10241 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10243 unsigned char value2 = op2->uc;
10246 exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
10249 exp->expType = op1->type;
10251 op1->type->refCount++;
10256 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10258 float value2 = op2->f;
10261 exp->string = PrintFloat((float)(op1->f >= value2));
10264 exp->expType = op1->type;
10266 op1->type->refCount++;
10271 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10273 double value2 = op2->d;
10276 exp->string = PrintDouble((double)(op1->d >= value2));
10279 exp->expType = op1->type;
10281 op1->type->refCount++;
10286 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10288 int value2 = op2->i;
10291 exp->string = PrintInt((int)(op1->i <= value2));
10294 exp->expType = op1->type;
10296 op1->type->refCount++;
10301 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10303 unsigned int value2 = op2->ui;
10306 exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
10309 exp->expType = op1->type;
10311 op1->type->refCount++;
10316 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10318 long long value2 = op2->i64;
10321 exp->string = PrintInt64((long long)(op1->i64 <= value2));
10324 exp->expType = op1->type;
10326 op1->type->refCount++;
10331 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10333 uint64 value2 = op2->ui64;
10336 exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
10339 exp->expType = op1->type;
10341 op1->type->refCount++;
10346 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10348 short value2 = op2->s;
10351 exp->string = PrintShort((short)(op1->s <= value2));
10354 exp->expType = op1->type;
10356 op1->type->refCount++;
10361 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10363 unsigned short value2 = op2->us;
10366 exp->string = PrintUShort((unsigned short)(op1->us <= value2));
10369 exp->expType = op1->type;
10371 op1->type->refCount++;
10376 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10378 char value2 = op2->c;
10381 exp->string = PrintChar((char)(op1->c <= value2));
10384 exp->expType = op1->type;
10386 op1->type->refCount++;
10391 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10393 unsigned char value2 = op2->uc;
10396 exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
10399 exp->expType = op1->type;
10401 op1->type->refCount++;
10406 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10408 float value2 = op2->f;
10411 exp->string = PrintFloat((float)(op1->f <= value2));
10414 exp->expType = op1->type;
10416 op1->type->refCount++;
10421 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10423 double value2 = op2->d;
10426 exp->string = PrintDouble((double)(op1->d <= value2));
10429 exp->expType = op1->type;
10431 op1->type->refCount++;
10436 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10439 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10442 exp->expType = op1->type;
10444 op1->type->refCount++;
10449 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10452 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10455 exp->expType = op1->type;
10457 op1->type->refCount++;
10462 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10465 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10468 exp->expType = op1->type;
10470 op1->type->refCount++;
10475 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10478 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10481 exp->expType = op1->type;
10483 op1->type->refCount++;
10488 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10491 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10494 exp->expType = op1->type;
10496 op1->type->refCount++;
10501 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10504 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10507 exp->expType = op1->type;
10509 op1->type->refCount++;
10514 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10517 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10520 exp->expType = op1->type;
10522 op1->type->refCount++;
10527 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10530 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10533 exp->expType = op1->type;
10535 op1->type->refCount++;
10540 struct OpTable intOps =
10542 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
10545 struct OpTable uintOps =
10547 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
10550 struct OpTable int64Ops =
10552 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10555 struct OpTable uint64Ops =
10557 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10560 struct OpTable shortOps =
10562 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
10565 struct OpTable ushortOps =
10567 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
10570 struct OpTable floatOps =
10572 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
10575 struct OpTable doubleOps =
10577 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
10580 struct OpTable charOps =
10582 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
10585 struct OpTable ucharOps =
10587 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
10590 void ReadString(char * output, char * string)
10592 int len = strlen(string);
10594 unsigned int quoted = 0x0, escaped = 0x0;
10596 for(c = 0; c < len; c++)
10598 char ch = string[c];
10656 int UnescapeString(char * d, char * s, int len)
10661 while(j < len && (ch = s[j]))
10666 switch((ch = s[++j]))
10712 char * OffsetEscapedString(char * s, int len, int offset)
10717 while(j < len && k < offset && (ch = s[j]))
10723 return (k == offset) ? s + j : (((void *)0));
10726 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10728 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10730 extern double strtod(char * , char * * );
10732 extern float (* __ecereMethod_float_inf)(void);
10734 extern float (* __ecereMethod_float_nan)(void);
10736 extern double (* __ecereMethod_double_inf)(void);
10738 extern double (* __ecereMethod_double_nan)(void);
10740 struct Operand GetOperand(struct Expression * exp)
10742 struct Operand op =
10746 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10749 struct Type * type = exp->expType;
10753 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10755 if(!type->_class->registered->dataType)
10756 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10757 type = type->_class->registered->dataType;
10759 if(exp->type == 3 && op.kind == 13)
10761 op.ui64 = (uint64)exp->string;
10763 op.ops = uint64Ops;
10765 else if(exp->isConstant && exp->type == 2)
10767 op.kind = type->kind;
10768 op.type = exp->expType;
10774 if(exp->constant[0] == '\'')
10776 op.c = exp->constant[1];
10779 else if(type->isSigned)
10781 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10786 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10794 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10799 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10800 op.ops = ushortOps;
10807 op.i = strtol(exp->constant, (((void *)0)), 0);
10812 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10820 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10825 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10826 op.ops = uint64Ops;
10833 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10838 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10839 op.ops = uint64Ops;
10846 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10851 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10852 op.ops = uint64Ops;
10857 if(!strcmp(exp->constant, "inf"))
10858 op.f = __ecereMethod_float_inf();
10859 else if(!strcmp(exp->constant, "-inf"))
10860 op.f = -__ecereMethod_float_inf();
10861 else if(!strcmp(exp->constant, "nan"))
10862 op.f = __ecereMethod_float_nan();
10863 else if(!strcmp(exp->constant, "-nan"))
10864 op.f = -__ecereMethod_float_nan();
10866 op.f = (float)strtod(exp->constant, (((void *)0)));
10870 if(!strcmp(exp->constant, "inf"))
10871 op.d = __ecereMethod_double_inf();
10872 else if(!strcmp(exp->constant, "-inf"))
10873 op.d = -__ecereMethod_double_inf();
10874 else if(!strcmp(exp->constant, "nan"))
10875 op.d = __ecereMethod_double_nan();
10876 else if(!strcmp(exp->constant, "-nan"))
10877 op.d = -__ecereMethod_double_nan();
10879 op.d = (double)strtod(exp->constant, (((void *)0)));
10880 op.ops = doubleOps;
10885 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10887 op.ops = uint64Ops;
10895 int __ecereVMethodID_class_OnGetString;
10897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10899 static void UnusedFunction()
10903 ((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);
10906 extern int __ecereVMethodID_class_OnGetString;
10908 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10910 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10912 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10914 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10915 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10918 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10919 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10920 struct Type * type;
10921 void * ptr = inst->data + dataMember->offset + offset;
10922 char * result = (((void *)0));
10924 exp->loc = member->loc = inst->loc;
10925 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10926 if(!dataMember->dataType)
10927 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10928 type = dataMember->dataType;
10929 if(type->kind == 8)
10931 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10933 if(_class->type == 4)
10935 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10939 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10940 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10942 for(item = e->values.first; item; item = item->next)
10944 if((int)item->data == *(int *)ptr)
10946 result = item->name;
10952 exp->identifier = MkIdentifier(result);
10954 exp->destType = MkClassType(_class->fullName);
10955 ProcessExpressionType(exp);
10959 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10961 if(!_class->dataType)
10962 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10963 type = _class->dataType;
10972 FreeExpContents(exp);
10973 exp->constant = PrintFloat(*(float *)ptr);
10979 FreeExpContents(exp);
10980 exp->constant = PrintDouble(*(double *)ptr);
10986 FreeExpContents(exp);
10987 exp->constant = PrintInt(*(int *)ptr);
10993 FreeExpContents(exp);
10994 exp->constant = PrintInt64(*(long long *)ptr);
11000 FreeExpContents(exp);
11001 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11007 FreeExpContents(exp);
11008 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11016 ListAdd(memberList, member);
11018 if(parentDataMember->type == 1)
11023 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11025 void PopulateInstance(struct Instantiation * inst)
11027 struct Symbol * classSym = inst->_class->symbol;
11028 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
11029 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11030 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11033 inst->members = MkListOne(MkMembersInitList(memberList));
11035 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11036 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11038 if(!dataMember->isProperty)
11040 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11041 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11044 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11045 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11046 struct Type * type;
11047 void * ptr = inst->data + dataMember->offset;
11048 char * result = (((void *)0));
11050 exp->loc = member->loc = inst->loc;
11051 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11052 if(!dataMember->dataType)
11053 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11054 type = dataMember->dataType;
11055 if(type->kind == 8)
11057 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11059 if(_class->type == 4)
11061 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11065 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11066 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11068 for(item = e->values.first; item; item = item->next)
11070 if((int)item->data == *(int *)ptr)
11072 result = item->name;
11079 exp->identifier = MkIdentifier(result);
11081 exp->destType = MkClassType(_class->fullName);
11082 ProcessExpressionType(exp);
11085 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11087 if(!_class->dataType)
11088 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11089 type = _class->dataType;
11098 exp->constant = PrintFloat(*(float *)ptr);
11104 exp->constant = PrintDouble(*(double *)ptr);
11110 exp->constant = PrintInt(*(int *)ptr);
11116 exp->constant = PrintInt64(*(long long *)ptr);
11122 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11127 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11130 ListAdd(memberList, member);
11136 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);
11138 extern void FreeInstance(struct Instantiation * inst);
11140 void ComputeInstantiation(struct Expression * exp)
11142 struct Instantiation * inst = exp->instance;
11143 struct MembersInit * members;
11144 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11145 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11146 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11147 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11148 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11149 int subMemberStackPos = 0;
11152 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11156 if(_class->type == 0 || _class->type == 5)
11158 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11159 if(_class->type == 0)
11160 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11163 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11167 for(members = (*inst->members).first; members; members = members->next)
11169 switch(members->type)
11173 if(members->dataMembers)
11175 struct MemberInit * member;
11177 for(member = (*members->dataMembers).first; member; member = member->next)
11179 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11180 unsigned int found = 0x0;
11181 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11182 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11183 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11184 unsigned int dataMemberOffset;
11188 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11191 if(curMember->isProperty)
11192 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11195 dataMember = curMember;
11196 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11197 if(_class->type == 0)
11198 dataMemberOffset += _class->base->structSize;
11205 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11209 if(prop->memberAccess == 1)
11211 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11212 curClass = prop->_class;
11217 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11218 int _subMemberStackPos = 0;
11220 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11224 if(dataMember->memberAccess == 1)
11226 curMember = dataMember;
11227 curClass = dataMember->_class;
11228 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11229 subMemberStackPos = _subMemberStackPos;
11234 if(found && member->initializer && member->initializer->type == 0)
11236 struct Expression * value = member->initializer->exp;
11237 struct Type * type = (((void *)0));
11238 unsigned int deepMember = 0x0;
11242 type = prop->dataType;
11244 else if(dataMember)
11246 if(!dataMember->dataType)
11247 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11248 type = dataMember->dataType;
11250 if(ident && ident->next)
11253 for(ident = ident->next; ident && type; ident = ident->next)
11255 if(type->kind == 8)
11257 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11259 type = prop->dataType;
11262 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11264 type = dataMember->dataType;
11267 else if(type->kind == 9 || type->kind == 10)
11269 struct Type * memberType;
11271 for(memberType = type->members.first; memberType; memberType = memberType->next)
11273 if(!strcmp(memberType->name, ident->string))
11284 FreeType(value->destType);
11285 value->destType = type;
11288 ComputeExpression(value);
11290 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11292 if(type->kind == 8)
11294 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11296 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11298 if(!_class->dataType)
11299 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11300 type = _class->dataType;
11305 void * ptr = inst->data + dataMemberOffset;
11307 if(value->type == 2)
11313 GetInt(value, (int *)ptr);
11318 GetInt64(value, (long long *)ptr);
11323 GetIntPtr(value, (intptr_t *)ptr);
11328 GetIntSize(value, (ssize_t *)ptr);
11333 GetFloat(value, (float *)ptr);
11338 GetDouble(value, (double *)ptr);
11343 else if(value->type == 1)
11345 if(type->kind == 8)
11347 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11349 if(_class->type == 1)
11351 ComputeTypeSize(type);
11352 if(value->instance->data)
11353 memcpy(ptr, value->instance->data, type->size);
11360 if(value->type == 1 && value->instance->data)
11362 if(type->kind == 8)
11364 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11366 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)))
11368 void (* Set)(void *, void *) = (void *)prop->Set;
11370 Set(inst->data, value->instance->data);
11371 PopulateInstance(inst);
11375 else if(value->type == 2)
11381 void (* Set)(void *, double) = (void *)prop->Set;
11383 Set(inst->data, strtod(value->constant, (((void *)0))));
11388 void (* Set)(void *, float) = (void *)prop->Set;
11390 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11395 void (* Set)(void *, int) = (void *)prop->Set;
11397 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11402 void (* Set)(void *, long long) = (void *)prop->Set;
11404 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11409 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11411 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11416 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11418 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11423 else if(value->type == 3)
11427 ReadString(temp, value->string);
11428 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11432 else if(!deepMember && type && _class->type == 3)
11436 if(value->type == 2)
11438 if(type->kind == 8)
11440 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11442 if(_class->type == 3)
11444 if(!_class->dataType)
11445 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11446 type = _class->dataType;
11454 float (* Set)(float) = (void *)prop->Set;
11456 GetFloat(member->initializer->exp, &fValue);
11457 exp->constant = PrintFloat(Set(fValue));
11464 double (* Set)(double) = (void *)prop->Set;
11466 GetDouble(member->initializer->exp, &dValue);
11467 exp->constant = PrintDouble(Set(dValue));
11475 else if(!deepMember && type && _class->type == 2)
11479 if(value->type == 1 && value->instance->data)
11481 unsigned int (* Set)(void *) = (void *)prop->Set;
11483 bits = Set(value->instance->data);
11485 else if(value->type == 2)
11489 else if(dataMember)
11491 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11492 struct Type * type;
11495 bits = (bits & ~bitMember->mask);
11496 if(!bitMember->dataType)
11497 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11498 type = bitMember->dataType;
11499 if(type->kind == 8 && type->_class && type->_class->registered)
11501 if(!type->_class->registered->dataType)
11502 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11503 type = type->_class->registered->dataType;
11512 type->isSigned ? GetChar(value, &v) : GetUChar(value, &v);
11520 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11529 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11537 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11545 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11553 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11558 bits |= part << bitMember->pos;
11564 if(_class && _class->type == 3)
11566 ComputeExpression(member->initializer->exp);
11567 exp->constant = member->initializer->exp->constant;
11569 member->initializer->exp->constant = (((void *)0));
11579 if(_class && _class->type == 2)
11581 exp->constant = PrintHexUInt(bits);
11586 FreeInstance(inst);
11590 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11592 unsigned int result = 0x0;
11597 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11598 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11602 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11603 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11606 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11607 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11610 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11611 result = GetOpFloat(op, &op->f);
11614 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11615 result = GetOpDouble(op, &op->d);
11618 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11619 result = GetOpUIntPtr(op, &op->ui64);
11622 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11623 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11626 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11627 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11630 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11631 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11637 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11639 if(exp->op.op == SIZEOF)
11641 FreeExpContents(exp);
11643 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11653 struct Expression * exp2 = exp->op.exp2;
11655 exp->op.exp2 = (((void *)0));
11656 FreeExpContents(exp);
11657 FreeType(exp->expType);
11658 FreeType(exp->destType);
11660 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11666 FreeExpContents(exp);
11667 op1->ops.Neg(exp, op1);
11671 if(op1->ops.BitNot)
11673 FreeExpContents(exp);
11674 op1->ops.BitNot(exp, op1);
11680 FreeExpContents(exp);
11681 op1->ops.Not(exp, op1);
11688 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11690 if(Promote(op2, op1->kind, op1->type->isSigned))
11691 op2->kind = op1->kind, op2->ops = op1->ops;
11692 else if(Promote(op1, op2->kind, op2->type->isSigned))
11693 op1->kind = op2->kind, op1->ops = op2->ops;
11700 FreeExpContents(exp);
11701 op1->ops.Add(exp, op1, op2);
11707 FreeExpContents(exp);
11708 op1->ops.Sub(exp, op1, op2);
11714 FreeExpContents(exp);
11715 op1->ops.Mul(exp, op1, op2);
11721 FreeExpContents(exp);
11722 op1->ops.Div(exp, op1, op2);
11728 FreeExpContents(exp);
11729 op1->ops.Mod(exp, op1, op2);
11735 if(op1->ops.BitAnd)
11737 FreeExpContents(exp);
11738 op1->ops.BitAnd(exp, op1, op2);
11745 FreeExpContents(exp);
11746 op1->ops.BitOr(exp, op1, op2);
11750 if(op1->ops.BitXor)
11752 FreeExpContents(exp);
11753 op1->ops.BitXor(exp, op1, op2);
11757 if(op1->ops.LShift)
11759 FreeExpContents(exp);
11760 op1->ops.LShift(exp, op1, op2);
11764 if(op1->ops.RShift)
11766 FreeExpContents(exp);
11767 op1->ops.RShift(exp, op1, op2);
11773 FreeExpContents(exp);
11774 op1->ops.Equ(exp, op1, op2);
11780 FreeExpContents(exp);
11781 op1->ops.Nqu(exp, op1, op2);
11787 FreeExpContents(exp);
11788 op1->ops.And(exp, op1, op2);
11794 FreeExpContents(exp);
11795 op1->ops.Or(exp, op1, op2);
11801 FreeExpContents(exp);
11802 op1->ops.Grt(exp, op1, op2);
11808 FreeExpContents(exp);
11809 op1->ops.Sma(exp, op1, op2);
11813 if(op1->ops.GrtEqu)
11815 FreeExpContents(exp);
11816 op1->ops.GrtEqu(exp, op1, op2);
11820 if(op1->ops.SmaEqu)
11822 FreeExpContents(exp);
11823 op1->ops.SmaEqu(exp, op1, op2);
11831 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11833 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11835 void ComputeExpression(struct Expression * exp)
11837 char expString[10240];
11839 expString[0] = '\0';
11844 ComputeInstantiation(exp);
11849 struct Expression * exp1, * exp2 = (((void *)0));
11850 struct Operand op1 =
11854 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11857 struct Operand op2 =
11861 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11867 struct Expression * e = exp->op.exp2;
11869 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11871 if(e->type == 5 || e->type == 32 || e->type == 23)
11874 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11876 e = (*e->list).last;
11879 if(exp->op.op == 261 && e && e->expType)
11881 if(e->type == 3 && e->string)
11883 char * string = e->string;
11884 int len = strlen(string);
11885 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11887 len = UnescapeString(tmp, string + 1, len - 2);
11888 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11889 FreeExpContents(exp);
11891 exp->constant = PrintUInt(len + 1);
11895 struct Type * type = e->expType;
11898 FreeExpContents(exp);
11900 exp->constant = PrintUInt(ComputeTypeSize(type));
11906 ComputeExpression(exp->op.exp2);
11910 ComputeExpression(exp->op.exp1);
11911 exp1 = exp->op.exp1;
11912 exp2 = exp->op.exp2;
11913 op1 = GetOperand(exp1);
11915 op1.type->refCount++;
11918 op2 = GetOperand(exp2);
11920 op2.type->refCount++;
11925 exp1 = exp->op.exp2;
11926 op1 = GetOperand(exp1);
11928 op1.type->refCount++;
11930 CallOperator(exp, exp1, exp2, &op1, &op2);
11932 FreeType(op1.type);
11934 FreeType(op2.type);
11940 struct Expression * e, * n;
11942 for(e = (*exp->list).first; e; e = n)
11947 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11948 struct Expression * prev = exp->prev;
11949 struct Expression * next = exp->next;
11951 ComputeExpression(e);
11952 FreeType(exp->expType);
11953 FreeType(exp->destType);
11957 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11958 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11969 struct Expression * memberExp = exp->member.exp;
11970 struct Identifier * memberID = exp->member.member;
11971 struct Type * type;
11973 ComputeExpression(exp->member.exp);
11974 type = exp->member.exp->expType;
11977 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)));
11978 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11979 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11980 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11982 if(type->kind == 19 && exp->member.exp->type == 24)
11983 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11987 struct Symbol * classSym;
11990 PrintTypeNoConst(type, string, 0x0, 0x1);
11991 classSym = FindClass(string);
11992 _class = classSym ? classSym->registered : (((void *)0));
11994 if(exp->member.member)
11996 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11998 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
12000 if(!prop && !member && _class && exp->member.member)
12002 struct Symbol * classSym = FindClass(exp->member.member->string);
12004 convertTo = _class;
12005 _class = classSym ? classSym->registered : (((void *)0));
12006 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12012 struct Type * type = prop->dataType;
12014 if(_class->type == 3)
12016 if(type->kind == 8)
12018 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12020 if(_class->type == 3)
12022 if(!_class->dataType)
12023 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12024 type = _class->dataType;
12032 float (* Get)(float) = (void *)prop->Get;
12034 GetFloat(exp->member.exp, &value);
12035 exp->constant = PrintFloat(Get ? Get(value) : value);
12042 double (* Get)(double);
12044 GetDouble(exp->member.exp, &value);
12046 Get = (void *)prop->Set;
12048 Get = (void *)prop->Get;
12049 exp->constant = PrintDouble(Get ? Get(value) : value);
12059 struct Expression * value = exp->member.exp;
12060 struct Type * type;
12062 if(!prop->dataType)
12063 ProcessPropertyType(prop);
12064 type = prop->dataType;
12068 else if(_class->type == 1)
12074 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12076 if(propertyClass->type == 1 && value->type == 1)
12078 void (* Set)(void *, void *) = (void *)prop->Set;
12080 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12081 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12082 exp->instance->_class = MkSpecifierName(_class->fullName);
12083 exp->instance->loc = exp->loc;
12085 Set(exp->instance->data, value->instance->data);
12086 PopulateInstance(exp->instance);
12093 void (* Set)(void *, int) = (void *)prop->Set;
12095 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12096 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12097 exp->instance->_class = MkSpecifierName(_class->fullName);
12098 exp->instance->loc = exp->loc;
12100 GetInt(value, &intValue);
12101 Set(exp->instance->data, intValue);
12102 PopulateInstance(exp->instance);
12107 long long intValue;
12108 void (* Set)(void *, long long) = (void *)prop->Set;
12110 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12111 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12112 exp->instance->_class = MkSpecifierName(_class->fullName);
12113 exp->instance->loc = exp->loc;
12115 GetInt64(value, &intValue);
12116 Set(exp->instance->data, intValue);
12117 PopulateInstance(exp->instance);
12123 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12125 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12126 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12127 exp->instance->_class = MkSpecifierName(_class->fullName);
12128 exp->instance->loc = exp->loc;
12130 GetIntPtr(value, &intValue);
12131 Set(exp->instance->data, intValue);
12132 PopulateInstance(exp->instance);
12138 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12140 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12141 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12142 exp->instance->_class = MkSpecifierName(_class->fullName);
12143 exp->instance->loc = exp->loc;
12145 GetIntSize(value, &intValue);
12146 Set(exp->instance->data, intValue);
12147 PopulateInstance(exp->instance);
12153 void (* Set)(void *, float) = (void *)prop->Set;
12155 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12156 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12157 exp->instance->_class = MkSpecifierName(_class->fullName);
12158 exp->instance->loc = exp->loc;
12160 GetFloat(value, &floatValue);
12161 Set(exp->instance->data, floatValue);
12162 PopulateInstance(exp->instance);
12167 double doubleValue;
12168 void (* Set)(void *, double) = (void *)prop->Set;
12170 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12171 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12172 exp->instance->_class = MkSpecifierName(_class->fullName);
12173 exp->instance->loc = exp->loc;
12175 GetDouble(value, &doubleValue);
12176 Set(exp->instance->data, doubleValue);
12177 PopulateInstance(exp->instance);
12182 else if(_class->type == 2)
12188 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12190 if(propertyClass->type == 1 && value->instance->data)
12192 unsigned int (* Set)(void *) = (void *)prop->Set;
12193 unsigned int bits = Set(value->instance->data);
12195 exp->constant = PrintHexUInt(bits);
12199 else if(_class->type == 2)
12201 unsigned int value;
12202 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12205 GetUInt(exp->member.exp, &value);
12207 exp->constant = PrintHexUInt(bits);
12216 if(_class->type == 2)
12218 unsigned int value;
12220 GetUInt(exp->member.exp, &value);
12225 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12227 if(_class->type == 1)
12229 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12231 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12232 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12233 exp->instance->_class = MkSpecifierName(_class->fullName);
12234 exp->instance->loc = exp->loc;
12236 Get(value, exp->instance->data);
12237 PopulateInstance(exp->instance);
12239 else if(_class->type == 2)
12241 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12242 uint64 bits = Get(value);
12244 exp->constant = PrintHexUInt64(bits);
12251 else if(_class->type == 1)
12253 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12259 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12261 if(_class->type == 1 && value)
12263 void (* Get)(void *, void *) = (void *)prop->Get;
12265 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12266 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12267 exp->instance->_class = MkSpecifierName(_class->fullName);
12268 exp->instance->loc = exp->loc;
12270 Get(value, exp->instance->data);
12271 PopulateInstance(exp->instance);
12282 exp->isConstant = 0x0;
12291 FreeExpression(memberExp);
12292 FreeIdentifier(memberID);
12298 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12300 FreeExpContents(exp);
12301 exp->constant = PrintUInt(ComputeTypeSize(type));
12308 struct Symbol * classSym = exp->_class->symbol;
12310 if(classSym && classSym->registered)
12312 if(classSym->registered->fixed)
12314 FreeSpecifier(exp->_class);
12315 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12320 char className[1024];
12322 strcpy(className, "__ecereClass_");
12323 FullClassNameCat(className, classSym->string, 0x1);
12324 MangleClassName(className);
12325 DeclareClass(classSym, className);
12326 FreeExpContents(exp);
12328 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12329 exp->member.member = MkIdentifier("structSize");
12336 struct Type * type;
12337 struct Expression * e = exp;
12339 if(exp->type == 11)
12342 ComputeExpression(exp->cast.exp);
12345 if(e && exp->expType)
12347 type = exp->expType;
12348 if(type->kind == 8)
12350 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12352 if(_class && (_class->type == 3 || _class->type == 2))
12354 if(!_class->dataType)
12355 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12356 type = _class->dataType;
12365 char value = (char)0;
12367 if(GetChar(e, &value))
12369 FreeExpContents(exp);
12370 exp->constant = PrintChar(value);
12376 unsigned char value = (unsigned char)0;
12378 if(GetUChar(e, &value))
12380 FreeExpContents(exp);
12381 exp->constant = PrintUChar(value);
12389 short value = (short)0;
12391 if(GetShort(e, &value))
12393 FreeExpContents(exp);
12394 exp->constant = PrintShort(value);
12400 unsigned short value = (unsigned short)0;
12402 if(GetUShort(e, &value))
12404 FreeExpContents(exp);
12405 exp->constant = PrintUShort(value);
12415 if(GetInt(e, &value))
12417 FreeExpContents(exp);
12418 exp->constant = PrintInt(value);
12424 unsigned int value = 0;
12426 if(GetUInt(e, &value))
12428 FreeExpContents(exp);
12429 exp->constant = PrintUInt(value);
12437 long long value = 0;
12439 if(GetInt64(e, &value))
12441 FreeExpContents(exp);
12442 exp->constant = PrintInt64(value);
12450 if(GetUInt64(e, &value))
12452 FreeExpContents(exp);
12453 exp->constant = PrintUInt64(value);
12461 intptr_t value = 0;
12463 if(GetIntPtr(e, &value))
12465 FreeExpContents(exp);
12466 exp->constant = PrintInt64((long long)value);
12472 uintptr_t value = 0;
12474 if(GetUIntPtr(e, &value))
12476 FreeExpContents(exp);
12477 exp->constant = PrintUInt64((uint64)value);
12487 if(GetIntSize(e, &value))
12489 FreeExpContents(exp);
12490 exp->constant = PrintInt64((long long)value);
12498 if(GetUIntSize(e, &value))
12500 FreeExpContents(exp);
12501 exp->constant = PrintUInt64((uint64)value);
12510 if(GetFloat(e, &value))
12512 FreeExpContents(exp);
12513 exp->constant = PrintFloat(value);
12522 if(GetDouble(e, &value))
12524 FreeExpContents(exp);
12525 exp->constant = PrintDouble(value);
12536 struct Operand op1 =
12540 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12543 struct Operand op2 =
12547 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12550 struct Operand op3 =
12554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12559 ComputeExpression((*exp->cond.exp).last);
12560 if(exp->cond.elseExp)
12561 ComputeExpression(exp->cond.elseExp);
12563 ComputeExpression(exp->cond.cond);
12564 op1 = GetOperand(exp->cond.cond);
12566 op1.type->refCount++;
12567 op2 = GetOperand((*exp->cond.exp).last);
12569 op2.type->refCount++;
12570 op3 = GetOperand(exp->cond.elseExp);
12572 op3.type->refCount++;
12575 FreeExpContents(exp);
12576 op1.ops.Cond(exp, &op1, &op2, &op3);
12579 FreeType(op1.type);
12581 FreeType(op2.type);
12583 FreeType(op3.type);
12589 void ApplyAnyObjectLogic(struct Expression * e);
12591 extern void CopyTypeInto(struct Type * type, struct Type * src);
12593 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12595 unsigned int result = 0x1;
12599 struct __ecereNameSpace__ecere__sys__OldList converts =
12603 struct Conversion * convert;
12605 if(destType->kind == 0)
12607 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12611 for(convert = converts.first; convert; convert = convert->next)
12613 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12617 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12618 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12621 newExp->prev = (((void *)0));
12622 newExp->next = (((void *)0));
12623 newExp->destType = (((void *)0));
12627 exp->addedThis = 0x1;
12628 exp->member.exp = newExp;
12629 FreeType(exp->member.exp->expType);
12630 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12631 exp->member.exp->expType->classObjectType = objectType;
12632 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12633 exp->member.memberType = 1;
12634 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12635 exp->needCast = 0x1;
12637 exp->expType->refCount++;
12638 ApplyAnyObjectLogic(exp->member.exp);
12644 exp->addedThis = 0x1;
12645 exp->member.exp = newExp;
12646 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12648 newExp->byReference = 0x1;
12650 FreeType(exp->member.exp->expType);
12651 exp->member.exp->expType = (((void *)0));
12652 if(convert->convert->dataType)
12654 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12655 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12656 exp->member.exp->expType->refCount = 1;
12657 exp->member.exp->expType->classObjectType = objectType;
12658 ApplyAnyObjectLogic(exp->member.exp);
12660 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12661 exp->member.memberType = 4;
12662 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12663 exp->needCast = 0x1;
12664 if(convert->resultType)
12665 convert->resultType->refCount++;
12671 FreeType(exp->expType);
12674 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12675 exp->needCast = 0x1;
12677 exp->expType->refCount++;
12681 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12682 exp->needCast = 0x1;
12683 if(convert->resultType)
12684 convert->resultType->refCount++;
12688 if(exp->isConstant && inCompiler)
12689 ComputeExpression(exp);
12690 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12692 if(!result && exp->expType && converts.count)
12694 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12696 if(!result && exp->expType && exp->destType)
12698 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))
12705 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12707 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12709 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12711 void CheckTemplateTypes(struct Expression * exp)
12713 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12715 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12716 struct Statement * compound;
12717 struct Context * context;
12721 exp->destType->refCount++;
12723 exp->expType->refCount++;
12724 newExp->prev = (((void *)0));
12725 newExp->next = (((void *)0));
12726 switch(exp->expType->kind)
12729 if(exp->destType->classObjectType)
12732 exp->destType->refCount--;
12734 exp->expType->refCount--;
12735 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12739 struct __ecereNameSpace__ecere__sys__OldList * specs;
12740 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12741 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12743 context = PushContext();
12744 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12745 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12746 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12748 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12749 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12750 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12751 exp->compound->compound.context = context;
12752 PopContext(context);
12757 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12758 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12762 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12764 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12765 struct Statement * compound;
12766 struct Context * context;
12770 exp->destType->refCount++;
12772 exp->expType->refCount++;
12773 newExp->prev = (((void *)0));
12774 newExp->next = (((void *)0));
12775 switch(exp->expType->kind)
12778 if(exp->destType->classObjectType)
12781 exp->destType->refCount--;
12783 exp->expType->refCount--;
12784 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12788 struct __ecereNameSpace__ecere__sys__OldList * specs;
12789 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12790 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12792 context = PushContext();
12793 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12794 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12795 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12797 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12798 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12799 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12800 exp->compound->compound.context = context;
12801 PopContext(context);
12806 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12809 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12810 ProcessExpressionType((*exp->list).first);
12816 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12817 newExp->needCast = 0x1;
12818 ProcessExpressionType((*exp->list).first);
12824 if(exp->expType->kind == 20)
12826 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12830 FreeType(exp->destType);
12831 FreeType(exp->expType);
12832 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12836 if(newExp->type == 8 && newExp->member.memberType == 3)
12840 exp->op.exp1 = (((void *)0));
12841 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12845 char typeString[1024];
12846 struct Declarator * decl;
12847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12849 typeString[0] = '\0';
12850 PrintType(exp->expType, typeString, 0x0, 0x0);
12851 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12853 exp->cast.typeName = MkTypeName(specs, decl);
12854 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12855 exp->cast.exp->needCast = 0x1;
12863 extern int strncmp(const char * , const char * , size_t n);
12865 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12867 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12869 int nsLen = strlen(nameSpace);
12870 struct Symbol * symbol;
12872 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)))
12874 char * s = symbol->string;
12876 if(!strncmp(s, nameSpace, nsLen))
12881 for(c = strlen(s) - 1; c >= 0; c--)
12884 namePart = s + c + 1;
12885 if(!strcmp(namePart, name))
12893 return (((void *)0));
12896 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12899 char nameSpace[1024];
12901 unsigned int gotColon = 0x0;
12903 nameSpace[0] = '\0';
12904 for(c = strlen(name) - 1; c >= 0; c--)
12910 namePart = name + c + 1;
12911 while(c >= 0 && name[c] == ':')
12915 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12919 memcpy(nameSpace, name, c + 1);
12920 nameSpace[c + 1] = (char)0;
12921 return ScanWithNameSpace(tree, nameSpace, namePart);
12925 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12931 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12935 return ScanWithNameSpace(tree, "", namePart);
12937 return (((void *)0));
12940 static void ProcessDeclaration(struct Declaration * decl);
12942 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12944 struct Context * ctx;
12945 struct Symbol * symbol = (((void *)0));
12947 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12949 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12951 symbol = (((void *)0));
12954 char curName[1024];
12956 strcpy(curName, thisNameSpace);
12957 strcat(curName, "::");
12958 strcat(curName, name);
12959 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12962 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12965 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12966 if(symbol || ctx == endContext)
12969 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12971 if(symbol->pointerExternal->type == 0)
12973 struct FunctionDefinition * function = symbol->pointerExternal->function;
12974 struct Context * tmpContext = curContext;
12976 curContext = (((void *)0));
12977 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12978 curContext = tmpContext;
12979 symbol->pointerExternal->symbol = symbol;
12980 DeclareType(symbol->type, 0x1, 0x1);
12981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12982 symbol->id = curExternal->symbol->idCode;
12984 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12987 symbol->id = curExternal->symbol->idCode;
12993 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12995 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12996 ListAdd(specs, MkSpecifier(UNSIGNED));
13001 if(type->_class->registered)
13003 if(!type->_class->registered->dataType)
13004 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
13005 GetTypeSpecs(type->_class->registered->dataType, specs);
13010 ListAdd(specs, MkSpecifier(DOUBLE));
13013 ListAdd(specs, MkSpecifier(FLOAT));
13016 ListAdd(specs, MkSpecifier(CHAR));
13019 ListAdd(specs, MkSpecifier(_BOOL));
13022 ListAdd(specs, MkSpecifier(SHORT));
13025 ListAdd(specs, MkSpecifier(INT64));
13028 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13031 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13035 ListAdd(specs, MkSpecifier(INT));
13040 static void PrintArraySize(struct Type * arrayType, char * string)
13046 if(arrayType->enumClass)
13047 strcat(size, arrayType->enumClass->string);
13048 else if(arrayType->arraySizeExp)
13049 PrintExpression(arrayType->arraySizeExp, size);
13051 strcat(string, size);
13054 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13058 if(printConst && type->constant)
13059 strcat(string, "const ");
13064 struct Symbol * c = type->_class;
13066 if(type->classObjectType == 2)
13067 strcat(string, "typed_object");
13068 else if(type->classObjectType == 3)
13069 strcat(string, "any_object");
13073 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13075 if(type->byReference)
13076 strcat(string, " &");
13080 strcat(string, "void");
13083 strcat(string, type->isSigned ? "int" : "uint");
13086 strcat(string, type->isSigned ? "int64" : "uint64");
13089 strcat(string, type->isSigned ? "intptr" : "uintptr");
13092 strcat(string, type->isSigned ? "intsize" : "uintsize");
13095 strcat(string, type->isSigned ? "char" : "byte");
13098 strcat(string, "_Bool");
13101 strcat(string, type->isSigned ? "short" : "uint16");
13104 strcat(string, "float");
13107 strcat(string, "double");
13112 strcat(string, "struct ");
13113 strcat(string, type->enumName);
13115 else if(type->typeName)
13116 strcat(string, type->typeName);
13119 struct Type * member;
13121 strcat(string, "struct { ");
13122 for(member = type->members.first; member; member = member->next)
13124 PrintType(member, string, 0x1, fullName);
13125 strcat(string, "; ");
13127 strcat(string, "}");
13133 strcat(string, "union ");
13134 strcat(string, type->enumName);
13136 else if(type->typeName)
13137 strcat(string, type->typeName);
13140 strcat(string, "union ");
13141 strcat(string, "(unnamed)");
13147 strcat(string, "enum ");
13148 strcat(string, type->enumName);
13150 else if(type->typeName)
13151 strcat(string, type->typeName);
13153 strcat(string, "int");
13156 strcat(string, "...");
13159 strcat(string, "subclass(");
13160 strcat(string, type->_class ? type->_class->string : "int");
13161 strcat(string, ")");
13164 strcat(string, type->templateParameter->identifier->string);
13167 strcat(string, "thisclass");
13170 strcat(string, "__builtin_va_list");
13176 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13178 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13180 if(type->name && type->name[0])
13183 strcat(string, type->name);
13186 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13192 strcat(string, name);
13197 static void PrintAttribs(struct Type * type, char * string)
13201 if(type->dllExport)
13202 strcat(string, "dllexport ");
13203 if(type->attrStdcall)
13204 strcat(string, "stdcall ");
13208 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13210 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13212 struct Type * attrType = (((void *)0));
13214 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13215 PrintAttribs(type, string);
13216 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13217 strcat(string, " const");
13218 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13219 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13220 strcat(string, " (");
13221 if(type->kind == 13)
13223 if(type->type->kind == 11 || type->type->kind == 16)
13224 PrintAttribs(type->type, string);
13226 if(type->kind == 13)
13228 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13229 strcat(string, "*");
13231 strcat(string, " *");
13233 if(printConst && type->constant && type->kind == 13)
13234 strcat(string, " const");
13237 PrintTypeSpecs(type, string, fullName, printConst);
13240 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13242 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13243 strcat(string, ")");
13244 if(type->kind == 12)
13245 PrintArraySize(type, string);
13246 else if(type->kind == 11)
13248 struct Type * param;
13250 strcat(string, "(");
13251 for(param = type->params.first; param; param = param->next)
13253 PrintType(param, string, 0x1, fullName);
13255 strcat(string, ", ");
13257 strcat(string, ")");
13259 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13260 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13263 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13265 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13266 if(type->thisClass || (printName && type->name && type->name[0]))
13267 strcat(string, " ");
13268 if((type->thisClass || type->staticMethod))
13270 struct Symbol * _class = type->thisClass;
13272 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13274 if(type->classObjectType == 1)
13275 strcat(string, "class");
13277 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13279 else if(_class && _class->string)
13281 char * s = _class->string;
13287 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13293 strcat(string, name);
13296 strcat(string, "::");
13298 if(printName && type->name)
13299 PrintName(type, string, fullName);
13300 PostPrintType(type, string, fullName);
13301 if(type->bitFieldCount)
13305 sprintf(count, ":%d", type->bitFieldCount);
13306 strcat(string, count);
13310 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13312 _PrintType(type, string, printName, fullName, 0x1);
13315 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13317 _PrintType(type, string, printName, fullName, 0x0);
13320 static struct Type * FindMember(struct Type * type, char * string)
13322 struct Type * memberType;
13324 for(memberType = type->members.first; memberType; memberType = memberType->next)
13326 if(!memberType->name)
13328 struct Type * subType = FindMember(memberType, string);
13333 else if(!strcmp(memberType->name, string))
13336 return (((void *)0));
13339 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13341 struct Type * memberType;
13343 for(memberType = type->members.first; memberType; memberType = memberType->next)
13345 if(!memberType->name)
13347 struct Type * subType = FindMember(memberType, string);
13351 *offset += memberType->offset;
13355 else if(!strcmp(memberType->name, string))
13357 *offset += memberType->offset;
13361 return (((void *)0));
13364 extern unsigned int parseError;
13366 unsigned int GetParseError()
13371 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13373 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13377 struct Expression * ParseExpressionString(char * expression)
13380 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13381 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13382 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13384 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13385 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13386 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13387 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13389 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13390 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13392 parsedExpression = (((void *)0));
13394 expression_yyparse();
13395 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13396 return parsedExpression;
13399 extern char * QMkString(char * source);
13401 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13403 struct Identifier * id = exp->identifier;
13404 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13405 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13406 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13407 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13409 if(_class && _class->type == 4)
13411 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13412 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13416 struct __ecereNameSpace__ecere__com__Class * baseClass;
13418 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13420 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13422 for(value = e->values.first; value; value = value->next)
13424 if(!strcmp(value->name, id->string))
13429 char constant[256];
13431 FreeExpContents(exp);
13433 exp->isConstant = 0x1;
13434 if(!strcmp(baseClass->dataTypeString, "int"))
13435 sprintf(constant, "%d", (int)value->data);
13437 sprintf(constant, "0x%X", (int)value->data);
13438 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13439 exp->expType = MkClassType(baseClass->fullName);
13447 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13449 ProcessMethodType(method);
13450 exp->expType = __extension__ ({
13451 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13453 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13457 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13459 if(!prop->dataType)
13460 ProcessPropertyType(prop);
13461 exp->expType = prop->dataType;
13463 prop->dataType->refCount++;
13466 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13468 if(!member->dataType)
13469 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13470 exp->expType = member->dataType;
13471 if(member->dataType)
13472 member->dataType->refCount++;
13475 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13477 if(!classProp->dataType)
13478 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13479 if(classProp->constant)
13481 FreeExpContents(exp);
13482 exp->isConstant = 0x1;
13483 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13486 exp->constant = QMkString((char *)classProp->Get(_class));
13490 char constant[256];
13493 sprintf(constant, "%d", (int)classProp->Get(_class));
13494 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13500 exp->expType = classProp->dataType;
13501 if(classProp->dataType)
13502 classProp->dataType->refCount++;
13508 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13510 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13511 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13512 struct __ecereNameSpace__ecere__com__NameSpace * child;
13516 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)))
13518 data = ScanGlobalData(child, name);
13526 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13528 extern char * strncpy(char * , const char * , size_t n);
13530 static struct GlobalData * FindGlobalData(char * name)
13533 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13535 nameSpace = globalData;
13536 for(c = 0; name[c]; c++)
13538 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13540 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13541 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13543 strncpy(spaceName, name + start, c - start);
13544 spaceName[c - start] = '\0';
13545 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13546 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13548 return (((void *)0));
13549 nameSpace = newSpace;
13557 return ScanGlobalData(nameSpace, name + start);
13559 return (((void *)0));
13562 static int definedExpStackPos;
13564 static void * definedExpStack[512];
13566 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13568 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13570 FreeExpContents(checkedExp);
13571 FreeType(checkedExp->expType);
13572 FreeType(checkedExp->destType);
13573 *checkedExp = *newExp;
13574 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13575 checkedExp->prev = prev;
13576 checkedExp->next = next;
13579 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13581 extern int printf(char * , ...);
13583 void __ecereMethod_Expression_Clear();
13585 void ApplyAnyObjectLogic(struct Expression * e)
13587 struct Type * destType = e->destType;
13589 if(destType && (destType->classObjectType == 3))
13591 if(e && e->expType)
13593 struct Type * type = e->expType;
13594 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13596 if(type->kind == 8 && type->_class && type->_class->registered)
13598 _class = type->_class->registered;
13600 else if(type->kind == 19)
13602 _class = FindClass("ecere::com::Class")->registered;
13606 char string[1024] = "";
13607 struct Symbol * classSym;
13609 PrintTypeNoConst(type, string, 0x0, 0x1);
13610 classSym = FindClass(string);
13612 _class = classSym->registered;
13614 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)))
13616 if(!_class || strcmp(_class->fullName, "char *"))
13618 struct Expression * checkedExp = e, * newExp;
13620 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13622 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13624 if(checkedExp->type == 23)
13626 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13629 checkedExp = (*checkedExp->list).last;
13631 else if(checkedExp->type == 11)
13632 checkedExp = checkedExp->cast.exp;
13634 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13636 newExp = checkedExp->op.exp2;
13637 checkedExp->op.exp2 = (((void *)0));
13638 FreeExpContents(checkedExp);
13639 if(e->expType && e->expType->passAsTemplate)
13643 ComputeTypeSize(e->expType);
13644 sprintf(size, "%d", e->expType->size);
13645 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))))));
13647 ReplaceExpContents(checkedExp, newExp);
13648 e->byReference = 0x1;
13650 else if(!e->byReference || (_class && _class->type == 5))
13652 struct Expression * checkedExp, * newExp;
13655 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;
13657 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13659 struct Context * context = PushContext();
13660 struct Declarator * decl;
13661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13662 char typeString[1024];
13663 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13665 typeString[0] = '\0';
13667 newExp->prev = (((void *)0));
13668 newExp->next = (((void *)0));
13669 newExp->expType = (((void *)0));
13670 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13671 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13672 newExp->destType = ProcessType(specs, decl);
13673 curContext = context;
13677 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13680 sprintf(name, "__internalValue%03X", internalValueCounter++);
13681 if(!curCompound->compound.declarations)
13682 curCompound->compound.declarations = MkList();
13683 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13684 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13685 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13686 e->compound = MkCompoundStmt((((void *)0)), stmts);
13689 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13691 struct Type * type = e->destType;
13693 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13694 CopyTypeInto(e->destType, type);
13695 e->destType->refCount = 1;
13696 e->destType->classObjectType = 0;
13699 e->compound->compound.context = context;
13700 PopContext(context);
13701 curContext = context->parent;
13705 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13707 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13709 if(checkedExp->type == 23)
13711 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13714 checkedExp = (*checkedExp->list).last;
13716 else if(checkedExp->type == 11)
13717 checkedExp = checkedExp->cast.exp;
13720 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13722 *operand = *checkedExp;
13723 checkedExp->destType = (((void *)0));
13724 checkedExp->expType = (((void *)0));
13725 __ecereMethod_Expression_Clear(checkedExp);
13726 checkedExp->type = 4;
13727 checkedExp->op.op = '&';
13728 checkedExp->op.exp1 = (((void *)0));
13729 checkedExp->op.exp2 = operand;
13738 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))))
13740 if(e->expType->classObjectType && destType && destType->classObjectType)
13746 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13749 thisExp->prev = (((void *)0));
13750 thisExp->next = (((void *)0));
13751 __ecereMethod_Expression_Clear(e);
13753 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13754 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13755 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13757 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13758 CopyTypeInto(e->expType, thisExp->expType);
13759 e->expType->byReference = 0x0;
13760 e->expType->refCount = 1;
13761 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))
13763 e->expType->classObjectType = 0;
13768 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13770 if(destType->kind == 14)
13772 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13774 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13776 unsigned int byReference = e->expType->byReference;
13777 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13778 struct Declarator * decl;
13779 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13780 char typeString[1024];
13781 struct Type * type;
13782 int backupClassObjectType;
13783 unsigned int backupByReference;
13785 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13789 backupClassObjectType = type->classObjectType;
13790 backupByReference = type->byReference;
13791 type->classObjectType = 0;
13792 type->byReference = 0x0;
13793 typeString[0] = '\0';
13794 PrintType(type, typeString, 0x0, 0x1);
13795 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13796 type->classObjectType = backupClassObjectType;
13797 type->byReference = backupByReference;
13799 thisExp->prev = (((void *)0));
13800 thisExp->next = (((void *)0));
13801 __ecereMethod_Expression_Clear(e);
13802 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)))
13806 e->op.exp1 = (((void *)0));
13807 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13808 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13809 CopyTypeInto(e->expType, type);
13810 e->expType->byReference = 0x0;
13811 e->expType->refCount = 1;
13816 e->cast.typeName = MkTypeName(specs, decl);
13817 e->cast.exp = thisExp;
13818 e->byReference = 0x1;
13822 e->destType = destType;
13823 destType->refCount++;
13828 extern char * strstr(const char * , const char * );
13830 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13832 struct __ecereNameSpace__ecere__com__DefinedExpression
13834 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13835 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13838 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13839 } __attribute__ ((gcc_struct));
13841 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13843 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13845 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13847 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13849 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13851 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13853 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13855 static void ProcessStatement(struct Statement * stmt);
13857 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13859 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13861 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13863 extern char * sourceFile;
13865 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13867 void ProcessExpressionType(struct Expression * exp)
13869 unsigned int unresolved = 0x0;
13870 struct Location oldyylloc = yylloc;
13871 unsigned int notByReference = 0x0;
13873 if(!exp || exp->expType)
13880 struct Identifier * id = exp->identifier;
13882 if(!id || !topContext)
13884 if(id->_class && id->_class->name)
13886 id->classSym = id->_class->symbol;
13888 if(strstr(id->string, "__ecereClass") == id->string)
13890 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13893 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13895 ReplaceClassMembers(exp, thisClass);
13898 ProcessExpressionType(exp);
13901 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13906 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13910 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13916 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13919 ProcessExpressionType(exp);
13923 else if(currentClass && !id->_class)
13925 if(ResolveIdWithClass(exp, currentClass, 0x1))
13928 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13933 struct Type * type = symbol->type;
13934 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13936 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13938 struct Context * context = SetupTemplatesContext(_class);
13940 type = ReplaceThisClassType(_class);
13941 FinishTemplatesContext(context);
13943 type->refCount = 0;
13945 FreeSpecifier(id->_class);
13946 id->_class = (((void *)0));
13947 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13948 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13949 id->classSym = (((void *)0));
13950 exp->expType = type;
13953 if(type && (type->kind == 15))
13954 exp->isConstant = 0x1;
13955 if(symbol->isParam || !strcmp(id->string, "this"))
13957 if(_class && _class->type == 1 && !type->declaredWithStruct)
13958 exp->byReference = 0x1;
13960 if(symbol->isIterator)
13962 if(symbol->isIterator == 3)
13965 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13966 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13967 exp->expType = (((void *)0));
13968 ProcessExpressionType(exp);
13970 else if(symbol->isIterator != 4)
13973 exp->member.exp = MkExpIdentifier(exp->identifier);
13974 exp->member.exp->expType = exp->expType;
13975 exp->member.member = MkIdentifier("data");
13976 exp->expType = (((void *)0));
13977 ProcessExpressionType(exp);
13984 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13986 if(thisNameSpace && !(id->_class && !id->_class->name))
13990 strcpy(name, thisNameSpace);
13991 strcat(name, "::");
13992 strcat(name, id->string);
13993 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13996 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14001 for(c = 0; c < definedExpStackPos; c++)
14002 if(definedExpStack[c] == definedExp)
14004 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14006 struct Location backupYylloc = yylloc;
14007 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14009 definedExpStack[definedExpStackPos++] = definedExp;
14010 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14011 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
14012 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14014 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14015 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14016 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14017 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14019 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14020 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14022 parsedExpression = (((void *)0));
14024 expression_yyparse();
14025 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14027 fileInput = backInput;
14028 yylloc = backupYylloc;
14029 if(parsedExpression)
14031 FreeIdentifier(id);
14033 exp->list = MkListOne(parsedExpression);
14034 parsedExpression->loc = yylloc;
14035 ProcessExpressionType(exp);
14036 definedExpStackPos--;
14039 definedExpStackPos--;
14045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14051 struct GlobalData * data = (((void *)0));
14053 if(thisNameSpace && !(id->_class && !id->_class->name))
14057 strcpy(name, thisNameSpace);
14058 strcat(name, "::");
14059 strcat(name, id->string);
14060 data = FindGlobalData(name);
14063 data = FindGlobalData(id->string);
14066 DeclareGlobalData(data);
14067 exp->expType = data->dataType;
14069 data->dataType->refCount++;
14070 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14071 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14072 FreeSpecifier(id->_class);
14073 id->_class = (((void *)0));
14078 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14080 if(thisNameSpace && !(id->_class && !id->_class->name))
14084 strcpy(name, thisNameSpace);
14085 strcat(name, "::");
14086 strcat(name, id->string);
14087 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14090 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14095 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14096 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14098 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14099 strcpy(name, "__ecereFunction_");
14100 FullClassNameCat(name, id->string, 0x0);
14101 if(DeclareFunction(function, name))
14103 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14104 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14106 exp->expType = function->dataType;
14107 if(function->dataType)
14108 function->dataType->refCount++;
14109 FreeSpecifier(id->_class);
14110 id->_class = (((void *)0));
14122 struct __ecereNameSpace__ecere__com__Class * _class;
14124 if(!exp->instance->_class)
14126 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14128 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14131 ProcessInstantiationType(exp->instance);
14132 exp->isConstant = exp->instance->isConstant;
14133 if(exp->instance->_class)
14135 exp->expType = MkClassType(exp->instance->_class->name);
14143 char * constant = exp->constant;
14144 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14146 exp->expType = type;
14147 if(constant[0] == '\'')
14149 if((int)((unsigned char *)constant)[1] > 127)
14152 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14156 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14157 exp->constant = PrintUInt(ch);
14159 type->_class = FindClass("unichar");
14160 type->isSigned = 0x0;
14165 type->isSigned = 0x1;
14170 char * dot = strchr(constant, '.');
14171 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14176 exponent = strchr(constant, 'p');
14178 exponent = strchr(constant, 'P');
14182 exponent = strchr(constant, 'e');
14184 exponent = strchr(constant, 'E');
14186 if(dot || exponent)
14188 if(strchr(constant, 'f') || strchr(constant, 'F'))
14192 type->isSigned = 0x1;
14196 unsigned int isSigned = constant[0] == '-';
14197 char * endP = (((void *)0));
14198 long long i64 = strtoll(constant, &endP, 0);
14199 uint64 ui64 = strtoull(constant, &endP, 0);
14200 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14204 if(i64 < (((int)0x80000000)))
14209 if(ui64 > (((int)0x7fffffff)))
14211 if(ui64 > (0xffffffff))
14214 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14218 else if(constant[0] != '0' || !constant[1])
14221 type->kind = is64Bit ? 4 : 3;
14222 type->isSigned = isSigned;
14225 exp->isConstant = 0x1;
14226 if(exp->destType && exp->destType->kind == 7)
14228 else if(exp->destType && exp->destType->kind == 6)
14230 else if(exp->destType && exp->destType->kind == 4)
14237 exp->isConstant = 0x1;
14238 exp->expType = __extension__ ({
14239 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14241 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14242 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14244 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14245 }), __ecereInstance2;
14251 ProcessExpressionType(exp->_new.size);
14252 exp->expType = __extension__ ({
14253 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14255 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14257 DeclareType(exp->expType->type, 0x0, 0x0);
14261 ProcessExpressionType(exp->_renew.size);
14262 ProcessExpressionType(exp->_renew.exp);
14263 exp->expType = __extension__ ({
14264 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14266 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14268 DeclareType(exp->expType->type, 0x0, 0x0);
14272 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14273 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14274 unsigned int useDestType = 0x0, useSideType = 0x0;
14275 struct Location oldyylloc = yylloc;
14276 unsigned int useSideUnit = 0x0;
14277 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
14278 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14341 if(exp->op.op == '&')
14343 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14345 struct Identifier * id = exp->op.exp2->identifier;
14346 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14348 if(symbol && symbol->isIterator == 2)
14351 exp->member.exp = exp->op.exp2;
14352 exp->member.member = MkIdentifier("key");
14353 exp->expType = (((void *)0));
14354 exp->op.exp2->expType = symbol->type;
14355 symbol->type->refCount++;
14356 ProcessExpressionType(exp);
14364 if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14366 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14368 if(exp->op.exp1->destType)
14369 FreeType(exp->op.exp1->destType);
14370 exp->op.exp1->destType = exp->destType;
14371 exp->op.exp1->opDestType = 0x1;
14373 exp->destType->refCount++;
14377 if(exp->op.exp1->destType)
14378 FreeType(exp->op.exp1->destType);
14379 exp->op.exp1->destType = dummy;
14382 if(exp->op.exp1->destType && exp->op.op != '=')
14383 exp->op.exp1->destType->count++;
14384 ProcessExpressionType(exp->op.exp1);
14385 if(exp->op.exp1->destType && exp->op.op != '=')
14386 exp->op.exp1->destType->count--;
14387 exp->op.exp1->opDestType = 0x0;
14388 if(!exp->op.exp2 && (exp->op.op == INC_OP || exp->op.op == DEC_OP) && exp->op.exp1->expType && exp->op.exp1->expType->kind == 8 && exp->op.exp1->expType->_class && exp->op.exp1->expType->_class->registered && exp->op.exp1->expType->_class->registered->type == 3)
14390 exp->op.exp2 = MkExpConstant("1");
14391 exp->op.op = exp->op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14394 if(exp->op.exp1->destType == dummy)
14397 exp->op.exp1->destType = (((void *)0));
14399 type1 = exp->op.exp1->expType;
14403 char expString[10240];
14405 expString[0] = '\0';
14406 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14410 exp->op.exp2->destType = exp->op.exp1->expType;
14411 if(exp->op.exp1->expType)
14412 exp->op.exp1->expType->refCount++;
14416 exp->op.exp2->destType = exp->destType;
14417 if(!exp->op.exp1 || exp->op.op != '&')
14418 exp->op.exp2->opDestType = 0x1;
14420 exp->destType->refCount++;
14424 exp->expType = type1;
14429 PrintExpression(exp->op.exp2, expString);
14430 if(type1 && type1->kind == 13)
14432 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)
14433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14434 else if(exp->op.op == '=')
14436 if(exp->op.exp2->destType)
14437 FreeType(exp->op.exp2->destType);
14438 exp->op.exp2->destType = type1;
14445 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)
14449 if(exp->op.exp2->destType)
14450 FreeType(exp->op.exp2->destType);
14451 exp->op.exp2->destType = type1;
14458 exp->expType = type1;
14460 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14462 if(exp->op.exp2->destType)
14463 FreeType(exp->op.exp2->destType);
14464 exp->op.exp2->destType = exp->destType;
14465 if(exp->op.op != '&')
14466 exp->op.exp2->opDestType = 0x1;
14468 exp->destType->refCount++;
14472 if(exp->op.exp2->destType)
14473 FreeType(exp->op.exp2->destType);
14474 exp->op.exp2->destType = dummy;
14477 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14479 FreeType(exp->op.exp2->destType);
14480 exp->op.exp2->destType = type1;
14483 if(exp->op.exp2->destType && exp->op.op != '=')
14484 exp->op.exp2->destType->count++;
14485 if(exp->op.op == SIZEOF)
14487 struct Expression * e = exp->op.exp2;
14489 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14491 if(e->type == 5 || e->type == 32 || e->type == 23)
14494 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14496 e = (*e->list).last;
14499 if(e->type == 11 && e->cast.exp)
14500 e->cast.exp->needCast = 0x1;
14502 ProcessExpressionType(exp->op.exp2);
14503 exp->op.exp2->opDestType = 0x0;
14504 if(exp->op.exp2->destType && exp->op.op != '=')
14505 exp->op.exp2->destType->count--;
14506 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14508 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)
14510 if(exp->op.op != '=' && type1->type->kind == 0)
14511 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14513 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)))
14515 if(exp->op.op == ADD_ASSIGN)
14516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14518 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))
14520 if(exp->op.op == ADD_ASSIGN)
14521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14523 else if(inCompiler)
14525 char type1String[1024];
14526 char type2String[1024];
14528 type1String[0] = '\0';
14529 type2String[0] = '\0';
14530 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14531 PrintType(type1, type2String, 0x0, 0x1);
14532 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14533 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14536 if(exp->op.exp2->destType == dummy)
14539 exp->op.exp2->destType = (((void *)0));
14541 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14543 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14544 type2->refCount = 1;
14545 CopyTypeInto(type2, exp->op.exp2->expType);
14546 type2->isSigned = 0x1;
14548 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14550 type2 = __extension__ ({
14551 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14553 __ecereInstance1->kind = 3, __ecereInstance1;
14555 type2->refCount = 1;
14556 type2->isSigned = 0x1;
14560 type2 = exp->op.exp2->expType;
14566 if(exp->op.op == SIZEOF)
14568 exp->expType = __extension__ ({
14569 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14571 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14573 exp->isConstant = 0x1;
14575 else if(exp->op.op == '*' && !exp->op.exp1)
14577 exp->expType = Dereference(type2);
14578 if(type2 && type2->kind == 8)
14579 notByReference = 0x1;
14581 else if(exp->op.op == '&' && !exp->op.exp1)
14582 exp->expType = Reference(type2);
14589 if(exp->op.exp1->destType)
14590 FreeType(exp->op.exp1->destType);
14591 exp->op.exp1->destType = MkClassType("bool");
14592 exp->op.exp1->destType->truth = 0x1;
14593 if(!exp->op.exp1->expType)
14594 ProcessExpressionType(exp->op.exp1);
14596 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14597 FreeType(exp->op.exp1->expType);
14598 exp->op.exp1->expType = MkClassType("bool");
14599 exp->op.exp1->expType->truth = 0x1;
14603 if(exp->op.exp2->destType)
14604 FreeType(exp->op.exp2->destType);
14605 exp->op.exp2->destType = MkClassType("bool");
14606 exp->op.exp2->destType->truth = 0x1;
14607 if(!exp->op.exp2->expType)
14608 ProcessExpressionType(exp->op.exp2);
14610 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14611 FreeType(exp->op.exp2->expType);
14612 exp->op.exp2->expType = MkClassType("bool");
14613 exp->op.exp2->expType->truth = 0x1;
14616 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")))))
14618 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14620 if(exp->op.op == '-' && ((type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 4) || (type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 4)))
14622 struct Type * intType;
14624 if(!type1->_class->registered->dataType)
14625 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14626 if(!type2->_class->registered->dataType)
14627 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14628 intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14629 if(exp->op.exp1->destType)
14630 FreeType(exp->op.exp1->destType);
14631 if(exp->op.exp2->destType)
14632 FreeType(exp->op.exp2->destType);
14633 exp->op.exp1->destType = intType;
14634 exp->op.exp2->destType = intType;
14635 intType->refCount++;
14639 if(exp->op.exp2->destType)
14640 FreeType(exp->op.exp2->destType);
14641 exp->op.exp2->destType = type1;
14643 if(exp->op.exp1->destType)
14644 FreeType(exp->op.exp1->destType);
14645 exp->op.exp1->destType = type2;
14648 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)
14649 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14650 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14652 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14656 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14658 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14659 ProcessExpressionType(exp->op.exp1);
14660 if(type2->kind != 13)
14662 ProcessExpressionType(classExp);
14663 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"))))))));
14664 if(!exp->op.exp2->expType)
14668 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14671 ProcessExpressionType(exp->op.exp2);
14675 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)))
14677 if(type1->kind != 8 && type1->type->kind == 0)
14678 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14679 exp->expType = type1;
14683 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)))
14685 if(type2->kind != 8 && type2->type->kind == 0)
14686 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14687 exp->expType = type2;
14691 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))
14693 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14697 unsigned int success = 0x0;
14699 if(type1->kind == 13 && type2->kind == 13)
14701 if(exp->op.op == '+')
14702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14703 else if(exp->op.op == '-')
14705 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14707 exp->expType = __extension__ ({
14708 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14710 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14713 if(type1->type->kind == 20)
14715 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14719 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14721 ProcessExpressionType(classExp);
14723 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")))))));
14724 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14732 if(!success && exp->op.exp1->type == 2)
14734 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14737 FreeType(exp->expType);
14738 exp->expType = exp->op.exp1->destType;
14739 if(exp->op.exp1->destType)
14740 exp->op.exp1->destType->refCount++;
14743 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14746 FreeType(exp->expType);
14747 exp->expType = exp->op.exp2->destType;
14748 if(exp->op.exp2->destType)
14749 exp->op.exp2->destType->refCount++;
14755 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14758 FreeType(exp->expType);
14759 exp->expType = exp->op.exp2->destType;
14760 if(exp->op.exp2->destType)
14761 exp->op.exp2->destType->refCount++;
14764 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14767 FreeType(exp->expType);
14768 exp->expType = exp->op.exp1->destType;
14769 if(exp->op.exp1->destType)
14770 exp->op.exp1->destType->refCount++;
14776 char expString1[10240];
14777 char expString2[10240];
14781 expString1[0] = '\0';
14782 expString2[0] = '\0';
14787 PrintExpression(exp->op.exp1, expString1);
14788 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14789 PrintExpression(exp->op.exp2, expString2);
14790 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14791 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14792 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14794 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14798 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14800 if(exp->op.exp1->destType)
14801 FreeType(exp->op.exp1->destType);
14802 exp->op.exp1->destType = type2->_class->registered->dataType;
14803 if(type2->_class->registered->dataType)
14804 type2->_class->registered->dataType->refCount++;
14805 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14806 exp->expType = type2;
14810 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14812 if(exp->op.exp2->destType)
14813 FreeType(exp->op.exp2->destType);
14814 exp->op.exp2->destType = type1->_class->registered->dataType;
14815 if(type1->_class->registered->dataType)
14816 type1->_class->registered->dataType->refCount++;
14817 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14818 exp->expType = type1;
14824 unsigned int valid = 0x0;
14826 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14828 if(exp->op.exp2->destType)
14829 FreeType(exp->op.exp2->destType);
14830 if(!type1->_class->registered->dataType)
14831 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14832 exp->op.exp2->destType = type1->_class->registered->dataType;
14833 exp->op.exp2->destType->refCount++;
14834 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14837 type2 = exp->op.exp2->destType;
14840 exp->expType = type2;
14843 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14845 if(exp->op.exp1->destType)
14846 FreeType(exp->op.exp1->destType);
14847 if(!type2->_class->registered->dataType)
14848 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14849 exp->op.exp1->destType = type2->_class->registered->dataType;
14850 exp->op.exp1->destType->refCount++;
14851 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14852 type1 = exp->op.exp1->destType;
14853 exp->expType = type1;
14856 if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
14858 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
14859 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
14861 if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
14863 if(op1IsEnum && exp->op.exp2->expType)
14865 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14868 FreeType(exp->expType);
14869 exp->expType = exp->op.exp2->expType;
14870 if(exp->op.exp2->expType)
14871 exp->op.exp2->expType->refCount++;
14875 else if(op2IsEnum && exp->op.exp1->expType)
14877 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14880 FreeType(exp->expType);
14881 exp->expType = exp->op.exp1->expType;
14882 if(exp->op.exp1->expType)
14883 exp->op.exp1->expType->refCount++;
14890 if(op1IsEnum && exp->op.exp2->expType)
14892 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14895 FreeType(exp->expType);
14896 exp->expType = exp->op.exp1->expType;
14897 if(exp->op.exp1->expType)
14898 exp->op.exp1->expType->refCount++;
14902 else if(op2IsEnum && exp->op.exp1->expType)
14904 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14907 FreeType(exp->expType);
14908 exp->expType = exp->op.exp2->expType;
14909 if(exp->op.exp2->expType)
14910 exp->op.exp2->expType->refCount++;
14918 if(type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3 && (type1->kind != 8 || !type1->_class || !type1->_class->registered || type1->_class->registered->type != 3))
14920 if(exp->op.exp1->destType)
14921 FreeType(exp->op.exp1->destType);
14922 exp->op.exp1->destType = type2;
14924 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14927 FreeType(exp->expType);
14928 exp->expType = exp->op.exp1->destType;
14929 if(exp->op.exp1->destType)
14930 exp->op.exp1->destType->refCount++;
14935 if(exp->op.exp2->destType)
14936 FreeType(exp->op.exp2->destType);
14937 exp->op.exp2->destType = type1;
14939 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14942 FreeType(exp->expType);
14943 exp->expType = exp->op.exp2->destType;
14944 if(exp->op.exp2->destType)
14945 exp->op.exp2->destType->refCount++;
14947 else if(type1 && type2)
14949 char expString1[10240];
14950 char expString2[10240];
14951 char type1String[1024];
14952 char type2String[1024];
14954 expString1[0] = '\0';
14955 expString2[0] = '\0';
14956 type1String[0] = '\0';
14957 type2String[0] = '\0';
14960 PrintExpression(exp->op.exp1, expString1);
14961 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14962 PrintExpression(exp->op.exp2, expString2);
14963 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14964 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14965 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14967 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14968 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14970 exp->expType = exp->op.exp1->expType;
14971 if(exp->op.exp1->expType)
14972 exp->op.exp1->expType->refCount++;
14974 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14976 exp->expType = exp->op.exp2->expType;
14977 if(exp->op.exp2->expType)
14978 exp->op.exp2->expType->refCount++;
14986 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14988 struct Type * oldType = exp->op.exp1->expType;
14990 exp->op.exp1->expType = (((void *)0));
14991 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14994 exp->op.exp1->expType = oldType;
14996 if(exp->op.exp1->destType)
14997 FreeType(exp->op.exp1->destType);
14998 exp->op.exp1->destType = type2;
15000 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
15003 FreeType(exp->expType);
15004 exp->expType = exp->op.exp1->destType;
15005 if(exp->op.exp1->destType)
15006 exp->op.exp1->destType->refCount++;
15010 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15012 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
15014 if(exp->op.exp1->destType)
15015 FreeType(exp->op.exp1->destType);
15016 exp->op.exp1->destType = type2->_class->registered->dataType;
15017 if(type2->_class->registered->dataType)
15018 type2->_class->registered->dataType->refCount++;
15019 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
15021 if(exp->op.op == '!')
15023 exp->expType = MkClassType("bool");
15024 exp->expType->truth = 0x1;
15028 exp->expType = type2;
15033 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15035 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
15037 if(exp->op.exp2->destType)
15038 FreeType(exp->op.exp2->destType);
15039 exp->op.exp2->destType = type1->_class->registered->dataType;
15040 if(type1->_class->registered->dataType)
15041 type1->_class->registered->dataType->refCount++;
15042 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
15044 exp->expType = type1;
15050 if(exp->op.exp1 && !exp->op.exp1->expType)
15052 char expString[10000];
15054 expString[0] = '\0';
15057 PrintExpression(exp->op.exp1, expString);
15058 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15061 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15063 if(exp->op.exp2 && !exp->op.exp2->expType)
15065 char expString[10240];
15067 expString[0] = '\0';
15070 PrintExpression(exp->op.exp2, expString);
15071 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15078 FreeType(exp->expType);
15079 exp->expType = MkClassType("bool");
15080 exp->expType->truth = 0x1;
15082 if(exp->op.op != SIZEOF)
15083 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
15084 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
15086 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
15088 yylloc = oldyylloc;
15097 struct Expression * e;
15099 exp->isConstant = 0x1;
15100 for(e = (*exp->list).first; e; e = e->next)
15102 unsigned int inced = 0x0;
15106 FreeType(e->destType);
15107 e->opDestType = exp->opDestType;
15108 e->destType = exp->destType;
15111 exp->destType->refCount++;
15112 e->destType->count++;
15116 ProcessExpressionType(e);
15118 exp->destType->count--;
15119 if(!exp->expType && !e->next)
15121 exp->expType = e->expType;
15123 e->expType->refCount++;
15126 exp->isConstant = 0x0;
15128 e = (*exp->list).first;
15129 if(!e->next && e->type == 8)
15131 struct Expression * next = exp->next, * prev = exp->prev;
15133 FreeType(exp->expType);
15134 FreeType(exp->destType);
15135 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
15139 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15140 ProcessExpressionType(exp);
15146 struct Expression * e;
15148 exp->isConstant = 0x1;
15149 ProcessExpressionType(exp->index.exp);
15150 if(!exp->index.exp->isConstant)
15151 exp->isConstant = 0x0;
15152 if(exp->index.exp->expType)
15154 struct Type * source = exp->index.exp->expType;
15156 if(source->kind == 8 && source->_class && source->_class->registered)
15158 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15159 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15161 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15163 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15164 if(exp->index.index && (*exp->index.index).last)
15166 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15171 for(e = (*exp->index.index).first; e; e = e->next)
15173 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15176 FreeType(e->destType);
15177 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15179 ProcessExpressionType(e);
15184 exp->isConstant = 0x0;
15187 exp->expType = Dereference(exp->index.exp->expType);
15189 DeclareType(exp->expType, 0x0, 0x0);
15194 struct Expression * e;
15195 struct Type * functionType;
15196 struct Type * methodType = (((void *)0));
15202 PrintExpression(exp->call.exp, name);
15203 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15205 PrintExpression(exp->call.exp, name);
15208 if(exp->call.exp->type == 0)
15210 struct Expression * idExp = exp->call.exp;
15211 struct Identifier * id = idExp->identifier;
15213 if(!strcmp(id->string, "__builtin_frame_address"))
15215 exp->expType = ProcessTypeString("void *", 0x1);
15216 if(exp->call.arguments && (*exp->call.arguments).first)
15217 ProcessExpressionType((*exp->call.arguments).first);
15220 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15222 exp->expType = ProcessTypeString("int", 0x1);
15223 if(exp->call.arguments && (*exp->call.arguments).first)
15224 ProcessExpressionType((*exp->call.arguments).first);
15227 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15229 struct Expression * a = (((void *)0));
15230 struct Expression * b = (((void *)0));
15231 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15233 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15235 a = (*exp->call.arguments).first;
15236 b = (*exp->call.arguments).last;
15240 else if((*exp->call.arguments).count == 1)
15242 a = (*exp->call.arguments).first;
15247 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15248 idExp->identifier = (((void *)0));
15249 FreeExpContents(exp);
15250 ProcessExpressionType(a);
15252 ProcessExpressionType(b);
15254 exp->list = MkList();
15255 if(a->expType && (!b || b->expType))
15257 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15261 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15262 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15263 struct Declaration * decl;
15264 char temp1[1024], temp2[1024];
15266 GetTypeSpecs(a->expType, specs);
15267 if(a && !a->isConstant && a->type != 0)
15269 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15270 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15271 tempExp1 = QMkExpId(temp1);
15272 tempExp1->expType = a->expType;
15274 a->expType->refCount++;
15275 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15277 if(b && !b->isConstant && b->type != 0)
15279 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15280 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15281 tempExp2 = QMkExpId(temp2);
15282 tempExp2->expType = b->expType;
15284 b->expType->refCount++;
15285 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15287 decl = MkDeclaration(specs, decls);
15288 if(!curCompound->compound.declarations)
15289 curCompound->compound.declarations = MkList();
15290 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15294 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15296 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15298 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15299 exp->expType = a->expType;
15301 a->expType->refCount++;
15303 else if(!strcmp(id->string, "Abs"))
15305 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15306 exp->expType = a->expType;
15308 a->expType->refCount++;
15310 else if(!strcmp(id->string, "Sgn"))
15312 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"))))));
15313 exp->expType = ProcessTypeString("int", 0x0);
15315 FreeExpression(tempExp1);
15317 FreeExpression(tempExp2);
15318 FreeIdentifier(id);
15324 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15326 if(!exp->call.exp->destType)
15328 exp->call.exp->destType = dummy;
15331 ProcessExpressionType(exp->call.exp);
15332 if(exp->call.exp->destType == dummy)
15335 exp->call.exp->destType = (((void *)0));
15339 functionType = exp->call.exp->expType;
15340 if(functionType && functionType->kind == 16)
15342 methodType = functionType;
15343 functionType = methodType->method->dataType;
15344 if(exp->call.exp->expType->usedClass)
15346 char typeString[1024];
15348 typeString[0] = '\0';
15350 struct Symbol * back = functionType->thisClass;
15352 functionType->thisClass = (((void *)0));
15353 PrintType(functionType, typeString, 0x1, 0x1);
15354 functionType->thisClass = back;
15356 if(strstr(typeString, "thisclass"))
15358 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15359 struct Declarator * decl;
15362 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15364 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15365 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15366 thisClassParams = 0x0;
15367 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15369 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15371 thisClass = exp->call.exp->expType->usedClass;
15372 ProcessDeclarator(decl);
15373 thisClass = backupThisClass;
15375 thisClassParams = 0x1;
15376 functionType = ProcessType(specs, decl);
15377 functionType->refCount = 0;
15378 FinishTemplatesContext(context);
15380 FreeList(specs, FreeSpecifier);
15381 FreeDeclarator(decl);
15385 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15387 struct Type * type = functionType->type;
15389 if(!functionType->refCount)
15391 functionType->type = (((void *)0));
15392 FreeType(functionType);
15394 functionType = type;
15396 if(functionType && functionType->kind != 11)
15398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15400 else if(functionType)
15402 unsigned int emptyParams = 0x0, noParams = 0x0;
15403 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15404 struct Type * type = functionType->params.first;
15405 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15407 struct Location oldyylloc = yylloc;
15411 if(functionType->extraParam && e && functionType->thisClass)
15413 e->destType = MkClassType(functionType->thisClass->string);
15416 if(!functionType->staticMethod && !functionType->extraParam)
15418 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15420 type = MkClassType(memberExp->member.exp->expType->_class->string);
15423 e->destType = type;
15425 type = functionType->params.first;
15428 type->refCount = 0;
15430 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15432 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15433 type->byReference = functionType->byReference;
15434 type->typedByReference = functionType->typedByReference;
15437 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15439 e->destType = type;
15441 type = functionType->params.first;
15444 type->refCount = 0;
15447 if(type && type->kind == 0)
15450 if(!type->refCount)
15452 type = (((void *)0));
15454 for(; e; e = e->next)
15456 if(!type && !emptyParams)
15459 if(methodType && methodType->methodClass)
15460 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15462 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
15465 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15467 struct Type * templatedType = (((void *)0));
15468 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15469 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15472 if(_class && _class->templateArgs)
15474 struct __ecereNameSpace__ecere__com__Class * sClass;
15476 for(sClass = _class; sClass; sClass = sClass->base)
15478 if(sClass->templateClass)
15479 sClass = sClass->templateClass;
15481 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15483 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15485 struct __ecereNameSpace__ecere__com__Class * nextClass;
15487 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15489 if(nextClass->templateClass)
15490 nextClass = nextClass->templateClass;
15491 id += nextClass->templateParams.count;
15501 if(curParam && _class->templateArgs[id].dataTypeString)
15503 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15506 struct Context * context = SetupTemplatesContext(_class);
15508 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15509 FinishTemplatesContext(context);
15511 e->destType = templatedType;
15514 templatedType->passAsTemplate = 0x1;
15519 e->destType = type;
15526 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15528 e->destType = type->prev;
15529 e->destType->refCount++;
15533 e->destType = type;
15538 if(type && type->kind != 14)
15540 struct Type * next = type->next;
15542 if(!type->refCount)
15547 if(type && type->kind != 14)
15549 if(methodType && methodType->methodClass)
15550 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15552 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
15554 yylloc = oldyylloc;
15555 if(type && !type->refCount)
15560 functionType = __extension__ ({
15561 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15563 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15565 if(exp->call.exp->type == 0)
15567 char * string = exp->call.exp->identifier->string;
15571 struct Symbol * symbol;
15572 struct Location oldyylloc = yylloc;
15574 yylloc = exp->call.exp->identifier->loc;
15575 if(strstr(string, "__builtin_") == string)
15579 functionType->returnType = exp->destType;
15580 exp->destType->refCount++;
15584 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15585 symbol = __extension__ ({
15586 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15588 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15590 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15591 if(strstr(symbol->string, "::"))
15592 globalContext->hasNameSpace = 0x1;
15593 yylloc = oldyylloc;
15596 else if(exp->call.exp->type == 8)
15600 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15601 if(!functionType->returnType)
15603 functionType->returnType = __extension__ ({
15604 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15606 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15610 if(functionType && functionType->kind == 11)
15612 exp->expType = functionType->returnType;
15613 if(functionType->returnType)
15614 functionType->returnType->refCount++;
15615 if(!functionType->refCount)
15616 FreeType(functionType);
15618 if(exp->call.arguments)
15620 for(e = (*exp->call.arguments).first; e; e = e->next)
15622 struct Type * destType = e->destType;
15624 ProcessExpressionType(e);
15631 struct Type * type;
15632 struct Location oldyylloc = yylloc;
15633 unsigned int thisPtr;
15634 struct Expression * checkExp = exp->member.exp;
15638 if(checkExp->type == 11)
15639 checkExp = checkExp->cast.exp;
15640 else if(checkExp->type == 5)
15641 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15645 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15646 exp->thisPtr = thisPtr;
15647 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15649 exp->member.member->classSym = exp->member.member->_class->symbol;
15651 ProcessExpressionType(exp->member.exp);
15652 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)
15654 exp->isConstant = 0x0;
15657 exp->isConstant = exp->member.exp->isConstant;
15658 type = exp->member.exp->expType;
15660 if(type && (type->kind == 20))
15662 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15663 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15667 for(param = _class->templateParams.first; param; param = param->next)
15669 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15673 if(param && param->defaultArg.member)
15675 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15679 struct Expression * expMember = exp->member.exp;
15680 struct Declarator * decl;
15681 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15682 char thisClassTypeString[1024];
15684 FreeIdentifier(exp->member.member);
15685 ProcessExpressionType(argExp);
15687 char * colon = strstr(param->defaultArg.memberString, "::");
15691 char className[1024];
15692 struct __ecereNameSpace__ecere__com__Class * sClass;
15694 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15695 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15698 strcpy(thisClassTypeString, _class->fullName);
15700 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15701 exp->expType = ProcessType(specs, decl);
15702 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15704 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15705 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15707 int paramCount = 0;
15708 int lastParam = -1;
15709 char templateString[1024];
15710 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15712 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15713 for(cClass = expClass; cClass; cClass = cClass->base)
15717 for(param = cClass->templateParams.first; param; param = param->next)
15720 struct __ecereNameSpace__ecere__com__Class * sClass;
15721 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15723 for(sClass = cClass->base; sClass; sClass = sClass->base)
15724 id += sClass->templateParams.count;
15725 arg = expClass->templateArgs[id];
15726 for(sClass = _class; sClass; sClass = sClass->base)
15728 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15730 struct __ecereNameSpace__ecere__com__Class * nextClass;
15732 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15733 p += nextClass->templateParams.count;
15734 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15736 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15738 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15740 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15741 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15748 char argument[256];
15750 argument[0] = '\0';
15751 switch(param->type)
15755 char expString[1024];
15756 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15757 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15758 struct Expression * exp;
15759 char * string = PrintHexUInt64(arg.expression.ui64);
15761 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15762 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15763 ProcessExpressionType(exp);
15764 ComputeExpression(exp);
15765 expString[0] = '\0';
15766 PrintExpression(exp, expString);
15767 strcat(argument, expString);
15768 FreeExpression(exp);
15773 strcat(argument, arg.member->name);
15778 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15780 if(!strcmp(arg.dataTypeString, "thisclass"))
15781 strcat(argument, thisClassTypeString);
15783 strcat(argument, arg.dataTypeString);
15791 strcat(templateString, ", ");
15792 if(lastParam != p - 1)
15794 strcat(templateString, param->name);
15795 strcat(templateString, " = ");
15797 strcat(templateString, argument);
15806 int len = strlen(templateString);
15808 if(templateString[len - 1] == '>')
15809 templateString[len++] = ' ';
15810 templateString[len++] = '>';
15811 templateString[len++] = '\0';
15814 struct Context * context = SetupTemplatesContext(_class);
15816 FreeType(exp->expType);
15817 exp->expType = ProcessTypeString(templateString, 0x0);
15818 FinishTemplatesContext(context);
15822 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")))))))));
15825 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15827 type = ProcessTemplateParameterType(type->templateParameter);
15830 if(type && (type->kind == 20))
15832 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 == 24 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
15834 struct Identifier * id = exp->member.member;
15835 int typeKind = type->kind;
15836 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));
15838 if(typeKind == 19 && exp->member.exp->type == 24)
15840 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15845 if(typeKind == 3 || typeKind == 15)
15846 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15849 if(type->kind == 8 && type->_class && type->_class->registered)
15851 _class = type->_class->registered;
15853 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15855 _class = FindClass("char *")->registered;
15857 else if(type->kind == 13)
15859 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15860 FreeType(exp->expType);
15861 exp->expType = ProcessTypeString("uintptr", 0x0);
15862 exp->byReference = 0x1;
15866 char string[1024] = "";
15867 struct Symbol * classSym;
15869 PrintTypeNoConst(type, string, 0x0, 0x1);
15870 classSym = FindClass(string);
15872 _class = classSym->registered;
15878 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15879 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15880 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15881 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15882 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15884 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15885 exp->member.memberType = 1;
15886 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15890 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15892 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15893 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15895 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15897 member = (((void *)0));
15899 if(!member && !prop)
15900 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15901 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15902 exp->member.thisPtr = 0x1;
15908 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15909 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15910 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15912 if(!prop && !member)
15914 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15917 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15918 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15919 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15924 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15925 prop = (((void *)0));
15927 member = (((void *)0));
15931 if(!prop && !member && !method)
15932 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15933 if(!prop && !member && !method)
15937 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15940 exp->member.memberType = 5;
15941 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15945 char structName[1024];
15946 struct Identifier * id = exp->member.member;
15947 struct Expression * classExp = exp->member.exp;
15950 FreeType(classExp->expType);
15951 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15952 strcpy(structName, "__ecereClassData_");
15953 FullClassNameCat(structName, type->_class->string, 0x0);
15955 exp->member.member = id;
15956 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"))))))));
15958 ProcessExpressionType(exp);
15964 struct Symbol * classSym = FindClass(id->string);
15968 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15971 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15977 exp->member.memberType = 1;
15978 if(!prop->dataType)
15979 ProcessPropertyType(prop);
15980 exp->expType = prop->dataType;
15982 prop->dataType->refCount++;
15986 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15988 FreeExpContents(exp);
15990 exp->identifier = MkIdentifier("class");
15991 ProcessExpressionType(exp);
15994 exp->member.memberType = 3;
15995 DeclareStruct(_class->fullName, 0x0);
15996 if(!member->dataType)
15998 struct Context * context = SetupTemplatesContext(_class);
16000 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16001 FinishTemplatesContext(context);
16003 exp->expType = member->dataType;
16004 if(member->dataType)
16005 member->dataType->refCount++;
16007 else if(revConvert)
16009 exp->member.memberType = 4;
16010 exp->expType = MkClassType(revConvert->_class->fullName);
16015 exp->member.memberType = 2;
16017 if(!method->dataType)
16018 ProcessMethodType(method);
16019 exp->expType = __extension__ ({
16020 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16022 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
16024 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
16025 exp->expType->usedClass = _class;
16027 else if(!classProp)
16029 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16031 FreeExpContents(exp);
16033 exp->identifier = MkIdentifier("class");
16034 FreeType(exp->expType);
16035 exp->expType = MkClassType("ecere::com::Class");
16038 yylloc = exp->member.member->loc;
16039 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16041 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16043 if(_class && exp->expType)
16045 struct __ecereNameSpace__ecere__com__Class * tClass;
16048 while(tClass && !tClass->templateClass)
16049 tClass = tClass->base;
16050 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
16053 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16054 struct __ecereNameSpace__ecere__com__Class * sClass;
16056 for(sClass = tClass; sClass; sClass = sClass->base)
16059 if(sClass->templateClass)
16060 sClass = sClass->templateClass;
16061 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16063 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
16065 for(sClass = sClass->base; sClass; sClass = sClass->base)
16066 id += sClass->templateParams.count;
16074 if(curParam && tClass->templateArgs[id].dataTypeString)
16076 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16077 struct Context * context = SetupTemplatesContext(tClass);
16079 FreeType(exp->expType);
16080 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
16083 if(exp->expType->kind == 21)
16085 FreeType(exp->expType);
16086 exp->expType = ReplaceThisClassType(_class);
16088 if(tClass->templateClass)
16089 exp->expType->passAsTemplate = 0x1;
16092 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
16093 if(exp->destType->kind == 21)
16095 FreeType(exp->destType);
16096 exp->destType = ReplaceThisClassType(_class);
16100 FinishTemplatesContext(context);
16103 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
16106 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16107 struct __ecereNameSpace__ecere__com__Class * sClass;
16109 for(sClass = tClass; sClass; sClass = sClass->base)
16112 if(sClass->templateClass)
16113 sClass = sClass->templateClass;
16114 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16116 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
16118 for(sClass = sClass->base; sClass; sClass = sClass->base)
16119 id += sClass->templateParams.count;
16129 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16130 struct Context * context = SetupTemplatesContext(tClass);
16131 struct Type * basicType;
16133 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
16136 if(basicType->kind == 21)
16138 FreeType(basicType);
16139 basicType = ReplaceThisClassType(_class);
16141 FreeType(exp->expType);
16142 exp->expType = __extension__ ({
16143 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16145 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
16149 exp->destType = exp->expType;
16150 exp->destType->refCount++;
16153 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16154 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16155 struct Declarator * decl;
16157 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16160 exp->destType->refCount++;
16162 exp->expType->refCount++;
16164 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16165 exp->cast.exp = newExp;
16168 FinishTemplatesContext(context);
16171 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16173 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16177 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16180 int paramCount = 0;
16181 int lastParam = -1;
16182 char templateString[1024];
16183 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16185 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16186 while(cClass != expClass)
16188 struct __ecereNameSpace__ecere__com__Class * sClass;
16190 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16193 for(param = cClass->templateParams.first; param; param = param->next)
16195 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16198 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16199 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16201 while(cClassCur != tClass && !paramCur)
16203 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16205 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16207 cClassCur = sClassCur;
16208 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16210 if(!strcmp(paramCur->name, param->name))
16217 if(paramCur && paramCur->type == 0)
16218 arg = tClass->templateArgs[cp];
16220 arg = expClass->templateArgs[p];
16222 char argument[256];
16224 argument[0] = '\0';
16225 switch(param->type)
16229 char expString[1024];
16230 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16231 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16232 struct Expression * exp;
16233 char * string = PrintHexUInt64(arg.expression.ui64);
16235 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16236 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16237 ProcessExpressionType(exp);
16238 ComputeExpression(exp);
16239 expString[0] = '\0';
16240 PrintExpression(exp, expString);
16241 strcat(argument, expString);
16242 FreeExpression(exp);
16247 strcat(argument, arg.member->name);
16252 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16253 strcat(argument, arg.dataTypeString);
16260 strcat(templateString, ", ");
16261 if(lastParam != p - 1)
16263 strcat(templateString, param->name);
16264 strcat(templateString, " = ");
16266 strcat(templateString, argument);
16275 int len = strlen(templateString);
16277 if(templateString[len - 1] == '>')
16278 templateString[len++] = ' ';
16279 templateString[len++] = '>';
16280 templateString[len++] = '\0';
16282 FreeType(exp->expType);
16284 struct Context * context = SetupTemplatesContext(tClass);
16286 exp->expType = ProcessTypeString(templateString, 0x0);
16287 FinishTemplatesContext(context);
16294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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)");
16296 else if(type && (type->kind == 9 || type->kind == 10))
16298 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16302 exp->expType = memberType;
16304 memberType->refCount++;
16309 char expString[10240];
16311 expString[0] = '\0';
16314 PrintExpression(exp, expString);
16315 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16317 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16319 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16321 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16323 struct Identifier * id = exp->member.member;
16324 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));
16328 FreeType(exp->expType);
16329 exp->expType = ReplaceThisClassType(_class);
16333 yylloc = oldyylloc;
16338 struct Type * destType = exp->destType;
16340 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16342 exp->member.member->classSym = exp->member.member->_class->symbol;
16344 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16348 ProcessExpressionType(exp);
16355 struct Symbol * classSym = exp->_class->symbol;
16357 if(classSym && classSym->registered)
16359 if(classSym->registered->type == 5)
16364 DeclareStruct(classSym->string, 0x0);
16365 FreeSpecifier(exp->_class);
16367 FullClassNameCat(name, classSym->string, 0x0);
16368 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16372 if(classSym->registered->fixed)
16374 FreeSpecifier(exp->_class);
16375 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16380 char className[1024];
16382 strcpy(className, "__ecereClass_");
16383 FullClassNameCat(className, classSym->string, 0x1);
16384 MangleClassName(className);
16385 DeclareClass(classSym, className);
16386 FreeExpContents(exp);
16388 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16389 exp->member.member = MkIdentifier("structSize");
16393 exp->expType = __extension__ ({
16394 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16396 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16402 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16404 exp->expType = __extension__ ({
16405 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16407 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16409 exp->isConstant = 0x1;
16410 DeclareType(type, 0x0, 0x0);
16416 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16419 FreeType(exp->cast.exp->destType);
16420 exp->cast.exp->destType = type;
16422 ProcessExpressionType(exp->cast.exp);
16424 exp->expType = type;
16425 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16427 void * prev = exp->prev, * next = exp->next;
16428 struct Type * expType = exp->cast.exp->destType;
16429 struct Expression * castExp = exp->cast.exp;
16430 struct Type * destType = exp->destType;
16433 expType->refCount++;
16434 FreeType(exp->expType);
16435 FreeTypeName(exp->cast.typeName);
16437 FreeType(exp->expType);
16438 FreeType(exp->destType);
16439 exp->expType = expType;
16440 exp->destType = destType;
16441 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16447 exp->isConstant = exp->cast.exp->isConstant;
16453 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16455 exp->expType = type;
16460 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16462 ProcessExpressionType(exp->vaArg.exp);
16463 exp->expType = type;
16468 struct Expression * e;
16470 exp->isConstant = 0x1;
16471 FreeType(exp->cond.cond->destType);
16472 exp->cond.cond->destType = MkClassType("bool");
16473 exp->cond.cond->destType->truth = 0x1;
16474 ProcessExpressionType(exp->cond.cond);
16475 if(!exp->cond.cond->isConstant)
16476 exp->isConstant = 0x0;
16477 for(e = (*exp->cond.exp).first; e; e = e->next)
16481 FreeType(e->destType);
16482 e->destType = exp->destType;
16484 e->destType->refCount++;
16486 ProcessExpressionType(e);
16489 exp->expType = e->expType;
16491 e->expType->refCount++;
16494 exp->isConstant = 0x0;
16496 FreeType(exp->cond.elseExp->destType);
16497 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16498 if(exp->cond.elseExp->destType)
16499 exp->cond.elseExp->destType->refCount++;
16500 ProcessExpressionType(exp->cond.elseExp);
16501 if(!exp->cond.elseExp->isConstant)
16502 exp->isConstant = 0x0;
16507 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16509 struct Statement * last = (*exp->compound->compound.statements).last;
16511 if(last->type == 3 && last->expressions && (*last->expressions).last)
16513 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16515 exp->destType->refCount++;
16517 ProcessStatement(exp->compound);
16518 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16520 exp->expType->refCount++;
16526 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16528 if(spec && spec->type == 1)
16530 exp->expType = MkClassType(spec->name);
16531 exp->expType->kind = 19;
16532 exp->byReference = 0x1;
16536 exp->expType = MkClassType("ecere::com::Class");
16537 exp->byReference = 0x1;
16543 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16547 struct Identifier * id = exp->classData.id;
16548 char structName[1024];
16549 struct Expression * classExp;
16551 strcpy(structName, "__ecereClassData_");
16552 FullClassNameCat(structName, _class->fullName, 0x0);
16554 exp->member.member = id;
16555 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16556 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16558 classExp = MkExpIdentifier(MkIdentifier("class"));
16559 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"))))))));
16560 ProcessExpressionType(exp);
16567 struct Type * type = (((void *)0));
16568 char * typeString = (((void *)0));
16569 char typeStringBuf[1024];
16571 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))
16573 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16575 typeString = templateClass->templateArgs[2].dataTypeString;
16579 struct Expression * e;
16581 for(e = (*exp->list).first; e; e = e->next)
16583 ProcessExpressionType(e);
16593 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16597 e->expType = (((void *)0));
16598 e = (*exp->list).first;
16599 ProcessExpressionType(e);
16602 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16604 FreeType(e->expType);
16605 e->expType = (((void *)0));
16607 type = (((void *)0));
16615 FreeType(e->expType);
16616 e->expType = (((void *)0));
16622 typeStringBuf[0] = '\0';
16623 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16624 typeString = typeStringBuf;
16626 type = (((void *)0));
16631 char templateString[1024];
16632 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16633 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16634 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16635 struct Expression * expExt;
16636 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16638 sprintf(templateString, "Container<%s>", typeString);
16641 struct Expression * e;
16643 type = ProcessTypeString(typeString, 0x0);
16644 while(e = (*exp->list).first)
16646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16647 e->destType = type;
16649 ProcessExpressionType(e);
16650 ListAdd(initializers, MkInitializerAssignment(e));
16653 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16655 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16656 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16657 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16658 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16659 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16660 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16661 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16662 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16663 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16664 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16665 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16667 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16669 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16670 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16671 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16672 exp->expType = ProcessTypeString(templateString, 0x0);
16674 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16675 ProcessExpressionType(expExt);
16679 exp->expType = ProcessTypeString("Container", 0x0);
16680 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16685 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16687 FreeType(exp->expType);
16688 exp->expType = ReplaceThisClassType(thisClass);
16690 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16692 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16696 if(exp->expType->kind != 15)
16698 struct Type * member;
16699 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16701 FreeType(exp->expType);
16702 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16703 exp->expType->kind = symbol->type->kind;
16704 exp->expType->refCount++;
16705 exp->expType->enumName = enumName;
16706 exp->expType->members = symbol->type->members;
16707 for(member = symbol->type->members.first; member; member = member->next)
16708 member->refCount++;
16712 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16714 for(member = symbol->type->members.first; member; member = member->next)
16716 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16718 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16724 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16726 else if(exp->destType && !exp->destType->keepCast)
16728 if(!CheckExpressionType(exp, exp->destType, 0x0))
16730 if(!exp->destType->count || unresolved)
16735 if(exp->destType->kind != 14)
16742 char expString[10240];
16744 expString[0] = '\0';
16745 PrintType(exp->destType, type2, 0x0, 0x1);
16748 PrintExpression(exp, expString);
16749 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16752 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16753 else if(exp->type != 16)
16754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16759 char expString[10240];
16761 expString[0] = '\0';
16764 PrintExpression(exp, expString);
16765 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16768 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16769 else if(exp->type != 16)
16770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16782 PrintType(exp->expType, type1, 0x0, 0x1);
16783 PrintType(exp->destType, type2, 0x0, 0x1);
16785 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)))
16789 char expString[10240];
16791 expString[0] = '\0';
16794 PrintExpression(exp, expString);
16795 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16797 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16798 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16799 FreeType(exp->expType);
16800 exp->destType->refCount++;
16801 exp->expType = exp->destType;
16806 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16808 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16809 char typeString[1024];
16810 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16811 struct Declarator * decl;
16813 typeString[0] = '\0';
16816 exp->expType->refCount++;
16818 exp->expType->refCount++;
16820 newExp->destType = exp->expType;
16821 PrintType(exp->expType, typeString, 0x0, 0x0);
16822 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16823 exp->cast.typeName = MkTypeName(specs, decl);
16824 exp->cast.exp = newExp;
16827 else if(unresolved)
16829 if(exp->identifier->_class && exp->identifier->_class->name)
16830 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16831 else if(exp->identifier->string && exp->identifier->string[0])
16832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16834 else if(!exp->expType && exp->type != 16)
16836 char expString[10240];
16838 expString[0] = '\0';
16841 PrintExpression(exp, expString);
16842 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16847 ApplyAnyObjectLogic(exp);
16848 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 && exp->destType->kind != 24)))
16850 exp->byReference = 0x1;
16852 yylloc = oldyylloc;
16855 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)
16859 *curMember = (*curMember)->next;
16860 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16862 *curMember = subMemberStack[--(*subMemberStackPos)];
16863 *curMember = (*curMember)->next;
16865 while((*curMember) && (*curMember)->isProperty)
16866 *curMember = (*curMember)->next;
16867 if(subMemberStackPos)
16869 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16871 subMemberStack[(*subMemberStackPos)++] = *curMember;
16872 *curMember = (*curMember)->members.first;
16873 while(*curMember && (*curMember)->isProperty)
16874 *curMember = (*curMember)->next;
16882 if(subMemberStackPos && *subMemberStackPos)
16884 *curMember = subMemberStack[--(*subMemberStackPos)];
16885 *curMember = (*curMember)->next;
16889 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16891 if(*curClass == _class)
16893 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16895 *curMember = (*curClass)->membersAndProperties.first;
16897 while((*curMember) && (*curMember)->isProperty)
16898 *curMember = (*curMember)->next;
16899 if(subMemberStackPos)
16901 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16903 subMemberStack[(*subMemberStackPos)++] = *curMember;
16904 *curMember = (*curMember)->members.first;
16905 while(*curMember && (*curMember)->isProperty)
16906 *curMember = (*curMember)->next;
16913 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16918 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16920 if(init->exp && !init->exp->destType)
16922 FreeType(init->exp->destType);
16923 init->exp->destType = type;
16929 ProcessExpressionType(init->exp);
16930 init->isConstant = init->exp->isConstant;
16936 struct Expression * exp = init->exp;
16937 struct Instantiation * inst = exp->instance;
16938 struct MembersInit * members;
16941 init->list = MkList();
16944 for(members = (*inst->members).first; members; members = members->next)
16946 if(members->type == 0)
16948 struct MemberInit * member;
16950 for(member = (*members->dataMembers).first; member; member = member->next)
16952 ListAdd(init->list, member->initializer);
16953 member->initializer = (((void *)0));
16958 FreeExpression(exp);
16962 struct Initializer * i;
16963 struct Type * initializerType = (((void *)0));
16964 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16965 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16966 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16967 int subMemberStackPos = 0;
16969 if(type && type->kind == 12)
16970 initializerType = Dereference(type);
16971 else if(type && (type->kind == 9 || type->kind == 10))
16972 initializerType = type->members.first;
16973 for(i = (*init->list).first; i; i = i->next)
16975 if(type && type->kind == 8 && type->_class && type->_class->registered)
16977 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16980 if(!curMember->dataType)
16981 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16982 initializerType = curMember->dataType;
16985 ProcessInitializer(i, initializerType);
16986 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16987 initializerType = initializerType->next;
16989 init->isConstant = 0x0;
16991 if(type && type->kind == 12)
16992 FreeType(initializerType);
16993 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17002 extern struct Symbol * FindType(struct Context * ctx, char * name);
17004 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17006 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17012 if(spec->specifier == THISCLASS)
17017 spec->name = ReplaceThisClass(thisClass);
17018 spec->symbol = FindClass(spec->name);
17019 ProcessSpecifier(spec, declareStruct);
17026 struct Symbol * symbol = FindType(curContext, spec->name);
17029 DeclareType(symbol->type, 0x1, 0x1);
17030 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
17031 DeclareStruct(spec->name, 0x0);
17036 struct Enumerator * e;
17040 for(e = (*spec->list).first; e; e = e->next)
17043 ProcessExpressionType(e->exp);
17051 if(spec->definitions)
17053 struct ClassDef * def;
17054 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
17056 ProcessClass(spec->definitions, symbol);
17063 static void ProcessDeclarator(struct Declarator * decl)
17068 if(decl->identifier->classSym)
17070 FreeSpecifier(decl->identifier->_class);
17071 decl->identifier->_class = (((void *)0));
17075 if(decl->array.exp)
17076 ProcessExpressionType(decl->array.exp);
17083 if(decl->declarator)
17084 ProcessDeclarator(decl->declarator);
17085 if(decl->type == 4)
17087 struct Identifier * id = GetDeclId(decl);
17089 if(id && id->_class)
17091 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17093 if(!decl->function.parameters)
17094 decl->function.parameters = MkList();
17095 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
17096 id->_class = (((void *)0));
17098 if(decl->function.parameters)
17100 struct TypeName * param;
17102 for(param = (*decl->function.parameters).first; param; param = param->next)
17104 if(param->qualifiers && (*param->qualifiers).first)
17106 struct Specifier * spec = (*param->qualifiers).first;
17108 if(spec && spec->specifier == TYPED_OBJECT)
17110 struct Declarator * d = param->declarator;
17111 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);
17113 FreeList(param->qualifiers, FreeSpecifier);
17114 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17115 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17116 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
17119 else if(spec && spec->specifier == ANY_OBJECT)
17121 struct Declarator * d = param->declarator;
17123 FreeList(param->qualifiers, FreeSpecifier);
17124 param->qualifiers = MkListOne(MkSpecifier(VOID));
17125 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17127 else if(spec->specifier == THISCLASS)
17132 spec->name = ReplaceThisClass(thisClass);
17133 spec->symbol = FindClass(spec->name);
17134 ProcessSpecifier(spec, 0x0);
17138 if(param->declarator)
17139 ProcessDeclarator(param->declarator);
17147 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17149 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17151 static void ProcessDeclaration(struct Declaration * decl)
17153 yylloc = decl->loc;
17158 unsigned int declareStruct = 0x0;
17160 if(decl->declarators)
17162 struct InitDeclarator * d;
17164 for(d = (*decl->declarators).first; d; d = d->next)
17166 struct Type * type, * subType;
17168 ProcessDeclarator(d->declarator);
17169 type = ProcessType(decl->specifiers, d->declarator);
17172 ProcessInitializer(d->initializer, type);
17173 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17175 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17177 struct Instantiation * inst = d->initializer->exp->instance;
17179 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17180 d->initializer->exp->instance = (((void *)0));
17181 if(decl->specifiers)
17182 FreeList(decl->specifiers, FreeSpecifier);
17183 FreeList(decl->declarators, FreeInitDeclarator);
17190 for(subType = type; subType; )
17192 if(subType->kind == 8)
17194 declareStruct = 0x1;
17197 else if(subType->kind == 13)
17199 else if(subType->kind == 12)
17200 subType = subType->arrayType;
17209 if(decl->specifiers)
17211 struct Specifier * s;
17213 for(s = (*decl->specifiers).first; s; s = s->next)
17215 ProcessSpecifier(s, declareStruct);
17222 ProcessInstantiationType(decl->inst);
17227 struct Specifier * spec;
17228 struct Declarator * d;
17229 unsigned int declareStruct = 0x0;
17231 if(decl->declarators)
17233 for(d = (*decl->declarators).first; d; d = d->next)
17235 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17236 struct Type * subType;
17238 ProcessDeclarator(d);
17239 for(subType = type; subType; )
17241 if(subType->kind == 8)
17243 declareStruct = 0x1;
17246 else if(subType->kind == 13)
17248 else if(subType->kind == 12)
17249 subType = subType->arrayType;
17256 if(decl->specifiers)
17258 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17259 ProcessSpecifier(spec, declareStruct);
17266 static struct FunctionDefinition * curFunction;
17268 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17270 char propName[1024], propNameM[1024];
17271 char getName[1024], setName[1024];
17272 struct __ecereNameSpace__ecere__sys__OldList * args;
17274 DeclareProperty(prop, setName, getName);
17275 strcpy(propName, "__ecereProp_");
17276 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17277 strcat(propName, "_");
17278 FullClassNameCat(propName, prop->name, 0x1);
17279 MangleClassName(propName);
17280 strcpy(propNameM, "__ecerePropM_");
17281 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17282 strcat(propNameM, "_");
17283 FullClassNameCat(propNameM, prop->name, 0x1);
17284 MangleClassName(propNameM);
17285 if(prop->isWatchable)
17288 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17289 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17290 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17292 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17293 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17294 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17298 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17299 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17300 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17302 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17303 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17304 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17306 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17307 curFunction->propSet->fireWatchersDone = 0x1;
17310 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17312 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17314 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17316 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17318 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17320 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17322 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17324 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17326 static void ProcessStatement(struct Statement * stmt)
17328 yylloc = stmt->loc;
17332 ProcessStatement(stmt->labeled.stmt);
17335 if(stmt->caseStmt.exp)
17337 FreeType(stmt->caseStmt.exp->destType);
17338 stmt->caseStmt.exp->destType = curSwitchType;
17340 curSwitchType->refCount++;
17341 ProcessExpressionType(stmt->caseStmt.exp);
17342 ComputeExpression(stmt->caseStmt.exp);
17344 if(stmt->caseStmt.stmt)
17345 ProcessStatement(stmt->caseStmt.stmt);
17349 if(stmt->compound.context)
17351 struct Declaration * decl;
17352 struct Statement * s;
17353 struct Statement * prevCompound = curCompound;
17354 struct Context * prevContext = curContext;
17356 if(!stmt->compound.isSwitch)
17357 curCompound = stmt;
17358 curContext = stmt->compound.context;
17359 if(stmt->compound.declarations)
17361 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17362 ProcessDeclaration(decl);
17364 if(stmt->compound.statements)
17366 for(s = (*stmt->compound.statements).first; s; s = s->next)
17367 ProcessStatement(s);
17369 curContext = prevContext;
17370 curCompound = prevCompound;
17376 struct Expression * exp;
17378 if(stmt->expressions)
17380 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17381 ProcessExpressionType(exp);
17387 struct Expression * exp;
17389 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17390 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17391 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17392 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17394 ProcessExpressionType(exp);
17396 if(stmt->ifStmt.stmt)
17397 ProcessStatement(stmt->ifStmt.stmt);
17398 if(stmt->ifStmt.elseStmt)
17399 ProcessStatement(stmt->ifStmt.elseStmt);
17404 struct Type * oldSwitchType = curSwitchType;
17406 if(stmt->switchStmt.exp)
17408 struct Expression * exp;
17410 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17414 ProcessExpressionType(exp);
17417 curSwitchType = exp->expType;
17420 ProcessStatement(stmt->switchStmt.stmt);
17421 curSwitchType = oldSwitchType;
17426 if(stmt->whileStmt.exp)
17428 struct Expression * exp;
17430 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17431 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17432 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17433 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17435 ProcessExpressionType(exp);
17438 if(stmt->whileStmt.stmt)
17439 ProcessStatement(stmt->whileStmt.stmt);
17444 if(stmt->doWhile.exp)
17446 struct Expression * exp;
17448 if((*stmt->doWhile.exp).last)
17450 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17451 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17452 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17454 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17456 ProcessExpressionType(exp);
17459 if(stmt->doWhile.stmt)
17460 ProcessStatement(stmt->doWhile.stmt);
17465 struct Expression * exp;
17467 if(stmt->forStmt.init)
17468 ProcessStatement(stmt->forStmt.init);
17469 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17471 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17472 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17473 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17475 if(stmt->forStmt.check)
17476 ProcessStatement(stmt->forStmt.check);
17477 if(stmt->forStmt.increment)
17479 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17480 ProcessExpressionType(exp);
17482 if(stmt->forStmt.stmt)
17483 ProcessStatement(stmt->forStmt.stmt);
17488 struct Identifier * id = stmt->forEachStmt.id;
17489 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17490 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17491 struct Statement * block = stmt->forEachStmt.stmt;
17492 char iteratorType[1024];
17493 struct Type * source;
17494 struct Expression * e;
17495 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 35 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 35));
17496 struct Expression * arrayExp;
17497 char * typeString = (((void *)0));
17498 int builtinCount = 0;
17500 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17504 FreeType(e->destType);
17505 e->destType = ProcessTypeString("Container", 0x0);
17507 if(!isBuiltin || e->next)
17508 ProcessExpressionType(e);
17510 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17511 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17513 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17514 struct Symbol * symbol;
17515 struct Expression * expIt = (((void *)0));
17516 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17517 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17518 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17519 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17522 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17523 stmt->compound.context->parent = curContext;
17524 curContext = stmt->compound.context;
17525 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17527 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17528 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17530 isCustomAVLTree = 0x1;
17531 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17533 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17536 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17538 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17540 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17543 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17547 struct Declarator * decl;
17548 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17550 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17551 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17552 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17556 struct Type * type = (((void *)0));
17557 char typeStringBuf[1024];
17559 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17560 if(((struct Expression *)(*exp).last)->type == 11)
17562 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17565 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17567 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)
17569 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17571 typeString = templateClass->templateArgs[2].dataTypeString;
17573 else if(arrayExp->list)
17575 struct Expression * e;
17577 for(e = (*arrayExp->list).first; e; e = e->next)
17579 ProcessExpressionType(e);
17589 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17593 e->expType = (((void *)0));
17594 e = (*arrayExp->list).first;
17595 ProcessExpressionType(e);
17598 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17600 FreeType(e->expType);
17601 e->expType = (((void *)0));
17603 type = (((void *)0));
17611 FreeType(e->expType);
17612 e->expType = (((void *)0));
17618 typeStringBuf[0] = '\0';
17619 PrintType(type, typeStringBuf, 0x0, 0x1);
17620 typeString = typeStringBuf;
17626 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17627 struct Declarator * decl;
17628 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17632 struct Expression * e;
17634 builtinCount = (*arrayExp->list).count;
17635 type = ProcessTypeString(typeString, 0x0);
17636 while(e = (*arrayExp->list).first)
17638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17639 e->destType = type;
17641 ProcessExpressionType(e);
17642 ListAdd(initializers, MkInitializerAssignment(e));
17645 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17647 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17648 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17649 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17650 FreeList(exp, FreeExpression);
17654 arrayExp->expType = ProcessTypeString("Container", 0x0);
17655 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17658 else if(isLinkList && !isList)
17660 struct Declarator * decl;
17661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17663 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17664 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17665 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17667 else if(_class->templateArgs)
17670 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17672 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17673 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17675 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17678 switch(block->type)
17681 if(block->compound.context)
17682 block->compound.context->parent = stmt->compound.context;
17685 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17686 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17687 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17688 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17691 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17692 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17695 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17696 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17699 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17700 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17703 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17704 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17707 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17708 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17714 block = MkIfStmt(filter, block, (((void *)0)));
17718 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));
17719 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17720 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17721 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17727 sprintf(count, "%d", builtinCount);
17728 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));
17729 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17730 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17731 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17733 else if(isLinkList && !isList)
17735 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17736 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17738 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17740 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));
17744 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17745 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17747 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));
17749 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17750 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17751 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17755 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17757 ProcessExpressionType(expIt);
17758 if((*stmt->compound.declarations).first)
17759 ProcessDeclaration((*stmt->compound.declarations).first);
17761 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17762 ProcessStatement(stmt);
17763 curContext = stmt->compound.context->parent;
17768 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17780 struct Expression * exp;
17782 if(stmt->expressions)
17784 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17788 if(curFunction && !curFunction->type)
17789 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17790 FreeType(exp->destType);
17791 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17793 exp->destType->refCount++;
17795 ProcessExpressionType(exp);
17802 ProcessDeclaration(stmt->decl);
17807 struct AsmField * field;
17809 if(stmt->asmStmt.inputFields)
17811 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17812 if(field->expression)
17813 ProcessExpressionType(field->expression);
17815 if(stmt->asmStmt.outputFields)
17817 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17818 if(field->expression)
17819 ProcessExpressionType(field->expression);
17821 if(stmt->asmStmt.clobberedFields)
17823 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17825 if(field->expression)
17826 ProcessExpressionType(field->expression);
17833 struct PropertyWatch * propWatch;
17834 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17835 struct Expression * object = stmt->_watch.object;
17836 struct Expression * watcher = stmt->_watch.watcher;
17839 ProcessExpressionType(watcher);
17841 ProcessExpressionType(object);
17844 if(watcher || thisClass)
17846 struct External * external = curExternal;
17847 struct Context * context = curContext;
17850 stmt->expressions = MkList();
17851 curExternal = external->prev;
17852 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17854 struct ClassFunction * func;
17855 char watcherName[1024];
17856 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17857 struct External * createdExternal;
17858 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17861 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17862 if(propWatch->deleteWatch)
17863 strcat(watcherName, "_delete");
17866 struct Identifier * propID;
17868 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17870 strcat(watcherName, "_");
17871 strcat(watcherName, propID->string);
17874 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17876 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17877 ProcessClassFunctionBody(func, propWatch->compound);
17878 propWatch->compound = (((void *)0));
17879 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17880 createdExternal->symbol->idCode = external->symbol->idCode;
17881 curExternal = createdExternal;
17882 ProcessFunction(createdExternal->function);
17884 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17886 externalDecl->declaration = decl;
17887 if(decl->symbol && !decl->symbol->pointerExternal)
17888 decl->symbol->pointerExternal = externalDecl;
17890 if(propWatch->deleteWatch)
17892 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17894 ListAdd(args, CopyExpression(object));
17895 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17896 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17897 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17901 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17902 struct Identifier * propID;
17904 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17906 char propName[1024];
17907 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17911 char getName[1024], setName[1024];
17912 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17914 DeclareProperty(prop, setName, getName);
17915 strcpy(propName, "__ecereProp_");
17916 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17917 strcat(propName, "_");
17918 FullClassNameCat(propName, prop->name, 0x1);
17919 ListAdd(args, CopyExpression(object));
17920 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17921 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17922 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17923 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17926 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17933 curExternal = external;
17934 curContext = context;
17936 FreeExpression(watcher);
17938 FreeExpression(object);
17939 FreeList(watches, FreePropertyWatch);
17942 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17946 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17948 ProcessStatement(propWatch->compound);
17955 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17956 struct Expression * object = stmt->_watch.object;
17957 struct __ecereNameSpace__ecere__com__Class * _class;
17960 ProcessExpressionType(object);
17963 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17966 struct Identifier * propID;
17969 stmt->expressions = MkList();
17970 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17972 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17979 for(propID = (*watches).first; propID; propID = propID->next)
17981 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17985 CreateFireWatcher(prop, object, stmt);
17988 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17993 struct __ecereNameSpace__ecere__com__Property * prop;
17994 struct __ecereNameSpace__ecere__com__Class * base;
17996 for(base = _class; base; base = base->base)
17998 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18000 if(prop->isProperty && prop->isWatchable)
18002 CreateFireWatcher(prop, object, stmt);
18008 FreeExpression(object);
18009 FreeList(watches, FreeIdentifier);
18012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18018 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18019 struct Expression * object = stmt->_watch.object;
18020 struct Expression * watcher = stmt->_watch.watcher;
18021 struct __ecereNameSpace__ecere__com__Class * _class;
18024 ProcessExpressionType(object);
18026 ProcessExpressionType(watcher);
18029 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
18030 if(watcher || thisClass)
18034 struct Identifier * propID;
18037 stmt->expressions = MkList();
18040 struct __ecereNameSpace__ecere__sys__OldList * args;
18043 ListAdd(args, CopyExpression(object));
18044 ListAdd(args, MkExpConstant("0"));
18045 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18046 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18050 for(propID = (*watches).first; propID; propID = propID->next)
18052 char propName[1024];
18053 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18057 char getName[1024], setName[1024];
18058 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18060 DeclareProperty(prop, setName, getName);
18061 strcpy(propName, "__ecereProp_");
18062 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18063 strcat(propName, "_");
18064 FullClassNameCat(propName, prop->name, 0x1);
18065 MangleClassName(propName);
18066 ListAdd(args, CopyExpression(object));
18067 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18068 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18069 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18076 FreeExpression(object);
18078 FreeExpression(watcher);
18079 FreeList(watches, FreeIdentifier);
18082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18085 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18092 extern struct Expression * QBrackets(struct Expression * exp);
18094 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
18096 extern struct Declarator * QMkPtrDecl(char * id);
18098 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18100 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18102 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18104 static void ProcessFunction(struct FunctionDefinition * function)
18106 struct Identifier * id = GetDeclId(function->declarator);
18107 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18108 struct Type * type = symbol ? symbol->type : (((void *)0));
18109 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18110 struct Context * oldTopContext = topContext;
18112 yylloc = function->loc;
18113 if(type && type->thisClass)
18115 struct Symbol * classSym = type->thisClass;
18116 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
18117 char className[1024];
18118 char structName[1024];
18119 struct Declarator * funcDecl;
18120 struct Symbol * thisSymbol;
18121 unsigned int typedObject = 0x0;
18123 if(_class && !_class->base)
18125 _class = currentClass;
18126 if(_class && !_class->symbol)
18127 _class->symbol = FindClass(_class->fullName);
18128 classSym = _class ? _class->symbol : (((void *)0));
18131 thisClass = _class;
18132 if(inCompiler && _class)
18134 if(type->kind == 11)
18136 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
18138 struct Type * param = symbol->type->params.first;
18140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
18143 if(type->classObjectType != 1)
18145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
18146 symbol->type->staticMethod = 0x1;
18147 symbol->type->thisClass = (((void *)0));
18148 symbol->type->extraParam = 0x0;
18151 strcpy(className, "__ecereClass_");
18152 FullClassNameCat(className, _class->fullName, 0x1);
18153 MangleClassName(className);
18154 structName[0] = (char)0;
18155 FullClassNameCat(structName, _class->fullName, 0x0);
18156 funcDecl = GetFuncDecl(function->declarator);
18159 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18161 struct TypeName * param = (*funcDecl->function.parameters).first;
18163 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18165 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18166 FreeTypeName(param);
18169 if(!function->propertyNoThis)
18171 struct TypeName * thisParam;
18173 if(type->classObjectType != 1)
18175 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18176 if(!funcDecl->function.parameters)
18177 funcDecl->function.parameters = MkList();
18178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18182 if(type->classObjectType != 1)
18184 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18185 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18187 thisParam = __extension__ ({
18188 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18190 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18196 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18198 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18200 funcDecl = GetFuncDecl(initDecl->declarator);
18203 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18205 struct TypeName * param = (*funcDecl->function.parameters).first;
18207 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18209 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18210 FreeTypeName(param);
18213 if(type->classObjectType != 1)
18215 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18217 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18219 if(!funcDecl->function.parameters)
18220 funcDecl->function.parameters = MkList();
18221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18229 if(type->classObjectType != 1)
18231 thisSymbol = __extension__ ({
18232 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18234 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18236 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18237 if(typedObject && thisSymbol->type)
18239 thisSymbol->type->classObjectType = 2;
18240 thisSymbol->type->byReference = type->byReference;
18241 thisSymbol->type->typedByReference = type->byReference;
18245 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18247 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18250 struct __ecereNameSpace__ecere__com__Class * base;
18252 for(base = _class; base && base->type != 1000; base = base->next)
18254 for(member = base->membersAndProperties.first; member; member = member->next)
18255 if(!member->isProperty)
18261 for(member = _class->membersAndProperties.first; member; member = member->next)
18262 if(!member->isProperty)
18266 char pointerName[1024];
18267 struct Declaration * decl;
18268 struct Initializer * initializer;
18269 struct Expression * exp, * bytePtr;
18271 strcpy(pointerName, "__ecerePointer_");
18272 FullClassNameCat(pointerName, _class->fullName, 0x0);
18274 char className[1024];
18276 strcpy(className, "__ecereClass_");
18277 FullClassNameCat(className, classSym->string, 0x1);
18278 MangleClassName(className);
18279 DeclareClass(classSym, className);
18281 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18286 sprintf(string, "%d", _class->offset);
18287 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18291 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18293 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18294 exp->expType = __extension__ ({
18295 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18297 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18298 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18300 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18301 }), __ecereInstance2;
18305 yylloc = function->body->loc;
18306 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18308 struct Context * prevContext = curContext;
18310 curContext = function->body->compound.context;
18311 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18312 curContext = prevContext;
18314 decl->symbol = (((void *)0));
18315 if(!function->body->compound.declarations)
18316 function->body->compound.declarations = MkList();
18317 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18323 thisClass = (((void *)0));
18326 FreeSpecifier(id->_class);
18327 id->_class = (((void *)0));
18328 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18330 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18332 id = GetDeclId(initDecl->declarator);
18333 FreeSpecifier(id->_class);
18334 id->_class = (((void *)0));
18338 topContext = function->body->compound.context;
18340 struct FunctionDefinition * oldFunction = curFunction;
18342 curFunction = function;
18344 ProcessStatement(function->body);
18345 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18347 struct Statement * prevCompound = curCompound;
18348 struct Context * prevContext = curContext;
18349 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18351 if(!function->body->compound.statements)
18352 function->body->compound.statements = MkList();
18353 ListAdd(function->body->compound.statements, fireWatchers);
18354 curCompound = function->body;
18355 curContext = function->body->compound.context;
18356 ProcessStatement(fireWatchers);
18357 curContext = prevContext;
18358 curCompound = prevCompound;
18360 curFunction = oldFunction;
18362 if(function->declarator)
18364 ProcessDeclarator(function->declarator);
18366 topContext = oldTopContext;
18367 thisClass = oldThisClass;
18370 extern void FreeSymbol(struct Symbol * symbol);
18372 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18374 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18376 struct ClassDef * def;
18377 struct External * external = curExternal;
18378 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18380 for(def = definitions->first; def; def = def->next)
18384 if(def->function->declarator)
18385 curExternal = def->function->declarator->symbol->pointerExternal;
18387 curExternal = external;
18388 ProcessFunction((struct FunctionDefinition *)def->function);
18390 else if(def->type == 2)
18392 if(def->decl->type == 2)
18394 thisClass = regClass;
18395 ProcessInstantiationType(def->decl->inst);
18396 thisClass = (((void *)0));
18400 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18403 thisClass = regClass;
18404 ProcessDeclaration(def->decl);
18405 thisClass = backThisClass;
18408 else if(def->type == 1 && def->defProperties)
18410 struct MemberInit * defProperty;
18411 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);
18413 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18414 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18416 thisClass = regClass;
18417 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18418 thisClass = (((void *)0));
18420 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18421 FreeSymbol(thisSymbol);
18423 else if(def->type == 3 && def->propertyDef)
18425 struct PropertyDef * prop = def->propertyDef;
18427 thisClass = regClass;
18432 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18434 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18436 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18437 ProcessStatement(prop->setStmt);
18443 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18445 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18447 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18448 ProcessStatement(prop->getStmt);
18450 if(prop->issetStmt)
18454 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18456 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18458 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18459 ProcessStatement(prop->issetStmt);
18461 thisClass = (((void *)0));
18463 else if(def->type == 4 && def->propertyWatch)
18465 struct PropertyWatch * propertyWatch = def->propertyWatch;
18467 thisClass = regClass;
18468 if(propertyWatch->compound)
18470 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);
18472 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18473 curExternal = (((void *)0));
18474 ProcessStatement(propertyWatch->compound);
18476 thisClass = (((void *)0));
18481 void DeclareFunctionUtil(char * s)
18483 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18490 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18491 strcpy(name, "__ecereFunction_");
18492 FullClassNameCat(name, s, 0x0);
18493 DeclareFunction(function, name);
18497 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18499 void ComputeDataTypes()
18501 struct External * external;
18502 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18503 struct External * after = (((void *)0));
18505 currentClass = (((void *)0));
18506 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18507 for(external = (*ast).first; external; external = external->next)
18509 if(external->type == 1)
18511 struct Declaration * decl = external->declaration;
18515 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18519 struct InitDeclarator * initDecl = (*decls).first;
18523 struct Declarator * declarator = initDecl->declarator;
18525 if(declarator && declarator->type == 1)
18527 struct Identifier * id = declarator->identifier;
18529 if(id && id->string)
18531 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18533 external->symbol->id = -1001, external->symbol->idCode = -1001;
18543 temp->symbol = __extension__ ({
18544 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18546 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18549 curExternal = temp;
18550 DeclareFunctionUtil("eSystem_New");
18551 DeclareFunctionUtil("eSystem_New0");
18552 DeclareFunctionUtil("eSystem_Renew");
18553 DeclareFunctionUtil("eSystem_Renew0");
18554 DeclareFunctionUtil("eSystem_Delete");
18555 DeclareFunctionUtil("eClass_GetProperty");
18556 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18557 DeclareStruct("ecere::com::Class", 0x0);
18558 DeclareStruct("ecere::com::Instance", 0x0);
18559 DeclareStruct("ecere::com::Property", 0x0);
18560 DeclareStruct("ecere::com::DataMember", 0x0);
18561 DeclareStruct("ecere::com::Method", 0x0);
18562 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18563 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18564 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18565 for(external = (*ast).first; external; external = external->next)
18567 afterExternal = curExternal = external;
18568 if(external->type == 0)
18570 currentClass = external->function->_class;
18571 ProcessFunction(external->function);
18573 else if(external->type == 1)
18575 currentClass = (((void *)0));
18576 if(external->declaration)
18577 ProcessDeclaration(external->declaration);
18579 else if(external->type == 2)
18581 struct ClassDefinition * _class = external->_class;
18583 currentClass = external->symbol->registered;
18584 if(_class->definitions)
18586 ProcessClass(_class->definitions, _class->symbol);
18590 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18591 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18594 else if(external->type == 4)
18596 thisNameSpace = external->id->string;
18599 currentClass = (((void *)0));
18600 thisNameSpace = (((void *)0));
18601 curExternal = (((void *)0));
18602 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18603 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18606 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);
18608 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);
18610 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18612 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18614 struct __ecereNameSpace__ecere__com__Class * class;
18616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18640 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18650 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18651 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18652 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18653 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18654 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18656 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18657 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18658 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18659 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18660 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18661 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18663 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18664 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18665 __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);
18666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18669 __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);
18670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18677 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18681 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18682 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18683 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18684 __ecereClass_Conversion = class;
18685 __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);
18686 __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);
18687 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18688 __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);
18689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18694 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18695 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18696 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18698 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18700 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18709 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18712 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)