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 } __attribute__ ((gcc_struct));
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
359 struct __ecereNameSpace__ecere__com__DataValue
374 } __attribute__ ((gcc_struct));
375 } __attribute__ ((gcc_struct));
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
381 struct Expression * prev;
382 struct Expression * next;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct));
392 struct Statement * compound;
393 struct Instantiation * instance;
397 unsigned int intlString;
398 } __attribute__ ((gcc_struct));
399 struct __ecereNameSpace__ecere__sys__OldList * list;
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
422 struct Expression * exp;
423 struct Identifier * member;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct));
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 } __attribute__ ((gcc_struct));
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
495 struct TemplateDatatype
497 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
498 struct Declarator * decl;
499 } __attribute__ ((gcc_struct));
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
503 struct TemplateArgument;
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
507 struct TemplateParameter
509 struct TemplateParameter * prev;
510 struct TemplateParameter * next;
513 struct Identifier * identifier;
516 struct TemplateDatatype * dataType;
518 } __attribute__ ((gcc_struct));
519 struct TemplateArgument * defaultArgument;
520 char * dataTypeString;
521 struct Type * baseType;
522 } __attribute__ ((gcc_struct));
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
528 struct Specifier * prev;
529 struct Specifier * next;
537 struct ExtDecl * extDecl;
539 struct Symbol * symbol;
540 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
541 } __attribute__ ((gcc_struct));
544 struct Identifier * id;
545 struct __ecereNameSpace__ecere__sys__OldList * list;
546 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
547 struct __ecereNameSpace__ecere__sys__OldList * definitions;
548 unsigned int addNameSpace;
549 struct Context * ctx;
550 struct ExtDecl * extDeclStruct;
551 } __attribute__ ((gcc_struct));
552 struct Expression * expression;
553 struct Specifier * _class;
554 struct TemplateParameter * templateParameter;
555 } __attribute__ ((gcc_struct));
556 } __attribute__ ((gcc_struct));
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
562 struct Identifier * prev;
563 struct Identifier * next;
565 struct Symbol * classSym;
566 struct Specifier * _class;
568 struct Identifier * badID;
569 } __attribute__ ((gcc_struct));
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
579 struct Declarator * prev;
580 struct Declarator * next;
583 struct Symbol * symbol;
584 struct Declarator * declarator;
587 struct Identifier * identifier;
590 struct Expression * exp;
591 struct Expression * posExp;
592 struct Attrib * attrib;
593 } __attribute__ ((gcc_struct)) structDecl;
596 struct Expression * exp;
597 struct Specifier * enumClass;
598 } __attribute__ ((gcc_struct)) array;
601 struct __ecereNameSpace__ecere__sys__OldList * parameters;
602 } __attribute__ ((gcc_struct)) function;
605 struct Pointer * pointer;
606 } __attribute__ ((gcc_struct)) pointer;
609 struct ExtDecl * extended;
610 } __attribute__ ((gcc_struct)) extended;
611 } __attribute__ ((gcc_struct));
612 } __attribute__ ((gcc_struct));
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
616 struct FunctionDefinition
618 struct FunctionDefinition * prev;
619 struct FunctionDefinition * next;
621 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
622 struct Declarator * declarator;
623 struct __ecereNameSpace__ecere__sys__OldList * declarations;
624 struct Statement * body;
625 struct __ecereNameSpace__ecere__com__Class * _class;
626 struct __ecereNameSpace__ecere__sys__OldList attached;
629 struct Symbol * propSet;
631 unsigned int propertyNoThis;
632 } __attribute__ ((gcc_struct));
634 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
642 struct External * prev;
643 struct External * next;
646 struct Symbol * symbol;
649 struct FunctionDefinition * function;
650 struct ClassDefinition * _class;
651 struct Declaration * declaration;
653 struct Identifier * id;
654 struct DBTableDef * table;
655 } __attribute__ ((gcc_struct));
657 } __attribute__ ((gcc_struct));
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
663 struct ModuleImport * prev;
664 struct ModuleImport * next;
666 struct __ecereNameSpace__ecere__sys__OldList classes;
667 struct __ecereNameSpace__ecere__sys__OldList functions;
670 } __attribute__ ((gcc_struct));
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
676 struct ClassImport * prev;
677 struct ClassImport * next;
679 struct __ecereNameSpace__ecere__sys__OldList methods;
680 struct __ecereNameSpace__ecere__sys__OldList properties;
682 unsigned int isRemote;
683 } __attribute__ ((gcc_struct));
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
690 struct Symbol * parent;
691 struct Symbol * left;
692 struct Symbol * right;
697 struct __ecereNameSpace__ecere__com__Method * method;
698 struct __ecereNameSpace__ecere__com__Property * _property;
699 struct __ecereNameSpace__ecere__com__Class * registered;
700 } __attribute__ ((gcc_struct));
707 struct External * pointerExternal;
708 struct External * structExternal;
709 } __attribute__ ((gcc_struct));
712 struct External * externalGet;
713 struct External * externalSet;
714 struct External * externalPtr;
715 struct External * externalIsSet;
716 } __attribute__ ((gcc_struct));
719 struct External * methodExternal;
720 struct External * methodCodeExternal;
721 } __attribute__ ((gcc_struct));
722 } __attribute__ ((gcc_struct));
723 unsigned int imported;
724 unsigned int declaredStructSym;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 unsigned int declaredStruct;
727 unsigned int needConstructor;
728 unsigned int needDestructor;
729 char * constructorName;
732 char * destructorName;
733 struct ModuleImport * module;
734 struct ClassImport * _import;
735 struct Location nameLoc;
736 unsigned int isParam;
737 unsigned int isRemote;
738 unsigned int isStruct;
739 unsigned int fireWatchersDone;
741 unsigned int classData;
742 unsigned int isStatic;
744 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
745 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
746 struct Context * ctx;
748 struct Expression * propCategory;
749 } __attribute__ ((gcc_struct));
751 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
760 struct Symbol * _class;
763 struct __ecereNameSpace__ecere__sys__OldList members;
765 } __attribute__ ((gcc_struct));
768 struct Type * returnType;
769 struct __ecereNameSpace__ecere__sys__OldList params;
770 struct Symbol * thisClass;
771 unsigned int staticMethod;
772 struct TemplateParameter * thisClassTemplate;
773 } __attribute__ ((gcc_struct));
776 struct __ecereNameSpace__ecere__com__Method * method;
777 struct __ecereNameSpace__ecere__com__Class * methodClass;
778 struct __ecereNameSpace__ecere__com__Class * usedClass;
779 } __attribute__ ((gcc_struct));
782 struct Type * arrayType;
784 struct Expression * arraySizeExp;
785 unsigned int freeExp;
786 struct Symbol * enumClass;
787 } __attribute__ ((gcc_struct));
789 struct TemplateParameter * templateParameter;
790 } __attribute__ ((gcc_struct));
800 unsigned int isSigned : 1;
801 unsigned int constant : 1;
802 unsigned int truth : 1;
803 unsigned int byReference : 1;
804 unsigned int extraParam : 1;
805 unsigned int directClassAccess : 1;
806 unsigned int computing : 1;
807 unsigned int keepCast : 1;
808 unsigned int passAsTemplate : 1;
809 unsigned int dllExport : 1;
810 unsigned int attrStdcall : 1;
811 unsigned int declaredWithStruct : 1;
812 unsigned int typedByReference : 1;
813 } __attribute__ ((gcc_struct));
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
817 struct __ecereNameSpace__ecere__com__Class
819 struct __ecereNameSpace__ecere__com__Class * prev;
820 struct __ecereNameSpace__ecere__com__Class * next;
826 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
827 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
830 struct __ecereNameSpace__ecere__com__Class * base;
831 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
832 struct __ecereNameSpace__ecere__sys__BinaryTree members;
833 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
834 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
835 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
836 struct __ecereNameSpace__ecere__sys__OldList derivatives;
840 struct __ecereNameSpace__ecere__com__Instance * module;
841 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
842 char * dataTypeString;
843 struct Type * dataType;
845 int defaultAlignment;
846 void (* Initialize)();
848 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
849 char * designerClass;
850 unsigned int noExpansion;
851 char * defaultProperty;
852 unsigned int comRedefinition;
854 unsigned int isRemote;
855 unsigned int internalDecl;
857 unsigned int computeSize;
859 int destructionWatchOffset;
861 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
862 int inheritanceAccess;
865 struct __ecereNameSpace__ecere__sys__OldList conversions;
866 struct __ecereNameSpace__ecere__sys__OldList templateParams;
867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
868 struct __ecereNameSpace__ecere__com__Class * templateClass;
869 struct __ecereNameSpace__ecere__sys__OldList templatized;
871 unsigned int isInstanceClass;
872 unsigned int byValueSystemClass;
873 } __attribute__ ((gcc_struct));
875 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
877 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
879 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
881 struct __ecereNameSpace__ecere__com__Instance
884 struct __ecereNameSpace__ecere__com__Class * _class;
886 } __attribute__ ((gcc_struct));
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
890 struct __ecereNameSpace__ecere__com__DataMember
892 struct __ecereNameSpace__ecere__com__DataMember * prev;
893 struct __ecereNameSpace__ecere__com__DataMember * next;
895 unsigned int isProperty;
898 struct __ecereNameSpace__ecere__com__Class * _class;
899 char * dataTypeString;
900 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
901 struct Type * dataType;
905 struct __ecereNameSpace__ecere__sys__OldList members;
906 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
909 } __attribute__ ((gcc_struct));
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
913 struct __ecereNameSpace__ecere__com__SerialBuffer
915 unsigned char * _buffer;
919 } __attribute__ ((gcc_struct));
921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
929 char * dataTypeString;
930 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
931 } __attribute__ ((gcc_struct));
932 struct __ecereNameSpace__ecere__com__DataValue expression;
938 struct __ecereNameSpace__ecere__com__DataMember * member;
939 struct __ecereNameSpace__ecere__com__Property * prop;
940 struct __ecereNameSpace__ecere__com__Method * method;
941 } __attribute__ ((gcc_struct));
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
946 void exit(int status);
948 void * calloc(size_t nmemb, size_t size);
950 void free(void * ptr);
952 void * malloc(size_t size);
954 void * realloc(void * ptr, size_t size);
956 long int strtol(const char * nptr, char ** endptr, int base);
958 long long int strtoll(const char * nptr, char ** endptr, int base);
960 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
964 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
967 typedef union YYSTYPE
972 struct Identifier * id;
973 struct Expression * exp;
974 struct Specifier * specifier;
975 struct __ecereNameSpace__ecere__sys__OldList * list;
976 struct Enumerator * enumerator;
977 struct Declarator * declarator;
978 struct Pointer * pointer;
979 struct Initializer * initializer;
980 struct InitDeclarator * initDeclarator;
981 struct TypeName * typeName;
982 struct Declaration * declaration;
983 struct Statement * stmt;
984 struct FunctionDefinition * function;
985 struct External * external;
986 struct Context * context;
987 struct AsmField * asmField;
988 struct Attrib * attrib;
989 struct ExtDecl * extDecl;
990 struct Attribute * attribute;
991 struct Instantiation * instance;
992 struct MembersInit * membersInit;
993 struct MemberInit * memberInit;
994 struct ClassFunction * classFunction;
995 struct ClassDefinition * _class;
996 struct ClassDef * classDef;
997 struct PropertyDef * prop;
999 struct Symbol * symbol;
1000 struct PropertyWatch * propertyWatch;
1001 struct TemplateParameter * templateParameter;
1002 struct TemplateArgument * templateArgument;
1003 struct TemplateDatatype * templateDatatype;
1004 struct DBTableEntry * dbtableEntry;
1005 struct DBIndexItem * dbindexItem;
1006 struct DBTableDef * dbtableDef;
1007 } __attribute__ ((gcc_struct)) YYSTYPE;
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1013 struct Enumerator * prev;
1014 struct Enumerator * next;
1015 struct Location loc;
1016 struct Identifier * id;
1017 struct Expression * exp;
1018 } __attribute__ ((gcc_struct));
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1022 struct InitDeclarator
1024 struct InitDeclarator * prev;
1025 struct InitDeclarator * next;
1026 struct Location loc;
1027 struct Declarator * declarator;
1028 struct Initializer * initializer;
1029 } __attribute__ ((gcc_struct));
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1035 struct AsmField * prev;
1036 struct AsmField * next;
1037 struct Location loc;
1039 struct Expression * expression;
1040 struct Identifier * symbolic;
1041 } __attribute__ ((gcc_struct));
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1049 struct ClassFunction
1051 struct ClassFunction * prev;
1052 struct ClassFunction * next;
1053 struct Location loc;
1054 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1055 struct Declarator * declarator;
1056 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1057 struct Statement * body;
1058 struct __ecereNameSpace__ecere__com__Class * _class;
1059 struct __ecereNameSpace__ecere__sys__OldList attached;
1062 struct Symbol * propSet;
1063 unsigned int isVirtual;
1064 unsigned int isConstructor;
1065 unsigned int isDestructor;
1066 unsigned int dontMangle;
1069 } __attribute__ ((gcc_struct));
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1075 struct MembersInit * prev;
1076 struct MembersInit * next;
1077 struct Location loc;
1081 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1082 struct ClassFunction * function;
1083 } __attribute__ ((gcc_struct));
1084 } __attribute__ ((gcc_struct));
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1090 struct MemberInit * prev;
1091 struct MemberInit * next;
1092 struct Location loc;
1093 struct Location realLoc;
1094 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1095 struct Initializer * initializer;
1097 unsigned int variable;
1098 unsigned int takeOutExp;
1099 } __attribute__ ((gcc_struct));
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1105 struct PropertyDef * prev;
1106 struct PropertyDef * next;
1107 struct Location loc;
1108 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1109 struct Declarator * declarator;
1110 struct Identifier * id;
1111 struct Statement * getStmt;
1112 struct Statement * setStmt;
1113 struct Statement * issetStmt;
1114 struct Symbol * symbol;
1115 struct Expression * category;
1118 unsigned int conversion : 1;
1119 unsigned int isWatchable : 1;
1120 unsigned int isDBProp : 1;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1126 struct PropertyWatch
1128 struct PropertyWatch * prev;
1129 struct PropertyWatch * next;
1130 struct Location loc;
1131 struct Statement * compound;
1132 struct __ecereNameSpace__ecere__sys__OldList * properties;
1133 unsigned int deleteWatch;
1134 } __attribute__ ((gcc_struct));
1136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1140 struct ClassDef * prev;
1141 struct ClassDef * next;
1142 struct Location loc;
1146 struct Declaration * decl;
1147 struct ClassFunction * function;
1148 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1149 struct PropertyDef * propertyDef;
1150 struct PropertyWatch * propertyWatch;
1152 struct Identifier * defaultProperty;
1155 struct Identifier * id;
1156 struct Initializer * initializer;
1157 } __attribute__ ((gcc_struct));
1158 } __attribute__ ((gcc_struct));
1161 } __attribute__ ((gcc_struct));
1163 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1165 struct DBTableEntry;
1167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1171 extern YYSTYPE yylval;
1173 extern struct Location yylloc;
1175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1177 extern int returnCode;
1179 extern struct Expression * parsedExpression;
1181 extern unsigned int yydebug;
1183 void SetYydebug(unsigned int b)
1188 extern unsigned int echoOn;
1190 void resetScanner();
1194 int expression_yyparse();
1196 static struct Statement * curCompound;
1198 struct External * curExternal, * afterExternal;
1200 static struct Type * curSwitchType;
1202 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1204 struct __ecereNameSpace__ecere__com__Class * thisClass;
1206 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1211 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1216 static char * thisNameSpace;
1218 struct __ecereNameSpace__ecere__com__Class * containerClass;
1220 unsigned int thisClassParams = 0x1;
1222 unsigned int internalValueCounter;
1224 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1226 extern size_t strlen(const char * );
1228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1230 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1232 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1234 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1236 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1238 void PrintExpression(struct Expression * exp, char * string)
1241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1245 OutputExpression(exp, f);
1246 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1247 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1249 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1250 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1251 count = strlen(string);
1252 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__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_Read])(f, string + count, 1, 1023);
1257 string[count] = '\0';
1258 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1262 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1264 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1266 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1268 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1270 if(!param->baseType)
1272 if(param->dataTypeString)
1273 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1275 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1277 return param->baseType;
1279 return (((void *)0));
1282 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1284 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1286 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1290 if(type1->kind == type2->kind)
1301 if(type1->passAsTemplate && !type2->passAsTemplate)
1303 return type1->isSigned != type2->isSigned;
1305 return type1->_class != type2->_class;
1307 return NeedCast(type1->type, type2->type);
1315 extern int strcmp(const char * , const char * );
1317 extern struct Context * curContext;
1319 extern struct Context * topContext;
1321 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1323 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);
1325 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1327 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);
1329 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);
1331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1333 struct __ecereNameSpace__ecere__com__ClassProperty
1336 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1337 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1338 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1340 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1341 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1342 char * dataTypeString;
1343 struct Type * dataType;
1344 unsigned int constant;
1345 } __attribute__ ((gcc_struct));
1347 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1349 extern struct Expression * QMkExpId(char * id);
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1355 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1356 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1361 char * dataTypeString;
1363 } __attribute__ ((gcc_struct));
1364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1366 } __attribute__ ((gcc_struct));
1368 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1370 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1372 extern void FreeIdentifier(struct Identifier * id);
1374 void ProcessExpressionType(struct Expression * exp);
1376 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1378 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1380 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1382 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1384 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1386 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1388 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1390 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1392 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1394 if(exp->type == 0 && exp->identifier)
1396 struct Identifier * id = exp->identifier;
1397 struct Context * ctx;
1398 struct Symbol * symbol = (((void *)0));
1400 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1402 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1404 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1409 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1412 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1413 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1418 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1420 if(!prop && !method)
1421 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1422 if(!prop && !method && !member)
1424 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1426 if(prop || method || member || classProp)
1429 exp->member.member = id;
1430 exp->member.memberType = 0;
1431 exp->member.exp = QMkExpId("this");
1432 exp->addedThis = 0x1;
1434 else if(_class && _class->templateParams.first)
1436 struct __ecereNameSpace__ecere__com__Class * sClass;
1438 for(sClass = _class; sClass; sClass = sClass->base)
1440 if(sClass->templateParams.first)
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1444 for(param = sClass->templateParams.first; param; param = param->next)
1446 if(param->type == 2 && !strcmp(param->name, id->string))
1448 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1452 struct Declarator * decl;
1453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1455 FreeIdentifier(exp->member.member);
1456 ProcessExpressionType(argExp);
1457 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1458 exp->expType = ProcessType(specs, decl);
1460 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1471 extern int sprintf(char * , char * , ...);
1473 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1475 extern char * strcat(char * , const char * );
1477 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1479 char * PrintInt(long long result)
1483 if(result > (((int)0x7fffffff)))
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1487 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1489 return __ecereNameSpace__ecere__sys__CopyString(temp);
1492 char * PrintUInt(uint64 result)
1496 if(result > (0xffffffff))
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1498 else if(result > (((int)0x7fffffff)))
1499 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1502 return __ecereNameSpace__ecere__sys__CopyString(temp);
1505 char * PrintInt64(long long result)
1509 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1510 return __ecereNameSpace__ecere__sys__CopyString(temp);
1513 char * PrintUInt64(uint64 result)
1517 if(result > (((long long)0x7fffffffffffffffLL)))
1518 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1521 return __ecereNameSpace__ecere__sys__CopyString(temp);
1524 char * PrintHexUInt(uint64 result)
1528 if(result > (0xffffffff))
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1532 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 char * PrintHexUInt64(uint64 result)
1539 if(result > (0xffffffff))
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1543 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 char * PrintShort(short result)
1550 sprintf(temp, "%d", (unsigned short)result);
1551 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 char * PrintUShort(unsigned short result)
1558 if(result > (unsigned short)32767)
1559 sprintf(temp, "0x%X", (int)result);
1561 sprintf(temp, "%d", (int)result);
1562 return __ecereNameSpace__ecere__sys__CopyString(temp);
1565 extern int isprint(int c);
1567 char * PrintChar(char result)
1571 if(result > (char)0 && isprint(result))
1572 sprintf(temp, "'%c'", result);
1573 else if(result < (char)0)
1574 sprintf(temp, "%d", (int)result);
1576 sprintf(temp, "0x%X", (unsigned char)result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 char * PrintUChar(unsigned char result)
1584 sprintf(temp, "0x%X", result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 extern char * strcpy(char * , const char * );
1590 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1592 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1594 extern int (* __ecereProp_float_Get_signBit)(float this);
1596 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1598 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1600 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1602 char * PrintFloat(float result)
1606 if(__ecereProp_float_Get_isInf(result))
1608 if(__ecereProp_float_Get_signBit(result))
1609 strcpy(temp, "-inf");
1611 strcpy(temp, "inf");
1613 else if(__ecereProp_float_Get_isNan(result))
1615 if(__ecereProp_float_Get_signBit(result))
1616 strcpy(temp, "-nan");
1618 strcpy(temp, "nan");
1621 sprintf(temp, "%.16ff", result);
1622 return __ecereNameSpace__ecere__sys__CopyString(temp);
1625 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1627 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1629 extern int (* __ecereProp_double_Get_signBit)(double this);
1631 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1633 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1635 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1637 char * PrintDouble(double result)
1641 if(__ecereProp_double_Get_isInf(result))
1643 if(__ecereProp_double_Get_signBit(result))
1644 strcpy(temp, "-inf");
1646 strcpy(temp, "inf");
1648 else if(__ecereProp_double_Get_isNan(result))
1650 if(__ecereProp_double_Get_signBit(result))
1651 strcpy(temp, "-nan");
1653 strcpy(temp, "nan");
1656 sprintf(temp, "%.16f", result);
1657 return __ecereNameSpace__ecere__sys__CopyString(temp);
1660 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1664 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* Neg)(struct Expression *, struct Operand *);
1670 unsigned int (* Inc)(struct Expression *, struct Operand *);
1671 unsigned int (* Dec)(struct Expression *, struct Operand *);
1672 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1684 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* Not)(struct Expression *, struct Operand *);
1690 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1699 } __attribute__ ((gcc_struct));
1701 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1707 unsigned int ptrSize;
1720 } __attribute__ ((gcc_struct));
1722 } __attribute__ ((gcc_struct));
1724 unsigned int GetOpInt(struct Operand * op2, int * value2)
1726 if(op2->kind == 3 && op2->type->isSigned)
1728 else if(op2->kind == 3)
1729 *value2 = (int)op2->ui;
1730 else if(op2->kind == 4 && op2->type->isSigned)
1731 *value2 = (int)op2->i64;
1732 else if(op2->kind == 4)
1733 *value2 = (int)op2->ui64;
1734 else if(op2->kind == 23 && op2->type->isSigned)
1735 *value2 = (int)op2->i64;
1736 else if(op2->kind == 23)
1737 *value2 = (int)op2->ui64;
1738 else if(op2->kind == 22 && op2->type->isSigned)
1739 *value2 = (int)op2->i64;
1740 else if(op2->kind == 22)
1741 *value2 = (int)op2->ui64;
1742 else if(op2->kind == 2 && op2->type->isSigned)
1743 *value2 = (int)op2->s;
1744 else if(op2->kind == 2)
1745 *value2 = (int)op2->us;
1746 else if(op2->kind == 1 && op2->type->isSigned)
1747 *value2 = (int)op2->c;
1748 else if(op2->kind == 24 || op2->kind == 1)
1749 *value2 = (int)op2->uc;
1750 else if(op2->kind == 6)
1751 *value2 = (int)op2->f;
1752 else if(op2->kind == 7)
1753 *value2 = (int)op2->d;
1754 else if(op2->kind == 13)
1755 *value2 = (int)op2->ui64;
1761 struct Operand GetOperand(struct Expression * exp);
1763 unsigned int GetInt(struct Expression * exp, int * value2)
1765 struct Operand op2 = GetOperand(exp);
1767 return GetOpInt(&op2, value2);
1770 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1772 if(op2->kind == 3 && op2->type->isSigned)
1773 *value2 = (unsigned int)op2->i;
1774 else if(op2->kind == 3)
1776 else if(op2->kind == 4 && op2->type->isSigned)
1777 *value2 = (unsigned int)op2->i64;
1778 else if(op2->kind == 4)
1779 *value2 = (unsigned int)op2->ui64;
1780 else if(op2->kind == 23 && op2->type->isSigned)
1781 *value2 = (unsigned int)op2->i64;
1782 else if(op2->kind == 23)
1783 *value2 = (unsigned int)op2->ui64;
1784 else if(op2->kind == 22 && op2->type->isSigned)
1785 *value2 = (unsigned int)op2->i64;
1786 else if(op2->kind == 22)
1787 *value2 = (unsigned int)op2->ui64;
1788 else if(op2->kind == 2 && op2->type->isSigned)
1789 *value2 = (unsigned int)op2->s;
1790 else if(op2->kind == 2)
1791 *value2 = (unsigned int)op2->us;
1792 else if(op2->kind == 1 && op2->type->isSigned)
1793 *value2 = (unsigned int)op2->c;
1794 else if(op2->kind == 24 || op2->kind == 1)
1795 *value2 = (unsigned int)op2->uc;
1796 else if(op2->kind == 6)
1797 *value2 = (unsigned int)op2->f;
1798 else if(op2->kind == 7)
1799 *value2 = (unsigned int)op2->d;
1800 else if(op2->kind == 13)
1801 *value2 = (unsigned int)op2->ui64;
1807 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1809 struct Operand op2 = GetOperand(exp);
1811 return GetOpUInt(&op2, value2);
1814 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1816 if(op2->kind == 3 && op2->type->isSigned)
1817 *value2 = (long long)op2->i;
1818 else if(op2->kind == 3)
1819 *value2 = (long long)op2->ui;
1820 else if(op2->kind == 4 && op2->type->isSigned)
1822 else if(op2->kind == 4)
1823 *value2 = (long long)op2->ui64;
1824 else if(op2->kind == 23 && op2->type->isSigned)
1826 else if(op2->kind == 23)
1827 *value2 = (long long)op2->ui64;
1828 else if(op2->kind == 22 && op2->type->isSigned)
1830 else if(op2->kind == 22)
1831 *value2 = (long long)op2->ui64;
1832 else if(op2->kind == 2 && op2->type->isSigned)
1833 *value2 = (long long)op2->s;
1834 else if(op2->kind == 2)
1835 *value2 = (long long)op2->us;
1836 else if(op2->kind == 1 && op2->type->isSigned)
1837 *value2 = (long long)op2->c;
1838 else if(op2->kind == 24 || op2->kind == 1)
1839 *value2 = (long long)op2->uc;
1840 else if(op2->kind == 6)
1841 *value2 = (long long)op2->f;
1842 else if(op2->kind == 7)
1843 *value2 = (long long)op2->d;
1844 else if(op2->kind == 13)
1845 *value2 = (long long)op2->ui64;
1851 unsigned int GetInt64(struct Expression * exp, long long * value2)
1853 struct Operand op2 = GetOperand(exp);
1855 return GetOpInt64(&op2, value2);
1858 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1860 if(op2->kind == 3 && op2->type->isSigned)
1861 *value2 = (uint64)op2->i;
1862 else if(op2->kind == 3)
1863 *value2 = (uint64)op2->ui;
1864 else if(op2->kind == 4 && op2->type->isSigned)
1865 *value2 = (uint64)op2->i64;
1866 else if(op2->kind == 4)
1867 *value2 = op2->ui64;
1868 else if(op2->kind == 23 && op2->type->isSigned)
1869 *value2 = (uint64)op2->i64;
1870 else if(op2->kind == 23)
1871 *value2 = op2->ui64;
1872 else if(op2->kind == 22 && op2->type->isSigned)
1873 *value2 = (uint64)op2->i64;
1874 else if(op2->kind == 22)
1875 *value2 = op2->ui64;
1876 else if(op2->kind == 2 && op2->type->isSigned)
1877 *value2 = (uint64)op2->s;
1878 else if(op2->kind == 2)
1879 *value2 = (uint64)op2->us;
1880 else if(op2->kind == 1 && op2->type->isSigned)
1881 *value2 = (uint64)op2->c;
1882 else if(op2->kind == 24 || op2->kind == 1)
1883 *value2 = (uint64)op2->uc;
1884 else if(op2->kind == 6)
1885 *value2 = (uint64)op2->f;
1886 else if(op2->kind == 7)
1887 *value2 = (uint64)op2->d;
1888 else if(op2->kind == 13)
1889 *value2 = op2->ui64;
1895 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1897 struct Operand op2 = GetOperand(exp);
1899 return GetOpUInt64(&op2, value2);
1902 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1904 if(op2->kind == 3 && op2->type->isSigned)
1905 *value2 = (intptr_t)op2->i;
1906 else if(op2->kind == 3)
1907 *value2 = (intptr_t)op2->ui;
1908 else if(op2->kind == 4 && op2->type->isSigned)
1909 *value2 = (intptr_t)op2->i64;
1910 else if(op2->kind == 4)
1911 *value2 = (intptr_t)op2->ui64;
1912 else if(op2->kind == 23 && op2->type->isSigned)
1913 *value2 = (intptr_t)op2->i64;
1914 else if(op2->kind == 23)
1915 *value2 = (intptr_t)op2->ui64;
1916 else if(op2->kind == 22 && op2->type->isSigned)
1917 *value2 = (intptr_t)op2->i64;
1918 else if(op2->kind == 22)
1919 *value2 = (intptr_t)op2->ui64;
1920 else if(op2->kind == 2 && op2->type->isSigned)
1921 *value2 = (intptr_t)op2->s;
1922 else if(op2->kind == 2)
1923 *value2 = (intptr_t)op2->us;
1924 else if(op2->kind == 1 && op2->type->isSigned)
1925 *value2 = (intptr_t)op2->c;
1926 else if(op2->kind == 24 || op2->kind == 1)
1927 *value2 = (intptr_t)op2->uc;
1928 else if(op2->kind == 6)
1929 *value2 = (intptr_t)op2->f;
1930 else if(op2->kind == 7)
1931 *value2 = (intptr_t)op2->d;
1932 else if(op2->kind == 13)
1933 *value2 = (intptr_t)op2->ui64;
1939 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1941 struct Operand op2 = GetOperand(exp);
1943 return GetOpIntPtr(&op2, value2);
1946 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1948 if(op2->kind == 3 && op2->type->isSigned)
1949 *value2 = (uintptr_t)op2->i;
1950 else if(op2->kind == 3)
1951 *value2 = (uintptr_t)op2->ui;
1952 else if(op2->kind == 4 && op2->type->isSigned)
1953 *value2 = (uintptr_t)op2->i64;
1954 else if(op2->kind == 4)
1955 *value2 = (uintptr_t)op2->ui64;
1956 else if(op2->kind == 23 && op2->type->isSigned)
1957 *value2 = (uintptr_t)op2->i64;
1958 else if(op2->kind == 23)
1959 *value2 = (uintptr_t)op2->ui64;
1960 else if(op2->kind == 22 && op2->type->isSigned)
1961 *value2 = (uintptr_t)op2->i64;
1962 else if(op2->kind == 22)
1963 *value2 = (uintptr_t)op2->ui64;
1964 else if(op2->kind == 2 && op2->type->isSigned)
1965 *value2 = (uintptr_t)op2->s;
1966 else if(op2->kind == 2)
1967 *value2 = (uintptr_t)op2->us;
1968 else if(op2->kind == 1 && op2->type->isSigned)
1969 *value2 = (uintptr_t)op2->c;
1970 else if(op2->kind == 24 || op2->kind == 1)
1971 *value2 = (uintptr_t)op2->uc;
1972 else if(op2->kind == 6)
1973 *value2 = (uintptr_t)op2->f;
1974 else if(op2->kind == 7)
1975 *value2 = (uintptr_t)op2->d;
1976 else if(op2->kind == 13)
1977 *value2 = (uintptr_t)op2->ui64;
1983 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1985 struct Operand op2 = GetOperand(exp);
1987 return GetOpUIntPtr(&op2, value2);
1990 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1992 if(op2->kind == 3 && op2->type->isSigned)
1993 *value2 = (ssize_t)op2->i;
1994 else if(op2->kind == 3)
1995 *value2 = (ssize_t)op2->ui;
1996 else if(op2->kind == 4 && op2->type->isSigned)
1997 *value2 = (ssize_t)op2->i64;
1998 else if(op2->kind == 4)
1999 *value2 = (ssize_t)op2->ui64;
2000 else if(op2->kind == 23 && op2->type->isSigned)
2001 *value2 = (ssize_t)op2->i64;
2002 else if(op2->kind == 23)
2003 *value2 = (ssize_t)op2->ui64;
2004 else if(op2->kind == 22 && op2->type->isSigned)
2005 *value2 = (ssize_t)op2->i64;
2006 else if(op2->kind == 22)
2007 *value2 = (ssize_t)op2->ui64;
2008 else if(op2->kind == 2 && op2->type->isSigned)
2009 *value2 = (ssize_t)op2->s;
2010 else if(op2->kind == 2)
2011 *value2 = (ssize_t)op2->us;
2012 else if(op2->kind == 1 && op2->type->isSigned)
2013 *value2 = (ssize_t)op2->c;
2014 else if(op2->kind == 24 || op2->kind == 1)
2015 *value2 = (ssize_t)op2->uc;
2016 else if(op2->kind == 6)
2017 *value2 = (ssize_t)op2->f;
2018 else if(op2->kind == 7)
2019 *value2 = (ssize_t)op2->d;
2020 else if(op2->kind == 13)
2021 *value2 = (ssize_t)op2->ui64;
2027 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2029 struct Operand op2 = GetOperand(exp);
2031 return GetOpIntSize(&op2, value2);
2034 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2036 if(op2->kind == 3 && op2->type->isSigned)
2037 *value2 = (size_t)op2->i;
2038 else if(op2->kind == 3)
2039 *value2 = (size_t)op2->ui;
2040 else if(op2->kind == 4 && op2->type->isSigned)
2041 *value2 = (size_t)op2->i64;
2042 else if(op2->kind == 4)
2043 *value2 = (size_t)op2->ui64;
2044 else if(op2->kind == 23 && op2->type->isSigned)
2045 *value2 = (size_t)op2->i64;
2046 else if(op2->kind == 23)
2047 *value2 = (size_t)op2->ui64;
2048 else if(op2->kind == 22 && op2->type->isSigned)
2049 *value2 = (size_t)op2->i64;
2050 else if(op2->kind == 22)
2051 *value2 = (size_t)op2->ui64;
2052 else if(op2->kind == 2 && op2->type->isSigned)
2053 *value2 = (size_t)op2->s;
2054 else if(op2->kind == 2)
2055 *value2 = (size_t)op2->us;
2056 else if(op2->kind == 1 && op2->type->isSigned)
2057 *value2 = (size_t)op2->c;
2058 else if(op2->kind == 24 || op2->kind == 1)
2059 *value2 = (size_t)op2->uc;
2060 else if(op2->kind == 6)
2061 *value2 = (size_t)op2->f;
2062 else if(op2->kind == 7)
2063 *value2 = (size_t)op2->d;
2064 else if(op2->kind == 13)
2065 *value2 = (size_t)op2->ui64;
2071 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2073 struct Operand op2 = GetOperand(exp);
2075 return GetOpUIntSize(&op2, value2);
2078 unsigned int GetOpShort(struct Operand * op2, short * value2)
2080 if(op2->kind == 3 && op2->type->isSigned)
2081 *value2 = (short)op2->i;
2082 else if(op2->kind == 3)
2083 *value2 = (short)op2->ui;
2084 else if(op2->kind == 4 && op2->type->isSigned)
2085 *value2 = (short)op2->i64;
2086 else if(op2->kind == 4)
2087 *value2 = (short)op2->ui64;
2088 else if(op2->kind == 23 && op2->type->isSigned)
2089 *value2 = (short)op2->i64;
2090 else if(op2->kind == 23)
2091 *value2 = (short)op2->ui64;
2092 else if(op2->kind == 22 && op2->type->isSigned)
2093 *value2 = (short)op2->i64;
2094 else if(op2->kind == 22)
2095 *value2 = (short)op2->ui64;
2096 else if(op2->kind == 2 && op2->type->isSigned)
2098 else if(op2->kind == 2)
2099 *value2 = (short)op2->us;
2100 else if(op2->kind == 1 && op2->type->isSigned)
2101 *value2 = (short)op2->c;
2102 else if(op2->kind == 24 || op2->kind == 1)
2103 *value2 = (short)op2->uc;
2104 else if(op2->kind == 6)
2105 *value2 = (short)op2->f;
2106 else if(op2->kind == 7)
2107 *value2 = (short)op2->d;
2108 else if(op2->kind == 13)
2109 *value2 = (short)op2->ui64;
2115 unsigned int GetShort(struct Expression * exp, short * value2)
2117 struct Operand op2 = GetOperand(exp);
2119 return GetOpShort(&op2, value2);
2122 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2124 if(op2->kind == 3 && op2->type->isSigned)
2125 *value2 = (unsigned short)op2->i;
2126 else if(op2->kind == 3)
2127 *value2 = (unsigned short)op2->ui;
2128 else if(op2->kind == 4 && op2->type->isSigned)
2129 *value2 = (unsigned short)op2->i64;
2130 else if(op2->kind == 4)
2131 *value2 = (unsigned short)op2->ui64;
2132 else if(op2->kind == 23 && op2->type->isSigned)
2133 *value2 = (unsigned short)op2->i64;
2134 else if(op2->kind == 23)
2135 *value2 = (unsigned short)op2->ui64;
2136 else if(op2->kind == 22 && op2->type->isSigned)
2137 *value2 = (unsigned short)op2->i64;
2138 else if(op2->kind == 22)
2139 *value2 = (unsigned short)op2->ui64;
2140 else if(op2->kind == 2 && op2->type->isSigned)
2141 *value2 = (unsigned short)op2->s;
2142 else if(op2->kind == 2)
2144 else if(op2->kind == 1 && op2->type->isSigned)
2145 *value2 = (unsigned short)op2->c;
2146 else if(op2->kind == 24 || op2->kind == 1)
2147 *value2 = (unsigned short)op2->uc;
2148 else if(op2->kind == 6)
2149 *value2 = (unsigned short)op2->f;
2150 else if(op2->kind == 7)
2151 *value2 = (unsigned short)op2->d;
2152 else if(op2->kind == 13)
2153 *value2 = (unsigned short)op2->ui64;
2159 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2161 struct Operand op2 = GetOperand(exp);
2163 return GetOpUShort(&op2, value2);
2166 unsigned int GetOpChar(struct Operand * op2, char * value2)
2168 if(op2->kind == 3 && op2->type->isSigned)
2169 *value2 = (char)op2->i;
2170 else if(op2->kind == 3)
2171 *value2 = (char)op2->ui;
2172 else if(op2->kind == 4 && op2->type->isSigned)
2173 *value2 = (char)op2->i64;
2174 else if(op2->kind == 4)
2175 *value2 = (char)op2->ui64;
2176 else if(op2->kind == 23 && op2->type->isSigned)
2177 *value2 = (char)op2->i64;
2178 else if(op2->kind == 23)
2179 *value2 = (char)op2->ui64;
2180 else if(op2->kind == 22 && op2->type->isSigned)
2181 *value2 = (char)op2->i64;
2182 else if(op2->kind == 22)
2183 *value2 = (char)op2->ui64;
2184 else if(op2->kind == 2 && op2->type->isSigned)
2185 *value2 = (char)op2->s;
2186 else if(op2->kind == 2)
2187 *value2 = (char)op2->us;
2188 else if(op2->kind == 1 && op2->type->isSigned)
2190 else if(op2->kind == 24 || op2->kind == 1)
2191 *value2 = (char)op2->uc;
2192 else if(op2->kind == 6)
2193 *value2 = (char)op2->f;
2194 else if(op2->kind == 7)
2195 *value2 = (char)op2->d;
2196 else if(op2->kind == 13)
2197 *value2 = (char)op2->ui64;
2203 unsigned int GetChar(struct Expression * exp, char * value2)
2205 struct Operand op2 = GetOperand(exp);
2207 return GetOpChar(&op2, value2);
2210 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2212 if(op2->kind == 3 && op2->type->isSigned)
2213 *value2 = (unsigned char)op2->i;
2214 else if(op2->kind == 3)
2215 *value2 = (unsigned char)op2->ui;
2216 else if(op2->kind == 4 && op2->type->isSigned)
2217 *value2 = (unsigned char)op2->i64;
2218 else if(op2->kind == 4)
2219 *value2 = (unsigned char)op2->ui64;
2220 else if(op2->kind == 23 && op2->type->isSigned)
2221 *value2 = (unsigned char)op2->i64;
2222 else if(op2->kind == 23)
2223 *value2 = (unsigned char)op2->ui64;
2224 else if(op2->kind == 22 && op2->type->isSigned)
2225 *value2 = (unsigned char)op2->i64;
2226 else if(op2->kind == 22)
2227 *value2 = (unsigned char)op2->ui64;
2228 else if(op2->kind == 2 && op2->type->isSigned)
2229 *value2 = (unsigned char)op2->s;
2230 else if(op2->kind == 2)
2231 *value2 = (unsigned char)op2->us;
2232 else if(op2->kind == 1 && op2->type->isSigned)
2233 *value2 = (unsigned char)op2->c;
2234 else if(op2->kind == 24 || op2->kind == 1)
2236 else if(op2->kind == 6)
2237 *value2 = (unsigned char)op2->f;
2238 else if(op2->kind == 7)
2239 *value2 = (unsigned char)op2->d;
2240 else if(op2->kind == 13)
2241 *value2 = (unsigned char)op2->ui64;
2247 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2249 struct Operand op2 = GetOperand(exp);
2251 return GetOpUChar(&op2, value2);
2254 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2256 if(op2->kind == 3 && op2->type->isSigned)
2257 *value2 = (float)(float)op2->i;
2258 else if(op2->kind == 3)
2259 *value2 = (float)(float)op2->ui;
2260 else if(op2->kind == 4 && op2->type->isSigned)
2261 *value2 = (float)(float)op2->i64;
2262 else if(op2->kind == 4)
2263 *value2 = (float)(float)op2->ui64;
2264 else if(op2->kind == 23 && op2->type->isSigned)
2265 *value2 = (float)(float)op2->i64;
2266 else if(op2->kind == 23)
2267 *value2 = (float)(float)op2->ui64;
2268 else if(op2->kind == 22 && op2->type->isSigned)
2269 *value2 = (float)(float)op2->i64;
2270 else if(op2->kind == 22)
2271 *value2 = (float)(float)op2->ui64;
2272 else if(op2->kind == 2 && op2->type->isSigned)
2273 *value2 = (float)(float)op2->s;
2274 else if(op2->kind == 2)
2275 *value2 = (float)(float)op2->us;
2276 else if(op2->kind == 1 && op2->type->isSigned)
2277 *value2 = (float)(float)op2->c;
2278 else if(op2->kind == 24 || op2->kind == 1)
2279 *value2 = (float)(float)op2->uc;
2280 else if(op2->kind == 6)
2281 *value2 = (float)op2->f;
2282 else if(op2->kind == 7)
2283 *value2 = (float)op2->d;
2284 else if(op2->kind == 13)
2285 *value2 = (float)(float)op2->ui64;
2291 unsigned int GetFloat(struct Expression * exp, float * value2)
2293 struct Operand op2 = GetOperand(exp);
2295 return GetOpFloat(&op2, value2);
2298 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2300 if(op2->kind == 3 && op2->type->isSigned)
2301 *value2 = (double)(double)op2->i;
2302 else if(op2->kind == 3)
2303 *value2 = (double)(double)op2->ui;
2304 else if(op2->kind == 4 && op2->type->isSigned)
2305 *value2 = (double)(double)op2->i64;
2306 else if(op2->kind == 4)
2307 *value2 = (double)(double)op2->ui64;
2308 else if(op2->kind == 23 && op2->type->isSigned)
2309 *value2 = (double)(double)op2->i64;
2310 else if(op2->kind == 23)
2311 *value2 = (double)(double)op2->ui64;
2312 else if(op2->kind == 22 && op2->type->isSigned)
2313 *value2 = (double)(double)op2->i64;
2314 else if(op2->kind == 22)
2315 *value2 = (double)(double)op2->ui64;
2316 else if(op2->kind == 2 && op2->type->isSigned)
2317 *value2 = (double)(double)op2->s;
2318 else if(op2->kind == 2)
2319 *value2 = (double)(double)op2->us;
2320 else if(op2->kind == 1 && op2->type->isSigned)
2321 *value2 = (double)(double)op2->c;
2322 else if(op2->kind == 24 || op2->kind == 1)
2323 *value2 = (double)(double)op2->uc;
2324 else if(op2->kind == 6)
2325 *value2 = (double)op2->f;
2326 else if(op2->kind == 7)
2327 *value2 = (double)op2->d;
2328 else if(op2->kind == 13)
2329 *value2 = (double)(double)op2->ui64;
2335 unsigned int GetDouble(struct Expression * exp, double * value2)
2337 struct Operand op2 = GetOperand(exp);
2339 return GetOpDouble(&op2, value2);
2342 void ComputeExpression(struct Expression * exp);
2344 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2346 extern int targetBits;
2348 int ComputeTypeSize(struct Type * type);
2350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2352 struct __ecereNameSpace__ecere__com__BitMember
2354 struct __ecereNameSpace__ecere__com__BitMember * prev;
2355 struct __ecereNameSpace__ecere__com__BitMember * next;
2357 unsigned int isProperty;
2360 struct __ecereNameSpace__ecere__com__Class * _class;
2361 char * dataTypeString;
2362 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2363 struct Type * dataType;
2368 } __attribute__ ((gcc_struct));
2370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2372 struct __ecereNameSpace__ecere__sys__OldLink
2374 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2375 struct __ecereNameSpace__ecere__sys__OldLink * next;
2377 } __attribute__ ((gcc_struct));
2379 void FinishTemplatesContext(struct Context * context);
2381 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2383 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2384 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2386 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))
2389 int unionMemberOffset = 0;
2394 member->memberOffset = 0;
2395 if(targetBits < sizeof(void *) * 8)
2396 member->structAlignment = 0;
2398 else if(targetBits < sizeof(void *) * 8)
2399 _class->structAlignment = 0;
2400 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2401 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2402 if(!member && _class->destructionWatchOffset)
2403 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2405 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2407 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2409 if(!dataMember->isProperty)
2411 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2413 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2419 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2421 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2423 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2425 if(!isMember && _class->type == 2 && dataMember->dataType)
2427 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2431 ComputeTypeSize(dataMember->dataType);
2432 if(bitMember->pos == -1)
2433 bitMember->pos = _class->memberOffset;
2434 if(!bitMember->size)
2435 bitMember->size = dataMember->dataType->size * 8;
2436 _class->memberOffset = bitMember->pos + bitMember->size;
2437 for(d = 0; d < bitMember->size; d++)
2443 bitMember->mask = mask << bitMember->pos;
2445 else if(dataMember->type == 0 && dataMember->dataType)
2450 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2451 ComputeTypeSize(dataMember->dataType);
2452 if(dataMember->dataType->bitFieldCount)
2454 bitFields += dataMember->dataType->bitFieldCount;
2461 int size = (bitFields + 7) / 8;
2465 int __simpleStruct0;
2469 int __simpleStruct0;
2471 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2472 if(member->memberOffset % alignment)
2473 member->memberOffset += alignment - (member->memberOffset % alignment);
2475 dataMember->offset = member->memberOffset;
2476 if(member->type == 1)
2477 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2480 member->memberOffset += size;
2487 int __simpleStruct0;
2489 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2490 if(_class->memberOffset % alignment)
2491 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2493 dataMember->offset = _class->memberOffset;
2494 _class->memberOffset += size;
2498 size = dataMember->dataType->size;
2499 alignment = dataMember->dataType->alignment;
2503 int __simpleStruct0;
2507 int __simpleStruct0;
2509 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2510 if(member->memberOffset % alignment)
2511 member->memberOffset += alignment - (member->memberOffset % alignment);
2513 dataMember->offset = member->memberOffset;
2514 if(member->type == 1)
2515 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2518 member->memberOffset += size;
2525 int __simpleStruct0;
2527 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2528 if(_class->memberOffset % alignment)
2529 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2531 dataMember->offset = _class->memberOffset;
2532 _class->memberOffset += size;
2539 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2540 alignment = dataMember->structAlignment;
2543 int __simpleStruct0;
2547 int __simpleStruct0;
2549 if(member->memberOffset % alignment)
2550 member->memberOffset += alignment - (member->memberOffset % alignment);
2551 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2553 dataMember->offset = member->memberOffset;
2554 if(member->type == 1)
2555 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2557 member->memberOffset += dataMember->memberOffset;
2563 int __simpleStruct0;
2565 if(_class->memberOffset % alignment)
2566 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2567 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2569 dataMember->offset = _class->memberOffset;
2570 _class->memberOffset += dataMember->memberOffset;
2578 int size = (bitFields + 7) / 8;
2582 int __simpleStruct0;
2586 int __simpleStruct0;
2588 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2589 if(member->memberOffset % alignment)
2590 member->memberOffset += alignment - (member->memberOffset % alignment);
2592 if(member->type == 1)
2593 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2596 member->memberOffset += size;
2603 int __simpleStruct0;
2605 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2606 if(_class->memberOffset % alignment)
2607 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2609 _class->memberOffset += size;
2614 if(member && member->type == 1)
2616 member->memberOffset = unionMemberOffset;
2620 if(_class->type != 2)
2624 if(_class->structAlignment)
2626 if(_class->memberOffset % _class->structAlignment)
2627 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2629 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2632 struct __ecereNameSpace__ecere__com__Property * prop;
2634 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2636 if(prop->isProperty && prop->isWatchable)
2638 prop->watcherOffset = _class->structSize;
2639 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2644 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2646 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2648 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2650 if(deriv->computeSize)
2652 deriv->offset = _class->structSize;
2653 deriv->memberOffset = 0;
2654 deriv->structSize = deriv->offset;
2655 ComputeClassMembers(deriv, 0x0);
2663 FinishTemplatesContext(context);
2666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2668 struct __ecereNameSpace__ecere__com__NameSpace
2671 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2672 struct __ecereNameSpace__ecere__com__NameSpace * left;
2673 struct __ecereNameSpace__ecere__com__NameSpace * right;
2675 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2676 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2677 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2678 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2679 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2680 } __attribute__ ((gcc_struct));
2682 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2684 struct __ecereNameSpace__ecere__com__Module
2686 struct __ecereNameSpace__ecere__com__Instance * application;
2687 struct __ecereNameSpace__ecere__sys__OldList classes;
2688 struct __ecereNameSpace__ecere__sys__OldList defines;
2689 struct __ecereNameSpace__ecere__sys__OldList functions;
2690 struct __ecereNameSpace__ecere__sys__OldList modules;
2691 struct __ecereNameSpace__ecere__com__Instance * prev;
2692 struct __ecereNameSpace__ecere__com__Instance * next;
2698 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2699 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2700 } __attribute__ ((gcc_struct));
2702 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2704 struct __ecereNameSpace__ecere__com__Class * _class;
2705 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2707 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2708 ComputeModuleClasses(subModule->data);
2709 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2710 ComputeClassMembers(_class, 0x0);
2713 extern unsigned int inCompiler;
2715 extern void Compiler_Error(char * format, ...);
2717 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2719 int ComputeTypeSize(struct Type * type)
2721 unsigned int size = type ? type->size : 0;
2723 if(!size && type && !type->computing)
2725 type->computing = 0x1;
2729 type->alignment = size = sizeof(char);
2732 type->alignment = size = sizeof(char);
2735 type->alignment = size = sizeof(int);
2738 type->alignment = size = sizeof(long long);
2741 type->alignment = size = targetBits / 8;
2744 type->alignment = size = targetBits / 8;
2747 type->alignment = size = sizeof(long);
2750 type->alignment = size = sizeof(short);
2753 type->alignment = size = sizeof(float);
2756 type->alignment = size = sizeof(double);
2760 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2762 if(_class && _class->type == 1)
2764 ComputeClassMembers(_class, 0x0);
2765 type->alignment = _class->structAlignment;
2766 size = _class->structSize;
2767 if(type->alignment && size % type->alignment)
2768 size += type->alignment - (size % type->alignment);
2770 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2772 if(!_class->dataType)
2773 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2774 size = type->alignment = ComputeTypeSize(_class->dataType);
2777 size = type->alignment = targetBits / 8;
2782 size = type->alignment = targetBits / 8;
2785 if(type->arraySizeExp)
2787 ProcessExpressionType(type->arraySizeExp);
2788 ComputeExpression(type->arraySizeExp);
2789 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)))
2791 struct Location oldLoc = yylloc;
2792 char expression[10240];
2794 expression[0] = '\0';
2795 type->arraySizeExp->expType = (((void *)0));
2796 yylloc = type->arraySizeExp->loc;
2798 PrintExpression(type->arraySizeExp, expression);
2799 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2802 GetInt(type->arraySizeExp, &type->arraySize);
2804 else if(type->enumClass)
2806 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2808 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2811 type->arraySize = 0;
2815 type->arraySize = 0;
2817 size = ComputeTypeSize(type->type) * type->arraySize;
2819 type->alignment = type->type->alignment;
2823 struct Type * member;
2825 for(member = type->members.first; member; member = member->next)
2827 int __simpleStruct0, __simpleStruct1;
2828 unsigned int addSize = ComputeTypeSize(member);
2830 member->offset = size;
2831 if(member->alignment && size % member->alignment)
2832 member->offset += member->alignment - (size % member->alignment);
2833 size = member->offset;
2834 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2837 if(type->alignment && size % type->alignment)
2838 size += type->alignment - (size % type->alignment);
2843 struct Type * member;
2845 for(member = type->members.first; member; member = member->next)
2847 int __simpleStruct0, __simpleStruct1;
2848 unsigned int addSize = ComputeTypeSize(member);
2850 member->offset = size;
2851 if(member->alignment && size % member->alignment)
2852 member->offset += member->alignment - (size % member->alignment);
2853 size = member->offset;
2854 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2855 size = ((size > addSize) ? size : addSize);
2857 if(type->alignment && size % type->alignment)
2858 size += type->alignment - (size % type->alignment);
2863 struct TemplateParameter * param = type->templateParameter;
2864 struct Type * baseType = ProcessTemplateParameterType(param);
2868 size = ComputeTypeSize(baseType);
2869 type->alignment = baseType->alignment;
2872 type->alignment = size = sizeof(uint64);
2877 type->alignment = size = sizeof(enum
2885 type->alignment = size = targetBits / 8;
2890 type->computing = 0x0;
2895 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2897 extern struct Identifier * MkIdentifier(char * string);
2899 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2901 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2903 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2905 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2907 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2909 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2911 extern void FreeType(struct Type * type);
2913 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2915 extern struct Specifier * MkSpecifier(int specifier);
2917 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2919 extern struct Expression * MkExpConstant(char * string);
2921 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)
2923 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2924 unsigned int totalSize = 0;
2925 unsigned int maxSize = 0;
2926 int alignment, size;
2927 struct __ecereNameSpace__ecere__com__DataMember * member;
2928 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2931 *addedPadding = 0x0;
2932 if(!isMember && _class->base)
2934 maxSize = _class->structSize;
2936 if(_class->type == 1 || _class->type == 5)
2937 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2940 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2942 if(maxSize > baseSize)
2943 maxSize -= baseSize;
2949 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2951 if(!member->isProperty)
2953 switch(member->type)
2957 if(member->dataTypeString)
2959 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2960 struct Declarator * decl;
2962 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2963 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2964 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2965 if(!member->dataType)
2966 member->dataType = ProcessType(specs, decl);
2967 ReplaceThisClassSpecifiers(specs, topClass);
2969 struct Type * type = ProcessType(specs, decl);
2971 DeclareType(member->dataType, 0x0, 0x0);
2974 ComputeTypeSize(member->dataType);
2975 size = member->dataType->size;
2976 alignment = member->dataType->alignment;
2979 if(totalSize % alignment)
2980 totalSize += alignment - (totalSize % alignment);
2989 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2992 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2993 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2994 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2995 alignment = member->structAlignment;
2998 if(totalSize % alignment)
2999 totalSize += alignment - (totalSize % alignment);
3009 unsigned int __simpleStruct0;
3011 if(topMember && topMember->type == 1)
3012 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3014 *retSize += totalSize;
3016 else if(totalSize < maxSize && _class->type != 1000)
3018 int autoPadding = 0;
3020 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3021 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3022 if(totalSize + autoPadding < maxSize)
3024 char sizeString[50];
3026 sprintf(sizeString, "%d", maxSize - totalSize);
3027 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3029 *addedPadding = 0x1;
3033 FinishTemplatesContext(context);
3034 return topMember ? topMember->memberID : _class->memberID;
3037 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3039 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3040 unsigned int totalSize = 0;
3041 struct __ecereNameSpace__ecere__com__DataMember * member;
3042 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3044 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3045 DeclareMembers(_class->base, 0x0);
3046 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3048 if(!member->isProperty)
3050 switch(member->type)
3054 if(!member->dataType && member->dataTypeString)
3055 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3056 if(member->dataType)
3057 DeclareType(member->dataType, 0x0, 0x0);
3063 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3070 FinishTemplatesContext(context);
3071 return topMember ? topMember->memberID : _class->memberID;
3074 extern struct Symbol * FindClass(char * name);
3076 extern char * strchr(const char * , int);
3078 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3080 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3082 extern void FreeClassDef(struct ClassDef * def);
3084 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3086 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3088 extern void MangleClassName(char * className);
3090 extern void DeclareClass(struct Symbol * classSym, char * className);
3092 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3094 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3096 void DeclareStruct(char * name, unsigned int skipNoHead)
3098 struct External * external = (((void *)0));
3099 struct Symbol * classSym = FindClass(name);
3101 if(!inCompiler || !classSym)
3103 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3105 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3107 struct Declaration * decl;
3108 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3109 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3110 char structName[1024];
3112 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3113 classSym->declaring++;
3114 if(strchr(classSym->string, '<'))
3116 if(classSym->registered->templateClass)
3118 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3119 classSym->declaring--;
3123 DeclareMembers(classSym->registered, 0x0);
3124 structName[0] = (char)0;
3125 FullClassNameCat(structName, name, 0x0);
3128 unsigned int addedPadding = 0x0;
3130 classSym->declaredStructSym = 0x1;
3131 declarations = MkList();
3132 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3133 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3135 FreeList(declarations, FreeClassDef);
3136 declarations = (((void *)0));
3139 if(skipNoHead || declarations)
3141 if(external && external->declaration)
3143 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3144 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3146 if(classSym->structExternal)
3147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3149 classSym->id = curExternal->symbol->idCode;
3150 classSym->idCode = curExternal->symbol->idCode;
3156 external = MkExternalDeclaration((((void *)0)));
3157 specifiers = MkList();
3158 declarators = MkList();
3159 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3160 external->declaration = decl = MkDeclaration(specifiers, declarators);
3161 if(decl->symbol && !decl->symbol->pointerExternal)
3162 decl->symbol->pointerExternal = external;
3163 if(classSym->registered && classSym->registered->type == 1)
3165 char className[1024];
3167 strcpy(className, "__ecereClass_");
3168 FullClassNameCat(className, classSym->string, 0x1);
3169 MangleClassName(className);
3170 DeclareClass(classSym, className);
3171 external->symbol = classSym;
3172 classSym->pointerExternal = external;
3173 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3174 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3178 char className[1024];
3180 strcpy(className, "__ecereClass_");
3181 FullClassNameCat(className, classSym->string, 0x1);
3182 MangleClassName(className);
3183 classSym->structExternal = external;
3184 DeclareClass(classSym, className);
3185 external->symbol = classSym;
3187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3190 classSym->declaring--;
3192 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3194 classSym->declaring++;
3196 if(classSym->registered)
3197 DeclareMembers(classSym->registered, 0x0);
3199 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3201 if(classSym->structExternal)
3202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3204 classSym->id = curExternal->symbol->idCode;
3205 classSym->idCode = curExternal->symbol->idCode;
3207 classSym->declaring--;
3211 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3213 extern struct ModuleImport * mainModule;
3215 extern struct Specifier * MkSpecifierName(char * name);
3217 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3219 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3221 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3223 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3225 extern void FreeDeclarator(struct Declarator * decl);
3227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3229 struct PropertyImport
3231 struct PropertyImport * prev;
3232 struct PropertyImport * next;
3234 unsigned int isVirtual;
3235 unsigned int hasSet;
3236 unsigned int hasGet;
3237 } __attribute__ ((gcc_struct));
3239 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3241 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3243 struct Symbol * symbol = prop->symbol;
3244 char propName[1024];
3246 strcpy(setName, "__ecereProp_");
3247 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3248 strcat(setName, "_Set_");
3249 FullClassNameCat(setName, prop->name, 0x1);
3250 strcpy(getName, "__ecereProp_");
3251 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3252 strcat(getName, "_Get_");
3253 FullClassNameCat(getName, prop->name, 0x1);
3254 strcpy(propName, "__ecereProp_");
3255 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3256 strcat(propName, "_");
3257 FullClassNameCat(propName, prop->name, 0x1);
3258 MangleClassName(getName);
3259 MangleClassName(setName);
3260 MangleClassName(propName);
3261 if(prop->_class->type == 1)
3262 DeclareStruct(prop->_class->fullName, 0x0);
3263 if(!symbol || curExternal->symbol->idCode < symbol->id)
3265 unsigned int imported = 0x0;
3266 unsigned int dllImport = 0x0;
3268 if(!symbol || symbol->_import)
3272 struct Symbol * classSym;
3274 if(!prop->_class->symbol)
3275 prop->_class->symbol = FindClass(prop->_class->fullName);
3276 classSym = prop->_class->symbol;
3277 if(classSym && !classSym->_import)
3279 struct ModuleImport * module;
3281 if(prop->_class->module)
3282 module = FindModule(prop->_class->module);
3284 module = mainModule;
3285 classSym->_import = __extension__ ({
3286 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3288 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3290 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3292 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3293 symbol->_import = (struct ClassImport *)__extension__ ({
3294 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3296 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3302 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)
3307 struct Context * context = SetupTemplatesContext(prop->_class);
3309 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3310 FinishTemplatesContext(context);
3314 if(!symbol->externalGet || symbol->externalGet->type == 0)
3316 struct Declaration * decl;
3317 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3318 struct Declarator * d;
3319 struct __ecereNameSpace__ecere__sys__OldList * params;
3320 struct Specifier * spec;
3321 struct External * external;
3322 struct Declarator * typeDecl;
3323 unsigned int simple = 0x0;
3325 specifiers = MkList();
3326 declarators = MkList();
3328 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3329 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3331 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3333 struct Context * context = SetupTemplatesContext(prop->_class);
3335 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3336 FinishTemplatesContext(context);
3338 for(spec = (*specifiers).first; spec; spec = spec->next)
3342 if((!typeDecl || typeDecl->type == 1))
3344 struct Symbol * classSym = spec->symbol;
3346 symbol->_class = classSym->registered;
3347 if(classSym->registered && classSym->registered->type == 1)
3349 DeclareStruct(spec->name, 0x0);
3356 d = PlugDeclarator(typeDecl, d);
3359 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3360 specifiers = MkList();
3362 d = MkDeclaratorFunction(d, params);
3364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3365 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3368 ListAdd(specifiers, MkSpecifier(VOID));
3369 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3370 decl = MkDeclaration(specifiers, declarators);
3371 external = MkExternalDeclaration(decl);
3372 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3373 external->symbol = symbol;
3374 symbol->externalGet = external;
3375 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3377 FreeDeclarator(typeDecl);
3381 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3386 if(!symbol->externalSet || symbol->externalSet->type == 0)
3388 struct Declaration * decl;
3389 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3390 struct Declarator * d;
3391 struct __ecereNameSpace__ecere__sys__OldList * params;
3392 struct Specifier * spec;
3393 struct External * external;
3394 struct Declarator * typeDecl;
3396 declarators = MkList();
3398 if(!prop->conversion || prop->_class->type == 1)
3400 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3402 specifiers = MkList();
3404 struct Context * context = SetupTemplatesContext(prop->_class);
3406 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3407 FinishTemplatesContext(context);
3409 ListAdd(params, MkTypeName(specifiers, d));
3410 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3412 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3413 d = MkDeclaratorFunction(d, params);
3414 for(spec = (*specifiers).first; spec; spec = spec->next)
3418 if((!typeDecl || typeDecl->type == 1))
3420 struct Symbol * classSym = spec->symbol;
3422 symbol->_class = classSym->registered;
3423 if(classSym->registered && classSym->registered->type == 1)
3424 DeclareStruct(spec->name, 0x0);
3428 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3429 specifiers = MkList();
3431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3432 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3434 if(!prop->conversion || prop->_class->type == 1)
3435 ListAdd(specifiers, MkSpecifier(VOID));
3437 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3438 decl = MkDeclaration(specifiers, declarators);
3439 external = MkExternalDeclaration(decl);
3440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3441 external->symbol = symbol;
3442 symbol->externalSet = external;
3443 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3447 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3450 if(!symbol->externalPtr)
3452 struct Declaration * decl;
3453 struct External * external;
3454 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3460 ListAdd(specifiers, MkSpecifierName("Property"));
3462 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3464 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3467 strcpy(propName, "__ecerePropM_");
3468 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3469 strcat(propName, "_");
3470 FullClassNameCat(propName, prop->name, 0x1);
3471 MangleClassName(propName);
3472 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3474 decl = MkDeclaration(specifiers, list);
3476 external = MkExternalDeclaration(decl);
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3478 external->symbol = symbol;
3479 symbol->externalPtr = external;
3483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3485 symbol->id = curExternal->symbol->idCode;
3489 struct Type * Dereference(struct Type * source)
3491 struct Type * type = (((void *)0));
3495 if(source->kind == 13 || source->kind == 12)
3497 type = source->type;
3498 source->type->refCount++;
3500 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3502 type = __extension__ ({
3503 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3505 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3508 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3514 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3519 static struct Type * Reference(struct Type * source)
3521 struct Type * type = (((void *)0));
3525 type = __extension__ ({
3526 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3528 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3535 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);
3537 extern void * memcpy(void * , const void * , size_t size);
3539 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3541 extern void FreeExpression(struct Expression * exp);
3543 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3545 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);
3547 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3549 extern struct Type * MkClassType(char * name);
3551 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);
3553 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)
3555 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3556 unsigned int found = 0x0;
3557 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3558 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3559 unsigned int freeType = 0x0;
3561 yylloc = member->loc;
3566 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3570 dataMember = *curMember;
3576 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3577 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3578 int _subMemberStackPos = 0;
3581 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3584 dataMember = thisMember;
3585 if(curMember && thisMember->memberAccess == 1)
3587 *curMember = thisMember;
3588 *curClass = thisMember->_class;
3589 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3590 *subMemberStackPos = _subMemberStackPos;
3596 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3597 if(method && method->type == 1)
3600 method = (((void *)0));
3605 struct Type * type = (((void *)0));
3609 if(!dataMember->dataType && dataMember->dataTypeString)
3611 struct Context * context = SetupTemplatesContext(_class);
3613 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3614 FinishTemplatesContext(context);
3616 type = dataMember->dataType;
3620 if(!method->dataType)
3621 ProcessMethodType(method);
3622 type = method->dataType;
3624 if(ident && ident->next)
3626 for(ident = ident->next; ident && type; ident = ident->next)
3630 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3632 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3634 type = dataMember->dataType;
3636 else if(type->kind == 9 || type->kind == 10)
3638 struct Type * memberType;
3640 for(memberType = type->members.first; memberType; memberType = memberType->next)
3642 if(!strcmp(memberType->name, ident->string))
3651 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3654 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3655 struct __ecereNameSpace__ecere__com__Class * sClass;
3657 for(sClass = _class; sClass; sClass = sClass->base)
3660 if(sClass->templateClass)
3661 sClass = sClass->templateClass;
3662 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3664 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3666 for(sClass = sClass->base; sClass; sClass = sClass->base)
3668 if(sClass->templateClass)
3669 sClass = sClass->templateClass;
3670 id += sClass->templateParams.count;
3681 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3683 if(arg.dataTypeString)
3685 type = ProcessTypeString(arg.dataTypeString, 0x0);
3687 if(type && _class->templateClass)
3688 type->passAsTemplate = 0x1;
3695 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3697 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3698 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3702 char templateString[1024];
3703 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3705 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3706 for(cClass = expClass; cClass; cClass = cClass->base)
3710 if(cClass->templateClass)
3711 cClass = cClass->templateClass;
3712 for(param = cClass->templateParams.first; param; param = param->next)
3715 struct __ecereNameSpace__ecere__com__Class * sClass;
3716 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3718 for(sClass = cClass->base; sClass; sClass = sClass->base)
3720 if(sClass->templateClass)
3721 sClass = sClass->templateClass;
3722 id += sClass->templateParams.count;
3724 arg = expClass->templateArgs[id];
3725 for(sClass = _class; sClass; sClass = sClass->base)
3727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3729 struct __ecereNameSpace__ecere__com__Class * nextClass;
3731 if(sClass->templateClass)
3732 sClass = sClass->templateClass;
3733 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3735 if(nextClass->templateClass)
3736 nextClass = nextClass->templateClass;
3737 p += nextClass->templateParams.count;
3739 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3741 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3743 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3745 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3746 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3760 char expString[1024];
3761 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3762 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3763 struct Expression * exp;
3764 char * string = PrintHexUInt64(arg.expression.ui64);
3766 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3767 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3768 ProcessExpressionType(exp);
3769 ComputeExpression(exp);
3770 expString[0] = '\0';
3771 PrintExpression(exp, expString);
3772 strcat(argument, expString);
3773 FreeExpression(exp);
3778 strcat(argument, arg.member->name);
3783 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3784 strcat(argument, arg.dataTypeString);
3791 strcat(templateString, ", ");
3792 if(lastParam != p - 1)
3794 strcat(templateString, param->name);
3795 strcat(templateString, " = ");
3797 strcat(templateString, argument);
3806 int len = strlen(templateString);
3808 if(templateString[len - 1] == '<')
3812 if(templateString[len - 1] == '>')
3813 templateString[len++] = ' ';
3814 templateString[len++] = '>';
3816 templateString[len++] = '\0';
3819 struct Context * context = SetupTemplatesContext(_class);
3823 type = ProcessTypeString(templateString, 0x0);
3825 FinishTemplatesContext(context);
3828 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3830 ProcessExpressionType(member->initializer->exp);
3831 if(!member->initializer->exp->expType)
3835 char expString[10240];
3837 expString[0] = '\0';
3838 PrintExpression(member->initializer->exp, expString);
3839 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3840 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3843 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3845 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3848 else if(member->initializer)
3850 ProcessInitializer(member->initializer, type);
3857 if(_class && _class->type == 3)
3859 if(member->initializer)
3861 struct Type * type = MkClassType(_class->fullName);
3863 ProcessInitializer(member->initializer, type);
3869 if(member->initializer)
3871 ProcessInitializer(member->initializer, (((void *)0)));
3877 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3881 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3883 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3892 extern struct Identifier * GetDeclId(struct Declarator * decl);
3894 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);
3896 extern void FreeSpecifier(struct Specifier * spec);
3898 static void ProcessFunction(struct FunctionDefinition * function);
3900 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3902 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3904 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3906 extern void FreeClassFunction(struct ClassFunction * func);
3908 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3910 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3912 void ProcessInstantiationType(struct Instantiation * inst)
3917 struct MembersInit * members;
3918 struct Symbol * classSym;
3919 struct __ecereNameSpace__ecere__com__Class * _class;
3921 classSym = inst->_class->symbol;
3922 _class = classSym ? classSym->registered : (((void *)0));
3923 if(!_class || _class->type != 5)
3924 DeclareStruct(inst->_class->name, 0x0);
3925 afterExternal = afterExternal ? afterExternal : curExternal;
3927 ProcessExpressionType(inst->exp);
3928 inst->isConstant = 0x1;
3931 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3932 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3933 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3934 int subMemberStackPos = 0;
3936 for(members = (*inst->members).first; members; members = members->next)
3938 switch(members->type)
3943 static unsigned int instMethodID = 0;
3944 struct External * external = curExternal;
3945 struct Context * context = curContext;
3946 struct Declarator * declarator = members->function->declarator;
3947 struct Identifier * nameID = GetDeclId(declarator);
3948 char * unmangled = nameID ? nameID->string : (((void *)0));
3949 struct Expression * exp;
3950 struct External * createdExternal = (((void *)0));
3956 strcpy(name, "__ecereInstMeth_");
3957 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3959 strcat(name, nameID->string);
3961 sprintf(number, "_%08d", instMethodID++);
3962 strcat(name, number);
3963 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3967 struct Symbol * symbol = declarator->symbol;
3968 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3970 if(method && method->type == 1)
3972 symbol->method = method;
3973 ProcessMethodType(method);
3974 if(!symbol->type->thisClass)
3976 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3978 if(!currentClass->symbol)
3979 currentClass->symbol = FindClass(currentClass->fullName);
3980 symbol->type->thisClass = currentClass->symbol;
3985 _class->symbol = FindClass(_class->fullName);
3986 symbol->type->thisClass = _class->symbol;
3989 DeclareType(symbol->type, 0x1, 0x1);
3993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3996 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3999 FreeSpecifier(nameID->_class);
4000 nameID->_class = (((void *)0));
4004 struct Type * type = declarator->symbol->type;
4005 struct External * oldExternal = curExternal;
4007 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4009 struct External * externalDecl;
4011 externalDecl = MkExternalDeclaration((((void *)0)));
4012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4013 if(createdExternal->function)
4015 ProcessFunction(createdExternal->function);
4017 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4019 externalDecl->declaration = decl;
4020 if(decl->symbol && !decl->symbol->pointerExternal)
4021 decl->symbol->pointerExternal = externalDecl;
4022 declarator->symbol->pointerExternal = externalDecl;
4029 curExternal = declarator->symbol->pointerExternal;
4030 ProcessFunction((struct FunctionDefinition *)members->function);
4032 curExternal = external;
4033 curContext = context;
4036 FreeClassFunction(members->function);
4037 exp = QMkExpId(name);
4039 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4040 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4046 if(members->dataMembers && classSym)
4048 struct MemberInit * member;
4049 struct Location oldyyloc = yylloc;
4051 for(member = (*members->dataMembers).first; member; member = member->next)
4053 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4054 if(member->initializer && !member->initializer->isConstant)
4055 inst->isConstant = 0x0;
4067 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4071 if(type->kind == 11)
4073 struct Type * param;
4077 for(param = type->params.first; param; param = param->next)
4078 DeclareType(param, declarePointers, 0x1);
4080 DeclareType(type->returnType, declarePointers, 0x1);
4082 else if(type->kind == 13 && declarePointers)
4083 DeclareType(type->type, declarePointers, 0x0);
4084 else if(type->kind == 8)
4086 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4087 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4089 else if(type->kind == 9 || type->kind == 10)
4091 struct Type * member;
4093 for(member = type->members.first; member; member = member->next)
4094 DeclareType(member, 0x0, 0x0);
4096 else if(type->kind == 12)
4097 DeclareType(type->arrayType, declarePointers, 0x0);
4101 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4103 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4105 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4107 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4108 struct __ecereNameSpace__ecere__com__Class * sClass;
4110 for(sClass = _class; sClass; sClass = sClass->base)
4113 if(sClass->templateClass)
4114 sClass = sClass->templateClass;
4115 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4117 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4119 for(sClass = sClass->base; sClass; sClass = sClass->base)
4121 if(sClass->templateClass)
4122 sClass = sClass->templateClass;
4123 id += sClass->templateParams.count;
4134 arg = &_class->templateArgs[id];
4135 if(arg && param->type == 0)
4136 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4141 extern struct Context * PushContext(void);
4143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4145 struct TemplatedType
4148 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4149 struct __ecereNameSpace__ecere__sys__BTNode * left;
4150 struct __ecereNameSpace__ecere__sys__BTNode * right;
4152 struct TemplateParameter * param;
4153 } __attribute__ ((gcc_struct));
4155 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4157 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4159 struct Context * context = PushContext();
4161 context->templateTypesOnly = 0x1;
4162 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4164 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4166 for(; param; param = param->next)
4168 if(param->type == 0 && param->identifier)
4170 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4172 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4178 struct __ecereNameSpace__ecere__com__Class * sClass;
4180 for(sClass = _class; sClass; sClass = sClass->base)
4182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4184 for(p = sClass->templateParams.first; p; p = p->next)
4188 struct TemplateParameter * param = p->param;
4189 struct TemplatedType * type;
4193 p->param = param = __extension__ ({
4194 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4196 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4199 type = __extension__ ({
4200 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4202 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4204 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4212 extern void PopContext(struct Context * ctx);
4214 extern void FreeContext(struct Context * context);
4216 void FinishTemplatesContext(struct Context * context)
4218 PopContext(context);
4219 FreeContext(context);
4220 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4223 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4225 if(!method->dataType)
4227 struct Context * context = SetupTemplatesContext(method->_class);
4229 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4230 FinishTemplatesContext(context);
4231 if(method->type != 1 && method->dataType)
4233 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4235 if(!method->_class->symbol)
4236 method->_class->symbol = FindClass(method->_class->fullName);
4237 method->dataType->thisClass = method->_class->symbol;
4243 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4247 struct Context * context = SetupTemplatesContext(prop->_class);
4249 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4250 FinishTemplatesContext(context);
4254 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4256 extern void FreeTypeName(struct TypeName * typeName);
4258 static void ProcessDeclarator(struct Declarator * decl);
4260 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4262 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4266 struct MethodImport * prev;
4267 struct MethodImport * next;
4269 unsigned int isVirtual;
4270 } __attribute__ ((gcc_struct));
4272 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4274 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4276 struct Symbol * symbol = method->symbol;
4278 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4280 unsigned int imported = 0x0;
4281 unsigned int dllImport = 0x0;
4283 if(!method->dataType)
4284 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4285 if(!symbol || symbol->_import || method->type == 1)
4287 if(!symbol || method->type == 1)
4289 struct Symbol * classSym;
4291 if(!method->_class->symbol)
4292 method->_class->symbol = FindClass(method->_class->fullName);
4293 classSym = method->_class->symbol;
4294 if(!classSym->_import)
4296 struct ModuleImport * module;
4298 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4299 module = FindModule(method->_class->module);
4301 module = mainModule;
4302 classSym->_import = __extension__ ({
4303 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4305 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4311 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4313 if(!symbol->_import)
4315 symbol->_import = (struct ClassImport *)__extension__ ({
4316 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4318 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4324 symbol->type = method->dataType;
4326 symbol->type->refCount++;
4329 if(!method->dataType->dllExport)
4332 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)
4336 if(method->type != 1 && method->dataType)
4337 DeclareType(method->dataType, 0x1, 0x1);
4338 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4340 struct Declaration * decl;
4341 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4342 struct Declarator * d;
4343 struct Declarator * funcDecl;
4344 struct External * external;
4346 specifiers = MkList();
4347 declarators = MkList();
4349 ListAdd(specifiers, MkSpecifier(EXTERN));
4350 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4351 ListAdd(specifiers, MkSpecifier(STATIC));
4352 if(method->type == 1)
4354 ListAdd(specifiers, MkSpecifier(INT));
4355 d = MkDeclaratorIdentifier(MkIdentifier(name));
4359 d = MkDeclaratorIdentifier(MkIdentifier(name));
4361 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4363 struct Context * context = SetupTemplatesContext(method->_class);
4365 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4366 FinishTemplatesContext(context);
4368 funcDecl = GetFuncDecl(d);
4371 struct Specifier * spec, * next;
4373 for(spec = (*specifiers).first; spec; spec = next)
4378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4379 FreeSpecifier(spec);
4383 if(method->dataType && !method->dataType->staticMethod)
4385 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4387 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4388 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")));
4389 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4390 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4392 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4394 struct TypeName * param = (*funcDecl->function.parameters).first;
4396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4397 FreeTypeName(param);
4399 if(!funcDecl->function.parameters)
4400 funcDecl->function.parameters = MkList();
4401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4405 ProcessDeclarator(d);
4406 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4407 decl = MkDeclaration(specifiers, declarators);
4408 ReplaceThisClassSpecifiers(specifiers, method->_class);
4409 if(symbol->pointerExternal)
4411 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4414 *functionSymbol = *symbol;
4415 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4416 if(functionSymbol->type)
4417 functionSymbol->type->refCount++;
4419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4420 symbol->pointerExternal->symbol = functionSymbol;
4422 external = MkExternalDeclaration(decl);
4424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4425 external->symbol = symbol;
4426 symbol->pointerExternal = external;
4430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4432 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4436 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4438 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4440 unsigned int first = 0x1;
4442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4444 char className[1024];
4446 strcpy(className, _class->fullName);
4447 for(param = _class->templateParams.first; param; param = param->next)
4451 strcat(className, "<");
4453 strcat(className, ", ");
4454 if(lastParam + 1 != p)
4456 strcat(className, param->name);
4457 strcat(className, " = ");
4459 strcat(className, param->name);
4467 int len = strlen(className);
4469 if(className[len - 1] == '>')
4470 className[len++] = ' ';
4471 className[len++] = '>';
4472 className[len++] = '\0';
4474 return __ecereNameSpace__ecere__sys__CopyString(className);
4477 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4480 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4482 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4484 unsigned int first = 0x1;
4486 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4488 char className[1024];
4490 strcpy(className, _class->fullName);
4491 for(param = _class->templateParams.first; param; param = param->next)
4495 strcat(className, "<");
4497 strcat(className, ", ");
4498 if(lastParam + 1 != p)
4500 strcat(className, param->name);
4501 strcat(className, " = ");
4503 strcat(className, param->name);
4511 int len = strlen(className);
4513 if(className[len - 1] == '>')
4514 className[len++] = ' ';
4515 className[len++] = '>';
4516 className[len++] = '\0';
4518 return MkClassType(className);
4522 return MkClassType(_class->fullName);
4526 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4528 if(specs != (((void *)0)) && _class)
4530 struct Specifier * spec;
4532 for(spec = specs->first; spec; spec = spec->next)
4534 if(spec->type == 0 && spec->specifier == THISCLASS)
4537 spec->name = ReplaceThisClass(_class);
4538 spec->symbol = FindClass(spec->name);
4544 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4546 struct __ecereNameSpace__ecere__com__GlobalFunction
4548 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4549 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4552 struct __ecereNameSpace__ecere__com__Instance * module;
4553 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4554 char * dataTypeString;
4555 struct Type * dataType;
4557 } __attribute__ ((gcc_struct));
4559 extern struct Context * globalContext;
4561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4563 struct FunctionImport
4565 struct FunctionImport * prev;
4566 struct FunctionImport * next;
4568 } __attribute__ ((gcc_struct));
4570 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4572 struct Symbol * symbol = function->symbol;
4574 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4576 unsigned int imported = 0x0;
4577 unsigned int dllImport = 0x0;
4579 if(!function->dataType)
4581 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4582 if(!function->dataType->thisClass)
4583 function->dataType->staticMethod = 0x1;
4589 struct ModuleImport * module = FindModule(function->module);
4591 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4594 if(!function->dataType->dllExport)
4596 symbol->_import = (struct ClassImport *)__extension__ ({
4597 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4599 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4601 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4605 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4606 if(!symbol->type->thisClass)
4607 symbol->type->staticMethod = 0x1;
4610 imported = symbol->_import ? 0x1 : 0x0;
4611 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4614 DeclareType(function->dataType, 0x1, 0x1);
4617 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4619 struct Declaration * decl;
4620 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4621 struct Declarator * d;
4622 struct Declarator * funcDecl;
4623 struct External * external;
4625 specifiers = MkList();
4626 declarators = MkList();
4627 ListAdd(specifiers, MkSpecifier(EXTERN));
4628 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4630 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4631 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4632 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4634 struct Specifier * spec;
4636 for(spec = (*specifiers).first; spec; spec = spec->next)
4637 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4639 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4640 FreeSpecifier(spec);
4644 funcDecl = GetFuncDecl(d);
4645 if(funcDecl && !funcDecl->function.parameters)
4647 funcDecl->function.parameters = MkList();
4648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4650 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4652 struct Context * oldCtx = curContext;
4654 curContext = globalContext;
4655 decl = MkDeclaration(specifiers, declarators);
4656 curContext = oldCtx;
4658 if(symbol->pointerExternal)
4660 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4663 *functionSymbol = *symbol;
4664 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4665 if(functionSymbol->type)
4666 functionSymbol->type->refCount++;
4668 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4669 symbol->pointerExternal->symbol = functionSymbol;
4671 external = MkExternalDeclaration(decl);
4673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4674 external->symbol = symbol;
4675 symbol->pointerExternal = external;
4679 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4682 symbol->id = curExternal->symbol->idCode;
4685 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4693 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4694 struct __ecereNameSpace__ecere__sys__BTNode * left;
4695 struct __ecereNameSpace__ecere__sys__BTNode * right;
4697 struct __ecereNameSpace__ecere__com__Instance * module;
4698 char * dataTypeString;
4699 struct Type * dataType;
4702 } __attribute__ ((gcc_struct));
4704 void DeclareGlobalData(struct GlobalData * data)
4706 struct Symbol * symbol = data->symbol;
4708 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4713 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4716 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4717 DeclareType(data->dataType, 0x1, 0x1);
4720 if(!symbol->pointerExternal)
4722 struct Declaration * decl;
4723 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4724 struct Declarator * d;
4725 struct External * external;
4727 specifiers = MkList();
4728 declarators = MkList();
4729 ListAdd(specifiers, MkSpecifier(EXTERN));
4730 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4731 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4732 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4733 decl = MkDeclaration(specifiers, declarators);
4734 external = MkExternalDeclaration(decl);
4736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4737 external->symbol = symbol;
4738 symbol->pointerExternal = external;
4742 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4745 symbol->id = curExternal->symbol->idCode;
4752 struct Conversion * prev, * next;
4753 struct __ecereNameSpace__ecere__com__Property * convert;
4755 struct Type * resultType;
4756 } __attribute__ ((gcc_struct));
4758 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4760 extern void Compiler_Warning(char * format, ...);
4762 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4764 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)
4768 if(source->kind == 20 && dest->kind != 20)
4770 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4775 if(dest->kind == 20 && source->kind != 20)
4777 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4782 if(dest->classObjectType == 2)
4784 if(source->classObjectType != 3)
4788 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4796 if(source->classObjectType == 3)
4798 if(dest->classObjectType == 3 && source->classObjectType != 2)
4801 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4803 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4806 if(dest->kind == 14 && source->kind != 0)
4808 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))
4810 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))
4812 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4814 if(source->_class->registered && source->_class->registered->type == 3)
4816 if(conversions != (((void *)0)))
4818 if(source->_class->registered == dest->_class->registered)
4823 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4825 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4827 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4829 if(sourceBase == destBase)
4833 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))
4837 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))
4839 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4846 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4850 if(source->kind == 8)
4852 struct __ecereNameSpace__ecere__com__Class * _class;
4854 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4856 struct __ecereNameSpace__ecere__com__Property * convert;
4858 for(convert = _class->conversions.first; convert; convert = convert->next)
4860 if(convert->memberAccess == 1 || _class->module == privateModule)
4862 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4864 if(!convert->dataType)
4865 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4866 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4868 if(!conversions && !convert->Get)
4870 else if(conversions != (((void *)0)))
4872 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))
4876 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4889 struct __ecereNameSpace__ecere__com__Class * _class;
4891 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4893 struct __ecereNameSpace__ecere__com__Property * convert;
4895 for(convert = _class->conversions.first; convert; convert = convert->next)
4897 if(convert->memberAccess == 1 || _class->module == privateModule)
4899 if(!convert->dataType)
4900 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4901 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4903 if(!conversions && !convert->Set)
4905 else if(conversions != (((void *)0)))
4907 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))
4911 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4921 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4923 if(!dest->_class->registered->dataType)
4924 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4925 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4927 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4934 if(source->kind == 8)
4936 struct __ecereNameSpace__ecere__com__Class * _class;
4938 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4940 struct __ecereNameSpace__ecere__com__Property * convert;
4942 for(convert = _class->conversions.first; convert; convert = convert->next)
4944 if(convert->memberAccess == 1 || _class->module == privateModule)
4946 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4948 if(!convert->dataType)
4949 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4950 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4952 if(!conversions && !convert->Get)
4954 else if(conversions != (((void *)0)))
4956 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))
4960 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4970 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4972 if(!source->_class->registered->dataType)
4973 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4974 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4981 if(source->kind == 8 || source->kind == 19)
4983 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4985 else if(dest->kind == 7 && source->kind == 6)
4987 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4989 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4991 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4993 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4995 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4997 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))
4999 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5001 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)))
5003 struct Type * paramSource, * paramDest;
5005 if(dest->kind == 16)
5006 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5007 if(source->kind == 16)
5008 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5009 if(dest->kind == 13 && dest->type->kind == 11)
5011 if(source->kind == 13 && source->type->kind == 11)
5012 source = source->type;
5013 if(dest->kind == 16)
5014 dest = dest->method->dataType;
5015 if(source->kind == 16)
5016 source = source->method->dataType;
5017 paramSource = source->params.first;
5018 if(paramSource && paramSource->kind == 0)
5019 paramSource = (((void *)0));
5020 paramDest = dest->params.first;
5021 if(paramDest && paramDest->kind == 0)
5022 paramDest = (((void *)0));
5023 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5025 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))))
5027 if(paramDest && paramDest->kind == 8)
5028 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5033 paramDest = paramDest->next;
5035 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5037 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5041 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5043 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5049 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5058 paramSource = paramSource->next;
5064 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5066 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5072 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5074 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5080 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5082 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5085 for(; paramDest; paramDest = paramDest->next)
5089 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5093 struct Type * paramDestType = paramDest;
5094 struct Type * paramSourceType = paramSource;
5095 struct Type * type = paramDestType;
5097 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5100 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5101 struct __ecereNameSpace__ecere__com__Class * sClass;
5103 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5106 if(sClass->templateClass)
5107 sClass = sClass->templateClass;
5108 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5110 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5112 for(sClass = sClass->base; sClass; sClass = sClass->base)
5114 if(sClass->templateClass)
5115 sClass = sClass->templateClass;
5116 id += sClass->templateParams.count;
5127 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5129 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5132 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)))
5137 PrintType(paramDest, type, 0x0, 0x1);
5138 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5139 if(paramDestType != paramDest)
5140 FreeType(paramDestType);
5143 if(paramDestType != paramDest)
5144 FreeType(paramDestType);
5146 paramSource = paramSource->next;
5150 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5155 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5159 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5161 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5168 static void FreeConvert(struct Conversion * convert)
5170 if(convert->resultType)
5171 FreeType(convert->resultType);
5174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5176 struct __ecereNameSpace__ecere__com__BTNamedLink
5179 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5180 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5181 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5184 } __attribute__ ((gcc_struct));
5186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5188 struct __ecereNameSpace__ecere__com__EnumClassData
5190 struct __ecereNameSpace__ecere__sys__OldList values;
5192 } __attribute__ ((gcc_struct));
5194 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5196 struct __ecereNameSpace__ecere__sys__NamedLink
5198 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5199 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5202 } __attribute__ ((gcc_struct));
5204 extern void FreeExpContents(struct Expression * exp);
5206 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5208 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5210 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5212 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5214 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5216 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5218 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5220 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)))
5222 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5224 if(_class->type == 4)
5226 struct __ecereNameSpace__ecere__sys__OldList converts =
5230 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5234 _class->symbol = FindClass(_class->fullName);
5235 type->_class = _class->symbol;
5236 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5238 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5239 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5243 struct __ecereNameSpace__ecere__com__Class * baseClass;
5245 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5247 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5249 for(value = e->values.first; value; value = value->next)
5251 if(!strcmp(value->name, string))
5256 FreeExpContents(sourceExp);
5257 FreeType(sourceExp->expType);
5258 sourceExp->isConstant = 0x1;
5259 sourceExp->expType = MkClassType(baseClass->fullName);
5263 sourceExp->type = 2;
5264 if(!strcmp(baseClass->dataTypeString, "int"))
5265 sprintf(constant, "%d", (int)value->data);
5267 sprintf(constant, "0x%X", (int)value->data);
5268 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5270 while(converts.first)
5272 struct Conversion * convert = converts.first;
5274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5277 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5284 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5285 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5288 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)))
5289 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5296 struct __ecereNameSpace__ecere__com__SubModule
5298 struct __ecereNameSpace__ecere__com__SubModule * prev;
5299 struct __ecereNameSpace__ecere__com__SubModule * next;
5300 struct __ecereNameSpace__ecere__com__Instance * module;
5302 } __attribute__ ((gcc_struct));
5304 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5306 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5308 if(searchFor == searchIn)
5310 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5312 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5314 if(ModuleVisibility(subModule->module, searchFor))
5321 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5323 struct __ecereNameSpace__ecere__com__Application
5328 unsigned int isGUIApp;
5329 struct __ecereNameSpace__ecere__sys__OldList allModules;
5330 char * parsedCommand;
5331 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5332 } __attribute__ ((gcc_struct));
5334 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5336 struct __ecereNameSpace__ecere__com__Instance * module;
5338 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))
5340 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))
5342 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))
5344 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)
5346 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5352 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5354 void ReadString(char * output, char * string);
5356 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5358 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5360 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5362 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5364 struct Type * source = sourceExp->expType;
5365 struct Type * realDest = dest;
5366 struct Type * backupSourceExpType = (((void *)0));
5368 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5370 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5372 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5374 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5376 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5378 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5380 if(sourceBase == destBase)
5386 struct __ecereNameSpace__ecere__sys__OldList * specs;
5387 unsigned int flag = 0x0;
5388 long long value = (((int)0x7fffffff));
5392 if(sourceExp->type == 2)
5394 if(source->isSigned)
5395 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5397 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5399 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5401 if(source->isSigned)
5402 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5404 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5406 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5409 source = __extension__ ({
5410 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5412 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5417 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5419 if(_class && _class->type == 3)
5421 if(source->kind != 8)
5423 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5424 struct Type * tempDest, * tempSource;
5426 for(; _class->base->type != 1000; _class = _class->base)
5429 tempDest = tempType;
5432 _class->symbol = FindClass(_class->fullName);
5433 tempType->_class = _class->symbol;
5434 tempType->truth = dest->truth;
5435 if(tempType->_class)
5436 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5437 backupSourceExpType = sourceExp->expType;
5438 sourceExp->expType = dest;
5441 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5444 if(_class && _class->type == 2 && source->kind != 8)
5446 if(!dest->_class->registered->dataType)
5447 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5448 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5451 FreeType(sourceExp->expType);
5452 source = sourceExp->expType = MkClassType(dest->_class->string);
5456 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5458 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5459 struct Declarator * decl;
5462 ReadString(string, sourceExp->string);
5463 decl = SpecDeclFromString(string, specs, (((void *)0)));
5464 FreeExpContents(sourceExp);
5465 FreeType(sourceExp->expType);
5466 sourceExp->type = 24;
5467 sourceExp->_classExp.specifiers = specs;
5468 sourceExp->_classExp.decl = decl;
5469 sourceExp->expType = dest;
5473 if(backupSourceExpType)
5474 FreeType(backupSourceExpType);
5478 else if(source->kind == 8)
5480 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5482 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5486 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5487 struct Type * tempDest, * tempSource;
5489 if(!source->_class->registered->dataType)
5490 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5491 for(; _class->base->type != 1000; _class = _class->base)
5494 tempSource = tempType;
5496 tempType->_class = FindClass(_class->fullName);
5497 tempType->truth = source->truth;
5498 tempType->classObjectType = source->classObjectType;
5499 if(tempType->_class)
5500 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5501 if(conversions->last)
5503 ((struct Conversion *)conversions->last)->resultType = dest;
5506 FreeType(sourceExp->expType);
5507 sourceExp->expType = MkClassType(_class->fullName);
5508 sourceExp->expType->truth = source->truth;
5509 sourceExp->expType->classObjectType = source->classObjectType;
5510 if(!sourceExp->destType)
5512 FreeType(sourceExp->destType);
5513 sourceExp->destType = sourceExp->expType;
5514 if(sourceExp->expType)
5515 sourceExp->expType->refCount++;
5517 if(!_class->dataType)
5518 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5520 dest = MkClassType(source->_class->string);
5521 dest->truth = source->truth;
5522 dest->classObjectType = source->classObjectType;
5524 source = _class->dataType;
5526 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5532 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5541 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5543 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5545 if(_class->type == 0 || _class->type == 5)
5547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5549 *newExp = *sourceExp;
5550 if(sourceExp->destType)
5551 sourceExp->destType->refCount++;
5552 if(sourceExp->expType)
5553 sourceExp->expType->refCount++;
5554 sourceExp->type = 11;
5555 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5556 sourceExp->cast.exp = newExp;
5557 FreeType(sourceExp->expType);
5558 sourceExp->expType = (((void *)0));
5559 ProcessExpressionType(sourceExp);
5562 FreeType(sourceExp->expType);
5563 sourceExp->expType = dest;
5568 if(backupSourceExpType)
5569 FreeType(backupSourceExpType);
5572 if(!_class->dataType)
5573 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5575 dest = _class->dataType;
5578 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))
5580 specs = MkListOne(MkSpecifier(DOUBLE));
5582 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))
5584 specs = MkListOne(MkSpecifier(FLOAT));
5586 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))
5590 ListAdd(specs, MkSpecifier(UNSIGNED));
5591 ListAdd(specs, MkSpecifier(INT64));
5593 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5597 ListAdd(specs, MkSpecifier(UNSIGNED));
5598 ListAdd(specs, MkSpecifier(INT));
5600 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5604 ListAdd(specs, MkSpecifier(UNSIGNED));
5605 ListAdd(specs, MkSpecifier(SHORT));
5607 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5611 ListAdd(specs, MkSpecifier(UNSIGNED));
5612 ListAdd(specs, MkSpecifier(CHAR));
5618 if(backupSourceExpType)
5620 if(sourceExp->expType)
5621 FreeType(sourceExp->expType);
5622 sourceExp->expType = backupSourceExpType;
5627 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))
5629 specs = MkListOne(MkSpecifier(DOUBLE));
5631 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))
5633 specs = MkListOne(MkSpecifier(FLOAT));
5635 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5638 ListAdd(specs, MkSpecifier(BOOL));
5640 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)))
5644 ListAdd(specs, MkSpecifier(UNSIGNED));
5645 ListAdd(specs, MkSpecifier(CHAR));
5647 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)))))
5651 ListAdd(specs, MkSpecifier(UNSIGNED));
5652 ListAdd(specs, MkSpecifier(SHORT));
5654 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5658 ListAdd(specs, MkSpecifier(UNSIGNED));
5659 ListAdd(specs, MkSpecifier(INT));
5661 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5665 ListAdd(specs, MkSpecifier(UNSIGNED));
5666 ListAdd(specs, MkSpecifier(INT64));
5668 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5670 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5676 if(backupSourceExpType)
5678 if(sourceExp->expType)
5679 FreeType(sourceExp->expType);
5680 sourceExp->expType = backupSourceExpType;
5686 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5688 *newExp = *sourceExp;
5689 newExp->prev = (((void *)0));
5690 newExp->next = (((void *)0));
5691 if(sourceExp->destType)
5692 sourceExp->destType->refCount++;
5693 if(sourceExp->expType)
5694 sourceExp->expType->refCount++;
5695 sourceExp->type = 11;
5696 if(realDest->kind == 8)
5698 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5699 FreeList(specs, FreeSpecifier);
5702 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5703 if(newExp->type == 4)
5705 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5708 sourceExp->cast.exp = newExp;
5709 FreeType(sourceExp->expType);
5710 sourceExp->expType = (((void *)0));
5711 ProcessExpressionType(sourceExp);
5714 FreeList(specs, FreeSpecifier);
5717 if(backupSourceExpType)
5718 FreeType(backupSourceExpType);
5723 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5724 sourceExp = (*sourceExp->list).last;
5725 if(sourceExp->type == 0)
5727 struct Identifier * id = sourceExp->identifier;
5731 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5733 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5734 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5738 for(; _class && _class->type == 4; _class = _class->base)
5740 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5741 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5743 for(value = e->values.first; value; value = value->next)
5745 if(!strcmp(value->name, id->string))
5750 FreeExpContents(sourceExp);
5751 FreeType(sourceExp->expType);
5752 sourceExp->isConstant = 0x1;
5753 sourceExp->expType = MkClassType(_class->fullName);
5757 sourceExp->type = 2;
5758 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5759 sprintf(constant, "%d", (int)value->data);
5761 sprintf(constant, "0x%X", (int)value->data);
5762 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5770 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5777 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5779 int value2 = op2->i;
5782 exp->string = PrintInt(op1->i + value2);
5785 exp->expType = op1->type;
5787 op1->type->refCount++;
5792 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5794 unsigned int value2 = op2->ui;
5797 exp->string = PrintUInt(op1->ui + value2);
5800 exp->expType = op1->type;
5802 op1->type->refCount++;
5807 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5809 long long value2 = op2->i64;
5812 exp->string = PrintInt64(op1->i64 + value2);
5815 exp->expType = op1->type;
5817 op1->type->refCount++;
5822 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5824 uint64 value2 = op2->ui64;
5827 exp->string = PrintUInt64(op1->ui64 + value2);
5830 exp->expType = op1->type;
5832 op1->type->refCount++;
5837 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5839 short value2 = op2->s;
5842 exp->string = PrintShort(op1->s + value2);
5845 exp->expType = op1->type;
5847 op1->type->refCount++;
5852 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5854 unsigned short value2 = op2->us;
5857 exp->string = PrintUShort(op1->us + value2);
5860 exp->expType = op1->type;
5862 op1->type->refCount++;
5867 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5869 char value2 = op2->c;
5872 exp->string = PrintChar(op1->c + value2);
5875 exp->expType = op1->type;
5877 op1->type->refCount++;
5882 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5884 unsigned char value2 = op2->uc;
5887 exp->string = PrintUChar(op1->uc + value2);
5890 exp->expType = op1->type;
5892 op1->type->refCount++;
5897 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5899 float value2 = op2->f;
5902 exp->string = PrintFloat(op1->f + value2);
5905 exp->expType = op1->type;
5907 op1->type->refCount++;
5912 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5914 double value2 = op2->d;
5917 exp->string = PrintDouble(op1->d + value2);
5920 exp->expType = op1->type;
5922 op1->type->refCount++;
5927 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5929 int value2 = op2->i;
5932 exp->string = PrintInt(op1->i - value2);
5935 exp->expType = op1->type;
5937 op1->type->refCount++;
5942 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5944 unsigned int value2 = op2->ui;
5947 exp->string = PrintUInt(op1->ui - value2);
5950 exp->expType = op1->type;
5952 op1->type->refCount++;
5957 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5959 long long value2 = op2->i64;
5962 exp->string = PrintInt64(op1->i64 - value2);
5965 exp->expType = op1->type;
5967 op1->type->refCount++;
5972 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5974 uint64 value2 = op2->ui64;
5977 exp->string = PrintUInt64(op1->ui64 - value2);
5980 exp->expType = op1->type;
5982 op1->type->refCount++;
5987 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5989 short value2 = op2->s;
5992 exp->string = PrintShort(op1->s - value2);
5995 exp->expType = op1->type;
5997 op1->type->refCount++;
6002 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6004 unsigned short value2 = op2->us;
6007 exp->string = PrintUShort(op1->us - value2);
6010 exp->expType = op1->type;
6012 op1->type->refCount++;
6017 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6019 char value2 = op2->c;
6022 exp->string = PrintChar(op1->c - value2);
6025 exp->expType = op1->type;
6027 op1->type->refCount++;
6032 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6034 unsigned char value2 = op2->uc;
6037 exp->string = PrintUChar(op1->uc - value2);
6040 exp->expType = op1->type;
6042 op1->type->refCount++;
6047 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6049 float value2 = op2->f;
6052 exp->string = PrintFloat(op1->f - value2);
6055 exp->expType = op1->type;
6057 op1->type->refCount++;
6062 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6064 double value2 = op2->d;
6067 exp->string = PrintDouble(op1->d - value2);
6070 exp->expType = op1->type;
6072 op1->type->refCount++;
6077 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6079 int value2 = op2->i;
6082 exp->string = PrintInt(op1->i * value2);
6085 exp->expType = op1->type;
6087 op1->type->refCount++;
6092 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6094 unsigned int value2 = op2->ui;
6097 exp->string = PrintUInt(op1->ui * value2);
6100 exp->expType = op1->type;
6102 op1->type->refCount++;
6107 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6109 long long value2 = op2->i64;
6112 exp->string = PrintInt64(op1->i64 * value2);
6115 exp->expType = op1->type;
6117 op1->type->refCount++;
6122 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6124 uint64 value2 = op2->ui64;
6127 exp->string = PrintUInt64(op1->ui64 * value2);
6130 exp->expType = op1->type;
6132 op1->type->refCount++;
6137 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6139 short value2 = op2->s;
6142 exp->string = PrintShort(op1->s * value2);
6145 exp->expType = op1->type;
6147 op1->type->refCount++;
6152 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6154 unsigned short value2 = op2->us;
6157 exp->string = PrintUShort(op1->us * value2);
6160 exp->expType = op1->type;
6162 op1->type->refCount++;
6167 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6169 char value2 = op2->c;
6172 exp->string = PrintChar(op1->c * value2);
6175 exp->expType = op1->type;
6177 op1->type->refCount++;
6182 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6184 unsigned char value2 = op2->uc;
6187 exp->string = PrintUChar(op1->uc * value2);
6190 exp->expType = op1->type;
6192 op1->type->refCount++;
6197 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6199 float value2 = op2->f;
6202 exp->string = PrintFloat(op1->f * value2);
6205 exp->expType = op1->type;
6207 op1->type->refCount++;
6212 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6214 double value2 = op2->d;
6217 exp->string = PrintDouble(op1->d * value2);
6220 exp->expType = op1->type;
6222 op1->type->refCount++;
6227 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6229 int value2 = op2->i;
6232 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6235 exp->expType = op1->type;
6237 op1->type->refCount++;
6242 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6244 unsigned int value2 = op2->ui;
6247 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6250 exp->expType = op1->type;
6252 op1->type->refCount++;
6257 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6259 long long value2 = op2->i64;
6262 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6265 exp->expType = op1->type;
6267 op1->type->refCount++;
6272 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6274 uint64 value2 = op2->ui64;
6277 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6280 exp->expType = op1->type;
6282 op1->type->refCount++;
6287 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6289 short value2 = op2->s;
6292 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6295 exp->expType = op1->type;
6297 op1->type->refCount++;
6302 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6304 unsigned short value2 = op2->us;
6307 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6319 char value2 = op2->c;
6322 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6325 exp->expType = op1->type;
6327 op1->type->refCount++;
6332 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6334 unsigned char value2 = op2->uc;
6337 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6340 exp->expType = op1->type;
6342 op1->type->refCount++;
6347 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6349 float value2 = op2->f;
6352 exp->string = PrintFloat(op1->f / value2);
6355 exp->expType = op1->type;
6357 op1->type->refCount++;
6362 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6364 double value2 = op2->d;
6367 exp->string = PrintDouble(op1->d / value2);
6370 exp->expType = op1->type;
6372 op1->type->refCount++;
6377 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6379 int value2 = op2->i;
6382 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6385 exp->expType = op1->type;
6387 op1->type->refCount++;
6392 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6394 unsigned int value2 = op2->ui;
6397 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6400 exp->expType = op1->type;
6402 op1->type->refCount++;
6407 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6409 long long value2 = op2->i64;
6412 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6415 exp->expType = op1->type;
6417 op1->type->refCount++;
6422 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6424 uint64 value2 = op2->ui64;
6427 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6430 exp->expType = op1->type;
6432 op1->type->refCount++;
6437 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6439 short value2 = op2->s;
6442 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6445 exp->expType = op1->type;
6447 op1->type->refCount++;
6452 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6454 unsigned short value2 = op2->us;
6457 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6460 exp->expType = op1->type;
6462 op1->type->refCount++;
6467 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6469 char value2 = op2->c;
6472 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6475 exp->expType = op1->type;
6477 op1->type->refCount++;
6482 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6484 unsigned char value2 = op2->uc;
6487 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6490 exp->expType = op1->type;
6492 op1->type->refCount++;
6497 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6500 exp->string = PrintInt((-op1->i));
6503 exp->expType = op1->type;
6505 op1->type->refCount++;
6510 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6513 exp->string = PrintUInt((unsigned int)(-op1->ui));
6516 exp->expType = op1->type;
6518 op1->type->refCount++;
6523 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6526 exp->string = PrintInt64((-op1->i64));
6529 exp->expType = op1->type;
6531 op1->type->refCount++;
6536 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6539 exp->string = PrintUInt64((uint64)(-op1->ui64));
6542 exp->expType = op1->type;
6544 op1->type->refCount++;
6549 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6552 exp->string = PrintShort((-op1->s));
6555 exp->expType = op1->type;
6557 op1->type->refCount++;
6562 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6565 exp->string = PrintUShort((unsigned short)(-op1->us));
6568 exp->expType = op1->type;
6570 op1->type->refCount++;
6575 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6578 exp->string = PrintChar((-op1->c));
6581 exp->expType = op1->type;
6583 op1->type->refCount++;
6588 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6591 exp->string = PrintUChar((unsigned char)(-op1->uc));
6594 exp->expType = op1->type;
6596 op1->type->refCount++;
6601 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6604 exp->string = PrintFloat((float)(-op1->f));
6607 exp->expType = op1->type;
6609 op1->type->refCount++;
6614 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6617 exp->string = PrintDouble((double)(-op1->d));
6620 exp->expType = op1->type;
6622 op1->type->refCount++;
6627 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6630 exp->string = PrintInt((++op1->i));
6633 exp->expType = op1->type;
6635 op1->type->refCount++;
6640 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6643 exp->string = PrintUInt((++op1->ui));
6646 exp->expType = op1->type;
6648 op1->type->refCount++;
6653 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6656 exp->string = PrintInt64((++op1->i64));
6659 exp->expType = op1->type;
6661 op1->type->refCount++;
6666 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6669 exp->string = PrintUInt64((++op1->ui64));
6672 exp->expType = op1->type;
6674 op1->type->refCount++;
6679 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6682 exp->string = PrintShort((++op1->s));
6685 exp->expType = op1->type;
6687 op1->type->refCount++;
6692 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6695 exp->string = PrintUShort((++op1->us));
6698 exp->expType = op1->type;
6700 op1->type->refCount++;
6705 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6708 exp->string = PrintChar((++op1->c));
6711 exp->expType = op1->type;
6713 op1->type->refCount++;
6718 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6721 exp->string = PrintUChar((++op1->uc));
6724 exp->expType = op1->type;
6726 op1->type->refCount++;
6731 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6734 exp->string = PrintFloat((float)(++op1->f));
6737 exp->expType = op1->type;
6739 op1->type->refCount++;
6744 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6747 exp->string = PrintDouble((double)(++op1->d));
6750 exp->expType = op1->type;
6752 op1->type->refCount++;
6757 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6760 exp->string = PrintInt((--op1->i));
6763 exp->expType = op1->type;
6765 op1->type->refCount++;
6770 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6773 exp->string = PrintUInt((--op1->ui));
6776 exp->expType = op1->type;
6778 op1->type->refCount++;
6783 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6786 exp->string = PrintInt64((--op1->i64));
6789 exp->expType = op1->type;
6791 op1->type->refCount++;
6796 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6799 exp->string = PrintUInt64((--op1->ui64));
6802 exp->expType = op1->type;
6804 op1->type->refCount++;
6809 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6812 exp->string = PrintShort((--op1->s));
6815 exp->expType = op1->type;
6817 op1->type->refCount++;
6822 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6825 exp->string = PrintUShort((--op1->us));
6828 exp->expType = op1->type;
6830 op1->type->refCount++;
6835 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6838 exp->string = PrintChar((--op1->c));
6841 exp->expType = op1->type;
6843 op1->type->refCount++;
6848 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6851 exp->string = PrintUChar((--op1->uc));
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6864 exp->string = PrintFloat((float)(--op1->f));
6867 exp->expType = op1->type;
6869 op1->type->refCount++;
6874 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6877 exp->string = PrintDouble((double)(--op1->d));
6880 exp->expType = op1->type;
6882 op1->type->refCount++;
6887 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6889 int value2 = op2->i;
6892 exp->string = PrintInt(op1->i = value2);
6895 exp->expType = op1->type;
6897 op1->type->refCount++;
6902 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6904 unsigned int value2 = op2->ui;
6907 exp->string = PrintUInt(op1->ui = value2);
6910 exp->expType = op1->type;
6912 op1->type->refCount++;
6917 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6919 long long value2 = op2->i64;
6922 exp->string = PrintInt64(op1->i64 = value2);
6925 exp->expType = op1->type;
6927 op1->type->refCount++;
6932 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6934 uint64 value2 = op2->ui64;
6937 exp->string = PrintUInt64(op1->ui64 = value2);
6940 exp->expType = op1->type;
6942 op1->type->refCount++;
6947 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6949 short value2 = op2->s;
6952 exp->string = PrintShort(op1->s = value2);
6955 exp->expType = op1->type;
6957 op1->type->refCount++;
6962 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6964 unsigned short value2 = op2->us;
6967 exp->string = PrintUShort(op1->us = value2);
6970 exp->expType = op1->type;
6972 op1->type->refCount++;
6977 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6979 char value2 = op2->c;
6982 exp->string = PrintChar(op1->c = value2);
6985 exp->expType = op1->type;
6987 op1->type->refCount++;
6992 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6994 unsigned char value2 = op2->uc;
6997 exp->string = PrintUChar(op1->uc = value2);
7000 exp->expType = op1->type;
7002 op1->type->refCount++;
7007 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7009 float value2 = op2->f;
7012 exp->string = PrintFloat(op1->f = value2);
7015 exp->expType = op1->type;
7017 op1->type->refCount++;
7022 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7024 double value2 = op2->d;
7027 exp->string = PrintDouble(op1->d = value2);
7030 exp->expType = op1->type;
7032 op1->type->refCount++;
7037 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7039 int value2 = op2->i;
7042 exp->string = PrintInt(op1->i += value2);
7045 exp->expType = op1->type;
7047 op1->type->refCount++;
7052 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7054 unsigned int value2 = op2->ui;
7057 exp->string = PrintUInt(op1->ui += value2);
7060 exp->expType = op1->type;
7062 op1->type->refCount++;
7067 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7069 long long value2 = op2->i64;
7072 exp->string = PrintInt64(op1->i64 += value2);
7075 exp->expType = op1->type;
7077 op1->type->refCount++;
7082 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7084 uint64 value2 = op2->ui64;
7087 exp->string = PrintUInt64(op1->ui64 += value2);
7090 exp->expType = op1->type;
7092 op1->type->refCount++;
7097 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7099 short value2 = op2->s;
7102 exp->string = PrintShort(op1->s += value2);
7105 exp->expType = op1->type;
7107 op1->type->refCount++;
7112 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7114 unsigned short value2 = op2->us;
7117 exp->string = PrintUShort(op1->us += value2);
7120 exp->expType = op1->type;
7122 op1->type->refCount++;
7127 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7129 char value2 = op2->c;
7132 exp->string = PrintChar(op1->c += value2);
7135 exp->expType = op1->type;
7137 op1->type->refCount++;
7142 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7144 unsigned char value2 = op2->uc;
7147 exp->string = PrintUChar(op1->uc += value2);
7150 exp->expType = op1->type;
7152 op1->type->refCount++;
7157 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7159 float value2 = op2->f;
7162 exp->string = PrintFloat(op1->f += value2);
7165 exp->expType = op1->type;
7167 op1->type->refCount++;
7172 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7174 double value2 = op2->d;
7177 exp->string = PrintDouble(op1->d += value2);
7180 exp->expType = op1->type;
7182 op1->type->refCount++;
7187 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7189 int value2 = op2->i;
7192 exp->string = PrintInt(op1->i -= value2);
7195 exp->expType = op1->type;
7197 op1->type->refCount++;
7202 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7204 unsigned int value2 = op2->ui;
7207 exp->string = PrintUInt(op1->ui -= value2);
7210 exp->expType = op1->type;
7212 op1->type->refCount++;
7217 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7219 long long value2 = op2->i64;
7222 exp->string = PrintInt64(op1->i64 -= value2);
7225 exp->expType = op1->type;
7227 op1->type->refCount++;
7232 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7234 uint64 value2 = op2->ui64;
7237 exp->string = PrintUInt64(op1->ui64 -= value2);
7240 exp->expType = op1->type;
7242 op1->type->refCount++;
7247 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7249 short value2 = op2->s;
7252 exp->string = PrintShort(op1->s -= value2);
7255 exp->expType = op1->type;
7257 op1->type->refCount++;
7262 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7264 unsigned short value2 = op2->us;
7267 exp->string = PrintUShort(op1->us -= value2);
7270 exp->expType = op1->type;
7272 op1->type->refCount++;
7277 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7279 char value2 = op2->c;
7282 exp->string = PrintChar(op1->c -= value2);
7285 exp->expType = op1->type;
7287 op1->type->refCount++;
7292 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7294 unsigned char value2 = op2->uc;
7297 exp->string = PrintUChar(op1->uc -= value2);
7300 exp->expType = op1->type;
7302 op1->type->refCount++;
7307 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7309 float value2 = op2->f;
7312 exp->string = PrintFloat(op1->f -= value2);
7315 exp->expType = op1->type;
7317 op1->type->refCount++;
7322 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7324 double value2 = op2->d;
7327 exp->string = PrintDouble(op1->d -= value2);
7330 exp->expType = op1->type;
7332 op1->type->refCount++;
7337 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7339 int value2 = op2->i;
7342 exp->string = PrintInt(op1->i *= value2);
7345 exp->expType = op1->type;
7347 op1->type->refCount++;
7352 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7354 unsigned int value2 = op2->ui;
7357 exp->string = PrintUInt(op1->ui *= value2);
7360 exp->expType = op1->type;
7362 op1->type->refCount++;
7367 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7369 long long value2 = op2->i64;
7372 exp->string = PrintInt64(op1->i64 *= value2);
7375 exp->expType = op1->type;
7377 op1->type->refCount++;
7382 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7384 uint64 value2 = op2->ui64;
7387 exp->string = PrintUInt64(op1->ui64 *= value2);
7390 exp->expType = op1->type;
7392 op1->type->refCount++;
7397 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7399 short value2 = op2->s;
7402 exp->string = PrintShort(op1->s *= value2);
7405 exp->expType = op1->type;
7407 op1->type->refCount++;
7412 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7414 unsigned short value2 = op2->us;
7417 exp->string = PrintUShort(op1->us *= value2);
7420 exp->expType = op1->type;
7422 op1->type->refCount++;
7427 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7429 char value2 = op2->c;
7432 exp->string = PrintChar(op1->c *= value2);
7435 exp->expType = op1->type;
7437 op1->type->refCount++;
7442 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7444 unsigned char value2 = op2->uc;
7447 exp->string = PrintUChar(op1->uc *= value2);
7450 exp->expType = op1->type;
7452 op1->type->refCount++;
7457 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7459 float value2 = op2->f;
7462 exp->string = PrintFloat(op1->f *= value2);
7465 exp->expType = op1->type;
7467 op1->type->refCount++;
7472 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7474 double value2 = op2->d;
7477 exp->string = PrintDouble(op1->d *= value2);
7480 exp->expType = op1->type;
7482 op1->type->refCount++;
7487 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7489 int value2 = op2->i;
7492 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7495 exp->expType = op1->type;
7497 op1->type->refCount++;
7502 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7504 unsigned int value2 = op2->ui;
7507 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7510 exp->expType = op1->type;
7512 op1->type->refCount++;
7517 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7519 long long value2 = op2->i64;
7522 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7525 exp->expType = op1->type;
7527 op1->type->refCount++;
7532 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7534 uint64 value2 = op2->ui64;
7537 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7540 exp->expType = op1->type;
7542 op1->type->refCount++;
7547 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7549 short value2 = op2->s;
7552 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7555 exp->expType = op1->type;
7557 op1->type->refCount++;
7562 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7564 unsigned short value2 = op2->us;
7567 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7570 exp->expType = op1->type;
7572 op1->type->refCount++;
7577 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7579 char value2 = op2->c;
7582 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7585 exp->expType = op1->type;
7587 op1->type->refCount++;
7592 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7594 unsigned char value2 = op2->uc;
7597 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7600 exp->expType = op1->type;
7602 op1->type->refCount++;
7607 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7609 float value2 = op2->f;
7612 exp->string = PrintFloat(op1->f /= value2);
7615 exp->expType = op1->type;
7617 op1->type->refCount++;
7622 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7624 double value2 = op2->d;
7627 exp->string = PrintDouble(op1->d /= value2);
7630 exp->expType = op1->type;
7632 op1->type->refCount++;
7637 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7639 int value2 = op2->i;
7642 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7654 unsigned int value2 = op2->ui;
7657 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7660 exp->expType = op1->type;
7662 op1->type->refCount++;
7667 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7669 long long value2 = op2->i64;
7672 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7675 exp->expType = op1->type;
7677 op1->type->refCount++;
7682 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7684 uint64 value2 = op2->ui64;
7687 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7690 exp->expType = op1->type;
7692 op1->type->refCount++;
7697 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7699 short value2 = op2->s;
7702 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7705 exp->expType = op1->type;
7707 op1->type->refCount++;
7712 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7714 unsigned short value2 = op2->us;
7717 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7720 exp->expType = op1->type;
7722 op1->type->refCount++;
7727 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7729 char value2 = op2->c;
7732 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7735 exp->expType = op1->type;
7737 op1->type->refCount++;
7742 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7744 unsigned char value2 = op2->uc;
7747 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7750 exp->expType = op1->type;
7752 op1->type->refCount++;
7757 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7759 int value2 = op2->i;
7762 exp->string = PrintInt(op1->i & value2);
7765 exp->expType = op1->type;
7767 op1->type->refCount++;
7772 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7774 unsigned int value2 = op2->ui;
7777 exp->string = PrintUInt(op1->ui & value2);
7780 exp->expType = op1->type;
7782 op1->type->refCount++;
7787 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7789 long long value2 = op2->i64;
7792 exp->string = PrintInt64(op1->i64 & value2);
7795 exp->expType = op1->type;
7797 op1->type->refCount++;
7802 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7804 uint64 value2 = op2->ui64;
7807 exp->string = PrintUInt64(op1->ui64 & value2);
7810 exp->expType = op1->type;
7812 op1->type->refCount++;
7817 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7819 short value2 = op2->s;
7822 exp->string = PrintShort(op1->s & value2);
7825 exp->expType = op1->type;
7827 op1->type->refCount++;
7832 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7834 unsigned short value2 = op2->us;
7837 exp->string = PrintUShort(op1->us & value2);
7840 exp->expType = op1->type;
7842 op1->type->refCount++;
7847 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7849 char value2 = op2->c;
7852 exp->string = PrintChar(op1->c & value2);
7855 exp->expType = op1->type;
7857 op1->type->refCount++;
7862 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7864 unsigned char value2 = op2->uc;
7867 exp->string = PrintUChar(op1->uc & value2);
7870 exp->expType = op1->type;
7872 op1->type->refCount++;
7877 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7879 int value2 = op2->i;
7882 exp->string = PrintInt(op1->i | value2);
7885 exp->expType = op1->type;
7887 op1->type->refCount++;
7892 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7894 unsigned int value2 = op2->ui;
7897 exp->string = PrintUInt(op1->ui | value2);
7900 exp->expType = op1->type;
7902 op1->type->refCount++;
7907 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7909 long long value2 = op2->i64;
7912 exp->string = PrintInt64(op1->i64 | value2);
7915 exp->expType = op1->type;
7917 op1->type->refCount++;
7922 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7924 uint64 value2 = op2->ui64;
7927 exp->string = PrintUInt64(op1->ui64 | value2);
7930 exp->expType = op1->type;
7932 op1->type->refCount++;
7937 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7939 short value2 = op2->s;
7942 exp->string = PrintShort(op1->s | value2);
7945 exp->expType = op1->type;
7947 op1->type->refCount++;
7952 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7954 unsigned short value2 = op2->us;
7957 exp->string = PrintUShort(op1->us | value2);
7960 exp->expType = op1->type;
7962 op1->type->refCount++;
7967 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7969 char value2 = op2->c;
7972 exp->string = PrintChar(op1->c | value2);
7975 exp->expType = op1->type;
7977 op1->type->refCount++;
7982 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7984 unsigned char value2 = op2->uc;
7987 exp->string = PrintUChar(op1->uc | value2);
7990 exp->expType = op1->type;
7992 op1->type->refCount++;
7997 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7999 int value2 = op2->i;
8002 exp->string = PrintInt(op1->i ^ value2);
8005 exp->expType = op1->type;
8007 op1->type->refCount++;
8012 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8014 unsigned int value2 = op2->ui;
8017 exp->string = PrintUInt(op1->ui ^ value2);
8020 exp->expType = op1->type;
8022 op1->type->refCount++;
8027 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8029 long long value2 = op2->i64;
8032 exp->string = PrintInt64(op1->i64 ^ value2);
8035 exp->expType = op1->type;
8037 op1->type->refCount++;
8042 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8044 uint64 value2 = op2->ui64;
8047 exp->string = PrintUInt64(op1->ui64 ^ value2);
8050 exp->expType = op1->type;
8052 op1->type->refCount++;
8057 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8059 short value2 = op2->s;
8062 exp->string = PrintShort(op1->s ^ value2);
8065 exp->expType = op1->type;
8067 op1->type->refCount++;
8072 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8074 unsigned short value2 = op2->us;
8077 exp->string = PrintUShort(op1->us ^ value2);
8080 exp->expType = op1->type;
8082 op1->type->refCount++;
8087 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8089 char value2 = op2->c;
8092 exp->string = PrintChar(op1->c ^ value2);
8095 exp->expType = op1->type;
8097 op1->type->refCount++;
8102 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8104 unsigned char value2 = op2->uc;
8107 exp->string = PrintUChar(op1->uc ^ value2);
8110 exp->expType = op1->type;
8112 op1->type->refCount++;
8117 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8119 int value2 = op2->i;
8122 exp->string = PrintInt(op1->i << value2);
8125 exp->expType = op1->type;
8127 op1->type->refCount++;
8132 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8134 unsigned int value2 = op2->ui;
8137 exp->string = PrintUInt(op1->ui << value2);
8140 exp->expType = op1->type;
8142 op1->type->refCount++;
8147 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8149 long long value2 = op2->i64;
8152 exp->string = PrintInt64(op1->i64 << value2);
8155 exp->expType = op1->type;
8157 op1->type->refCount++;
8162 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8164 uint64 value2 = op2->ui64;
8167 exp->string = PrintUInt64(op1->ui64 << value2);
8170 exp->expType = op1->type;
8172 op1->type->refCount++;
8177 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8179 short value2 = op2->s;
8182 exp->string = PrintShort(op1->s << value2);
8185 exp->expType = op1->type;
8187 op1->type->refCount++;
8192 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8194 unsigned short value2 = op2->us;
8197 exp->string = PrintUShort(op1->us << value2);
8200 exp->expType = op1->type;
8202 op1->type->refCount++;
8207 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8209 char value2 = op2->c;
8212 exp->string = PrintChar(op1->c << value2);
8215 exp->expType = op1->type;
8217 op1->type->refCount++;
8222 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8224 unsigned char value2 = op2->uc;
8227 exp->string = PrintUChar(op1->uc << value2);
8230 exp->expType = op1->type;
8232 op1->type->refCount++;
8237 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8239 int value2 = op2->i;
8242 exp->string = PrintInt(op1->i >> value2);
8245 exp->expType = op1->type;
8247 op1->type->refCount++;
8252 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8254 unsigned int value2 = op2->ui;
8257 exp->string = PrintUInt(op1->ui >> value2);
8260 exp->expType = op1->type;
8262 op1->type->refCount++;
8267 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8269 long long value2 = op2->i64;
8272 exp->string = PrintInt64(op1->i64 >> value2);
8275 exp->expType = op1->type;
8277 op1->type->refCount++;
8282 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8284 uint64 value2 = op2->ui64;
8287 exp->string = PrintUInt64(op1->ui64 >> value2);
8290 exp->expType = op1->type;
8292 op1->type->refCount++;
8297 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8299 short value2 = op2->s;
8302 exp->string = PrintShort(op1->s >> value2);
8305 exp->expType = op1->type;
8307 op1->type->refCount++;
8312 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8314 unsigned short value2 = op2->us;
8317 exp->string = PrintUShort(op1->us >> value2);
8320 exp->expType = op1->type;
8322 op1->type->refCount++;
8327 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8329 char value2 = op2->c;
8332 exp->string = PrintChar(op1->c >> value2);
8335 exp->expType = op1->type;
8337 op1->type->refCount++;
8342 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8344 unsigned char value2 = op2->uc;
8347 exp->string = PrintUChar(op1->uc >> value2);
8350 exp->expType = op1->type;
8352 op1->type->refCount++;
8357 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8360 exp->string = PrintInt((~op1->i));
8363 exp->expType = op1->type;
8365 op1->type->refCount++;
8370 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8373 exp->string = PrintUInt((unsigned int)(~op1->ui));
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8386 exp->string = PrintInt64((long long)(~op1->i64));
8389 exp->expType = op1->type;
8391 op1->type->refCount++;
8396 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8399 exp->string = PrintUInt64((uint64)(~op1->ui64));
8402 exp->expType = op1->type;
8404 op1->type->refCount++;
8409 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8412 exp->string = PrintShort((short)(~op1->s));
8415 exp->expType = op1->type;
8417 op1->type->refCount++;
8422 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8425 exp->string = PrintUShort((unsigned short)(~op1->us));
8428 exp->expType = op1->type;
8430 op1->type->refCount++;
8435 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8438 exp->string = PrintChar((char)(~op1->c));
8441 exp->expType = op1->type;
8443 op1->type->refCount++;
8448 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8451 exp->string = PrintUChar((unsigned char)(~op1->uc));
8454 exp->expType = op1->type;
8456 op1->type->refCount++;
8461 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8463 int value2 = op2->i;
8466 exp->string = PrintInt(op1->i &= value2);
8469 exp->expType = op1->type;
8471 op1->type->refCount++;
8476 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8478 unsigned int value2 = op2->ui;
8481 exp->string = PrintUInt(op1->ui &= value2);
8484 exp->expType = op1->type;
8486 op1->type->refCount++;
8491 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8493 long long value2 = op2->i64;
8496 exp->string = PrintInt64(op1->i64 &= value2);
8499 exp->expType = op1->type;
8501 op1->type->refCount++;
8506 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8508 uint64 value2 = op2->ui64;
8511 exp->string = PrintUInt64(op1->ui64 &= value2);
8514 exp->expType = op1->type;
8516 op1->type->refCount++;
8521 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8523 short value2 = op2->s;
8526 exp->string = PrintShort(op1->s &= value2);
8529 exp->expType = op1->type;
8531 op1->type->refCount++;
8536 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8538 unsigned short value2 = op2->us;
8541 exp->string = PrintUShort(op1->us &= value2);
8544 exp->expType = op1->type;
8546 op1->type->refCount++;
8551 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8553 char value2 = op2->c;
8556 exp->string = PrintChar(op1->c &= value2);
8559 exp->expType = op1->type;
8561 op1->type->refCount++;
8566 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8568 unsigned char value2 = op2->uc;
8571 exp->string = PrintUChar(op1->uc &= value2);
8574 exp->expType = op1->type;
8576 op1->type->refCount++;
8581 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8583 int value2 = op2->i;
8586 exp->string = PrintInt(op1->i |= value2);
8589 exp->expType = op1->type;
8591 op1->type->refCount++;
8596 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8598 unsigned int value2 = op2->ui;
8601 exp->string = PrintUInt(op1->ui |= value2);
8604 exp->expType = op1->type;
8606 op1->type->refCount++;
8611 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8613 long long value2 = op2->i64;
8616 exp->string = PrintInt64(op1->i64 |= value2);
8619 exp->expType = op1->type;
8621 op1->type->refCount++;
8626 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8628 uint64 value2 = op2->ui64;
8631 exp->string = PrintUInt64(op1->ui64 |= value2);
8634 exp->expType = op1->type;
8636 op1->type->refCount++;
8641 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8643 short value2 = op2->s;
8646 exp->string = PrintShort(op1->s |= value2);
8649 exp->expType = op1->type;
8651 op1->type->refCount++;
8656 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8658 unsigned short value2 = op2->us;
8661 exp->string = PrintUShort(op1->us |= value2);
8664 exp->expType = op1->type;
8666 op1->type->refCount++;
8671 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8673 char value2 = op2->c;
8676 exp->string = PrintChar(op1->c |= value2);
8679 exp->expType = op1->type;
8681 op1->type->refCount++;
8686 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8688 unsigned char value2 = op2->uc;
8691 exp->string = PrintUChar(op1->uc |= value2);
8694 exp->expType = op1->type;
8696 op1->type->refCount++;
8701 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8703 int value2 = op2->i;
8706 exp->string = PrintInt(op1->i ^= value2);
8709 exp->expType = op1->type;
8711 op1->type->refCount++;
8716 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8718 unsigned int value2 = op2->ui;
8721 exp->string = PrintUInt(op1->ui ^= value2);
8724 exp->expType = op1->type;
8726 op1->type->refCount++;
8731 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8733 long long value2 = op2->i64;
8736 exp->string = PrintInt64(op1->i64 ^= value2);
8739 exp->expType = op1->type;
8741 op1->type->refCount++;
8746 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8748 uint64 value2 = op2->ui64;
8751 exp->string = PrintUInt64(op1->ui64 ^= value2);
8754 exp->expType = op1->type;
8756 op1->type->refCount++;
8761 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8763 short value2 = op2->s;
8766 exp->string = PrintShort(op1->s ^= value2);
8769 exp->expType = op1->type;
8771 op1->type->refCount++;
8776 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8778 unsigned short value2 = op2->us;
8781 exp->string = PrintUShort(op1->us ^= value2);
8784 exp->expType = op1->type;
8786 op1->type->refCount++;
8791 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8793 char value2 = op2->c;
8796 exp->string = PrintChar(op1->c ^= value2);
8799 exp->expType = op1->type;
8801 op1->type->refCount++;
8806 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8808 unsigned char value2 = op2->uc;
8811 exp->string = PrintUChar(op1->uc ^= value2);
8814 exp->expType = op1->type;
8816 op1->type->refCount++;
8821 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8823 int value2 = op2->i;
8826 exp->string = PrintInt(op1->i <<= value2);
8829 exp->expType = op1->type;
8831 op1->type->refCount++;
8836 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8838 unsigned int value2 = op2->ui;
8841 exp->string = PrintUInt(op1->ui <<= value2);
8844 exp->expType = op1->type;
8846 op1->type->refCount++;
8851 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8853 long long value2 = op2->i64;
8856 exp->string = PrintInt64(op1->i64 <<= value2);
8859 exp->expType = op1->type;
8861 op1->type->refCount++;
8866 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8868 uint64 value2 = op2->ui64;
8871 exp->string = PrintUInt64(op1->ui64 <<= value2);
8874 exp->expType = op1->type;
8876 op1->type->refCount++;
8881 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8883 short value2 = op2->s;
8886 exp->string = PrintShort(op1->s <<= value2);
8889 exp->expType = op1->type;
8891 op1->type->refCount++;
8896 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8898 unsigned short value2 = op2->us;
8901 exp->string = PrintUShort(op1->us <<= value2);
8904 exp->expType = op1->type;
8906 op1->type->refCount++;
8911 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8913 char value2 = op2->c;
8916 exp->string = PrintChar(op1->c <<= value2);
8919 exp->expType = op1->type;
8921 op1->type->refCount++;
8926 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8928 unsigned char value2 = op2->uc;
8931 exp->string = PrintUChar(op1->uc <<= value2);
8934 exp->expType = op1->type;
8936 op1->type->refCount++;
8941 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8943 int value2 = op2->i;
8946 exp->string = PrintInt(op1->i >>= value2);
8949 exp->expType = op1->type;
8951 op1->type->refCount++;
8956 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8958 unsigned int value2 = op2->ui;
8961 exp->string = PrintUInt(op1->ui >>= value2);
8964 exp->expType = op1->type;
8966 op1->type->refCount++;
8971 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8973 long long value2 = op2->i64;
8976 exp->string = PrintInt64(op1->i64 >>= value2);
8979 exp->expType = op1->type;
8981 op1->type->refCount++;
8986 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8988 uint64 value2 = op2->ui64;
8991 exp->string = PrintUInt64(op1->ui64 >>= value2);
8994 exp->expType = op1->type;
8996 op1->type->refCount++;
9001 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9003 short value2 = op2->s;
9006 exp->string = PrintShort(op1->s >>= value2);
9009 exp->expType = op1->type;
9011 op1->type->refCount++;
9016 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9018 unsigned short value2 = op2->us;
9021 exp->string = PrintUShort(op1->us >>= value2);
9024 exp->expType = op1->type;
9026 op1->type->refCount++;
9031 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9033 char value2 = op2->c;
9036 exp->string = PrintChar(op1->c >>= value2);
9039 exp->expType = op1->type;
9041 op1->type->refCount++;
9046 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9048 unsigned char value2 = op2->uc;
9051 exp->string = PrintUChar(op1->uc >>= value2);
9054 exp->expType = op1->type;
9056 op1->type->refCount++;
9061 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9064 exp->string = PrintInt((int)(!op1->i));
9067 exp->expType = op1->type;
9069 op1->type->refCount++;
9074 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9077 exp->string = PrintUInt((unsigned int)(!op1->ui));
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9090 exp->string = PrintInt64((long long)(!op1->i64));
9093 exp->expType = op1->type;
9095 op1->type->refCount++;
9100 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9103 exp->string = PrintUInt64((uint64)(!op1->ui64));
9106 exp->expType = op1->type;
9108 op1->type->refCount++;
9113 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9116 exp->string = PrintShort((short)(!op1->s));
9119 exp->expType = op1->type;
9121 op1->type->refCount++;
9126 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9129 exp->string = PrintUShort((unsigned short)(!op1->us));
9132 exp->expType = op1->type;
9134 op1->type->refCount++;
9139 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9142 exp->string = PrintChar((char)(!op1->c));
9145 exp->expType = op1->type;
9147 op1->type->refCount++;
9152 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9155 exp->string = PrintUChar((unsigned char)(!op1->uc));
9158 exp->expType = op1->type;
9160 op1->type->refCount++;
9165 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9167 int value2 = op2->i;
9170 exp->string = PrintInt(op1->i == value2);
9173 exp->expType = op1->type;
9175 op1->type->refCount++;
9180 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9182 unsigned int value2 = op2->ui;
9185 exp->string = PrintUInt(op1->ui == value2);
9188 exp->expType = op1->type;
9190 op1->type->refCount++;
9195 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9197 long long value2 = op2->i64;
9200 exp->string = PrintInt64(op1->i64 == value2);
9203 exp->expType = op1->type;
9205 op1->type->refCount++;
9210 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9212 uint64 value2 = op2->ui64;
9215 exp->string = PrintUInt64(op1->ui64 == value2);
9218 exp->expType = op1->type;
9220 op1->type->refCount++;
9225 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9227 short value2 = op2->s;
9230 exp->string = PrintShort(op1->s == value2);
9233 exp->expType = op1->type;
9235 op1->type->refCount++;
9240 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9242 unsigned short value2 = op2->us;
9245 exp->string = PrintUShort(op1->us == value2);
9248 exp->expType = op1->type;
9250 op1->type->refCount++;
9255 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9257 char value2 = op2->c;
9260 exp->string = PrintChar(op1->c == value2);
9263 exp->expType = op1->type;
9265 op1->type->refCount++;
9270 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9272 unsigned char value2 = op2->uc;
9275 exp->string = PrintUChar(op1->uc == value2);
9278 exp->expType = op1->type;
9280 op1->type->refCount++;
9285 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9287 float value2 = op2->f;
9290 exp->string = PrintFloat(op1->f == value2);
9293 exp->expType = op1->type;
9295 op1->type->refCount++;
9300 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9302 double value2 = op2->d;
9305 exp->string = PrintDouble(op1->d == value2);
9308 exp->expType = op1->type;
9310 op1->type->refCount++;
9315 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9317 int value2 = op2->i;
9320 exp->string = PrintInt(op1->i != value2);
9323 exp->expType = op1->type;
9325 op1->type->refCount++;
9330 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9332 unsigned int value2 = op2->ui;
9335 exp->string = PrintUInt(op1->ui != value2);
9338 exp->expType = op1->type;
9340 op1->type->refCount++;
9345 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9347 long long value2 = op2->i64;
9350 exp->string = PrintInt64(op1->i64 != value2);
9353 exp->expType = op1->type;
9355 op1->type->refCount++;
9360 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9362 uint64 value2 = op2->ui64;
9365 exp->string = PrintUInt64(op1->ui64 != value2);
9368 exp->expType = op1->type;
9370 op1->type->refCount++;
9375 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9377 short value2 = op2->s;
9380 exp->string = PrintShort(op1->s != value2);
9383 exp->expType = op1->type;
9385 op1->type->refCount++;
9390 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9392 unsigned short value2 = op2->us;
9395 exp->string = PrintUShort(op1->us != value2);
9398 exp->expType = op1->type;
9400 op1->type->refCount++;
9405 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9407 char value2 = op2->c;
9410 exp->string = PrintChar(op1->c != value2);
9413 exp->expType = op1->type;
9415 op1->type->refCount++;
9420 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9422 unsigned char value2 = op2->uc;
9425 exp->string = PrintUChar(op1->uc != value2);
9428 exp->expType = op1->type;
9430 op1->type->refCount++;
9435 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9437 float value2 = op2->f;
9440 exp->string = PrintFloat(op1->f != value2);
9443 exp->expType = op1->type;
9445 op1->type->refCount++;
9450 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9452 double value2 = op2->d;
9455 exp->string = PrintDouble(op1->d != value2);
9458 exp->expType = op1->type;
9460 op1->type->refCount++;
9465 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9467 int value2 = op2->i;
9470 exp->string = PrintInt(op1->i && value2);
9473 exp->expType = op1->type;
9475 op1->type->refCount++;
9480 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9482 unsigned int value2 = op2->ui;
9485 exp->string = PrintUInt(op1->ui && value2);
9488 exp->expType = op1->type;
9490 op1->type->refCount++;
9495 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9497 long long value2 = op2->i64;
9500 exp->string = PrintInt64(op1->i64 && value2);
9503 exp->expType = op1->type;
9505 op1->type->refCount++;
9510 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9512 uint64 value2 = op2->ui64;
9515 exp->string = PrintUInt64(op1->ui64 && value2);
9518 exp->expType = op1->type;
9520 op1->type->refCount++;
9525 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9527 short value2 = op2->s;
9530 exp->string = PrintShort(op1->s && value2);
9533 exp->expType = op1->type;
9535 op1->type->refCount++;
9540 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9542 unsigned short value2 = op2->us;
9545 exp->string = PrintUShort(op1->us && value2);
9548 exp->expType = op1->type;
9550 op1->type->refCount++;
9555 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9557 char value2 = op2->c;
9560 exp->string = PrintChar(op1->c && value2);
9563 exp->expType = op1->type;
9565 op1->type->refCount++;
9570 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9572 unsigned char value2 = op2->uc;
9575 exp->string = PrintUChar(op1->uc && value2);
9578 exp->expType = op1->type;
9580 op1->type->refCount++;
9585 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9587 float value2 = op2->f;
9590 exp->string = PrintFloat(op1->f && value2);
9593 exp->expType = op1->type;
9595 op1->type->refCount++;
9600 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9602 double value2 = op2->d;
9605 exp->string = PrintDouble(op1->d && value2);
9608 exp->expType = op1->type;
9610 op1->type->refCount++;
9615 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9617 int value2 = op2->i;
9620 exp->string = PrintInt(op1->i || value2);
9623 exp->expType = op1->type;
9625 op1->type->refCount++;
9630 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9632 unsigned int value2 = op2->ui;
9635 exp->string = PrintUInt(op1->ui || value2);
9638 exp->expType = op1->type;
9640 op1->type->refCount++;
9645 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9647 long long value2 = op2->i64;
9650 exp->string = PrintInt64(op1->i64 || value2);
9653 exp->expType = op1->type;
9655 op1->type->refCount++;
9660 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9662 uint64 value2 = op2->ui64;
9665 exp->string = PrintUInt64(op1->ui64 || value2);
9668 exp->expType = op1->type;
9670 op1->type->refCount++;
9675 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9677 short value2 = op2->s;
9680 exp->string = PrintShort(op1->s || value2);
9683 exp->expType = op1->type;
9685 op1->type->refCount++;
9690 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9692 unsigned short value2 = op2->us;
9695 exp->string = PrintUShort(op1->us || value2);
9698 exp->expType = op1->type;
9700 op1->type->refCount++;
9705 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9707 char value2 = op2->c;
9710 exp->string = PrintChar(op1->c || value2);
9713 exp->expType = op1->type;
9715 op1->type->refCount++;
9720 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9722 unsigned char value2 = op2->uc;
9725 exp->string = PrintUChar(op1->uc || value2);
9728 exp->expType = op1->type;
9730 op1->type->refCount++;
9735 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9737 float value2 = op2->f;
9740 exp->string = PrintFloat(op1->f || value2);
9743 exp->expType = op1->type;
9745 op1->type->refCount++;
9750 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9752 double value2 = op2->d;
9755 exp->string = PrintDouble(op1->d || value2);
9758 exp->expType = op1->type;
9760 op1->type->refCount++;
9765 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9767 int value2 = op2->i;
9770 exp->string = PrintInt(op1->i > value2);
9773 exp->expType = op1->type;
9775 op1->type->refCount++;
9780 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9782 unsigned int value2 = op2->ui;
9785 exp->string = PrintUInt(op1->ui > value2);
9788 exp->expType = op1->type;
9790 op1->type->refCount++;
9795 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9797 long long value2 = op2->i64;
9800 exp->string = PrintInt64(op1->i64 > value2);
9803 exp->expType = op1->type;
9805 op1->type->refCount++;
9810 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9812 uint64 value2 = op2->ui64;
9815 exp->string = PrintUInt64(op1->ui64 > value2);
9818 exp->expType = op1->type;
9820 op1->type->refCount++;
9825 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9827 short value2 = op2->s;
9830 exp->string = PrintShort(op1->s > value2);
9833 exp->expType = op1->type;
9835 op1->type->refCount++;
9840 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9842 unsigned short value2 = op2->us;
9845 exp->string = PrintUShort(op1->us > value2);
9848 exp->expType = op1->type;
9850 op1->type->refCount++;
9855 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9857 char value2 = op2->c;
9860 exp->string = PrintChar(op1->c > value2);
9863 exp->expType = op1->type;
9865 op1->type->refCount++;
9870 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9872 unsigned char value2 = op2->uc;
9875 exp->string = PrintUChar(op1->uc > value2);
9878 exp->expType = op1->type;
9880 op1->type->refCount++;
9885 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9887 float value2 = op2->f;
9890 exp->string = PrintFloat(op1->f > value2);
9893 exp->expType = op1->type;
9895 op1->type->refCount++;
9900 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9902 double value2 = op2->d;
9905 exp->string = PrintDouble(op1->d > value2);
9908 exp->expType = op1->type;
9910 op1->type->refCount++;
9915 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9917 int value2 = op2->i;
9920 exp->string = PrintInt(op1->i < value2);
9923 exp->expType = op1->type;
9925 op1->type->refCount++;
9930 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9932 unsigned int value2 = op2->ui;
9935 exp->string = PrintUInt(op1->ui < value2);
9938 exp->expType = op1->type;
9940 op1->type->refCount++;
9945 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9947 long long value2 = op2->i64;
9950 exp->string = PrintInt64(op1->i64 < value2);
9953 exp->expType = op1->type;
9955 op1->type->refCount++;
9960 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9962 uint64 value2 = op2->ui64;
9965 exp->string = PrintUInt64(op1->ui64 < value2);
9968 exp->expType = op1->type;
9970 op1->type->refCount++;
9975 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9977 short value2 = op2->s;
9980 exp->string = PrintShort(op1->s < value2);
9983 exp->expType = op1->type;
9985 op1->type->refCount++;
9990 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9992 unsigned short value2 = op2->us;
9995 exp->string = PrintUShort(op1->us < value2);
9998 exp->expType = op1->type;
10000 op1->type->refCount++;
10005 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10007 char value2 = op2->c;
10010 exp->string = PrintChar(op1->c < value2);
10013 exp->expType = op1->type;
10015 op1->type->refCount++;
10020 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10022 unsigned char value2 = op2->uc;
10025 exp->string = PrintUChar(op1->uc < value2);
10028 exp->expType = op1->type;
10030 op1->type->refCount++;
10035 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10037 float value2 = op2->f;
10040 exp->string = PrintFloat(op1->f < value2);
10043 exp->expType = op1->type;
10045 op1->type->refCount++;
10050 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10052 double value2 = op2->d;
10055 exp->string = PrintDouble(op1->d < value2);
10058 exp->expType = op1->type;
10060 op1->type->refCount++;
10065 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10067 int value2 = op2->i;
10070 exp->string = PrintInt(op1->i >= value2);
10073 exp->expType = op1->type;
10075 op1->type->refCount++;
10080 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10082 unsigned int value2 = op2->ui;
10085 exp->string = PrintUInt(op1->ui >= value2);
10088 exp->expType = op1->type;
10090 op1->type->refCount++;
10095 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10097 long long value2 = op2->i64;
10100 exp->string = PrintInt64(op1->i64 >= value2);
10103 exp->expType = op1->type;
10105 op1->type->refCount++;
10110 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10112 uint64 value2 = op2->ui64;
10115 exp->string = PrintUInt64(op1->ui64 >= value2);
10118 exp->expType = op1->type;
10120 op1->type->refCount++;
10125 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10127 short value2 = op2->s;
10130 exp->string = PrintShort(op1->s >= value2);
10133 exp->expType = op1->type;
10135 op1->type->refCount++;
10140 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10142 unsigned short value2 = op2->us;
10145 exp->string = PrintUShort(op1->us >= value2);
10148 exp->expType = op1->type;
10150 op1->type->refCount++;
10155 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10157 char value2 = op2->c;
10160 exp->string = PrintChar(op1->c >= value2);
10163 exp->expType = op1->type;
10165 op1->type->refCount++;
10170 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10172 unsigned char value2 = op2->uc;
10175 exp->string = PrintUChar(op1->uc >= value2);
10178 exp->expType = op1->type;
10180 op1->type->refCount++;
10185 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10187 float value2 = op2->f;
10190 exp->string = PrintFloat(op1->f >= value2);
10193 exp->expType = op1->type;
10195 op1->type->refCount++;
10200 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10202 double value2 = op2->d;
10205 exp->string = PrintDouble(op1->d >= value2);
10208 exp->expType = op1->type;
10210 op1->type->refCount++;
10215 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10217 int value2 = op2->i;
10220 exp->string = PrintInt(op1->i <= value2);
10223 exp->expType = op1->type;
10225 op1->type->refCount++;
10230 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10232 unsigned int value2 = op2->ui;
10235 exp->string = PrintUInt(op1->ui <= value2);
10238 exp->expType = op1->type;
10240 op1->type->refCount++;
10245 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10247 long long value2 = op2->i64;
10250 exp->string = PrintInt64(op1->i64 <= value2);
10253 exp->expType = op1->type;
10255 op1->type->refCount++;
10260 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10262 uint64 value2 = op2->ui64;
10265 exp->string = PrintUInt64(op1->ui64 <= value2);
10268 exp->expType = op1->type;
10270 op1->type->refCount++;
10275 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10277 short value2 = op2->s;
10280 exp->string = PrintShort(op1->s <= value2);
10283 exp->expType = op1->type;
10285 op1->type->refCount++;
10290 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10292 unsigned short value2 = op2->us;
10295 exp->string = PrintUShort(op1->us <= value2);
10298 exp->expType = op1->type;
10300 op1->type->refCount++;
10305 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10307 char value2 = op2->c;
10310 exp->string = PrintChar(op1->c <= value2);
10313 exp->expType = op1->type;
10315 op1->type->refCount++;
10320 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10322 unsigned char value2 = op2->uc;
10325 exp->string = PrintUChar(op1->uc <= value2);
10328 exp->expType = op1->type;
10330 op1->type->refCount++;
10335 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10337 float value2 = op2->f;
10340 exp->string = PrintFloat(op1->f <= value2);
10343 exp->expType = op1->type;
10345 op1->type->refCount++;
10350 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10352 double value2 = op2->d;
10355 exp->string = PrintDouble(op1->d <= value2);
10358 exp->expType = op1->type;
10360 op1->type->refCount++;
10365 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10368 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10371 exp->expType = op1->type;
10373 op1->type->refCount++;
10378 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10381 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10384 exp->expType = op1->type;
10386 op1->type->refCount++;
10391 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10394 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10397 exp->expType = op1->type;
10399 op1->type->refCount++;
10404 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10407 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10410 exp->expType = op1->type;
10412 op1->type->refCount++;
10417 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10420 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10423 exp->expType = op1->type;
10425 op1->type->refCount++;
10430 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10433 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10436 exp->expType = op1->type;
10438 op1->type->refCount++;
10443 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10446 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10449 exp->expType = op1->type;
10451 op1->type->refCount++;
10456 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10459 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10462 exp->expType = op1->type;
10464 op1->type->refCount++;
10469 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10472 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10475 exp->expType = op1->type;
10477 op1->type->refCount++;
10482 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10485 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10488 exp->expType = op1->type;
10490 op1->type->refCount++;
10495 struct OpTable intOps =
10497 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
10500 struct OpTable uintOps =
10502 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
10505 struct OpTable int64Ops =
10507 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
10510 struct OpTable uint64Ops =
10512 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
10515 struct OpTable shortOps =
10517 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
10520 struct OpTable ushortOps =
10522 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
10525 struct OpTable floatOps =
10527 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
10530 struct OpTable doubleOps =
10532 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
10535 struct OpTable charOps =
10537 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
10540 struct OpTable ucharOps =
10542 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
10545 void ReadString(char * output, char * string)
10547 int len = strlen(string);
10549 unsigned int quoted = 0x0, escaped = 0x0;
10551 for(c = 0; c < len; c++)
10553 char ch = string[c];
10611 int UnescapeString(char * d, char * s, int len)
10616 while(j < len && (ch = s[j]))
10621 switch((ch = s[++j]))
10667 char * OffsetEscapedString(char * s, int len, int offset)
10672 while(j < len && k < offset && (ch = s[j]))
10678 return (k == offset) ? s + j : (((void *)0));
10681 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10683 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10685 extern double strtod(char * , char * * );
10687 extern float (* __ecereMethod_float_inf)(void);
10689 extern float (* __ecereMethod_float_nan)(void);
10691 extern double (* __ecereMethod_double_inf)(void);
10693 extern double (* __ecereMethod_double_nan)(void);
10695 struct Operand GetOperand(struct Expression * exp)
10697 struct Operand op =
10701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10704 struct Type * type = exp->expType;
10708 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10710 if(!type->_class->registered->dataType)
10711 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10712 type = type->_class->registered->dataType;
10714 if(exp->type == 3 && op.kind == 13)
10716 op.ui64 = (uint64)exp->string;
10718 op.ops = uint64Ops;
10720 else if(exp->isConstant && exp->type == 2)
10722 op.kind = type->kind;
10723 op.type = exp->expType;
10729 if(exp->constant[0] == '\'')
10731 op.c = exp->constant[1];
10734 else if(type->isSigned)
10736 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10741 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10749 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10754 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10755 op.ops = ushortOps;
10762 op.i = strtol(exp->constant, (((void *)0)), 0);
10767 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10775 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10780 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10781 op.ops = uint64Ops;
10788 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10793 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10794 op.ops = uint64Ops;
10801 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10806 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10807 op.ops = uint64Ops;
10812 if(!strcmp(exp->constant, "inf"))
10813 op.f = __ecereMethod_float_inf();
10814 else if(!strcmp(exp->constant, "-inf"))
10815 op.f = -__ecereMethod_float_inf();
10816 else if(!strcmp(exp->constant, "nan"))
10817 op.f = __ecereMethod_float_nan();
10818 else if(!strcmp(exp->constant, "-nan"))
10819 op.f = -__ecereMethod_float_nan();
10821 op.f = (float)strtod(exp->constant, (((void *)0)));
10825 if(!strcmp(exp->constant, "inf"))
10826 op.d = __ecereMethod_double_inf();
10827 else if(!strcmp(exp->constant, "-inf"))
10828 op.d = -__ecereMethod_double_inf();
10829 else if(!strcmp(exp->constant, "nan"))
10830 op.d = __ecereMethod_double_nan();
10831 else if(!strcmp(exp->constant, "-nan"))
10832 op.d = -__ecereMethod_double_nan();
10834 op.d = (double)strtod(exp->constant, (((void *)0)));
10835 op.ops = doubleOps;
10840 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10842 op.ops = uint64Ops;
10850 int __ecereVMethodID_class_OnGetString;
10852 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10854 static void UnusedFunction()
10858 ((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);
10861 extern int __ecereVMethodID_class_OnGetString;
10863 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10865 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10867 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10869 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10870 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10873 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10874 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10875 struct Type * type;
10876 void * ptr = inst->data + dataMember->offset + offset;
10877 char * result = (((void *)0));
10879 exp->loc = member->loc = inst->loc;
10880 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10881 if(!dataMember->dataType)
10882 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10883 type = dataMember->dataType;
10884 if(type->kind == 8)
10886 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10888 if(_class->type == 4)
10890 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10894 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10895 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10897 for(item = e->values.first; item; item = item->next)
10899 if((int)item->data == *(int *)ptr)
10901 result = item->name;
10907 exp->identifier = MkIdentifier(result);
10909 exp->destType = MkClassType(_class->fullName);
10910 ProcessExpressionType(exp);
10914 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10916 if(!_class->dataType)
10917 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10918 type = _class->dataType;
10927 FreeExpContents(exp);
10928 exp->constant = PrintFloat(*(float *)ptr);
10934 FreeExpContents(exp);
10935 exp->constant = PrintDouble(*(double *)ptr);
10941 FreeExpContents(exp);
10942 exp->constant = PrintInt(*(int *)ptr);
10948 FreeExpContents(exp);
10949 exp->constant = PrintInt64(*(long long *)ptr);
10955 FreeExpContents(exp);
10956 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10962 FreeExpContents(exp);
10963 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10968 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10971 ListAdd(memberList, member);
10973 if(parentDataMember->type == 1)
10978 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10980 void PopulateInstance(struct Instantiation * inst)
10982 struct Symbol * classSym = inst->_class->symbol;
10983 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10984 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10985 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10988 inst->members = MkListOne(MkMembersInitList(memberList));
10990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10991 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10993 if(!dataMember->isProperty)
10995 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10996 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10999 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11000 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11001 struct Type * type;
11002 void * ptr = inst->data + dataMember->offset;
11003 char * result = (((void *)0));
11005 exp->loc = member->loc = inst->loc;
11006 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11007 if(!dataMember->dataType)
11008 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11009 type = dataMember->dataType;
11010 if(type->kind == 8)
11012 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11014 if(_class->type == 4)
11016 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11020 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11021 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11023 for(item = e->values.first; item; item = item->next)
11025 if((int)item->data == *(int *)ptr)
11027 result = item->name;
11034 exp->identifier = MkIdentifier(result);
11036 exp->destType = MkClassType(_class->fullName);
11037 ProcessExpressionType(exp);
11040 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11042 if(!_class->dataType)
11043 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11044 type = _class->dataType;
11053 exp->constant = PrintFloat(*(float *)ptr);
11059 exp->constant = PrintDouble(*(double *)ptr);
11065 exp->constant = PrintInt(*(int *)ptr);
11071 exp->constant = PrintInt64(*(long long *)ptr);
11077 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11085 ListAdd(memberList, member);
11091 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);
11093 extern void FreeInstance(struct Instantiation * inst);
11095 void ComputeInstantiation(struct Expression * exp)
11097 struct Instantiation * inst = exp->instance;
11098 struct MembersInit * members;
11099 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11100 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11101 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11102 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11103 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11104 int subMemberStackPos = 0;
11107 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11111 if(_class->type == 0 || _class->type == 5)
11113 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11114 if(_class->type == 0)
11115 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11118 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11122 for(members = (*inst->members).first; members; members = members->next)
11124 switch(members->type)
11128 if(members->dataMembers)
11130 struct MemberInit * member;
11132 for(member = (*members->dataMembers).first; member; member = member->next)
11134 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11135 unsigned int found = 0x0;
11136 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11137 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11138 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11139 unsigned int dataMemberOffset;
11143 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11146 if(curMember->isProperty)
11147 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11150 dataMember = curMember;
11151 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11152 if(_class->type == 0)
11153 dataMemberOffset += _class->base->structSize;
11160 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11164 if(prop->memberAccess == 1)
11166 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11167 curClass = prop->_class;
11172 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11173 int _subMemberStackPos = 0;
11175 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11179 if(dataMember->memberAccess == 1)
11181 curMember = dataMember;
11182 curClass = dataMember->_class;
11183 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11184 subMemberStackPos = _subMemberStackPos;
11189 if(found && member->initializer && member->initializer->type == 0)
11191 struct Expression * value = member->initializer->exp;
11192 struct Type * type = (((void *)0));
11193 unsigned int deepMember = 0x0;
11197 type = prop->dataType;
11199 else if(dataMember)
11201 if(!dataMember->dataType)
11202 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11203 type = dataMember->dataType;
11205 if(ident && ident->next)
11208 for(ident = ident->next; ident && type; ident = ident->next)
11210 if(type->kind == 8)
11212 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11214 type = prop->dataType;
11217 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11219 type = dataMember->dataType;
11222 else if(type->kind == 9 || type->kind == 10)
11224 struct Type * memberType;
11226 for(memberType = type->members.first; memberType; memberType = memberType->next)
11228 if(!strcmp(memberType->name, ident->string))
11239 FreeType(value->destType);
11240 value->destType = type;
11243 ComputeExpression(value);
11245 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11247 if(type->kind == 8)
11249 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11251 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11253 if(!_class->dataType)
11254 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11255 type = _class->dataType;
11260 void * ptr = inst->data + dataMemberOffset;
11262 if(value->type == 2)
11268 GetInt(value, (int *)ptr);
11273 GetInt64(value, (long long *)ptr);
11278 GetIntPtr(value, (intptr_t *)ptr);
11283 GetIntSize(value, (ssize_t *)ptr);
11288 GetFloat(value, (float *)ptr);
11293 GetDouble(value, (double *)ptr);
11298 else if(value->type == 1)
11300 if(type->kind == 8)
11302 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11304 if(_class->type == 1)
11306 ComputeTypeSize(type);
11307 if(value->instance->data)
11308 memcpy(ptr, value->instance->data, type->size);
11315 if(value->type == 1 && value->instance->data)
11317 if(type->kind == 8)
11319 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11321 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)))
11323 void (* Set)(void *, void *) = (void *)prop->Set;
11325 Set(inst->data, value->instance->data);
11326 PopulateInstance(inst);
11330 else if(value->type == 2)
11336 void (* Set)(void *, double) = (void *)prop->Set;
11338 Set(inst->data, strtod(value->constant, (((void *)0))));
11343 void (* Set)(void *, float) = (void *)prop->Set;
11345 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11350 void (* Set)(void *, int) = (void *)prop->Set;
11352 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11357 void (* Set)(void *, long long) = (void *)prop->Set;
11359 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11364 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11366 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11371 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11373 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11378 else if(value->type == 3)
11382 ReadString(temp, value->string);
11383 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11387 else if(!deepMember && type && _class->type == 3)
11391 if(value->type == 2)
11393 if(type->kind == 8)
11395 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11397 if(_class->type == 3)
11399 if(!_class->dataType)
11400 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11401 type = _class->dataType;
11409 float (* Set)(float) = (void *)prop->Set;
11411 GetFloat(member->initializer->exp, &fValue);
11412 exp->constant = PrintFloat(Set(fValue));
11419 double (* Set)(double) = (void *)prop->Set;
11421 GetDouble(member->initializer->exp, &dValue);
11422 exp->constant = PrintDouble(Set(dValue));
11430 else if(!deepMember && type && _class->type == 2)
11434 if(value->type == 1 && value->instance->data)
11436 unsigned int (* Set)(void *) = (void *)prop->Set;
11438 bits = Set(value->instance->data);
11440 else if(value->type == 2)
11444 else if(dataMember)
11446 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11447 struct Type * type;
11450 GetInt(value, &part);
11451 bits = (bits & ~bitMember->mask);
11452 if(!bitMember->dataType)
11453 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11454 type = bitMember->dataType;
11455 if(type->kind == 8 && type->_class && type->_class->registered)
11457 if(!type->_class->registered->dataType)
11458 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11459 type = type->_class->registered->dataType;
11466 bits |= ((char)part << bitMember->pos);
11468 bits |= ((unsigned char)part << bitMember->pos);
11472 bits |= ((short)part << bitMember->pos);
11474 bits |= ((unsigned short)part << bitMember->pos);
11479 bits |= (part << bitMember->pos);
11481 bits |= ((unsigned int)part << bitMember->pos);
11485 bits |= ((long long)part << bitMember->pos);
11487 bits |= ((uint64)part << bitMember->pos);
11492 bits |= ((intptr_t)part << bitMember->pos);
11496 bits |= ((uintptr_t)part << bitMember->pos);
11502 bits |= ((ssize_t)part << bitMember->pos);
11506 bits |= ((size_t)part << bitMember->pos);
11515 if(_class && _class->type == 3)
11517 ComputeExpression(member->initializer->exp);
11518 exp->constant = member->initializer->exp->constant;
11520 member->initializer->exp->constant = (((void *)0));
11530 if(_class && _class->type == 2)
11532 exp->constant = PrintHexUInt(bits);
11537 FreeInstance(inst);
11541 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11543 unsigned int result = 0x0;
11548 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11549 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11553 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11554 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11557 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)
11558 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11561 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)
11562 result = GetOpFloat(op, &op->f);
11565 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)
11566 result = GetOpDouble(op, &op->d);
11569 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)
11570 result = GetOpUIntPtr(op, &op->ui64);
11573 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)
11574 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11577 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11578 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11581 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11582 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11588 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11590 if(exp->op.op == SIZEOF)
11592 FreeExpContents(exp);
11594 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11604 struct Expression * exp2 = exp->op.exp2;
11606 exp->op.exp2 = (((void *)0));
11607 FreeExpContents(exp);
11608 FreeType(exp->expType);
11609 FreeType(exp->destType);
11611 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11617 FreeExpContents(exp);
11618 op1->ops.Neg(exp, op1);
11622 if(op1->ops.BitNot)
11624 FreeExpContents(exp);
11625 op1->ops.BitNot(exp, op1);
11631 FreeExpContents(exp);
11632 op1->ops.Not(exp, op1);
11639 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11641 if(Promote(op2, op1->kind, op1->type->isSigned))
11642 op2->kind = op1->kind, op2->ops = op1->ops;
11643 else if(Promote(op1, op2->kind, op2->type->isSigned))
11644 op1->kind = op2->kind, op1->ops = op2->ops;
11651 FreeExpContents(exp);
11652 op1->ops.Add(exp, op1, op2);
11658 FreeExpContents(exp);
11659 op1->ops.Sub(exp, op1, op2);
11665 FreeExpContents(exp);
11666 op1->ops.Mul(exp, op1, op2);
11672 FreeExpContents(exp);
11673 op1->ops.Div(exp, op1, op2);
11679 FreeExpContents(exp);
11680 op1->ops.Mod(exp, op1, op2);
11686 if(op1->ops.BitAnd)
11688 FreeExpContents(exp);
11689 op1->ops.BitAnd(exp, op1, op2);
11696 FreeExpContents(exp);
11697 op1->ops.BitOr(exp, op1, op2);
11701 if(op1->ops.BitXor)
11703 FreeExpContents(exp);
11704 op1->ops.BitXor(exp, op1, op2);
11708 if(op1->ops.LShift)
11710 FreeExpContents(exp);
11711 op1->ops.LShift(exp, op1, op2);
11715 if(op1->ops.RShift)
11717 FreeExpContents(exp);
11718 op1->ops.RShift(exp, op1, op2);
11724 FreeExpContents(exp);
11725 op1->ops.Equ(exp, op1, op2);
11731 FreeExpContents(exp);
11732 op1->ops.Nqu(exp, op1, op2);
11738 FreeExpContents(exp);
11739 op1->ops.And(exp, op1, op2);
11745 FreeExpContents(exp);
11746 op1->ops.Or(exp, op1, op2);
11752 FreeExpContents(exp);
11753 op1->ops.Grt(exp, op1, op2);
11759 FreeExpContents(exp);
11760 op1->ops.Sma(exp, op1, op2);
11764 if(op1->ops.GrtEqu)
11766 FreeExpContents(exp);
11767 op1->ops.GrtEqu(exp, op1, op2);
11771 if(op1->ops.SmaEqu)
11773 FreeExpContents(exp);
11774 op1->ops.SmaEqu(exp, op1, op2);
11782 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11784 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11786 void ComputeExpression(struct Expression * exp)
11788 char expString[10240];
11790 expString[0] = '\0';
11795 ComputeInstantiation(exp);
11800 struct Expression * exp1, * exp2 = (((void *)0));
11801 struct Operand op1 =
11805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11808 struct Operand op2 =
11812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11818 struct Expression * e = exp->op.exp2;
11820 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11822 if(e->type == 5 || e->type == 32 || e->type == 23)
11825 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11827 e = (*e->list).last;
11830 if(exp->op.op == 261 && e && e->expType)
11832 if(e->type == 3 && e->string)
11834 char * string = e->string;
11835 int len = strlen(string);
11836 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11838 len = UnescapeString(tmp, string + 1, len - 2);
11839 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11840 FreeExpContents(exp);
11842 exp->constant = PrintUInt(len + 1);
11846 struct Type * type = e->expType;
11849 FreeExpContents(exp);
11851 exp->constant = PrintUInt(ComputeTypeSize(type));
11857 ComputeExpression(exp->op.exp2);
11861 ComputeExpression(exp->op.exp1);
11862 exp1 = exp->op.exp1;
11863 exp2 = exp->op.exp2;
11864 op1 = GetOperand(exp1);
11866 op1.type->refCount++;
11869 op2 = GetOperand(exp2);
11871 op2.type->refCount++;
11876 exp1 = exp->op.exp2;
11877 op1 = GetOperand(exp1);
11879 op1.type->refCount++;
11881 CallOperator(exp, exp1, exp2, &op1, &op2);
11883 FreeType(op1.type);
11885 FreeType(op2.type);
11891 struct Expression * e, * n;
11893 for(e = (*exp->list).first; e; e = n)
11898 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11900 ComputeExpression(e);
11901 FreeType(exp->expType);
11902 FreeType(exp->destType);
11904 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11905 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11916 struct Expression * memberExp = exp->member.exp;
11917 struct Identifier * memberID = exp->member.member;
11918 struct Type * type;
11920 ComputeExpression(exp->member.exp);
11921 type = exp->member.exp->expType;
11924 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)));
11925 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11926 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11927 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11929 if(type->kind == 19 && exp->member.exp->type == 24)
11930 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11934 struct Symbol * classSym;
11937 PrintTypeNoConst(type, string, 0x0, 0x1);
11938 classSym = FindClass(string);
11939 _class = classSym ? classSym->registered : (((void *)0));
11941 if(exp->member.member)
11943 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11945 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11947 if(!prop && !member && _class && exp->member.member)
11949 struct Symbol * classSym = FindClass(exp->member.member->string);
11951 convertTo = _class;
11952 _class = classSym ? classSym->registered : (((void *)0));
11953 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11959 struct Type * type = prop->dataType;
11961 if(_class->type == 3)
11963 if(type->kind == 8)
11965 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11967 if(_class->type == 3)
11969 if(!_class->dataType)
11970 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11971 type = _class->dataType;
11979 float (* Get)(float) = (void *)prop->Get;
11981 GetFloat(exp->member.exp, &value);
11982 exp->constant = PrintFloat(Get ? Get(value) : value);
11989 double (* Get)(double);
11991 GetDouble(exp->member.exp, &value);
11993 Get = (void *)prop->Set;
11995 Get = (void *)prop->Get;
11996 exp->constant = PrintDouble(Get ? Get(value) : value);
12006 struct Expression * value = exp->member.exp;
12007 struct Type * type;
12009 if(!prop->dataType)
12010 ProcessPropertyType(prop);
12011 type = prop->dataType;
12015 else if(_class->type == 1)
12021 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12023 if(propertyClass->type == 1 && value->type == 1)
12025 void (* Set)(void *, void *) = (void *)prop->Set;
12027 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12028 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12029 exp->instance->_class = MkSpecifierName(_class->fullName);
12030 exp->instance->loc = exp->loc;
12032 Set(exp->instance->data, value->instance->data);
12033 PopulateInstance(exp->instance);
12040 void (* Set)(void *, int) = (void *)prop->Set;
12042 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12043 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12044 exp->instance->_class = MkSpecifierName(_class->fullName);
12045 exp->instance->loc = exp->loc;
12047 GetInt(value, &intValue);
12048 Set(exp->instance->data, intValue);
12049 PopulateInstance(exp->instance);
12054 long long intValue;
12055 void (* Set)(void *, long long) = (void *)prop->Set;
12057 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12058 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12059 exp->instance->_class = MkSpecifierName(_class->fullName);
12060 exp->instance->loc = exp->loc;
12062 GetInt64(value, &intValue);
12063 Set(exp->instance->data, intValue);
12064 PopulateInstance(exp->instance);
12070 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12072 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12073 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12074 exp->instance->_class = MkSpecifierName(_class->fullName);
12075 exp->instance->loc = exp->loc;
12077 GetIntPtr(value, &intValue);
12078 Set(exp->instance->data, intValue);
12079 PopulateInstance(exp->instance);
12085 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12087 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12088 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12089 exp->instance->_class = MkSpecifierName(_class->fullName);
12090 exp->instance->loc = exp->loc;
12092 GetIntSize(value, &intValue);
12093 Set(exp->instance->data, intValue);
12094 PopulateInstance(exp->instance);
12100 void (* Set)(void *, float) = (void *)prop->Set;
12102 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12103 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12104 exp->instance->_class = MkSpecifierName(_class->fullName);
12105 exp->instance->loc = exp->loc;
12107 GetFloat(value, &floatValue);
12108 Set(exp->instance->data, floatValue);
12109 PopulateInstance(exp->instance);
12114 double doubleValue;
12115 void (* Set)(void *, double) = (void *)prop->Set;
12117 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12118 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12119 exp->instance->_class = MkSpecifierName(_class->fullName);
12120 exp->instance->loc = exp->loc;
12122 GetDouble(value, &doubleValue);
12123 Set(exp->instance->data, doubleValue);
12124 PopulateInstance(exp->instance);
12129 else if(_class->type == 2)
12135 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12137 if(propertyClass->type == 1 && value->instance->data)
12139 unsigned int (* Set)(void *) = (void *)prop->Set;
12140 unsigned int bits = Set(value->instance->data);
12142 exp->constant = PrintHexUInt(bits);
12146 else if(_class->type == 2)
12148 unsigned int value;
12149 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12152 GetUInt(exp->member.exp, &value);
12154 exp->constant = PrintHexUInt(bits);
12163 if(_class->type == 2)
12165 unsigned int value;
12167 GetUInt(exp->member.exp, &value);
12172 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12174 if(_class->type == 1)
12176 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12178 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12179 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12180 exp->instance->_class = MkSpecifierName(_class->fullName);
12181 exp->instance->loc = exp->loc;
12183 Get(value, exp->instance->data);
12184 PopulateInstance(exp->instance);
12186 else if(_class->type == 2)
12188 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12189 uint64 bits = Get(value);
12191 exp->constant = PrintHexUInt64(bits);
12198 else if(_class->type == 1)
12200 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12206 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12208 if(_class->type == 1 && value)
12210 void (* Get)(void *, void *) = (void *)prop->Get;
12212 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12213 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12214 exp->instance->_class = MkSpecifierName(_class->fullName);
12215 exp->instance->loc = exp->loc;
12217 Get(value, exp->instance->data);
12218 PopulateInstance(exp->instance);
12229 exp->isConstant = 0x0;
12238 FreeExpression(memberExp);
12239 FreeIdentifier(memberID);
12245 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12247 FreeExpContents(exp);
12248 exp->constant = PrintUInt(ComputeTypeSize(type));
12255 struct Symbol * classSym = exp->_class->symbol;
12257 if(classSym && classSym->registered)
12259 if(classSym->registered->fixed)
12261 FreeSpecifier(exp->_class);
12262 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12267 char className[1024];
12269 strcpy(className, "__ecereClass_");
12270 FullClassNameCat(className, classSym->string, 0x1);
12271 MangleClassName(className);
12272 DeclareClass(classSym, className);
12273 FreeExpContents(exp);
12275 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12276 exp->member.member = MkIdentifier("structSize");
12283 struct Type * type;
12284 struct Expression * e = exp;
12286 if(exp->type == 11)
12289 ComputeExpression(exp->cast.exp);
12292 if(e && exp->expType)
12294 type = exp->expType;
12295 if(type->kind == 8)
12297 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12299 if(_class && (_class->type == 3 || _class->type == 2))
12301 if(!_class->dataType)
12302 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12303 type = _class->dataType;
12312 char value = (char)0;
12314 if(GetChar(e, &value))
12316 FreeExpContents(exp);
12317 exp->constant = PrintChar(value);
12323 unsigned char value = (unsigned char)0;
12325 if(GetUChar(e, &value))
12327 FreeExpContents(exp);
12328 exp->constant = PrintUChar(value);
12336 short value = (short)0;
12338 if(GetShort(e, &value))
12340 FreeExpContents(exp);
12341 exp->constant = PrintShort(value);
12347 unsigned short value = (unsigned short)0;
12349 if(GetUShort(e, &value))
12351 FreeExpContents(exp);
12352 exp->constant = PrintUShort(value);
12362 if(GetInt(e, &value))
12364 FreeExpContents(exp);
12365 exp->constant = PrintInt(value);
12371 unsigned int value = 0;
12373 if(GetUInt(e, &value))
12375 FreeExpContents(exp);
12376 exp->constant = PrintUInt(value);
12384 long long value = 0;
12386 if(GetInt64(e, &value))
12388 FreeExpContents(exp);
12389 exp->constant = PrintInt64(value);
12397 if(GetUInt64(e, &value))
12399 FreeExpContents(exp);
12400 exp->constant = PrintUInt64(value);
12408 intptr_t value = 0;
12410 if(GetIntPtr(e, &value))
12412 FreeExpContents(exp);
12413 exp->constant = PrintInt64((long long)value);
12419 uintptr_t value = 0;
12421 if(GetUIntPtr(e, &value))
12423 FreeExpContents(exp);
12424 exp->constant = PrintUInt64((uint64)value);
12434 if(GetIntSize(e, &value))
12436 FreeExpContents(exp);
12437 exp->constant = PrintInt64((long long)value);
12445 if(GetUIntSize(e, &value))
12447 FreeExpContents(exp);
12448 exp->constant = PrintUInt64((uint64)value);
12457 if(GetFloat(e, &value))
12459 FreeExpContents(exp);
12460 exp->constant = PrintFloat(value);
12469 if(GetDouble(e, &value))
12471 FreeExpContents(exp);
12472 exp->constant = PrintDouble(value);
12483 struct Operand op1 =
12487 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12490 struct Operand op2 =
12494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12497 struct Operand op3 =
12501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12506 ComputeExpression((*exp->cond.exp).last);
12507 if(exp->cond.elseExp)
12508 ComputeExpression(exp->cond.elseExp);
12510 ComputeExpression(exp->cond.cond);
12511 op1 = GetOperand(exp->cond.cond);
12513 op1.type->refCount++;
12514 op2 = GetOperand((*exp->cond.exp).last);
12516 op2.type->refCount++;
12517 op3 = GetOperand(exp->cond.elseExp);
12519 op3.type->refCount++;
12522 FreeExpContents(exp);
12523 op1.ops.Cond(exp, &op1, &op2, &op3);
12526 FreeType(op1.type);
12528 FreeType(op2.type);
12530 FreeType(op3.type);
12536 void ApplyAnyObjectLogic(struct Expression * e);
12538 extern void CopyTypeInto(struct Type * type, struct Type * src);
12540 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12542 unsigned int result = 0x1;
12546 struct __ecereNameSpace__ecere__sys__OldList converts =
12550 struct Conversion * convert;
12552 if(destType->kind == 0)
12554 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12558 for(convert = converts.first; convert; convert = convert->next)
12560 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12564 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12565 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12568 newExp->destType = (((void *)0));
12572 exp->addedThis = 0x1;
12573 exp->member.exp = newExp;
12574 FreeType(exp->member.exp->expType);
12575 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12576 exp->member.exp->expType->classObjectType = objectType;
12577 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12578 exp->member.memberType = 1;
12579 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12580 exp->needCast = 0x1;
12582 exp->expType->refCount++;
12583 ApplyAnyObjectLogic(exp->member.exp);
12589 exp->addedThis = 0x1;
12590 exp->member.exp = newExp;
12591 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12593 newExp->byReference = 0x1;
12595 FreeType(exp->member.exp->expType);
12596 exp->member.exp->expType = (((void *)0));
12597 if(convert->convert->dataType)
12599 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12600 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12601 exp->member.exp->expType->refCount = 1;
12602 exp->member.exp->expType->classObjectType = objectType;
12603 ApplyAnyObjectLogic(exp->member.exp);
12605 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12606 exp->member.memberType = 4;
12607 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12608 exp->needCast = 0x1;
12609 if(convert->resultType)
12610 convert->resultType->refCount++;
12616 FreeType(exp->expType);
12619 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12620 exp->needCast = 0x1;
12622 exp->expType->refCount++;
12626 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12627 exp->needCast = 0x1;
12628 if(convert->resultType)
12629 convert->resultType->refCount++;
12633 if(exp->isConstant && inCompiler)
12634 ComputeExpression(exp);
12635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12637 if(!result && exp->expType && converts.count)
12639 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12641 if(!result && exp->expType && exp->destType)
12643 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))
12650 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12652 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12654 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12656 void CheckTemplateTypes(struct Expression * exp)
12658 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12660 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12661 struct Statement * compound;
12662 struct Context * context;
12666 exp->destType->refCount++;
12668 exp->expType->refCount++;
12669 newExp->prev = (((void *)0));
12670 newExp->next = (((void *)0));
12671 switch(exp->expType->kind)
12674 if(exp->destType->classObjectType)
12677 exp->destType->refCount--;
12679 exp->expType->refCount--;
12680 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12684 struct __ecereNameSpace__ecere__sys__OldList * specs;
12685 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12686 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12688 context = PushContext();
12689 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12690 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12691 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12693 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12694 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12695 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12696 exp->compound->compound.context = context;
12697 PopContext(context);
12702 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12703 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12707 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12709 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12710 struct Statement * compound;
12711 struct Context * context;
12715 exp->destType->refCount++;
12717 exp->expType->refCount++;
12718 newExp->prev = (((void *)0));
12719 newExp->next = (((void *)0));
12720 switch(exp->expType->kind)
12723 if(exp->destType->classObjectType)
12726 exp->destType->refCount--;
12728 exp->expType->refCount--;
12729 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12733 struct __ecereNameSpace__ecere__sys__OldList * specs;
12734 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12735 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12737 context = PushContext();
12738 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12739 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12740 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12742 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12743 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12744 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12745 exp->compound->compound.context = context;
12746 PopContext(context);
12751 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12754 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12755 ProcessExpressionType((*exp->list).first);
12761 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12762 newExp->needCast = 0x1;
12763 ProcessExpressionType((*exp->list).first);
12769 if(exp->expType->kind == 20)
12771 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12775 FreeType(exp->destType);
12776 FreeType(exp->expType);
12777 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12781 if(newExp->type == 8 && newExp->member.memberType == 3)
12785 exp->op.exp1 = (((void *)0));
12786 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12790 char typeString[1024];
12791 struct Declarator * decl;
12792 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12794 typeString[0] = '\0';
12795 PrintType(exp->expType, typeString, 0x0, 0x0);
12796 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12798 exp->cast.typeName = MkTypeName(specs, decl);
12799 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12800 exp->cast.exp->needCast = 0x1;
12808 extern int strncmp(const char * , const char * , size_t n);
12810 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12812 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12814 int nsLen = strlen(nameSpace);
12815 struct Symbol * symbol;
12817 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)))
12819 char * s = symbol->string;
12821 if(!strncmp(s, nameSpace, nsLen))
12826 for(c = strlen(s) - 1; c >= 0; c--)
12829 namePart = s + c + 1;
12830 if(!strcmp(namePart, name))
12838 return (((void *)0));
12841 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12844 char nameSpace[1024];
12846 unsigned int gotColon = 0x0;
12848 nameSpace[0] = '\0';
12849 for(c = strlen(name) - 1; c >= 0; c--)
12855 namePart = name + c + 1;
12856 while(c >= 0 && name[c] == ':')
12860 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12864 memcpy(nameSpace, name, c + 1);
12865 nameSpace[c + 1] = (char)0;
12866 return ScanWithNameSpace(tree, nameSpace, namePart);
12870 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12876 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12880 return ScanWithNameSpace(tree, "", namePart);
12882 return (((void *)0));
12885 static void ProcessDeclaration(struct Declaration * decl);
12887 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12889 struct Context * ctx;
12890 struct Symbol * symbol = (((void *)0));
12892 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12894 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12896 symbol = (((void *)0));
12899 char curName[1024];
12901 strcpy(curName, thisNameSpace);
12902 strcat(curName, "::");
12903 strcat(curName, name);
12904 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12907 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12910 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12911 if(symbol || ctx == endContext)
12914 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12916 if(symbol->pointerExternal->type == 0)
12918 struct FunctionDefinition * function = symbol->pointerExternal->function;
12919 struct Context * tmpContext = curContext;
12921 curContext = (((void *)0));
12922 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12923 curContext = tmpContext;
12924 symbol->pointerExternal->symbol = symbol;
12925 DeclareType(symbol->type, 0x1, 0x1);
12926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12927 symbol->id = curExternal->symbol->idCode;
12929 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12931 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12932 symbol->id = curExternal->symbol->idCode;
12938 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12940 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12941 ListAdd(specs, MkSpecifier(UNSIGNED));
12946 if(type->_class->registered)
12948 if(!type->_class->registered->dataType)
12949 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12950 GetTypeSpecs(type->_class->registered->dataType, specs);
12955 ListAdd(specs, MkSpecifier(DOUBLE));
12958 ListAdd(specs, MkSpecifier(FLOAT));
12961 ListAdd(specs, MkSpecifier(CHAR));
12964 ListAdd(specs, MkSpecifier(_BOOL));
12967 ListAdd(specs, MkSpecifier(SHORT));
12970 ListAdd(specs, MkSpecifier(INT64));
12973 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12976 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12980 ListAdd(specs, MkSpecifier(INT));
12985 static void PrintArraySize(struct Type * arrayType, char * string)
12991 if(arrayType->enumClass)
12992 strcat(size, arrayType->enumClass->string);
12993 else if(arrayType->arraySizeExp)
12994 PrintExpression(arrayType->arraySizeExp, size);
12996 strcat(string, size);
12999 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13003 if(printConst && type->constant)
13004 strcat(string, "const ");
13009 struct Symbol * c = type->_class;
13011 if(type->classObjectType == 2)
13012 strcat(string, "typed_object");
13013 else if(type->classObjectType == 3)
13014 strcat(string, "any_object");
13018 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13020 if(type->byReference)
13021 strcat(string, " &");
13025 strcat(string, "void");
13028 strcat(string, type->isSigned ? "int" : "uint");
13031 strcat(string, type->isSigned ? "int64" : "uint64");
13034 strcat(string, type->isSigned ? "intptr" : "uintptr");
13037 strcat(string, type->isSigned ? "intsize" : "uintsize");
13040 strcat(string, type->isSigned ? "char" : "byte");
13043 strcat(string, "_Bool");
13046 strcat(string, type->isSigned ? "short" : "uint16");
13049 strcat(string, "float");
13052 strcat(string, "double");
13057 strcat(string, "struct ");
13058 strcat(string, type->enumName);
13060 else if(type->typeName)
13061 strcat(string, type->typeName);
13064 struct Type * member;
13066 strcat(string, "struct { ");
13067 for(member = type->members.first; member; member = member->next)
13069 PrintType(member, string, 0x1, fullName);
13070 strcat(string, "; ");
13072 strcat(string, "}");
13078 strcat(string, "union ");
13079 strcat(string, type->enumName);
13081 else if(type->typeName)
13082 strcat(string, type->typeName);
13085 strcat(string, "union ");
13086 strcat(string, "(unnamed)");
13092 strcat(string, "enum ");
13093 strcat(string, type->enumName);
13095 else if(type->typeName)
13096 strcat(string, type->typeName);
13098 strcat(string, "int");
13101 strcat(string, "...");
13104 strcat(string, "subclass(");
13105 strcat(string, type->_class ? type->_class->string : "int");
13106 strcat(string, ")");
13109 strcat(string, type->templateParameter->identifier->string);
13112 strcat(string, "thisclass");
13115 strcat(string, "__builtin_va_list");
13121 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13123 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13125 if(type->name && type->name[0])
13128 strcat(string, type->name);
13131 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13137 strcat(string, name);
13142 static void PrintAttribs(struct Type * type, char * string)
13146 if(type->dllExport)
13147 strcat(string, "dllexport ");
13148 if(type->attrStdcall)
13149 strcat(string, "stdcall ");
13153 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13155 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13157 struct Type * attrType = (((void *)0));
13159 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13160 PrintAttribs(type, string);
13161 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13162 strcat(string, " const");
13163 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13164 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13165 strcat(string, " (");
13166 if(type->kind == 13)
13168 if(type->type->kind == 11 || type->type->kind == 16)
13169 PrintAttribs(type->type, string);
13171 if(type->kind == 13)
13173 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13174 strcat(string, "*");
13176 strcat(string, " *");
13178 if(printConst && type->constant && type->kind == 13)
13179 strcat(string, " const");
13182 PrintTypeSpecs(type, string, fullName, printConst);
13185 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13187 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13188 strcat(string, ")");
13189 if(type->kind == 12)
13190 PrintArraySize(type, string);
13191 else if(type->kind == 11)
13193 struct Type * param;
13195 strcat(string, "(");
13196 for(param = type->params.first; param; param = param->next)
13198 PrintType(param, string, 0x1, fullName);
13200 strcat(string, ", ");
13202 strcat(string, ")");
13204 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13205 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13208 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13210 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13211 if(type->thisClass || (printName && type->name && type->name[0]))
13212 strcat(string, " ");
13213 if((type->thisClass || type->staticMethod))
13215 struct Symbol * _class = type->thisClass;
13217 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13219 if(type->classObjectType == 1)
13220 strcat(string, "class");
13222 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13224 else if(_class && _class->string)
13226 char * s = _class->string;
13232 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13238 strcat(string, name);
13241 strcat(string, "::");
13243 if(printName && type->name)
13244 PrintName(type, string, fullName);
13245 PostPrintType(type, string, fullName);
13246 if(type->bitFieldCount)
13250 sprintf(count, ":%d", type->bitFieldCount);
13251 strcat(string, count);
13255 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13257 _PrintType(type, string, printName, fullName, 0x1);
13260 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13262 _PrintType(type, string, printName, fullName, 0x0);
13265 static struct Type * FindMember(struct Type * type, char * string)
13267 struct Type * memberType;
13269 for(memberType = type->members.first; memberType; memberType = memberType->next)
13271 if(!memberType->name)
13273 struct Type * subType = FindMember(memberType, string);
13278 else if(!strcmp(memberType->name, string))
13281 return (((void *)0));
13284 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13286 struct Type * memberType;
13288 for(memberType = type->members.first; memberType; memberType = memberType->next)
13290 if(!memberType->name)
13292 struct Type * subType = FindMember(memberType, string);
13296 *offset += memberType->offset;
13300 else if(!strcmp(memberType->name, string))
13302 *offset += memberType->offset;
13306 return (((void *)0));
13309 extern unsigned int parseError;
13311 unsigned int GetParseError()
13316 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13318 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13322 struct Expression * ParseExpressionString(char * expression)
13325 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13326 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13327 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13329 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13330 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13331 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13332 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13334 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13335 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13337 parsedExpression = (((void *)0));
13339 expression_yyparse();
13340 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13341 return parsedExpression;
13344 extern char * QMkString(char * source);
13346 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13348 struct Identifier * id = exp->identifier;
13349 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13350 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13351 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13352 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13354 if(_class && _class->type == 4)
13356 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13357 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13361 struct __ecereNameSpace__ecere__com__Class * baseClass;
13363 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13365 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13367 for(value = e->values.first; value; value = value->next)
13369 if(!strcmp(value->name, id->string))
13374 char constant[256];
13376 FreeExpContents(exp);
13378 exp->isConstant = 0x1;
13379 if(!strcmp(baseClass->dataTypeString, "int"))
13380 sprintf(constant, "%d", (int)value->data);
13382 sprintf(constant, "0x%X", (int)value->data);
13383 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13384 exp->expType = MkClassType(baseClass->fullName);
13392 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13394 ProcessMethodType(method);
13395 exp->expType = __extension__ ({
13396 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13398 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13402 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13404 if(!prop->dataType)
13405 ProcessPropertyType(prop);
13406 exp->expType = prop->dataType;
13408 prop->dataType->refCount++;
13411 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13413 if(!member->dataType)
13414 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13415 exp->expType = member->dataType;
13416 if(member->dataType)
13417 member->dataType->refCount++;
13420 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13422 if(!classProp->dataType)
13423 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13424 if(classProp->constant)
13426 FreeExpContents(exp);
13427 exp->isConstant = 0x1;
13428 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13431 exp->constant = QMkString((char *)classProp->Get(_class));
13435 char constant[256];
13438 sprintf(constant, "%d", (int)classProp->Get(_class));
13439 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13445 exp->expType = classProp->dataType;
13446 if(classProp->dataType)
13447 classProp->dataType->refCount++;
13453 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13455 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13456 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13457 struct __ecereNameSpace__ecere__com__NameSpace * child;
13461 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)))
13463 data = ScanGlobalData(child, name);
13471 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13473 extern char * strncpy(char * , const char * , size_t n);
13475 static struct GlobalData * FindGlobalData(char * name)
13478 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13480 nameSpace = globalData;
13481 for(c = 0; name[c]; c++)
13483 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13485 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13486 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13488 strncpy(spaceName, name + start, c - start);
13489 spaceName[c - start] = '\0';
13490 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13491 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13493 return (((void *)0));
13494 nameSpace = newSpace;
13502 return ScanGlobalData(nameSpace, name + start);
13504 return (((void *)0));
13507 static int definedExpStackPos;
13509 static void * definedExpStack[512];
13511 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13513 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13515 FreeExpContents(checkedExp);
13516 FreeType(checkedExp->expType);
13517 FreeType(checkedExp->destType);
13518 *checkedExp = *newExp;
13519 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13520 checkedExp->prev = prev;
13521 checkedExp->next = next;
13524 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13526 extern int printf(char * , ...);
13528 void __ecereMethod_Expression_Clear();
13530 void ApplyAnyObjectLogic(struct Expression * e)
13532 struct Type * destType = e->destType;
13534 if(destType && (destType->classObjectType == 3))
13536 if(e && e->expType)
13538 struct Type * type = e->expType;
13539 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13541 if(type->kind == 8 && type->_class && type->_class->registered)
13543 _class = type->_class->registered;
13545 else if(type->kind == 19)
13547 _class = FindClass("ecere::com::Class")->registered;
13551 char string[1024] = "";
13552 struct Symbol * classSym;
13554 PrintTypeNoConst(type, string, 0x0, 0x1);
13555 classSym = FindClass(string);
13557 _class = classSym->registered;
13559 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)))
13561 if(!_class || strcmp(_class->fullName, "char *"))
13563 struct Expression * checkedExp = e, * newExp;
13565 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13567 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13569 if(checkedExp->type == 23)
13571 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13574 checkedExp = (*checkedExp->list).last;
13576 else if(checkedExp->type == 11)
13577 checkedExp = checkedExp->cast.exp;
13579 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13581 newExp = checkedExp->op.exp2;
13582 checkedExp->op.exp2 = (((void *)0));
13583 FreeExpContents(checkedExp);
13584 if(e->expType && e->expType->passAsTemplate)
13588 ComputeTypeSize(e->expType);
13589 sprintf(size, "%d", e->expType->size);
13590 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))))));
13592 ReplaceExpContents(checkedExp, newExp);
13593 e->byReference = 0x1;
13595 else if(!e->byReference || (_class && _class->type == 5))
13597 struct Expression * checkedExp, * newExp;
13600 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;
13602 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13604 struct Context * context = PushContext();
13605 struct Declarator * decl;
13606 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13607 char typeString[1024];
13608 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13610 typeString[0] = '\0';
13612 newExp->prev = (((void *)0));
13613 newExp->next = (((void *)0));
13614 newExp->expType = (((void *)0));
13615 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13616 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13617 newExp->destType = ProcessType(specs, decl);
13618 curContext = context;
13622 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13625 sprintf(name, "__internalValue%03X", internalValueCounter++);
13626 if(!curCompound->compound.declarations)
13627 curCompound->compound.declarations = MkList();
13628 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13629 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13630 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13631 e->compound = MkCompoundStmt((((void *)0)), stmts);
13634 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13636 struct Type * type = e->destType;
13638 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13639 CopyTypeInto(e->destType, type);
13640 e->destType->refCount = 1;
13641 e->destType->classObjectType = 0;
13644 e->compound->compound.context = context;
13645 PopContext(context);
13646 curContext = context->parent;
13650 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13652 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13654 if(checkedExp->type == 23)
13656 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13659 checkedExp = (*checkedExp->list).last;
13661 else if(checkedExp->type == 11)
13662 checkedExp = checkedExp->cast.exp;
13665 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13667 *operand = *checkedExp;
13668 checkedExp->destType = (((void *)0));
13669 checkedExp->expType = (((void *)0));
13670 __ecereMethod_Expression_Clear(checkedExp);
13671 checkedExp->type = 4;
13672 checkedExp->op.op = '&';
13673 checkedExp->op.exp1 = (((void *)0));
13674 checkedExp->op.exp2 = operand;
13683 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))))
13685 if(e->expType->classObjectType && destType && destType->classObjectType)
13691 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13694 thisExp->prev = (((void *)0));
13695 thisExp->next = (((void *)0));
13696 __ecereMethod_Expression_Clear(e);
13698 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13699 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13700 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13702 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13703 CopyTypeInto(e->expType, thisExp->expType);
13704 e->expType->byReference = 0x0;
13705 e->expType->refCount = 1;
13706 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))
13708 e->expType->classObjectType = 0;
13713 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13715 if(destType->kind == 14)
13717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13719 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13721 unsigned int byReference = e->expType->byReference;
13722 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13723 struct Declarator * decl;
13724 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13725 char typeString[1024];
13726 struct Type * type;
13727 int backupClassObjectType;
13728 unsigned int backupByReference;
13730 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13734 backupClassObjectType = type->classObjectType;
13735 backupByReference = type->byReference;
13736 type->classObjectType = 0;
13737 type->byReference = 0x0;
13738 typeString[0] = '\0';
13739 PrintType(type, typeString, 0x0, 0x1);
13740 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13741 type->classObjectType = backupClassObjectType;
13742 type->byReference = backupByReference;
13744 thisExp->prev = (((void *)0));
13745 thisExp->next = (((void *)0));
13746 __ecereMethod_Expression_Clear(e);
13747 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)))
13751 e->op.exp1 = (((void *)0));
13752 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13753 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13754 CopyTypeInto(e->expType, type);
13755 e->expType->byReference = 0x0;
13756 e->expType->refCount = 1;
13761 e->cast.typeName = MkTypeName(specs, decl);
13762 e->cast.exp = thisExp;
13763 e->byReference = 0x1;
13767 e->destType = destType;
13768 destType->refCount++;
13773 extern char * strstr(const char * , const char * );
13775 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13777 struct __ecereNameSpace__ecere__com__DefinedExpression
13779 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13780 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13783 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13784 } __attribute__ ((gcc_struct));
13786 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13788 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13790 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13792 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13794 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13796 extern struct Expression * CopyExpression(struct Expression * exp);
13798 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13800 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13802 static void ProcessStatement(struct Statement * stmt);
13804 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13806 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13808 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13810 extern char * sourceFile;
13812 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13814 void ProcessExpressionType(struct Expression * exp)
13816 unsigned int unresolved = 0x0;
13817 struct Location oldyylloc = yylloc;
13818 unsigned int notByReference = 0x0;
13820 if(!exp || exp->expType)
13827 struct Identifier * id = exp->identifier;
13829 if(!id || !topContext)
13831 if(id->_class && id->_class->name)
13833 id->classSym = id->_class->symbol;
13835 if(strstr(id->string, "__ecereClass") == id->string)
13837 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13840 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13842 ReplaceClassMembers(exp, thisClass);
13845 ProcessExpressionType(exp);
13848 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13853 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13857 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13863 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13866 ProcessExpressionType(exp);
13870 else if(currentClass && !id->_class)
13872 if(ResolveIdWithClass(exp, currentClass, 0x1))
13875 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13880 struct Type * type = symbol->type;
13881 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13883 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13885 struct Context * context = SetupTemplatesContext(_class);
13887 type = ReplaceThisClassType(_class);
13888 FinishTemplatesContext(context);
13890 type->refCount = 0;
13892 FreeSpecifier(id->_class);
13893 id->_class = (((void *)0));
13894 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13895 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13896 id->classSym = (((void *)0));
13897 exp->expType = type;
13900 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13901 exp->isConstant = 0x1;
13902 if(symbol->isParam || !strcmp(id->string, "this"))
13904 if(_class && _class->type == 1 && !type->declaredWithStruct)
13905 exp->byReference = 0x1;
13907 if(symbol->isIterator)
13909 if(symbol->isIterator == 3)
13912 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13913 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13914 exp->expType = (((void *)0));
13915 ProcessExpressionType(exp);
13917 else if(symbol->isIterator != 4)
13920 exp->member.exp = MkExpIdentifier(exp->identifier);
13921 exp->member.exp->expType = exp->expType;
13922 exp->member.member = MkIdentifier("data");
13923 exp->expType = (((void *)0));
13924 ProcessExpressionType(exp);
13931 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13933 if(thisNameSpace && !(id->_class && !id->_class->name))
13937 strcpy(name, thisNameSpace);
13938 strcat(name, "::");
13939 strcat(name, id->string);
13940 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13943 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13948 for(c = 0; c < definedExpStackPos; c++)
13949 if(definedExpStack[c] == definedExp)
13951 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13953 struct Location backupYylloc = yylloc;
13954 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13956 definedExpStack[definedExpStackPos++] = definedExp;
13957 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13958 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13959 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13961 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13962 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13963 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13964 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13966 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13967 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13969 parsedExpression = (((void *)0));
13971 expression_yyparse();
13972 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13974 fileInput = backInput;
13975 yylloc = backupYylloc;
13976 if(parsedExpression)
13978 FreeIdentifier(id);
13980 exp->list = MkListOne(parsedExpression);
13981 parsedExpression->loc = yylloc;
13982 ProcessExpressionType(exp);
13983 definedExpStackPos--;
13986 definedExpStackPos--;
13992 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13998 struct GlobalData * data = (((void *)0));
14000 if(thisNameSpace && !(id->_class && !id->_class->name))
14004 strcpy(name, thisNameSpace);
14005 strcat(name, "::");
14006 strcat(name, id->string);
14007 data = FindGlobalData(name);
14010 data = FindGlobalData(id->string);
14013 DeclareGlobalData(data);
14014 exp->expType = data->dataType;
14016 data->dataType->refCount++;
14017 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14018 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14019 FreeSpecifier(id->_class);
14020 id->_class = (((void *)0));
14025 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14027 if(thisNameSpace && !(id->_class && !id->_class->name))
14031 strcpy(name, thisNameSpace);
14032 strcat(name, "::");
14033 strcat(name, id->string);
14034 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14037 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14042 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14043 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14045 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14046 strcpy(name, "__ecereFunction_");
14047 FullClassNameCat(name, id->string, 0x0);
14048 if(DeclareFunction(function, name))
14050 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14051 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14053 exp->expType = function->dataType;
14054 if(function->dataType)
14055 function->dataType->refCount++;
14056 FreeSpecifier(id->_class);
14057 id->_class = (((void *)0));
14069 struct __ecereNameSpace__ecere__com__Class * _class;
14071 if(!exp->instance->_class)
14073 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14075 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14078 ProcessInstantiationType(exp->instance);
14079 exp->isConstant = exp->instance->isConstant;
14080 if(exp->instance->_class)
14082 exp->expType = MkClassType(exp->instance->_class->name);
14090 char * constant = exp->constant;
14091 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14093 exp->expType = type;
14094 if(constant[0] == '\'')
14096 if((int)((unsigned char *)constant)[1] > 127)
14099 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14103 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14104 exp->constant = PrintUInt(ch);
14106 type->_class = FindClass("unichar");
14107 type->isSigned = 0x0;
14112 type->isSigned = 0x1;
14117 char * dot = strchr(constant, '.');
14118 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14123 exponent = strchr(constant, 'p');
14125 exponent = strchr(constant, 'P');
14129 exponent = strchr(constant, 'e');
14131 exponent = strchr(constant, 'E');
14133 if(dot || exponent)
14135 if(strchr(constant, 'f') || strchr(constant, 'F'))
14139 type->isSigned = 0x1;
14143 unsigned int isSigned = constant[0] == '-';
14144 char * endP = (((void *)0));
14145 long long i64 = strtoll(constant, &endP, 0);
14146 uint64 ui64 = strtoull(constant, &endP, 0);
14147 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14151 if(i64 < (((int)0x80000000)))
14156 if(ui64 > (((int)0x7fffffff)))
14158 if(ui64 > (0xffffffff))
14161 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14165 else if(constant[0] != '0' || !constant[1])
14168 type->kind = is64Bit ? 4 : 3;
14169 type->isSigned = isSigned;
14172 exp->isConstant = 0x1;
14173 if(exp->destType && exp->destType->kind == 7)
14175 else if(exp->destType && exp->destType->kind == 6)
14177 else if(exp->destType && exp->destType->kind == 4)
14184 exp->isConstant = 0x1;
14185 exp->expType = __extension__ ({
14186 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14188 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14189 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14191 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14192 }), __ecereInstance2;
14198 ProcessExpressionType(exp->_new.size);
14199 exp->expType = __extension__ ({
14200 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14202 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14204 DeclareType(exp->expType->type, 0x0, 0x0);
14208 ProcessExpressionType(exp->_renew.size);
14209 ProcessExpressionType(exp->_renew.exp);
14210 exp->expType = __extension__ ({
14211 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14213 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14215 DeclareType(exp->expType->type, 0x0, 0x0);
14219 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14220 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14221 unsigned int useDestType = 0x0, useSideType = 0x0;
14222 struct Location oldyylloc = yylloc;
14223 unsigned int useSideUnit = 0x0;
14224 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14266 if(exp->op.op != '*' || exp->op.exp1)
14273 if(exp->op.op == '&')
14275 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14277 struct Identifier * id = exp->op.exp2->identifier;
14278 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14280 if(symbol && symbol->isIterator == 2)
14283 exp->member.exp = exp->op.exp2;
14284 exp->member.member = MkIdentifier("key");
14285 exp->expType = (((void *)0));
14286 exp->op.exp2->expType = symbol->type;
14287 symbol->type->refCount++;
14288 ProcessExpressionType(exp);
14296 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
14298 if(exp->op.exp1->destType)
14299 FreeType(exp->op.exp1->destType);
14300 exp->op.exp1->destType = exp->destType;
14302 exp->destType->refCount++;
14306 if(exp->op.exp1->destType)
14307 FreeType(exp->op.exp1->destType);
14308 exp->op.exp1->destType = dummy;
14311 if(exp->op.exp1->destType && exp->op.op != '=')
14312 exp->op.exp1->destType->count++;
14313 ProcessExpressionType(exp->op.exp1);
14314 if(exp->op.exp1->destType && exp->op.op != '=')
14315 exp->op.exp1->destType->count--;
14316 if(exp->op.exp1->destType == dummy)
14319 exp->op.exp1->destType = (((void *)0));
14321 type1 = exp->op.exp1->expType;
14325 char expString[10240];
14327 expString[0] = '\0';
14328 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14332 exp->op.exp2->destType = exp->op.exp1->expType;
14333 if(exp->op.exp1->expType)
14334 exp->op.exp1->expType->refCount++;
14338 exp->op.exp2->destType = exp->destType;
14340 exp->destType->refCount++;
14344 exp->expType = type1;
14349 PrintExpression(exp->op.exp2, expString);
14350 if(type1 && type1->kind == 13)
14352 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)
14353 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14354 else if(exp->op.op == '=')
14356 if(exp->op.exp2->destType)
14357 FreeType(exp->op.exp2->destType);
14358 exp->op.exp2->destType = type1;
14365 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)
14369 if(exp->op.exp2->destType)
14370 FreeType(exp->op.exp2->destType);
14371 exp->op.exp2->destType = type1;
14378 exp->expType = type1;
14380 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
14382 if(exp->op.exp2->destType)
14383 FreeType(exp->op.exp2->destType);
14384 exp->op.exp2->destType = exp->destType;
14386 exp->destType->refCount++;
14390 if(exp->op.exp2->destType)
14391 FreeType(exp->op.exp2->destType);
14392 exp->op.exp2->destType = dummy;
14395 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14397 FreeType(exp->op.exp2->destType);
14398 exp->op.exp2->destType = type1;
14401 if(exp->op.exp2->destType && exp->op.op != '=')
14402 exp->op.exp2->destType->count++;
14403 if(exp->op.op == SIZEOF)
14405 struct Expression * e = exp->op.exp2;
14407 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14409 if(e->type == 5 || e->type == 32 || e->type == 23)
14412 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14414 e = (*e->list).last;
14417 if(e->type == 11 && e->cast.exp)
14418 e->cast.exp->needCast = 0x1;
14420 ProcessExpressionType(exp->op.exp2);
14421 if(exp->op.exp2->destType && exp->op.op != '=')
14422 exp->op.exp2->destType->count--;
14423 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14425 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)
14427 if(exp->op.op != '=' && type1->type->kind == 0)
14428 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14430 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)))
14432 if(exp->op.op == ADD_ASSIGN)
14433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14435 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))
14437 if(exp->op.op == ADD_ASSIGN)
14438 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14440 else if(inCompiler)
14442 char type1String[1024];
14443 char type2String[1024];
14445 type1String[0] = '\0';
14446 type2String[0] = '\0';
14447 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14448 PrintType(type1, type2String, 0x0, 0x1);
14449 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14450 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14453 if(exp->op.exp2->destType == dummy)
14456 exp->op.exp2->destType = (((void *)0));
14458 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14460 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14461 type2->refCount = 1;
14462 CopyTypeInto(type2, exp->op.exp2->expType);
14463 type2->isSigned = 0x1;
14465 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14467 type2 = __extension__ ({
14468 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14470 __ecereInstance1->kind = 3, __ecereInstance1;
14472 type2->refCount = 1;
14473 type2->isSigned = 0x1;
14477 type2 = exp->op.exp2->expType;
14483 if(exp->op.op == SIZEOF)
14485 exp->expType = __extension__ ({
14486 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14488 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14490 exp->isConstant = 0x1;
14492 else if(exp->op.op == '*' && !exp->op.exp1)
14494 exp->expType = Dereference(type2);
14495 if(type2 && type2->kind == 8)
14496 notByReference = 0x1;
14498 else if(exp->op.op == '&' && !exp->op.exp1)
14499 exp->expType = Reference(type2);
14506 if(exp->op.exp1->destType)
14507 FreeType(exp->op.exp1->destType);
14508 exp->op.exp1->destType = MkClassType("bool");
14509 exp->op.exp1->destType->truth = 0x1;
14510 if(!exp->op.exp1->expType)
14511 ProcessExpressionType(exp->op.exp1);
14513 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14514 FreeType(exp->op.exp1->expType);
14515 exp->op.exp1->expType = MkClassType("bool");
14516 exp->op.exp1->expType->truth = 0x1;
14520 if(exp->op.exp2->destType)
14521 FreeType(exp->op.exp2->destType);
14522 exp->op.exp2->destType = MkClassType("bool");
14523 exp->op.exp2->destType->truth = 0x1;
14524 if(!exp->op.exp2->expType)
14525 ProcessExpressionType(exp->op.exp2);
14527 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14528 FreeType(exp->op.exp2->expType);
14529 exp->op.exp2->expType = MkClassType("bool");
14530 exp->op.exp2->expType->truth = 0x1;
14533 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")))))
14535 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14537 if(exp->op.exp2->destType)
14538 FreeType(exp->op.exp2->destType);
14539 exp->op.exp2->destType = type1;
14541 if(exp->op.exp1->destType)
14542 FreeType(exp->op.exp1->destType);
14543 exp->op.exp1->destType = type2;
14545 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)
14546 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);
14547 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14549 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14553 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14555 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14556 ProcessExpressionType(exp->op.exp1);
14557 if(type2->kind != 13)
14559 ProcessExpressionType(classExp);
14560 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"))))))));
14561 if(!exp->op.exp2->expType)
14565 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14568 ProcessExpressionType(exp->op.exp2);
14572 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)))
14574 if(type1->kind != 8 && type1->type->kind == 0)
14575 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14576 exp->expType = type1;
14580 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)))
14582 if(type2->kind != 8 && type2->type->kind == 0)
14583 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14584 exp->expType = type2;
14588 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))
14590 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14594 unsigned int success = 0x0;
14596 if(type1->kind == 13 && type2->kind == 13)
14598 if(exp->op.op == '+')
14599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14600 else if(exp->op.op == '-')
14602 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14604 exp->expType = __extension__ ({
14605 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14607 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14610 if(type1->type->kind == 20)
14612 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14616 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14618 ProcessExpressionType(classExp);
14620 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")))))));
14621 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14629 if(!success && exp->op.exp1->type == 2)
14631 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14634 FreeType(exp->expType);
14635 exp->expType = exp->op.exp1->destType;
14636 if(exp->op.exp1->destType)
14637 exp->op.exp1->destType->refCount++;
14640 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14643 FreeType(exp->expType);
14644 exp->expType = exp->op.exp2->destType;
14645 if(exp->op.exp2->destType)
14646 exp->op.exp2->destType->refCount++;
14652 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14655 FreeType(exp->expType);
14656 exp->expType = exp->op.exp2->destType;
14657 if(exp->op.exp2->destType)
14658 exp->op.exp2->destType->refCount++;
14661 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14664 FreeType(exp->expType);
14665 exp->expType = exp->op.exp1->destType;
14666 if(exp->op.exp1->destType)
14667 exp->op.exp1->destType->refCount++;
14673 char expString1[10240];
14674 char expString2[10240];
14678 expString1[0] = '\0';
14679 expString2[0] = '\0';
14684 PrintExpression(exp->op.exp1, expString1);
14685 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14686 PrintExpression(exp->op.exp2, expString2);
14687 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14688 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14689 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14691 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14695 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14697 if(exp->op.exp1->destType)
14698 FreeType(exp->op.exp1->destType);
14699 exp->op.exp1->destType = type2->_class->registered->dataType;
14700 if(type2->_class->registered->dataType)
14701 type2->_class->registered->dataType->refCount++;
14702 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14703 exp->expType = type2;
14707 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14709 if(exp->op.exp2->destType)
14710 FreeType(exp->op.exp2->destType);
14711 exp->op.exp2->destType = type1->_class->registered->dataType;
14712 if(type1->_class->registered->dataType)
14713 type1->_class->registered->dataType->refCount++;
14714 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14715 exp->expType = type1;
14721 unsigned int valid = 0x0;
14723 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14725 if(exp->op.exp2->destType)
14726 FreeType(exp->op.exp2->destType);
14727 if(!type1->_class->registered->dataType)
14728 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14729 exp->op.exp2->destType = type1->_class->registered->dataType;
14730 exp->op.exp2->destType->refCount++;
14731 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14734 type2 = exp->op.exp2->destType;
14737 exp->expType = type2;
14740 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14742 if(exp->op.exp1->destType)
14743 FreeType(exp->op.exp1->destType);
14744 if(!type2->_class->registered->dataType)
14745 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14746 exp->op.exp1->destType = type2->_class->registered->dataType;
14747 exp->op.exp1->destType->refCount++;
14748 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14749 type1 = exp->op.exp1->destType;
14750 exp->expType = type1;
14753 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14755 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14757 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14760 FreeType(exp->expType);
14761 exp->expType = exp->op.exp1->expType;
14762 if(exp->op.exp2->expType)
14763 exp->op.exp1->expType->refCount++;
14767 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14769 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14772 FreeType(exp->expType);
14773 exp->expType = exp->op.exp2->expType;
14774 if(exp->op.exp2->expType)
14775 exp->op.exp2->expType->refCount++;
14782 if(exp->op.exp2->destType)
14783 FreeType(exp->op.exp2->destType);
14784 exp->op.exp2->destType = type1;
14786 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14789 FreeType(exp->expType);
14790 exp->expType = exp->op.exp2->destType;
14791 if(exp->op.exp2->destType)
14792 exp->op.exp2->destType->refCount++;
14794 else if(type1 && type2)
14796 char expString1[10240];
14797 char expString2[10240];
14798 char type1String[1024];
14799 char type2String[1024];
14801 expString1[0] = '\0';
14802 expString2[0] = '\0';
14803 type1String[0] = '\0';
14804 type2String[0] = '\0';
14807 PrintExpression(exp->op.exp1, expString1);
14808 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14809 PrintExpression(exp->op.exp2, expString2);
14810 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14811 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14812 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14814 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14815 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14817 exp->expType = exp->op.exp1->expType;
14818 if(exp->op.exp1->expType)
14819 exp->op.exp1->expType->refCount++;
14821 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14823 exp->expType = exp->op.exp2->expType;
14824 if(exp->op.exp2->expType)
14825 exp->op.exp2->expType->refCount++;
14832 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14834 struct Type * oldType = exp->op.exp1->expType;
14836 exp->op.exp1->expType = (((void *)0));
14837 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14840 exp->op.exp1->expType = oldType;
14842 if(exp->op.exp1->destType)
14843 FreeType(exp->op.exp1->destType);
14844 exp->op.exp1->destType = type2;
14846 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14849 FreeType(exp->expType);
14850 exp->expType = exp->op.exp1->destType;
14851 if(exp->op.exp1->destType)
14852 exp->op.exp1->destType->refCount++;
14856 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14858 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14860 if(exp->op.exp1->destType)
14861 FreeType(exp->op.exp1->destType);
14862 exp->op.exp1->destType = type2->_class->registered->dataType;
14863 if(type2->_class->registered->dataType)
14864 type2->_class->registered->dataType->refCount++;
14865 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14867 if(exp->op.op == '!')
14869 exp->expType = MkClassType("bool");
14870 exp->expType->truth = 0x1;
14874 exp->expType = type2;
14879 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14881 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14883 if(exp->op.exp2->destType)
14884 FreeType(exp->op.exp2->destType);
14885 exp->op.exp2->destType = type1->_class->registered->dataType;
14886 if(type1->_class->registered->dataType)
14887 type1->_class->registered->dataType->refCount++;
14888 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14890 exp->expType = type1;
14896 if(exp->op.exp1 && !exp->op.exp1->expType)
14898 char expString[10000];
14900 expString[0] = '\0';
14903 PrintExpression(exp->op.exp1, expString);
14904 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14909 if(exp->op.exp2 && !exp->op.exp2->expType)
14911 char expString[10240];
14913 expString[0] = '\0';
14916 PrintExpression(exp->op.exp2, expString);
14917 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14920 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14924 FreeType(exp->expType);
14925 exp->expType = MkClassType("bool");
14926 exp->expType->truth = 0x1;
14928 if(exp->op.op != SIZEOF)
14929 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14930 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14932 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14934 yylloc = oldyylloc;
14943 struct Expression * e;
14945 exp->isConstant = 0x1;
14946 for(e = (*exp->list).first; e; e = e->next)
14948 unsigned int inced = 0x0;
14952 FreeType(e->destType);
14953 e->destType = exp->destType;
14956 exp->destType->refCount++;
14957 e->destType->count++;
14961 ProcessExpressionType(e);
14963 exp->destType->count--;
14964 if(!exp->expType && !e->next)
14966 exp->expType = e->expType;
14968 e->expType->refCount++;
14971 exp->isConstant = 0x0;
14973 e = (*exp->list).first;
14974 if(!e->next && e->type == 8)
14976 struct Expression * next = exp->next, * prev = exp->prev;
14978 FreeType(exp->expType);
14979 FreeType(exp->destType);
14980 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14984 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14985 ProcessExpressionType(exp);
14991 struct Expression * e;
14993 exp->isConstant = 0x1;
14994 ProcessExpressionType(exp->index.exp);
14995 if(!exp->index.exp->isConstant)
14996 exp->isConstant = 0x0;
14997 if(exp->index.exp->expType)
14999 struct Type * source = exp->index.exp->expType;
15001 if(source->kind == 8 && source->_class && source->_class->registered)
15003 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15004 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15006 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15008 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15009 if(exp->index.index && (*exp->index.index).last)
15011 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15016 for(e = (*exp->index.index).first; e; e = e->next)
15018 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15021 FreeType(e->destType);
15022 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15024 ProcessExpressionType(e);
15029 exp->isConstant = 0x0;
15032 exp->expType = Dereference(exp->index.exp->expType);
15034 DeclareType(exp->expType, 0x0, 0x0);
15039 struct Expression * e;
15040 struct Type * functionType;
15041 struct Type * methodType = (((void *)0));
15047 PrintExpression(exp->call.exp, name);
15048 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15050 PrintExpression(exp->call.exp, name);
15053 if(exp->call.exp->type == 0)
15055 struct Expression * idExp = exp->call.exp;
15056 struct Identifier * id = idExp->identifier;
15058 if(!strcmp(id->string, "__builtin_frame_address"))
15060 exp->expType = ProcessTypeString("void *", 0x1);
15061 if(exp->call.arguments && (*exp->call.arguments).first)
15062 ProcessExpressionType((*exp->call.arguments).first);
15065 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15067 exp->expType = ProcessTypeString("int", 0x1);
15068 if(exp->call.arguments && (*exp->call.arguments).first)
15069 ProcessExpressionType((*exp->call.arguments).first);
15072 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15074 struct Expression * a = (((void *)0));
15075 struct Expression * b = (((void *)0));
15076 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15078 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15080 a = (*exp->call.arguments).first;
15081 b = (*exp->call.arguments).last;
15085 else if((*exp->call.arguments).count == 1)
15087 a = (*exp->call.arguments).first;
15092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15093 idExp->identifier = (((void *)0));
15094 FreeExpContents(exp);
15095 ProcessExpressionType(a);
15097 ProcessExpressionType(b);
15099 exp->list = MkList();
15100 if(a->expType && (!b || b->expType))
15102 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15107 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15108 struct Declaration * decl;
15109 char temp1[1024], temp2[1024];
15111 GetTypeSpecs(a->expType, specs);
15112 if(a && !a->isConstant && a->type != 0)
15114 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15115 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15116 tempExp1 = QMkExpId(temp1);
15117 tempExp1->expType = a->expType;
15119 a->expType->refCount++;
15120 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15122 if(b && !b->isConstant && b->type != 0)
15124 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15125 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15126 tempExp2 = QMkExpId(temp2);
15127 tempExp2->expType = b->expType;
15129 b->expType->refCount++;
15130 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15132 decl = MkDeclaration(specs, decls);
15133 if(!curCompound->compound.declarations)
15134 curCompound->compound.declarations = MkList();
15135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15139 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15141 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15143 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15144 exp->expType = a->expType;
15146 a->expType->refCount++;
15148 else if(!strcmp(id->string, "Abs"))
15150 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15151 exp->expType = a->expType;
15153 a->expType->refCount++;
15155 else if(!strcmp(id->string, "Sgn"))
15157 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"))))));
15158 exp->expType = ProcessTypeString("int", 0x0);
15160 FreeExpression(tempExp1);
15162 FreeExpression(tempExp2);
15163 FreeIdentifier(id);
15169 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15171 if(!exp->call.exp->destType)
15173 exp->call.exp->destType = dummy;
15176 ProcessExpressionType(exp->call.exp);
15177 if(exp->call.exp->destType == dummy)
15180 exp->call.exp->destType = (((void *)0));
15184 functionType = exp->call.exp->expType;
15185 if(functionType && functionType->kind == 16)
15187 methodType = functionType;
15188 functionType = methodType->method->dataType;
15189 if(exp->call.exp->expType->usedClass)
15191 char typeString[1024];
15193 typeString[0] = '\0';
15195 struct Symbol * back = functionType->thisClass;
15197 functionType->thisClass = (((void *)0));
15198 PrintType(functionType, typeString, 0x1, 0x1);
15199 functionType->thisClass = back;
15201 if(strstr(typeString, "thisclass"))
15203 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15204 struct Declarator * decl;
15207 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15209 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15210 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15211 thisClassParams = 0x0;
15212 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15214 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15216 thisClass = exp->call.exp->expType->usedClass;
15217 ProcessDeclarator(decl);
15218 thisClass = backupThisClass;
15220 thisClassParams = 0x1;
15221 functionType = ProcessType(specs, decl);
15222 functionType->refCount = 0;
15223 FinishTemplatesContext(context);
15225 FreeList(specs, FreeSpecifier);
15226 FreeDeclarator(decl);
15230 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15232 struct Type * type = functionType->type;
15234 if(!functionType->refCount)
15236 functionType->type = (((void *)0));
15237 FreeType(functionType);
15239 functionType = type;
15241 if(functionType && functionType->kind != 11)
15243 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15245 else if(functionType)
15247 unsigned int emptyParams = 0x0, noParams = 0x0;
15248 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15249 struct Type * type = functionType->params.first;
15250 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15252 struct Location oldyylloc = yylloc;
15256 if(functionType->extraParam && e && functionType->thisClass)
15258 e->destType = MkClassType(functionType->thisClass->string);
15261 if(!functionType->staticMethod && !functionType->extraParam)
15263 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15265 type = MkClassType(memberExp->member.exp->expType->_class->string);
15268 e->destType = type;
15270 type = functionType->params.first;
15273 type->refCount = 0;
15275 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15277 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15278 type->byReference = functionType->byReference;
15279 type->typedByReference = functionType->typedByReference;
15282 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15284 e->destType = type;
15286 type = functionType->params.first;
15289 type->refCount = 0;
15292 if(type && type->kind == 0)
15295 if(!type->refCount)
15297 type = (((void *)0));
15299 for(; e; e = e->next)
15301 if(!type && !emptyParams)
15304 if(methodType && methodType->methodClass)
15305 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);
15307 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);
15310 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15312 struct Type * templatedType = (((void *)0));
15313 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15314 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15317 if(_class && _class->templateArgs)
15319 struct __ecereNameSpace__ecere__com__Class * sClass;
15321 for(sClass = _class; sClass; sClass = sClass->base)
15323 if(sClass->templateClass)
15324 sClass = sClass->templateClass;
15326 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15328 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15330 struct __ecereNameSpace__ecere__com__Class * nextClass;
15332 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15334 if(nextClass->templateClass)
15335 nextClass = nextClass->templateClass;
15336 id += nextClass->templateParams.count;
15346 if(curParam && _class->templateArgs[id].dataTypeString)
15348 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15351 struct Context * context = SetupTemplatesContext(_class);
15353 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15354 FinishTemplatesContext(context);
15356 e->destType = templatedType;
15359 templatedType->passAsTemplate = 0x1;
15364 e->destType = type;
15371 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15373 e->destType = type->prev;
15374 e->destType->refCount++;
15378 e->destType = type;
15383 if(type && type->kind != 14)
15385 struct Type * next = type->next;
15387 if(!type->refCount)
15392 if(type && type->kind != 14)
15394 if(methodType && methodType->methodClass)
15395 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);
15397 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);
15399 yylloc = oldyylloc;
15400 if(type && !type->refCount)
15405 functionType = __extension__ ({
15406 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15408 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15410 if(exp->call.exp->type == 0)
15412 char * string = exp->call.exp->identifier->string;
15416 struct Symbol * symbol;
15417 struct Location oldyylloc = yylloc;
15419 yylloc = exp->call.exp->identifier->loc;
15420 if(strstr(string, "__builtin_") == string)
15424 functionType->returnType = exp->destType;
15425 exp->destType->refCount++;
15429 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15430 symbol = __extension__ ({
15431 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15433 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15435 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15436 if(strstr(symbol->string, "::"))
15437 globalContext->hasNameSpace = 0x1;
15438 yylloc = oldyylloc;
15441 else if(exp->call.exp->type == 8)
15445 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15446 if(!functionType->returnType)
15448 functionType->returnType = __extension__ ({
15449 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15451 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15455 if(functionType && functionType->kind == 11)
15457 exp->expType = functionType->returnType;
15458 if(functionType->returnType)
15459 functionType->returnType->refCount++;
15460 if(!functionType->refCount)
15461 FreeType(functionType);
15463 if(exp->call.arguments)
15465 for(e = (*exp->call.arguments).first; e; e = e->next)
15467 struct Type * destType = e->destType;
15469 ProcessExpressionType(e);
15476 struct Type * type;
15477 struct Location oldyylloc = yylloc;
15478 unsigned int thisPtr;
15479 struct Expression * checkExp = exp->member.exp;
15483 if(checkExp->type == 11)
15484 checkExp = checkExp->cast.exp;
15485 else if(checkExp->type == 5)
15486 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15490 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15491 exp->thisPtr = thisPtr;
15492 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15494 exp->member.member->classSym = exp->member.member->_class->symbol;
15496 ProcessExpressionType(exp->member.exp);
15497 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)
15499 exp->isConstant = 0x0;
15502 exp->isConstant = exp->member.exp->isConstant;
15503 type = exp->member.exp->expType;
15505 if(type && (type->kind == 20))
15507 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15508 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15512 for(param = _class->templateParams.first; param; param = param->next)
15514 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15518 if(param && param->defaultArg.member)
15520 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15524 struct Expression * expMember = exp->member.exp;
15525 struct Declarator * decl;
15526 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15527 char thisClassTypeString[1024];
15529 FreeIdentifier(exp->member.member);
15530 ProcessExpressionType(argExp);
15532 char * colon = strstr(param->defaultArg.memberString, "::");
15536 char className[1024];
15537 struct __ecereNameSpace__ecere__com__Class * sClass;
15539 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15540 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15543 strcpy(thisClassTypeString, _class->fullName);
15545 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15546 exp->expType = ProcessType(specs, decl);
15547 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15549 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15550 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15552 int paramCount = 0;
15553 int lastParam = -1;
15554 char templateString[1024];
15555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15557 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15558 for(cClass = expClass; cClass; cClass = cClass->base)
15562 for(param = cClass->templateParams.first; param; param = param->next)
15565 struct __ecereNameSpace__ecere__com__Class * sClass;
15566 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15568 for(sClass = cClass->base; sClass; sClass = sClass->base)
15569 id += sClass->templateParams.count;
15570 arg = expClass->templateArgs[id];
15571 for(sClass = _class; sClass; sClass = sClass->base)
15573 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15575 struct __ecereNameSpace__ecere__com__Class * nextClass;
15577 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15578 p += nextClass->templateParams.count;
15579 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15581 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15583 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15585 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15586 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15593 char argument[256];
15595 argument[0] = '\0';
15596 switch(param->type)
15600 char expString[1024];
15601 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15602 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15603 struct Expression * exp;
15604 char * string = PrintHexUInt64(arg.expression.ui64);
15606 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15607 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15608 ProcessExpressionType(exp);
15609 ComputeExpression(exp);
15610 expString[0] = '\0';
15611 PrintExpression(exp, expString);
15612 strcat(argument, expString);
15613 FreeExpression(exp);
15618 strcat(argument, arg.member->name);
15623 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15625 if(!strcmp(arg.dataTypeString, "thisclass"))
15626 strcat(argument, thisClassTypeString);
15628 strcat(argument, arg.dataTypeString);
15636 strcat(templateString, ", ");
15637 if(lastParam != p - 1)
15639 strcat(templateString, param->name);
15640 strcat(templateString, " = ");
15642 strcat(templateString, argument);
15651 int len = strlen(templateString);
15653 if(templateString[len - 1] == '>')
15654 templateString[len++] = ' ';
15655 templateString[len++] = '>';
15656 templateString[len++] = '\0';
15659 struct Context * context = SetupTemplatesContext(_class);
15661 FreeType(exp->expType);
15662 exp->expType = ProcessTypeString(templateString, 0x0);
15663 FinishTemplatesContext(context);
15667 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")))))))));
15670 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15672 type = ProcessTemplateParameterType(type->templateParameter);
15675 if(type && (type->kind == 20))
15677 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)))
15679 struct Identifier * id = exp->member.member;
15680 int typeKind = type->kind;
15681 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));
15683 if(typeKind == 19 && exp->member.exp->type == 24)
15685 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15690 if(typeKind == 3 || typeKind == 15)
15691 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15694 if(type->kind == 8 && type->_class && type->_class->registered)
15696 _class = type->_class->registered;
15698 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15700 _class = FindClass("char *")->registered;
15702 else if(type->kind == 13)
15704 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15705 FreeType(exp->expType);
15706 exp->expType = ProcessTypeString("uintptr", 0x0);
15707 exp->byReference = 0x1;
15711 char string[1024] = "";
15712 struct Symbol * classSym;
15714 PrintTypeNoConst(type, string, 0x0, 0x1);
15715 classSym = FindClass(string);
15717 _class = classSym->registered;
15723 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15724 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15725 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15726 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15727 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15729 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15730 exp->member.memberType = 1;
15731 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15735 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15737 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15738 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15740 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15742 member = (((void *)0));
15744 if(!member && !prop)
15745 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15746 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15747 exp->member.thisPtr = 0x1;
15753 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15754 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15755 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15757 if(!prop && !member)
15759 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15762 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15763 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15764 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15769 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15770 prop = (((void *)0));
15772 member = (((void *)0));
15776 if(!prop && !member && !method)
15777 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15778 if(!prop && !member && !method)
15782 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15785 exp->member.memberType = 5;
15786 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15790 char structName[1024];
15791 struct Identifier * id = exp->member.member;
15792 struct Expression * classExp = exp->member.exp;
15795 FreeType(classExp->expType);
15796 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15797 strcpy(structName, "__ecereClassData_");
15798 FullClassNameCat(structName, type->_class->string, 0x0);
15800 exp->member.member = id;
15801 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"))))))));
15803 ProcessExpressionType(exp);
15809 struct Symbol * classSym = FindClass(id->string);
15813 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15816 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15822 exp->member.memberType = 1;
15823 if(!prop->dataType)
15824 ProcessPropertyType(prop);
15825 exp->expType = prop->dataType;
15827 prop->dataType->refCount++;
15831 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15833 FreeExpContents(exp);
15835 exp->identifier = MkIdentifier("class");
15836 ProcessExpressionType(exp);
15839 exp->member.memberType = 3;
15840 DeclareStruct(_class->fullName, 0x0);
15841 if(!member->dataType)
15843 struct Context * context = SetupTemplatesContext(_class);
15845 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15846 FinishTemplatesContext(context);
15848 exp->expType = member->dataType;
15849 if(member->dataType)
15850 member->dataType->refCount++;
15852 else if(revConvert)
15854 exp->member.memberType = 4;
15855 exp->expType = MkClassType(revConvert->_class->fullName);
15860 exp->member.memberType = 2;
15862 if(!method->dataType)
15863 ProcessMethodType(method);
15864 exp->expType = __extension__ ({
15865 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15867 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15869 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15870 exp->expType->usedClass = _class;
15872 else if(!classProp)
15874 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15876 FreeExpContents(exp);
15878 exp->identifier = MkIdentifier("class");
15879 FreeType(exp->expType);
15880 exp->expType = MkClassType("ecere::com::Class");
15883 yylloc = exp->member.member->loc;
15884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15886 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15888 if(_class && exp->expType)
15890 struct __ecereNameSpace__ecere__com__Class * tClass;
15893 while(tClass && !tClass->templateClass)
15894 tClass = tClass->base;
15895 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15898 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15899 struct __ecereNameSpace__ecere__com__Class * sClass;
15901 for(sClass = tClass; sClass; sClass = sClass->base)
15904 if(sClass->templateClass)
15905 sClass = sClass->templateClass;
15906 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15908 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15910 for(sClass = sClass->base; sClass; sClass = sClass->base)
15911 id += sClass->templateParams.count;
15919 if(curParam && tClass->templateArgs[id].dataTypeString)
15921 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15922 struct Context * context = SetupTemplatesContext(tClass);
15924 FreeType(exp->expType);
15925 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15928 if(exp->expType->kind == 21)
15930 FreeType(exp->expType);
15931 exp->expType = ReplaceThisClassType(_class);
15933 if(tClass->templateClass)
15934 exp->expType->passAsTemplate = 0x1;
15937 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15938 if(exp->destType->kind == 21)
15940 FreeType(exp->destType);
15941 exp->destType = ReplaceThisClassType(_class);
15945 FinishTemplatesContext(context);
15948 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15951 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15952 struct __ecereNameSpace__ecere__com__Class * sClass;
15954 for(sClass = tClass; sClass; sClass = sClass->base)
15957 if(sClass->templateClass)
15958 sClass = sClass->templateClass;
15959 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15961 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15963 for(sClass = sClass->base; sClass; sClass = sClass->base)
15964 id += sClass->templateParams.count;
15974 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15975 struct Context * context = SetupTemplatesContext(tClass);
15976 struct Type * basicType;
15978 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15981 if(basicType->kind == 21)
15983 FreeType(basicType);
15984 basicType = ReplaceThisClassType(_class);
15986 FreeType(exp->expType);
15987 exp->expType = __extension__ ({
15988 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15990 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15994 exp->destType = exp->expType;
15995 exp->destType->refCount++;
15998 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15999 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16000 struct Declarator * decl;
16002 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16005 exp->destType->refCount++;
16007 exp->expType->refCount++;
16009 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16010 exp->cast.exp = newExp;
16013 FinishTemplatesContext(context);
16016 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16018 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16022 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16025 int paramCount = 0;
16026 int lastParam = -1;
16027 char templateString[1024];
16028 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16030 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16031 while(cClass != expClass)
16033 struct __ecereNameSpace__ecere__com__Class * sClass;
16035 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16038 for(param = cClass->templateParams.first; param; param = param->next)
16040 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16043 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16044 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16046 while(cClassCur != tClass && !paramCur)
16048 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16050 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16052 cClassCur = sClassCur;
16053 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16055 if(!strcmp(paramCur->name, param->name))
16062 if(paramCur && paramCur->type == 0)
16063 arg = tClass->templateArgs[cp];
16065 arg = expClass->templateArgs[p];
16067 char argument[256];
16069 argument[0] = '\0';
16070 switch(param->type)
16074 char expString[1024];
16075 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16076 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16077 struct Expression * exp;
16078 char * string = PrintHexUInt64(arg.expression.ui64);
16080 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16081 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16082 ProcessExpressionType(exp);
16083 ComputeExpression(exp);
16084 expString[0] = '\0';
16085 PrintExpression(exp, expString);
16086 strcat(argument, expString);
16087 FreeExpression(exp);
16092 strcat(argument, arg.member->name);
16097 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16098 strcat(argument, arg.dataTypeString);
16105 strcat(templateString, ", ");
16106 if(lastParam != p - 1)
16108 strcat(templateString, param->name);
16109 strcat(templateString, " = ");
16111 strcat(templateString, argument);
16120 int len = strlen(templateString);
16122 if(templateString[len - 1] == '>')
16123 templateString[len++] = ' ';
16124 templateString[len++] = '>';
16125 templateString[len++] = '\0';
16127 FreeType(exp->expType);
16129 struct Context * context = SetupTemplatesContext(tClass);
16131 exp->expType = ProcessTypeString(templateString, 0x0);
16132 FinishTemplatesContext(context);
16139 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)");
16141 else if(type && (type->kind == 9 || type->kind == 10))
16143 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16147 exp->expType = memberType;
16149 memberType->refCount++;
16154 char expString[10240];
16156 expString[0] = '\0';
16159 PrintExpression(exp, expString);
16160 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16164 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16166 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16168 struct Identifier * id = exp->member.member;
16169 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));
16173 FreeType(exp->expType);
16174 exp->expType = ReplaceThisClassType(_class);
16178 yylloc = oldyylloc;
16183 struct Type * destType = exp->destType;
16185 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16187 exp->member.member->classSym = exp->member.member->_class->symbol;
16189 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16193 ProcessExpressionType(exp);
16200 struct Symbol * classSym = exp->_class->symbol;
16202 if(classSym && classSym->registered)
16204 if(classSym->registered->type == 5)
16209 DeclareStruct(classSym->string, 0x0);
16210 FreeSpecifier(exp->_class);
16212 FullClassNameCat(name, classSym->string, 0x0);
16213 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16217 if(classSym->registered->fixed)
16219 FreeSpecifier(exp->_class);
16220 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16225 char className[1024];
16227 strcpy(className, "__ecereClass_");
16228 FullClassNameCat(className, classSym->string, 0x1);
16229 MangleClassName(className);
16230 DeclareClass(classSym, className);
16231 FreeExpContents(exp);
16233 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16234 exp->member.member = MkIdentifier("structSize");
16238 exp->expType = __extension__ ({
16239 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16241 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16247 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16249 exp->expType = __extension__ ({
16250 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16252 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16254 exp->isConstant = 0x1;
16255 DeclareType(type, 0x0, 0x0);
16261 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16264 FreeType(exp->cast.exp->destType);
16265 exp->cast.exp->destType = type;
16267 ProcessExpressionType(exp->cast.exp);
16269 exp->expType = type;
16270 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16272 void * prev = exp->prev, * next = exp->next;
16273 struct Type * expType = exp->cast.exp->destType;
16274 struct Expression * castExp = exp->cast.exp;
16275 struct Type * destType = exp->destType;
16278 expType->refCount++;
16279 FreeType(exp->expType);
16280 FreeTypeName(exp->cast.typeName);
16282 FreeType(exp->expType);
16283 FreeType(exp->destType);
16284 exp->expType = expType;
16285 exp->destType = destType;
16286 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16292 exp->isConstant = exp->cast.exp->isConstant;
16298 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16300 exp->expType = type;
16305 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16307 ProcessExpressionType(exp->vaArg.exp);
16308 exp->expType = type;
16313 struct Expression * e;
16315 exp->isConstant = 0x1;
16316 FreeType(exp->cond.cond->destType);
16317 exp->cond.cond->destType = MkClassType("bool");
16318 exp->cond.cond->destType->truth = 0x1;
16319 ProcessExpressionType(exp->cond.cond);
16320 if(!exp->cond.cond->isConstant)
16321 exp->isConstant = 0x0;
16322 for(e = (*exp->cond.exp).first; e; e = e->next)
16326 FreeType(e->destType);
16327 e->destType = exp->destType;
16329 e->destType->refCount++;
16331 ProcessExpressionType(e);
16334 exp->expType = e->expType;
16336 e->expType->refCount++;
16339 exp->isConstant = 0x0;
16341 FreeType(exp->cond.elseExp->destType);
16342 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16343 if(exp->cond.elseExp->destType)
16344 exp->cond.elseExp->destType->refCount++;
16345 ProcessExpressionType(exp->cond.elseExp);
16346 if(!exp->cond.elseExp->isConstant)
16347 exp->isConstant = 0x0;
16352 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16354 struct Statement * last = (*exp->compound->compound.statements).last;
16356 if(last->type == 3 && last->expressions && (*last->expressions).last)
16358 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16360 exp->destType->refCount++;
16362 ProcessStatement(exp->compound);
16363 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16365 exp->expType->refCount++;
16371 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16373 if(spec && spec->type == 1)
16375 exp->expType = MkClassType(spec->name);
16376 exp->expType->kind = 19;
16377 exp->byReference = 0x1;
16381 exp->expType = MkClassType("ecere::com::Class");
16382 exp->byReference = 0x1;
16388 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16392 struct Identifier * id = exp->classData.id;
16393 char structName[1024];
16394 struct Expression * classExp;
16396 strcpy(structName, "__ecereClassData_");
16397 FullClassNameCat(structName, _class->fullName, 0x0);
16399 exp->member.member = id;
16400 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16401 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16403 classExp = MkExpIdentifier(MkIdentifier("class"));
16404 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"))))))));
16405 ProcessExpressionType(exp);
16412 struct Type * type = (((void *)0));
16413 char * typeString = (((void *)0));
16414 char typeStringBuf[1024];
16416 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))
16418 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16420 typeString = templateClass->templateArgs[2].dataTypeString;
16424 struct Expression * e;
16426 for(e = (*exp->list).first; e; e = e->next)
16428 ProcessExpressionType(e);
16438 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16442 e->expType = (((void *)0));
16443 e = (*exp->list).first;
16444 ProcessExpressionType(e);
16447 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16449 FreeType(e->expType);
16450 e->expType = (((void *)0));
16452 type = (((void *)0));
16460 FreeType(e->expType);
16461 e->expType = (((void *)0));
16467 typeStringBuf[0] = '\0';
16468 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16469 typeString = typeStringBuf;
16471 type = (((void *)0));
16476 char templateString[1024];
16477 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16478 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16479 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16480 struct Expression * expExt;
16481 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16483 sprintf(templateString, "Container<%s>", typeString);
16486 struct Expression * e;
16488 type = ProcessTypeString(typeString, 0x0);
16489 while(e = (*exp->list).first)
16491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16492 e->destType = type;
16494 ProcessExpressionType(e);
16495 ListAdd(initializers, MkInitializerAssignment(e));
16498 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16500 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16501 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16502 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16503 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16505 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16507 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16509 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16510 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16512 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16515 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16517 exp->expType = ProcessTypeString(templateString, 0x0);
16519 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16520 ProcessExpressionType(expExt);
16524 exp->expType = ProcessTypeString("Container", 0x0);
16525 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16530 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16532 FreeType(exp->expType);
16533 exp->expType = ReplaceThisClassType(thisClass);
16535 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16537 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16541 if(exp->expType->kind != 15)
16543 struct Type * member;
16544 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16546 FreeType(exp->expType);
16547 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16548 exp->expType->kind = symbol->type->kind;
16549 exp->expType->refCount++;
16550 exp->expType->enumName = enumName;
16551 exp->expType->members = symbol->type->members;
16552 for(member = symbol->type->members.first; member; member = member->next)
16553 member->refCount++;
16557 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16559 for(member = symbol->type->members.first; member; member = member->next)
16561 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16569 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16571 else if(exp->destType && !exp->destType->keepCast)
16573 if(!CheckExpressionType(exp, exp->destType, 0x0))
16575 if(!exp->destType->count || unresolved)
16580 if(exp->destType->kind != 14)
16587 char expString[10240];
16589 expString[0] = '\0';
16590 PrintType(exp->destType, type2, 0x0, 0x1);
16593 PrintExpression(exp, expString);
16594 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16598 else if(exp->type != 16)
16599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16604 char expString[10240];
16606 expString[0] = '\0';
16609 PrintExpression(exp, expString);
16610 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16614 else if(exp->type != 16)
16615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16627 PrintType(exp->expType, type1, 0x0, 0x1);
16628 PrintType(exp->destType, type2, 0x0, 0x1);
16630 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)))
16634 char expString[10240];
16636 expString[0] = '\0';
16639 PrintExpression(exp, expString);
16640 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16642 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16643 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16644 FreeType(exp->expType);
16645 exp->destType->refCount++;
16646 exp->expType = exp->destType;
16651 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16653 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16654 char typeString[1024];
16655 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16656 struct Declarator * decl;
16658 typeString[0] = '\0';
16661 exp->expType->refCount++;
16663 exp->expType->refCount++;
16665 newExp->destType = exp->expType;
16666 PrintType(exp->expType, typeString, 0x0, 0x0);
16667 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16668 exp->cast.typeName = MkTypeName(specs, decl);
16669 exp->cast.exp = newExp;
16672 else if(unresolved)
16674 if(exp->identifier->_class && exp->identifier->_class->name)
16675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16676 else if(exp->identifier->string && exp->identifier->string[0])
16677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16679 else if(!exp->expType && exp->type != 16)
16681 char expString[10240];
16683 expString[0] = '\0';
16686 PrintExpression(exp, expString);
16687 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16692 ApplyAnyObjectLogic(exp);
16693 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)))
16695 exp->byReference = 0x1;
16697 yylloc = oldyylloc;
16700 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)
16704 *curMember = (*curMember)->next;
16705 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16707 *curMember = subMemberStack[--(*subMemberStackPos)];
16708 *curMember = (*curMember)->next;
16710 while((*curMember) && (*curMember)->isProperty)
16711 *curMember = (*curMember)->next;
16712 if(subMemberStackPos)
16714 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16716 subMemberStack[(*subMemberStackPos)++] = *curMember;
16717 *curMember = (*curMember)->members.first;
16718 while(*curMember && (*curMember)->isProperty)
16719 *curMember = (*curMember)->next;
16727 if(subMemberStackPos && *subMemberStackPos)
16729 *curMember = subMemberStack[--(*subMemberStackPos)];
16730 *curMember = (*curMember)->next;
16734 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16736 if(*curClass == _class)
16738 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16740 *curMember = (*curClass)->membersAndProperties.first;
16742 while((*curMember) && (*curMember)->isProperty)
16743 *curMember = (*curMember)->next;
16744 if(subMemberStackPos)
16746 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16748 subMemberStack[(*subMemberStackPos)++] = *curMember;
16749 *curMember = (*curMember)->members.first;
16750 while(*curMember && (*curMember)->isProperty)
16751 *curMember = (*curMember)->next;
16758 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16763 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16765 if(init->exp && !init->exp->destType)
16767 FreeType(init->exp->destType);
16768 init->exp->destType = type;
16774 ProcessExpressionType(init->exp);
16775 init->isConstant = init->exp->isConstant;
16781 struct Expression * exp = init->exp;
16782 struct Instantiation * inst = exp->instance;
16783 struct MembersInit * members;
16786 init->list = MkList();
16789 for(members = (*inst->members).first; members; members = members->next)
16791 if(members->type == 0)
16793 struct MemberInit * member;
16795 for(member = (*members->dataMembers).first; member; member = member->next)
16797 ListAdd(init->list, member->initializer);
16798 member->initializer = (((void *)0));
16803 FreeExpression(exp);
16807 struct Initializer * i;
16808 struct Type * initializerType = (((void *)0));
16809 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16810 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16811 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16812 int subMemberStackPos = 0;
16814 if(type && type->kind == 12)
16815 initializerType = Dereference(type);
16816 else if(type && (type->kind == 9 || type->kind == 10))
16817 initializerType = type->members.first;
16818 for(i = (*init->list).first; i; i = i->next)
16820 if(type && type->kind == 8 && type->_class && type->_class->registered)
16822 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16825 if(!curMember->dataType)
16826 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16827 initializerType = curMember->dataType;
16830 ProcessInitializer(i, initializerType);
16831 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16832 initializerType = initializerType->next;
16834 init->isConstant = 0x0;
16836 if(type && type->kind == 12)
16837 FreeType(initializerType);
16838 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16840 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16847 extern struct Symbol * FindType(struct Context * ctx, char * name);
16849 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16851 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16857 if(spec->specifier == THISCLASS)
16862 spec->name = ReplaceThisClass(thisClass);
16863 spec->symbol = FindClass(spec->name);
16864 ProcessSpecifier(spec, declareStruct);
16871 struct Symbol * symbol = FindType(curContext, spec->name);
16874 DeclareType(symbol->type, 0x1, 0x1);
16875 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16876 DeclareStruct(spec->name, 0x0);
16881 struct Enumerator * e;
16885 for(e = (*spec->list).first; e; e = e->next)
16888 ProcessExpressionType(e->exp);
16896 if(spec->definitions)
16898 struct ClassDef * def;
16899 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16901 ProcessClass(spec->definitions, symbol);
16908 static void ProcessDeclarator(struct Declarator * decl)
16913 if(decl->identifier->classSym)
16915 FreeSpecifier(decl->identifier->_class);
16916 decl->identifier->_class = (((void *)0));
16920 if(decl->array.exp)
16921 ProcessExpressionType(decl->array.exp);
16928 if(decl->declarator)
16929 ProcessDeclarator(decl->declarator);
16930 if(decl->type == 4)
16932 struct Identifier * id = GetDeclId(decl);
16934 if(id && id->_class)
16936 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16938 if(!decl->function.parameters)
16939 decl->function.parameters = MkList();
16940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16941 id->_class = (((void *)0));
16943 if(decl->function.parameters)
16945 struct TypeName * param;
16947 for(param = (*decl->function.parameters).first; param; param = param->next)
16949 if(param->qualifiers && (*param->qualifiers).first)
16951 struct Specifier * spec = (*param->qualifiers).first;
16953 if(spec && spec->specifier == TYPED_OBJECT)
16955 struct Declarator * d = param->declarator;
16956 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);
16958 FreeList(param->qualifiers, FreeSpecifier);
16959 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16960 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16961 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16964 else if(spec && spec->specifier == ANY_OBJECT)
16966 struct Declarator * d = param->declarator;
16968 FreeList(param->qualifiers, FreeSpecifier);
16969 param->qualifiers = MkListOne(MkSpecifier(VOID));
16970 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16972 else if(spec->specifier == THISCLASS)
16977 spec->name = ReplaceThisClass(thisClass);
16978 spec->symbol = FindClass(spec->name);
16979 ProcessSpecifier(spec, 0x0);
16983 if(param->declarator)
16984 ProcessDeclarator(param->declarator);
16992 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16994 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16996 static void ProcessDeclaration(struct Declaration * decl)
16998 yylloc = decl->loc;
17003 unsigned int declareStruct = 0x0;
17005 if(decl->declarators)
17007 struct InitDeclarator * d;
17009 for(d = (*decl->declarators).first; d; d = d->next)
17011 struct Type * type, * subType;
17013 ProcessDeclarator(d->declarator);
17014 type = ProcessType(decl->specifiers, d->declarator);
17017 ProcessInitializer(d->initializer, type);
17018 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17020 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17022 struct Instantiation * inst = d->initializer->exp->instance;
17024 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17025 d->initializer->exp->instance = (((void *)0));
17026 if(decl->specifiers)
17027 FreeList(decl->specifiers, FreeSpecifier);
17028 FreeList(decl->declarators, FreeInitDeclarator);
17035 for(subType = type; subType; )
17037 if(subType->kind == 8)
17039 declareStruct = 0x1;
17042 else if(subType->kind == 13)
17044 else if(subType->kind == 12)
17045 subType = subType->arrayType;
17054 if(decl->specifiers)
17056 struct Specifier * s;
17058 for(s = (*decl->specifiers).first; s; s = s->next)
17060 ProcessSpecifier(s, declareStruct);
17067 ProcessInstantiationType(decl->inst);
17072 struct Specifier * spec;
17073 struct Declarator * d;
17074 unsigned int declareStruct = 0x0;
17076 if(decl->declarators)
17078 for(d = (*decl->declarators).first; d; d = d->next)
17080 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17081 struct Type * subType;
17083 ProcessDeclarator(d);
17084 for(subType = type; subType; )
17086 if(subType->kind == 8)
17088 declareStruct = 0x1;
17091 else if(subType->kind == 13)
17093 else if(subType->kind == 12)
17094 subType = subType->arrayType;
17101 if(decl->specifiers)
17103 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17104 ProcessSpecifier(spec, declareStruct);
17111 static struct FunctionDefinition * curFunction;
17113 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17115 char propName[1024], propNameM[1024];
17116 char getName[1024], setName[1024];
17117 struct __ecereNameSpace__ecere__sys__OldList * args;
17119 DeclareProperty(prop, setName, getName);
17120 strcpy(propName, "__ecereProp_");
17121 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17122 strcat(propName, "_");
17123 FullClassNameCat(propName, prop->name, 0x1);
17124 MangleClassName(propName);
17125 strcpy(propNameM, "__ecerePropM_");
17126 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17127 strcat(propNameM, "_");
17128 FullClassNameCat(propNameM, prop->name, 0x1);
17129 MangleClassName(propNameM);
17130 if(prop->isWatchable)
17133 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17134 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17135 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17137 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17138 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17139 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17143 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17144 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17145 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17147 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17148 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17149 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17151 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17152 curFunction->propSet->fireWatchersDone = 0x1;
17155 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17157 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17159 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17161 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17163 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17165 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17167 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17169 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17171 static void ProcessStatement(struct Statement * stmt)
17173 yylloc = stmt->loc;
17177 ProcessStatement(stmt->labeled.stmt);
17180 if(stmt->caseStmt.exp)
17182 FreeType(stmt->caseStmt.exp->destType);
17183 stmt->caseStmt.exp->destType = curSwitchType;
17185 curSwitchType->refCount++;
17186 ProcessExpressionType(stmt->caseStmt.exp);
17187 ComputeExpression(stmt->caseStmt.exp);
17189 if(stmt->caseStmt.stmt)
17190 ProcessStatement(stmt->caseStmt.stmt);
17194 if(stmt->compound.context)
17196 struct Declaration * decl;
17197 struct Statement * s;
17198 struct Statement * prevCompound = curCompound;
17199 struct Context * prevContext = curContext;
17201 if(!stmt->compound.isSwitch)
17202 curCompound = stmt;
17203 curContext = stmt->compound.context;
17204 if(stmt->compound.declarations)
17206 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17207 ProcessDeclaration(decl);
17209 if(stmt->compound.statements)
17211 for(s = (*stmt->compound.statements).first; s; s = s->next)
17212 ProcessStatement(s);
17214 curContext = prevContext;
17215 curCompound = prevCompound;
17221 struct Expression * exp;
17223 if(stmt->expressions)
17225 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17226 ProcessExpressionType(exp);
17232 struct Expression * exp;
17234 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17235 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17236 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17237 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17239 ProcessExpressionType(exp);
17241 if(stmt->ifStmt.stmt)
17242 ProcessStatement(stmt->ifStmt.stmt);
17243 if(stmt->ifStmt.elseStmt)
17244 ProcessStatement(stmt->ifStmt.elseStmt);
17249 struct Type * oldSwitchType = curSwitchType;
17251 if(stmt->switchStmt.exp)
17253 struct Expression * exp;
17255 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17259 ProcessExpressionType(exp);
17262 curSwitchType = exp->expType;
17265 ProcessStatement(stmt->switchStmt.stmt);
17266 curSwitchType = oldSwitchType;
17271 if(stmt->whileStmt.exp)
17273 struct Expression * exp;
17275 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17276 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17277 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17278 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17280 ProcessExpressionType(exp);
17283 if(stmt->whileStmt.stmt)
17284 ProcessStatement(stmt->whileStmt.stmt);
17289 if(stmt->doWhile.exp)
17291 struct Expression * exp;
17293 if((*stmt->doWhile.exp).last)
17295 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17296 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17297 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17299 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17301 ProcessExpressionType(exp);
17304 if(stmt->doWhile.stmt)
17305 ProcessStatement(stmt->doWhile.stmt);
17310 struct Expression * exp;
17312 if(stmt->forStmt.init)
17313 ProcessStatement(stmt->forStmt.init);
17314 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17316 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17317 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17318 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17320 if(stmt->forStmt.check)
17321 ProcessStatement(stmt->forStmt.check);
17322 if(stmt->forStmt.increment)
17324 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17325 ProcessExpressionType(exp);
17327 if(stmt->forStmt.stmt)
17328 ProcessStatement(stmt->forStmt.stmt);
17333 struct Identifier * id = stmt->forEachStmt.id;
17334 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17335 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17336 struct Statement * block = stmt->forEachStmt.stmt;
17337 char iteratorType[1024];
17338 struct Type * source;
17339 struct Expression * e;
17340 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));
17341 struct Expression * arrayExp;
17342 char * typeString = (((void *)0));
17343 int builtinCount = 0;
17345 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17349 FreeType(e->destType);
17350 e->destType = ProcessTypeString("Container", 0x0);
17352 if(!isBuiltin || e->next)
17353 ProcessExpressionType(e);
17355 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17356 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17358 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17359 struct Symbol * symbol;
17360 struct Expression * expIt = (((void *)0));
17361 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17362 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17363 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17364 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17367 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17368 stmt->compound.context->parent = curContext;
17369 curContext = stmt->compound.context;
17370 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17372 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17373 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17375 isCustomAVLTree = 0x1;
17376 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17378 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17381 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17383 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17385 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17388 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17392 struct Declarator * decl;
17393 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17395 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17396 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17397 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17401 struct Type * type = (((void *)0));
17402 char typeStringBuf[1024];
17404 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17405 if(((struct Expression *)(*exp).last)->type == 11)
17407 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17410 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17412 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)
17414 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17416 typeString = templateClass->templateArgs[2].dataTypeString;
17418 else if(arrayExp->list)
17420 struct Expression * e;
17422 for(e = (*arrayExp->list).first; e; e = e->next)
17424 ProcessExpressionType(e);
17434 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17438 e->expType = (((void *)0));
17439 e = (*arrayExp->list).first;
17440 ProcessExpressionType(e);
17443 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17445 FreeType(e->expType);
17446 e->expType = (((void *)0));
17448 type = (((void *)0));
17456 FreeType(e->expType);
17457 e->expType = (((void *)0));
17463 typeStringBuf[0] = '\0';
17464 PrintType(type, typeStringBuf, 0x0, 0x1);
17465 typeString = typeStringBuf;
17471 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17472 struct Declarator * decl;
17473 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17477 struct Expression * e;
17479 builtinCount = (*arrayExp->list).count;
17480 type = ProcessTypeString(typeString, 0x0);
17481 while(e = (*arrayExp->list).first)
17483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17484 e->destType = type;
17486 ProcessExpressionType(e);
17487 ListAdd(initializers, MkInitializerAssignment(e));
17490 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17492 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17493 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17494 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17495 FreeList(exp, FreeExpression);
17499 arrayExp->expType = ProcessTypeString("Container", 0x0);
17500 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17503 else if(isLinkList && !isList)
17505 struct Declarator * decl;
17506 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17508 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17509 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17510 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17512 else if(_class->templateArgs)
17515 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17517 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17518 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17520 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17523 switch(block->type)
17526 if(block->compound.context)
17527 block->compound.context->parent = stmt->compound.context;
17530 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17531 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17532 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17533 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17536 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17537 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17540 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17541 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17544 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17545 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17548 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17549 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17552 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17553 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17559 block = MkIfStmt(filter, block, (((void *)0)));
17563 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));
17564 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17565 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17566 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17572 sprintf(count, "%d", builtinCount);
17573 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));
17574 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17575 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17576 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17578 else if(isLinkList && !isList)
17580 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17581 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17583 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17585 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));
17589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17590 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17592 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));
17594 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17595 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17596 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17600 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17602 ProcessExpressionType(expIt);
17603 if((*stmt->compound.declarations).first)
17604 ProcessDeclaration((*stmt->compound.declarations).first);
17606 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17607 ProcessStatement(stmt);
17608 curContext = stmt->compound.context->parent;
17613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17625 struct Expression * exp;
17627 if(stmt->expressions)
17629 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17633 if(curFunction && !curFunction->type)
17634 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17635 FreeType(exp->destType);
17636 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17638 exp->destType->refCount++;
17640 ProcessExpressionType(exp);
17647 ProcessDeclaration(stmt->decl);
17652 struct AsmField * field;
17654 if(stmt->asmStmt.inputFields)
17656 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17657 if(field->expression)
17658 ProcessExpressionType(field->expression);
17660 if(stmt->asmStmt.outputFields)
17662 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17663 if(field->expression)
17664 ProcessExpressionType(field->expression);
17666 if(stmt->asmStmt.clobberedFields)
17668 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17670 if(field->expression)
17671 ProcessExpressionType(field->expression);
17678 struct PropertyWatch * propWatch;
17679 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17680 struct Expression * object = stmt->_watch.object;
17681 struct Expression * watcher = stmt->_watch.watcher;
17684 ProcessExpressionType(watcher);
17686 ProcessExpressionType(object);
17689 if(watcher || thisClass)
17691 struct External * external = curExternal;
17692 struct Context * context = curContext;
17695 stmt->expressions = MkList();
17696 curExternal = external->prev;
17697 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17699 struct ClassFunction * func;
17700 char watcherName[1024];
17701 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17702 struct External * createdExternal;
17703 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17705 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17706 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17707 if(propWatch->deleteWatch)
17708 strcat(watcherName, "_delete");
17711 struct Identifier * propID;
17713 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17715 strcat(watcherName, "_");
17716 strcat(watcherName, propID->string);
17719 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17721 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17722 ProcessClassFunctionBody(func, propWatch->compound);
17723 propWatch->compound = (((void *)0));
17724 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17725 createdExternal->symbol->idCode = external->symbol->idCode;
17726 curExternal = createdExternal;
17727 ProcessFunction(createdExternal->function);
17729 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17731 externalDecl->declaration = decl;
17732 if(decl->symbol && !decl->symbol->pointerExternal)
17733 decl->symbol->pointerExternal = externalDecl;
17735 if(propWatch->deleteWatch)
17737 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17739 ListAdd(args, CopyExpression(object));
17740 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17741 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17742 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17746 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17747 struct Identifier * propID;
17749 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17751 char propName[1024];
17752 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17756 char getName[1024], setName[1024];
17757 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17759 DeclareProperty(prop, setName, getName);
17760 strcpy(propName, "__ecereProp_");
17761 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17762 strcat(propName, "_");
17763 FullClassNameCat(propName, prop->name, 0x1);
17764 ListAdd(args, CopyExpression(object));
17765 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17766 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17767 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17768 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17776 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17778 curExternal = external;
17779 curContext = context;
17781 FreeExpression(watcher);
17783 FreeExpression(object);
17784 FreeList(watches, FreePropertyWatch);
17787 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17791 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17793 ProcessStatement(propWatch->compound);
17800 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17801 struct Expression * object = stmt->_watch.object;
17802 struct __ecereNameSpace__ecere__com__Class * _class;
17805 ProcessExpressionType(object);
17808 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17811 struct Identifier * propID;
17814 stmt->expressions = MkList();
17815 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17817 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17824 for(propID = (*watches).first; propID; propID = propID->next)
17826 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17830 CreateFireWatcher(prop, object, stmt);
17833 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17838 struct __ecereNameSpace__ecere__com__Property * prop;
17839 struct __ecereNameSpace__ecere__com__Class * base;
17841 for(base = _class; base; base = base->base)
17843 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17845 if(prop->isProperty && prop->isWatchable)
17847 CreateFireWatcher(prop, object, stmt);
17853 FreeExpression(object);
17854 FreeList(watches, FreeIdentifier);
17857 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17863 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17864 struct Expression * object = stmt->_watch.object;
17865 struct Expression * watcher = stmt->_watch.watcher;
17866 struct __ecereNameSpace__ecere__com__Class * _class;
17869 ProcessExpressionType(object);
17871 ProcessExpressionType(watcher);
17874 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17875 if(watcher || thisClass)
17879 struct Identifier * propID;
17882 stmt->expressions = MkList();
17885 struct __ecereNameSpace__ecere__sys__OldList * args;
17888 ListAdd(args, CopyExpression(object));
17889 ListAdd(args, MkExpConstant("0"));
17890 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17891 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17895 for(propID = (*watches).first; propID; propID = propID->next)
17897 char propName[1024];
17898 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17902 char getName[1024], setName[1024];
17903 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17905 DeclareProperty(prop, setName, getName);
17906 strcpy(propName, "__ecereProp_");
17907 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17908 strcat(propName, "_");
17909 FullClassNameCat(propName, prop->name, 0x1);
17910 MangleClassName(propName);
17911 ListAdd(args, CopyExpression(object));
17912 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17913 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17914 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17921 FreeExpression(object);
17923 FreeExpression(watcher);
17924 FreeList(watches, FreeIdentifier);
17927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17930 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17937 extern struct Expression * QBrackets(struct Expression * exp);
17939 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17941 extern struct Declarator * QMkPtrDecl(char * id);
17943 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17945 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17947 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17949 static void ProcessFunction(struct FunctionDefinition * function)
17951 struct Identifier * id = GetDeclId(function->declarator);
17952 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17953 struct Type * type = symbol ? symbol->type : (((void *)0));
17954 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17955 struct Context * oldTopContext = topContext;
17957 yylloc = function->loc;
17958 if(type && type->thisClass)
17960 struct Symbol * classSym = type->thisClass;
17961 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17962 char className[1024];
17963 char structName[1024];
17964 struct Declarator * funcDecl;
17965 struct Symbol * thisSymbol;
17966 unsigned int typedObject = 0x0;
17968 if(_class && !_class->base)
17970 _class = currentClass;
17971 if(_class && !_class->symbol)
17972 _class->symbol = FindClass(_class->fullName);
17973 classSym = _class ? _class->symbol : (((void *)0));
17976 thisClass = _class;
17977 if(inCompiler && _class)
17979 if(type->kind == 11)
17981 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17983 struct Type * param = symbol->type->params.first;
17985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17988 if(type->classObjectType != 1)
17990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17991 symbol->type->staticMethod = 0x1;
17992 symbol->type->thisClass = (((void *)0));
17993 symbol->type->extraParam = 0x0;
17996 strcpy(className, "__ecereClass_");
17997 FullClassNameCat(className, _class->fullName, 0x1);
17998 MangleClassName(className);
17999 structName[0] = (char)0;
18000 FullClassNameCat(structName, _class->fullName, 0x0);
18001 funcDecl = GetFuncDecl(function->declarator);
18004 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18006 struct TypeName * param = (*funcDecl->function.parameters).first;
18008 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18011 FreeTypeName(param);
18014 if(!function->propertyNoThis)
18016 struct TypeName * thisParam;
18018 if(type->classObjectType != 1)
18020 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18021 if(!funcDecl->function.parameters)
18022 funcDecl->function.parameters = MkList();
18023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18027 if(type->classObjectType != 1)
18029 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18030 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18032 thisParam = __extension__ ({
18033 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18035 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18041 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18043 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18045 funcDecl = GetFuncDecl(initDecl->declarator);
18048 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18050 struct TypeName * param = (*funcDecl->function.parameters).first;
18052 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18055 FreeTypeName(param);
18058 if(type->classObjectType != 1)
18060 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18062 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18064 if(!funcDecl->function.parameters)
18065 funcDecl->function.parameters = MkList();
18066 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18074 if(type->classObjectType != 1)
18076 thisSymbol = __extension__ ({
18077 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18079 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18081 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18082 if(typedObject && thisSymbol->type)
18084 thisSymbol->type->classObjectType = 2;
18085 thisSymbol->type->byReference = type->byReference;
18086 thisSymbol->type->typedByReference = type->byReference;
18090 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18092 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18095 struct __ecereNameSpace__ecere__com__Class * base;
18097 for(base = _class; base && base->type != 1000; base = base->next)
18099 for(member = base->membersAndProperties.first; member; member = member->next)
18100 if(!member->isProperty)
18106 for(member = _class->membersAndProperties.first; member; member = member->next)
18107 if(!member->isProperty)
18111 char pointerName[1024];
18112 struct Declaration * decl;
18113 struct Initializer * initializer;
18114 struct Expression * exp, * bytePtr;
18116 strcpy(pointerName, "__ecerePointer_");
18117 FullClassNameCat(pointerName, _class->fullName, 0x0);
18119 char className[1024];
18121 strcpy(className, "__ecereClass_");
18122 FullClassNameCat(className, classSym->string, 0x1);
18123 MangleClassName(className);
18124 DeclareClass(classSym, className);
18126 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18131 sprintf(string, "%d", _class->offset);
18132 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18136 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18138 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18139 exp->expType = __extension__ ({
18140 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18142 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18143 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18145 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18146 }), __ecereInstance2;
18150 yylloc = function->body->loc;
18151 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18153 struct Context * prevContext = curContext;
18155 curContext = function->body->compound.context;
18156 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18157 curContext = prevContext;
18159 decl->symbol = (((void *)0));
18160 if(!function->body->compound.declarations)
18161 function->body->compound.declarations = MkList();
18162 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18168 thisClass = (((void *)0));
18171 FreeSpecifier(id->_class);
18172 id->_class = (((void *)0));
18173 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18175 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18177 id = GetDeclId(initDecl->declarator);
18178 FreeSpecifier(id->_class);
18179 id->_class = (((void *)0));
18183 topContext = function->body->compound.context;
18185 struct FunctionDefinition * oldFunction = curFunction;
18187 curFunction = function;
18189 ProcessStatement(function->body);
18190 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18192 struct Statement * prevCompound = curCompound;
18193 struct Context * prevContext = curContext;
18194 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18196 if(!function->body->compound.statements)
18197 function->body->compound.statements = MkList();
18198 ListAdd(function->body->compound.statements, fireWatchers);
18199 curCompound = function->body;
18200 curContext = function->body->compound.context;
18201 ProcessStatement(fireWatchers);
18202 curContext = prevContext;
18203 curCompound = prevCompound;
18205 curFunction = oldFunction;
18207 if(function->declarator)
18209 ProcessDeclarator(function->declarator);
18211 topContext = oldTopContext;
18212 thisClass = oldThisClass;
18215 extern void FreeSymbol(struct Symbol * symbol);
18217 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18219 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18221 struct ClassDef * def;
18222 struct External * external = curExternal;
18223 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18225 for(def = definitions->first; def; def = def->next)
18229 if(def->function->declarator)
18230 curExternal = def->function->declarator->symbol->pointerExternal;
18232 curExternal = external;
18233 ProcessFunction((struct FunctionDefinition *)def->function);
18235 else if(def->type == 2)
18237 if(def->decl->type == 2)
18239 thisClass = regClass;
18240 ProcessInstantiationType(def->decl->inst);
18241 thisClass = (((void *)0));
18245 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18248 thisClass = regClass;
18249 ProcessDeclaration(def->decl);
18250 thisClass = backThisClass;
18253 else if(def->type == 1 && def->defProperties)
18255 struct MemberInit * defProperty;
18256 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);
18258 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18259 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18261 thisClass = regClass;
18262 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18263 thisClass = (((void *)0));
18265 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18266 FreeSymbol(thisSymbol);
18268 else if(def->type == 3 && def->propertyDef)
18270 struct PropertyDef * prop = def->propertyDef;
18272 thisClass = regClass;
18277 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18279 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18281 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18282 ProcessStatement(prop->setStmt);
18288 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18290 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18292 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18293 ProcessStatement(prop->getStmt);
18295 if(prop->issetStmt)
18299 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18301 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18303 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18304 ProcessStatement(prop->issetStmt);
18306 thisClass = (((void *)0));
18308 else if(def->type == 4 && def->propertyWatch)
18310 struct PropertyWatch * propertyWatch = def->propertyWatch;
18312 thisClass = regClass;
18313 if(propertyWatch->compound)
18315 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);
18317 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18318 curExternal = (((void *)0));
18319 ProcessStatement(propertyWatch->compound);
18321 thisClass = (((void *)0));
18326 void DeclareFunctionUtil(char * s)
18328 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18335 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18336 strcpy(name, "__ecereFunction_");
18337 FullClassNameCat(name, s, 0x0);
18338 DeclareFunction(function, name);
18342 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18344 void ComputeDataTypes()
18346 struct External * external;
18347 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18348 struct External * after = (((void *)0));
18350 currentClass = (((void *)0));
18351 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18352 for(external = (*ast).first; external; external = external->next)
18354 if(external->type == 1)
18356 struct Declaration * decl = external->declaration;
18360 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18364 struct InitDeclarator * initDecl = (*decls).first;
18368 struct Declarator * declarator = initDecl->declarator;
18370 if(declarator && declarator->type == 1)
18372 struct Identifier * id = declarator->identifier;
18374 if(id && id->string)
18376 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18378 external->symbol->id = -1001, external->symbol->idCode = -1001;
18388 temp->symbol = __extension__ ({
18389 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18391 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18394 curExternal = temp;
18395 DeclareFunctionUtil("eSystem_New");
18396 DeclareFunctionUtil("eSystem_New0");
18397 DeclareFunctionUtil("eSystem_Renew");
18398 DeclareFunctionUtil("eSystem_Renew0");
18399 DeclareFunctionUtil("eSystem_Delete");
18400 DeclareFunctionUtil("eClass_GetProperty");
18401 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18402 DeclareStruct("ecere::com::Class", 0x0);
18403 DeclareStruct("ecere::com::Instance", 0x0);
18404 DeclareStruct("ecere::com::Property", 0x0);
18405 DeclareStruct("ecere::com::DataMember", 0x0);
18406 DeclareStruct("ecere::com::Method", 0x0);
18407 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18408 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18409 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18410 for(external = (*ast).first; external; external = external->next)
18412 afterExternal = curExternal = external;
18413 if(external->type == 0)
18415 currentClass = external->function->_class;
18416 ProcessFunction(external->function);
18418 else if(external->type == 1)
18420 currentClass = (((void *)0));
18421 ProcessDeclaration(external->declaration);
18423 else if(external->type == 2)
18425 struct ClassDefinition * _class = external->_class;
18427 currentClass = external->symbol->registered;
18428 if(_class->definitions)
18430 ProcessClass(_class->definitions, _class->symbol);
18434 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18435 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18438 else if(external->type == 4)
18440 thisNameSpace = external->id->string;
18443 currentClass = (((void *)0));
18444 thisNameSpace = (((void *)0));
18445 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18446 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18449 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);
18451 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);
18453 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18455 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18457 struct __ecereNameSpace__ecere__com__Class * class;
18459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18507 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18508 __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);
18509 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18510 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18511 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18512 __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);
18513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18525 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18526 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18527 __ecereClass_Conversion = class;
18528 __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);
18529 __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);
18530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18531 __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);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18533 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18535 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18536 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18537 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18538 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18539 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18540 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18541 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18542 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18543 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18544 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18545 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18546 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18547 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18548 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18549 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18550 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18551 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18552 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18555 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)