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%I64X" : "0x%llX"), result);
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1532 if(result > (0xffffffff))
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1537 char * PrintHexUInt64(uint64 result)
1541 if(result > (0xffffffff))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 char * PrintShort(short result)
1552 sprintf(temp, "%d", (unsigned short)result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 char * PrintUShort(unsigned short result)
1560 if(result > (unsigned short)32767)
1561 sprintf(temp, "0x%X", (int)result);
1563 sprintf(temp, "%d", (int)result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 extern int isprint(int c);
1569 char * PrintChar(char result)
1573 if(result > (char)0 && isprint(result))
1574 sprintf(temp, "'%c'", result);
1575 else if(result < (char)0)
1576 sprintf(temp, "%d", (int)result);
1578 sprintf(temp, "0x%X", (unsigned char)result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 char * PrintUChar(unsigned char result)
1586 sprintf(temp, "0x%X", result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1590 extern char * strcpy(char * , const char * );
1592 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1594 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1596 extern int (* __ecereProp_float_Get_signBit)(float this);
1598 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1600 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1602 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1604 char * PrintFloat(float result)
1608 if(__ecereProp_float_Get_isInf(result))
1610 if(__ecereProp_float_Get_signBit(result))
1611 strcpy(temp, "-inf");
1613 strcpy(temp, "inf");
1615 else if(__ecereProp_float_Get_isNan(result))
1617 if(__ecereProp_float_Get_signBit(result))
1618 strcpy(temp, "-nan");
1620 strcpy(temp, "nan");
1623 sprintf(temp, "%.16ff", result);
1624 return __ecereNameSpace__ecere__sys__CopyString(temp);
1627 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1629 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1631 extern int (* __ecereProp_double_Get_signBit)(double this);
1633 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1635 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1637 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1639 char * PrintDouble(double result)
1643 if(__ecereProp_double_Get_isInf(result))
1645 if(__ecereProp_double_Get_signBit(result))
1646 strcpy(temp, "-inf");
1648 strcpy(temp, "inf");
1650 else if(__ecereProp_double_Get_isNan(result))
1652 if(__ecereProp_double_Get_signBit(result))
1653 strcpy(temp, "-nan");
1655 strcpy(temp, "nan");
1658 sprintf(temp, "%.16f", result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1666 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (* Neg)(struct Expression *, struct Operand *);
1672 unsigned int (* Inc)(struct Expression *, struct Operand *);
1673 unsigned int (* Dec)(struct Expression *, struct Operand *);
1674 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1686 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* Not)(struct Expression *, struct Operand *);
1692 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1701 } __attribute__ ((gcc_struct));
1703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1709 unsigned int ptrSize;
1722 } __attribute__ ((gcc_struct));
1724 } __attribute__ ((gcc_struct));
1726 unsigned int GetOpInt(struct Operand * op2, int * value2)
1728 if(op2->kind == 3 && op2->type->isSigned)
1730 else if(op2->kind == 3)
1731 *value2 = (int)op2->ui;
1732 else if(op2->kind == 4 && op2->type->isSigned)
1733 *value2 = (int)op2->i64;
1734 else if(op2->kind == 4)
1735 *value2 = (int)op2->ui64;
1736 else if(op2->kind == 23 && op2->type->isSigned)
1737 *value2 = (int)op2->i64;
1738 else if(op2->kind == 23)
1739 *value2 = (int)op2->ui64;
1740 else if(op2->kind == 22 && op2->type->isSigned)
1741 *value2 = (int)op2->i64;
1742 else if(op2->kind == 22)
1743 *value2 = (int)op2->ui64;
1744 else if(op2->kind == 2 && op2->type->isSigned)
1745 *value2 = (int)op2->s;
1746 else if(op2->kind == 2)
1747 *value2 = (int)op2->us;
1748 else if(op2->kind == 1 && op2->type->isSigned)
1749 *value2 = (int)op2->c;
1750 else if(op2->kind == 24 || op2->kind == 1)
1751 *value2 = (int)op2->uc;
1752 else if(op2->kind == 6)
1753 *value2 = (int)op2->f;
1754 else if(op2->kind == 7)
1755 *value2 = (int)op2->d;
1756 else if(op2->kind == 13)
1757 *value2 = (int)op2->ui64;
1763 struct Operand GetOperand(struct Expression * exp);
1765 unsigned int GetInt(struct Expression * exp, int * value2)
1767 struct Operand op2 = GetOperand(exp);
1769 return GetOpInt(&op2, value2);
1772 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1774 if(op2->kind == 3 && op2->type->isSigned)
1775 *value2 = (unsigned int)op2->i;
1776 else if(op2->kind == 3)
1778 else if(op2->kind == 4 && op2->type->isSigned)
1779 *value2 = (unsigned int)op2->i64;
1780 else if(op2->kind == 4)
1781 *value2 = (unsigned int)op2->ui64;
1782 else if(op2->kind == 23 && op2->type->isSigned)
1783 *value2 = (unsigned int)op2->i64;
1784 else if(op2->kind == 23)
1785 *value2 = (unsigned int)op2->ui64;
1786 else if(op2->kind == 22 && op2->type->isSigned)
1787 *value2 = (unsigned int)op2->i64;
1788 else if(op2->kind == 22)
1789 *value2 = (unsigned int)op2->ui64;
1790 else if(op2->kind == 2 && op2->type->isSigned)
1791 *value2 = (unsigned int)op2->s;
1792 else if(op2->kind == 2)
1793 *value2 = (unsigned int)op2->us;
1794 else if(op2->kind == 1 && op2->type->isSigned)
1795 *value2 = (unsigned int)op2->c;
1796 else if(op2->kind == 24 || op2->kind == 1)
1797 *value2 = (unsigned int)op2->uc;
1798 else if(op2->kind == 6)
1799 *value2 = (unsigned int)op2->f;
1800 else if(op2->kind == 7)
1801 *value2 = (unsigned int)op2->d;
1802 else if(op2->kind == 13)
1803 *value2 = (unsigned int)op2->ui64;
1809 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1811 struct Operand op2 = GetOperand(exp);
1813 return GetOpUInt(&op2, value2);
1816 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1818 if(op2->kind == 3 && op2->type->isSigned)
1819 *value2 = (long long)op2->i;
1820 else if(op2->kind == 3)
1821 *value2 = (long long)op2->ui;
1822 else if(op2->kind == 4 && op2->type->isSigned)
1824 else if(op2->kind == 4)
1825 *value2 = (long long)op2->ui64;
1826 else if(op2->kind == 23 && op2->type->isSigned)
1828 else if(op2->kind == 23)
1829 *value2 = (long long)op2->ui64;
1830 else if(op2->kind == 22 && op2->type->isSigned)
1832 else if(op2->kind == 22)
1833 *value2 = (long long)op2->ui64;
1834 else if(op2->kind == 2 && op2->type->isSigned)
1835 *value2 = (long long)op2->s;
1836 else if(op2->kind == 2)
1837 *value2 = (long long)op2->us;
1838 else if(op2->kind == 1 && op2->type->isSigned)
1839 *value2 = (long long)op2->c;
1840 else if(op2->kind == 24 || op2->kind == 1)
1841 *value2 = (long long)op2->uc;
1842 else if(op2->kind == 6)
1843 *value2 = (long long)op2->f;
1844 else if(op2->kind == 7)
1845 *value2 = (long long)op2->d;
1846 else if(op2->kind == 13)
1847 *value2 = (long long)op2->ui64;
1853 unsigned int GetInt64(struct Expression * exp, long long * value2)
1855 struct Operand op2 = GetOperand(exp);
1857 return GetOpInt64(&op2, value2);
1860 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1862 if(op2->kind == 3 && op2->type->isSigned)
1863 *value2 = (uint64)op2->i;
1864 else if(op2->kind == 3)
1865 *value2 = (uint64)op2->ui;
1866 else if(op2->kind == 4 && op2->type->isSigned)
1867 *value2 = (uint64)op2->i64;
1868 else if(op2->kind == 4)
1869 *value2 = op2->ui64;
1870 else if(op2->kind == 23 && op2->type->isSigned)
1871 *value2 = (uint64)op2->i64;
1872 else if(op2->kind == 23)
1873 *value2 = op2->ui64;
1874 else if(op2->kind == 22 && op2->type->isSigned)
1875 *value2 = (uint64)op2->i64;
1876 else if(op2->kind == 22)
1877 *value2 = op2->ui64;
1878 else if(op2->kind == 2 && op2->type->isSigned)
1879 *value2 = (uint64)op2->s;
1880 else if(op2->kind == 2)
1881 *value2 = (uint64)op2->us;
1882 else if(op2->kind == 1 && op2->type->isSigned)
1883 *value2 = (uint64)op2->c;
1884 else if(op2->kind == 24 || op2->kind == 1)
1885 *value2 = (uint64)op2->uc;
1886 else if(op2->kind == 6)
1887 *value2 = (uint64)op2->f;
1888 else if(op2->kind == 7)
1889 *value2 = (uint64)op2->d;
1890 else if(op2->kind == 13)
1891 *value2 = op2->ui64;
1897 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1899 struct Operand op2 = GetOperand(exp);
1901 return GetOpUInt64(&op2, value2);
1904 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1906 if(op2->kind == 3 && op2->type->isSigned)
1907 *value2 = (intptr_t)op2->i;
1908 else if(op2->kind == 3)
1909 *value2 = (intptr_t)op2->ui;
1910 else if(op2->kind == 4 && op2->type->isSigned)
1911 *value2 = (intptr_t)op2->i64;
1912 else if(op2->kind == 4)
1913 *value2 = (intptr_t)op2->ui64;
1914 else if(op2->kind == 23 && op2->type->isSigned)
1915 *value2 = (intptr_t)op2->i64;
1916 else if(op2->kind == 23)
1917 *value2 = (intptr_t)op2->ui64;
1918 else if(op2->kind == 22 && op2->type->isSigned)
1919 *value2 = (intptr_t)op2->i64;
1920 else if(op2->kind == 22)
1921 *value2 = (intptr_t)op2->ui64;
1922 else if(op2->kind == 2 && op2->type->isSigned)
1923 *value2 = (intptr_t)op2->s;
1924 else if(op2->kind == 2)
1925 *value2 = (intptr_t)op2->us;
1926 else if(op2->kind == 1 && op2->type->isSigned)
1927 *value2 = (intptr_t)op2->c;
1928 else if(op2->kind == 24 || op2->kind == 1)
1929 *value2 = (intptr_t)op2->uc;
1930 else if(op2->kind == 6)
1931 *value2 = (intptr_t)op2->f;
1932 else if(op2->kind == 7)
1933 *value2 = (intptr_t)op2->d;
1934 else if(op2->kind == 13)
1935 *value2 = (intptr_t)op2->ui64;
1941 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1943 struct Operand op2 = GetOperand(exp);
1945 return GetOpIntPtr(&op2, value2);
1948 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1950 if(op2->kind == 3 && op2->type->isSigned)
1951 *value2 = (uintptr_t)op2->i;
1952 else if(op2->kind == 3)
1953 *value2 = (uintptr_t)op2->ui;
1954 else if(op2->kind == 4 && op2->type->isSigned)
1955 *value2 = (uintptr_t)op2->i64;
1956 else if(op2->kind == 4)
1957 *value2 = (uintptr_t)op2->ui64;
1958 else if(op2->kind == 23 && op2->type->isSigned)
1959 *value2 = (uintptr_t)op2->i64;
1960 else if(op2->kind == 23)
1961 *value2 = (uintptr_t)op2->ui64;
1962 else if(op2->kind == 22 && op2->type->isSigned)
1963 *value2 = (uintptr_t)op2->i64;
1964 else if(op2->kind == 22)
1965 *value2 = (uintptr_t)op2->ui64;
1966 else if(op2->kind == 2 && op2->type->isSigned)
1967 *value2 = (uintptr_t)op2->s;
1968 else if(op2->kind == 2)
1969 *value2 = (uintptr_t)op2->us;
1970 else if(op2->kind == 1 && op2->type->isSigned)
1971 *value2 = (uintptr_t)op2->c;
1972 else if(op2->kind == 24 || op2->kind == 1)
1973 *value2 = (uintptr_t)op2->uc;
1974 else if(op2->kind == 6)
1975 *value2 = (uintptr_t)op2->f;
1976 else if(op2->kind == 7)
1977 *value2 = (uintptr_t)op2->d;
1978 else if(op2->kind == 13)
1979 *value2 = (uintptr_t)op2->ui64;
1985 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1987 struct Operand op2 = GetOperand(exp);
1989 return GetOpUIntPtr(&op2, value2);
1992 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1994 if(op2->kind == 3 && op2->type->isSigned)
1995 *value2 = (ssize_t)op2->i;
1996 else if(op2->kind == 3)
1997 *value2 = (ssize_t)op2->ui;
1998 else if(op2->kind == 4 && op2->type->isSigned)
1999 *value2 = (ssize_t)op2->i64;
2000 else if(op2->kind == 4)
2001 *value2 = (ssize_t)op2->ui64;
2002 else if(op2->kind == 23 && op2->type->isSigned)
2003 *value2 = (ssize_t)op2->i64;
2004 else if(op2->kind == 23)
2005 *value2 = (ssize_t)op2->ui64;
2006 else if(op2->kind == 22 && op2->type->isSigned)
2007 *value2 = (ssize_t)op2->i64;
2008 else if(op2->kind == 22)
2009 *value2 = (ssize_t)op2->ui64;
2010 else if(op2->kind == 2 && op2->type->isSigned)
2011 *value2 = (ssize_t)op2->s;
2012 else if(op2->kind == 2)
2013 *value2 = (ssize_t)op2->us;
2014 else if(op2->kind == 1 && op2->type->isSigned)
2015 *value2 = (ssize_t)op2->c;
2016 else if(op2->kind == 24 || op2->kind == 1)
2017 *value2 = (ssize_t)op2->uc;
2018 else if(op2->kind == 6)
2019 *value2 = (ssize_t)op2->f;
2020 else if(op2->kind == 7)
2021 *value2 = (ssize_t)op2->d;
2022 else if(op2->kind == 13)
2023 *value2 = (ssize_t)op2->ui64;
2029 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2031 struct Operand op2 = GetOperand(exp);
2033 return GetOpIntSize(&op2, value2);
2036 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2038 if(op2->kind == 3 && op2->type->isSigned)
2039 *value2 = (size_t)op2->i;
2040 else if(op2->kind == 3)
2041 *value2 = (size_t)op2->ui;
2042 else if(op2->kind == 4 && op2->type->isSigned)
2043 *value2 = (size_t)op2->i64;
2044 else if(op2->kind == 4)
2045 *value2 = (size_t)op2->ui64;
2046 else if(op2->kind == 23 && op2->type->isSigned)
2047 *value2 = (size_t)op2->i64;
2048 else if(op2->kind == 23)
2049 *value2 = (size_t)op2->ui64;
2050 else if(op2->kind == 22 && op2->type->isSigned)
2051 *value2 = (size_t)op2->i64;
2052 else if(op2->kind == 22)
2053 *value2 = (size_t)op2->ui64;
2054 else if(op2->kind == 2 && op2->type->isSigned)
2055 *value2 = (size_t)op2->s;
2056 else if(op2->kind == 2)
2057 *value2 = (size_t)op2->us;
2058 else if(op2->kind == 1 && op2->type->isSigned)
2059 *value2 = (size_t)op2->c;
2060 else if(op2->kind == 24 || op2->kind == 1)
2061 *value2 = (size_t)op2->uc;
2062 else if(op2->kind == 6)
2063 *value2 = (size_t)op2->f;
2064 else if(op2->kind == 7)
2065 *value2 = (size_t)op2->d;
2066 else if(op2->kind == 13)
2067 *value2 = (size_t)op2->ui64;
2073 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2075 struct Operand op2 = GetOperand(exp);
2077 return GetOpUIntSize(&op2, value2);
2080 unsigned int GetOpShort(struct Operand * op2, short * value2)
2082 if(op2->kind == 3 && op2->type->isSigned)
2083 *value2 = (short)op2->i;
2084 else if(op2->kind == 3)
2085 *value2 = (short)op2->ui;
2086 else if(op2->kind == 4 && op2->type->isSigned)
2087 *value2 = (short)op2->i64;
2088 else if(op2->kind == 4)
2089 *value2 = (short)op2->ui64;
2090 else if(op2->kind == 23 && op2->type->isSigned)
2091 *value2 = (short)op2->i64;
2092 else if(op2->kind == 23)
2093 *value2 = (short)op2->ui64;
2094 else if(op2->kind == 22 && op2->type->isSigned)
2095 *value2 = (short)op2->i64;
2096 else if(op2->kind == 22)
2097 *value2 = (short)op2->ui64;
2098 else if(op2->kind == 2 && op2->type->isSigned)
2100 else if(op2->kind == 2)
2101 *value2 = (short)op2->us;
2102 else if(op2->kind == 1 && op2->type->isSigned)
2103 *value2 = (short)op2->c;
2104 else if(op2->kind == 24 || op2->kind == 1)
2105 *value2 = (short)op2->uc;
2106 else if(op2->kind == 6)
2107 *value2 = (short)op2->f;
2108 else if(op2->kind == 7)
2109 *value2 = (short)op2->d;
2110 else if(op2->kind == 13)
2111 *value2 = (short)op2->ui64;
2117 unsigned int GetShort(struct Expression * exp, short * value2)
2119 struct Operand op2 = GetOperand(exp);
2121 return GetOpShort(&op2, value2);
2124 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2126 if(op2->kind == 3 && op2->type->isSigned)
2127 *value2 = (unsigned short)op2->i;
2128 else if(op2->kind == 3)
2129 *value2 = (unsigned short)op2->ui;
2130 else if(op2->kind == 4 && op2->type->isSigned)
2131 *value2 = (unsigned short)op2->i64;
2132 else if(op2->kind == 4)
2133 *value2 = (unsigned short)op2->ui64;
2134 else if(op2->kind == 23 && op2->type->isSigned)
2135 *value2 = (unsigned short)op2->i64;
2136 else if(op2->kind == 23)
2137 *value2 = (unsigned short)op2->ui64;
2138 else if(op2->kind == 22 && op2->type->isSigned)
2139 *value2 = (unsigned short)op2->i64;
2140 else if(op2->kind == 22)
2141 *value2 = (unsigned short)op2->ui64;
2142 else if(op2->kind == 2 && op2->type->isSigned)
2143 *value2 = (unsigned short)op2->s;
2144 else if(op2->kind == 2)
2146 else if(op2->kind == 1 && op2->type->isSigned)
2147 *value2 = (unsigned short)op2->c;
2148 else if(op2->kind == 24 || op2->kind == 1)
2149 *value2 = (unsigned short)op2->uc;
2150 else if(op2->kind == 6)
2151 *value2 = (unsigned short)op2->f;
2152 else if(op2->kind == 7)
2153 *value2 = (unsigned short)op2->d;
2154 else if(op2->kind == 13)
2155 *value2 = (unsigned short)op2->ui64;
2161 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2163 struct Operand op2 = GetOperand(exp);
2165 return GetOpUShort(&op2, value2);
2168 unsigned int GetOpChar(struct Operand * op2, char * value2)
2170 if(op2->kind == 3 && op2->type->isSigned)
2171 *value2 = (char)op2->i;
2172 else if(op2->kind == 3)
2173 *value2 = (char)op2->ui;
2174 else if(op2->kind == 4 && op2->type->isSigned)
2175 *value2 = (char)op2->i64;
2176 else if(op2->kind == 4)
2177 *value2 = (char)op2->ui64;
2178 else if(op2->kind == 23 && op2->type->isSigned)
2179 *value2 = (char)op2->i64;
2180 else if(op2->kind == 23)
2181 *value2 = (char)op2->ui64;
2182 else if(op2->kind == 22 && op2->type->isSigned)
2183 *value2 = (char)op2->i64;
2184 else if(op2->kind == 22)
2185 *value2 = (char)op2->ui64;
2186 else if(op2->kind == 2 && op2->type->isSigned)
2187 *value2 = (char)op2->s;
2188 else if(op2->kind == 2)
2189 *value2 = (char)op2->us;
2190 else if(op2->kind == 1 && op2->type->isSigned)
2192 else if(op2->kind == 24 || op2->kind == 1)
2193 *value2 = (char)op2->uc;
2194 else if(op2->kind == 6)
2195 *value2 = (char)op2->f;
2196 else if(op2->kind == 7)
2197 *value2 = (char)op2->d;
2198 else if(op2->kind == 13)
2199 *value2 = (char)op2->ui64;
2205 unsigned int GetChar(struct Expression * exp, char * value2)
2207 struct Operand op2 = GetOperand(exp);
2209 return GetOpChar(&op2, value2);
2212 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2214 if(op2->kind == 3 && op2->type->isSigned)
2215 *value2 = (unsigned char)op2->i;
2216 else if(op2->kind == 3)
2217 *value2 = (unsigned char)op2->ui;
2218 else if(op2->kind == 4 && op2->type->isSigned)
2219 *value2 = (unsigned char)op2->i64;
2220 else if(op2->kind == 4)
2221 *value2 = (unsigned char)op2->ui64;
2222 else if(op2->kind == 23 && op2->type->isSigned)
2223 *value2 = (unsigned char)op2->i64;
2224 else if(op2->kind == 23)
2225 *value2 = (unsigned char)op2->ui64;
2226 else if(op2->kind == 22 && op2->type->isSigned)
2227 *value2 = (unsigned char)op2->i64;
2228 else if(op2->kind == 22)
2229 *value2 = (unsigned char)op2->ui64;
2230 else if(op2->kind == 2 && op2->type->isSigned)
2231 *value2 = (unsigned char)op2->s;
2232 else if(op2->kind == 2)
2233 *value2 = (unsigned char)op2->us;
2234 else if(op2->kind == 1 && op2->type->isSigned)
2235 *value2 = (unsigned char)op2->c;
2236 else if(op2->kind == 24 || op2->kind == 1)
2238 else if(op2->kind == 6)
2239 *value2 = (unsigned char)op2->f;
2240 else if(op2->kind == 7)
2241 *value2 = (unsigned char)op2->d;
2242 else if(op2->kind == 13)
2243 *value2 = (unsigned char)op2->ui64;
2249 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2251 struct Operand op2 = GetOperand(exp);
2253 return GetOpUChar(&op2, value2);
2256 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2258 if(op2->kind == 3 && op2->type->isSigned)
2259 *value2 = (float)(float)op2->i;
2260 else if(op2->kind == 3)
2261 *value2 = (float)(float)op2->ui;
2262 else if(op2->kind == 4 && op2->type->isSigned)
2263 *value2 = (float)(float)op2->i64;
2264 else if(op2->kind == 4)
2265 *value2 = (float)(float)op2->ui64;
2266 else if(op2->kind == 23 && op2->type->isSigned)
2267 *value2 = (float)(float)op2->i64;
2268 else if(op2->kind == 23)
2269 *value2 = (float)(float)op2->ui64;
2270 else if(op2->kind == 22 && op2->type->isSigned)
2271 *value2 = (float)(float)op2->i64;
2272 else if(op2->kind == 22)
2273 *value2 = (float)(float)op2->ui64;
2274 else if(op2->kind == 2 && op2->type->isSigned)
2275 *value2 = (float)(float)op2->s;
2276 else if(op2->kind == 2)
2277 *value2 = (float)(float)op2->us;
2278 else if(op2->kind == 1 && op2->type->isSigned)
2279 *value2 = (float)(float)op2->c;
2280 else if(op2->kind == 24 || op2->kind == 1)
2281 *value2 = (float)(float)op2->uc;
2282 else if(op2->kind == 6)
2283 *value2 = (float)op2->f;
2284 else if(op2->kind == 7)
2285 *value2 = (float)op2->d;
2286 else if(op2->kind == 13)
2287 *value2 = (float)(float)op2->ui64;
2293 unsigned int GetFloat(struct Expression * exp, float * value2)
2295 struct Operand op2 = GetOperand(exp);
2297 return GetOpFloat(&op2, value2);
2300 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2302 if(op2->kind == 3 && op2->type->isSigned)
2303 *value2 = (double)(double)op2->i;
2304 else if(op2->kind == 3)
2305 *value2 = (double)(double)op2->ui;
2306 else if(op2->kind == 4 && op2->type->isSigned)
2307 *value2 = (double)(double)op2->i64;
2308 else if(op2->kind == 4)
2309 *value2 = (double)(double)op2->ui64;
2310 else if(op2->kind == 23 && op2->type->isSigned)
2311 *value2 = (double)(double)op2->i64;
2312 else if(op2->kind == 23)
2313 *value2 = (double)(double)op2->ui64;
2314 else if(op2->kind == 22 && op2->type->isSigned)
2315 *value2 = (double)(double)op2->i64;
2316 else if(op2->kind == 22)
2317 *value2 = (double)(double)op2->ui64;
2318 else if(op2->kind == 2 && op2->type->isSigned)
2319 *value2 = (double)(double)op2->s;
2320 else if(op2->kind == 2)
2321 *value2 = (double)(double)op2->us;
2322 else if(op2->kind == 1 && op2->type->isSigned)
2323 *value2 = (double)(double)op2->c;
2324 else if(op2->kind == 24 || op2->kind == 1)
2325 *value2 = (double)(double)op2->uc;
2326 else if(op2->kind == 6)
2327 *value2 = (double)op2->f;
2328 else if(op2->kind == 7)
2329 *value2 = (double)op2->d;
2330 else if(op2->kind == 13)
2331 *value2 = (double)(double)op2->ui64;
2337 unsigned int GetDouble(struct Expression * exp, double * value2)
2339 struct Operand op2 = GetOperand(exp);
2341 return GetOpDouble(&op2, value2);
2344 void ComputeExpression(struct Expression * exp);
2346 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2348 extern int targetBits;
2350 int ComputeTypeSize(struct Type * type);
2352 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2354 struct __ecereNameSpace__ecere__com__BitMember
2356 struct __ecereNameSpace__ecere__com__BitMember * prev;
2357 struct __ecereNameSpace__ecere__com__BitMember * next;
2359 unsigned int isProperty;
2362 struct __ecereNameSpace__ecere__com__Class * _class;
2363 char * dataTypeString;
2364 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2365 struct Type * dataType;
2370 } __attribute__ ((gcc_struct));
2372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2374 struct __ecereNameSpace__ecere__sys__OldLink
2376 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2377 struct __ecereNameSpace__ecere__sys__OldLink * next;
2379 } __attribute__ ((gcc_struct));
2381 void FinishTemplatesContext(struct Context * context);
2383 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2385 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2386 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2388 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))
2391 int unionMemberOffset = 0;
2396 member->memberOffset = 0;
2397 if(targetBits < sizeof(void *) * 8)
2398 member->structAlignment = 0;
2400 else if(targetBits < sizeof(void *) * 8)
2401 _class->structAlignment = 0;
2402 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2403 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2404 if(!member && _class->destructionWatchOffset)
2405 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2407 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2409 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2411 if(!dataMember->isProperty)
2413 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2415 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2421 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2423 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2425 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2427 if(!isMember && _class->type == 2 && dataMember->dataType)
2429 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2433 ComputeTypeSize(dataMember->dataType);
2434 if(bitMember->pos == -1)
2435 bitMember->pos = _class->memberOffset;
2436 if(!bitMember->size)
2437 bitMember->size = dataMember->dataType->size * 8;
2438 _class->memberOffset = bitMember->pos + bitMember->size;
2439 for(d = 0; d < bitMember->size; d++)
2445 bitMember->mask = mask << bitMember->pos;
2447 else if(dataMember->type == 0 && dataMember->dataType)
2452 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2453 ComputeTypeSize(dataMember->dataType);
2454 if(dataMember->dataType->bitFieldCount)
2456 bitFields += dataMember->dataType->bitFieldCount;
2463 int size = (bitFields + 7) / 8;
2467 int __simpleStruct0;
2471 int __simpleStruct0;
2473 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2474 if(member->memberOffset % alignment)
2475 member->memberOffset += alignment - (member->memberOffset % alignment);
2477 dataMember->offset = member->memberOffset;
2478 if(member->type == 1)
2479 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2482 member->memberOffset += size;
2489 int __simpleStruct0;
2491 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2492 if(_class->memberOffset % alignment)
2493 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2495 dataMember->offset = _class->memberOffset;
2496 _class->memberOffset += size;
2500 size = dataMember->dataType->size;
2501 alignment = dataMember->dataType->alignment;
2505 int __simpleStruct0;
2509 int __simpleStruct0;
2511 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2512 if(member->memberOffset % alignment)
2513 member->memberOffset += alignment - (member->memberOffset % alignment);
2515 dataMember->offset = member->memberOffset;
2516 if(member->type == 1)
2517 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2520 member->memberOffset += size;
2527 int __simpleStruct0;
2529 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2530 if(_class->memberOffset % alignment)
2531 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2533 dataMember->offset = _class->memberOffset;
2534 _class->memberOffset += size;
2541 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2542 alignment = dataMember->structAlignment;
2545 int __simpleStruct0;
2549 int __simpleStruct0;
2551 if(member->memberOffset % alignment)
2552 member->memberOffset += alignment - (member->memberOffset % alignment);
2553 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2555 dataMember->offset = member->memberOffset;
2556 if(member->type == 1)
2557 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2559 member->memberOffset += dataMember->memberOffset;
2565 int __simpleStruct0;
2567 if(_class->memberOffset % alignment)
2568 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2569 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2571 dataMember->offset = _class->memberOffset;
2572 _class->memberOffset += dataMember->memberOffset;
2580 int size = (bitFields + 7) / 8;
2584 int __simpleStruct0;
2588 int __simpleStruct0;
2590 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2591 if(member->memberOffset % alignment)
2592 member->memberOffset += alignment - (member->memberOffset % alignment);
2594 if(member->type == 1)
2595 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2598 member->memberOffset += size;
2605 int __simpleStruct0;
2607 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2608 if(_class->memberOffset % alignment)
2609 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2611 _class->memberOffset += size;
2616 if(member && member->type == 1)
2618 member->memberOffset = unionMemberOffset;
2622 if(_class->type != 2)
2626 if(_class->structAlignment)
2628 if(_class->memberOffset % _class->structAlignment)
2629 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2631 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2634 struct __ecereNameSpace__ecere__com__Property * prop;
2636 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2638 if(prop->isProperty && prop->isWatchable)
2640 prop->watcherOffset = _class->structSize;
2641 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2646 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2648 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2650 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2652 if(deriv->computeSize)
2654 deriv->offset = _class->structSize;
2655 deriv->memberOffset = 0;
2656 deriv->structSize = deriv->offset;
2657 ComputeClassMembers(deriv, 0x0);
2665 FinishTemplatesContext(context);
2668 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2670 struct __ecereNameSpace__ecere__com__NameSpace
2673 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2674 struct __ecereNameSpace__ecere__com__NameSpace * left;
2675 struct __ecereNameSpace__ecere__com__NameSpace * right;
2677 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2678 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2679 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2680 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2681 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2682 } __attribute__ ((gcc_struct));
2684 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2686 struct __ecereNameSpace__ecere__com__Module
2688 struct __ecereNameSpace__ecere__com__Instance * application;
2689 struct __ecereNameSpace__ecere__sys__OldList classes;
2690 struct __ecereNameSpace__ecere__sys__OldList defines;
2691 struct __ecereNameSpace__ecere__sys__OldList functions;
2692 struct __ecereNameSpace__ecere__sys__OldList modules;
2693 struct __ecereNameSpace__ecere__com__Instance * prev;
2694 struct __ecereNameSpace__ecere__com__Instance * next;
2700 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2701 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2702 } __attribute__ ((gcc_struct));
2704 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2706 struct __ecereNameSpace__ecere__com__Class * _class;
2707 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2709 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2710 ComputeModuleClasses(subModule->data);
2711 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2712 ComputeClassMembers(_class, 0x0);
2715 extern unsigned int inCompiler;
2717 extern void Compiler_Error(char * format, ...);
2719 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2721 int ComputeTypeSize(struct Type * type)
2723 unsigned int size = type ? type->size : 0;
2725 if(!size && type && !type->computing)
2727 type->computing = 0x1;
2731 type->alignment = size = sizeof(char);
2734 type->alignment = size = sizeof(char);
2737 type->alignment = size = sizeof(int);
2740 type->alignment = size = sizeof(long long);
2743 type->alignment = size = targetBits / 8;
2746 type->alignment = size = targetBits / 8;
2749 type->alignment = size = sizeof(long);
2752 type->alignment = size = sizeof(short);
2755 type->alignment = size = sizeof(float);
2758 type->alignment = size = sizeof(double);
2762 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2764 if(_class && _class->type == 1)
2766 ComputeClassMembers(_class, 0x0);
2767 type->alignment = _class->structAlignment;
2768 size = _class->structSize;
2769 if(type->alignment && size % type->alignment)
2770 size += type->alignment - (size % type->alignment);
2772 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2774 if(!_class->dataType)
2775 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2776 size = type->alignment = ComputeTypeSize(_class->dataType);
2779 size = type->alignment = targetBits / 8;
2784 size = type->alignment = targetBits / 8;
2787 if(type->arraySizeExp)
2789 ProcessExpressionType(type->arraySizeExp);
2790 ComputeExpression(type->arraySizeExp);
2791 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)))
2793 struct Location oldLoc = yylloc;
2794 char expression[10240];
2796 expression[0] = '\0';
2797 type->arraySizeExp->expType = (((void *)0));
2798 yylloc = type->arraySizeExp->loc;
2800 PrintExpression(type->arraySizeExp, expression);
2801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2804 GetInt(type->arraySizeExp, &type->arraySize);
2806 else if(type->enumClass)
2808 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2810 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2813 type->arraySize = 0;
2817 type->arraySize = 0;
2819 size = ComputeTypeSize(type->type) * type->arraySize;
2821 type->alignment = type->type->alignment;
2825 struct Type * member;
2827 for(member = type->members.first; member; member = member->next)
2829 int __simpleStruct0, __simpleStruct1;
2830 unsigned int addSize = ComputeTypeSize(member);
2832 member->offset = size;
2833 if(member->alignment && size % member->alignment)
2834 member->offset += member->alignment - (size % member->alignment);
2835 size = member->offset;
2836 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2839 if(type->alignment && size % type->alignment)
2840 size += type->alignment - (size % type->alignment);
2845 struct Type * member;
2847 for(member = type->members.first; member; member = member->next)
2849 int __simpleStruct0, __simpleStruct1;
2850 unsigned int addSize = ComputeTypeSize(member);
2852 member->offset = size;
2853 if(member->alignment && size % member->alignment)
2854 member->offset += member->alignment - (size % member->alignment);
2855 size = member->offset;
2856 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2857 size = ((size > addSize) ? size : addSize);
2859 if(type->alignment && size % type->alignment)
2860 size += type->alignment - (size % type->alignment);
2865 struct TemplateParameter * param = type->templateParameter;
2866 struct Type * baseType = ProcessTemplateParameterType(param);
2870 size = ComputeTypeSize(baseType);
2871 type->alignment = baseType->alignment;
2874 type->alignment = size = sizeof(uint64);
2879 type->alignment = size = sizeof(enum
2887 type->alignment = size = targetBits / 8;
2892 type->computing = 0x0;
2897 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2899 extern struct Identifier * MkIdentifier(char * string);
2901 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2903 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2905 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2907 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2909 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2911 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2913 extern void FreeType(struct Type * type);
2915 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2917 extern struct Specifier * MkSpecifier(int specifier);
2919 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2921 extern struct Expression * MkExpConstant(char * string);
2923 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)
2925 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2926 unsigned int totalSize = 0;
2927 unsigned int maxSize = 0;
2928 int alignment, size;
2929 struct __ecereNameSpace__ecere__com__DataMember * member;
2930 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2933 *addedPadding = 0x0;
2934 if(!isMember && _class->base)
2936 maxSize = _class->structSize;
2938 if(_class->type == 1 || _class->type == 5)
2939 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2942 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2944 if(maxSize > baseSize)
2945 maxSize -= baseSize;
2951 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2953 if(!member->isProperty)
2955 switch(member->type)
2959 if(member->dataTypeString)
2961 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2962 struct Declarator * decl;
2964 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2965 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2966 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2967 if(!member->dataType)
2968 member->dataType = ProcessType(specs, decl);
2969 ReplaceThisClassSpecifiers(specs, topClass);
2971 struct Type * type = ProcessType(specs, decl);
2973 DeclareType(member->dataType, 0x0, 0x0);
2976 ComputeTypeSize(member->dataType);
2977 size = member->dataType->size;
2978 alignment = member->dataType->alignment;
2981 if(totalSize % alignment)
2982 totalSize += alignment - (totalSize % alignment);
2991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2994 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2995 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2996 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2997 alignment = member->structAlignment;
3000 if(totalSize % alignment)
3001 totalSize += alignment - (totalSize % alignment);
3011 unsigned int __simpleStruct0;
3013 if(topMember && topMember->type == 1)
3014 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3016 *retSize += totalSize;
3018 else if(totalSize < maxSize && _class->type != 1000)
3020 int autoPadding = 0;
3022 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3023 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3024 if(totalSize + autoPadding < maxSize)
3026 char sizeString[50];
3028 sprintf(sizeString, "%d", maxSize - totalSize);
3029 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3031 *addedPadding = 0x1;
3035 FinishTemplatesContext(context);
3036 return topMember ? topMember->memberID : _class->memberID;
3039 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3041 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3042 unsigned int totalSize = 0;
3043 struct __ecereNameSpace__ecere__com__DataMember * member;
3044 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3046 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3047 DeclareMembers(_class->base, 0x0);
3048 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3050 if(!member->isProperty)
3052 switch(member->type)
3056 if(!member->dataType && member->dataTypeString)
3057 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3058 if(member->dataType)
3059 DeclareType(member->dataType, 0x0, 0x0);
3065 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3072 FinishTemplatesContext(context);
3073 return topMember ? topMember->memberID : _class->memberID;
3076 extern struct Symbol * FindClass(char * name);
3078 extern char * strchr(const char * , int);
3080 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3082 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3084 extern void FreeClassDef(struct ClassDef * def);
3086 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3088 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3090 extern void MangleClassName(char * className);
3092 extern void DeclareClass(struct Symbol * classSym, char * className);
3094 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3096 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3098 void DeclareStruct(char * name, unsigned int skipNoHead)
3100 struct External * external = (((void *)0));
3101 struct Symbol * classSym = FindClass(name);
3103 if(!inCompiler || !classSym)
3105 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3107 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3109 struct Declaration * decl;
3110 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3111 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3112 char structName[1024];
3114 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3115 classSym->declaring++;
3116 if(strchr(classSym->string, '<'))
3118 if(classSym->registered->templateClass)
3120 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3121 classSym->declaring--;
3125 DeclareMembers(classSym->registered, 0x0);
3126 structName[0] = (char)0;
3127 FullClassNameCat(structName, name, 0x0);
3130 unsigned int addedPadding = 0x0;
3132 classSym->declaredStructSym = 0x1;
3133 declarations = MkList();
3134 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3135 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3137 FreeList(declarations, FreeClassDef);
3138 declarations = (((void *)0));
3141 if(skipNoHead || declarations)
3143 if(external && external->declaration)
3145 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3146 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3148 if(classSym->structExternal)
3149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3151 classSym->id = curExternal->symbol->idCode;
3152 classSym->idCode = curExternal->symbol->idCode;
3158 external = MkExternalDeclaration((((void *)0)));
3159 specifiers = MkList();
3160 declarators = MkList();
3161 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3162 external->declaration = decl = MkDeclaration(specifiers, declarators);
3163 if(decl->symbol && !decl->symbol->pointerExternal)
3164 decl->symbol->pointerExternal = external;
3165 if(classSym->registered && classSym->registered->type == 1)
3167 char className[1024];
3169 strcpy(className, "__ecereClass_");
3170 FullClassNameCat(className, classSym->string, 0x1);
3171 MangleClassName(className);
3172 DeclareClass(classSym, className);
3173 external->symbol = classSym;
3174 classSym->pointerExternal = external;
3175 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3176 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3180 char className[1024];
3182 strcpy(className, "__ecereClass_");
3183 FullClassNameCat(className, classSym->string, 0x1);
3184 MangleClassName(className);
3185 classSym->structExternal = external;
3186 DeclareClass(classSym, className);
3187 external->symbol = classSym;
3189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3192 classSym->declaring--;
3194 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3196 classSym->declaring++;
3198 if(classSym->registered)
3199 DeclareMembers(classSym->registered, 0x0);
3201 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3203 if(classSym->structExternal)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3205 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3206 classSym->id = curExternal->symbol->idCode;
3207 classSym->idCode = curExternal->symbol->idCode;
3209 classSym->declaring--;
3213 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3215 extern struct ModuleImport * mainModule;
3217 extern struct Specifier * MkSpecifierName(char * name);
3219 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3221 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3223 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3225 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3227 extern void FreeDeclarator(struct Declarator * decl);
3229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3231 struct PropertyImport
3233 struct PropertyImport * prev;
3234 struct PropertyImport * next;
3236 unsigned int isVirtual;
3237 unsigned int hasSet;
3238 unsigned int hasGet;
3239 } __attribute__ ((gcc_struct));
3241 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3243 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3245 struct Symbol * symbol = prop->symbol;
3246 char propName[1024];
3248 strcpy(setName, "__ecereProp_");
3249 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3250 strcat(setName, "_Set_");
3251 FullClassNameCat(setName, prop->name, 0x1);
3252 strcpy(getName, "__ecereProp_");
3253 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3254 strcat(getName, "_Get_");
3255 FullClassNameCat(getName, prop->name, 0x1);
3256 strcpy(propName, "__ecereProp_");
3257 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3258 strcat(propName, "_");
3259 FullClassNameCat(propName, prop->name, 0x1);
3260 MangleClassName(getName);
3261 MangleClassName(setName);
3262 MangleClassName(propName);
3263 if(prop->_class->type == 1)
3264 DeclareStruct(prop->_class->fullName, 0x0);
3265 if(!symbol || curExternal->symbol->idCode < symbol->id)
3267 unsigned int imported = 0x0;
3268 unsigned int dllImport = 0x0;
3270 if(!symbol || symbol->_import)
3274 struct Symbol * classSym;
3276 if(!prop->_class->symbol)
3277 prop->_class->symbol = FindClass(prop->_class->fullName);
3278 classSym = prop->_class->symbol;
3279 if(classSym && !classSym->_import)
3281 struct ModuleImport * module;
3283 if(prop->_class->module)
3284 module = FindModule(prop->_class->module);
3286 module = mainModule;
3287 classSym->_import = __extension__ ({
3288 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3290 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3294 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3295 symbol->_import = (struct ClassImport *)__extension__ ({
3296 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3298 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3301 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3304 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)
3309 struct Context * context = SetupTemplatesContext(prop->_class);
3311 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3312 FinishTemplatesContext(context);
3316 if(!symbol->externalGet || symbol->externalGet->type == 0)
3318 struct Declaration * decl;
3319 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3320 struct Declarator * d;
3321 struct __ecereNameSpace__ecere__sys__OldList * params;
3322 struct Specifier * spec;
3323 struct External * external;
3324 struct Declarator * typeDecl;
3325 unsigned int simple = 0x0;
3327 specifiers = MkList();
3328 declarators = MkList();
3330 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3331 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3333 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3335 struct Context * context = SetupTemplatesContext(prop->_class);
3337 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3338 FinishTemplatesContext(context);
3340 for(spec = (*specifiers).first; spec; spec = spec->next)
3344 if((!typeDecl || typeDecl->type == 1))
3346 struct Symbol * classSym = spec->symbol;
3348 symbol->_class = classSym->registered;
3349 if(classSym->registered && classSym->registered->type == 1)
3351 DeclareStruct(spec->name, 0x0);
3358 d = PlugDeclarator(typeDecl, d);
3361 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3362 specifiers = MkList();
3364 d = MkDeclaratorFunction(d, params);
3366 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3367 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3370 ListAdd(specifiers, MkSpecifier(VOID));
3371 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3372 decl = MkDeclaration(specifiers, declarators);
3373 external = MkExternalDeclaration(decl);
3374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3375 external->symbol = symbol;
3376 symbol->externalGet = external;
3377 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3379 FreeDeclarator(typeDecl);
3383 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3388 if(!symbol->externalSet || symbol->externalSet->type == 0)
3390 struct Declaration * decl;
3391 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3392 struct Declarator * d;
3393 struct __ecereNameSpace__ecere__sys__OldList * params;
3394 struct Specifier * spec;
3395 struct External * external;
3396 struct Declarator * typeDecl;
3398 declarators = MkList();
3400 if(!prop->conversion || prop->_class->type == 1)
3402 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3404 specifiers = MkList();
3406 struct Context * context = SetupTemplatesContext(prop->_class);
3408 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3409 FinishTemplatesContext(context);
3411 ListAdd(params, MkTypeName(specifiers, d));
3412 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3414 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3415 d = MkDeclaratorFunction(d, params);
3416 for(spec = (*specifiers).first; spec; spec = spec->next)
3420 if((!typeDecl || typeDecl->type == 1))
3422 struct Symbol * classSym = spec->symbol;
3424 symbol->_class = classSym->registered;
3425 if(classSym->registered && classSym->registered->type == 1)
3426 DeclareStruct(spec->name, 0x0);
3430 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3431 specifiers = MkList();
3433 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3434 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3436 if(!prop->conversion || prop->_class->type == 1)
3437 ListAdd(specifiers, MkSpecifier(VOID));
3439 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3440 decl = MkDeclaration(specifiers, declarators);
3441 external = MkExternalDeclaration(decl);
3442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3443 external->symbol = symbol;
3444 symbol->externalSet = external;
3445 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3452 if(!symbol->externalPtr)
3454 struct Declaration * decl;
3455 struct External * external;
3456 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3462 ListAdd(specifiers, MkSpecifierName("Property"));
3464 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3466 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3469 strcpy(propName, "__ecerePropM_");
3470 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3471 strcat(propName, "_");
3472 FullClassNameCat(propName, prop->name, 0x1);
3473 MangleClassName(propName);
3474 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3476 decl = MkDeclaration(specifiers, list);
3478 external = MkExternalDeclaration(decl);
3479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3480 external->symbol = symbol;
3481 symbol->externalPtr = external;
3485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3487 symbol->id = curExternal->symbol->idCode;
3491 struct Type * Dereference(struct Type * source)
3493 struct Type * type = (((void *)0));
3497 if(source->kind == 13 || source->kind == 12)
3499 type = source->type;
3500 source->type->refCount++;
3502 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3504 type = __extension__ ({
3505 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3507 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3510 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3521 static struct Type * Reference(struct Type * source)
3523 struct Type * type = (((void *)0));
3527 type = __extension__ ({
3528 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3530 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3537 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);
3539 extern void * memcpy(void * , const void * , size_t size);
3541 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3543 extern void FreeExpression(struct Expression * exp);
3545 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3547 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);
3549 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3551 extern struct Type * MkClassType(char * name);
3553 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);
3555 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)
3557 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3558 unsigned int found = 0x0;
3559 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3560 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3561 unsigned int freeType = 0x0;
3563 yylloc = member->loc;
3568 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3572 dataMember = *curMember;
3578 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3579 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3580 int _subMemberStackPos = 0;
3583 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3586 dataMember = thisMember;
3587 if(curMember && thisMember->memberAccess == 1)
3589 *curMember = thisMember;
3590 *curClass = thisMember->_class;
3591 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3592 *subMemberStackPos = _subMemberStackPos;
3598 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3599 if(method && method->type == 1)
3602 method = (((void *)0));
3607 struct Type * type = (((void *)0));
3611 if(!dataMember->dataType && dataMember->dataTypeString)
3613 struct Context * context = SetupTemplatesContext(_class);
3615 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3616 FinishTemplatesContext(context);
3618 type = dataMember->dataType;
3622 if(!method->dataType)
3623 ProcessMethodType(method);
3624 type = method->dataType;
3626 if(ident && ident->next)
3628 for(ident = ident->next; ident && type; ident = ident->next)
3632 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3634 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3636 type = dataMember->dataType;
3638 else if(type->kind == 9 || type->kind == 10)
3640 struct Type * memberType;
3642 for(memberType = type->members.first; memberType; memberType = memberType->next)
3644 if(!strcmp(memberType->name, ident->string))
3653 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3656 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3657 struct __ecereNameSpace__ecere__com__Class * sClass;
3659 for(sClass = _class; sClass; sClass = sClass->base)
3662 if(sClass->templateClass)
3663 sClass = sClass->templateClass;
3664 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3666 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3668 for(sClass = sClass->base; sClass; sClass = sClass->base)
3670 if(sClass->templateClass)
3671 sClass = sClass->templateClass;
3672 id += sClass->templateParams.count;
3683 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3685 if(arg.dataTypeString)
3687 type = ProcessTypeString(arg.dataTypeString, 0x0);
3689 if(type && _class->templateClass)
3690 type->passAsTemplate = 0x1;
3697 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3699 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3700 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3704 char templateString[1024];
3705 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3707 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3708 for(cClass = expClass; cClass; cClass = cClass->base)
3712 if(cClass->templateClass)
3713 cClass = cClass->templateClass;
3714 for(param = cClass->templateParams.first; param; param = param->next)
3717 struct __ecereNameSpace__ecere__com__Class * sClass;
3718 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3720 for(sClass = cClass->base; sClass; sClass = sClass->base)
3722 if(sClass->templateClass)
3723 sClass = sClass->templateClass;
3724 id += sClass->templateParams.count;
3726 arg = expClass->templateArgs[id];
3727 for(sClass = _class; sClass; sClass = sClass->base)
3729 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3731 struct __ecereNameSpace__ecere__com__Class * nextClass;
3733 if(sClass->templateClass)
3734 sClass = sClass->templateClass;
3735 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3737 if(nextClass->templateClass)
3738 nextClass = nextClass->templateClass;
3739 p += nextClass->templateParams.count;
3741 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3743 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3745 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3747 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3748 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3762 char expString[1024];
3763 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3764 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3765 struct Expression * exp;
3766 char * string = PrintHexUInt64(arg.expression.ui64);
3768 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3769 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3770 ProcessExpressionType(exp);
3771 ComputeExpression(exp);
3772 expString[0] = '\0';
3773 PrintExpression(exp, expString);
3774 strcat(argument, expString);
3775 FreeExpression(exp);
3780 strcat(argument, arg.member->name);
3785 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3786 strcat(argument, arg.dataTypeString);
3793 strcat(templateString, ", ");
3794 if(lastParam != p - 1)
3796 strcat(templateString, param->name);
3797 strcat(templateString, " = ");
3799 strcat(templateString, argument);
3808 int len = strlen(templateString);
3810 if(templateString[len - 1] == '<')
3814 if(templateString[len - 1] == '>')
3815 templateString[len++] = ' ';
3816 templateString[len++] = '>';
3818 templateString[len++] = '\0';
3821 struct Context * context = SetupTemplatesContext(_class);
3825 type = ProcessTypeString(templateString, 0x0);
3827 FinishTemplatesContext(context);
3830 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3832 ProcessExpressionType(member->initializer->exp);
3833 if(!member->initializer->exp->expType)
3837 char expString[10240];
3839 expString[0] = '\0';
3840 PrintExpression(member->initializer->exp, expString);
3841 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3845 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3850 else if(member->initializer)
3852 ProcessInitializer(member->initializer, type);
3859 if(_class && _class->type == 3)
3861 if(member->initializer)
3863 struct Type * type = MkClassType(_class->fullName);
3865 ProcessInitializer(member->initializer, type);
3871 if(member->initializer)
3873 ProcessInitializer(member->initializer, (((void *)0)));
3879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3885 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3894 extern struct Identifier * GetDeclId(struct Declarator * decl);
3896 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);
3898 extern void FreeSpecifier(struct Specifier * spec);
3900 static void ProcessFunction(struct FunctionDefinition * function);
3902 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3904 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3906 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3908 extern void FreeClassFunction(struct ClassFunction * func);
3910 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3912 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3914 void ProcessInstantiationType(struct Instantiation * inst)
3919 struct MembersInit * members;
3920 struct Symbol * classSym;
3921 struct __ecereNameSpace__ecere__com__Class * _class;
3923 classSym = inst->_class->symbol;
3924 _class = classSym ? classSym->registered : (((void *)0));
3925 if(!_class || _class->type != 5)
3926 DeclareStruct(inst->_class->name, 0x0);
3927 afterExternal = afterExternal ? afterExternal : curExternal;
3929 ProcessExpressionType(inst->exp);
3930 inst->isConstant = 0x1;
3933 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3934 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3935 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3936 int subMemberStackPos = 0;
3938 for(members = (*inst->members).first; members; members = members->next)
3940 switch(members->type)
3945 static unsigned int instMethodID = 0;
3946 struct External * external = curExternal;
3947 struct Context * context = curContext;
3948 struct Declarator * declarator = members->function->declarator;
3949 struct Identifier * nameID = GetDeclId(declarator);
3950 char * unmangled = nameID ? nameID->string : (((void *)0));
3951 struct Expression * exp;
3952 struct External * createdExternal = (((void *)0));
3958 strcpy(name, "__ecereInstMeth_");
3959 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3961 strcat(name, nameID->string);
3963 sprintf(number, "_%08d", instMethodID++);
3964 strcat(name, number);
3965 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3969 struct Symbol * symbol = declarator->symbol;
3970 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3972 if(method && method->type == 1)
3974 symbol->method = method;
3975 ProcessMethodType(method);
3976 if(!symbol->type->thisClass)
3978 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3980 if(!currentClass->symbol)
3981 currentClass->symbol = FindClass(currentClass->fullName);
3982 symbol->type->thisClass = currentClass->symbol;
3987 _class->symbol = FindClass(_class->fullName);
3988 symbol->type->thisClass = _class->symbol;
3991 DeclareType(symbol->type, 0x1, 0x1);
3995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3998 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4001 FreeSpecifier(nameID->_class);
4002 nameID->_class = (((void *)0));
4006 struct Type * type = declarator->symbol->type;
4007 struct External * oldExternal = curExternal;
4009 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4011 struct External * externalDecl;
4013 externalDecl = MkExternalDeclaration((((void *)0)));
4014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4015 if(createdExternal->function)
4017 ProcessFunction(createdExternal->function);
4019 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4021 externalDecl->declaration = decl;
4022 if(decl->symbol && !decl->symbol->pointerExternal)
4023 decl->symbol->pointerExternal = externalDecl;
4024 declarator->symbol->pointerExternal = externalDecl;
4031 curExternal = declarator->symbol->pointerExternal;
4032 ProcessFunction((struct FunctionDefinition *)members->function);
4034 curExternal = external;
4035 curContext = context;
4038 FreeClassFunction(members->function);
4039 exp = QMkExpId(name);
4041 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4042 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4048 if(members->dataMembers && classSym)
4050 struct MemberInit * member;
4051 struct Location oldyyloc = yylloc;
4053 for(member = (*members->dataMembers).first; member; member = member->next)
4055 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4056 if(member->initializer && !member->initializer->isConstant)
4057 inst->isConstant = 0x0;
4069 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4073 if(type->kind == 11)
4075 struct Type * param;
4079 for(param = type->params.first; param; param = param->next)
4080 DeclareType(param, declarePointers, 0x1);
4082 DeclareType(type->returnType, declarePointers, 0x1);
4084 else if(type->kind == 13 && declarePointers)
4085 DeclareType(type->type, declarePointers, 0x0);
4086 else if(type->kind == 8)
4088 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4089 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4091 else if(type->kind == 9 || type->kind == 10)
4093 struct Type * member;
4095 for(member = type->members.first; member; member = member->next)
4096 DeclareType(member, 0x0, 0x0);
4098 else if(type->kind == 12)
4099 DeclareType(type->arrayType, declarePointers, 0x0);
4103 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4105 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4107 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4109 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4110 struct __ecereNameSpace__ecere__com__Class * sClass;
4112 for(sClass = _class; sClass; sClass = sClass->base)
4115 if(sClass->templateClass)
4116 sClass = sClass->templateClass;
4117 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4119 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4121 for(sClass = sClass->base; sClass; sClass = sClass->base)
4123 if(sClass->templateClass)
4124 sClass = sClass->templateClass;
4125 id += sClass->templateParams.count;
4136 arg = &_class->templateArgs[id];
4137 if(arg && param->type == 0)
4138 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4143 extern struct Context * PushContext(void);
4145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4147 struct TemplatedType
4150 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4151 struct __ecereNameSpace__ecere__sys__BTNode * left;
4152 struct __ecereNameSpace__ecere__sys__BTNode * right;
4154 struct TemplateParameter * param;
4155 } __attribute__ ((gcc_struct));
4157 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4159 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4161 struct Context * context = PushContext();
4163 context->templateTypesOnly = 0x1;
4164 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4166 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4168 for(; param; param = param->next)
4170 if(param->type == 0 && param->identifier)
4172 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4174 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4180 struct __ecereNameSpace__ecere__com__Class * sClass;
4182 for(sClass = _class; sClass; sClass = sClass->base)
4184 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4186 for(p = sClass->templateParams.first; p; p = p->next)
4190 struct TemplateParameter * param = p->param;
4191 struct TemplatedType * type;
4195 p->param = param = __extension__ ({
4196 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4198 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4201 type = __extension__ ({
4202 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4204 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4206 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4214 extern void PopContext(struct Context * ctx);
4216 extern void FreeContext(struct Context * context);
4218 void FinishTemplatesContext(struct Context * context)
4220 PopContext(context);
4221 FreeContext(context);
4222 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4225 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4227 if(!method->dataType)
4229 struct Context * context = SetupTemplatesContext(method->_class);
4231 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4232 FinishTemplatesContext(context);
4233 if(method->type != 1 && method->dataType)
4235 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4237 if(!method->_class->symbol)
4238 method->_class->symbol = FindClass(method->_class->fullName);
4239 method->dataType->thisClass = method->_class->symbol;
4245 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4249 struct Context * context = SetupTemplatesContext(prop->_class);
4251 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4252 FinishTemplatesContext(context);
4256 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4258 extern void FreeTypeName(struct TypeName * typeName);
4260 static void ProcessDeclarator(struct Declarator * decl);
4262 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4264 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4268 struct MethodImport * prev;
4269 struct MethodImport * next;
4271 unsigned int isVirtual;
4272 } __attribute__ ((gcc_struct));
4274 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4276 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4278 struct Symbol * symbol = method->symbol;
4280 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4282 unsigned int imported = 0x0;
4283 unsigned int dllImport = 0x0;
4285 if(!method->dataType)
4286 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4287 if(!symbol || symbol->_import || method->type == 1)
4289 if(!symbol || method->type == 1)
4291 struct Symbol * classSym;
4293 if(!method->_class->symbol)
4294 method->_class->symbol = FindClass(method->_class->fullName);
4295 classSym = method->_class->symbol;
4296 if(!classSym->_import)
4298 struct ModuleImport * module;
4300 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4301 module = FindModule(method->_class->module);
4303 module = mainModule;
4304 classSym->_import = __extension__ ({
4305 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4307 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4313 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4315 if(!symbol->_import)
4317 symbol->_import = (struct ClassImport *)__extension__ ({
4318 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4320 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4326 symbol->type = method->dataType;
4328 symbol->type->refCount++;
4331 if(!method->dataType->dllExport)
4334 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)
4338 if(method->type != 1 && method->dataType)
4339 DeclareType(method->dataType, 0x1, 0x1);
4340 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4342 struct Declaration * decl;
4343 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4344 struct Declarator * d;
4345 struct Declarator * funcDecl;
4346 struct External * external;
4348 specifiers = MkList();
4349 declarators = MkList();
4351 ListAdd(specifiers, MkSpecifier(EXTERN));
4352 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4353 ListAdd(specifiers, MkSpecifier(STATIC));
4354 if(method->type == 1)
4356 ListAdd(specifiers, MkSpecifier(INT));
4357 d = MkDeclaratorIdentifier(MkIdentifier(name));
4361 d = MkDeclaratorIdentifier(MkIdentifier(name));
4363 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4365 struct Context * context = SetupTemplatesContext(method->_class);
4367 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4368 FinishTemplatesContext(context);
4370 funcDecl = GetFuncDecl(d);
4373 struct Specifier * spec, * next;
4375 for(spec = (*specifiers).first; spec; spec = next)
4380 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4381 FreeSpecifier(spec);
4385 if(method->dataType && !method->dataType->staticMethod)
4387 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4389 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4390 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")));
4391 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4392 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4394 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4396 struct TypeName * param = (*funcDecl->function.parameters).first;
4398 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4399 FreeTypeName(param);
4401 if(!funcDecl->function.parameters)
4402 funcDecl->function.parameters = MkList();
4403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4407 ProcessDeclarator(d);
4408 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4409 decl = MkDeclaration(specifiers, declarators);
4410 ReplaceThisClassSpecifiers(specifiers, method->_class);
4411 if(symbol->pointerExternal)
4413 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4416 *functionSymbol = *symbol;
4417 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4418 if(functionSymbol->type)
4419 functionSymbol->type->refCount++;
4421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4422 symbol->pointerExternal->symbol = functionSymbol;
4424 external = MkExternalDeclaration(decl);
4426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4427 external->symbol = symbol;
4428 symbol->pointerExternal = external;
4432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4434 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4438 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4440 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4442 unsigned int first = 0x1;
4444 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4446 char className[1024];
4448 strcpy(className, _class->fullName);
4449 for(param = _class->templateParams.first; param; param = param->next)
4453 strcat(className, "<");
4455 strcat(className, ", ");
4456 if(lastParam + 1 != p)
4458 strcat(className, param->name);
4459 strcat(className, " = ");
4461 strcat(className, param->name);
4469 int len = strlen(className);
4471 if(className[len - 1] == '>')
4472 className[len++] = ' ';
4473 className[len++] = '>';
4474 className[len++] = '\0';
4476 return __ecereNameSpace__ecere__sys__CopyString(className);
4479 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4482 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4484 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4486 unsigned int first = 0x1;
4488 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4490 char className[1024];
4492 strcpy(className, _class->fullName);
4493 for(param = _class->templateParams.first; param; param = param->next)
4497 strcat(className, "<");
4499 strcat(className, ", ");
4500 if(lastParam + 1 != p)
4502 strcat(className, param->name);
4503 strcat(className, " = ");
4505 strcat(className, param->name);
4513 int len = strlen(className);
4515 if(className[len - 1] == '>')
4516 className[len++] = ' ';
4517 className[len++] = '>';
4518 className[len++] = '\0';
4520 return MkClassType(className);
4524 return MkClassType(_class->fullName);
4528 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4530 if(specs != (((void *)0)) && _class)
4532 struct Specifier * spec;
4534 for(spec = specs->first; spec; spec = spec->next)
4536 if(spec->type == 0 && spec->specifier == THISCLASS)
4539 spec->name = ReplaceThisClass(_class);
4540 spec->symbol = FindClass(spec->name);
4546 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4548 struct __ecereNameSpace__ecere__com__GlobalFunction
4550 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4551 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4554 struct __ecereNameSpace__ecere__com__Instance * module;
4555 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4556 char * dataTypeString;
4557 struct Type * dataType;
4559 } __attribute__ ((gcc_struct));
4561 extern struct Context * globalContext;
4563 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4565 struct FunctionImport
4567 struct FunctionImport * prev;
4568 struct FunctionImport * next;
4570 } __attribute__ ((gcc_struct));
4572 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4574 struct Symbol * symbol = function->symbol;
4576 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4578 unsigned int imported = 0x0;
4579 unsigned int dllImport = 0x0;
4581 if(!function->dataType)
4583 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4584 if(!function->dataType->thisClass)
4585 function->dataType->staticMethod = 0x1;
4591 struct ModuleImport * module = FindModule(function->module);
4593 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4596 if(!function->dataType->dllExport)
4598 symbol->_import = (struct ClassImport *)__extension__ ({
4599 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4601 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4607 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4608 if(!symbol->type->thisClass)
4609 symbol->type->staticMethod = 0x1;
4612 imported = symbol->_import ? 0x1 : 0x0;
4613 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4616 DeclareType(function->dataType, 0x1, 0x1);
4619 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4621 struct Declaration * decl;
4622 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4623 struct Declarator * d;
4624 struct Declarator * funcDecl;
4625 struct External * external;
4627 specifiers = MkList();
4628 declarators = MkList();
4629 ListAdd(specifiers, MkSpecifier(EXTERN));
4630 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4632 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4633 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4634 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4636 struct Specifier * spec;
4638 for(spec = (*specifiers).first; spec; spec = spec->next)
4639 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4642 FreeSpecifier(spec);
4646 funcDecl = GetFuncDecl(d);
4647 if(funcDecl && !funcDecl->function.parameters)
4649 funcDecl->function.parameters = MkList();
4650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4652 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4654 struct Context * oldCtx = curContext;
4656 curContext = globalContext;
4657 decl = MkDeclaration(specifiers, declarators);
4658 curContext = oldCtx;
4660 if(symbol->pointerExternal)
4662 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4665 *functionSymbol = *symbol;
4666 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4667 if(functionSymbol->type)
4668 functionSymbol->type->refCount++;
4670 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4671 symbol->pointerExternal->symbol = functionSymbol;
4673 external = MkExternalDeclaration(decl);
4675 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4676 external->symbol = symbol;
4677 symbol->pointerExternal = external;
4681 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4684 symbol->id = curExternal->symbol->idCode;
4687 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4695 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4696 struct __ecereNameSpace__ecere__sys__BTNode * left;
4697 struct __ecereNameSpace__ecere__sys__BTNode * right;
4699 struct __ecereNameSpace__ecere__com__Instance * module;
4700 char * dataTypeString;
4701 struct Type * dataType;
4704 } __attribute__ ((gcc_struct));
4706 void DeclareGlobalData(struct GlobalData * data)
4708 struct Symbol * symbol = data->symbol;
4710 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4715 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4718 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4719 DeclareType(data->dataType, 0x1, 0x1);
4722 if(!symbol->pointerExternal)
4724 struct Declaration * decl;
4725 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4726 struct Declarator * d;
4727 struct External * external;
4729 specifiers = MkList();
4730 declarators = MkList();
4731 ListAdd(specifiers, MkSpecifier(EXTERN));
4732 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4733 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4734 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4735 decl = MkDeclaration(specifiers, declarators);
4736 external = MkExternalDeclaration(decl);
4738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4739 external->symbol = symbol;
4740 symbol->pointerExternal = external;
4744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4747 symbol->id = curExternal->symbol->idCode;
4754 struct Conversion * prev, * next;
4755 struct __ecereNameSpace__ecere__com__Property * convert;
4757 struct Type * resultType;
4758 } __attribute__ ((gcc_struct));
4760 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4762 extern void Compiler_Warning(char * format, ...);
4764 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4766 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)
4770 if(source->kind == 20 && dest->kind != 20)
4772 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4777 if(dest->kind == 20 && source->kind != 20)
4779 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4784 if(dest->classObjectType == 2)
4786 if(source->classObjectType != 3)
4790 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4798 if(source->classObjectType == 3)
4800 if(dest->classObjectType == 3 && source->classObjectType != 2)
4803 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4805 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4808 if(dest->kind == 14 && source->kind != 0)
4810 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))
4812 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))
4814 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4816 if(source->_class->registered && source->_class->registered->type == 3)
4818 if(conversions != (((void *)0)))
4820 if(source->_class->registered == dest->_class->registered)
4825 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4827 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4829 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4831 if(sourceBase == destBase)
4835 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))
4839 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))
4841 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4848 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4852 if(source->kind == 8)
4854 struct __ecereNameSpace__ecere__com__Class * _class;
4856 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4858 struct __ecereNameSpace__ecere__com__Property * convert;
4860 for(convert = _class->conversions.first; convert; convert = convert->next)
4862 if(convert->memberAccess == 1 || _class->module == privateModule)
4864 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4866 if(!convert->dataType)
4867 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4868 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4870 if(!conversions && !convert->Get)
4872 else if(conversions != (((void *)0)))
4874 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))
4878 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4891 struct __ecereNameSpace__ecere__com__Class * _class;
4893 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4895 struct __ecereNameSpace__ecere__com__Property * convert;
4897 for(convert = _class->conversions.first; convert; convert = convert->next)
4899 if(convert->memberAccess == 1 || _class->module == privateModule)
4901 if(!convert->dataType)
4902 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4903 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4905 if(!conversions && !convert->Set)
4907 else if(conversions != (((void *)0)))
4909 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))
4913 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4915 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4923 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4925 if(!dest->_class->registered->dataType)
4926 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4927 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4929 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4936 if(source->kind == 8)
4938 struct __ecereNameSpace__ecere__com__Class * _class;
4940 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4942 struct __ecereNameSpace__ecere__com__Property * convert;
4944 for(convert = _class->conversions.first; convert; convert = convert->next)
4946 if(convert->memberAccess == 1 || _class->module == privateModule)
4948 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4950 if(!convert->dataType)
4951 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4952 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4954 if(!conversions && !convert->Get)
4956 else if(conversions != (((void *)0)))
4958 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))
4962 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4972 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4974 if(!source->_class->registered->dataType)
4975 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4976 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4983 if(source->kind == 8 || source->kind == 19)
4985 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4987 else if(dest->kind == 7 && source->kind == 6)
4989 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4991 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4993 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4995 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4997 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4999 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))
5001 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))
5003 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)))
5005 struct Type * paramSource, * paramDest;
5007 if(dest->kind == 16)
5008 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5009 if(source->kind == 16)
5010 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5011 if(dest->kind == 13 && dest->type->kind == 11)
5013 if(source->kind == 13 && source->type->kind == 11)
5014 source = source->type;
5015 if(dest->kind == 16)
5016 dest = dest->method->dataType;
5017 if(source->kind == 16)
5018 source = source->method->dataType;
5019 paramSource = source->params.first;
5020 if(paramSource && paramSource->kind == 0)
5021 paramSource = (((void *)0));
5022 paramDest = dest->params.first;
5023 if(paramDest && paramDest->kind == 0)
5024 paramDest = (((void *)0));
5025 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5027 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))))
5029 if(paramDest && paramDest->kind == 8)
5030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5032 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5035 paramDest = paramDest->next;
5037 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5039 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5043 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5051 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5060 paramSource = paramSource->next;
5066 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5068 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5074 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5082 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5084 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5087 for(; paramDest; paramDest = paramDest->next)
5091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5095 struct Type * paramDestType = paramDest;
5096 struct Type * paramSourceType = paramSource;
5097 struct Type * type = paramDestType;
5099 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5102 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5103 struct __ecereNameSpace__ecere__com__Class * sClass;
5105 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5108 if(sClass->templateClass)
5109 sClass = sClass->templateClass;
5110 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5112 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5114 for(sClass = sClass->base; sClass; sClass = sClass->base)
5116 if(sClass->templateClass)
5117 sClass = sClass->templateClass;
5118 id += sClass->templateParams.count;
5129 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5131 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5134 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)))
5139 PrintType(paramDest, type, 0x0, 0x1);
5140 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5141 if(paramDestType != paramDest)
5142 FreeType(paramDestType);
5145 if(paramDestType != paramDest)
5146 FreeType(paramDestType);
5148 paramSource = paramSource->next;
5152 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5157 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5161 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5163 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5170 static void FreeConvert(struct Conversion * convert)
5172 if(convert->resultType)
5173 FreeType(convert->resultType);
5176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5178 struct __ecereNameSpace__ecere__com__BTNamedLink
5181 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5182 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5183 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5186 } __attribute__ ((gcc_struct));
5188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5190 struct __ecereNameSpace__ecere__com__EnumClassData
5192 struct __ecereNameSpace__ecere__sys__OldList values;
5194 } __attribute__ ((gcc_struct));
5196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5198 struct __ecereNameSpace__ecere__sys__NamedLink
5200 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5201 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5204 } __attribute__ ((gcc_struct));
5206 extern void FreeExpContents(struct Expression * exp);
5208 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5210 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5212 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5214 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5216 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5218 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5220 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5222 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)))
5224 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5226 if(_class->type == 4)
5228 struct __ecereNameSpace__ecere__sys__OldList converts =
5232 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5236 _class->symbol = FindClass(_class->fullName);
5237 type->_class = _class->symbol;
5238 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5240 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5241 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5245 struct __ecereNameSpace__ecere__com__Class * baseClass;
5247 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5249 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5251 for(value = e->values.first; value; value = value->next)
5253 if(!strcmp(value->name, string))
5258 FreeExpContents(sourceExp);
5259 FreeType(sourceExp->expType);
5260 sourceExp->isConstant = 0x1;
5261 sourceExp->expType = MkClassType(baseClass->fullName);
5265 sourceExp->type = 2;
5266 if(!strcmp(baseClass->dataTypeString, "int"))
5267 sprintf(constant, "%d", (int)value->data);
5269 sprintf(constant, "0x%X", (int)value->data);
5270 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5272 while(converts.first)
5274 struct Conversion * convert = converts.first;
5276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5279 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5287 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5290 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)))
5291 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5298 struct __ecereNameSpace__ecere__com__SubModule
5300 struct __ecereNameSpace__ecere__com__SubModule * prev;
5301 struct __ecereNameSpace__ecere__com__SubModule * next;
5302 struct __ecereNameSpace__ecere__com__Instance * module;
5304 } __attribute__ ((gcc_struct));
5306 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5308 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5310 if(searchFor == searchIn)
5312 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5314 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5316 if(ModuleVisibility(subModule->module, searchFor))
5323 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5325 struct __ecereNameSpace__ecere__com__Application
5330 unsigned int isGUIApp;
5331 struct __ecereNameSpace__ecere__sys__OldList allModules;
5332 char * parsedCommand;
5333 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5334 } __attribute__ ((gcc_struct));
5336 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5338 struct __ecereNameSpace__ecere__com__Instance * module;
5340 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))
5342 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))
5344 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))
5346 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)
5348 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5354 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5356 void ReadString(char * output, char * string);
5358 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5360 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5362 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5364 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5366 struct Type * source = sourceExp->expType;
5367 struct Type * realDest = dest;
5368 struct Type * backupSourceExpType = (((void *)0));
5370 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5372 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5374 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5376 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5378 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5380 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5382 if(sourceBase == destBase)
5388 struct __ecereNameSpace__ecere__sys__OldList * specs;
5389 unsigned int flag = 0x0;
5390 long long value = (((int)0x7fffffff));
5394 if(sourceExp->type == 2)
5396 if(source->isSigned)
5397 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5399 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5401 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5403 if(source->isSigned)
5404 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5406 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5408 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5411 source = __extension__ ({
5412 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5414 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5419 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5421 if(_class && _class->type == 3)
5423 if(source->kind != 8)
5425 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5426 struct Type * tempDest, * tempSource;
5428 for(; _class->base->type != 1000; _class = _class->base)
5431 tempDest = tempType;
5434 _class->symbol = FindClass(_class->fullName);
5435 tempType->_class = _class->symbol;
5436 tempType->truth = dest->truth;
5437 if(tempType->_class)
5438 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5439 backupSourceExpType = sourceExp->expType;
5440 sourceExp->expType = dest;
5443 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5446 if(_class && _class->type == 2 && source->kind != 8)
5448 if(!dest->_class->registered->dataType)
5449 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5450 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5453 FreeType(sourceExp->expType);
5454 source = sourceExp->expType = MkClassType(dest->_class->string);
5458 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5460 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5461 struct Declarator * decl;
5464 ReadString(string, sourceExp->string);
5465 decl = SpecDeclFromString(string, specs, (((void *)0)));
5466 FreeExpContents(sourceExp);
5467 FreeType(sourceExp->expType);
5468 sourceExp->type = 24;
5469 sourceExp->_classExp.specifiers = specs;
5470 sourceExp->_classExp.decl = decl;
5471 sourceExp->expType = dest;
5475 if(backupSourceExpType)
5476 FreeType(backupSourceExpType);
5480 else if(source->kind == 8)
5482 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5484 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5488 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5489 struct Type * tempDest, * tempSource;
5491 if(!source->_class->registered->dataType)
5492 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5493 for(; _class->base->type != 1000; _class = _class->base)
5496 tempSource = tempType;
5498 tempType->_class = FindClass(_class->fullName);
5499 tempType->truth = source->truth;
5500 tempType->classObjectType = source->classObjectType;
5501 if(tempType->_class)
5502 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5503 if(conversions->last)
5505 ((struct Conversion *)conversions->last)->resultType = dest;
5508 FreeType(sourceExp->expType);
5509 sourceExp->expType = MkClassType(_class->fullName);
5510 sourceExp->expType->truth = source->truth;
5511 sourceExp->expType->classObjectType = source->classObjectType;
5512 if(!sourceExp->destType)
5514 FreeType(sourceExp->destType);
5515 sourceExp->destType = sourceExp->expType;
5516 if(sourceExp->expType)
5517 sourceExp->expType->refCount++;
5519 if(!_class->dataType)
5520 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5522 dest = MkClassType(source->_class->string);
5523 dest->truth = source->truth;
5524 dest->classObjectType = source->classObjectType;
5526 source = _class->dataType;
5528 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5534 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5543 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5545 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5547 if(_class->type == 0 || _class->type == 5)
5549 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5551 *newExp = *sourceExp;
5552 if(sourceExp->destType)
5553 sourceExp->destType->refCount++;
5554 if(sourceExp->expType)
5555 sourceExp->expType->refCount++;
5556 sourceExp->type = 11;
5557 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5558 sourceExp->cast.exp = newExp;
5559 FreeType(sourceExp->expType);
5560 sourceExp->expType = (((void *)0));
5561 ProcessExpressionType(sourceExp);
5564 FreeType(sourceExp->expType);
5565 sourceExp->expType = dest;
5570 if(backupSourceExpType)
5571 FreeType(backupSourceExpType);
5574 if(!_class->dataType)
5575 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5577 dest = _class->dataType;
5580 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))
5582 specs = MkListOne(MkSpecifier(DOUBLE));
5584 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))
5586 specs = MkListOne(MkSpecifier(FLOAT));
5588 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))
5592 ListAdd(specs, MkSpecifier(UNSIGNED));
5593 ListAdd(specs, MkSpecifier(INT64));
5595 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5599 ListAdd(specs, MkSpecifier(UNSIGNED));
5600 ListAdd(specs, MkSpecifier(INT));
5602 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5606 ListAdd(specs, MkSpecifier(UNSIGNED));
5607 ListAdd(specs, MkSpecifier(SHORT));
5609 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5613 ListAdd(specs, MkSpecifier(UNSIGNED));
5614 ListAdd(specs, MkSpecifier(CHAR));
5620 if(backupSourceExpType)
5622 if(sourceExp->expType)
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = backupSourceExpType;
5629 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))
5631 specs = MkListOne(MkSpecifier(DOUBLE));
5633 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))
5635 specs = MkListOne(MkSpecifier(FLOAT));
5637 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5640 ListAdd(specs, MkSpecifier(BOOL));
5642 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)))
5646 ListAdd(specs, MkSpecifier(UNSIGNED));
5647 ListAdd(specs, MkSpecifier(CHAR));
5649 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)))))
5653 ListAdd(specs, MkSpecifier(UNSIGNED));
5654 ListAdd(specs, MkSpecifier(SHORT));
5656 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5660 ListAdd(specs, MkSpecifier(UNSIGNED));
5661 ListAdd(specs, MkSpecifier(INT));
5663 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5667 ListAdd(specs, MkSpecifier(UNSIGNED));
5668 ListAdd(specs, MkSpecifier(INT64));
5670 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5672 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5678 if(backupSourceExpType)
5680 if(sourceExp->expType)
5681 FreeType(sourceExp->expType);
5682 sourceExp->expType = backupSourceExpType;
5688 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5690 *newExp = *sourceExp;
5691 newExp->prev = (((void *)0));
5692 newExp->next = (((void *)0));
5693 if(sourceExp->destType)
5694 sourceExp->destType->refCount++;
5695 if(sourceExp->expType)
5696 sourceExp->expType->refCount++;
5697 sourceExp->type = 11;
5698 if(realDest->kind == 8)
5700 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5701 FreeList(specs, FreeSpecifier);
5704 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5705 if(newExp->type == 4)
5707 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5710 sourceExp->cast.exp = newExp;
5711 FreeType(sourceExp->expType);
5712 sourceExp->expType = (((void *)0));
5713 ProcessExpressionType(sourceExp);
5716 FreeList(specs, FreeSpecifier);
5719 if(backupSourceExpType)
5720 FreeType(backupSourceExpType);
5725 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5726 sourceExp = (*sourceExp->list).last;
5727 if(sourceExp->type == 0)
5729 struct Identifier * id = sourceExp->identifier;
5733 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5735 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5736 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5740 for(; _class && _class->type == 4; _class = _class->base)
5742 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5743 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5745 for(value = e->values.first; value; value = value->next)
5747 if(!strcmp(value->name, id->string))
5752 FreeExpContents(sourceExp);
5753 FreeType(sourceExp->expType);
5754 sourceExp->isConstant = 0x1;
5755 sourceExp->expType = MkClassType(_class->fullName);
5759 sourceExp->type = 2;
5760 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5761 sprintf(constant, "%d", (int)value->data);
5763 sprintf(constant, "0x%X", (int)value->data);
5764 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5772 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5779 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5781 int value2 = op2->i;
5784 exp->string = PrintInt(op1->i + value2);
5787 exp->expType = op1->type;
5789 op1->type->refCount++;
5794 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5796 unsigned int value2 = op2->ui;
5799 exp->string = PrintUInt(op1->ui + value2);
5802 exp->expType = op1->type;
5804 op1->type->refCount++;
5809 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5811 long long value2 = op2->i64;
5814 exp->string = PrintInt64(op1->i64 + value2);
5817 exp->expType = op1->type;
5819 op1->type->refCount++;
5824 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5826 uint64 value2 = op2->ui64;
5829 exp->string = PrintUInt64(op1->ui64 + value2);
5832 exp->expType = op1->type;
5834 op1->type->refCount++;
5839 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5841 short value2 = op2->s;
5844 exp->string = PrintShort(op1->s + value2);
5847 exp->expType = op1->type;
5849 op1->type->refCount++;
5854 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5856 unsigned short value2 = op2->us;
5859 exp->string = PrintUShort(op1->us + value2);
5862 exp->expType = op1->type;
5864 op1->type->refCount++;
5869 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5871 char value2 = op2->c;
5874 exp->string = PrintChar(op1->c + value2);
5877 exp->expType = op1->type;
5879 op1->type->refCount++;
5884 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5886 unsigned char value2 = op2->uc;
5889 exp->string = PrintUChar(op1->uc + value2);
5892 exp->expType = op1->type;
5894 op1->type->refCount++;
5899 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5901 float value2 = op2->f;
5904 exp->string = PrintFloat(op1->f + value2);
5907 exp->expType = op1->type;
5909 op1->type->refCount++;
5914 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5916 double value2 = op2->d;
5919 exp->string = PrintDouble(op1->d + value2);
5922 exp->expType = op1->type;
5924 op1->type->refCount++;
5929 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5931 int value2 = op2->i;
5934 exp->string = PrintInt(op1->i - value2);
5937 exp->expType = op1->type;
5939 op1->type->refCount++;
5944 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5946 unsigned int value2 = op2->ui;
5949 exp->string = PrintUInt(op1->ui - value2);
5952 exp->expType = op1->type;
5954 op1->type->refCount++;
5959 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5961 long long value2 = op2->i64;
5964 exp->string = PrintInt64(op1->i64 - value2);
5967 exp->expType = op1->type;
5969 op1->type->refCount++;
5974 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5976 uint64 value2 = op2->ui64;
5979 exp->string = PrintUInt64(op1->ui64 - value2);
5982 exp->expType = op1->type;
5984 op1->type->refCount++;
5989 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5991 short value2 = op2->s;
5994 exp->string = PrintShort(op1->s - value2);
5997 exp->expType = op1->type;
5999 op1->type->refCount++;
6004 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6006 unsigned short value2 = op2->us;
6009 exp->string = PrintUShort(op1->us - value2);
6012 exp->expType = op1->type;
6014 op1->type->refCount++;
6019 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6021 char value2 = op2->c;
6024 exp->string = PrintChar(op1->c - value2);
6027 exp->expType = op1->type;
6029 op1->type->refCount++;
6034 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6036 unsigned char value2 = op2->uc;
6039 exp->string = PrintUChar(op1->uc - value2);
6042 exp->expType = op1->type;
6044 op1->type->refCount++;
6049 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6051 float value2 = op2->f;
6054 exp->string = PrintFloat(op1->f - value2);
6057 exp->expType = op1->type;
6059 op1->type->refCount++;
6064 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6066 double value2 = op2->d;
6069 exp->string = PrintDouble(op1->d - value2);
6072 exp->expType = op1->type;
6074 op1->type->refCount++;
6079 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6081 int value2 = op2->i;
6084 exp->string = PrintInt(op1->i * value2);
6087 exp->expType = op1->type;
6089 op1->type->refCount++;
6094 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6096 unsigned int value2 = op2->ui;
6099 exp->string = PrintUInt(op1->ui * value2);
6102 exp->expType = op1->type;
6104 op1->type->refCount++;
6109 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6111 long long value2 = op2->i64;
6114 exp->string = PrintInt64(op1->i64 * value2);
6117 exp->expType = op1->type;
6119 op1->type->refCount++;
6124 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6126 uint64 value2 = op2->ui64;
6129 exp->string = PrintUInt64(op1->ui64 * value2);
6132 exp->expType = op1->type;
6134 op1->type->refCount++;
6139 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6141 short value2 = op2->s;
6144 exp->string = PrintShort(op1->s * value2);
6147 exp->expType = op1->type;
6149 op1->type->refCount++;
6154 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6156 unsigned short value2 = op2->us;
6159 exp->string = PrintUShort(op1->us * value2);
6162 exp->expType = op1->type;
6164 op1->type->refCount++;
6169 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6171 char value2 = op2->c;
6174 exp->string = PrintChar(op1->c * value2);
6177 exp->expType = op1->type;
6179 op1->type->refCount++;
6184 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6186 unsigned char value2 = op2->uc;
6189 exp->string = PrintUChar(op1->uc * value2);
6192 exp->expType = op1->type;
6194 op1->type->refCount++;
6199 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6201 float value2 = op2->f;
6204 exp->string = PrintFloat(op1->f * value2);
6207 exp->expType = op1->type;
6209 op1->type->refCount++;
6214 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6216 double value2 = op2->d;
6219 exp->string = PrintDouble(op1->d * value2);
6222 exp->expType = op1->type;
6224 op1->type->refCount++;
6229 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6231 int value2 = op2->i;
6234 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6237 exp->expType = op1->type;
6239 op1->type->refCount++;
6244 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6246 unsigned int value2 = op2->ui;
6249 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6252 exp->expType = op1->type;
6254 op1->type->refCount++;
6259 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6261 long long value2 = op2->i64;
6264 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6267 exp->expType = op1->type;
6269 op1->type->refCount++;
6274 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6276 uint64 value2 = op2->ui64;
6279 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6282 exp->expType = op1->type;
6284 op1->type->refCount++;
6289 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6291 short value2 = op2->s;
6294 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6306 unsigned short value2 = op2->us;
6309 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6312 exp->expType = op1->type;
6314 op1->type->refCount++;
6319 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6321 char value2 = op2->c;
6324 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6327 exp->expType = op1->type;
6329 op1->type->refCount++;
6334 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6336 unsigned char value2 = op2->uc;
6339 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6342 exp->expType = op1->type;
6344 op1->type->refCount++;
6349 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6351 float value2 = op2->f;
6354 exp->string = PrintFloat(op1->f / value2);
6357 exp->expType = op1->type;
6359 op1->type->refCount++;
6364 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6366 double value2 = op2->d;
6369 exp->string = PrintDouble(op1->d / value2);
6372 exp->expType = op1->type;
6374 op1->type->refCount++;
6379 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6381 int value2 = op2->i;
6384 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6387 exp->expType = op1->type;
6389 op1->type->refCount++;
6394 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6396 unsigned int value2 = op2->ui;
6399 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6402 exp->expType = op1->type;
6404 op1->type->refCount++;
6409 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6411 long long value2 = op2->i64;
6414 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6417 exp->expType = op1->type;
6419 op1->type->refCount++;
6424 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6426 uint64 value2 = op2->ui64;
6429 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6432 exp->expType = op1->type;
6434 op1->type->refCount++;
6439 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6441 short value2 = op2->s;
6444 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6447 exp->expType = op1->type;
6449 op1->type->refCount++;
6454 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6456 unsigned short value2 = op2->us;
6459 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6462 exp->expType = op1->type;
6464 op1->type->refCount++;
6469 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6471 char value2 = op2->c;
6474 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6477 exp->expType = op1->type;
6479 op1->type->refCount++;
6484 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6486 unsigned char value2 = op2->uc;
6489 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6492 exp->expType = op1->type;
6494 op1->type->refCount++;
6499 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6502 exp->string = PrintInt((-op1->i));
6505 exp->expType = op1->type;
6507 op1->type->refCount++;
6512 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6515 exp->string = PrintUInt((unsigned int)(-op1->ui));
6518 exp->expType = op1->type;
6520 op1->type->refCount++;
6525 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6528 exp->string = PrintInt64((-op1->i64));
6531 exp->expType = op1->type;
6533 op1->type->refCount++;
6538 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6541 exp->string = PrintUInt64((uint64)(-op1->ui64));
6544 exp->expType = op1->type;
6546 op1->type->refCount++;
6551 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6554 exp->string = PrintShort((-op1->s));
6557 exp->expType = op1->type;
6559 op1->type->refCount++;
6564 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6567 exp->string = PrintUShort((unsigned short)(-op1->us));
6570 exp->expType = op1->type;
6572 op1->type->refCount++;
6577 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6580 exp->string = PrintChar((-op1->c));
6583 exp->expType = op1->type;
6585 op1->type->refCount++;
6590 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6593 exp->string = PrintUChar((unsigned char)(-op1->uc));
6596 exp->expType = op1->type;
6598 op1->type->refCount++;
6603 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6606 exp->string = PrintFloat((float)(-op1->f));
6609 exp->expType = op1->type;
6611 op1->type->refCount++;
6616 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6619 exp->string = PrintDouble((double)(-op1->d));
6622 exp->expType = op1->type;
6624 op1->type->refCount++;
6629 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6632 exp->string = PrintInt((++op1->i));
6635 exp->expType = op1->type;
6637 op1->type->refCount++;
6642 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6645 exp->string = PrintUInt((++op1->ui));
6648 exp->expType = op1->type;
6650 op1->type->refCount++;
6655 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6658 exp->string = PrintInt64((++op1->i64));
6661 exp->expType = op1->type;
6663 op1->type->refCount++;
6668 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6671 exp->string = PrintUInt64((++op1->ui64));
6674 exp->expType = op1->type;
6676 op1->type->refCount++;
6681 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6684 exp->string = PrintShort((++op1->s));
6687 exp->expType = op1->type;
6689 op1->type->refCount++;
6694 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6697 exp->string = PrintUShort((++op1->us));
6700 exp->expType = op1->type;
6702 op1->type->refCount++;
6707 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6710 exp->string = PrintChar((++op1->c));
6713 exp->expType = op1->type;
6715 op1->type->refCount++;
6720 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6723 exp->string = PrintUChar((++op1->uc));
6726 exp->expType = op1->type;
6728 op1->type->refCount++;
6733 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6736 exp->string = PrintFloat((float)(++op1->f));
6739 exp->expType = op1->type;
6741 op1->type->refCount++;
6746 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6749 exp->string = PrintDouble((double)(++op1->d));
6752 exp->expType = op1->type;
6754 op1->type->refCount++;
6759 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6762 exp->string = PrintInt((--op1->i));
6765 exp->expType = op1->type;
6767 op1->type->refCount++;
6772 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6775 exp->string = PrintUInt((--op1->ui));
6778 exp->expType = op1->type;
6780 op1->type->refCount++;
6785 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6788 exp->string = PrintInt64((--op1->i64));
6791 exp->expType = op1->type;
6793 op1->type->refCount++;
6798 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6801 exp->string = PrintUInt64((--op1->ui64));
6804 exp->expType = op1->type;
6806 op1->type->refCount++;
6811 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6814 exp->string = PrintShort((--op1->s));
6817 exp->expType = op1->type;
6819 op1->type->refCount++;
6824 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6827 exp->string = PrintUShort((--op1->us));
6830 exp->expType = op1->type;
6832 op1->type->refCount++;
6837 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6840 exp->string = PrintChar((--op1->c));
6843 exp->expType = op1->type;
6845 op1->type->refCount++;
6850 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6853 exp->string = PrintUChar((--op1->uc));
6856 exp->expType = op1->type;
6858 op1->type->refCount++;
6863 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6866 exp->string = PrintFloat((float)(--op1->f));
6869 exp->expType = op1->type;
6871 op1->type->refCount++;
6876 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6879 exp->string = PrintDouble((double)(--op1->d));
6882 exp->expType = op1->type;
6884 op1->type->refCount++;
6889 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6891 int value2 = op2->i;
6894 exp->string = PrintInt(op1->i = value2);
6897 exp->expType = op1->type;
6899 op1->type->refCount++;
6904 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6906 unsigned int value2 = op2->ui;
6909 exp->string = PrintUInt(op1->ui = value2);
6912 exp->expType = op1->type;
6914 op1->type->refCount++;
6919 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6921 long long value2 = op2->i64;
6924 exp->string = PrintInt64(op1->i64 = value2);
6927 exp->expType = op1->type;
6929 op1->type->refCount++;
6934 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6936 uint64 value2 = op2->ui64;
6939 exp->string = PrintUInt64(op1->ui64 = value2);
6942 exp->expType = op1->type;
6944 op1->type->refCount++;
6949 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6951 short value2 = op2->s;
6954 exp->string = PrintShort(op1->s = value2);
6957 exp->expType = op1->type;
6959 op1->type->refCount++;
6964 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6966 unsigned short value2 = op2->us;
6969 exp->string = PrintUShort(op1->us = value2);
6972 exp->expType = op1->type;
6974 op1->type->refCount++;
6979 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6981 char value2 = op2->c;
6984 exp->string = PrintChar(op1->c = value2);
6987 exp->expType = op1->type;
6989 op1->type->refCount++;
6994 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6996 unsigned char value2 = op2->uc;
6999 exp->string = PrintUChar(op1->uc = value2);
7002 exp->expType = op1->type;
7004 op1->type->refCount++;
7009 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7011 float value2 = op2->f;
7014 exp->string = PrintFloat(op1->f = value2);
7017 exp->expType = op1->type;
7019 op1->type->refCount++;
7024 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7026 double value2 = op2->d;
7029 exp->string = PrintDouble(op1->d = value2);
7032 exp->expType = op1->type;
7034 op1->type->refCount++;
7039 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7041 int value2 = op2->i;
7044 exp->string = PrintInt(op1->i += value2);
7047 exp->expType = op1->type;
7049 op1->type->refCount++;
7054 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7056 unsigned int value2 = op2->ui;
7059 exp->string = PrintUInt(op1->ui += value2);
7062 exp->expType = op1->type;
7064 op1->type->refCount++;
7069 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7071 long long value2 = op2->i64;
7074 exp->string = PrintInt64(op1->i64 += value2);
7077 exp->expType = op1->type;
7079 op1->type->refCount++;
7084 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7086 uint64 value2 = op2->ui64;
7089 exp->string = PrintUInt64(op1->ui64 += value2);
7092 exp->expType = op1->type;
7094 op1->type->refCount++;
7099 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7101 short value2 = op2->s;
7104 exp->string = PrintShort(op1->s += value2);
7107 exp->expType = op1->type;
7109 op1->type->refCount++;
7114 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7116 unsigned short value2 = op2->us;
7119 exp->string = PrintUShort(op1->us += value2);
7122 exp->expType = op1->type;
7124 op1->type->refCount++;
7129 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7131 char value2 = op2->c;
7134 exp->string = PrintChar(op1->c += value2);
7137 exp->expType = op1->type;
7139 op1->type->refCount++;
7144 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7146 unsigned char value2 = op2->uc;
7149 exp->string = PrintUChar(op1->uc += value2);
7152 exp->expType = op1->type;
7154 op1->type->refCount++;
7159 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7161 float value2 = op2->f;
7164 exp->string = PrintFloat(op1->f += value2);
7167 exp->expType = op1->type;
7169 op1->type->refCount++;
7174 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7176 double value2 = op2->d;
7179 exp->string = PrintDouble(op1->d += value2);
7182 exp->expType = op1->type;
7184 op1->type->refCount++;
7189 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7191 int value2 = op2->i;
7194 exp->string = PrintInt(op1->i -= value2);
7197 exp->expType = op1->type;
7199 op1->type->refCount++;
7204 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7206 unsigned int value2 = op2->ui;
7209 exp->string = PrintUInt(op1->ui -= value2);
7212 exp->expType = op1->type;
7214 op1->type->refCount++;
7219 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7221 long long value2 = op2->i64;
7224 exp->string = PrintInt64(op1->i64 -= value2);
7227 exp->expType = op1->type;
7229 op1->type->refCount++;
7234 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7236 uint64 value2 = op2->ui64;
7239 exp->string = PrintUInt64(op1->ui64 -= value2);
7242 exp->expType = op1->type;
7244 op1->type->refCount++;
7249 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7251 short value2 = op2->s;
7254 exp->string = PrintShort(op1->s -= value2);
7257 exp->expType = op1->type;
7259 op1->type->refCount++;
7264 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7266 unsigned short value2 = op2->us;
7269 exp->string = PrintUShort(op1->us -= value2);
7272 exp->expType = op1->type;
7274 op1->type->refCount++;
7279 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7281 char value2 = op2->c;
7284 exp->string = PrintChar(op1->c -= value2);
7287 exp->expType = op1->type;
7289 op1->type->refCount++;
7294 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7296 unsigned char value2 = op2->uc;
7299 exp->string = PrintUChar(op1->uc -= value2);
7302 exp->expType = op1->type;
7304 op1->type->refCount++;
7309 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7311 float value2 = op2->f;
7314 exp->string = PrintFloat(op1->f -= value2);
7317 exp->expType = op1->type;
7319 op1->type->refCount++;
7324 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7326 double value2 = op2->d;
7329 exp->string = PrintDouble(op1->d -= value2);
7332 exp->expType = op1->type;
7334 op1->type->refCount++;
7339 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7341 int value2 = op2->i;
7344 exp->string = PrintInt(op1->i *= value2);
7347 exp->expType = op1->type;
7349 op1->type->refCount++;
7354 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7356 unsigned int value2 = op2->ui;
7359 exp->string = PrintUInt(op1->ui *= value2);
7362 exp->expType = op1->type;
7364 op1->type->refCount++;
7369 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7371 long long value2 = op2->i64;
7374 exp->string = PrintInt64(op1->i64 *= value2);
7377 exp->expType = op1->type;
7379 op1->type->refCount++;
7384 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7386 uint64 value2 = op2->ui64;
7389 exp->string = PrintUInt64(op1->ui64 *= value2);
7392 exp->expType = op1->type;
7394 op1->type->refCount++;
7399 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7401 short value2 = op2->s;
7404 exp->string = PrintShort(op1->s *= value2);
7407 exp->expType = op1->type;
7409 op1->type->refCount++;
7414 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7416 unsigned short value2 = op2->us;
7419 exp->string = PrintUShort(op1->us *= value2);
7422 exp->expType = op1->type;
7424 op1->type->refCount++;
7429 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7431 char value2 = op2->c;
7434 exp->string = PrintChar(op1->c *= value2);
7437 exp->expType = op1->type;
7439 op1->type->refCount++;
7444 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7446 unsigned char value2 = op2->uc;
7449 exp->string = PrintUChar(op1->uc *= value2);
7452 exp->expType = op1->type;
7454 op1->type->refCount++;
7459 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7461 float value2 = op2->f;
7464 exp->string = PrintFloat(op1->f *= value2);
7467 exp->expType = op1->type;
7469 op1->type->refCount++;
7474 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7476 double value2 = op2->d;
7479 exp->string = PrintDouble(op1->d *= value2);
7482 exp->expType = op1->type;
7484 op1->type->refCount++;
7489 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7491 int value2 = op2->i;
7494 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7497 exp->expType = op1->type;
7499 op1->type->refCount++;
7504 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7506 unsigned int value2 = op2->ui;
7509 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7512 exp->expType = op1->type;
7514 op1->type->refCount++;
7519 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7521 long long value2 = op2->i64;
7524 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7527 exp->expType = op1->type;
7529 op1->type->refCount++;
7534 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7536 uint64 value2 = op2->ui64;
7539 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7542 exp->expType = op1->type;
7544 op1->type->refCount++;
7549 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7551 short value2 = op2->s;
7554 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7557 exp->expType = op1->type;
7559 op1->type->refCount++;
7564 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7566 unsigned short value2 = op2->us;
7569 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7572 exp->expType = op1->type;
7574 op1->type->refCount++;
7579 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7581 char value2 = op2->c;
7584 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7587 exp->expType = op1->type;
7589 op1->type->refCount++;
7594 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7596 unsigned char value2 = op2->uc;
7599 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7602 exp->expType = op1->type;
7604 op1->type->refCount++;
7609 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7611 float value2 = op2->f;
7614 exp->string = PrintFloat(op1->f /= value2);
7617 exp->expType = op1->type;
7619 op1->type->refCount++;
7624 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7626 double value2 = op2->d;
7629 exp->string = PrintDouble(op1->d /= value2);
7632 exp->expType = op1->type;
7634 op1->type->refCount++;
7639 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7641 int value2 = op2->i;
7644 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7647 exp->expType = op1->type;
7649 op1->type->refCount++;
7654 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7656 unsigned int value2 = op2->ui;
7659 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7662 exp->expType = op1->type;
7664 op1->type->refCount++;
7669 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7671 long long value2 = op2->i64;
7674 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7677 exp->expType = op1->type;
7679 op1->type->refCount++;
7684 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7686 uint64 value2 = op2->ui64;
7689 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7692 exp->expType = op1->type;
7694 op1->type->refCount++;
7699 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7701 short value2 = op2->s;
7704 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7707 exp->expType = op1->type;
7709 op1->type->refCount++;
7714 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7716 unsigned short value2 = op2->us;
7719 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7722 exp->expType = op1->type;
7724 op1->type->refCount++;
7729 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7731 char value2 = op2->c;
7734 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7737 exp->expType = op1->type;
7739 op1->type->refCount++;
7744 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7746 unsigned char value2 = op2->uc;
7749 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7752 exp->expType = op1->type;
7754 op1->type->refCount++;
7759 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7761 int value2 = op2->i;
7764 exp->string = PrintInt(op1->i & value2);
7767 exp->expType = op1->type;
7769 op1->type->refCount++;
7774 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7776 unsigned int value2 = op2->ui;
7779 exp->string = PrintUInt(op1->ui & value2);
7782 exp->expType = op1->type;
7784 op1->type->refCount++;
7789 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7791 long long value2 = op2->i64;
7794 exp->string = PrintInt64(op1->i64 & value2);
7797 exp->expType = op1->type;
7799 op1->type->refCount++;
7804 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7806 uint64 value2 = op2->ui64;
7809 exp->string = PrintUInt64(op1->ui64 & value2);
7812 exp->expType = op1->type;
7814 op1->type->refCount++;
7819 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7821 short value2 = op2->s;
7824 exp->string = PrintShort(op1->s & value2);
7827 exp->expType = op1->type;
7829 op1->type->refCount++;
7834 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7836 unsigned short value2 = op2->us;
7839 exp->string = PrintUShort(op1->us & value2);
7842 exp->expType = op1->type;
7844 op1->type->refCount++;
7849 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7851 char value2 = op2->c;
7854 exp->string = PrintChar(op1->c & value2);
7857 exp->expType = op1->type;
7859 op1->type->refCount++;
7864 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7866 unsigned char value2 = op2->uc;
7869 exp->string = PrintUChar(op1->uc & value2);
7872 exp->expType = op1->type;
7874 op1->type->refCount++;
7879 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7881 int value2 = op2->i;
7884 exp->string = PrintInt(op1->i | value2);
7887 exp->expType = op1->type;
7889 op1->type->refCount++;
7894 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7896 unsigned int value2 = op2->ui;
7899 exp->string = PrintUInt(op1->ui | value2);
7902 exp->expType = op1->type;
7904 op1->type->refCount++;
7909 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7911 long long value2 = op2->i64;
7914 exp->string = PrintInt64(op1->i64 | value2);
7917 exp->expType = op1->type;
7919 op1->type->refCount++;
7924 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7926 uint64 value2 = op2->ui64;
7929 exp->string = PrintUInt64(op1->ui64 | value2);
7932 exp->expType = op1->type;
7934 op1->type->refCount++;
7939 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7941 short value2 = op2->s;
7944 exp->string = PrintShort(op1->s | value2);
7947 exp->expType = op1->type;
7949 op1->type->refCount++;
7954 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7956 unsigned short value2 = op2->us;
7959 exp->string = PrintUShort(op1->us | value2);
7962 exp->expType = op1->type;
7964 op1->type->refCount++;
7969 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7971 char value2 = op2->c;
7974 exp->string = PrintChar(op1->c | value2);
7977 exp->expType = op1->type;
7979 op1->type->refCount++;
7984 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7986 unsigned char value2 = op2->uc;
7989 exp->string = PrintUChar(op1->uc | value2);
7992 exp->expType = op1->type;
7994 op1->type->refCount++;
7999 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8001 int value2 = op2->i;
8004 exp->string = PrintInt(op1->i ^ value2);
8007 exp->expType = op1->type;
8009 op1->type->refCount++;
8014 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8016 unsigned int value2 = op2->ui;
8019 exp->string = PrintUInt(op1->ui ^ value2);
8022 exp->expType = op1->type;
8024 op1->type->refCount++;
8029 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8031 long long value2 = op2->i64;
8034 exp->string = PrintInt64(op1->i64 ^ value2);
8037 exp->expType = op1->type;
8039 op1->type->refCount++;
8044 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8046 uint64 value2 = op2->ui64;
8049 exp->string = PrintUInt64(op1->ui64 ^ value2);
8052 exp->expType = op1->type;
8054 op1->type->refCount++;
8059 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8061 short value2 = op2->s;
8064 exp->string = PrintShort(op1->s ^ value2);
8067 exp->expType = op1->type;
8069 op1->type->refCount++;
8074 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8076 unsigned short value2 = op2->us;
8079 exp->string = PrintUShort(op1->us ^ value2);
8082 exp->expType = op1->type;
8084 op1->type->refCount++;
8089 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8091 char value2 = op2->c;
8094 exp->string = PrintChar(op1->c ^ value2);
8097 exp->expType = op1->type;
8099 op1->type->refCount++;
8104 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8106 unsigned char value2 = op2->uc;
8109 exp->string = PrintUChar(op1->uc ^ value2);
8112 exp->expType = op1->type;
8114 op1->type->refCount++;
8119 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8121 int value2 = op2->i;
8124 exp->string = PrintInt(op1->i << value2);
8127 exp->expType = op1->type;
8129 op1->type->refCount++;
8134 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8136 unsigned int value2 = op2->ui;
8139 exp->string = PrintUInt(op1->ui << value2);
8142 exp->expType = op1->type;
8144 op1->type->refCount++;
8149 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8151 long long value2 = op2->i64;
8154 exp->string = PrintInt64(op1->i64 << value2);
8157 exp->expType = op1->type;
8159 op1->type->refCount++;
8164 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8166 uint64 value2 = op2->ui64;
8169 exp->string = PrintUInt64(op1->ui64 << value2);
8172 exp->expType = op1->type;
8174 op1->type->refCount++;
8179 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8181 short value2 = op2->s;
8184 exp->string = PrintShort(op1->s << value2);
8187 exp->expType = op1->type;
8189 op1->type->refCount++;
8194 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8196 unsigned short value2 = op2->us;
8199 exp->string = PrintUShort(op1->us << value2);
8202 exp->expType = op1->type;
8204 op1->type->refCount++;
8209 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8211 char value2 = op2->c;
8214 exp->string = PrintChar(op1->c << value2);
8217 exp->expType = op1->type;
8219 op1->type->refCount++;
8224 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8226 unsigned char value2 = op2->uc;
8229 exp->string = PrintUChar(op1->uc << value2);
8232 exp->expType = op1->type;
8234 op1->type->refCount++;
8239 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8241 int value2 = op2->i;
8244 exp->string = PrintInt(op1->i >> value2);
8247 exp->expType = op1->type;
8249 op1->type->refCount++;
8254 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8256 unsigned int value2 = op2->ui;
8259 exp->string = PrintUInt(op1->ui >> value2);
8262 exp->expType = op1->type;
8264 op1->type->refCount++;
8269 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8271 long long value2 = op2->i64;
8274 exp->string = PrintInt64(op1->i64 >> value2);
8277 exp->expType = op1->type;
8279 op1->type->refCount++;
8284 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8286 uint64 value2 = op2->ui64;
8289 exp->string = PrintUInt64(op1->ui64 >> value2);
8292 exp->expType = op1->type;
8294 op1->type->refCount++;
8299 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8301 short value2 = op2->s;
8304 exp->string = PrintShort(op1->s >> value2);
8307 exp->expType = op1->type;
8309 op1->type->refCount++;
8314 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8316 unsigned short value2 = op2->us;
8319 exp->string = PrintUShort(op1->us >> value2);
8322 exp->expType = op1->type;
8324 op1->type->refCount++;
8329 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8331 char value2 = op2->c;
8334 exp->string = PrintChar(op1->c >> value2);
8337 exp->expType = op1->type;
8339 op1->type->refCount++;
8344 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8346 unsigned char value2 = op2->uc;
8349 exp->string = PrintUChar(op1->uc >> value2);
8352 exp->expType = op1->type;
8354 op1->type->refCount++;
8359 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8362 exp->string = PrintInt((~op1->i));
8365 exp->expType = op1->type;
8367 op1->type->refCount++;
8372 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8375 exp->string = PrintUInt((unsigned int)(~op1->ui));
8378 exp->expType = op1->type;
8380 op1->type->refCount++;
8385 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8388 exp->string = PrintInt64((long long)(~op1->i64));
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8401 exp->string = PrintUInt64((uint64)(~op1->ui64));
8404 exp->expType = op1->type;
8406 op1->type->refCount++;
8411 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8414 exp->string = PrintShort((short)(~op1->s));
8417 exp->expType = op1->type;
8419 op1->type->refCount++;
8424 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8427 exp->string = PrintUShort((unsigned short)(~op1->us));
8430 exp->expType = op1->type;
8432 op1->type->refCount++;
8437 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8440 exp->string = PrintChar((char)(~op1->c));
8443 exp->expType = op1->type;
8445 op1->type->refCount++;
8450 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8453 exp->string = PrintUChar((unsigned char)(~op1->uc));
8456 exp->expType = op1->type;
8458 op1->type->refCount++;
8463 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8465 int value2 = op2->i;
8468 exp->string = PrintInt(op1->i &= value2);
8471 exp->expType = op1->type;
8473 op1->type->refCount++;
8478 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8480 unsigned int value2 = op2->ui;
8483 exp->string = PrintUInt(op1->ui &= value2);
8486 exp->expType = op1->type;
8488 op1->type->refCount++;
8493 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8495 long long value2 = op2->i64;
8498 exp->string = PrintInt64(op1->i64 &= value2);
8501 exp->expType = op1->type;
8503 op1->type->refCount++;
8508 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8510 uint64 value2 = op2->ui64;
8513 exp->string = PrintUInt64(op1->ui64 &= value2);
8516 exp->expType = op1->type;
8518 op1->type->refCount++;
8523 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8525 short value2 = op2->s;
8528 exp->string = PrintShort(op1->s &= value2);
8531 exp->expType = op1->type;
8533 op1->type->refCount++;
8538 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8540 unsigned short value2 = op2->us;
8543 exp->string = PrintUShort(op1->us &= value2);
8546 exp->expType = op1->type;
8548 op1->type->refCount++;
8553 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8555 char value2 = op2->c;
8558 exp->string = PrintChar(op1->c &= value2);
8561 exp->expType = op1->type;
8563 op1->type->refCount++;
8568 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8570 unsigned char value2 = op2->uc;
8573 exp->string = PrintUChar(op1->uc &= value2);
8576 exp->expType = op1->type;
8578 op1->type->refCount++;
8583 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8585 int value2 = op2->i;
8588 exp->string = PrintInt(op1->i |= value2);
8591 exp->expType = op1->type;
8593 op1->type->refCount++;
8598 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8600 unsigned int value2 = op2->ui;
8603 exp->string = PrintUInt(op1->ui |= value2);
8606 exp->expType = op1->type;
8608 op1->type->refCount++;
8613 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8615 long long value2 = op2->i64;
8618 exp->string = PrintInt64(op1->i64 |= value2);
8621 exp->expType = op1->type;
8623 op1->type->refCount++;
8628 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8630 uint64 value2 = op2->ui64;
8633 exp->string = PrintUInt64(op1->ui64 |= value2);
8636 exp->expType = op1->type;
8638 op1->type->refCount++;
8643 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8645 short value2 = op2->s;
8648 exp->string = PrintShort(op1->s |= value2);
8651 exp->expType = op1->type;
8653 op1->type->refCount++;
8658 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8660 unsigned short value2 = op2->us;
8663 exp->string = PrintUShort(op1->us |= value2);
8666 exp->expType = op1->type;
8668 op1->type->refCount++;
8673 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8675 char value2 = op2->c;
8678 exp->string = PrintChar(op1->c |= value2);
8681 exp->expType = op1->type;
8683 op1->type->refCount++;
8688 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8690 unsigned char value2 = op2->uc;
8693 exp->string = PrintUChar(op1->uc |= value2);
8696 exp->expType = op1->type;
8698 op1->type->refCount++;
8703 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8705 int value2 = op2->i;
8708 exp->string = PrintInt(op1->i ^= value2);
8711 exp->expType = op1->type;
8713 op1->type->refCount++;
8718 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8720 unsigned int value2 = op2->ui;
8723 exp->string = PrintUInt(op1->ui ^= value2);
8726 exp->expType = op1->type;
8728 op1->type->refCount++;
8733 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8735 long long value2 = op2->i64;
8738 exp->string = PrintInt64(op1->i64 ^= value2);
8741 exp->expType = op1->type;
8743 op1->type->refCount++;
8748 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8750 uint64 value2 = op2->ui64;
8753 exp->string = PrintUInt64(op1->ui64 ^= value2);
8756 exp->expType = op1->type;
8758 op1->type->refCount++;
8763 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8765 short value2 = op2->s;
8768 exp->string = PrintShort(op1->s ^= value2);
8771 exp->expType = op1->type;
8773 op1->type->refCount++;
8778 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8780 unsigned short value2 = op2->us;
8783 exp->string = PrintUShort(op1->us ^= value2);
8786 exp->expType = op1->type;
8788 op1->type->refCount++;
8793 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8795 char value2 = op2->c;
8798 exp->string = PrintChar(op1->c ^= value2);
8801 exp->expType = op1->type;
8803 op1->type->refCount++;
8808 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8810 unsigned char value2 = op2->uc;
8813 exp->string = PrintUChar(op1->uc ^= value2);
8816 exp->expType = op1->type;
8818 op1->type->refCount++;
8823 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8825 int value2 = op2->i;
8828 exp->string = PrintInt(op1->i <<= value2);
8831 exp->expType = op1->type;
8833 op1->type->refCount++;
8838 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8840 unsigned int value2 = op2->ui;
8843 exp->string = PrintUInt(op1->ui <<= value2);
8846 exp->expType = op1->type;
8848 op1->type->refCount++;
8853 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8855 long long value2 = op2->i64;
8858 exp->string = PrintInt64(op1->i64 <<= value2);
8861 exp->expType = op1->type;
8863 op1->type->refCount++;
8868 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8870 uint64 value2 = op2->ui64;
8873 exp->string = PrintUInt64(op1->ui64 <<= value2);
8876 exp->expType = op1->type;
8878 op1->type->refCount++;
8883 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8885 short value2 = op2->s;
8888 exp->string = PrintShort(op1->s <<= value2);
8891 exp->expType = op1->type;
8893 op1->type->refCount++;
8898 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8900 unsigned short value2 = op2->us;
8903 exp->string = PrintUShort(op1->us <<= value2);
8906 exp->expType = op1->type;
8908 op1->type->refCount++;
8913 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8915 char value2 = op2->c;
8918 exp->string = PrintChar(op1->c <<= value2);
8921 exp->expType = op1->type;
8923 op1->type->refCount++;
8928 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8930 unsigned char value2 = op2->uc;
8933 exp->string = PrintUChar(op1->uc <<= value2);
8936 exp->expType = op1->type;
8938 op1->type->refCount++;
8943 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8945 int value2 = op2->i;
8948 exp->string = PrintInt(op1->i >>= value2);
8951 exp->expType = op1->type;
8953 op1->type->refCount++;
8958 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8960 unsigned int value2 = op2->ui;
8963 exp->string = PrintUInt(op1->ui >>= value2);
8966 exp->expType = op1->type;
8968 op1->type->refCount++;
8973 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8975 long long value2 = op2->i64;
8978 exp->string = PrintInt64(op1->i64 >>= value2);
8981 exp->expType = op1->type;
8983 op1->type->refCount++;
8988 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8990 uint64 value2 = op2->ui64;
8993 exp->string = PrintUInt64(op1->ui64 >>= value2);
8996 exp->expType = op1->type;
8998 op1->type->refCount++;
9003 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9005 short value2 = op2->s;
9008 exp->string = PrintShort(op1->s >>= value2);
9011 exp->expType = op1->type;
9013 op1->type->refCount++;
9018 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9020 unsigned short value2 = op2->us;
9023 exp->string = PrintUShort(op1->us >>= value2);
9026 exp->expType = op1->type;
9028 op1->type->refCount++;
9033 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9035 char value2 = op2->c;
9038 exp->string = PrintChar(op1->c >>= value2);
9041 exp->expType = op1->type;
9043 op1->type->refCount++;
9048 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9050 unsigned char value2 = op2->uc;
9053 exp->string = PrintUChar(op1->uc >>= value2);
9056 exp->expType = op1->type;
9058 op1->type->refCount++;
9063 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9066 exp->string = PrintInt((int)(!op1->i));
9069 exp->expType = op1->type;
9071 op1->type->refCount++;
9076 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9079 exp->string = PrintUInt((unsigned int)(!op1->ui));
9082 exp->expType = op1->type;
9084 op1->type->refCount++;
9089 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9092 exp->string = PrintInt64((long long)(!op1->i64));
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9105 exp->string = PrintUInt64((uint64)(!op1->ui64));
9108 exp->expType = op1->type;
9110 op1->type->refCount++;
9115 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9118 exp->string = PrintShort((short)(!op1->s));
9121 exp->expType = op1->type;
9123 op1->type->refCount++;
9128 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9131 exp->string = PrintUShort((unsigned short)(!op1->us));
9134 exp->expType = op1->type;
9136 op1->type->refCount++;
9141 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9144 exp->string = PrintChar((char)(!op1->c));
9147 exp->expType = op1->type;
9149 op1->type->refCount++;
9154 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9157 exp->string = PrintUChar((unsigned char)(!op1->uc));
9160 exp->expType = op1->type;
9162 op1->type->refCount++;
9167 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9169 int value2 = op2->i;
9172 exp->string = PrintInt(op1->i == value2);
9175 exp->expType = op1->type;
9177 op1->type->refCount++;
9182 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9184 unsigned int value2 = op2->ui;
9187 exp->string = PrintUInt(op1->ui == value2);
9190 exp->expType = op1->type;
9192 op1->type->refCount++;
9197 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9199 long long value2 = op2->i64;
9202 exp->string = PrintInt64(op1->i64 == value2);
9205 exp->expType = op1->type;
9207 op1->type->refCount++;
9212 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9214 uint64 value2 = op2->ui64;
9217 exp->string = PrintUInt64(op1->ui64 == value2);
9220 exp->expType = op1->type;
9222 op1->type->refCount++;
9227 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9229 short value2 = op2->s;
9232 exp->string = PrintShort(op1->s == value2);
9235 exp->expType = op1->type;
9237 op1->type->refCount++;
9242 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9244 unsigned short value2 = op2->us;
9247 exp->string = PrintUShort(op1->us == value2);
9250 exp->expType = op1->type;
9252 op1->type->refCount++;
9257 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9259 char value2 = op2->c;
9262 exp->string = PrintChar(op1->c == value2);
9265 exp->expType = op1->type;
9267 op1->type->refCount++;
9272 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9274 unsigned char value2 = op2->uc;
9277 exp->string = PrintUChar(op1->uc == value2);
9280 exp->expType = op1->type;
9282 op1->type->refCount++;
9287 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9289 float value2 = op2->f;
9292 exp->string = PrintFloat(op1->f == value2);
9295 exp->expType = op1->type;
9297 op1->type->refCount++;
9302 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9304 double value2 = op2->d;
9307 exp->string = PrintDouble(op1->d == value2);
9310 exp->expType = op1->type;
9312 op1->type->refCount++;
9317 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9319 int value2 = op2->i;
9322 exp->string = PrintInt(op1->i != value2);
9325 exp->expType = op1->type;
9327 op1->type->refCount++;
9332 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9334 unsigned int value2 = op2->ui;
9337 exp->string = PrintUInt(op1->ui != value2);
9340 exp->expType = op1->type;
9342 op1->type->refCount++;
9347 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9349 long long value2 = op2->i64;
9352 exp->string = PrintInt64(op1->i64 != value2);
9355 exp->expType = op1->type;
9357 op1->type->refCount++;
9362 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9364 uint64 value2 = op2->ui64;
9367 exp->string = PrintUInt64(op1->ui64 != value2);
9370 exp->expType = op1->type;
9372 op1->type->refCount++;
9377 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9379 short value2 = op2->s;
9382 exp->string = PrintShort(op1->s != value2);
9385 exp->expType = op1->type;
9387 op1->type->refCount++;
9392 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9394 unsigned short value2 = op2->us;
9397 exp->string = PrintUShort(op1->us != value2);
9400 exp->expType = op1->type;
9402 op1->type->refCount++;
9407 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9409 char value2 = op2->c;
9412 exp->string = PrintChar(op1->c != value2);
9415 exp->expType = op1->type;
9417 op1->type->refCount++;
9422 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9424 unsigned char value2 = op2->uc;
9427 exp->string = PrintUChar(op1->uc != value2);
9430 exp->expType = op1->type;
9432 op1->type->refCount++;
9437 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9439 float value2 = op2->f;
9442 exp->string = PrintFloat(op1->f != value2);
9445 exp->expType = op1->type;
9447 op1->type->refCount++;
9452 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9454 double value2 = op2->d;
9457 exp->string = PrintDouble(op1->d != value2);
9460 exp->expType = op1->type;
9462 op1->type->refCount++;
9467 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9469 int value2 = op2->i;
9472 exp->string = PrintInt(op1->i && value2);
9475 exp->expType = op1->type;
9477 op1->type->refCount++;
9482 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9484 unsigned int value2 = op2->ui;
9487 exp->string = PrintUInt(op1->ui && value2);
9490 exp->expType = op1->type;
9492 op1->type->refCount++;
9497 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9499 long long value2 = op2->i64;
9502 exp->string = PrintInt64(op1->i64 && value2);
9505 exp->expType = op1->type;
9507 op1->type->refCount++;
9512 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9514 uint64 value2 = op2->ui64;
9517 exp->string = PrintUInt64(op1->ui64 && value2);
9520 exp->expType = op1->type;
9522 op1->type->refCount++;
9527 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9529 short value2 = op2->s;
9532 exp->string = PrintShort(op1->s && value2);
9535 exp->expType = op1->type;
9537 op1->type->refCount++;
9542 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9544 unsigned short value2 = op2->us;
9547 exp->string = PrintUShort(op1->us && value2);
9550 exp->expType = op1->type;
9552 op1->type->refCount++;
9557 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9559 char value2 = op2->c;
9562 exp->string = PrintChar(op1->c && value2);
9565 exp->expType = op1->type;
9567 op1->type->refCount++;
9572 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9574 unsigned char value2 = op2->uc;
9577 exp->string = PrintUChar(op1->uc && value2);
9580 exp->expType = op1->type;
9582 op1->type->refCount++;
9587 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9589 float value2 = op2->f;
9592 exp->string = PrintFloat(op1->f && value2);
9595 exp->expType = op1->type;
9597 op1->type->refCount++;
9602 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9604 double value2 = op2->d;
9607 exp->string = PrintDouble(op1->d && value2);
9610 exp->expType = op1->type;
9612 op1->type->refCount++;
9617 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9619 int value2 = op2->i;
9622 exp->string = PrintInt(op1->i || value2);
9625 exp->expType = op1->type;
9627 op1->type->refCount++;
9632 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9634 unsigned int value2 = op2->ui;
9637 exp->string = PrintUInt(op1->ui || value2);
9640 exp->expType = op1->type;
9642 op1->type->refCount++;
9647 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9649 long long value2 = op2->i64;
9652 exp->string = PrintInt64(op1->i64 || value2);
9655 exp->expType = op1->type;
9657 op1->type->refCount++;
9662 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9664 uint64 value2 = op2->ui64;
9667 exp->string = PrintUInt64(op1->ui64 || value2);
9670 exp->expType = op1->type;
9672 op1->type->refCount++;
9677 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9679 short value2 = op2->s;
9682 exp->string = PrintShort(op1->s || value2);
9685 exp->expType = op1->type;
9687 op1->type->refCount++;
9692 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9694 unsigned short value2 = op2->us;
9697 exp->string = PrintUShort(op1->us || value2);
9700 exp->expType = op1->type;
9702 op1->type->refCount++;
9707 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9709 char value2 = op2->c;
9712 exp->string = PrintChar(op1->c || value2);
9715 exp->expType = op1->type;
9717 op1->type->refCount++;
9722 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9724 unsigned char value2 = op2->uc;
9727 exp->string = PrintUChar(op1->uc || value2);
9730 exp->expType = op1->type;
9732 op1->type->refCount++;
9737 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9739 float value2 = op2->f;
9742 exp->string = PrintFloat(op1->f || value2);
9745 exp->expType = op1->type;
9747 op1->type->refCount++;
9752 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9754 double value2 = op2->d;
9757 exp->string = PrintDouble(op1->d || value2);
9760 exp->expType = op1->type;
9762 op1->type->refCount++;
9767 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9769 int value2 = op2->i;
9772 exp->string = PrintInt(op1->i > value2);
9775 exp->expType = op1->type;
9777 op1->type->refCount++;
9782 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9784 unsigned int value2 = op2->ui;
9787 exp->string = PrintUInt(op1->ui > value2);
9790 exp->expType = op1->type;
9792 op1->type->refCount++;
9797 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9799 long long value2 = op2->i64;
9802 exp->string = PrintInt64(op1->i64 > value2);
9805 exp->expType = op1->type;
9807 op1->type->refCount++;
9812 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9814 uint64 value2 = op2->ui64;
9817 exp->string = PrintUInt64(op1->ui64 > value2);
9820 exp->expType = op1->type;
9822 op1->type->refCount++;
9827 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9829 short value2 = op2->s;
9832 exp->string = PrintShort(op1->s > value2);
9835 exp->expType = op1->type;
9837 op1->type->refCount++;
9842 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9844 unsigned short value2 = op2->us;
9847 exp->string = PrintUShort(op1->us > value2);
9850 exp->expType = op1->type;
9852 op1->type->refCount++;
9857 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9859 char value2 = op2->c;
9862 exp->string = PrintChar(op1->c > value2);
9865 exp->expType = op1->type;
9867 op1->type->refCount++;
9872 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9874 unsigned char value2 = op2->uc;
9877 exp->string = PrintUChar(op1->uc > value2);
9880 exp->expType = op1->type;
9882 op1->type->refCount++;
9887 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9889 float value2 = op2->f;
9892 exp->string = PrintFloat(op1->f > value2);
9895 exp->expType = op1->type;
9897 op1->type->refCount++;
9902 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9904 double value2 = op2->d;
9907 exp->string = PrintDouble(op1->d > value2);
9910 exp->expType = op1->type;
9912 op1->type->refCount++;
9917 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9919 int value2 = op2->i;
9922 exp->string = PrintInt(op1->i < value2);
9925 exp->expType = op1->type;
9927 op1->type->refCount++;
9932 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9934 unsigned int value2 = op2->ui;
9937 exp->string = PrintUInt(op1->ui < value2);
9940 exp->expType = op1->type;
9942 op1->type->refCount++;
9947 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9949 long long value2 = op2->i64;
9952 exp->string = PrintInt64(op1->i64 < value2);
9955 exp->expType = op1->type;
9957 op1->type->refCount++;
9962 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9964 uint64 value2 = op2->ui64;
9967 exp->string = PrintUInt64(op1->ui64 < value2);
9970 exp->expType = op1->type;
9972 op1->type->refCount++;
9977 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9979 short value2 = op2->s;
9982 exp->string = PrintShort(op1->s < value2);
9985 exp->expType = op1->type;
9987 op1->type->refCount++;
9992 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9994 unsigned short value2 = op2->us;
9997 exp->string = PrintUShort(op1->us < value2);
10000 exp->expType = op1->type;
10002 op1->type->refCount++;
10007 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10009 char value2 = op2->c;
10012 exp->string = PrintChar(op1->c < value2);
10015 exp->expType = op1->type;
10017 op1->type->refCount++;
10022 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10024 unsigned char value2 = op2->uc;
10027 exp->string = PrintUChar(op1->uc < value2);
10030 exp->expType = op1->type;
10032 op1->type->refCount++;
10037 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10039 float value2 = op2->f;
10042 exp->string = PrintFloat(op1->f < value2);
10045 exp->expType = op1->type;
10047 op1->type->refCount++;
10052 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10054 double value2 = op2->d;
10057 exp->string = PrintDouble(op1->d < value2);
10060 exp->expType = op1->type;
10062 op1->type->refCount++;
10067 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10069 int value2 = op2->i;
10072 exp->string = PrintInt(op1->i >= value2);
10075 exp->expType = op1->type;
10077 op1->type->refCount++;
10082 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10084 unsigned int value2 = op2->ui;
10087 exp->string = PrintUInt(op1->ui >= value2);
10090 exp->expType = op1->type;
10092 op1->type->refCount++;
10097 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10099 long long value2 = op2->i64;
10102 exp->string = PrintInt64(op1->i64 >= value2);
10105 exp->expType = op1->type;
10107 op1->type->refCount++;
10112 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10114 uint64 value2 = op2->ui64;
10117 exp->string = PrintUInt64(op1->ui64 >= value2);
10120 exp->expType = op1->type;
10122 op1->type->refCount++;
10127 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10129 short value2 = op2->s;
10132 exp->string = PrintShort(op1->s >= value2);
10135 exp->expType = op1->type;
10137 op1->type->refCount++;
10142 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10144 unsigned short value2 = op2->us;
10147 exp->string = PrintUShort(op1->us >= value2);
10150 exp->expType = op1->type;
10152 op1->type->refCount++;
10157 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10159 char value2 = op2->c;
10162 exp->string = PrintChar(op1->c >= value2);
10165 exp->expType = op1->type;
10167 op1->type->refCount++;
10172 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10174 unsigned char value2 = op2->uc;
10177 exp->string = PrintUChar(op1->uc >= value2);
10180 exp->expType = op1->type;
10182 op1->type->refCount++;
10187 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10189 float value2 = op2->f;
10192 exp->string = PrintFloat(op1->f >= value2);
10195 exp->expType = op1->type;
10197 op1->type->refCount++;
10202 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10204 double value2 = op2->d;
10207 exp->string = PrintDouble(op1->d >= value2);
10210 exp->expType = op1->type;
10212 op1->type->refCount++;
10217 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10219 int value2 = op2->i;
10222 exp->string = PrintInt(op1->i <= value2);
10225 exp->expType = op1->type;
10227 op1->type->refCount++;
10232 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10234 unsigned int value2 = op2->ui;
10237 exp->string = PrintUInt(op1->ui <= value2);
10240 exp->expType = op1->type;
10242 op1->type->refCount++;
10247 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10249 long long value2 = op2->i64;
10252 exp->string = PrintInt64(op1->i64 <= value2);
10255 exp->expType = op1->type;
10257 op1->type->refCount++;
10262 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10264 uint64 value2 = op2->ui64;
10267 exp->string = PrintUInt64(op1->ui64 <= value2);
10270 exp->expType = op1->type;
10272 op1->type->refCount++;
10277 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10279 short value2 = op2->s;
10282 exp->string = PrintShort(op1->s <= value2);
10285 exp->expType = op1->type;
10287 op1->type->refCount++;
10292 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10294 unsigned short value2 = op2->us;
10297 exp->string = PrintUShort(op1->us <= value2);
10300 exp->expType = op1->type;
10302 op1->type->refCount++;
10307 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10309 char value2 = op2->c;
10312 exp->string = PrintChar(op1->c <= value2);
10315 exp->expType = op1->type;
10317 op1->type->refCount++;
10322 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10324 unsigned char value2 = op2->uc;
10327 exp->string = PrintUChar(op1->uc <= value2);
10330 exp->expType = op1->type;
10332 op1->type->refCount++;
10337 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10339 float value2 = op2->f;
10342 exp->string = PrintFloat(op1->f <= value2);
10345 exp->expType = op1->type;
10347 op1->type->refCount++;
10352 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10354 double value2 = op2->d;
10357 exp->string = PrintDouble(op1->d <= value2);
10360 exp->expType = op1->type;
10362 op1->type->refCount++;
10367 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10370 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10373 exp->expType = op1->type;
10375 op1->type->refCount++;
10380 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10383 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10386 exp->expType = op1->type;
10388 op1->type->refCount++;
10393 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10396 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10399 exp->expType = op1->type;
10401 op1->type->refCount++;
10406 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10409 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10412 exp->expType = op1->type;
10414 op1->type->refCount++;
10419 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10422 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10425 exp->expType = op1->type;
10427 op1->type->refCount++;
10432 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10435 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10438 exp->expType = op1->type;
10440 op1->type->refCount++;
10445 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10448 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10451 exp->expType = op1->type;
10453 op1->type->refCount++;
10458 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10461 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10464 exp->expType = op1->type;
10466 op1->type->refCount++;
10471 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10474 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10477 exp->expType = op1->type;
10479 op1->type->refCount++;
10484 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10487 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10490 exp->expType = op1->type;
10492 op1->type->refCount++;
10497 struct OpTable intOps =
10499 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
10502 struct OpTable uintOps =
10504 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
10507 struct OpTable int64Ops =
10509 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
10512 struct OpTable uint64Ops =
10514 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
10517 struct OpTable shortOps =
10519 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
10522 struct OpTable ushortOps =
10524 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
10527 struct OpTable floatOps =
10529 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
10532 struct OpTable doubleOps =
10534 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
10537 struct OpTable charOps =
10539 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
10542 struct OpTable ucharOps =
10544 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
10547 void ReadString(char * output, char * string)
10549 int len = strlen(string);
10551 unsigned int quoted = 0x0, escaped = 0x0;
10553 for(c = 0; c < len; c++)
10555 char ch = string[c];
10613 int UnescapeString(char * d, char * s, int len)
10618 while(j < len && (ch = s[j]))
10623 switch((ch = s[++j]))
10669 char * OffsetEscapedString(char * s, int len, int offset)
10674 while(j < len && k < offset && (ch = s[j]))
10680 return (k == offset) ? s + j : (((void *)0));
10683 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10685 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10687 extern double strtod(char * , char * * );
10689 extern float (* __ecereMethod_float_inf)(void);
10691 extern float (* __ecereMethod_float_nan)(void);
10693 extern double (* __ecereMethod_double_inf)(void);
10695 extern double (* __ecereMethod_double_nan)(void);
10697 struct Operand GetOperand(struct Expression * exp)
10699 struct Operand op =
10703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10706 struct Type * type = exp->expType;
10710 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10712 if(!type->_class->registered->dataType)
10713 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10714 type = type->_class->registered->dataType;
10716 if(exp->type == 3 && op.kind == 13)
10718 op.ui64 = (uint64)exp->string;
10720 op.ops = uint64Ops;
10722 else if(exp->isConstant && exp->type == 2)
10724 op.kind = type->kind;
10725 op.type = exp->expType;
10731 if(exp->constant[0] == '\'')
10733 op.c = exp->constant[1];
10736 else if(type->isSigned)
10738 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10743 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10751 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10756 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10757 op.ops = ushortOps;
10764 op.i = strtol(exp->constant, (((void *)0)), 0);
10769 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10777 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10782 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10783 op.ops = uint64Ops;
10790 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10795 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10796 op.ops = uint64Ops;
10803 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10808 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10809 op.ops = uint64Ops;
10814 if(!strcmp(exp->constant, "inf"))
10815 op.f = __ecereMethod_float_inf();
10816 else if(!strcmp(exp->constant, "-inf"))
10817 op.f = -__ecereMethod_float_inf();
10818 else if(!strcmp(exp->constant, "nan"))
10819 op.f = __ecereMethod_float_nan();
10820 else if(!strcmp(exp->constant, "-nan"))
10821 op.f = -__ecereMethod_float_nan();
10823 op.f = (float)strtod(exp->constant, (((void *)0)));
10827 if(!strcmp(exp->constant, "inf"))
10828 op.d = __ecereMethod_double_inf();
10829 else if(!strcmp(exp->constant, "-inf"))
10830 op.d = -__ecereMethod_double_inf();
10831 else if(!strcmp(exp->constant, "nan"))
10832 op.d = __ecereMethod_double_nan();
10833 else if(!strcmp(exp->constant, "-nan"))
10834 op.d = -__ecereMethod_double_nan();
10836 op.d = (double)strtod(exp->constant, (((void *)0)));
10837 op.ops = doubleOps;
10842 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10844 op.ops = uint64Ops;
10852 int __ecereVMethodID_class_OnGetString;
10854 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10856 static void UnusedFunction()
10860 ((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);
10863 extern int __ecereVMethodID_class_OnGetString;
10865 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10867 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10869 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10871 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10872 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10875 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10876 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10877 struct Type * type;
10878 void * ptr = inst->data + dataMember->offset + offset;
10879 char * result = (((void *)0));
10881 exp->loc = member->loc = inst->loc;
10882 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10883 if(!dataMember->dataType)
10884 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10885 type = dataMember->dataType;
10886 if(type->kind == 8)
10888 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10890 if(_class->type == 4)
10892 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10896 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10897 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10899 for(item = e->values.first; item; item = item->next)
10901 if((int)item->data == *(int *)ptr)
10903 result = item->name;
10909 exp->identifier = MkIdentifier(result);
10911 exp->destType = MkClassType(_class->fullName);
10912 ProcessExpressionType(exp);
10916 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10918 if(!_class->dataType)
10919 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10920 type = _class->dataType;
10929 FreeExpContents(exp);
10930 exp->constant = PrintFloat(*(float *)ptr);
10936 FreeExpContents(exp);
10937 exp->constant = PrintDouble(*(double *)ptr);
10943 FreeExpContents(exp);
10944 exp->constant = PrintInt(*(int *)ptr);
10950 FreeExpContents(exp);
10951 exp->constant = PrintInt64(*(long long *)ptr);
10957 FreeExpContents(exp);
10958 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10964 FreeExpContents(exp);
10965 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10970 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10973 ListAdd(memberList, member);
10975 if(parentDataMember->type == 1)
10980 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10982 void PopulateInstance(struct Instantiation * inst)
10984 struct Symbol * classSym = inst->_class->symbol;
10985 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10986 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10987 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10990 inst->members = MkListOne(MkMembersInitList(memberList));
10992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10993 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10995 if(!dataMember->isProperty)
10997 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10998 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11001 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11002 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11003 struct Type * type;
11004 void * ptr = inst->data + dataMember->offset;
11005 char * result = (((void *)0));
11007 exp->loc = member->loc = inst->loc;
11008 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11009 if(!dataMember->dataType)
11010 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11011 type = dataMember->dataType;
11012 if(type->kind == 8)
11014 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11016 if(_class->type == 4)
11018 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11022 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11023 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11025 for(item = e->values.first; item; item = item->next)
11027 if((int)item->data == *(int *)ptr)
11029 result = item->name;
11036 exp->identifier = MkIdentifier(result);
11038 exp->destType = MkClassType(_class->fullName);
11039 ProcessExpressionType(exp);
11042 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11044 if(!_class->dataType)
11045 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11046 type = _class->dataType;
11055 exp->constant = PrintFloat(*(float *)ptr);
11061 exp->constant = PrintDouble(*(double *)ptr);
11067 exp->constant = PrintInt(*(int *)ptr);
11073 exp->constant = PrintInt64(*(long long *)ptr);
11079 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11087 ListAdd(memberList, member);
11093 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);
11095 extern void FreeInstance(struct Instantiation * inst);
11097 void ComputeInstantiation(struct Expression * exp)
11099 struct Instantiation * inst = exp->instance;
11100 struct MembersInit * members;
11101 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11102 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11103 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11104 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11105 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11106 int subMemberStackPos = 0;
11109 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11113 if(_class->type == 0 || _class->type == 5)
11115 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11116 if(_class->type == 0)
11117 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11120 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11124 for(members = (*inst->members).first; members; members = members->next)
11126 switch(members->type)
11130 if(members->dataMembers)
11132 struct MemberInit * member;
11134 for(member = (*members->dataMembers).first; member; member = member->next)
11136 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11137 unsigned int found = 0x0;
11138 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11139 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11140 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11141 unsigned int dataMemberOffset;
11145 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11148 if(curMember->isProperty)
11149 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11152 dataMember = curMember;
11153 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11154 if(_class->type == 0)
11155 dataMemberOffset += _class->base->structSize;
11162 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11166 if(prop->memberAccess == 1)
11168 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11169 curClass = prop->_class;
11174 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11175 int _subMemberStackPos = 0;
11177 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11181 if(dataMember->memberAccess == 1)
11183 curMember = dataMember;
11184 curClass = dataMember->_class;
11185 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11186 subMemberStackPos = _subMemberStackPos;
11191 if(found && member->initializer && member->initializer->type == 0)
11193 struct Expression * value = member->initializer->exp;
11194 struct Type * type = (((void *)0));
11195 unsigned int deepMember = 0x0;
11199 type = prop->dataType;
11201 else if(dataMember)
11203 if(!dataMember->dataType)
11204 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11205 type = dataMember->dataType;
11207 if(ident && ident->next)
11210 for(ident = ident->next; ident && type; ident = ident->next)
11212 if(type->kind == 8)
11214 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11216 type = prop->dataType;
11219 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11221 type = dataMember->dataType;
11224 else if(type->kind == 9 || type->kind == 10)
11226 struct Type * memberType;
11228 for(memberType = type->members.first; memberType; memberType = memberType->next)
11230 if(!strcmp(memberType->name, ident->string))
11241 FreeType(value->destType);
11242 value->destType = type;
11245 ComputeExpression(value);
11247 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11249 if(type->kind == 8)
11251 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11253 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11255 if(!_class->dataType)
11256 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11257 type = _class->dataType;
11262 void * ptr = inst->data + dataMemberOffset;
11264 if(value->type == 2)
11270 GetInt(value, (int *)ptr);
11275 GetInt64(value, (long long *)ptr);
11280 GetIntPtr(value, (intptr_t *)ptr);
11285 GetIntSize(value, (ssize_t *)ptr);
11290 GetFloat(value, (float *)ptr);
11295 GetDouble(value, (double *)ptr);
11300 else if(value->type == 1)
11302 if(type->kind == 8)
11304 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11306 if(_class->type == 1)
11308 ComputeTypeSize(type);
11309 if(value->instance->data)
11310 memcpy(ptr, value->instance->data, type->size);
11317 if(value->type == 1 && value->instance->data)
11319 if(type->kind == 8)
11321 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11323 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)))
11325 void (* Set)(void *, void *) = (void *)prop->Set;
11327 Set(inst->data, value->instance->data);
11328 PopulateInstance(inst);
11332 else if(value->type == 2)
11338 void (* Set)(void *, double) = (void *)prop->Set;
11340 Set(inst->data, strtod(value->constant, (((void *)0))));
11345 void (* Set)(void *, float) = (void *)prop->Set;
11347 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11352 void (* Set)(void *, int) = (void *)prop->Set;
11354 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11359 void (* Set)(void *, long long) = (void *)prop->Set;
11361 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11366 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11368 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11373 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11375 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11380 else if(value->type == 3)
11384 ReadString(temp, value->string);
11385 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11389 else if(!deepMember && type && _class->type == 3)
11393 if(value->type == 2)
11395 if(type->kind == 8)
11397 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11399 if(_class->type == 3)
11401 if(!_class->dataType)
11402 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11403 type = _class->dataType;
11411 float (* Set)(float) = (void *)prop->Set;
11413 GetFloat(member->initializer->exp, &fValue);
11414 exp->constant = PrintFloat(Set(fValue));
11421 double (* Set)(double) = (void *)prop->Set;
11423 GetDouble(member->initializer->exp, &dValue);
11424 exp->constant = PrintDouble(Set(dValue));
11432 else if(!deepMember && type && _class->type == 2)
11436 if(value->type == 1 && value->instance->data)
11438 unsigned int (* Set)(void *) = (void *)prop->Set;
11440 bits = Set(value->instance->data);
11442 else if(value->type == 2)
11446 else if(dataMember)
11448 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11449 struct Type * type;
11452 GetInt(value, &part);
11453 bits = (bits & ~bitMember->mask);
11454 if(!bitMember->dataType)
11455 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11456 type = bitMember->dataType;
11457 if(type->kind == 8 && type->_class && type->_class->registered)
11459 if(!type->_class->registered->dataType)
11460 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11461 type = type->_class->registered->dataType;
11468 bits |= ((char)part << bitMember->pos);
11470 bits |= ((unsigned char)part << bitMember->pos);
11474 bits |= ((short)part << bitMember->pos);
11476 bits |= ((unsigned short)part << bitMember->pos);
11481 bits |= (part << bitMember->pos);
11483 bits |= ((unsigned int)part << bitMember->pos);
11487 bits |= ((long long)part << bitMember->pos);
11489 bits |= ((uint64)part << bitMember->pos);
11494 bits |= ((intptr_t)part << bitMember->pos);
11498 bits |= ((uintptr_t)part << bitMember->pos);
11504 bits |= ((ssize_t)part << bitMember->pos);
11508 bits |= ((size_t)part << bitMember->pos);
11517 if(_class && _class->type == 3)
11519 ComputeExpression(member->initializer->exp);
11520 exp->constant = member->initializer->exp->constant;
11522 member->initializer->exp->constant = (((void *)0));
11532 if(_class && _class->type == 2)
11534 exp->constant = PrintHexUInt(bits);
11539 FreeInstance(inst);
11543 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11545 unsigned int result = 0x0;
11550 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11551 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11555 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11556 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11559 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)
11560 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11563 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)
11564 result = GetOpFloat(op, &op->f);
11567 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)
11568 result = GetOpDouble(op, &op->d);
11571 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)
11572 result = GetOpUIntPtr(op, &op->ui64);
11575 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)
11576 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11579 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11580 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11583 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11584 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11590 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11592 if(exp->op.op == SIZEOF)
11594 FreeExpContents(exp);
11596 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11606 struct Expression * exp2 = exp->op.exp2;
11608 exp->op.exp2 = (((void *)0));
11609 FreeExpContents(exp);
11610 FreeType(exp->expType);
11611 FreeType(exp->destType);
11613 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11619 FreeExpContents(exp);
11620 op1->ops.Neg(exp, op1);
11624 if(op1->ops.BitNot)
11626 FreeExpContents(exp);
11627 op1->ops.BitNot(exp, op1);
11633 FreeExpContents(exp);
11634 op1->ops.Not(exp, op1);
11641 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11643 if(Promote(op2, op1->kind, op1->type->isSigned))
11644 op2->kind = op1->kind, op2->ops = op1->ops;
11645 else if(Promote(op1, op2->kind, op2->type->isSigned))
11646 op1->kind = op2->kind, op1->ops = op2->ops;
11653 FreeExpContents(exp);
11654 op1->ops.Add(exp, op1, op2);
11660 FreeExpContents(exp);
11661 op1->ops.Sub(exp, op1, op2);
11667 FreeExpContents(exp);
11668 op1->ops.Mul(exp, op1, op2);
11674 FreeExpContents(exp);
11675 op1->ops.Div(exp, op1, op2);
11681 FreeExpContents(exp);
11682 op1->ops.Mod(exp, op1, op2);
11688 if(op1->ops.BitAnd)
11690 FreeExpContents(exp);
11691 op1->ops.BitAnd(exp, op1, op2);
11698 FreeExpContents(exp);
11699 op1->ops.BitOr(exp, op1, op2);
11703 if(op1->ops.BitXor)
11705 FreeExpContents(exp);
11706 op1->ops.BitXor(exp, op1, op2);
11710 if(op1->ops.LShift)
11712 FreeExpContents(exp);
11713 op1->ops.LShift(exp, op1, op2);
11717 if(op1->ops.RShift)
11719 FreeExpContents(exp);
11720 op1->ops.RShift(exp, op1, op2);
11726 FreeExpContents(exp);
11727 op1->ops.Equ(exp, op1, op2);
11733 FreeExpContents(exp);
11734 op1->ops.Nqu(exp, op1, op2);
11740 FreeExpContents(exp);
11741 op1->ops.And(exp, op1, op2);
11747 FreeExpContents(exp);
11748 op1->ops.Or(exp, op1, op2);
11754 FreeExpContents(exp);
11755 op1->ops.Grt(exp, op1, op2);
11761 FreeExpContents(exp);
11762 op1->ops.Sma(exp, op1, op2);
11766 if(op1->ops.GrtEqu)
11768 FreeExpContents(exp);
11769 op1->ops.GrtEqu(exp, op1, op2);
11773 if(op1->ops.SmaEqu)
11775 FreeExpContents(exp);
11776 op1->ops.SmaEqu(exp, op1, op2);
11784 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11786 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11788 void ComputeExpression(struct Expression * exp)
11790 char expString[10240];
11792 expString[0] = '\0';
11797 ComputeInstantiation(exp);
11802 struct Expression * exp1, * exp2 = (((void *)0));
11803 struct Operand op1 =
11807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11810 struct Operand op2 =
11814 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11820 struct Expression * e = exp->op.exp2;
11822 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11824 if(e->type == 5 || e->type == 32 || e->type == 23)
11827 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11829 e = (*e->list).last;
11832 if(exp->op.op == 261 && e && e->expType)
11834 if(e->type == 3 && e->string)
11836 char * string = e->string;
11837 int len = strlen(string);
11838 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11840 len = UnescapeString(tmp, string + 1, len - 2);
11841 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11842 FreeExpContents(exp);
11844 exp->constant = PrintUInt(len + 1);
11848 struct Type * type = e->expType;
11851 FreeExpContents(exp);
11853 exp->constant = PrintUInt(ComputeTypeSize(type));
11859 ComputeExpression(exp->op.exp2);
11863 ComputeExpression(exp->op.exp1);
11864 exp1 = exp->op.exp1;
11865 exp2 = exp->op.exp2;
11866 op1 = GetOperand(exp1);
11868 op1.type->refCount++;
11871 op2 = GetOperand(exp2);
11873 op2.type->refCount++;
11878 exp1 = exp->op.exp2;
11879 op1 = GetOperand(exp1);
11881 op1.type->refCount++;
11883 CallOperator(exp, exp1, exp2, &op1, &op2);
11885 FreeType(op1.type);
11887 FreeType(op2.type);
11893 struct Expression * e, * n;
11895 for(e = (*exp->list).first; e; e = n)
11900 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11902 ComputeExpression(e);
11903 FreeType(exp->expType);
11904 FreeType(exp->destType);
11906 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11907 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11918 struct Expression * memberExp = exp->member.exp;
11919 struct Identifier * memberID = exp->member.member;
11920 struct Type * type;
11922 ComputeExpression(exp->member.exp);
11923 type = exp->member.exp->expType;
11926 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)));
11927 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11928 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11929 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11931 if(type->kind == 19 && exp->member.exp->type == 24)
11932 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11936 struct Symbol * classSym;
11939 PrintTypeNoConst(type, string, 0x0, 0x1);
11940 classSym = FindClass(string);
11941 _class = classSym ? classSym->registered : (((void *)0));
11943 if(exp->member.member)
11945 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11947 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11949 if(!prop && !member && _class && exp->member.member)
11951 struct Symbol * classSym = FindClass(exp->member.member->string);
11953 convertTo = _class;
11954 _class = classSym ? classSym->registered : (((void *)0));
11955 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11961 struct Type * type = prop->dataType;
11963 if(_class->type == 3)
11965 if(type->kind == 8)
11967 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11969 if(_class->type == 3)
11971 if(!_class->dataType)
11972 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11973 type = _class->dataType;
11981 float (* Get)(float) = (void *)prop->Get;
11983 GetFloat(exp->member.exp, &value);
11984 exp->constant = PrintFloat(Get ? Get(value) : value);
11991 double (* Get)(double);
11993 GetDouble(exp->member.exp, &value);
11995 Get = (void *)prop->Set;
11997 Get = (void *)prop->Get;
11998 exp->constant = PrintDouble(Get ? Get(value) : value);
12008 struct Expression * value = exp->member.exp;
12009 struct Type * type;
12011 if(!prop->dataType)
12012 ProcessPropertyType(prop);
12013 type = prop->dataType;
12017 else if(_class->type == 1)
12023 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12025 if(propertyClass->type == 1 && value->type == 1)
12027 void (* Set)(void *, void *) = (void *)prop->Set;
12029 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12030 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12031 exp->instance->_class = MkSpecifierName(_class->fullName);
12032 exp->instance->loc = exp->loc;
12034 Set(exp->instance->data, value->instance->data);
12035 PopulateInstance(exp->instance);
12042 void (* Set)(void *, int) = (void *)prop->Set;
12044 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12045 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12046 exp->instance->_class = MkSpecifierName(_class->fullName);
12047 exp->instance->loc = exp->loc;
12049 GetInt(value, &intValue);
12050 Set(exp->instance->data, intValue);
12051 PopulateInstance(exp->instance);
12056 long long intValue;
12057 void (* Set)(void *, long long) = (void *)prop->Set;
12059 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12060 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12061 exp->instance->_class = MkSpecifierName(_class->fullName);
12062 exp->instance->loc = exp->loc;
12064 GetInt64(value, &intValue);
12065 Set(exp->instance->data, intValue);
12066 PopulateInstance(exp->instance);
12072 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12074 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12075 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12076 exp->instance->_class = MkSpecifierName(_class->fullName);
12077 exp->instance->loc = exp->loc;
12079 GetIntPtr(value, &intValue);
12080 Set(exp->instance->data, intValue);
12081 PopulateInstance(exp->instance);
12087 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12089 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12090 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12091 exp->instance->_class = MkSpecifierName(_class->fullName);
12092 exp->instance->loc = exp->loc;
12094 GetIntSize(value, &intValue);
12095 Set(exp->instance->data, intValue);
12096 PopulateInstance(exp->instance);
12102 void (* Set)(void *, float) = (void *)prop->Set;
12104 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12105 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12106 exp->instance->_class = MkSpecifierName(_class->fullName);
12107 exp->instance->loc = exp->loc;
12109 GetFloat(value, &floatValue);
12110 Set(exp->instance->data, floatValue);
12111 PopulateInstance(exp->instance);
12116 double doubleValue;
12117 void (* Set)(void *, double) = (void *)prop->Set;
12119 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12120 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12121 exp->instance->_class = MkSpecifierName(_class->fullName);
12122 exp->instance->loc = exp->loc;
12124 GetDouble(value, &doubleValue);
12125 Set(exp->instance->data, doubleValue);
12126 PopulateInstance(exp->instance);
12131 else if(_class->type == 2)
12137 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12139 if(propertyClass->type == 1 && value->instance->data)
12141 unsigned int (* Set)(void *) = (void *)prop->Set;
12142 unsigned int bits = Set(value->instance->data);
12144 exp->constant = PrintHexUInt(bits);
12148 else if(_class->type == 2)
12150 unsigned int value;
12151 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12154 GetUInt(exp->member.exp, &value);
12156 exp->constant = PrintHexUInt(bits);
12165 if(_class->type == 2)
12167 unsigned int value;
12169 GetUInt(exp->member.exp, &value);
12174 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12176 if(_class->type == 1)
12178 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12180 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12181 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12182 exp->instance->_class = MkSpecifierName(_class->fullName);
12183 exp->instance->loc = exp->loc;
12185 Get(value, exp->instance->data);
12186 PopulateInstance(exp->instance);
12188 else if(_class->type == 2)
12190 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12191 uint64 bits = Get(value);
12193 exp->constant = PrintHexUInt64(bits);
12200 else if(_class->type == 1)
12202 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12208 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12210 if(_class->type == 1 && value)
12212 void (* Get)(void *, void *) = (void *)prop->Get;
12214 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12215 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12216 exp->instance->_class = MkSpecifierName(_class->fullName);
12217 exp->instance->loc = exp->loc;
12219 Get(value, exp->instance->data);
12220 PopulateInstance(exp->instance);
12231 exp->isConstant = 0x0;
12240 FreeExpression(memberExp);
12241 FreeIdentifier(memberID);
12247 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12249 FreeExpContents(exp);
12250 exp->constant = PrintUInt(ComputeTypeSize(type));
12257 struct Symbol * classSym = exp->_class->symbol;
12259 if(classSym && classSym->registered)
12261 if(classSym->registered->fixed)
12263 FreeSpecifier(exp->_class);
12264 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12269 char className[1024];
12271 strcpy(className, "__ecereClass_");
12272 FullClassNameCat(className, classSym->string, 0x1);
12273 MangleClassName(className);
12274 DeclareClass(classSym, className);
12275 FreeExpContents(exp);
12277 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12278 exp->member.member = MkIdentifier("structSize");
12285 struct Type * type;
12286 struct Expression * e = exp;
12288 if(exp->type == 11)
12291 ComputeExpression(exp->cast.exp);
12294 if(e && exp->expType)
12296 type = exp->expType;
12297 if(type->kind == 8)
12299 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12301 if(_class && (_class->type == 3 || _class->type == 2))
12303 if(!_class->dataType)
12304 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12305 type = _class->dataType;
12314 char value = (char)0;
12316 if(GetChar(e, &value))
12318 FreeExpContents(exp);
12319 exp->constant = PrintChar(value);
12325 unsigned char value = (unsigned char)0;
12327 if(GetUChar(e, &value))
12329 FreeExpContents(exp);
12330 exp->constant = PrintUChar(value);
12338 short value = (short)0;
12340 if(GetShort(e, &value))
12342 FreeExpContents(exp);
12343 exp->constant = PrintShort(value);
12349 unsigned short value = (unsigned short)0;
12351 if(GetUShort(e, &value))
12353 FreeExpContents(exp);
12354 exp->constant = PrintUShort(value);
12364 if(GetInt(e, &value))
12366 FreeExpContents(exp);
12367 exp->constant = PrintInt(value);
12373 unsigned int value = 0;
12375 if(GetUInt(e, &value))
12377 FreeExpContents(exp);
12378 exp->constant = PrintUInt(value);
12386 long long value = 0;
12388 if(GetInt64(e, &value))
12390 FreeExpContents(exp);
12391 exp->constant = PrintInt64(value);
12399 if(GetUInt64(e, &value))
12401 FreeExpContents(exp);
12402 exp->constant = PrintUInt64(value);
12410 intptr_t value = 0;
12412 if(GetIntPtr(e, &value))
12414 FreeExpContents(exp);
12415 exp->constant = PrintInt64((long long)value);
12421 uintptr_t value = 0;
12423 if(GetUIntPtr(e, &value))
12425 FreeExpContents(exp);
12426 exp->constant = PrintUInt64((uint64)value);
12436 if(GetIntSize(e, &value))
12438 FreeExpContents(exp);
12439 exp->constant = PrintInt64((long long)value);
12447 if(GetUIntSize(e, &value))
12449 FreeExpContents(exp);
12450 exp->constant = PrintUInt64((uint64)value);
12459 if(GetFloat(e, &value))
12461 FreeExpContents(exp);
12462 exp->constant = PrintFloat(value);
12471 if(GetDouble(e, &value))
12473 FreeExpContents(exp);
12474 exp->constant = PrintDouble(value);
12485 struct Operand op1 =
12489 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12492 struct Operand op2 =
12496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12499 struct Operand op3 =
12503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12508 ComputeExpression((*exp->cond.exp).last);
12509 if(exp->cond.elseExp)
12510 ComputeExpression(exp->cond.elseExp);
12512 ComputeExpression(exp->cond.cond);
12513 op1 = GetOperand(exp->cond.cond);
12515 op1.type->refCount++;
12516 op2 = GetOperand((*exp->cond.exp).last);
12518 op2.type->refCount++;
12519 op3 = GetOperand(exp->cond.elseExp);
12521 op3.type->refCount++;
12524 FreeExpContents(exp);
12525 op1.ops.Cond(exp, &op1, &op2, &op3);
12528 FreeType(op1.type);
12530 FreeType(op2.type);
12532 FreeType(op3.type);
12538 void ApplyAnyObjectLogic(struct Expression * e);
12540 extern void CopyTypeInto(struct Type * type, struct Type * src);
12542 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12544 unsigned int result = 0x1;
12548 struct __ecereNameSpace__ecere__sys__OldList converts =
12552 struct Conversion * convert;
12554 if(destType->kind == 0)
12556 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12560 for(convert = converts.first; convert; convert = convert->next)
12562 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12566 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12567 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12570 newExp->destType = (((void *)0));
12574 exp->addedThis = 0x1;
12575 exp->member.exp = newExp;
12576 FreeType(exp->member.exp->expType);
12577 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12578 exp->member.exp->expType->classObjectType = objectType;
12579 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12580 exp->member.memberType = 1;
12581 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12582 exp->needCast = 0x1;
12584 exp->expType->refCount++;
12585 ApplyAnyObjectLogic(exp->member.exp);
12591 exp->addedThis = 0x1;
12592 exp->member.exp = newExp;
12593 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12595 newExp->byReference = 0x1;
12597 FreeType(exp->member.exp->expType);
12598 exp->member.exp->expType = (((void *)0));
12599 if(convert->convert->dataType)
12601 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12602 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12603 exp->member.exp->expType->refCount = 1;
12604 exp->member.exp->expType->classObjectType = objectType;
12605 ApplyAnyObjectLogic(exp->member.exp);
12607 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12608 exp->member.memberType = 4;
12609 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12610 exp->needCast = 0x1;
12611 if(convert->resultType)
12612 convert->resultType->refCount++;
12618 FreeType(exp->expType);
12621 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12622 exp->needCast = 0x1;
12624 exp->expType->refCount++;
12628 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12629 exp->needCast = 0x1;
12630 if(convert->resultType)
12631 convert->resultType->refCount++;
12635 if(exp->isConstant && inCompiler)
12636 ComputeExpression(exp);
12637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12639 if(!result && exp->expType && converts.count)
12641 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12643 if(!result && exp->expType && exp->destType)
12645 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))
12652 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12654 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12656 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12658 void CheckTemplateTypes(struct Expression * exp)
12660 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12662 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12663 struct Statement * compound;
12664 struct Context * context;
12668 exp->destType->refCount++;
12670 exp->expType->refCount++;
12671 newExp->prev = (((void *)0));
12672 newExp->next = (((void *)0));
12673 switch(exp->expType->kind)
12676 if(exp->destType->classObjectType)
12679 exp->destType->refCount--;
12681 exp->expType->refCount--;
12682 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12686 struct __ecereNameSpace__ecere__sys__OldList * specs;
12687 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12688 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12690 context = PushContext();
12691 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12692 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12693 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12695 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12696 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12697 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12698 exp->compound->compound.context = context;
12699 PopContext(context);
12704 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12705 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12709 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12711 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12712 struct Statement * compound;
12713 struct Context * context;
12717 exp->destType->refCount++;
12719 exp->expType->refCount++;
12720 newExp->prev = (((void *)0));
12721 newExp->next = (((void *)0));
12722 switch(exp->expType->kind)
12725 if(exp->destType->classObjectType)
12728 exp->destType->refCount--;
12730 exp->expType->refCount--;
12731 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12735 struct __ecereNameSpace__ecere__sys__OldList * specs;
12736 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12737 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12739 context = PushContext();
12740 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12741 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12742 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12744 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12745 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12746 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12747 exp->compound->compound.context = context;
12748 PopContext(context);
12753 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12756 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12757 ProcessExpressionType((*exp->list).first);
12763 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12764 newExp->needCast = 0x1;
12765 ProcessExpressionType((*exp->list).first);
12771 if(exp->expType->kind == 20)
12773 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12777 FreeType(exp->destType);
12778 FreeType(exp->expType);
12779 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12783 if(newExp->type == 8 && newExp->member.memberType == 3)
12787 exp->op.exp1 = (((void *)0));
12788 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12792 char typeString[1024];
12793 struct Declarator * decl;
12794 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12796 typeString[0] = '\0';
12797 PrintType(exp->expType, typeString, 0x0, 0x0);
12798 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12800 exp->cast.typeName = MkTypeName(specs, decl);
12801 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12802 exp->cast.exp->needCast = 0x1;
12810 extern int strncmp(const char * , const char * , size_t n);
12812 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12814 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12816 int nsLen = strlen(nameSpace);
12817 struct Symbol * symbol;
12819 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)))
12821 char * s = symbol->string;
12823 if(!strncmp(s, nameSpace, nsLen))
12828 for(c = strlen(s) - 1; c >= 0; c--)
12831 namePart = s + c + 1;
12832 if(!strcmp(namePart, name))
12840 return (((void *)0));
12843 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12846 char nameSpace[1024];
12848 unsigned int gotColon = 0x0;
12850 nameSpace[0] = '\0';
12851 for(c = strlen(name) - 1; c >= 0; c--)
12857 namePart = name + c + 1;
12858 while(c >= 0 && name[c] == ':')
12862 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12866 memcpy(nameSpace, name, c + 1);
12867 nameSpace[c + 1] = (char)0;
12868 return ScanWithNameSpace(tree, nameSpace, namePart);
12872 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12878 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12882 return ScanWithNameSpace(tree, "", namePart);
12884 return (((void *)0));
12887 static void ProcessDeclaration(struct Declaration * decl);
12889 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12891 struct Context * ctx;
12892 struct Symbol * symbol = (((void *)0));
12894 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12896 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12898 symbol = (((void *)0));
12901 char curName[1024];
12903 strcpy(curName, thisNameSpace);
12904 strcat(curName, "::");
12905 strcat(curName, name);
12906 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12909 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12912 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12913 if(symbol || ctx == endContext)
12916 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12918 if(symbol->pointerExternal->type == 0)
12920 struct FunctionDefinition * function = symbol->pointerExternal->function;
12921 struct Context * tmpContext = curContext;
12923 curContext = (((void *)0));
12924 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12925 curContext = tmpContext;
12926 symbol->pointerExternal->symbol = symbol;
12927 DeclareType(symbol->type, 0x1, 0x1);
12928 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12929 symbol->id = curExternal->symbol->idCode;
12931 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12934 symbol->id = curExternal->symbol->idCode;
12940 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12942 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12943 ListAdd(specs, MkSpecifier(UNSIGNED));
12948 if(type->_class->registered)
12950 if(!type->_class->registered->dataType)
12951 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12952 GetTypeSpecs(type->_class->registered->dataType, specs);
12957 ListAdd(specs, MkSpecifier(DOUBLE));
12960 ListAdd(specs, MkSpecifier(FLOAT));
12963 ListAdd(specs, MkSpecifier(CHAR));
12966 ListAdd(specs, MkSpecifier(_BOOL));
12969 ListAdd(specs, MkSpecifier(SHORT));
12972 ListAdd(specs, MkSpecifier(INT64));
12975 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12978 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12982 ListAdd(specs, MkSpecifier(INT));
12987 static void PrintArraySize(struct Type * arrayType, char * string)
12993 if(arrayType->enumClass)
12994 strcat(size, arrayType->enumClass->string);
12995 else if(arrayType->arraySizeExp)
12996 PrintExpression(arrayType->arraySizeExp, size);
12998 strcat(string, size);
13001 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13005 if(printConst && type->constant)
13006 strcat(string, "const ");
13011 struct Symbol * c = type->_class;
13013 if(type->classObjectType == 2)
13014 strcat(string, "typed_object");
13015 else if(type->classObjectType == 3)
13016 strcat(string, "any_object");
13020 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13022 if(type->byReference)
13023 strcat(string, " &");
13027 strcat(string, "void");
13030 strcat(string, type->isSigned ? "int" : "uint");
13033 strcat(string, type->isSigned ? "int64" : "uint64");
13036 strcat(string, type->isSigned ? "intptr" : "uintptr");
13039 strcat(string, type->isSigned ? "intsize" : "uintsize");
13042 strcat(string, type->isSigned ? "char" : "byte");
13045 strcat(string, "_Bool");
13048 strcat(string, type->isSigned ? "short" : "uint16");
13051 strcat(string, "float");
13054 strcat(string, "double");
13059 strcat(string, "struct ");
13060 strcat(string, type->enumName);
13062 else if(type->typeName)
13063 strcat(string, type->typeName);
13066 struct Type * member;
13068 strcat(string, "struct { ");
13069 for(member = type->members.first; member; member = member->next)
13071 PrintType(member, string, 0x1, fullName);
13072 strcat(string, "; ");
13074 strcat(string, "}");
13080 strcat(string, "union ");
13081 strcat(string, type->enumName);
13083 else if(type->typeName)
13084 strcat(string, type->typeName);
13087 strcat(string, "union ");
13088 strcat(string, "(unnamed)");
13094 strcat(string, "enum ");
13095 strcat(string, type->enumName);
13097 else if(type->typeName)
13098 strcat(string, type->typeName);
13100 strcat(string, "int");
13103 strcat(string, "...");
13106 strcat(string, "subclass(");
13107 strcat(string, type->_class ? type->_class->string : "int");
13108 strcat(string, ")");
13111 strcat(string, type->templateParameter->identifier->string);
13114 strcat(string, "thisclass");
13117 strcat(string, "__builtin_va_list");
13123 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13125 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13127 if(type->name && type->name[0])
13130 strcat(string, type->name);
13133 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13139 strcat(string, name);
13144 static void PrintAttribs(struct Type * type, char * string)
13148 if(type->dllExport)
13149 strcat(string, "dllexport ");
13150 if(type->attrStdcall)
13151 strcat(string, "stdcall ");
13155 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13157 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13159 struct Type * attrType = (((void *)0));
13161 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13162 PrintAttribs(type, string);
13163 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13164 strcat(string, " const");
13165 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13166 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13167 strcat(string, " (");
13168 if(type->kind == 13)
13170 if(type->type->kind == 11 || type->type->kind == 16)
13171 PrintAttribs(type->type, string);
13173 if(type->kind == 13)
13175 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13176 strcat(string, "*");
13178 strcat(string, " *");
13180 if(printConst && type->constant && type->kind == 13)
13181 strcat(string, " const");
13184 PrintTypeSpecs(type, string, fullName, printConst);
13187 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13189 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13190 strcat(string, ")");
13191 if(type->kind == 12)
13192 PrintArraySize(type, string);
13193 else if(type->kind == 11)
13195 struct Type * param;
13197 strcat(string, "(");
13198 for(param = type->params.first; param; param = param->next)
13200 PrintType(param, string, 0x1, fullName);
13202 strcat(string, ", ");
13204 strcat(string, ")");
13206 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13207 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13210 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13212 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13213 if(type->thisClass || (printName && type->name && type->name[0]))
13214 strcat(string, " ");
13215 if((type->thisClass || type->staticMethod))
13217 struct Symbol * _class = type->thisClass;
13219 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13221 if(type->classObjectType == 1)
13222 strcat(string, "class");
13224 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13226 else if(_class && _class->string)
13228 char * s = _class->string;
13234 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13240 strcat(string, name);
13243 strcat(string, "::");
13245 if(printName && type->name)
13246 PrintName(type, string, fullName);
13247 PostPrintType(type, string, fullName);
13248 if(type->bitFieldCount)
13252 sprintf(count, ":%d", type->bitFieldCount);
13253 strcat(string, count);
13257 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13259 _PrintType(type, string, printName, fullName, 0x1);
13262 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13264 _PrintType(type, string, printName, fullName, 0x0);
13267 static struct Type * FindMember(struct Type * type, char * string)
13269 struct Type * memberType;
13271 for(memberType = type->members.first; memberType; memberType = memberType->next)
13273 if(!memberType->name)
13275 struct Type * subType = FindMember(memberType, string);
13280 else if(!strcmp(memberType->name, string))
13283 return (((void *)0));
13286 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13288 struct Type * memberType;
13290 for(memberType = type->members.first; memberType; memberType = memberType->next)
13292 if(!memberType->name)
13294 struct Type * subType = FindMember(memberType, string);
13298 *offset += memberType->offset;
13302 else if(!strcmp(memberType->name, string))
13304 *offset += memberType->offset;
13308 return (((void *)0));
13311 extern unsigned int parseError;
13313 unsigned int GetParseError()
13318 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13320 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13324 struct Expression * ParseExpressionString(char * expression)
13327 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13328 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13329 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13331 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13332 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13333 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13334 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13336 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13337 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13339 parsedExpression = (((void *)0));
13341 expression_yyparse();
13342 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13343 return parsedExpression;
13346 extern char * QMkString(char * source);
13348 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13350 struct Identifier * id = exp->identifier;
13351 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13352 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13353 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13354 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13356 if(_class && _class->type == 4)
13358 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13359 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13363 struct __ecereNameSpace__ecere__com__Class * baseClass;
13365 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13367 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13369 for(value = e->values.first; value; value = value->next)
13371 if(!strcmp(value->name, id->string))
13376 char constant[256];
13378 FreeExpContents(exp);
13380 exp->isConstant = 0x1;
13381 if(!strcmp(baseClass->dataTypeString, "int"))
13382 sprintf(constant, "%d", (int)value->data);
13384 sprintf(constant, "0x%X", (int)value->data);
13385 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13386 exp->expType = MkClassType(baseClass->fullName);
13394 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13396 ProcessMethodType(method);
13397 exp->expType = __extension__ ({
13398 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13400 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13404 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13406 if(!prop->dataType)
13407 ProcessPropertyType(prop);
13408 exp->expType = prop->dataType;
13410 prop->dataType->refCount++;
13413 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13415 if(!member->dataType)
13416 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13417 exp->expType = member->dataType;
13418 if(member->dataType)
13419 member->dataType->refCount++;
13422 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13424 if(!classProp->dataType)
13425 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13426 if(classProp->constant)
13428 FreeExpContents(exp);
13429 exp->isConstant = 0x1;
13430 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13433 exp->constant = QMkString((char *)classProp->Get(_class));
13437 char constant[256];
13440 sprintf(constant, "%d", (int)classProp->Get(_class));
13441 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13447 exp->expType = classProp->dataType;
13448 if(classProp->dataType)
13449 classProp->dataType->refCount++;
13455 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13457 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13458 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13459 struct __ecereNameSpace__ecere__com__NameSpace * child;
13463 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)))
13465 data = ScanGlobalData(child, name);
13473 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13475 extern char * strncpy(char * , const char * , size_t n);
13477 static struct GlobalData * FindGlobalData(char * name)
13480 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13482 nameSpace = globalData;
13483 for(c = 0; name[c]; c++)
13485 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13487 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13488 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13490 strncpy(spaceName, name + start, c - start);
13491 spaceName[c - start] = '\0';
13492 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13493 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13495 return (((void *)0));
13496 nameSpace = newSpace;
13504 return ScanGlobalData(nameSpace, name + start);
13506 return (((void *)0));
13509 static int definedExpStackPos;
13511 static void * definedExpStack[512];
13513 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13515 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13517 FreeExpContents(checkedExp);
13518 FreeType(checkedExp->expType);
13519 FreeType(checkedExp->destType);
13520 *checkedExp = *newExp;
13521 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13522 checkedExp->prev = prev;
13523 checkedExp->next = next;
13526 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13528 extern int printf(char * , ...);
13530 void __ecereMethod_Expression_Clear();
13532 void ApplyAnyObjectLogic(struct Expression * e)
13534 struct Type * destType = e->destType;
13536 if(destType && (destType->classObjectType == 3))
13538 if(e && e->expType)
13540 struct Type * type = e->expType;
13541 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13543 if(type->kind == 8 && type->_class && type->_class->registered)
13545 _class = type->_class->registered;
13547 else if(type->kind == 19)
13549 _class = FindClass("ecere::com::Class")->registered;
13553 char string[1024] = "";
13554 struct Symbol * classSym;
13556 PrintTypeNoConst(type, string, 0x0, 0x1);
13557 classSym = FindClass(string);
13559 _class = classSym->registered;
13561 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)))
13563 if(!_class || strcmp(_class->fullName, "char *"))
13565 struct Expression * checkedExp = e, * newExp;
13567 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13569 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13571 if(checkedExp->type == 23)
13573 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13576 checkedExp = (*checkedExp->list).last;
13578 else if(checkedExp->type == 11)
13579 checkedExp = checkedExp->cast.exp;
13581 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13583 newExp = checkedExp->op.exp2;
13584 checkedExp->op.exp2 = (((void *)0));
13585 FreeExpContents(checkedExp);
13586 if(e->expType && e->expType->passAsTemplate)
13590 ComputeTypeSize(e->expType);
13591 sprintf(size, "%d", e->expType->size);
13592 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))))));
13594 ReplaceExpContents(checkedExp, newExp);
13595 e->byReference = 0x1;
13597 else if(!e->byReference || (_class && _class->type == 5))
13599 struct Expression * checkedExp, * newExp;
13602 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;
13604 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13606 struct Context * context = PushContext();
13607 struct Declarator * decl;
13608 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13609 char typeString[1024];
13610 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13612 typeString[0] = '\0';
13614 newExp->prev = (((void *)0));
13615 newExp->next = (((void *)0));
13616 newExp->expType = (((void *)0));
13617 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13618 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13619 newExp->destType = ProcessType(specs, decl);
13620 curContext = context;
13624 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13627 sprintf(name, "__internalValue%03X", internalValueCounter++);
13628 if(!curCompound->compound.declarations)
13629 curCompound->compound.declarations = MkList();
13630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13631 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13632 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13633 e->compound = MkCompoundStmt((((void *)0)), stmts);
13636 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13638 struct Type * type = e->destType;
13640 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13641 CopyTypeInto(e->destType, type);
13642 e->destType->refCount = 1;
13643 e->destType->classObjectType = 0;
13646 e->compound->compound.context = context;
13647 PopContext(context);
13648 curContext = context->parent;
13652 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13654 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13656 if(checkedExp->type == 23)
13658 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13661 checkedExp = (*checkedExp->list).last;
13663 else if(checkedExp->type == 11)
13664 checkedExp = checkedExp->cast.exp;
13667 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13669 *operand = *checkedExp;
13670 checkedExp->destType = (((void *)0));
13671 checkedExp->expType = (((void *)0));
13672 __ecereMethod_Expression_Clear(checkedExp);
13673 checkedExp->type = 4;
13674 checkedExp->op.op = '&';
13675 checkedExp->op.exp1 = (((void *)0));
13676 checkedExp->op.exp2 = operand;
13685 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))))
13687 if(e->expType->classObjectType && destType && destType->classObjectType)
13693 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13696 thisExp->prev = (((void *)0));
13697 thisExp->next = (((void *)0));
13698 __ecereMethod_Expression_Clear(e);
13700 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13701 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13702 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13704 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13705 CopyTypeInto(e->expType, thisExp->expType);
13706 e->expType->byReference = 0x0;
13707 e->expType->refCount = 1;
13708 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))
13710 e->expType->classObjectType = 0;
13715 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13717 if(destType->kind == 14)
13719 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13721 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13723 unsigned int byReference = e->expType->byReference;
13724 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13725 struct Declarator * decl;
13726 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13727 char typeString[1024];
13728 struct Type * type;
13729 int backupClassObjectType;
13730 unsigned int backupByReference;
13732 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13736 backupClassObjectType = type->classObjectType;
13737 backupByReference = type->byReference;
13738 type->classObjectType = 0;
13739 type->byReference = 0x0;
13740 typeString[0] = '\0';
13741 PrintType(type, typeString, 0x0, 0x1);
13742 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13743 type->classObjectType = backupClassObjectType;
13744 type->byReference = backupByReference;
13746 thisExp->prev = (((void *)0));
13747 thisExp->next = (((void *)0));
13748 __ecereMethod_Expression_Clear(e);
13749 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)))
13753 e->op.exp1 = (((void *)0));
13754 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13755 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13756 CopyTypeInto(e->expType, type);
13757 e->expType->byReference = 0x0;
13758 e->expType->refCount = 1;
13763 e->cast.typeName = MkTypeName(specs, decl);
13764 e->cast.exp = thisExp;
13765 e->byReference = 0x1;
13769 e->destType = destType;
13770 destType->refCount++;
13775 extern char * strstr(const char * , const char * );
13777 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13779 struct __ecereNameSpace__ecere__com__DefinedExpression
13781 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13782 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13785 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13786 } __attribute__ ((gcc_struct));
13788 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13790 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13792 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13794 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13796 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13798 extern struct Expression * CopyExpression(struct Expression * exp);
13800 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13802 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13804 static void ProcessStatement(struct Statement * stmt);
13806 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13808 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13810 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13812 extern char * sourceFile;
13814 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13816 void ProcessExpressionType(struct Expression * exp)
13818 unsigned int unresolved = 0x0;
13819 struct Location oldyylloc = yylloc;
13820 unsigned int notByReference = 0x0;
13822 if(!exp || exp->expType)
13829 struct Identifier * id = exp->identifier;
13831 if(!id || !topContext)
13833 if(id->_class && id->_class->name)
13835 id->classSym = id->_class->symbol;
13837 if(strstr(id->string, "__ecereClass") == id->string)
13839 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13842 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13844 ReplaceClassMembers(exp, thisClass);
13847 ProcessExpressionType(exp);
13850 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13855 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13859 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13865 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13868 ProcessExpressionType(exp);
13872 else if(currentClass && !id->_class)
13874 if(ResolveIdWithClass(exp, currentClass, 0x1))
13877 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13882 struct Type * type = symbol->type;
13883 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13885 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13887 struct Context * context = SetupTemplatesContext(_class);
13889 type = ReplaceThisClassType(_class);
13890 FinishTemplatesContext(context);
13892 type->refCount = 0;
13894 FreeSpecifier(id->_class);
13895 id->_class = (((void *)0));
13896 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13897 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13898 id->classSym = (((void *)0));
13899 exp->expType = type;
13902 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13903 exp->isConstant = 0x1;
13904 if(symbol->isParam || !strcmp(id->string, "this"))
13906 if(_class && _class->type == 1 && !type->declaredWithStruct)
13907 exp->byReference = 0x1;
13909 if(symbol->isIterator)
13911 if(symbol->isIterator == 3)
13914 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13915 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13916 exp->expType = (((void *)0));
13917 ProcessExpressionType(exp);
13919 else if(symbol->isIterator != 4)
13922 exp->member.exp = MkExpIdentifier(exp->identifier);
13923 exp->member.exp->expType = exp->expType;
13924 exp->member.member = MkIdentifier("data");
13925 exp->expType = (((void *)0));
13926 ProcessExpressionType(exp);
13933 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13935 if(thisNameSpace && !(id->_class && !id->_class->name))
13939 strcpy(name, thisNameSpace);
13940 strcat(name, "::");
13941 strcat(name, id->string);
13942 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13945 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13950 for(c = 0; c < definedExpStackPos; c++)
13951 if(definedExpStack[c] == definedExp)
13953 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13955 struct Location backupYylloc = yylloc;
13956 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13958 definedExpStack[definedExpStackPos++] = definedExp;
13959 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13960 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13961 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13963 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13964 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13965 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13966 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13968 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13969 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13971 parsedExpression = (((void *)0));
13973 expression_yyparse();
13974 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13976 fileInput = backInput;
13977 yylloc = backupYylloc;
13978 if(parsedExpression)
13980 FreeIdentifier(id);
13982 exp->list = MkListOne(parsedExpression);
13983 parsedExpression->loc = yylloc;
13984 ProcessExpressionType(exp);
13985 definedExpStackPos--;
13988 definedExpStackPos--;
13994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14000 struct GlobalData * data = (((void *)0));
14002 if(thisNameSpace && !(id->_class && !id->_class->name))
14006 strcpy(name, thisNameSpace);
14007 strcat(name, "::");
14008 strcat(name, id->string);
14009 data = FindGlobalData(name);
14012 data = FindGlobalData(id->string);
14015 DeclareGlobalData(data);
14016 exp->expType = data->dataType;
14018 data->dataType->refCount++;
14019 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14020 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14021 FreeSpecifier(id->_class);
14022 id->_class = (((void *)0));
14027 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14029 if(thisNameSpace && !(id->_class && !id->_class->name))
14033 strcpy(name, thisNameSpace);
14034 strcat(name, "::");
14035 strcat(name, id->string);
14036 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14039 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14044 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14045 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14047 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14048 strcpy(name, "__ecereFunction_");
14049 FullClassNameCat(name, id->string, 0x0);
14050 if(DeclareFunction(function, name))
14052 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14053 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14055 exp->expType = function->dataType;
14056 if(function->dataType)
14057 function->dataType->refCount++;
14058 FreeSpecifier(id->_class);
14059 id->_class = (((void *)0));
14071 struct __ecereNameSpace__ecere__com__Class * _class;
14073 if(!exp->instance->_class)
14075 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14077 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14080 ProcessInstantiationType(exp->instance);
14081 exp->isConstant = exp->instance->isConstant;
14082 if(exp->instance->_class)
14084 exp->expType = MkClassType(exp->instance->_class->name);
14092 char * constant = exp->constant;
14093 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14095 exp->expType = type;
14096 if(constant[0] == '\'')
14098 if((int)((unsigned char *)constant)[1] > 127)
14101 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14105 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14106 exp->constant = PrintUInt(ch);
14108 type->_class = FindClass("unichar");
14109 type->isSigned = 0x0;
14114 type->isSigned = 0x1;
14119 char * dot = strchr(constant, '.');
14120 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14125 exponent = strchr(constant, 'p');
14127 exponent = strchr(constant, 'P');
14131 exponent = strchr(constant, 'e');
14133 exponent = strchr(constant, 'E');
14135 if(dot || exponent)
14137 if(strchr(constant, 'f') || strchr(constant, 'F'))
14141 type->isSigned = 0x1;
14145 unsigned int isSigned = constant[0] == '-';
14146 char * endP = (((void *)0));
14147 long long i64 = strtoll(constant, &endP, 0);
14148 uint64 ui64 = strtoull(constant, &endP, 0);
14149 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14153 if(i64 < (((int)0x80000000)))
14158 if(ui64 > (((int)0x7fffffff)))
14160 if(ui64 > (0xffffffff))
14163 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14167 else if(constant[0] != '0' || !constant[1])
14170 type->kind = is64Bit ? 4 : 3;
14171 type->isSigned = isSigned;
14174 exp->isConstant = 0x1;
14175 if(exp->destType && exp->destType->kind == 7)
14177 else if(exp->destType && exp->destType->kind == 6)
14179 else if(exp->destType && exp->destType->kind == 4)
14186 exp->isConstant = 0x1;
14187 exp->expType = __extension__ ({
14188 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14190 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14191 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14193 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14194 }), __ecereInstance2;
14200 ProcessExpressionType(exp->_new.size);
14201 exp->expType = __extension__ ({
14202 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14204 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14206 DeclareType(exp->expType->type, 0x0, 0x0);
14210 ProcessExpressionType(exp->_renew.size);
14211 ProcessExpressionType(exp->_renew.exp);
14212 exp->expType = __extension__ ({
14213 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14215 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14217 DeclareType(exp->expType->type, 0x0, 0x0);
14221 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14222 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14223 unsigned int useDestType = 0x0, useSideType = 0x0;
14224 struct Location oldyylloc = yylloc;
14225 unsigned int useSideUnit = 0x0;
14226 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14268 if(exp->op.op != '*' || exp->op.exp1)
14275 if(exp->op.op == '&')
14277 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14279 struct Identifier * id = exp->op.exp2->identifier;
14280 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14282 if(symbol && symbol->isIterator == 2)
14285 exp->member.exp = exp->op.exp2;
14286 exp->member.member = MkIdentifier("key");
14287 exp->expType = (((void *)0));
14288 exp->op.exp2->expType = symbol->type;
14289 symbol->type->refCount++;
14290 ProcessExpressionType(exp);
14298 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))
14300 if(exp->op.exp1->destType)
14301 FreeType(exp->op.exp1->destType);
14302 exp->op.exp1->destType = exp->destType;
14304 exp->destType->refCount++;
14308 if(exp->op.exp1->destType)
14309 FreeType(exp->op.exp1->destType);
14310 exp->op.exp1->destType = dummy;
14313 if(exp->op.exp1->destType && exp->op.op != '=')
14314 exp->op.exp1->destType->count++;
14315 ProcessExpressionType(exp->op.exp1);
14316 if(exp->op.exp1->destType && exp->op.op != '=')
14317 exp->op.exp1->destType->count--;
14318 if(exp->op.exp1->destType == dummy)
14321 exp->op.exp1->destType = (((void *)0));
14323 type1 = exp->op.exp1->expType;
14327 char expString[10240];
14329 expString[0] = '\0';
14330 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14334 exp->op.exp2->destType = exp->op.exp1->expType;
14335 if(exp->op.exp1->expType)
14336 exp->op.exp1->expType->refCount++;
14340 exp->op.exp2->destType = exp->destType;
14342 exp->destType->refCount++;
14346 exp->expType = type1;
14351 PrintExpression(exp->op.exp2, expString);
14352 if(type1 && type1->kind == 13)
14354 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)
14355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14356 else if(exp->op.op == '=')
14358 if(exp->op.exp2->destType)
14359 FreeType(exp->op.exp2->destType);
14360 exp->op.exp2->destType = type1;
14367 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)
14371 if(exp->op.exp2->destType)
14372 FreeType(exp->op.exp2->destType);
14373 exp->op.exp2->destType = type1;
14380 exp->expType = type1;
14382 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)))
14384 if(exp->op.exp2->destType)
14385 FreeType(exp->op.exp2->destType);
14386 exp->op.exp2->destType = exp->destType;
14388 exp->destType->refCount++;
14392 if(exp->op.exp2->destType)
14393 FreeType(exp->op.exp2->destType);
14394 exp->op.exp2->destType = dummy;
14397 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14399 FreeType(exp->op.exp2->destType);
14400 exp->op.exp2->destType = type1;
14403 if(exp->op.exp2->destType && exp->op.op != '=')
14404 exp->op.exp2->destType->count++;
14405 if(exp->op.op == SIZEOF)
14407 struct Expression * e = exp->op.exp2;
14409 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14411 if(e->type == 5 || e->type == 32 || e->type == 23)
14414 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14416 e = (*e->list).last;
14419 if(e->type == 11 && e->cast.exp)
14420 e->cast.exp->needCast = 0x1;
14422 ProcessExpressionType(exp->op.exp2);
14423 if(exp->op.exp2->destType && exp->op.op != '=')
14424 exp->op.exp2->destType->count--;
14425 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14427 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)
14429 if(exp->op.op != '=' && type1->type->kind == 0)
14430 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14432 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)))
14434 if(exp->op.op == ADD_ASSIGN)
14435 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14437 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))
14439 if(exp->op.op == ADD_ASSIGN)
14440 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14442 else if(inCompiler)
14444 char type1String[1024];
14445 char type2String[1024];
14447 type1String[0] = '\0';
14448 type2String[0] = '\0';
14449 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14450 PrintType(type1, type2String, 0x0, 0x1);
14451 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14452 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14455 if(exp->op.exp2->destType == dummy)
14458 exp->op.exp2->destType = (((void *)0));
14460 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14462 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14463 type2->refCount = 1;
14464 CopyTypeInto(type2, exp->op.exp2->expType);
14465 type2->isSigned = 0x1;
14467 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14469 type2 = __extension__ ({
14470 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14472 __ecereInstance1->kind = 3, __ecereInstance1;
14474 type2->refCount = 1;
14475 type2->isSigned = 0x1;
14479 type2 = exp->op.exp2->expType;
14485 if(exp->op.op == SIZEOF)
14487 exp->expType = __extension__ ({
14488 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14490 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14492 exp->isConstant = 0x1;
14494 else if(exp->op.op == '*' && !exp->op.exp1)
14496 exp->expType = Dereference(type2);
14497 if(type2 && type2->kind == 8)
14498 notByReference = 0x1;
14500 else if(exp->op.op == '&' && !exp->op.exp1)
14501 exp->expType = Reference(type2);
14508 if(exp->op.exp1->destType)
14509 FreeType(exp->op.exp1->destType);
14510 exp->op.exp1->destType = MkClassType("bool");
14511 exp->op.exp1->destType->truth = 0x1;
14512 if(!exp->op.exp1->expType)
14513 ProcessExpressionType(exp->op.exp1);
14515 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14516 FreeType(exp->op.exp1->expType);
14517 exp->op.exp1->expType = MkClassType("bool");
14518 exp->op.exp1->expType->truth = 0x1;
14522 if(exp->op.exp2->destType)
14523 FreeType(exp->op.exp2->destType);
14524 exp->op.exp2->destType = MkClassType("bool");
14525 exp->op.exp2->destType->truth = 0x1;
14526 if(!exp->op.exp2->expType)
14527 ProcessExpressionType(exp->op.exp2);
14529 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14530 FreeType(exp->op.exp2->expType);
14531 exp->op.exp2->expType = MkClassType("bool");
14532 exp->op.exp2->expType->truth = 0x1;
14535 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")))))
14537 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14539 if(exp->op.exp2->destType)
14540 FreeType(exp->op.exp2->destType);
14541 exp->op.exp2->destType = type1;
14543 if(exp->op.exp1->destType)
14544 FreeType(exp->op.exp1->destType);
14545 exp->op.exp1->destType = type2;
14547 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)
14548 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);
14549 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14551 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14555 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14557 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14558 ProcessExpressionType(exp->op.exp1);
14559 if(type2->kind != 13)
14561 ProcessExpressionType(classExp);
14562 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"))))))));
14563 if(!exp->op.exp2->expType)
14567 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14570 ProcessExpressionType(exp->op.exp2);
14574 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)))
14576 if(type1->kind != 8 && type1->type->kind == 0)
14577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14578 exp->expType = type1;
14582 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)))
14584 if(type2->kind != 8 && type2->type->kind == 0)
14585 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14586 exp->expType = type2;
14590 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))
14592 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14596 unsigned int success = 0x0;
14598 if(type1->kind == 13 && type2->kind == 13)
14600 if(exp->op.op == '+')
14601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14602 else if(exp->op.op == '-')
14604 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14606 exp->expType = __extension__ ({
14607 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14609 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14612 if(type1->type->kind == 20)
14614 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14618 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14620 ProcessExpressionType(classExp);
14622 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")))))));
14623 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14631 if(!success && exp->op.exp1->type == 2)
14633 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14636 FreeType(exp->expType);
14637 exp->expType = exp->op.exp1->destType;
14638 if(exp->op.exp1->destType)
14639 exp->op.exp1->destType->refCount++;
14642 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14645 FreeType(exp->expType);
14646 exp->expType = exp->op.exp2->destType;
14647 if(exp->op.exp2->destType)
14648 exp->op.exp2->destType->refCount++;
14654 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14657 FreeType(exp->expType);
14658 exp->expType = exp->op.exp2->destType;
14659 if(exp->op.exp2->destType)
14660 exp->op.exp2->destType->refCount++;
14663 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14666 FreeType(exp->expType);
14667 exp->expType = exp->op.exp1->destType;
14668 if(exp->op.exp1->destType)
14669 exp->op.exp1->destType->refCount++;
14675 char expString1[10240];
14676 char expString2[10240];
14680 expString1[0] = '\0';
14681 expString2[0] = '\0';
14686 PrintExpression(exp->op.exp1, expString1);
14687 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14688 PrintExpression(exp->op.exp2, expString2);
14689 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14690 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14691 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14693 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14697 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14699 if(exp->op.exp1->destType)
14700 FreeType(exp->op.exp1->destType);
14701 exp->op.exp1->destType = type2->_class->registered->dataType;
14702 if(type2->_class->registered->dataType)
14703 type2->_class->registered->dataType->refCount++;
14704 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14705 exp->expType = type2;
14709 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14711 if(exp->op.exp2->destType)
14712 FreeType(exp->op.exp2->destType);
14713 exp->op.exp2->destType = type1->_class->registered->dataType;
14714 if(type1->_class->registered->dataType)
14715 type1->_class->registered->dataType->refCount++;
14716 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14717 exp->expType = type1;
14723 unsigned int valid = 0x0;
14725 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14727 if(exp->op.exp2->destType)
14728 FreeType(exp->op.exp2->destType);
14729 if(!type1->_class->registered->dataType)
14730 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14731 exp->op.exp2->destType = type1->_class->registered->dataType;
14732 exp->op.exp2->destType->refCount++;
14733 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14736 type2 = exp->op.exp2->destType;
14739 exp->expType = type2;
14742 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14744 if(exp->op.exp1->destType)
14745 FreeType(exp->op.exp1->destType);
14746 if(!type2->_class->registered->dataType)
14747 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14748 exp->op.exp1->destType = type2->_class->registered->dataType;
14749 exp->op.exp1->destType->refCount++;
14750 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14751 type1 = exp->op.exp1->destType;
14752 exp->expType = type1;
14755 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14757 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14759 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14762 FreeType(exp->expType);
14763 exp->expType = exp->op.exp1->expType;
14764 if(exp->op.exp2->expType)
14765 exp->op.exp1->expType->refCount++;
14769 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14771 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14774 FreeType(exp->expType);
14775 exp->expType = exp->op.exp2->expType;
14776 if(exp->op.exp2->expType)
14777 exp->op.exp2->expType->refCount++;
14784 if(exp->op.exp2->destType)
14785 FreeType(exp->op.exp2->destType);
14786 exp->op.exp2->destType = type1;
14788 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14791 FreeType(exp->expType);
14792 exp->expType = exp->op.exp2->destType;
14793 if(exp->op.exp2->destType)
14794 exp->op.exp2->destType->refCount++;
14796 else if(type1 && type2)
14798 char expString1[10240];
14799 char expString2[10240];
14800 char type1String[1024];
14801 char type2String[1024];
14803 expString1[0] = '\0';
14804 expString2[0] = '\0';
14805 type1String[0] = '\0';
14806 type2String[0] = '\0';
14809 PrintExpression(exp->op.exp1, expString1);
14810 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14811 PrintExpression(exp->op.exp2, expString2);
14812 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14813 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14814 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14816 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14817 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14819 exp->expType = exp->op.exp1->expType;
14820 if(exp->op.exp1->expType)
14821 exp->op.exp1->expType->refCount++;
14823 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14825 exp->expType = exp->op.exp2->expType;
14826 if(exp->op.exp2->expType)
14827 exp->op.exp2->expType->refCount++;
14834 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14836 struct Type * oldType = exp->op.exp1->expType;
14838 exp->op.exp1->expType = (((void *)0));
14839 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14842 exp->op.exp1->expType = oldType;
14844 if(exp->op.exp1->destType)
14845 FreeType(exp->op.exp1->destType);
14846 exp->op.exp1->destType = type2;
14848 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14851 FreeType(exp->expType);
14852 exp->expType = exp->op.exp1->destType;
14853 if(exp->op.exp1->destType)
14854 exp->op.exp1->destType->refCount++;
14858 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14860 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14862 if(exp->op.exp1->destType)
14863 FreeType(exp->op.exp1->destType);
14864 exp->op.exp1->destType = type2->_class->registered->dataType;
14865 if(type2->_class->registered->dataType)
14866 type2->_class->registered->dataType->refCount++;
14867 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14869 if(exp->op.op == '!')
14871 exp->expType = MkClassType("bool");
14872 exp->expType->truth = 0x1;
14876 exp->expType = type2;
14881 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14883 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14885 if(exp->op.exp2->destType)
14886 FreeType(exp->op.exp2->destType);
14887 exp->op.exp2->destType = type1->_class->registered->dataType;
14888 if(type1->_class->registered->dataType)
14889 type1->_class->registered->dataType->refCount++;
14890 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14892 exp->expType = type1;
14898 if(exp->op.exp1 && !exp->op.exp1->expType)
14900 char expString[10000];
14902 expString[0] = '\0';
14905 PrintExpression(exp->op.exp1, expString);
14906 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14911 if(exp->op.exp2 && !exp->op.exp2->expType)
14913 char expString[10240];
14915 expString[0] = '\0';
14918 PrintExpression(exp->op.exp2, expString);
14919 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14922 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14926 FreeType(exp->expType);
14927 exp->expType = MkClassType("bool");
14928 exp->expType->truth = 0x1;
14930 if(exp->op.op != SIZEOF)
14931 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14932 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14934 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14936 yylloc = oldyylloc;
14945 struct Expression * e;
14947 exp->isConstant = 0x1;
14948 for(e = (*exp->list).first; e; e = e->next)
14950 unsigned int inced = 0x0;
14954 FreeType(e->destType);
14955 e->destType = exp->destType;
14958 exp->destType->refCount++;
14959 e->destType->count++;
14963 ProcessExpressionType(e);
14965 exp->destType->count--;
14966 if(!exp->expType && !e->next)
14968 exp->expType = e->expType;
14970 e->expType->refCount++;
14973 exp->isConstant = 0x0;
14975 e = (*exp->list).first;
14976 if(!e->next && e->type == 8)
14978 struct Expression * next = exp->next, * prev = exp->prev;
14980 FreeType(exp->expType);
14981 FreeType(exp->destType);
14982 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14986 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14987 ProcessExpressionType(exp);
14993 struct Expression * e;
14995 exp->isConstant = 0x1;
14996 ProcessExpressionType(exp->index.exp);
14997 if(!exp->index.exp->isConstant)
14998 exp->isConstant = 0x0;
14999 if(exp->index.exp->expType)
15001 struct Type * source = exp->index.exp->expType;
15003 if(source->kind == 8 && source->_class && source->_class->registered)
15005 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15006 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15008 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15010 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15011 if(exp->index.index && (*exp->index.index).last)
15013 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15018 for(e = (*exp->index.index).first; e; e = e->next)
15020 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15023 FreeType(e->destType);
15024 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15026 ProcessExpressionType(e);
15031 exp->isConstant = 0x0;
15034 exp->expType = Dereference(exp->index.exp->expType);
15036 DeclareType(exp->expType, 0x0, 0x0);
15041 struct Expression * e;
15042 struct Type * functionType;
15043 struct Type * methodType = (((void *)0));
15049 PrintExpression(exp->call.exp, name);
15050 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15052 PrintExpression(exp->call.exp, name);
15055 if(exp->call.exp->type == 0)
15057 struct Expression * idExp = exp->call.exp;
15058 struct Identifier * id = idExp->identifier;
15060 if(!strcmp(id->string, "__builtin_frame_address"))
15062 exp->expType = ProcessTypeString("void *", 0x1);
15063 if(exp->call.arguments && (*exp->call.arguments).first)
15064 ProcessExpressionType((*exp->call.arguments).first);
15067 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15069 exp->expType = ProcessTypeString("int", 0x1);
15070 if(exp->call.arguments && (*exp->call.arguments).first)
15071 ProcessExpressionType((*exp->call.arguments).first);
15074 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15076 struct Expression * a = (((void *)0));
15077 struct Expression * b = (((void *)0));
15078 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15080 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15082 a = (*exp->call.arguments).first;
15083 b = (*exp->call.arguments).last;
15087 else if((*exp->call.arguments).count == 1)
15089 a = (*exp->call.arguments).first;
15094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15095 idExp->identifier = (((void *)0));
15096 FreeExpContents(exp);
15097 ProcessExpressionType(a);
15099 ProcessExpressionType(b);
15101 exp->list = MkList();
15102 if(a->expType && (!b || b->expType))
15104 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15109 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15110 struct Declaration * decl;
15111 char temp1[1024], temp2[1024];
15113 GetTypeSpecs(a->expType, specs);
15114 if(a && !a->isConstant && a->type != 0)
15116 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15117 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15118 tempExp1 = QMkExpId(temp1);
15119 tempExp1->expType = a->expType;
15121 a->expType->refCount++;
15122 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15124 if(b && !b->isConstant && b->type != 0)
15126 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15127 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15128 tempExp2 = QMkExpId(temp2);
15129 tempExp2->expType = b->expType;
15131 b->expType->refCount++;
15132 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15134 decl = MkDeclaration(specs, decls);
15135 if(!curCompound->compound.declarations)
15136 curCompound->compound.declarations = MkList();
15137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15141 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15143 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15145 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15146 exp->expType = a->expType;
15148 a->expType->refCount++;
15150 else if(!strcmp(id->string, "Abs"))
15152 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15153 exp->expType = a->expType;
15155 a->expType->refCount++;
15157 else if(!strcmp(id->string, "Sgn"))
15159 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"))))));
15160 exp->expType = ProcessTypeString("int", 0x0);
15162 FreeExpression(tempExp1);
15164 FreeExpression(tempExp2);
15165 FreeIdentifier(id);
15171 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15173 if(!exp->call.exp->destType)
15175 exp->call.exp->destType = dummy;
15178 ProcessExpressionType(exp->call.exp);
15179 if(exp->call.exp->destType == dummy)
15182 exp->call.exp->destType = (((void *)0));
15186 functionType = exp->call.exp->expType;
15187 if(functionType && functionType->kind == 16)
15189 methodType = functionType;
15190 functionType = methodType->method->dataType;
15191 if(exp->call.exp->expType->usedClass)
15193 char typeString[1024];
15195 typeString[0] = '\0';
15197 struct Symbol * back = functionType->thisClass;
15199 functionType->thisClass = (((void *)0));
15200 PrintType(functionType, typeString, 0x1, 0x1);
15201 functionType->thisClass = back;
15203 if(strstr(typeString, "thisclass"))
15205 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15206 struct Declarator * decl;
15209 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15211 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15212 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15213 thisClassParams = 0x0;
15214 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15216 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15218 thisClass = exp->call.exp->expType->usedClass;
15219 ProcessDeclarator(decl);
15220 thisClass = backupThisClass;
15222 thisClassParams = 0x1;
15223 functionType = ProcessType(specs, decl);
15224 functionType->refCount = 0;
15225 FinishTemplatesContext(context);
15227 FreeList(specs, FreeSpecifier);
15228 FreeDeclarator(decl);
15232 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15234 struct Type * type = functionType->type;
15236 if(!functionType->refCount)
15238 functionType->type = (((void *)0));
15239 FreeType(functionType);
15241 functionType = type;
15243 if(functionType && functionType->kind != 11)
15245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15247 else if(functionType)
15249 unsigned int emptyParams = 0x0, noParams = 0x0;
15250 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15251 struct Type * type = functionType->params.first;
15252 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15254 struct Location oldyylloc = yylloc;
15258 if(functionType->extraParam && e && functionType->thisClass)
15260 e->destType = MkClassType(functionType->thisClass->string);
15263 if(!functionType->staticMethod && !functionType->extraParam)
15265 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15267 type = MkClassType(memberExp->member.exp->expType->_class->string);
15270 e->destType = type;
15272 type = functionType->params.first;
15275 type->refCount = 0;
15277 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15279 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15280 type->byReference = functionType->byReference;
15281 type->typedByReference = functionType->typedByReference;
15284 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15286 e->destType = type;
15288 type = functionType->params.first;
15291 type->refCount = 0;
15294 if(type && type->kind == 0)
15297 if(!type->refCount)
15299 type = (((void *)0));
15301 for(; e; e = e->next)
15303 if(!type && !emptyParams)
15306 if(methodType && methodType->methodClass)
15307 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);
15309 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);
15312 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15314 struct Type * templatedType = (((void *)0));
15315 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15319 if(_class && _class->templateArgs)
15321 struct __ecereNameSpace__ecere__com__Class * sClass;
15323 for(sClass = _class; sClass; sClass = sClass->base)
15325 if(sClass->templateClass)
15326 sClass = sClass->templateClass;
15328 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15330 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15332 struct __ecereNameSpace__ecere__com__Class * nextClass;
15334 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15336 if(nextClass->templateClass)
15337 nextClass = nextClass->templateClass;
15338 id += nextClass->templateParams.count;
15348 if(curParam && _class->templateArgs[id].dataTypeString)
15350 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15353 struct Context * context = SetupTemplatesContext(_class);
15355 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15356 FinishTemplatesContext(context);
15358 e->destType = templatedType;
15361 templatedType->passAsTemplate = 0x1;
15366 e->destType = type;
15373 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15375 e->destType = type->prev;
15376 e->destType->refCount++;
15380 e->destType = type;
15385 if(type && type->kind != 14)
15387 struct Type * next = type->next;
15389 if(!type->refCount)
15394 if(type && type->kind != 14)
15396 if(methodType && methodType->methodClass)
15397 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);
15399 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);
15401 yylloc = oldyylloc;
15402 if(type && !type->refCount)
15407 functionType = __extension__ ({
15408 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15410 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15412 if(exp->call.exp->type == 0)
15414 char * string = exp->call.exp->identifier->string;
15418 struct Symbol * symbol;
15419 struct Location oldyylloc = yylloc;
15421 yylloc = exp->call.exp->identifier->loc;
15422 if(strstr(string, "__builtin_") == string)
15426 functionType->returnType = exp->destType;
15427 exp->destType->refCount++;
15431 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15432 symbol = __extension__ ({
15433 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15435 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15437 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15438 if(strstr(symbol->string, "::"))
15439 globalContext->hasNameSpace = 0x1;
15440 yylloc = oldyylloc;
15443 else if(exp->call.exp->type == 8)
15447 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15448 if(!functionType->returnType)
15450 functionType->returnType = __extension__ ({
15451 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15453 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15457 if(functionType && functionType->kind == 11)
15459 exp->expType = functionType->returnType;
15460 if(functionType->returnType)
15461 functionType->returnType->refCount++;
15462 if(!functionType->refCount)
15463 FreeType(functionType);
15465 if(exp->call.arguments)
15467 for(e = (*exp->call.arguments).first; e; e = e->next)
15469 struct Type * destType = e->destType;
15471 ProcessExpressionType(e);
15478 struct Type * type;
15479 struct Location oldyylloc = yylloc;
15480 unsigned int thisPtr;
15481 struct Expression * checkExp = exp->member.exp;
15485 if(checkExp->type == 11)
15486 checkExp = checkExp->cast.exp;
15487 else if(checkExp->type == 5)
15488 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15492 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15493 exp->thisPtr = thisPtr;
15494 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15496 exp->member.member->classSym = exp->member.member->_class->symbol;
15498 ProcessExpressionType(exp->member.exp);
15499 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)
15501 exp->isConstant = 0x0;
15504 exp->isConstant = exp->member.exp->isConstant;
15505 type = exp->member.exp->expType;
15507 if(type && (type->kind == 20))
15509 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15510 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15514 for(param = _class->templateParams.first; param; param = param->next)
15516 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15520 if(param && param->defaultArg.member)
15522 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15526 struct Expression * expMember = exp->member.exp;
15527 struct Declarator * decl;
15528 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15529 char thisClassTypeString[1024];
15531 FreeIdentifier(exp->member.member);
15532 ProcessExpressionType(argExp);
15534 char * colon = strstr(param->defaultArg.memberString, "::");
15538 char className[1024];
15539 struct __ecereNameSpace__ecere__com__Class * sClass;
15541 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15542 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15545 strcpy(thisClassTypeString, _class->fullName);
15547 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15548 exp->expType = ProcessType(specs, decl);
15549 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15551 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15552 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15554 int paramCount = 0;
15555 int lastParam = -1;
15556 char templateString[1024];
15557 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15559 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15560 for(cClass = expClass; cClass; cClass = cClass->base)
15564 for(param = cClass->templateParams.first; param; param = param->next)
15567 struct __ecereNameSpace__ecere__com__Class * sClass;
15568 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15570 for(sClass = cClass->base; sClass; sClass = sClass->base)
15571 id += sClass->templateParams.count;
15572 arg = expClass->templateArgs[id];
15573 for(sClass = _class; sClass; sClass = sClass->base)
15575 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15577 struct __ecereNameSpace__ecere__com__Class * nextClass;
15579 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15580 p += nextClass->templateParams.count;
15581 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15583 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15585 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15587 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15588 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15595 char argument[256];
15597 argument[0] = '\0';
15598 switch(param->type)
15602 char expString[1024];
15603 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15604 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15605 struct Expression * exp;
15606 char * string = PrintHexUInt64(arg.expression.ui64);
15608 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15609 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15610 ProcessExpressionType(exp);
15611 ComputeExpression(exp);
15612 expString[0] = '\0';
15613 PrintExpression(exp, expString);
15614 strcat(argument, expString);
15615 FreeExpression(exp);
15620 strcat(argument, arg.member->name);
15625 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15627 if(!strcmp(arg.dataTypeString, "thisclass"))
15628 strcat(argument, thisClassTypeString);
15630 strcat(argument, arg.dataTypeString);
15638 strcat(templateString, ", ");
15639 if(lastParam != p - 1)
15641 strcat(templateString, param->name);
15642 strcat(templateString, " = ");
15644 strcat(templateString, argument);
15653 int len = strlen(templateString);
15655 if(templateString[len - 1] == '>')
15656 templateString[len++] = ' ';
15657 templateString[len++] = '>';
15658 templateString[len++] = '\0';
15661 struct Context * context = SetupTemplatesContext(_class);
15663 FreeType(exp->expType);
15664 exp->expType = ProcessTypeString(templateString, 0x0);
15665 FinishTemplatesContext(context);
15669 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")))))))));
15672 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15674 type = ProcessTemplateParameterType(type->templateParameter);
15677 if(type && (type->kind == 20))
15679 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)))
15681 struct Identifier * id = exp->member.member;
15682 int typeKind = type->kind;
15683 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));
15685 if(typeKind == 19 && exp->member.exp->type == 24)
15687 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15692 if(typeKind == 3 || typeKind == 15)
15693 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15696 if(type->kind == 8 && type->_class && type->_class->registered)
15698 _class = type->_class->registered;
15700 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15702 _class = FindClass("char *")->registered;
15704 else if(type->kind == 13)
15706 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15707 FreeType(exp->expType);
15708 exp->expType = ProcessTypeString("uintptr", 0x0);
15709 exp->byReference = 0x1;
15713 char string[1024] = "";
15714 struct Symbol * classSym;
15716 PrintTypeNoConst(type, string, 0x0, 0x1);
15717 classSym = FindClass(string);
15719 _class = classSym->registered;
15725 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15726 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15727 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15728 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15729 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15731 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15732 exp->member.memberType = 1;
15733 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15734 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15737 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15739 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15740 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15742 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15744 member = (((void *)0));
15746 if(!member && !prop)
15747 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15748 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15749 exp->member.thisPtr = 0x1;
15755 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15756 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15757 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15759 if(!prop && !member)
15761 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15764 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15765 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15766 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15771 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15772 prop = (((void *)0));
15774 member = (((void *)0));
15778 if(!prop && !member && !method)
15779 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15780 if(!prop && !member && !method)
15784 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15787 exp->member.memberType = 5;
15788 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15792 char structName[1024];
15793 struct Identifier * id = exp->member.member;
15794 struct Expression * classExp = exp->member.exp;
15797 FreeType(classExp->expType);
15798 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15799 strcpy(structName, "__ecereClassData_");
15800 FullClassNameCat(structName, type->_class->string, 0x0);
15802 exp->member.member = id;
15803 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"))))))));
15805 ProcessExpressionType(exp);
15811 struct Symbol * classSym = FindClass(id->string);
15815 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15818 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15824 exp->member.memberType = 1;
15825 if(!prop->dataType)
15826 ProcessPropertyType(prop);
15827 exp->expType = prop->dataType;
15829 prop->dataType->refCount++;
15833 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15835 FreeExpContents(exp);
15837 exp->identifier = MkIdentifier("class");
15838 ProcessExpressionType(exp);
15841 exp->member.memberType = 3;
15842 DeclareStruct(_class->fullName, 0x0);
15843 if(!member->dataType)
15845 struct Context * context = SetupTemplatesContext(_class);
15847 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15848 FinishTemplatesContext(context);
15850 exp->expType = member->dataType;
15851 if(member->dataType)
15852 member->dataType->refCount++;
15854 else if(revConvert)
15856 exp->member.memberType = 4;
15857 exp->expType = MkClassType(revConvert->_class->fullName);
15862 exp->member.memberType = 2;
15864 if(!method->dataType)
15865 ProcessMethodType(method);
15866 exp->expType = __extension__ ({
15867 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15869 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15871 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15872 exp->expType->usedClass = _class;
15874 else if(!classProp)
15876 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15878 FreeExpContents(exp);
15880 exp->identifier = MkIdentifier("class");
15881 FreeType(exp->expType);
15882 exp->expType = MkClassType("ecere::com::Class");
15885 yylloc = exp->member.member->loc;
15886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15888 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15890 if(_class && exp->expType)
15892 struct __ecereNameSpace__ecere__com__Class * tClass;
15895 while(tClass && !tClass->templateClass)
15896 tClass = tClass->base;
15897 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15900 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15901 struct __ecereNameSpace__ecere__com__Class * sClass;
15903 for(sClass = tClass; sClass; sClass = sClass->base)
15906 if(sClass->templateClass)
15907 sClass = sClass->templateClass;
15908 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15910 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15912 for(sClass = sClass->base; sClass; sClass = sClass->base)
15913 id += sClass->templateParams.count;
15921 if(curParam && tClass->templateArgs[id].dataTypeString)
15923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15924 struct Context * context = SetupTemplatesContext(tClass);
15926 FreeType(exp->expType);
15927 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15930 if(exp->expType->kind == 21)
15932 FreeType(exp->expType);
15933 exp->expType = ReplaceThisClassType(_class);
15935 if(tClass->templateClass)
15936 exp->expType->passAsTemplate = 0x1;
15939 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15940 if(exp->destType->kind == 21)
15942 FreeType(exp->destType);
15943 exp->destType = ReplaceThisClassType(_class);
15947 FinishTemplatesContext(context);
15950 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15953 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15954 struct __ecereNameSpace__ecere__com__Class * sClass;
15956 for(sClass = tClass; sClass; sClass = sClass->base)
15959 if(sClass->templateClass)
15960 sClass = sClass->templateClass;
15961 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15963 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15965 for(sClass = sClass->base; sClass; sClass = sClass->base)
15966 id += sClass->templateParams.count;
15976 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15977 struct Context * context = SetupTemplatesContext(tClass);
15978 struct Type * basicType;
15980 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15983 if(basicType->kind == 21)
15985 FreeType(basicType);
15986 basicType = ReplaceThisClassType(_class);
15988 FreeType(exp->expType);
15989 exp->expType = __extension__ ({
15990 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15992 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15996 exp->destType = exp->expType;
15997 exp->destType->refCount++;
16000 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16001 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16002 struct Declarator * decl;
16004 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16007 exp->destType->refCount++;
16009 exp->expType->refCount++;
16011 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16012 exp->cast.exp = newExp;
16015 FinishTemplatesContext(context);
16018 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16020 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16024 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16027 int paramCount = 0;
16028 int lastParam = -1;
16029 char templateString[1024];
16030 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16032 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16033 while(cClass != expClass)
16035 struct __ecereNameSpace__ecere__com__Class * sClass;
16037 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16040 for(param = cClass->templateParams.first; param; param = param->next)
16042 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16046 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16048 while(cClassCur != tClass && !paramCur)
16050 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16052 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16054 cClassCur = sClassCur;
16055 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16057 if(!strcmp(paramCur->name, param->name))
16064 if(paramCur && paramCur->type == 0)
16065 arg = tClass->templateArgs[cp];
16067 arg = expClass->templateArgs[p];
16069 char argument[256];
16071 argument[0] = '\0';
16072 switch(param->type)
16076 char expString[1024];
16077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16078 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16079 struct Expression * exp;
16080 char * string = PrintHexUInt64(arg.expression.ui64);
16082 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16083 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16084 ProcessExpressionType(exp);
16085 ComputeExpression(exp);
16086 expString[0] = '\0';
16087 PrintExpression(exp, expString);
16088 strcat(argument, expString);
16089 FreeExpression(exp);
16094 strcat(argument, arg.member->name);
16099 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16100 strcat(argument, arg.dataTypeString);
16107 strcat(templateString, ", ");
16108 if(lastParam != p - 1)
16110 strcat(templateString, param->name);
16111 strcat(templateString, " = ");
16113 strcat(templateString, argument);
16122 int len = strlen(templateString);
16124 if(templateString[len - 1] == '>')
16125 templateString[len++] = ' ';
16126 templateString[len++] = '>';
16127 templateString[len++] = '\0';
16129 FreeType(exp->expType);
16131 struct Context * context = SetupTemplatesContext(tClass);
16133 exp->expType = ProcessTypeString(templateString, 0x0);
16134 FinishTemplatesContext(context);
16141 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)");
16143 else if(type && (type->kind == 9 || type->kind == 10))
16145 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16149 exp->expType = memberType;
16151 memberType->refCount++;
16156 char expString[10240];
16158 expString[0] = '\0';
16161 PrintExpression(exp, expString);
16162 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16164 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16166 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16168 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16170 struct Identifier * id = exp->member.member;
16171 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));
16175 FreeType(exp->expType);
16176 exp->expType = ReplaceThisClassType(_class);
16180 yylloc = oldyylloc;
16185 struct Type * destType = exp->destType;
16187 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16189 exp->member.member->classSym = exp->member.member->_class->symbol;
16191 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16195 ProcessExpressionType(exp);
16202 struct Symbol * classSym = exp->_class->symbol;
16204 if(classSym && classSym->registered)
16206 if(classSym->registered->type == 5)
16211 DeclareStruct(classSym->string, 0x0);
16212 FreeSpecifier(exp->_class);
16214 FullClassNameCat(name, classSym->string, 0x0);
16215 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16219 if(classSym->registered->fixed)
16221 FreeSpecifier(exp->_class);
16222 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16227 char className[1024];
16229 strcpy(className, "__ecereClass_");
16230 FullClassNameCat(className, classSym->string, 0x1);
16231 MangleClassName(className);
16232 DeclareClass(classSym, className);
16233 FreeExpContents(exp);
16235 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16236 exp->member.member = MkIdentifier("structSize");
16240 exp->expType = __extension__ ({
16241 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16243 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16249 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16251 exp->expType = __extension__ ({
16252 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16254 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16256 exp->isConstant = 0x1;
16257 DeclareType(type, 0x0, 0x0);
16263 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16266 FreeType(exp->cast.exp->destType);
16267 exp->cast.exp->destType = type;
16269 ProcessExpressionType(exp->cast.exp);
16271 exp->expType = type;
16272 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16274 void * prev = exp->prev, * next = exp->next;
16275 struct Type * expType = exp->cast.exp->destType;
16276 struct Expression * castExp = exp->cast.exp;
16277 struct Type * destType = exp->destType;
16280 expType->refCount++;
16281 FreeType(exp->expType);
16282 FreeTypeName(exp->cast.typeName);
16284 FreeType(exp->expType);
16285 FreeType(exp->destType);
16286 exp->expType = expType;
16287 exp->destType = destType;
16288 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16294 exp->isConstant = exp->cast.exp->isConstant;
16300 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16302 exp->expType = type;
16307 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16309 ProcessExpressionType(exp->vaArg.exp);
16310 exp->expType = type;
16315 struct Expression * e;
16317 exp->isConstant = 0x1;
16318 FreeType(exp->cond.cond->destType);
16319 exp->cond.cond->destType = MkClassType("bool");
16320 exp->cond.cond->destType->truth = 0x1;
16321 ProcessExpressionType(exp->cond.cond);
16322 if(!exp->cond.cond->isConstant)
16323 exp->isConstant = 0x0;
16324 for(e = (*exp->cond.exp).first; e; e = e->next)
16328 FreeType(e->destType);
16329 e->destType = exp->destType;
16331 e->destType->refCount++;
16333 ProcessExpressionType(e);
16336 exp->expType = e->expType;
16338 e->expType->refCount++;
16341 exp->isConstant = 0x0;
16343 FreeType(exp->cond.elseExp->destType);
16344 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16345 if(exp->cond.elseExp->destType)
16346 exp->cond.elseExp->destType->refCount++;
16347 ProcessExpressionType(exp->cond.elseExp);
16348 if(!exp->cond.elseExp->isConstant)
16349 exp->isConstant = 0x0;
16354 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16356 struct Statement * last = (*exp->compound->compound.statements).last;
16358 if(last->type == 3 && last->expressions && (*last->expressions).last)
16360 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16362 exp->destType->refCount++;
16364 ProcessStatement(exp->compound);
16365 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16367 exp->expType->refCount++;
16373 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16375 if(spec && spec->type == 1)
16377 exp->expType = MkClassType(spec->name);
16378 exp->expType->kind = 19;
16379 exp->byReference = 0x1;
16383 exp->expType = MkClassType("ecere::com::Class");
16384 exp->byReference = 0x1;
16390 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16394 struct Identifier * id = exp->classData.id;
16395 char structName[1024];
16396 struct Expression * classExp;
16398 strcpy(structName, "__ecereClassData_");
16399 FullClassNameCat(structName, _class->fullName, 0x0);
16401 exp->member.member = id;
16402 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16403 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16405 classExp = MkExpIdentifier(MkIdentifier("class"));
16406 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"))))))));
16407 ProcessExpressionType(exp);
16414 struct Type * type = (((void *)0));
16415 char * typeString = (((void *)0));
16416 char typeStringBuf[1024];
16418 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))
16420 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16422 typeString = templateClass->templateArgs[2].dataTypeString;
16426 struct Expression * e;
16428 for(e = (*exp->list).first; e; e = e->next)
16430 ProcessExpressionType(e);
16440 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16444 e->expType = (((void *)0));
16445 e = (*exp->list).first;
16446 ProcessExpressionType(e);
16449 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16451 FreeType(e->expType);
16452 e->expType = (((void *)0));
16454 type = (((void *)0));
16462 FreeType(e->expType);
16463 e->expType = (((void *)0));
16469 typeStringBuf[0] = '\0';
16470 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16471 typeString = typeStringBuf;
16473 type = (((void *)0));
16478 char templateString[1024];
16479 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16480 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16482 struct Expression * expExt;
16483 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16485 sprintf(templateString, "Container<%s>", typeString);
16488 struct Expression * e;
16490 type = ProcessTypeString(typeString, 0x0);
16491 while(e = (*exp->list).first)
16493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16494 e->destType = type;
16496 ProcessExpressionType(e);
16497 ListAdd(initializers, MkInitializerAssignment(e));
16500 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16502 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16503 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16504 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16505 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16506 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16507 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16508 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16509 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16510 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16511 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16512 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16514 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16517 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16519 exp->expType = ProcessTypeString(templateString, 0x0);
16521 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16522 ProcessExpressionType(expExt);
16526 exp->expType = ProcessTypeString("Container", 0x0);
16527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16532 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16534 FreeType(exp->expType);
16535 exp->expType = ReplaceThisClassType(thisClass);
16537 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16539 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16543 if(exp->expType->kind != 15)
16545 struct Type * member;
16546 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16548 FreeType(exp->expType);
16549 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16550 exp->expType->kind = symbol->type->kind;
16551 exp->expType->refCount++;
16552 exp->expType->enumName = enumName;
16553 exp->expType->members = symbol->type->members;
16554 for(member = symbol->type->members.first; member; member = member->next)
16555 member->refCount++;
16559 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16561 for(member = symbol->type->members.first; member; member = member->next)
16563 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16565 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16571 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16573 else if(exp->destType && !exp->destType->keepCast)
16575 if(!CheckExpressionType(exp, exp->destType, 0x0))
16577 if(!exp->destType->count || unresolved)
16582 if(exp->destType->kind != 14)
16589 char expString[10240];
16591 expString[0] = '\0';
16592 PrintType(exp->destType, type2, 0x0, 0x1);
16595 PrintExpression(exp, expString);
16596 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16600 else if(exp->type != 16)
16601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16606 char expString[10240];
16608 expString[0] = '\0';
16611 PrintExpression(exp, expString);
16612 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16616 else if(exp->type != 16)
16617 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16629 PrintType(exp->expType, type1, 0x0, 0x1);
16630 PrintType(exp->destType, type2, 0x0, 0x1);
16632 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)))
16636 char expString[10240];
16638 expString[0] = '\0';
16641 PrintExpression(exp, expString);
16642 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16644 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16645 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16646 FreeType(exp->expType);
16647 exp->destType->refCount++;
16648 exp->expType = exp->destType;
16653 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16655 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16656 char typeString[1024];
16657 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16658 struct Declarator * decl;
16660 typeString[0] = '\0';
16663 exp->expType->refCount++;
16665 exp->expType->refCount++;
16667 newExp->destType = exp->expType;
16668 PrintType(exp->expType, typeString, 0x0, 0x0);
16669 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16670 exp->cast.typeName = MkTypeName(specs, decl);
16671 exp->cast.exp = newExp;
16674 else if(unresolved)
16676 if(exp->identifier->_class && exp->identifier->_class->name)
16677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16678 else if(exp->identifier->string && exp->identifier->string[0])
16679 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16681 else if(!exp->expType && exp->type != 16)
16683 char expString[10240];
16685 expString[0] = '\0';
16688 PrintExpression(exp, expString);
16689 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16694 ApplyAnyObjectLogic(exp);
16695 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)))
16697 exp->byReference = 0x1;
16699 yylloc = oldyylloc;
16702 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)
16706 *curMember = (*curMember)->next;
16707 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16709 *curMember = subMemberStack[--(*subMemberStackPos)];
16710 *curMember = (*curMember)->next;
16712 while((*curMember) && (*curMember)->isProperty)
16713 *curMember = (*curMember)->next;
16714 if(subMemberStackPos)
16716 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16718 subMemberStack[(*subMemberStackPos)++] = *curMember;
16719 *curMember = (*curMember)->members.first;
16720 while(*curMember && (*curMember)->isProperty)
16721 *curMember = (*curMember)->next;
16729 if(subMemberStackPos && *subMemberStackPos)
16731 *curMember = subMemberStack[--(*subMemberStackPos)];
16732 *curMember = (*curMember)->next;
16736 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16738 if(*curClass == _class)
16740 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16742 *curMember = (*curClass)->membersAndProperties.first;
16744 while((*curMember) && (*curMember)->isProperty)
16745 *curMember = (*curMember)->next;
16746 if(subMemberStackPos)
16748 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16750 subMemberStack[(*subMemberStackPos)++] = *curMember;
16751 *curMember = (*curMember)->members.first;
16752 while(*curMember && (*curMember)->isProperty)
16753 *curMember = (*curMember)->next;
16760 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16765 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16767 if(init->exp && !init->exp->destType)
16769 FreeType(init->exp->destType);
16770 init->exp->destType = type;
16776 ProcessExpressionType(init->exp);
16777 init->isConstant = init->exp->isConstant;
16783 struct Expression * exp = init->exp;
16784 struct Instantiation * inst = exp->instance;
16785 struct MembersInit * members;
16788 init->list = MkList();
16791 for(members = (*inst->members).first; members; members = members->next)
16793 if(members->type == 0)
16795 struct MemberInit * member;
16797 for(member = (*members->dataMembers).first; member; member = member->next)
16799 ListAdd(init->list, member->initializer);
16800 member->initializer = (((void *)0));
16805 FreeExpression(exp);
16809 struct Initializer * i;
16810 struct Type * initializerType = (((void *)0));
16811 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16812 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16813 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16814 int subMemberStackPos = 0;
16816 if(type && type->kind == 12)
16817 initializerType = Dereference(type);
16818 else if(type && (type->kind == 9 || type->kind == 10))
16819 initializerType = type->members.first;
16820 for(i = (*init->list).first; i; i = i->next)
16822 if(type && type->kind == 8 && type->_class && type->_class->registered)
16824 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16827 if(!curMember->dataType)
16828 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16829 initializerType = curMember->dataType;
16832 ProcessInitializer(i, initializerType);
16833 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16834 initializerType = initializerType->next;
16836 init->isConstant = 0x0;
16838 if(type && type->kind == 12)
16839 FreeType(initializerType);
16840 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16849 extern struct Symbol * FindType(struct Context * ctx, char * name);
16851 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16853 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16859 if(spec->specifier == THISCLASS)
16864 spec->name = ReplaceThisClass(thisClass);
16865 spec->symbol = FindClass(spec->name);
16866 ProcessSpecifier(spec, declareStruct);
16873 struct Symbol * symbol = FindType(curContext, spec->name);
16876 DeclareType(symbol->type, 0x1, 0x1);
16877 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16878 DeclareStruct(spec->name, 0x0);
16883 struct Enumerator * e;
16887 for(e = (*spec->list).first; e; e = e->next)
16890 ProcessExpressionType(e->exp);
16898 if(spec->definitions)
16900 struct ClassDef * def;
16901 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16903 ProcessClass(spec->definitions, symbol);
16910 static void ProcessDeclarator(struct Declarator * decl)
16915 if(decl->identifier->classSym)
16917 FreeSpecifier(decl->identifier->_class);
16918 decl->identifier->_class = (((void *)0));
16922 if(decl->array.exp)
16923 ProcessExpressionType(decl->array.exp);
16930 if(decl->declarator)
16931 ProcessDeclarator(decl->declarator);
16932 if(decl->type == 4)
16934 struct Identifier * id = GetDeclId(decl);
16936 if(id && id->_class)
16938 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16940 if(!decl->function.parameters)
16941 decl->function.parameters = MkList();
16942 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16943 id->_class = (((void *)0));
16945 if(decl->function.parameters)
16947 struct TypeName * param;
16949 for(param = (*decl->function.parameters).first; param; param = param->next)
16951 if(param->qualifiers && (*param->qualifiers).first)
16953 struct Specifier * spec = (*param->qualifiers).first;
16955 if(spec && spec->specifier == TYPED_OBJECT)
16957 struct Declarator * d = param->declarator;
16958 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);
16960 FreeList(param->qualifiers, FreeSpecifier);
16961 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16962 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16963 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16966 else if(spec && spec->specifier == ANY_OBJECT)
16968 struct Declarator * d = param->declarator;
16970 FreeList(param->qualifiers, FreeSpecifier);
16971 param->qualifiers = MkListOne(MkSpecifier(VOID));
16972 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16974 else if(spec->specifier == THISCLASS)
16979 spec->name = ReplaceThisClass(thisClass);
16980 spec->symbol = FindClass(spec->name);
16981 ProcessSpecifier(spec, 0x0);
16985 if(param->declarator)
16986 ProcessDeclarator(param->declarator);
16994 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16996 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16998 static void ProcessDeclaration(struct Declaration * decl)
17000 yylloc = decl->loc;
17005 unsigned int declareStruct = 0x0;
17007 if(decl->declarators)
17009 struct InitDeclarator * d;
17011 for(d = (*decl->declarators).first; d; d = d->next)
17013 struct Type * type, * subType;
17015 ProcessDeclarator(d->declarator);
17016 type = ProcessType(decl->specifiers, d->declarator);
17019 ProcessInitializer(d->initializer, type);
17020 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17022 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17024 struct Instantiation * inst = d->initializer->exp->instance;
17026 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17027 d->initializer->exp->instance = (((void *)0));
17028 if(decl->specifiers)
17029 FreeList(decl->specifiers, FreeSpecifier);
17030 FreeList(decl->declarators, FreeInitDeclarator);
17037 for(subType = type; subType; )
17039 if(subType->kind == 8)
17041 declareStruct = 0x1;
17044 else if(subType->kind == 13)
17046 else if(subType->kind == 12)
17047 subType = subType->arrayType;
17056 if(decl->specifiers)
17058 struct Specifier * s;
17060 for(s = (*decl->specifiers).first; s; s = s->next)
17062 ProcessSpecifier(s, declareStruct);
17069 ProcessInstantiationType(decl->inst);
17074 struct Specifier * spec;
17075 struct Declarator * d;
17076 unsigned int declareStruct = 0x0;
17078 if(decl->declarators)
17080 for(d = (*decl->declarators).first; d; d = d->next)
17082 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17083 struct Type * subType;
17085 ProcessDeclarator(d);
17086 for(subType = type; subType; )
17088 if(subType->kind == 8)
17090 declareStruct = 0x1;
17093 else if(subType->kind == 13)
17095 else if(subType->kind == 12)
17096 subType = subType->arrayType;
17103 if(decl->specifiers)
17105 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17106 ProcessSpecifier(spec, declareStruct);
17113 static struct FunctionDefinition * curFunction;
17115 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17117 char propName[1024], propNameM[1024];
17118 char getName[1024], setName[1024];
17119 struct __ecereNameSpace__ecere__sys__OldList * args;
17121 DeclareProperty(prop, setName, getName);
17122 strcpy(propName, "__ecereProp_");
17123 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17124 strcat(propName, "_");
17125 FullClassNameCat(propName, prop->name, 0x1);
17126 MangleClassName(propName);
17127 strcpy(propNameM, "__ecerePropM_");
17128 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17129 strcat(propNameM, "_");
17130 FullClassNameCat(propNameM, prop->name, 0x1);
17131 MangleClassName(propNameM);
17132 if(prop->isWatchable)
17135 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17136 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17137 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17139 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17140 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17141 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17145 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17146 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17147 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17149 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17150 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17151 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17153 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17154 curFunction->propSet->fireWatchersDone = 0x1;
17157 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17159 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17161 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17163 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17165 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17167 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17169 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17171 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17173 static void ProcessStatement(struct Statement * stmt)
17175 yylloc = stmt->loc;
17179 ProcessStatement(stmt->labeled.stmt);
17182 if(stmt->caseStmt.exp)
17184 FreeType(stmt->caseStmt.exp->destType);
17185 stmt->caseStmt.exp->destType = curSwitchType;
17187 curSwitchType->refCount++;
17188 ProcessExpressionType(stmt->caseStmt.exp);
17189 ComputeExpression(stmt->caseStmt.exp);
17191 if(stmt->caseStmt.stmt)
17192 ProcessStatement(stmt->caseStmt.stmt);
17196 if(stmt->compound.context)
17198 struct Declaration * decl;
17199 struct Statement * s;
17200 struct Statement * prevCompound = curCompound;
17201 struct Context * prevContext = curContext;
17203 if(!stmt->compound.isSwitch)
17204 curCompound = stmt;
17205 curContext = stmt->compound.context;
17206 if(stmt->compound.declarations)
17208 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17209 ProcessDeclaration(decl);
17211 if(stmt->compound.statements)
17213 for(s = (*stmt->compound.statements).first; s; s = s->next)
17214 ProcessStatement(s);
17216 curContext = prevContext;
17217 curCompound = prevCompound;
17223 struct Expression * exp;
17225 if(stmt->expressions)
17227 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17228 ProcessExpressionType(exp);
17234 struct Expression * exp;
17236 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17237 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17238 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17239 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17241 ProcessExpressionType(exp);
17243 if(stmt->ifStmt.stmt)
17244 ProcessStatement(stmt->ifStmt.stmt);
17245 if(stmt->ifStmt.elseStmt)
17246 ProcessStatement(stmt->ifStmt.elseStmt);
17251 struct Type * oldSwitchType = curSwitchType;
17253 if(stmt->switchStmt.exp)
17255 struct Expression * exp;
17257 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17261 ProcessExpressionType(exp);
17264 curSwitchType = exp->expType;
17267 ProcessStatement(stmt->switchStmt.stmt);
17268 curSwitchType = oldSwitchType;
17273 if(stmt->whileStmt.exp)
17275 struct Expression * exp;
17277 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17278 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17279 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17280 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17282 ProcessExpressionType(exp);
17285 if(stmt->whileStmt.stmt)
17286 ProcessStatement(stmt->whileStmt.stmt);
17291 if(stmt->doWhile.exp)
17293 struct Expression * exp;
17295 if((*stmt->doWhile.exp).last)
17297 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17298 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17299 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17301 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17303 ProcessExpressionType(exp);
17306 if(stmt->doWhile.stmt)
17307 ProcessStatement(stmt->doWhile.stmt);
17312 struct Expression * exp;
17314 if(stmt->forStmt.init)
17315 ProcessStatement(stmt->forStmt.init);
17316 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17318 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17319 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17320 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17322 if(stmt->forStmt.check)
17323 ProcessStatement(stmt->forStmt.check);
17324 if(stmt->forStmt.increment)
17326 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17327 ProcessExpressionType(exp);
17329 if(stmt->forStmt.stmt)
17330 ProcessStatement(stmt->forStmt.stmt);
17335 struct Identifier * id = stmt->forEachStmt.id;
17336 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17337 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17338 struct Statement * block = stmt->forEachStmt.stmt;
17339 char iteratorType[1024];
17340 struct Type * source;
17341 struct Expression * e;
17342 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));
17343 struct Expression * arrayExp;
17344 char * typeString = (((void *)0));
17345 int builtinCount = 0;
17347 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17351 FreeType(e->destType);
17352 e->destType = ProcessTypeString("Container", 0x0);
17354 if(!isBuiltin || e->next)
17355 ProcessExpressionType(e);
17357 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17358 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17360 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17361 struct Symbol * symbol;
17362 struct Expression * expIt = (((void *)0));
17363 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17364 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17365 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17366 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17369 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17370 stmt->compound.context->parent = curContext;
17371 curContext = stmt->compound.context;
17372 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17374 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17375 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17377 isCustomAVLTree = 0x1;
17378 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17380 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17383 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17385 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17387 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17390 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17394 struct Declarator * decl;
17395 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17397 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17398 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17399 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17403 struct Type * type = (((void *)0));
17404 char typeStringBuf[1024];
17406 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17407 if(((struct Expression *)(*exp).last)->type == 11)
17409 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17412 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17414 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)
17416 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17418 typeString = templateClass->templateArgs[2].dataTypeString;
17420 else if(arrayExp->list)
17422 struct Expression * e;
17424 for(e = (*arrayExp->list).first; e; e = e->next)
17426 ProcessExpressionType(e);
17436 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17440 e->expType = (((void *)0));
17441 e = (*arrayExp->list).first;
17442 ProcessExpressionType(e);
17445 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17447 FreeType(e->expType);
17448 e->expType = (((void *)0));
17450 type = (((void *)0));
17458 FreeType(e->expType);
17459 e->expType = (((void *)0));
17465 typeStringBuf[0] = '\0';
17466 PrintType(type, typeStringBuf, 0x0, 0x1);
17467 typeString = typeStringBuf;
17473 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17474 struct Declarator * decl;
17475 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17479 struct Expression * e;
17481 builtinCount = (*arrayExp->list).count;
17482 type = ProcessTypeString(typeString, 0x0);
17483 while(e = (*arrayExp->list).first)
17485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17486 e->destType = type;
17488 ProcessExpressionType(e);
17489 ListAdd(initializers, MkInitializerAssignment(e));
17492 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17494 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17495 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17496 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17497 FreeList(exp, FreeExpression);
17501 arrayExp->expType = ProcessTypeString("Container", 0x0);
17502 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17505 else if(isLinkList && !isList)
17507 struct Declarator * decl;
17508 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17510 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17511 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17512 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17514 else if(_class->templateArgs)
17517 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17519 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17520 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17522 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17525 switch(block->type)
17528 if(block->compound.context)
17529 block->compound.context->parent = stmt->compound.context;
17532 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17533 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17534 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17535 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17538 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17539 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17542 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17543 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17546 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17547 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17550 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17551 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17554 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17555 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17561 block = MkIfStmt(filter, block, (((void *)0)));
17565 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));
17566 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17567 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17568 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17574 sprintf(count, "%d", builtinCount);
17575 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));
17576 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17577 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17578 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17580 else if(isLinkList && !isList)
17582 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17583 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17585 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17587 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));
17591 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17592 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17594 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));
17596 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17597 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17598 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17602 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17604 ProcessExpressionType(expIt);
17605 if((*stmt->compound.declarations).first)
17606 ProcessDeclaration((*stmt->compound.declarations).first);
17608 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17609 ProcessStatement(stmt);
17610 curContext = stmt->compound.context->parent;
17615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17627 struct Expression * exp;
17629 if(stmt->expressions)
17631 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17635 if(curFunction && !curFunction->type)
17636 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17637 FreeType(exp->destType);
17638 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17640 exp->destType->refCount++;
17642 ProcessExpressionType(exp);
17649 ProcessDeclaration(stmt->decl);
17654 struct AsmField * field;
17656 if(stmt->asmStmt.inputFields)
17658 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17659 if(field->expression)
17660 ProcessExpressionType(field->expression);
17662 if(stmt->asmStmt.outputFields)
17664 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17665 if(field->expression)
17666 ProcessExpressionType(field->expression);
17668 if(stmt->asmStmt.clobberedFields)
17670 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17672 if(field->expression)
17673 ProcessExpressionType(field->expression);
17680 struct PropertyWatch * propWatch;
17681 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17682 struct Expression * object = stmt->_watch.object;
17683 struct Expression * watcher = stmt->_watch.watcher;
17686 ProcessExpressionType(watcher);
17688 ProcessExpressionType(object);
17691 if(watcher || thisClass)
17693 struct External * external = curExternal;
17694 struct Context * context = curContext;
17697 stmt->expressions = MkList();
17698 curExternal = external->prev;
17699 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17701 struct ClassFunction * func;
17702 char watcherName[1024];
17703 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17704 struct External * createdExternal;
17705 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17708 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17709 if(propWatch->deleteWatch)
17710 strcat(watcherName, "_delete");
17713 struct Identifier * propID;
17715 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17717 strcat(watcherName, "_");
17718 strcat(watcherName, propID->string);
17721 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17723 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17724 ProcessClassFunctionBody(func, propWatch->compound);
17725 propWatch->compound = (((void *)0));
17726 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17727 createdExternal->symbol->idCode = external->symbol->idCode;
17728 curExternal = createdExternal;
17729 ProcessFunction(createdExternal->function);
17731 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17733 externalDecl->declaration = decl;
17734 if(decl->symbol && !decl->symbol->pointerExternal)
17735 decl->symbol->pointerExternal = externalDecl;
17737 if(propWatch->deleteWatch)
17739 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17741 ListAdd(args, CopyExpression(object));
17742 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17743 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17744 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17748 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17749 struct Identifier * propID;
17751 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17753 char propName[1024];
17754 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17758 char getName[1024], setName[1024];
17759 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17761 DeclareProperty(prop, setName, getName);
17762 strcpy(propName, "__ecereProp_");
17763 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17764 strcat(propName, "_");
17765 FullClassNameCat(propName, prop->name, 0x1);
17766 ListAdd(args, CopyExpression(object));
17767 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17768 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17769 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17770 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17773 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17780 curExternal = external;
17781 curContext = context;
17783 FreeExpression(watcher);
17785 FreeExpression(object);
17786 FreeList(watches, FreePropertyWatch);
17789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17793 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17795 ProcessStatement(propWatch->compound);
17802 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17803 struct Expression * object = stmt->_watch.object;
17804 struct __ecereNameSpace__ecere__com__Class * _class;
17807 ProcessExpressionType(object);
17810 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17813 struct Identifier * propID;
17816 stmt->expressions = MkList();
17817 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17819 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17826 for(propID = (*watches).first; propID; propID = propID->next)
17828 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17832 CreateFireWatcher(prop, object, stmt);
17835 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17840 struct __ecereNameSpace__ecere__com__Property * prop;
17841 struct __ecereNameSpace__ecere__com__Class * base;
17843 for(base = _class; base; base = base->base)
17845 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17847 if(prop->isProperty && prop->isWatchable)
17849 CreateFireWatcher(prop, object, stmt);
17855 FreeExpression(object);
17856 FreeList(watches, FreeIdentifier);
17859 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17865 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17866 struct Expression * object = stmt->_watch.object;
17867 struct Expression * watcher = stmt->_watch.watcher;
17868 struct __ecereNameSpace__ecere__com__Class * _class;
17871 ProcessExpressionType(object);
17873 ProcessExpressionType(watcher);
17876 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17877 if(watcher || thisClass)
17881 struct Identifier * propID;
17884 stmt->expressions = MkList();
17887 struct __ecereNameSpace__ecere__sys__OldList * args;
17890 ListAdd(args, CopyExpression(object));
17891 ListAdd(args, MkExpConstant("0"));
17892 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17893 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17897 for(propID = (*watches).first; propID; propID = propID->next)
17899 char propName[1024];
17900 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17904 char getName[1024], setName[1024];
17905 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17907 DeclareProperty(prop, setName, getName);
17908 strcpy(propName, "__ecereProp_");
17909 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17910 strcat(propName, "_");
17911 FullClassNameCat(propName, prop->name, 0x1);
17912 MangleClassName(propName);
17913 ListAdd(args, CopyExpression(object));
17914 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17915 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17916 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17919 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17923 FreeExpression(object);
17925 FreeExpression(watcher);
17926 FreeList(watches, FreeIdentifier);
17929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17939 extern struct Expression * QBrackets(struct Expression * exp);
17941 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17943 extern struct Declarator * QMkPtrDecl(char * id);
17945 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17947 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17949 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17951 static void ProcessFunction(struct FunctionDefinition * function)
17953 struct Identifier * id = GetDeclId(function->declarator);
17954 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17955 struct Type * type = symbol ? symbol->type : (((void *)0));
17956 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17957 struct Context * oldTopContext = topContext;
17959 yylloc = function->loc;
17960 if(type && type->thisClass)
17962 struct Symbol * classSym = type->thisClass;
17963 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17964 char className[1024];
17965 char structName[1024];
17966 struct Declarator * funcDecl;
17967 struct Symbol * thisSymbol;
17968 unsigned int typedObject = 0x0;
17970 if(_class && !_class->base)
17972 _class = currentClass;
17973 if(_class && !_class->symbol)
17974 _class->symbol = FindClass(_class->fullName);
17975 classSym = _class ? _class->symbol : (((void *)0));
17978 thisClass = _class;
17979 if(inCompiler && _class)
17981 if(type->kind == 11)
17983 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17985 struct Type * param = symbol->type->params.first;
17987 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17990 if(type->classObjectType != 1)
17992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17993 symbol->type->staticMethod = 0x1;
17994 symbol->type->thisClass = (((void *)0));
17995 symbol->type->extraParam = 0x0;
17998 strcpy(className, "__ecereClass_");
17999 FullClassNameCat(className, _class->fullName, 0x1);
18000 MangleClassName(className);
18001 structName[0] = (char)0;
18002 FullClassNameCat(structName, _class->fullName, 0x0);
18003 funcDecl = GetFuncDecl(function->declarator);
18006 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18008 struct TypeName * param = (*funcDecl->function.parameters).first;
18010 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18013 FreeTypeName(param);
18016 if(!function->propertyNoThis)
18018 struct TypeName * thisParam;
18020 if(type->classObjectType != 1)
18022 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18023 if(!funcDecl->function.parameters)
18024 funcDecl->function.parameters = MkList();
18025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18029 if(type->classObjectType != 1)
18031 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18032 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18034 thisParam = __extension__ ({
18035 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18037 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18043 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18045 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18047 funcDecl = GetFuncDecl(initDecl->declarator);
18050 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18052 struct TypeName * param = (*funcDecl->function.parameters).first;
18054 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18056 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18057 FreeTypeName(param);
18060 if(type->classObjectType != 1)
18062 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18064 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18066 if(!funcDecl->function.parameters)
18067 funcDecl->function.parameters = MkList();
18068 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18076 if(type->classObjectType != 1)
18078 thisSymbol = __extension__ ({
18079 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18081 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18083 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18084 if(typedObject && thisSymbol->type)
18086 thisSymbol->type->classObjectType = 2;
18087 thisSymbol->type->byReference = type->byReference;
18088 thisSymbol->type->typedByReference = type->byReference;
18092 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18094 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18097 struct __ecereNameSpace__ecere__com__Class * base;
18099 for(base = _class; base && base->type != 1000; base = base->next)
18101 for(member = base->membersAndProperties.first; member; member = member->next)
18102 if(!member->isProperty)
18108 for(member = _class->membersAndProperties.first; member; member = member->next)
18109 if(!member->isProperty)
18113 char pointerName[1024];
18114 struct Declaration * decl;
18115 struct Initializer * initializer;
18116 struct Expression * exp, * bytePtr;
18118 strcpy(pointerName, "__ecerePointer_");
18119 FullClassNameCat(pointerName, _class->fullName, 0x0);
18121 char className[1024];
18123 strcpy(className, "__ecereClass_");
18124 FullClassNameCat(className, classSym->string, 0x1);
18125 MangleClassName(className);
18126 DeclareClass(classSym, className);
18128 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18133 sprintf(string, "%d", _class->offset);
18134 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18138 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18140 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18141 exp->expType = __extension__ ({
18142 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18144 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18145 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18147 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18148 }), __ecereInstance2;
18152 yylloc = function->body->loc;
18153 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18155 struct Context * prevContext = curContext;
18157 curContext = function->body->compound.context;
18158 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18159 curContext = prevContext;
18161 decl->symbol = (((void *)0));
18162 if(!function->body->compound.declarations)
18163 function->body->compound.declarations = MkList();
18164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18170 thisClass = (((void *)0));
18173 FreeSpecifier(id->_class);
18174 id->_class = (((void *)0));
18175 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18177 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18179 id = GetDeclId(initDecl->declarator);
18180 FreeSpecifier(id->_class);
18181 id->_class = (((void *)0));
18185 topContext = function->body->compound.context;
18187 struct FunctionDefinition * oldFunction = curFunction;
18189 curFunction = function;
18191 ProcessStatement(function->body);
18192 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18194 struct Statement * prevCompound = curCompound;
18195 struct Context * prevContext = curContext;
18196 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18198 if(!function->body->compound.statements)
18199 function->body->compound.statements = MkList();
18200 ListAdd(function->body->compound.statements, fireWatchers);
18201 curCompound = function->body;
18202 curContext = function->body->compound.context;
18203 ProcessStatement(fireWatchers);
18204 curContext = prevContext;
18205 curCompound = prevCompound;
18207 curFunction = oldFunction;
18209 if(function->declarator)
18211 ProcessDeclarator(function->declarator);
18213 topContext = oldTopContext;
18214 thisClass = oldThisClass;
18217 extern void FreeSymbol(struct Symbol * symbol);
18219 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18221 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18223 struct ClassDef * def;
18224 struct External * external = curExternal;
18225 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18227 for(def = definitions->first; def; def = def->next)
18231 if(def->function->declarator)
18232 curExternal = def->function->declarator->symbol->pointerExternal;
18234 curExternal = external;
18235 ProcessFunction((struct FunctionDefinition *)def->function);
18237 else if(def->type == 2)
18239 if(def->decl->type == 2)
18241 thisClass = regClass;
18242 ProcessInstantiationType(def->decl->inst);
18243 thisClass = (((void *)0));
18247 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18250 thisClass = regClass;
18251 ProcessDeclaration(def->decl);
18252 thisClass = backThisClass;
18255 else if(def->type == 1 && def->defProperties)
18257 struct MemberInit * defProperty;
18258 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);
18260 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18261 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18263 thisClass = regClass;
18264 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18265 thisClass = (((void *)0));
18267 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18268 FreeSymbol(thisSymbol);
18270 else if(def->type == 3 && def->propertyDef)
18272 struct PropertyDef * prop = def->propertyDef;
18274 thisClass = regClass;
18279 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18281 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18283 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18284 ProcessStatement(prop->setStmt);
18290 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18292 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18294 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18295 ProcessStatement(prop->getStmt);
18297 if(prop->issetStmt)
18301 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18303 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18305 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18306 ProcessStatement(prop->issetStmt);
18308 thisClass = (((void *)0));
18310 else if(def->type == 4 && def->propertyWatch)
18312 struct PropertyWatch * propertyWatch = def->propertyWatch;
18314 thisClass = regClass;
18315 if(propertyWatch->compound)
18317 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);
18319 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18320 curExternal = (((void *)0));
18321 ProcessStatement(propertyWatch->compound);
18323 thisClass = (((void *)0));
18328 void DeclareFunctionUtil(char * s)
18330 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18337 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18338 strcpy(name, "__ecereFunction_");
18339 FullClassNameCat(name, s, 0x0);
18340 DeclareFunction(function, name);
18344 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18346 void ComputeDataTypes()
18348 struct External * external;
18349 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18350 struct External * after = (((void *)0));
18352 currentClass = (((void *)0));
18353 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18354 for(external = (*ast).first; external; external = external->next)
18356 if(external->type == 1)
18358 struct Declaration * decl = external->declaration;
18362 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18366 struct InitDeclarator * initDecl = (*decls).first;
18370 struct Declarator * declarator = initDecl->declarator;
18372 if(declarator && declarator->type == 1)
18374 struct Identifier * id = declarator->identifier;
18376 if(id && id->string)
18378 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18380 external->symbol->id = -1001, external->symbol->idCode = -1001;
18390 temp->symbol = __extension__ ({
18391 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18393 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18396 curExternal = temp;
18397 DeclareFunctionUtil("eSystem_New");
18398 DeclareFunctionUtil("eSystem_New0");
18399 DeclareFunctionUtil("eSystem_Renew");
18400 DeclareFunctionUtil("eSystem_Renew0");
18401 DeclareFunctionUtil("eSystem_Delete");
18402 DeclareFunctionUtil("eClass_GetProperty");
18403 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18404 DeclareStruct("ecere::com::Class", 0x0);
18405 DeclareStruct("ecere::com::Instance", 0x0);
18406 DeclareStruct("ecere::com::Property", 0x0);
18407 DeclareStruct("ecere::com::DataMember", 0x0);
18408 DeclareStruct("ecere::com::Method", 0x0);
18409 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18410 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18412 for(external = (*ast).first; external; external = external->next)
18414 afterExternal = curExternal = external;
18415 if(external->type == 0)
18417 currentClass = external->function->_class;
18418 ProcessFunction(external->function);
18420 else if(external->type == 1)
18422 currentClass = (((void *)0));
18423 ProcessDeclaration(external->declaration);
18425 else if(external->type == 2)
18427 struct ClassDefinition * _class = external->_class;
18429 currentClass = external->symbol->registered;
18430 if(_class->definitions)
18432 ProcessClass(_class->definitions, _class->symbol);
18436 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18437 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18440 else if(external->type == 4)
18442 thisNameSpace = external->id->string;
18445 currentClass = (((void *)0));
18446 thisNameSpace = (((void *)0));
18447 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18448 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18451 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);
18453 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);
18455 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18457 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18459 struct __ecereNameSpace__ecere__com__Class * class;
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18490 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18494 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18507 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18508 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18509 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18510 __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);
18511 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18513 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18514 __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);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18527 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18528 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18529 __ecereClass_Conversion = class;
18530 __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);
18531 __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);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18533 __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);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18535 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18536 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18537 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18538 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18539 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18540 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18541 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18542 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18543 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18544 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18545 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18546 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18547 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18548 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18549 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18550 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18551 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18552 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18553 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18554 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18557 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)