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 * __ecereNameSpace__ecere__sys__CopyString(char * string);
1477 char * PrintInt(long long result)
1481 if(result > (((long long)0x7fffffffffffffffLL)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1488 char * PrintUInt(uint64 result)
1492 if(result > (0xffffffff))
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1494 else if(result > (((int)0x7fffffff)))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1501 char * PrintInt64(long long result)
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1506 return __ecereNameSpace__ecere__sys__CopyString(temp);
1509 char * PrintUInt64(uint64 result)
1513 if(result > (((long long)0x7fffffffffffffffLL)))
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1520 char * PrintHexUInt(uint64 result)
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 char * PrintHexUInt64(uint64 result)
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 char * PrintShort(short result)
1546 sprintf(temp, "%d", (unsigned short)result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1550 char * PrintUShort(unsigned short result)
1554 if(result > (unsigned short)32767)
1555 sprintf(temp, "0x%X", (int)result);
1557 sprintf(temp, "%d", (int)result);
1558 return __ecereNameSpace__ecere__sys__CopyString(temp);
1561 extern int isprint(int c);
1563 char * PrintChar(char result)
1567 if(result > (char)0 && isprint(result))
1568 sprintf(temp, "'%c'", result);
1569 else if(result < (char)0)
1570 sprintf(temp, "%d", (int)result);
1572 sprintf(temp, "0x%X", (unsigned char)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 char * PrintUChar(unsigned char result)
1580 sprintf(temp, "0x%X", result);
1581 return __ecereNameSpace__ecere__sys__CopyString(temp);
1584 extern char * strcpy(char * , const char * );
1586 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1588 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1590 extern int (* __ecereProp_float_Get_signBit)(float this);
1592 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1594 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1596 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1598 char * PrintFloat(float result)
1602 if(__ecereProp_float_Get_isInf(result))
1604 if(__ecereProp_float_Get_signBit(result))
1605 strcpy(temp, "-inf");
1607 strcpy(temp, "inf");
1609 else if(__ecereProp_float_Get_isNan(result))
1611 if(__ecereProp_float_Get_signBit(result))
1612 strcpy(temp, "-nan");
1614 strcpy(temp, "nan");
1617 sprintf(temp, "%.16ff", result);
1618 return __ecereNameSpace__ecere__sys__CopyString(temp);
1621 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1623 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1625 extern int (* __ecereProp_double_Get_signBit)(double this);
1627 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1629 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1631 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1633 char * PrintDouble(double result)
1637 if(__ecereProp_double_Get_isInf(result))
1639 if(__ecereProp_double_Get_signBit(result))
1640 strcpy(temp, "-inf");
1642 strcpy(temp, "inf");
1644 else if(__ecereProp_double_Get_isNan(result))
1646 if(__ecereProp_double_Get_signBit(result))
1647 strcpy(temp, "-nan");
1649 strcpy(temp, "nan");
1652 sprintf(temp, "%.16f", result);
1653 return __ecereNameSpace__ecere__sys__CopyString(temp);
1656 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1660 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1661 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* Neg)(struct Expression *, struct Operand *);
1666 unsigned int (* Inc)(struct Expression *, struct Operand *);
1667 unsigned int (* Dec)(struct Expression *, struct Operand *);
1668 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1680 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* Not)(struct Expression *, struct Operand *);
1686 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1695 } __attribute__ ((gcc_struct));
1697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1703 unsigned int ptrSize;
1716 } __attribute__ ((gcc_struct));
1718 } __attribute__ ((gcc_struct));
1720 unsigned int GetOpInt(struct Operand * op2, int * value2)
1722 if(op2->kind == 3 && op2->type->isSigned)
1724 else if(op2->kind == 3)
1725 *value2 = (int)op2->ui;
1726 else if(op2->kind == 4 && op2->type->isSigned)
1727 *value2 = (int)op2->i64;
1728 else if(op2->kind == 4)
1729 *value2 = (int)op2->ui64;
1730 else if(op2->kind == 23 && op2->type->isSigned)
1731 *value2 = (int)op2->i64;
1732 else if(op2->kind == 23)
1733 *value2 = (int)op2->ui64;
1734 else if(op2->kind == 22 && op2->type->isSigned)
1735 *value2 = (int)op2->i64;
1736 else if(op2->kind == 22)
1737 *value2 = (int)op2->ui64;
1738 else if(op2->kind == 2 && op2->type->isSigned)
1739 *value2 = (int)op2->s;
1740 else if(op2->kind == 2)
1741 *value2 = (int)op2->us;
1742 else if(op2->kind == 1 && op2->type->isSigned)
1743 *value2 = (int)op2->c;
1744 else if(op2->kind == 24 || op2->kind == 1)
1745 *value2 = (int)op2->uc;
1746 else if(op2->kind == 6)
1747 *value2 = (int)op2->f;
1748 else if(op2->kind == 7)
1749 *value2 = (int)op2->d;
1750 else if(op2->kind == 13)
1751 *value2 = (int)op2->ui64;
1757 struct Operand GetOperand(struct Expression * exp);
1759 unsigned int GetInt(struct Expression * exp, int * value2)
1761 struct Operand op2 = GetOperand(exp);
1763 return GetOpInt(&op2, value2);
1766 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1768 if(op2->kind == 3 && op2->type->isSigned)
1769 *value2 = (unsigned int)op2->i;
1770 else if(op2->kind == 3)
1772 else if(op2->kind == 4 && op2->type->isSigned)
1773 *value2 = (unsigned int)op2->i64;
1774 else if(op2->kind == 4)
1775 *value2 = (unsigned int)op2->ui64;
1776 else if(op2->kind == 23 && op2->type->isSigned)
1777 *value2 = (unsigned int)op2->i64;
1778 else if(op2->kind == 23)
1779 *value2 = (unsigned int)op2->ui64;
1780 else if(op2->kind == 22 && op2->type->isSigned)
1781 *value2 = (unsigned int)op2->i64;
1782 else if(op2->kind == 22)
1783 *value2 = (unsigned int)op2->ui64;
1784 else if(op2->kind == 2 && op2->type->isSigned)
1785 *value2 = (unsigned int)op2->s;
1786 else if(op2->kind == 2)
1787 *value2 = (unsigned int)op2->us;
1788 else if(op2->kind == 1 && op2->type->isSigned)
1789 *value2 = (unsigned int)op2->c;
1790 else if(op2->kind == 24 || op2->kind == 1)
1791 *value2 = (unsigned int)op2->uc;
1792 else if(op2->kind == 6)
1793 *value2 = (unsigned int)op2->f;
1794 else if(op2->kind == 7)
1795 *value2 = (unsigned int)op2->d;
1796 else if(op2->kind == 13)
1797 *value2 = (unsigned int)op2->ui64;
1803 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1805 struct Operand op2 = GetOperand(exp);
1807 return GetOpUInt(&op2, value2);
1810 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1812 if(op2->kind == 3 && op2->type->isSigned)
1813 *value2 = (long long)op2->i;
1814 else if(op2->kind == 3)
1815 *value2 = (long long)op2->ui;
1816 else if(op2->kind == 4 && op2->type->isSigned)
1818 else if(op2->kind == 4)
1819 *value2 = (long long)op2->ui64;
1820 else if(op2->kind == 23 && op2->type->isSigned)
1822 else if(op2->kind == 23)
1823 *value2 = (long long)op2->ui64;
1824 else if(op2->kind == 22 && op2->type->isSigned)
1826 else if(op2->kind == 22)
1827 *value2 = (long long)op2->ui64;
1828 else if(op2->kind == 2 && op2->type->isSigned)
1829 *value2 = (long long)op2->s;
1830 else if(op2->kind == 2)
1831 *value2 = (long long)op2->us;
1832 else if(op2->kind == 1 && op2->type->isSigned)
1833 *value2 = (long long)op2->c;
1834 else if(op2->kind == 24 || op2->kind == 1)
1835 *value2 = (long long)op2->uc;
1836 else if(op2->kind == 6)
1837 *value2 = (long long)op2->f;
1838 else if(op2->kind == 7)
1839 *value2 = (long long)op2->d;
1840 else if(op2->kind == 13)
1841 *value2 = (long long)op2->ui64;
1847 unsigned int GetInt64(struct Expression * exp, long long * value2)
1849 struct Operand op2 = GetOperand(exp);
1851 return GetOpInt64(&op2, value2);
1854 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1856 if(op2->kind == 3 && op2->type->isSigned)
1857 *value2 = (uint64)op2->i;
1858 else if(op2->kind == 3)
1859 *value2 = (uint64)op2->ui;
1860 else if(op2->kind == 4 && op2->type->isSigned)
1861 *value2 = (uint64)op2->i64;
1862 else if(op2->kind == 4)
1863 *value2 = op2->ui64;
1864 else if(op2->kind == 23 && op2->type->isSigned)
1865 *value2 = (uint64)op2->i64;
1866 else if(op2->kind == 23)
1867 *value2 = op2->ui64;
1868 else if(op2->kind == 22 && op2->type->isSigned)
1869 *value2 = (uint64)op2->i64;
1870 else if(op2->kind == 22)
1871 *value2 = op2->ui64;
1872 else if(op2->kind == 2 && op2->type->isSigned)
1873 *value2 = (uint64)op2->s;
1874 else if(op2->kind == 2)
1875 *value2 = (uint64)op2->us;
1876 else if(op2->kind == 1 && op2->type->isSigned)
1877 *value2 = (uint64)op2->c;
1878 else if(op2->kind == 24 || op2->kind == 1)
1879 *value2 = (uint64)op2->uc;
1880 else if(op2->kind == 6)
1881 *value2 = (uint64)op2->f;
1882 else if(op2->kind == 7)
1883 *value2 = (uint64)op2->d;
1884 else if(op2->kind == 13)
1885 *value2 = op2->ui64;
1891 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1893 struct Operand op2 = GetOperand(exp);
1895 return GetOpUInt64(&op2, value2);
1898 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1900 if(op2->kind == 3 && op2->type->isSigned)
1901 *value2 = (intptr_t)op2->i;
1902 else if(op2->kind == 3)
1903 *value2 = (intptr_t)op2->ui;
1904 else if(op2->kind == 4 && op2->type->isSigned)
1905 *value2 = (intptr_t)op2->i64;
1906 else if(op2->kind == 4)
1907 *value2 = (intptr_t)op2->ui64;
1908 else if(op2->kind == 23 && op2->type->isSigned)
1909 *value2 = (intptr_t)op2->i64;
1910 else if(op2->kind == 23)
1911 *value2 = (intptr_t)op2->ui64;
1912 else if(op2->kind == 22 && op2->type->isSigned)
1913 *value2 = (intptr_t)op2->i64;
1914 else if(op2->kind == 22)
1915 *value2 = (intptr_t)op2->ui64;
1916 else if(op2->kind == 2 && op2->type->isSigned)
1917 *value2 = (intptr_t)op2->s;
1918 else if(op2->kind == 2)
1919 *value2 = (intptr_t)op2->us;
1920 else if(op2->kind == 1 && op2->type->isSigned)
1921 *value2 = (intptr_t)op2->c;
1922 else if(op2->kind == 24 || op2->kind == 1)
1923 *value2 = (intptr_t)op2->uc;
1924 else if(op2->kind == 6)
1925 *value2 = (intptr_t)op2->f;
1926 else if(op2->kind == 7)
1927 *value2 = (intptr_t)op2->d;
1928 else if(op2->kind == 13)
1929 *value2 = (intptr_t)op2->ui64;
1935 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1937 struct Operand op2 = GetOperand(exp);
1939 return GetOpIntPtr(&op2, value2);
1942 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1944 if(op2->kind == 3 && op2->type->isSigned)
1945 *value2 = (uintptr_t)op2->i;
1946 else if(op2->kind == 3)
1947 *value2 = (uintptr_t)op2->ui;
1948 else if(op2->kind == 4 && op2->type->isSigned)
1949 *value2 = (uintptr_t)op2->i64;
1950 else if(op2->kind == 4)
1951 *value2 = (uintptr_t)op2->ui64;
1952 else if(op2->kind == 23 && op2->type->isSigned)
1953 *value2 = (uintptr_t)op2->i64;
1954 else if(op2->kind == 23)
1955 *value2 = (uintptr_t)op2->ui64;
1956 else if(op2->kind == 22 && op2->type->isSigned)
1957 *value2 = (uintptr_t)op2->i64;
1958 else if(op2->kind == 22)
1959 *value2 = (uintptr_t)op2->ui64;
1960 else if(op2->kind == 2 && op2->type->isSigned)
1961 *value2 = (uintptr_t)op2->s;
1962 else if(op2->kind == 2)
1963 *value2 = (uintptr_t)op2->us;
1964 else if(op2->kind == 1 && op2->type->isSigned)
1965 *value2 = (uintptr_t)op2->c;
1966 else if(op2->kind == 24 || op2->kind == 1)
1967 *value2 = (uintptr_t)op2->uc;
1968 else if(op2->kind == 6)
1969 *value2 = (uintptr_t)op2->f;
1970 else if(op2->kind == 7)
1971 *value2 = (uintptr_t)op2->d;
1972 else if(op2->kind == 13)
1973 *value2 = (uintptr_t)op2->ui64;
1979 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1981 struct Operand op2 = GetOperand(exp);
1983 return GetOpUIntPtr(&op2, value2);
1986 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1988 if(op2->kind == 3 && op2->type->isSigned)
1989 *value2 = (ssize_t)op2->i;
1990 else if(op2->kind == 3)
1991 *value2 = (ssize_t)op2->ui;
1992 else if(op2->kind == 4 && op2->type->isSigned)
1993 *value2 = (ssize_t)op2->i64;
1994 else if(op2->kind == 4)
1995 *value2 = (ssize_t)op2->ui64;
1996 else if(op2->kind == 23 && op2->type->isSigned)
1997 *value2 = (ssize_t)op2->i64;
1998 else if(op2->kind == 23)
1999 *value2 = (ssize_t)op2->ui64;
2000 else if(op2->kind == 22 && op2->type->isSigned)
2001 *value2 = (ssize_t)op2->i64;
2002 else if(op2->kind == 22)
2003 *value2 = (ssize_t)op2->ui64;
2004 else if(op2->kind == 2 && op2->type->isSigned)
2005 *value2 = (ssize_t)op2->s;
2006 else if(op2->kind == 2)
2007 *value2 = (ssize_t)op2->us;
2008 else if(op2->kind == 1 && op2->type->isSigned)
2009 *value2 = (ssize_t)op2->c;
2010 else if(op2->kind == 24 || op2->kind == 1)
2011 *value2 = (ssize_t)op2->uc;
2012 else if(op2->kind == 6)
2013 *value2 = (ssize_t)op2->f;
2014 else if(op2->kind == 7)
2015 *value2 = (ssize_t)op2->d;
2016 else if(op2->kind == 13)
2017 *value2 = (ssize_t)op2->ui64;
2023 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2025 struct Operand op2 = GetOperand(exp);
2027 return GetOpIntSize(&op2, value2);
2030 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2032 if(op2->kind == 3 && op2->type->isSigned)
2033 *value2 = (size_t)op2->i;
2034 else if(op2->kind == 3)
2035 *value2 = (size_t)op2->ui;
2036 else if(op2->kind == 4 && op2->type->isSigned)
2037 *value2 = (size_t)op2->i64;
2038 else if(op2->kind == 4)
2039 *value2 = (size_t)op2->ui64;
2040 else if(op2->kind == 23 && op2->type->isSigned)
2041 *value2 = (size_t)op2->i64;
2042 else if(op2->kind == 23)
2043 *value2 = (size_t)op2->ui64;
2044 else if(op2->kind == 22 && op2->type->isSigned)
2045 *value2 = (size_t)op2->i64;
2046 else if(op2->kind == 22)
2047 *value2 = (size_t)op2->ui64;
2048 else if(op2->kind == 2 && op2->type->isSigned)
2049 *value2 = (size_t)op2->s;
2050 else if(op2->kind == 2)
2051 *value2 = (size_t)op2->us;
2052 else if(op2->kind == 1 && op2->type->isSigned)
2053 *value2 = (size_t)op2->c;
2054 else if(op2->kind == 24 || op2->kind == 1)
2055 *value2 = (size_t)op2->uc;
2056 else if(op2->kind == 6)
2057 *value2 = (size_t)op2->f;
2058 else if(op2->kind == 7)
2059 *value2 = (size_t)op2->d;
2060 else if(op2->kind == 13)
2061 *value2 = (size_t)op2->ui64;
2067 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2069 struct Operand op2 = GetOperand(exp);
2071 return GetOpUIntSize(&op2, value2);
2074 unsigned int GetOpShort(struct Operand * op2, short * value2)
2076 if(op2->kind == 3 && op2->type->isSigned)
2077 *value2 = (short)op2->i;
2078 else if(op2->kind == 3)
2079 *value2 = (short)op2->ui;
2080 else if(op2->kind == 4 && op2->type->isSigned)
2081 *value2 = (short)op2->i64;
2082 else if(op2->kind == 4)
2083 *value2 = (short)op2->ui64;
2084 else if(op2->kind == 23 && op2->type->isSigned)
2085 *value2 = (short)op2->i64;
2086 else if(op2->kind == 23)
2087 *value2 = (short)op2->ui64;
2088 else if(op2->kind == 22 && op2->type->isSigned)
2089 *value2 = (short)op2->i64;
2090 else if(op2->kind == 22)
2091 *value2 = (short)op2->ui64;
2092 else if(op2->kind == 2 && op2->type->isSigned)
2094 else if(op2->kind == 2)
2095 *value2 = (short)op2->us;
2096 else if(op2->kind == 1 && op2->type->isSigned)
2097 *value2 = (short)op2->c;
2098 else if(op2->kind == 24 || op2->kind == 1)
2099 *value2 = (short)op2->uc;
2100 else if(op2->kind == 6)
2101 *value2 = (short)op2->f;
2102 else if(op2->kind == 7)
2103 *value2 = (short)op2->d;
2104 else if(op2->kind == 13)
2105 *value2 = (short)op2->ui64;
2111 unsigned int GetShort(struct Expression * exp, short * value2)
2113 struct Operand op2 = GetOperand(exp);
2115 return GetOpShort(&op2, value2);
2118 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2120 if(op2->kind == 3 && op2->type->isSigned)
2121 *value2 = (unsigned short)op2->i;
2122 else if(op2->kind == 3)
2123 *value2 = (unsigned short)op2->ui;
2124 else if(op2->kind == 4 && op2->type->isSigned)
2125 *value2 = (unsigned short)op2->i64;
2126 else if(op2->kind == 4)
2127 *value2 = (unsigned short)op2->ui64;
2128 else if(op2->kind == 23 && op2->type->isSigned)
2129 *value2 = (unsigned short)op2->i64;
2130 else if(op2->kind == 23)
2131 *value2 = (unsigned short)op2->ui64;
2132 else if(op2->kind == 22 && op2->type->isSigned)
2133 *value2 = (unsigned short)op2->i64;
2134 else if(op2->kind == 22)
2135 *value2 = (unsigned short)op2->ui64;
2136 else if(op2->kind == 2 && op2->type->isSigned)
2137 *value2 = (unsigned short)op2->s;
2138 else if(op2->kind == 2)
2140 else if(op2->kind == 1 && op2->type->isSigned)
2141 *value2 = (unsigned short)op2->c;
2142 else if(op2->kind == 24 || op2->kind == 1)
2143 *value2 = (unsigned short)op2->uc;
2144 else if(op2->kind == 6)
2145 *value2 = (unsigned short)op2->f;
2146 else if(op2->kind == 7)
2147 *value2 = (unsigned short)op2->d;
2148 else if(op2->kind == 13)
2149 *value2 = (unsigned short)op2->ui64;
2155 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2157 struct Operand op2 = GetOperand(exp);
2159 return GetOpUShort(&op2, value2);
2162 unsigned int GetOpChar(struct Operand * op2, char * value2)
2164 if(op2->kind == 3 && op2->type->isSigned)
2165 *value2 = (char)op2->i;
2166 else if(op2->kind == 3)
2167 *value2 = (char)op2->ui;
2168 else if(op2->kind == 4 && op2->type->isSigned)
2169 *value2 = (char)op2->i64;
2170 else if(op2->kind == 4)
2171 *value2 = (char)op2->ui64;
2172 else if(op2->kind == 23 && op2->type->isSigned)
2173 *value2 = (char)op2->i64;
2174 else if(op2->kind == 23)
2175 *value2 = (char)op2->ui64;
2176 else if(op2->kind == 22 && op2->type->isSigned)
2177 *value2 = (char)op2->i64;
2178 else if(op2->kind == 22)
2179 *value2 = (char)op2->ui64;
2180 else if(op2->kind == 2 && op2->type->isSigned)
2181 *value2 = (char)op2->s;
2182 else if(op2->kind == 2)
2183 *value2 = (char)op2->us;
2184 else if(op2->kind == 1 && op2->type->isSigned)
2186 else if(op2->kind == 24 || op2->kind == 1)
2187 *value2 = (char)op2->uc;
2188 else if(op2->kind == 6)
2189 *value2 = (char)op2->f;
2190 else if(op2->kind == 7)
2191 *value2 = (char)op2->d;
2192 else if(op2->kind == 13)
2193 *value2 = (char)op2->ui64;
2199 unsigned int GetChar(struct Expression * exp, char * value2)
2201 struct Operand op2 = GetOperand(exp);
2203 return GetOpChar(&op2, value2);
2206 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2208 if(op2->kind == 3 && op2->type->isSigned)
2209 *value2 = (unsigned char)op2->i;
2210 else if(op2->kind == 3)
2211 *value2 = (unsigned char)op2->ui;
2212 else if(op2->kind == 4 && op2->type->isSigned)
2213 *value2 = (unsigned char)op2->i64;
2214 else if(op2->kind == 4)
2215 *value2 = (unsigned char)op2->ui64;
2216 else if(op2->kind == 23 && op2->type->isSigned)
2217 *value2 = (unsigned char)op2->i64;
2218 else if(op2->kind == 23)
2219 *value2 = (unsigned char)op2->ui64;
2220 else if(op2->kind == 22 && op2->type->isSigned)
2221 *value2 = (unsigned char)op2->i64;
2222 else if(op2->kind == 22)
2223 *value2 = (unsigned char)op2->ui64;
2224 else if(op2->kind == 2 && op2->type->isSigned)
2225 *value2 = (unsigned char)op2->s;
2226 else if(op2->kind == 2)
2227 *value2 = (unsigned char)op2->us;
2228 else if(op2->kind == 1 && op2->type->isSigned)
2229 *value2 = (unsigned char)op2->c;
2230 else if(op2->kind == 24 || op2->kind == 1)
2232 else if(op2->kind == 6)
2233 *value2 = (unsigned char)op2->f;
2234 else if(op2->kind == 7)
2235 *value2 = (unsigned char)op2->d;
2236 else if(op2->kind == 13)
2237 *value2 = (unsigned char)op2->ui64;
2243 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2245 struct Operand op2 = GetOperand(exp);
2247 return GetOpUChar(&op2, value2);
2250 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2252 if(op2->kind == 3 && op2->type->isSigned)
2253 *value2 = (float)(float)op2->i;
2254 else if(op2->kind == 3)
2255 *value2 = (float)(float)op2->ui;
2256 else if(op2->kind == 4 && op2->type->isSigned)
2257 *value2 = (float)(float)op2->i64;
2258 else if(op2->kind == 4)
2259 *value2 = (float)(float)op2->ui64;
2260 else if(op2->kind == 23 && op2->type->isSigned)
2261 *value2 = (float)(float)op2->i64;
2262 else if(op2->kind == 23)
2263 *value2 = (float)(float)op2->ui64;
2264 else if(op2->kind == 22 && op2->type->isSigned)
2265 *value2 = (float)(float)op2->i64;
2266 else if(op2->kind == 22)
2267 *value2 = (float)(float)op2->ui64;
2268 else if(op2->kind == 2 && op2->type->isSigned)
2269 *value2 = (float)(float)op2->s;
2270 else if(op2->kind == 2)
2271 *value2 = (float)(float)op2->us;
2272 else if(op2->kind == 1 && op2->type->isSigned)
2273 *value2 = (float)(float)op2->c;
2274 else if(op2->kind == 24 || op2->kind == 1)
2275 *value2 = (float)(float)op2->uc;
2276 else if(op2->kind == 6)
2277 *value2 = (float)op2->f;
2278 else if(op2->kind == 7)
2279 *value2 = (float)op2->d;
2280 else if(op2->kind == 13)
2281 *value2 = (float)(float)op2->ui64;
2287 unsigned int GetFloat(struct Expression * exp, float * value2)
2289 struct Operand op2 = GetOperand(exp);
2291 return GetOpFloat(&op2, value2);
2294 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2296 if(op2->kind == 3 && op2->type->isSigned)
2297 *value2 = (double)(double)op2->i;
2298 else if(op2->kind == 3)
2299 *value2 = (double)(double)op2->ui;
2300 else if(op2->kind == 4 && op2->type->isSigned)
2301 *value2 = (double)(double)op2->i64;
2302 else if(op2->kind == 4)
2303 *value2 = (double)(double)op2->ui64;
2304 else if(op2->kind == 23 && op2->type->isSigned)
2305 *value2 = (double)(double)op2->i64;
2306 else if(op2->kind == 23)
2307 *value2 = (double)(double)op2->ui64;
2308 else if(op2->kind == 22 && op2->type->isSigned)
2309 *value2 = (double)(double)op2->i64;
2310 else if(op2->kind == 22)
2311 *value2 = (double)(double)op2->ui64;
2312 else if(op2->kind == 2 && op2->type->isSigned)
2313 *value2 = (double)(double)op2->s;
2314 else if(op2->kind == 2)
2315 *value2 = (double)(double)op2->us;
2316 else if(op2->kind == 1 && op2->type->isSigned)
2317 *value2 = (double)(double)op2->c;
2318 else if(op2->kind == 24 || op2->kind == 1)
2319 *value2 = (double)(double)op2->uc;
2320 else if(op2->kind == 6)
2321 *value2 = (double)op2->f;
2322 else if(op2->kind == 7)
2323 *value2 = (double)op2->d;
2324 else if(op2->kind == 13)
2325 *value2 = (double)(double)op2->ui64;
2331 unsigned int GetDouble(struct Expression * exp, double * value2)
2333 struct Operand op2 = GetOperand(exp);
2335 return GetOpDouble(&op2, value2);
2338 void ComputeExpression(struct Expression * exp);
2340 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2342 extern int targetBits;
2344 int ComputeTypeSize(struct Type * type);
2346 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2348 struct __ecereNameSpace__ecere__com__BitMember
2350 struct __ecereNameSpace__ecere__com__BitMember * prev;
2351 struct __ecereNameSpace__ecere__com__BitMember * next;
2353 unsigned int isProperty;
2356 struct __ecereNameSpace__ecere__com__Class * _class;
2357 char * dataTypeString;
2358 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2359 struct Type * dataType;
2364 } __attribute__ ((gcc_struct));
2366 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2368 struct __ecereNameSpace__ecere__sys__OldLink
2370 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2371 struct __ecereNameSpace__ecere__sys__OldLink * next;
2373 } __attribute__ ((gcc_struct));
2375 void FinishTemplatesContext(struct Context * context);
2377 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2379 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2380 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2382 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))
2385 int unionMemberOffset = 0;
2390 member->memberOffset = 0;
2391 if(targetBits < sizeof(void *) * 8)
2392 member->structAlignment = 0;
2394 else if(targetBits < sizeof(void *) * 8)
2395 _class->structAlignment = 0;
2396 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2397 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2398 if(!member && _class->destructionWatchOffset)
2399 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2401 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2403 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2405 if(!dataMember->isProperty)
2407 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2409 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2415 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2417 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2419 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2421 if(!isMember && _class->type == 2 && dataMember->dataType)
2423 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2427 ComputeTypeSize(dataMember->dataType);
2428 if(bitMember->pos == -1)
2429 bitMember->pos = _class->memberOffset;
2430 if(!bitMember->size)
2431 bitMember->size = dataMember->dataType->size * 8;
2432 _class->memberOffset = bitMember->pos + bitMember->size;
2433 for(d = 0; d < bitMember->size; d++)
2439 bitMember->mask = mask << bitMember->pos;
2441 else if(dataMember->type == 0 && dataMember->dataType)
2446 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2447 ComputeTypeSize(dataMember->dataType);
2448 if(dataMember->dataType->bitFieldCount)
2450 bitFields += dataMember->dataType->bitFieldCount;
2457 int size = (bitFields + 7) / 8;
2461 int __simpleStruct0;
2465 int __simpleStruct0;
2467 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2468 if(member->memberOffset % alignment)
2469 member->memberOffset += alignment - (member->memberOffset % alignment);
2471 dataMember->offset = member->memberOffset;
2472 if(member->type == 1)
2473 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2476 member->memberOffset += size;
2483 int __simpleStruct0;
2485 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2486 if(_class->memberOffset % alignment)
2487 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2489 dataMember->offset = _class->memberOffset;
2490 _class->memberOffset += size;
2494 size = dataMember->dataType->size;
2495 alignment = dataMember->dataType->alignment;
2499 int __simpleStruct0;
2503 int __simpleStruct0;
2505 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2506 if(member->memberOffset % alignment)
2507 member->memberOffset += alignment - (member->memberOffset % alignment);
2509 dataMember->offset = member->memberOffset;
2510 if(member->type == 1)
2511 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2514 member->memberOffset += size;
2521 int __simpleStruct0;
2523 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2524 if(_class->memberOffset % alignment)
2525 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2527 dataMember->offset = _class->memberOffset;
2528 _class->memberOffset += size;
2535 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2536 alignment = dataMember->structAlignment;
2539 int __simpleStruct0;
2543 int __simpleStruct0;
2545 if(member->memberOffset % alignment)
2546 member->memberOffset += alignment - (member->memberOffset % alignment);
2547 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2549 dataMember->offset = member->memberOffset;
2550 if(member->type == 1)
2551 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2553 member->memberOffset += dataMember->memberOffset;
2559 int __simpleStruct0;
2561 if(_class->memberOffset % alignment)
2562 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2563 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2565 dataMember->offset = _class->memberOffset;
2566 _class->memberOffset += dataMember->memberOffset;
2574 int size = (bitFields + 7) / 8;
2578 int __simpleStruct0;
2582 int __simpleStruct0;
2584 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2585 if(member->memberOffset % alignment)
2586 member->memberOffset += alignment - (member->memberOffset % alignment);
2588 if(member->type == 1)
2589 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2592 member->memberOffset += size;
2599 int __simpleStruct0;
2601 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2602 if(_class->memberOffset % alignment)
2603 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2605 _class->memberOffset += size;
2610 if(member && member->type == 1)
2612 member->memberOffset = unionMemberOffset;
2616 if(_class->type != 2)
2620 if(_class->structAlignment)
2622 if(_class->memberOffset % _class->structAlignment)
2623 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2625 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2628 struct __ecereNameSpace__ecere__com__Property * prop;
2630 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2632 if(prop->isProperty && prop->isWatchable)
2634 prop->watcherOffset = _class->structSize;
2635 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2640 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2642 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2644 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2646 if(deriv->computeSize)
2648 deriv->offset = _class->structSize;
2649 deriv->memberOffset = 0;
2650 deriv->structSize = deriv->offset;
2651 ComputeClassMembers(deriv, 0x0);
2659 FinishTemplatesContext(context);
2662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2664 struct __ecereNameSpace__ecere__com__NameSpace
2667 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2668 struct __ecereNameSpace__ecere__com__NameSpace * left;
2669 struct __ecereNameSpace__ecere__com__NameSpace * right;
2671 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2672 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2673 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2674 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2675 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2676 } __attribute__ ((gcc_struct));
2678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2680 struct __ecereNameSpace__ecere__com__Module
2682 struct __ecereNameSpace__ecere__com__Instance * application;
2683 struct __ecereNameSpace__ecere__sys__OldList classes;
2684 struct __ecereNameSpace__ecere__sys__OldList defines;
2685 struct __ecereNameSpace__ecere__sys__OldList functions;
2686 struct __ecereNameSpace__ecere__sys__OldList modules;
2687 struct __ecereNameSpace__ecere__com__Instance * prev;
2688 struct __ecereNameSpace__ecere__com__Instance * next;
2694 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2695 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2696 } __attribute__ ((gcc_struct));
2698 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2700 struct __ecereNameSpace__ecere__com__Class * _class;
2701 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2703 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2704 ComputeModuleClasses(subModule->data);
2705 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2706 ComputeClassMembers(_class, 0x0);
2709 extern unsigned int inCompiler;
2711 extern void Compiler_Error(char * format, ...);
2713 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2715 int ComputeTypeSize(struct Type * type)
2717 unsigned int size = type ? type->size : 0;
2719 if(!size && type && !type->computing)
2721 type->computing = 0x1;
2725 type->alignment = size = sizeof(char);
2728 type->alignment = size = sizeof(char);
2731 type->alignment = size = sizeof(int);
2734 type->alignment = size = sizeof(long long);
2737 type->alignment = size = targetBits / 8;
2740 type->alignment = size = targetBits / 8;
2743 type->alignment = size = sizeof(long);
2746 type->alignment = size = sizeof(short);
2749 type->alignment = size = sizeof(float);
2752 type->alignment = size = sizeof(double);
2756 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2758 if(_class && _class->type == 1)
2760 ComputeClassMembers(_class, 0x0);
2761 type->alignment = _class->structAlignment;
2762 size = _class->structSize;
2763 if(type->alignment && size % type->alignment)
2764 size += type->alignment - (size % type->alignment);
2766 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2768 if(!_class->dataType)
2769 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2770 size = type->alignment = ComputeTypeSize(_class->dataType);
2773 size = type->alignment = targetBits / 8;
2778 size = type->alignment = targetBits / 8;
2781 if(type->arraySizeExp)
2783 ProcessExpressionType(type->arraySizeExp);
2784 ComputeExpression(type->arraySizeExp);
2785 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)))
2787 struct Location oldLoc = yylloc;
2788 char expression[10240];
2790 expression[0] = '\0';
2791 type->arraySizeExp->expType = (((void *)0));
2792 yylloc = type->arraySizeExp->loc;
2794 PrintExpression(type->arraySizeExp, expression);
2795 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2798 GetInt(type->arraySizeExp, &type->arraySize);
2800 else if(type->enumClass)
2802 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2804 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2807 type->arraySize = 0;
2811 type->arraySize = 0;
2813 size = ComputeTypeSize(type->type) * type->arraySize;
2815 type->alignment = type->type->alignment;
2819 struct Type * member;
2821 for(member = type->members.first; member; member = member->next)
2823 int __simpleStruct0, __simpleStruct1;
2824 unsigned int addSize = ComputeTypeSize(member);
2826 member->offset = size;
2827 if(member->alignment && size % member->alignment)
2828 member->offset += member->alignment - (size % member->alignment);
2829 size = member->offset;
2830 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2833 if(type->alignment && size % type->alignment)
2834 size += type->alignment - (size % type->alignment);
2839 struct Type * member;
2841 for(member = type->members.first; member; member = member->next)
2843 int __simpleStruct0, __simpleStruct1;
2844 unsigned int addSize = ComputeTypeSize(member);
2846 member->offset = size;
2847 if(member->alignment && size % member->alignment)
2848 member->offset += member->alignment - (size % member->alignment);
2849 size = member->offset;
2850 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2851 size = ((size > addSize) ? size : addSize);
2853 if(type->alignment && size % type->alignment)
2854 size += type->alignment - (size % type->alignment);
2859 struct TemplateParameter * param = type->templateParameter;
2860 struct Type * baseType = ProcessTemplateParameterType(param);
2864 size = ComputeTypeSize(baseType);
2865 type->alignment = baseType->alignment;
2868 type->alignment = size = sizeof(uint64);
2873 type->alignment = size = sizeof(enum
2881 type->alignment = size = targetBits / 8;
2886 type->computing = 0x0;
2891 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2893 extern struct Identifier * MkIdentifier(char * string);
2895 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2897 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2899 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2901 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2903 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2905 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2907 extern void FreeType(struct Type * type);
2909 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2911 extern struct Specifier * MkSpecifier(int specifier);
2913 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2915 extern struct Expression * MkExpConstant(char * string);
2917 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)
2919 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2920 unsigned int totalSize = 0;
2921 unsigned int maxSize = 0;
2922 int alignment, size;
2923 struct __ecereNameSpace__ecere__com__DataMember * member;
2924 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2927 *addedPadding = 0x0;
2928 if(!isMember && _class->base)
2930 maxSize = _class->structSize;
2932 if(_class->type == 1 || _class->type == 5)
2933 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2936 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2938 if(maxSize > baseSize)
2939 maxSize -= baseSize;
2945 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2947 if(!member->isProperty)
2949 switch(member->type)
2953 if(member->dataTypeString)
2955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2956 struct Declarator * decl;
2958 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2959 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2960 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2961 if(!member->dataType)
2962 member->dataType = ProcessType(specs, decl);
2963 ReplaceThisClassSpecifiers(specs, topClass);
2965 struct Type * type = ProcessType(specs, decl);
2967 DeclareType(member->dataType, 0x0, 0x0);
2970 ComputeTypeSize(member->dataType);
2971 size = member->dataType->size;
2972 alignment = member->dataType->alignment;
2975 if(totalSize % alignment)
2976 totalSize += alignment - (totalSize % alignment);
2985 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2988 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2989 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2990 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2991 alignment = member->structAlignment;
2994 if(totalSize % alignment)
2995 totalSize += alignment - (totalSize % alignment);
3005 unsigned int __simpleStruct0;
3007 if(topMember && topMember->type == 1)
3008 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3010 *retSize += totalSize;
3012 else if(totalSize < maxSize && _class->type != 1000)
3014 int autoPadding = 0;
3016 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3017 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3018 if(totalSize + autoPadding < maxSize)
3020 char sizeString[50];
3022 sprintf(sizeString, "%d", maxSize - totalSize);
3023 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3025 *addedPadding = 0x1;
3029 FinishTemplatesContext(context);
3030 return topMember ? topMember->memberID : _class->memberID;
3033 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3035 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3036 unsigned int totalSize = 0;
3037 struct __ecereNameSpace__ecere__com__DataMember * member;
3038 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3040 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3041 DeclareMembers(_class->base, 0x0);
3042 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3044 if(!member->isProperty)
3046 switch(member->type)
3050 if(!member->dataType && member->dataTypeString)
3051 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3052 if(member->dataType)
3053 DeclareType(member->dataType, 0x0, 0x0);
3059 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3066 FinishTemplatesContext(context);
3067 return topMember ? topMember->memberID : _class->memberID;
3070 extern struct Symbol * FindClass(char * name);
3072 extern char * strchr(const char * , int);
3074 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3076 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3078 extern void FreeClassDef(struct ClassDef * def);
3080 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3082 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3084 extern void MangleClassName(char * className);
3086 extern void DeclareClass(struct Symbol * classSym, char * className);
3088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3090 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3092 void DeclareStruct(char * name, unsigned int skipNoHead)
3094 struct External * external = (((void *)0));
3095 struct Symbol * classSym = FindClass(name);
3097 if(!inCompiler || !classSym)
3099 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3101 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3103 struct Declaration * decl;
3104 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3105 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3106 char structName[1024];
3108 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3109 classSym->declaring++;
3110 if(strchr(classSym->string, '<'))
3112 if(classSym->registered->templateClass)
3114 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3115 classSym->declaring--;
3119 DeclareMembers(classSym->registered, 0x0);
3120 structName[0] = (char)0;
3121 FullClassNameCat(structName, name, 0x0);
3124 unsigned int addedPadding = 0x0;
3126 classSym->declaredStructSym = 0x1;
3127 declarations = MkList();
3128 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3129 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3131 FreeList(declarations, FreeClassDef);
3132 declarations = (((void *)0));
3135 if(skipNoHead || declarations)
3137 if(external && external->declaration)
3139 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3140 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3142 if(classSym->structExternal)
3143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3145 classSym->id = curExternal->symbol->idCode;
3146 classSym->idCode = curExternal->symbol->idCode;
3152 external = MkExternalDeclaration((((void *)0)));
3153 specifiers = MkList();
3154 declarators = MkList();
3155 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3156 external->declaration = decl = MkDeclaration(specifiers, declarators);
3157 if(decl->symbol && !decl->symbol->pointerExternal)
3158 decl->symbol->pointerExternal = external;
3159 if(classSym->registered && classSym->registered->type == 1)
3161 char className[1024];
3163 strcpy(className, "__ecereClass_");
3164 FullClassNameCat(className, classSym->string, 0x1);
3165 MangleClassName(className);
3166 DeclareClass(classSym, className);
3167 external->symbol = classSym;
3168 classSym->pointerExternal = external;
3169 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3170 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3174 char className[1024];
3176 strcpy(className, "__ecereClass_");
3177 FullClassNameCat(className, classSym->string, 0x1);
3178 MangleClassName(className);
3179 classSym->structExternal = external;
3180 DeclareClass(classSym, className);
3181 external->symbol = classSym;
3183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3186 classSym->declaring--;
3188 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3190 classSym->declaring++;
3192 if(classSym->registered)
3193 DeclareMembers(classSym->registered, 0x0);
3195 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3197 if(classSym->structExternal)
3198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3199 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3200 classSym->id = curExternal->symbol->idCode;
3201 classSym->idCode = curExternal->symbol->idCode;
3203 classSym->declaring--;
3207 extern char * strcat(char * , const char * );
3209 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3211 extern struct ModuleImport * mainModule;
3213 extern struct Specifier * MkSpecifierName(char * name);
3215 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3217 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3219 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3221 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3223 extern void FreeDeclarator(struct Declarator * decl);
3225 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3227 struct PropertyImport
3229 struct PropertyImport * prev;
3230 struct PropertyImport * next;
3232 unsigned int isVirtual;
3233 unsigned int hasSet;
3234 unsigned int hasGet;
3235 } __attribute__ ((gcc_struct));
3237 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3239 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3241 struct Symbol * symbol = prop->symbol;
3242 char propName[1024];
3244 strcpy(setName, "__ecereProp_");
3245 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3246 strcat(setName, "_Set_");
3247 FullClassNameCat(setName, prop->name, 0x1);
3248 strcpy(getName, "__ecereProp_");
3249 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3250 strcat(getName, "_Get_");
3251 FullClassNameCat(getName, prop->name, 0x1);
3252 strcpy(propName, "__ecereProp_");
3253 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3254 strcat(propName, "_");
3255 FullClassNameCat(propName, prop->name, 0x1);
3256 MangleClassName(getName);
3257 MangleClassName(setName);
3258 MangleClassName(propName);
3259 if(prop->_class->type == 1)
3260 DeclareStruct(prop->_class->fullName, 0x0);
3261 if(!symbol || curExternal->symbol->idCode < symbol->id)
3263 unsigned int imported = 0x0;
3264 unsigned int dllImport = 0x0;
3266 if(!symbol || symbol->_import)
3270 struct Symbol * classSym;
3272 if(!prop->_class->symbol)
3273 prop->_class->symbol = FindClass(prop->_class->fullName);
3274 classSym = prop->_class->symbol;
3275 if(classSym && !classSym->_import)
3277 struct ModuleImport * module;
3279 if(prop->_class->module)
3280 module = FindModule(prop->_class->module);
3282 module = mainModule;
3283 classSym->_import = __extension__ ({
3284 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3286 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3290 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3291 symbol->_import = (struct ClassImport *)__extension__ ({
3292 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3294 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3300 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)
3305 struct Context * context = SetupTemplatesContext(prop->_class);
3307 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3308 FinishTemplatesContext(context);
3312 if(!symbol->externalGet || symbol->externalGet->type == 0)
3314 struct Declaration * decl;
3315 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3316 struct Declarator * d;
3317 struct __ecereNameSpace__ecere__sys__OldList * params;
3318 struct Specifier * spec;
3319 struct External * external;
3320 struct Declarator * typeDecl;
3321 unsigned int simple = 0x0;
3323 specifiers = MkList();
3324 declarators = MkList();
3326 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3327 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3329 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3331 struct Context * context = SetupTemplatesContext(prop->_class);
3333 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3334 FinishTemplatesContext(context);
3336 for(spec = (*specifiers).first; spec; spec = spec->next)
3340 if((!typeDecl || typeDecl->type == 1))
3342 struct Symbol * classSym = spec->symbol;
3344 symbol->_class = classSym->registered;
3345 if(classSym->registered && classSym->registered->type == 1)
3347 DeclareStruct(spec->name, 0x0);
3354 d = PlugDeclarator(typeDecl, d);
3357 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3358 specifiers = MkList();
3360 d = MkDeclaratorFunction(d, params);
3362 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3363 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3366 ListAdd(specifiers, MkSpecifier(VOID));
3367 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3368 decl = MkDeclaration(specifiers, declarators);
3369 external = MkExternalDeclaration(decl);
3370 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3371 external->symbol = symbol;
3372 symbol->externalGet = external;
3373 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3375 FreeDeclarator(typeDecl);
3379 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3384 if(!symbol->externalSet || symbol->externalSet->type == 0)
3386 struct Declaration * decl;
3387 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3388 struct Declarator * d;
3389 struct __ecereNameSpace__ecere__sys__OldList * params;
3390 struct Specifier * spec;
3391 struct External * external;
3392 struct Declarator * typeDecl;
3394 declarators = MkList();
3396 if(!prop->conversion || prop->_class->type == 1)
3398 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3400 specifiers = MkList();
3402 struct Context * context = SetupTemplatesContext(prop->_class);
3404 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3405 FinishTemplatesContext(context);
3407 ListAdd(params, MkTypeName(specifiers, d));
3408 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3410 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3411 d = MkDeclaratorFunction(d, params);
3412 for(spec = (*specifiers).first; spec; spec = spec->next)
3416 if((!typeDecl || typeDecl->type == 1))
3418 struct Symbol * classSym = spec->symbol;
3420 symbol->_class = classSym->registered;
3421 if(classSym->registered && classSym->registered->type == 1)
3422 DeclareStruct(spec->name, 0x0);
3426 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3427 specifiers = MkList();
3429 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3430 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3432 if(!prop->conversion || prop->_class->type == 1)
3433 ListAdd(specifiers, MkSpecifier(VOID));
3435 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3436 decl = MkDeclaration(specifiers, declarators);
3437 external = MkExternalDeclaration(decl);
3438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3439 external->symbol = symbol;
3440 symbol->externalSet = external;
3441 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3448 if(!symbol->externalPtr)
3450 struct Declaration * decl;
3451 struct External * external;
3452 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3455 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3458 ListAdd(specifiers, MkSpecifierName("Property"));
3460 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3462 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3465 strcpy(propName, "__ecerePropM_");
3466 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3467 strcat(propName, "_");
3468 FullClassNameCat(propName, prop->name, 0x1);
3469 MangleClassName(propName);
3470 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3472 decl = MkDeclaration(specifiers, list);
3474 external = MkExternalDeclaration(decl);
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3476 external->symbol = symbol;
3477 symbol->externalPtr = external;
3481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3483 symbol->id = curExternal->symbol->idCode;
3487 struct Type * Dereference(struct Type * source)
3489 struct Type * type = (((void *)0));
3493 if(source->kind == 13 || source->kind == 12)
3495 type = source->type;
3496 source->type->refCount++;
3498 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3500 type = __extension__ ({
3501 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3503 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3506 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3512 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3517 static struct Type * Reference(struct Type * source)
3519 struct Type * type = (((void *)0));
3523 type = __extension__ ({
3524 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3526 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3533 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);
3535 extern void * memcpy(void * , const void * , size_t size);
3537 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3539 extern void FreeExpression(struct Expression * exp);
3541 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3543 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);
3545 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3547 extern struct Type * MkClassType(char * name);
3549 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);
3551 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)
3553 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3554 unsigned int found = 0x0;
3555 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3556 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3557 unsigned int freeType = 0x0;
3559 yylloc = member->loc;
3564 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3568 dataMember = *curMember;
3574 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3575 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3576 int _subMemberStackPos = 0;
3579 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3582 dataMember = thisMember;
3583 if(curMember && thisMember->memberAccess == 1)
3585 *curMember = thisMember;
3586 *curClass = thisMember->_class;
3587 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3588 *subMemberStackPos = _subMemberStackPos;
3594 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3595 if(method && method->type == 1)
3598 method = (((void *)0));
3603 struct Type * type = (((void *)0));
3607 if(!dataMember->dataType && dataMember->dataTypeString)
3609 struct Context * context = SetupTemplatesContext(_class);
3611 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3612 FinishTemplatesContext(context);
3614 type = dataMember->dataType;
3618 if(!method->dataType)
3619 ProcessMethodType(method);
3620 type = method->dataType;
3622 if(ident && ident->next)
3624 for(ident = ident->next; ident && type; ident = ident->next)
3628 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3630 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3632 type = dataMember->dataType;
3634 else if(type->kind == 9 || type->kind == 10)
3636 struct Type * memberType;
3638 for(memberType = type->members.first; memberType; memberType = memberType->next)
3640 if(!strcmp(memberType->name, ident->string))
3649 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3652 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3653 struct __ecereNameSpace__ecere__com__Class * sClass;
3655 for(sClass = _class; sClass; sClass = sClass->base)
3658 if(sClass->templateClass)
3659 sClass = sClass->templateClass;
3660 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3662 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3664 for(sClass = sClass->base; sClass; sClass = sClass->base)
3666 if(sClass->templateClass)
3667 sClass = sClass->templateClass;
3668 id += sClass->templateParams.count;
3679 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3681 if(arg.dataTypeString)
3683 type = ProcessTypeString(arg.dataTypeString, 0x0);
3685 if(type && _class->templateClass)
3686 type->passAsTemplate = 0x1;
3693 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3695 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3696 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3700 char templateString[1024];
3701 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3703 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3704 for(cClass = expClass; cClass; cClass = cClass->base)
3708 if(cClass->templateClass)
3709 cClass = cClass->templateClass;
3710 for(param = cClass->templateParams.first; param; param = param->next)
3713 struct __ecereNameSpace__ecere__com__Class * sClass;
3714 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3716 for(sClass = cClass->base; sClass; sClass = sClass->base)
3718 if(sClass->templateClass)
3719 sClass = sClass->templateClass;
3720 id += sClass->templateParams.count;
3722 arg = expClass->templateArgs[id];
3723 for(sClass = _class; sClass; sClass = sClass->base)
3725 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3727 struct __ecereNameSpace__ecere__com__Class * nextClass;
3729 if(sClass->templateClass)
3730 sClass = sClass->templateClass;
3731 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3733 if(nextClass->templateClass)
3734 nextClass = nextClass->templateClass;
3735 p += nextClass->templateParams.count;
3737 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3739 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3741 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3743 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3744 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3758 char expString[1024];
3759 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3760 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3761 struct Expression * exp;
3762 char * string = PrintHexUInt64(arg.expression.ui64);
3764 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3765 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3766 ProcessExpressionType(exp);
3767 ComputeExpression(exp);
3768 expString[0] = '\0';
3769 PrintExpression(exp, expString);
3770 strcat(argument, expString);
3771 FreeExpression(exp);
3776 strcat(argument, arg.member->name);
3781 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3782 strcat(argument, arg.dataTypeString);
3789 strcat(templateString, ", ");
3790 if(lastParam != p - 1)
3792 strcat(templateString, param->name);
3793 strcat(templateString, " = ");
3795 strcat(templateString, argument);
3804 int len = strlen(templateString);
3806 if(templateString[len - 1] == '<')
3810 if(templateString[len - 1] == '>')
3811 templateString[len++] = ' ';
3812 templateString[len++] = '>';
3814 templateString[len++] = '\0';
3817 struct Context * context = SetupTemplatesContext(_class);
3821 type = ProcessTypeString(templateString, 0x0);
3823 FinishTemplatesContext(context);
3826 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3828 ProcessExpressionType(member->initializer->exp);
3829 if(!member->initializer->exp->expType)
3833 char expString[10240];
3835 expString[0] = '\0';
3836 PrintExpression(member->initializer->exp, expString);
3837 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3841 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3846 else if(member->initializer)
3848 ProcessInitializer(member->initializer, type);
3855 if(_class && _class->type == 3)
3857 if(member->initializer)
3859 struct Type * type = MkClassType(_class->fullName);
3861 ProcessInitializer(member->initializer, type);
3867 if(member->initializer)
3869 ProcessInitializer(member->initializer, (((void *)0)));
3875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3881 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3885 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3890 extern struct Identifier * GetDeclId(struct Declarator * decl);
3892 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);
3894 extern void FreeSpecifier(struct Specifier * spec);
3896 static void ProcessFunction(struct FunctionDefinition * function);
3898 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3900 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3902 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3904 extern void FreeClassFunction(struct ClassFunction * func);
3906 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3908 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3910 void ProcessInstantiationType(struct Instantiation * inst)
3915 struct MembersInit * members;
3916 struct Symbol * classSym;
3917 struct __ecereNameSpace__ecere__com__Class * _class;
3919 classSym = inst->_class->symbol;
3920 _class = classSym ? classSym->registered : (((void *)0));
3921 if(!_class || _class->type != 5)
3922 DeclareStruct(inst->_class->name, 0x0);
3923 afterExternal = afterExternal ? afterExternal : curExternal;
3925 ProcessExpressionType(inst->exp);
3926 inst->isConstant = 0x1;
3929 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3930 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3931 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3932 int subMemberStackPos = 0;
3934 for(members = (*inst->members).first; members; members = members->next)
3936 switch(members->type)
3941 static unsigned int instMethodID = 0;
3942 struct External * external = curExternal;
3943 struct Context * context = curContext;
3944 struct Declarator * declarator = members->function->declarator;
3945 struct Identifier * nameID = GetDeclId(declarator);
3946 char * unmangled = nameID ? nameID->string : (((void *)0));
3947 struct Expression * exp;
3948 struct External * createdExternal = (((void *)0));
3954 strcpy(name, "__ecereInstMeth_");
3955 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3957 strcat(name, nameID->string);
3959 sprintf(number, "_%08d", instMethodID++);
3960 strcat(name, number);
3961 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3965 struct Symbol * symbol = declarator->symbol;
3966 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3968 if(method && method->type == 1)
3970 symbol->method = method;
3971 ProcessMethodType(method);
3972 if(!symbol->type->thisClass)
3974 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3976 if(!currentClass->symbol)
3977 currentClass->symbol = FindClass(currentClass->fullName);
3978 symbol->type->thisClass = currentClass->symbol;
3983 _class->symbol = FindClass(_class->fullName);
3984 symbol->type->thisClass = _class->symbol;
3987 DeclareType(symbol->type, 0x1, 0x1);
3991 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3994 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3997 FreeSpecifier(nameID->_class);
3998 nameID->_class = (((void *)0));
4002 struct Type * type = declarator->symbol->type;
4003 struct External * oldExternal = curExternal;
4005 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4007 struct External * externalDecl;
4009 externalDecl = MkExternalDeclaration((((void *)0)));
4010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4011 if(createdExternal->function)
4013 ProcessFunction(createdExternal->function);
4015 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4017 externalDecl->declaration = decl;
4018 if(decl->symbol && !decl->symbol->pointerExternal)
4019 decl->symbol->pointerExternal = externalDecl;
4020 declarator->symbol->pointerExternal = externalDecl;
4027 curExternal = declarator->symbol->pointerExternal;
4028 ProcessFunction((struct FunctionDefinition *)members->function);
4030 curExternal = external;
4031 curContext = context;
4034 FreeClassFunction(members->function);
4035 exp = QMkExpId(name);
4037 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4038 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4044 if(members->dataMembers && classSym)
4046 struct MemberInit * member;
4047 struct Location oldyyloc = yylloc;
4049 for(member = (*members->dataMembers).first; member; member = member->next)
4051 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4052 if(member->initializer && !member->initializer->isConstant)
4053 inst->isConstant = 0x0;
4065 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4069 if(type->kind == 11)
4071 struct Type * param;
4075 for(param = type->params.first; param; param = param->next)
4076 DeclareType(param, declarePointers, 0x1);
4078 DeclareType(type->returnType, declarePointers, 0x1);
4080 else if(type->kind == 13 && declarePointers)
4081 DeclareType(type->type, declarePointers, 0x0);
4082 else if(type->kind == 8)
4084 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4085 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4087 else if(type->kind == 9 || type->kind == 10)
4089 struct Type * member;
4091 for(member = type->members.first; member; member = member->next)
4092 DeclareType(member, 0x0, 0x0);
4094 else if(type->kind == 12)
4095 DeclareType(type->arrayType, declarePointers, 0x0);
4099 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4101 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4103 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4105 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4106 struct __ecereNameSpace__ecere__com__Class * sClass;
4108 for(sClass = _class; sClass; sClass = sClass->base)
4111 if(sClass->templateClass)
4112 sClass = sClass->templateClass;
4113 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4115 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4117 for(sClass = sClass->base; sClass; sClass = sClass->base)
4119 if(sClass->templateClass)
4120 sClass = sClass->templateClass;
4121 id += sClass->templateParams.count;
4132 arg = &_class->templateArgs[id];
4133 if(arg && param->type == 0)
4134 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4139 extern struct Context * PushContext(void);
4141 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4143 struct TemplatedType
4146 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4147 struct __ecereNameSpace__ecere__sys__BTNode * left;
4148 struct __ecereNameSpace__ecere__sys__BTNode * right;
4150 struct TemplateParameter * param;
4151 } __attribute__ ((gcc_struct));
4153 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4155 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4157 struct Context * context = PushContext();
4159 context->templateTypesOnly = 0x1;
4160 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4162 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4164 for(; param; param = param->next)
4166 if(param->type == 0 && param->identifier)
4168 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4170 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4176 struct __ecereNameSpace__ecere__com__Class * sClass;
4178 for(sClass = _class; sClass; sClass = sClass->base)
4180 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4182 for(p = sClass->templateParams.first; p; p = p->next)
4186 struct TemplateParameter * param = p->param;
4187 struct TemplatedType * type;
4191 p->param = param = __extension__ ({
4192 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4194 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4197 type = __extension__ ({
4198 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4200 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4202 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4210 extern void PopContext(struct Context * ctx);
4212 extern void FreeContext(struct Context * context);
4214 void FinishTemplatesContext(struct Context * context)
4216 PopContext(context);
4217 FreeContext(context);
4218 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4221 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4223 if(!method->dataType)
4225 struct Context * context = SetupTemplatesContext(method->_class);
4227 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4228 FinishTemplatesContext(context);
4229 if(method->type != 1 && method->dataType)
4231 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4233 if(!method->_class->symbol)
4234 method->_class->symbol = FindClass(method->_class->fullName);
4235 method->dataType->thisClass = method->_class->symbol;
4241 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4245 struct Context * context = SetupTemplatesContext(prop->_class);
4247 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4248 FinishTemplatesContext(context);
4252 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4254 extern void FreeTypeName(struct TypeName * typeName);
4256 static void ProcessDeclarator(struct Declarator * decl);
4258 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4260 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4264 struct MethodImport * prev;
4265 struct MethodImport * next;
4267 unsigned int isVirtual;
4268 } __attribute__ ((gcc_struct));
4270 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4272 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4274 struct Symbol * symbol = method->symbol;
4276 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4278 unsigned int imported = 0x0;
4279 unsigned int dllImport = 0x0;
4281 if(!method->dataType)
4282 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4283 if(!symbol || symbol->_import || method->type == 1)
4285 if(!symbol || method->type == 1)
4287 struct Symbol * classSym;
4289 if(!method->_class->symbol)
4290 method->_class->symbol = FindClass(method->_class->fullName);
4291 classSym = method->_class->symbol;
4292 if(!classSym->_import)
4294 struct ModuleImport * module;
4296 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4297 module = FindModule(method->_class->module);
4299 module = mainModule;
4300 classSym->_import = __extension__ ({
4301 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4303 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4309 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4311 if(!symbol->_import)
4313 symbol->_import = (struct ClassImport *)__extension__ ({
4314 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4316 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4322 symbol->type = method->dataType;
4324 symbol->type->refCount++;
4327 if(!method->dataType->dllExport)
4330 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)
4334 if(method->type != 1 && method->dataType)
4335 DeclareType(method->dataType, 0x1, 0x1);
4336 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4338 struct Declaration * decl;
4339 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4340 struct Declarator * d;
4341 struct Declarator * funcDecl;
4342 struct External * external;
4344 specifiers = MkList();
4345 declarators = MkList();
4347 ListAdd(specifiers, MkSpecifier(EXTERN));
4348 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4349 ListAdd(specifiers, MkSpecifier(STATIC));
4350 if(method->type == 1)
4352 ListAdd(specifiers, MkSpecifier(INT));
4353 d = MkDeclaratorIdentifier(MkIdentifier(name));
4357 d = MkDeclaratorIdentifier(MkIdentifier(name));
4359 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4361 struct Context * context = SetupTemplatesContext(method->_class);
4363 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4364 FinishTemplatesContext(context);
4366 funcDecl = GetFuncDecl(d);
4369 struct Specifier * spec, * next;
4371 for(spec = (*specifiers).first; spec; spec = next)
4376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4377 FreeSpecifier(spec);
4381 if(method->dataType && !method->dataType->staticMethod)
4383 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4385 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4386 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")));
4387 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4388 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4390 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4392 struct TypeName * param = (*funcDecl->function.parameters).first;
4394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4395 FreeTypeName(param);
4397 if(!funcDecl->function.parameters)
4398 funcDecl->function.parameters = MkList();
4399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4403 ProcessDeclarator(d);
4404 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4405 decl = MkDeclaration(specifiers, declarators);
4406 ReplaceThisClassSpecifiers(specifiers, method->_class);
4407 if(symbol->pointerExternal)
4409 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4412 *functionSymbol = *symbol;
4413 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4414 if(functionSymbol->type)
4415 functionSymbol->type->refCount++;
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4418 symbol->pointerExternal->symbol = functionSymbol;
4420 external = MkExternalDeclaration(decl);
4422 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4423 external->symbol = symbol;
4424 symbol->pointerExternal = external;
4428 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4430 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4434 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4436 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4438 unsigned int first = 0x1;
4440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4442 char className[1024];
4444 strcpy(className, _class->fullName);
4445 for(param = _class->templateParams.first; param; param = param->next)
4449 strcat(className, "<");
4451 strcat(className, ", ");
4452 if(lastParam + 1 != p)
4454 strcat(className, param->name);
4455 strcat(className, " = ");
4457 strcat(className, param->name);
4465 int len = strlen(className);
4467 if(className[len - 1] == '>')
4468 className[len++] = ' ';
4469 className[len++] = '>';
4470 className[len++] = '\0';
4472 return __ecereNameSpace__ecere__sys__CopyString(className);
4475 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4478 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4480 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4482 unsigned int first = 0x1;
4484 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4486 char className[1024];
4488 strcpy(className, _class->fullName);
4489 for(param = _class->templateParams.first; param; param = param->next)
4493 strcat(className, "<");
4495 strcat(className, ", ");
4496 if(lastParam + 1 != p)
4498 strcat(className, param->name);
4499 strcat(className, " = ");
4501 strcat(className, param->name);
4509 int len = strlen(className);
4511 if(className[len - 1] == '>')
4512 className[len++] = ' ';
4513 className[len++] = '>';
4514 className[len++] = '\0';
4516 return MkClassType(className);
4520 return MkClassType(_class->fullName);
4524 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4526 if(specs != (((void *)0)) && _class)
4528 struct Specifier * spec;
4530 for(spec = specs->first; spec; spec = spec->next)
4532 if(spec->type == 0 && spec->specifier == THISCLASS)
4535 spec->name = ReplaceThisClass(_class);
4536 spec->symbol = FindClass(spec->name);
4542 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4544 struct __ecereNameSpace__ecere__com__GlobalFunction
4546 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4547 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4550 struct __ecereNameSpace__ecere__com__Instance * module;
4551 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4552 char * dataTypeString;
4553 struct Type * dataType;
4555 } __attribute__ ((gcc_struct));
4557 extern struct Context * globalContext;
4559 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4561 struct FunctionImport
4563 struct FunctionImport * prev;
4564 struct FunctionImport * next;
4566 } __attribute__ ((gcc_struct));
4568 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4570 struct Symbol * symbol = function->symbol;
4572 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4574 unsigned int imported = 0x0;
4575 unsigned int dllImport = 0x0;
4577 if(!function->dataType)
4579 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4580 if(!function->dataType->thisClass)
4581 function->dataType->staticMethod = 0x1;
4587 struct ModuleImport * module = FindModule(function->module);
4589 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4592 if(!function->dataType->dllExport)
4594 symbol->_import = (struct ClassImport *)__extension__ ({
4595 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4597 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4603 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4604 if(!symbol->type->thisClass)
4605 symbol->type->staticMethod = 0x1;
4608 imported = symbol->_import ? 0x1 : 0x0;
4609 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4612 DeclareType(function->dataType, 0x1, 0x1);
4615 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4617 struct Declaration * decl;
4618 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4619 struct Declarator * d;
4620 struct Declarator * funcDecl;
4621 struct External * external;
4623 specifiers = MkList();
4624 declarators = MkList();
4625 ListAdd(specifiers, MkSpecifier(EXTERN));
4626 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4628 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4629 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4630 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4632 struct Specifier * spec;
4634 for(spec = (*specifiers).first; spec; spec = spec->next)
4635 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4638 FreeSpecifier(spec);
4642 funcDecl = GetFuncDecl(d);
4643 if(funcDecl && !funcDecl->function.parameters)
4645 funcDecl->function.parameters = MkList();
4646 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4648 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4650 struct Context * oldCtx = curContext;
4652 curContext = globalContext;
4653 decl = MkDeclaration(specifiers, declarators);
4654 curContext = oldCtx;
4656 if(symbol->pointerExternal)
4658 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4661 *functionSymbol = *symbol;
4662 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4663 if(functionSymbol->type)
4664 functionSymbol->type->refCount++;
4666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4667 symbol->pointerExternal->symbol = functionSymbol;
4669 external = MkExternalDeclaration(decl);
4671 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4672 external->symbol = symbol;
4673 symbol->pointerExternal = external;
4677 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4680 symbol->id = curExternal->symbol->idCode;
4683 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4691 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4692 struct __ecereNameSpace__ecere__sys__BTNode * left;
4693 struct __ecereNameSpace__ecere__sys__BTNode * right;
4695 struct __ecereNameSpace__ecere__com__Instance * module;
4696 char * dataTypeString;
4697 struct Type * dataType;
4700 } __attribute__ ((gcc_struct));
4702 void DeclareGlobalData(struct GlobalData * data)
4704 struct Symbol * symbol = data->symbol;
4706 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4711 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4714 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4715 DeclareType(data->dataType, 0x1, 0x1);
4718 if(!symbol->pointerExternal)
4720 struct Declaration * decl;
4721 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4722 struct Declarator * d;
4723 struct External * external;
4725 specifiers = MkList();
4726 declarators = MkList();
4727 ListAdd(specifiers, MkSpecifier(EXTERN));
4728 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4729 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4730 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4731 decl = MkDeclaration(specifiers, declarators);
4732 external = MkExternalDeclaration(decl);
4734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4735 external->symbol = symbol;
4736 symbol->pointerExternal = external;
4740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4743 symbol->id = curExternal->symbol->idCode;
4750 struct Conversion * prev, * next;
4751 struct __ecereNameSpace__ecere__com__Property * convert;
4753 struct Type * resultType;
4754 } __attribute__ ((gcc_struct));
4756 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4758 extern void Compiler_Warning(char * format, ...);
4760 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4762 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)
4766 if(source->kind == 20 && dest->kind != 20)
4768 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4773 if(dest->kind == 20 && source->kind != 20)
4775 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4780 if(dest->classObjectType == 2)
4782 if(source->classObjectType != 3)
4786 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4794 if(source->classObjectType == 3)
4796 if(dest->classObjectType == 3 && source->classObjectType != 2)
4799 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4801 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4804 if(dest->kind == 14 && source->kind != 0)
4806 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))
4808 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))
4810 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4812 if(source->_class->registered && source->_class->registered->type == 3)
4814 if(conversions != (((void *)0)))
4816 if(source->_class->registered == dest->_class->registered)
4821 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4823 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4825 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4827 if(sourceBase == destBase)
4831 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))
4835 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))
4837 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4844 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4848 if(source->kind == 8)
4850 struct __ecereNameSpace__ecere__com__Class * _class;
4852 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4854 struct __ecereNameSpace__ecere__com__Property * convert;
4856 for(convert = _class->conversions.first; convert; convert = convert->next)
4858 if(convert->memberAccess == 1 || _class->module == privateModule)
4860 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4862 if(!convert->dataType)
4863 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4864 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4866 if(!conversions && !convert->Get)
4868 else if(conversions != (((void *)0)))
4870 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))
4874 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4887 struct __ecereNameSpace__ecere__com__Class * _class;
4889 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4891 struct __ecereNameSpace__ecere__com__Property * convert;
4893 for(convert = _class->conversions.first; convert; convert = convert->next)
4895 if(convert->memberAccess == 1 || _class->module == privateModule)
4897 if(!convert->dataType)
4898 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4899 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4901 if(!conversions && !convert->Set)
4903 else if(conversions != (((void *)0)))
4905 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))
4909 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4919 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4921 if(!dest->_class->registered->dataType)
4922 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4923 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4925 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4932 if(source->kind == 8)
4934 struct __ecereNameSpace__ecere__com__Class * _class;
4936 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4938 struct __ecereNameSpace__ecere__com__Property * convert;
4940 for(convert = _class->conversions.first; convert; convert = convert->next)
4942 if(convert->memberAccess == 1 || _class->module == privateModule)
4944 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4946 if(!convert->dataType)
4947 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4948 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4950 if(!conversions && !convert->Get)
4952 else if(conversions != (((void *)0)))
4954 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))
4958 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4960 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4968 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4970 if(!source->_class->registered->dataType)
4971 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4972 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4979 if(source->kind == 8 || source->kind == 19)
4981 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4983 else if(dest->kind == 7 && source->kind == 6)
4985 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4987 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4989 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4991 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4993 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4995 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))
4997 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))
4999 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)))
5001 struct Type * paramSource, * paramDest;
5003 if(dest->kind == 16)
5004 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5005 if(source->kind == 16)
5006 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5007 if(dest->kind == 13 && dest->type->kind == 11)
5009 if(source->kind == 13 && source->type->kind == 11)
5010 source = source->type;
5011 if(dest->kind == 16)
5012 dest = dest->method->dataType;
5013 if(source->kind == 16)
5014 source = source->method->dataType;
5015 paramSource = source->params.first;
5016 if(paramSource && paramSource->kind == 0)
5017 paramSource = (((void *)0));
5018 paramDest = dest->params.first;
5019 if(paramDest && paramDest->kind == 0)
5020 paramDest = (((void *)0));
5021 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5023 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))))
5025 if(paramDest && paramDest->kind == 8)
5026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5028 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5031 paramDest = paramDest->next;
5033 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5035 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5039 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5041 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5047 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5050 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5052 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5056 paramSource = paramSource->next;
5062 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5070 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5078 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5080 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5083 for(; paramDest; paramDest = paramDest->next)
5087 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5091 struct Type * paramDestType = paramDest;
5092 struct Type * paramSourceType = paramSource;
5093 struct Type * type = paramDestType;
5095 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5098 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5099 struct __ecereNameSpace__ecere__com__Class * sClass;
5101 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5104 if(sClass->templateClass)
5105 sClass = sClass->templateClass;
5106 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5108 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5110 for(sClass = sClass->base; sClass; sClass = sClass->base)
5112 if(sClass->templateClass)
5113 sClass = sClass->templateClass;
5114 id += sClass->templateParams.count;
5125 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5127 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5130 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)))
5135 PrintType(paramDest, type, 0x0, 0x1);
5136 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5137 if(paramDestType != paramDest)
5138 FreeType(paramDestType);
5141 if(paramDestType != paramDest)
5142 FreeType(paramDestType);
5144 paramSource = paramSource->next;
5148 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5153 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5157 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5159 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5166 static void FreeConvert(struct Conversion * convert)
5168 if(convert->resultType)
5169 FreeType(convert->resultType);
5172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5174 struct __ecereNameSpace__ecere__com__BTNamedLink
5177 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5178 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5179 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5182 } __attribute__ ((gcc_struct));
5184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5186 struct __ecereNameSpace__ecere__com__EnumClassData
5188 struct __ecereNameSpace__ecere__sys__OldList values;
5190 } __attribute__ ((gcc_struct));
5192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5194 struct __ecereNameSpace__ecere__sys__NamedLink
5196 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5197 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5200 } __attribute__ ((gcc_struct));
5202 extern void FreeExpContents(struct Expression * exp);
5204 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5206 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5208 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5210 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5212 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5214 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5216 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5218 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)))
5220 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5222 if(_class->type == 4)
5224 struct __ecereNameSpace__ecere__sys__OldList converts =
5228 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5232 _class->symbol = FindClass(_class->fullName);
5233 type->_class = _class->symbol;
5234 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5236 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5237 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5241 struct __ecereNameSpace__ecere__com__Class * baseClass;
5243 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5245 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5247 for(value = e->values.first; value; value = value->next)
5249 if(!strcmp(value->name, string))
5254 FreeExpContents(sourceExp);
5255 FreeType(sourceExp->expType);
5256 sourceExp->isConstant = 0x1;
5257 sourceExp->expType = MkClassType(baseClass->fullName);
5261 sourceExp->type = 2;
5262 if(!strcmp(baseClass->dataTypeString, "int"))
5263 sprintf(constant, "%d", (int)value->data);
5265 sprintf(constant, "0x%X", (int)value->data);
5266 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5268 while(converts.first)
5270 struct Conversion * convert = converts.first;
5272 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5275 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5283 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5286 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)))
5287 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5292 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5294 struct __ecereNameSpace__ecere__com__SubModule
5296 struct __ecereNameSpace__ecere__com__SubModule * prev;
5297 struct __ecereNameSpace__ecere__com__SubModule * next;
5298 struct __ecereNameSpace__ecere__com__Instance * module;
5300 } __attribute__ ((gcc_struct));
5302 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5304 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5306 if(searchFor == searchIn)
5308 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5310 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5312 if(ModuleVisibility(subModule->module, searchFor))
5319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5321 struct __ecereNameSpace__ecere__com__Application
5326 unsigned int isGUIApp;
5327 struct __ecereNameSpace__ecere__sys__OldList allModules;
5328 char * parsedCommand;
5329 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5330 } __attribute__ ((gcc_struct));
5332 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5334 struct __ecereNameSpace__ecere__com__Instance * module;
5336 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))
5338 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))
5340 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))
5342 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)
5344 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5350 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5352 void ReadString(char * output, char * string);
5354 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5356 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5358 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5360 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5362 struct Type * source = sourceExp->expType;
5363 struct Type * realDest = dest;
5364 struct Type * backupSourceExpType = (((void *)0));
5366 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5368 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5370 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5372 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5374 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5376 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5378 if(sourceBase == destBase)
5384 struct __ecereNameSpace__ecere__sys__OldList * specs;
5385 unsigned int flag = 0x0;
5386 long long value = (((int)0x7fffffff));
5390 if(sourceExp->type == 2)
5392 if(source->isSigned)
5393 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5395 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5397 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5399 if(source->isSigned)
5400 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5402 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5404 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5407 source = __extension__ ({
5408 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5410 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5415 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5417 if(_class && _class->type == 3)
5419 if(source->kind != 8)
5421 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5422 struct Type * tempDest, * tempSource;
5424 for(; _class->base->type != 1000; _class = _class->base)
5427 tempDest = tempType;
5430 _class->symbol = FindClass(_class->fullName);
5431 tempType->_class = _class->symbol;
5432 tempType->truth = dest->truth;
5433 if(tempType->_class)
5434 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5435 backupSourceExpType = sourceExp->expType;
5436 sourceExp->expType = dest;
5439 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5442 if(_class && _class->type == 2 && source->kind != 8)
5444 if(!dest->_class->registered->dataType)
5445 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5446 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5449 FreeType(sourceExp->expType);
5450 source = sourceExp->expType = MkClassType(dest->_class->string);
5454 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5456 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5457 struct Declarator * decl;
5460 ReadString(string, sourceExp->string);
5461 decl = SpecDeclFromString(string, specs, (((void *)0)));
5462 FreeExpContents(sourceExp);
5463 FreeType(sourceExp->expType);
5464 sourceExp->type = 24;
5465 sourceExp->_classExp.specifiers = specs;
5466 sourceExp->_classExp.decl = decl;
5467 sourceExp->expType = dest;
5471 if(backupSourceExpType)
5472 FreeType(backupSourceExpType);
5476 else if(source->kind == 8)
5478 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5480 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5484 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5485 struct Type * tempDest, * tempSource;
5487 if(!source->_class->registered->dataType)
5488 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5489 for(; _class->base->type != 1000; _class = _class->base)
5492 tempSource = tempType;
5494 tempType->_class = FindClass(_class->fullName);
5495 tempType->truth = source->truth;
5496 tempType->classObjectType = source->classObjectType;
5497 if(tempType->_class)
5498 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5499 if(conversions->last)
5501 ((struct Conversion *)conversions->last)->resultType = dest;
5504 FreeType(sourceExp->expType);
5505 sourceExp->expType = MkClassType(_class->fullName);
5506 sourceExp->expType->truth = source->truth;
5507 sourceExp->expType->classObjectType = source->classObjectType;
5508 if(!sourceExp->destType)
5510 FreeType(sourceExp->destType);
5511 sourceExp->destType = sourceExp->expType;
5512 if(sourceExp->expType)
5513 sourceExp->expType->refCount++;
5515 if(!_class->dataType)
5516 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5518 dest = MkClassType(source->_class->string);
5519 dest->truth = source->truth;
5520 dest->classObjectType = source->classObjectType;
5522 source = _class->dataType;
5524 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5530 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5539 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5541 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5543 if(_class->type == 0 || _class->type == 5)
5545 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5547 *newExp = *sourceExp;
5548 if(sourceExp->destType)
5549 sourceExp->destType->refCount++;
5550 if(sourceExp->expType)
5551 sourceExp->expType->refCount++;
5552 sourceExp->type = 11;
5553 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5554 sourceExp->cast.exp = newExp;
5555 FreeType(sourceExp->expType);
5556 sourceExp->expType = (((void *)0));
5557 ProcessExpressionType(sourceExp);
5560 FreeType(sourceExp->expType);
5561 sourceExp->expType = dest;
5566 if(backupSourceExpType)
5567 FreeType(backupSourceExpType);
5570 if(!_class->dataType)
5571 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5573 dest = _class->dataType;
5576 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))
5578 specs = MkListOne(MkSpecifier(DOUBLE));
5580 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))
5582 specs = MkListOne(MkSpecifier(FLOAT));
5584 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))
5588 ListAdd(specs, MkSpecifier(UNSIGNED));
5589 ListAdd(specs, MkSpecifier(INT64));
5591 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5595 ListAdd(specs, MkSpecifier(UNSIGNED));
5596 ListAdd(specs, MkSpecifier(INT));
5598 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5602 ListAdd(specs, MkSpecifier(UNSIGNED));
5603 ListAdd(specs, MkSpecifier(SHORT));
5605 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5609 ListAdd(specs, MkSpecifier(UNSIGNED));
5610 ListAdd(specs, MkSpecifier(CHAR));
5616 if(backupSourceExpType)
5618 if(sourceExp->expType)
5619 FreeType(sourceExp->expType);
5620 sourceExp->expType = backupSourceExpType;
5625 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))
5627 specs = MkListOne(MkSpecifier(DOUBLE));
5629 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))
5631 specs = MkListOne(MkSpecifier(FLOAT));
5633 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5636 ListAdd(specs, MkSpecifier(BOOL));
5638 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)))
5642 ListAdd(specs, MkSpecifier(UNSIGNED));
5643 ListAdd(specs, MkSpecifier(CHAR));
5645 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)))))
5649 ListAdd(specs, MkSpecifier(UNSIGNED));
5650 ListAdd(specs, MkSpecifier(SHORT));
5652 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5656 ListAdd(specs, MkSpecifier(UNSIGNED));
5657 ListAdd(specs, MkSpecifier(INT));
5659 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5663 ListAdd(specs, MkSpecifier(UNSIGNED));
5664 ListAdd(specs, MkSpecifier(INT64));
5666 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5668 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5674 if(backupSourceExpType)
5676 if(sourceExp->expType)
5677 FreeType(sourceExp->expType);
5678 sourceExp->expType = backupSourceExpType;
5684 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5686 *newExp = *sourceExp;
5687 newExp->prev = (((void *)0));
5688 newExp->next = (((void *)0));
5689 if(sourceExp->destType)
5690 sourceExp->destType->refCount++;
5691 if(sourceExp->expType)
5692 sourceExp->expType->refCount++;
5693 sourceExp->type = 11;
5694 if(realDest->kind == 8)
5696 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5697 FreeList(specs, FreeSpecifier);
5700 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5701 if(newExp->type == 4)
5703 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5706 sourceExp->cast.exp = newExp;
5707 FreeType(sourceExp->expType);
5708 sourceExp->expType = (((void *)0));
5709 ProcessExpressionType(sourceExp);
5712 FreeList(specs, FreeSpecifier);
5715 if(backupSourceExpType)
5716 FreeType(backupSourceExpType);
5721 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5722 sourceExp = (*sourceExp->list).last;
5723 if(sourceExp->type == 0)
5725 struct Identifier * id = sourceExp->identifier;
5729 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5731 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5732 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5736 for(; _class && _class->type == 4; _class = _class->base)
5738 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5739 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5741 for(value = e->values.first; value; value = value->next)
5743 if(!strcmp(value->name, id->string))
5748 FreeExpContents(sourceExp);
5749 FreeType(sourceExp->expType);
5750 sourceExp->isConstant = 0x1;
5751 sourceExp->expType = MkClassType(_class->fullName);
5755 sourceExp->type = 2;
5756 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5757 sprintf(constant, "%d", (int)value->data);
5759 sprintf(constant, "0x%X", (int)value->data);
5760 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5768 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5775 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5777 int value2 = op2->i;
5780 exp->string = PrintInt(op1->i + value2);
5783 exp->expType = op1->type;
5785 op1->type->refCount++;
5790 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5792 unsigned int value2 = op2->ui;
5795 exp->string = PrintUInt(op1->ui + value2);
5798 exp->expType = op1->type;
5800 op1->type->refCount++;
5805 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5807 long long value2 = op2->i64;
5810 exp->string = PrintInt64(op1->i64 + value2);
5813 exp->expType = op1->type;
5815 op1->type->refCount++;
5820 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5822 uint64 value2 = op2->ui64;
5825 exp->string = PrintUInt64(op1->ui64 + value2);
5828 exp->expType = op1->type;
5830 op1->type->refCount++;
5835 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5837 short value2 = op2->s;
5840 exp->string = PrintShort(op1->s + value2);
5843 exp->expType = op1->type;
5845 op1->type->refCount++;
5850 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 unsigned short value2 = op2->us;
5855 exp->string = PrintUShort(op1->us + value2);
5858 exp->expType = op1->type;
5860 op1->type->refCount++;
5865 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 char value2 = op2->c;
5870 exp->string = PrintChar(op1->c + value2);
5873 exp->expType = op1->type;
5875 op1->type->refCount++;
5880 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 unsigned char value2 = op2->uc;
5885 exp->string = PrintUChar(op1->uc + value2);
5888 exp->expType = op1->type;
5890 op1->type->refCount++;
5895 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5897 float value2 = op2->f;
5900 exp->string = PrintFloat(op1->f + value2);
5903 exp->expType = op1->type;
5905 op1->type->refCount++;
5910 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5912 double value2 = op2->d;
5915 exp->string = PrintDouble(op1->d + value2);
5918 exp->expType = op1->type;
5920 op1->type->refCount++;
5925 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5927 int value2 = op2->i;
5930 exp->string = PrintInt(op1->i - value2);
5933 exp->expType = op1->type;
5935 op1->type->refCount++;
5940 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5942 unsigned int value2 = op2->ui;
5945 exp->string = PrintUInt(op1->ui - value2);
5948 exp->expType = op1->type;
5950 op1->type->refCount++;
5955 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5957 long long value2 = op2->i64;
5960 exp->string = PrintInt64(op1->i64 - value2);
5963 exp->expType = op1->type;
5965 op1->type->refCount++;
5970 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5972 uint64 value2 = op2->ui64;
5975 exp->string = PrintUInt64(op1->ui64 - value2);
5978 exp->expType = op1->type;
5980 op1->type->refCount++;
5985 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5987 short value2 = op2->s;
5990 exp->string = PrintShort(op1->s - value2);
5993 exp->expType = op1->type;
5995 op1->type->refCount++;
6000 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6002 unsigned short value2 = op2->us;
6005 exp->string = PrintUShort(op1->us - value2);
6008 exp->expType = op1->type;
6010 op1->type->refCount++;
6015 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6017 char value2 = op2->c;
6020 exp->string = PrintChar(op1->c - value2);
6023 exp->expType = op1->type;
6025 op1->type->refCount++;
6030 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6032 unsigned char value2 = op2->uc;
6035 exp->string = PrintUChar(op1->uc - value2);
6038 exp->expType = op1->type;
6040 op1->type->refCount++;
6045 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6047 float value2 = op2->f;
6050 exp->string = PrintFloat(op1->f - value2);
6053 exp->expType = op1->type;
6055 op1->type->refCount++;
6060 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6062 double value2 = op2->d;
6065 exp->string = PrintDouble(op1->d - value2);
6068 exp->expType = op1->type;
6070 op1->type->refCount++;
6075 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6077 int value2 = op2->i;
6080 exp->string = PrintInt(op1->i * value2);
6083 exp->expType = op1->type;
6085 op1->type->refCount++;
6090 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6092 unsigned int value2 = op2->ui;
6095 exp->string = PrintUInt(op1->ui * value2);
6098 exp->expType = op1->type;
6100 op1->type->refCount++;
6105 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6107 long long value2 = op2->i64;
6110 exp->string = PrintInt64(op1->i64 * value2);
6113 exp->expType = op1->type;
6115 op1->type->refCount++;
6120 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6122 uint64 value2 = op2->ui64;
6125 exp->string = PrintUInt64(op1->ui64 * value2);
6128 exp->expType = op1->type;
6130 op1->type->refCount++;
6135 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6137 short value2 = op2->s;
6140 exp->string = PrintShort(op1->s * value2);
6143 exp->expType = op1->type;
6145 op1->type->refCount++;
6150 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6152 unsigned short value2 = op2->us;
6155 exp->string = PrintUShort(op1->us * value2);
6158 exp->expType = op1->type;
6160 op1->type->refCount++;
6165 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6167 char value2 = op2->c;
6170 exp->string = PrintChar(op1->c * value2);
6173 exp->expType = op1->type;
6175 op1->type->refCount++;
6180 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6182 unsigned char value2 = op2->uc;
6185 exp->string = PrintUChar(op1->uc * value2);
6188 exp->expType = op1->type;
6190 op1->type->refCount++;
6195 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6197 float value2 = op2->f;
6200 exp->string = PrintFloat(op1->f * value2);
6203 exp->expType = op1->type;
6205 op1->type->refCount++;
6210 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6212 double value2 = op2->d;
6215 exp->string = PrintDouble(op1->d * value2);
6218 exp->expType = op1->type;
6220 op1->type->refCount++;
6225 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6227 int value2 = op2->i;
6230 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6233 exp->expType = op1->type;
6235 op1->type->refCount++;
6240 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6242 unsigned int value2 = op2->ui;
6245 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6248 exp->expType = op1->type;
6250 op1->type->refCount++;
6255 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6257 long long value2 = op2->i64;
6260 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6263 exp->expType = op1->type;
6265 op1->type->refCount++;
6270 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6272 uint64 value2 = op2->ui64;
6275 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6278 exp->expType = op1->type;
6280 op1->type->refCount++;
6285 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6287 short value2 = op2->s;
6290 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6293 exp->expType = op1->type;
6295 op1->type->refCount++;
6300 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6302 unsigned short value2 = op2->us;
6305 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6308 exp->expType = op1->type;
6310 op1->type->refCount++;
6315 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6317 char value2 = op2->c;
6320 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6332 unsigned char value2 = op2->uc;
6335 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6338 exp->expType = op1->type;
6340 op1->type->refCount++;
6345 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6347 float value2 = op2->f;
6350 exp->string = PrintFloat(op1->f / value2);
6353 exp->expType = op1->type;
6355 op1->type->refCount++;
6360 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6362 double value2 = op2->d;
6365 exp->string = PrintDouble(op1->d / value2);
6368 exp->expType = op1->type;
6370 op1->type->refCount++;
6375 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6377 int value2 = op2->i;
6380 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6383 exp->expType = op1->type;
6385 op1->type->refCount++;
6390 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6392 unsigned int value2 = op2->ui;
6395 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6398 exp->expType = op1->type;
6400 op1->type->refCount++;
6405 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6407 long long value2 = op2->i64;
6410 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6413 exp->expType = op1->type;
6415 op1->type->refCount++;
6420 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6422 uint64 value2 = op2->ui64;
6425 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6428 exp->expType = op1->type;
6430 op1->type->refCount++;
6435 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6437 short value2 = op2->s;
6440 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6443 exp->expType = op1->type;
6445 op1->type->refCount++;
6450 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6452 unsigned short value2 = op2->us;
6455 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6458 exp->expType = op1->type;
6460 op1->type->refCount++;
6465 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6467 char value2 = op2->c;
6470 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6473 exp->expType = op1->type;
6475 op1->type->refCount++;
6480 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6482 unsigned char value2 = op2->uc;
6485 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6488 exp->expType = op1->type;
6490 op1->type->refCount++;
6495 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6498 exp->string = PrintInt((-op1->i));
6501 exp->expType = op1->type;
6503 op1->type->refCount++;
6508 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6511 exp->string = PrintUInt((unsigned int)(-op1->ui));
6514 exp->expType = op1->type;
6516 op1->type->refCount++;
6521 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6524 exp->string = PrintInt64((-op1->i64));
6527 exp->expType = op1->type;
6529 op1->type->refCount++;
6534 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6537 exp->string = PrintUInt64((uint64)(-op1->ui64));
6540 exp->expType = op1->type;
6542 op1->type->refCount++;
6547 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6550 exp->string = PrintShort((-op1->s));
6553 exp->expType = op1->type;
6555 op1->type->refCount++;
6560 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6563 exp->string = PrintUShort((unsigned short)(-op1->us));
6566 exp->expType = op1->type;
6568 op1->type->refCount++;
6573 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6576 exp->string = PrintChar((-op1->c));
6579 exp->expType = op1->type;
6581 op1->type->refCount++;
6586 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6589 exp->string = PrintUChar((unsigned char)(-op1->uc));
6592 exp->expType = op1->type;
6594 op1->type->refCount++;
6599 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6602 exp->string = PrintFloat((float)(-op1->f));
6605 exp->expType = op1->type;
6607 op1->type->refCount++;
6612 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6615 exp->string = PrintDouble((double)(-op1->d));
6618 exp->expType = op1->type;
6620 op1->type->refCount++;
6625 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6628 exp->string = PrintInt((++op1->i));
6631 exp->expType = op1->type;
6633 op1->type->refCount++;
6638 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6641 exp->string = PrintUInt((++op1->ui));
6644 exp->expType = op1->type;
6646 op1->type->refCount++;
6651 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6654 exp->string = PrintInt64((++op1->i64));
6657 exp->expType = op1->type;
6659 op1->type->refCount++;
6664 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6667 exp->string = PrintUInt64((++op1->ui64));
6670 exp->expType = op1->type;
6672 op1->type->refCount++;
6677 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6680 exp->string = PrintShort((++op1->s));
6683 exp->expType = op1->type;
6685 op1->type->refCount++;
6690 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6693 exp->string = PrintUShort((++op1->us));
6696 exp->expType = op1->type;
6698 op1->type->refCount++;
6703 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6706 exp->string = PrintChar((++op1->c));
6709 exp->expType = op1->type;
6711 op1->type->refCount++;
6716 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6719 exp->string = PrintUChar((++op1->uc));
6722 exp->expType = op1->type;
6724 op1->type->refCount++;
6729 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6732 exp->string = PrintFloat((float)(++op1->f));
6735 exp->expType = op1->type;
6737 op1->type->refCount++;
6742 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6745 exp->string = PrintDouble((double)(++op1->d));
6748 exp->expType = op1->type;
6750 op1->type->refCount++;
6755 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6758 exp->string = PrintInt((--op1->i));
6761 exp->expType = op1->type;
6763 op1->type->refCount++;
6768 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6771 exp->string = PrintUInt((--op1->ui));
6774 exp->expType = op1->type;
6776 op1->type->refCount++;
6781 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6784 exp->string = PrintInt64((--op1->i64));
6787 exp->expType = op1->type;
6789 op1->type->refCount++;
6794 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6797 exp->string = PrintUInt64((--op1->ui64));
6800 exp->expType = op1->type;
6802 op1->type->refCount++;
6807 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6810 exp->string = PrintShort((--op1->s));
6813 exp->expType = op1->type;
6815 op1->type->refCount++;
6820 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6823 exp->string = PrintUShort((--op1->us));
6826 exp->expType = op1->type;
6828 op1->type->refCount++;
6833 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6836 exp->string = PrintChar((--op1->c));
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6849 exp->string = PrintUChar((--op1->uc));
6852 exp->expType = op1->type;
6854 op1->type->refCount++;
6859 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6862 exp->string = PrintFloat((float)(--op1->f));
6865 exp->expType = op1->type;
6867 op1->type->refCount++;
6872 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6875 exp->string = PrintDouble((double)(--op1->d));
6878 exp->expType = op1->type;
6880 op1->type->refCount++;
6885 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6887 int value2 = op2->i;
6890 exp->string = PrintInt(op1->i = value2);
6893 exp->expType = op1->type;
6895 op1->type->refCount++;
6900 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6902 unsigned int value2 = op2->ui;
6905 exp->string = PrintUInt(op1->ui = value2);
6908 exp->expType = op1->type;
6910 op1->type->refCount++;
6915 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6917 long long value2 = op2->i64;
6920 exp->string = PrintInt64(op1->i64 = value2);
6923 exp->expType = op1->type;
6925 op1->type->refCount++;
6930 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6932 uint64 value2 = op2->ui64;
6935 exp->string = PrintUInt64(op1->ui64 = value2);
6938 exp->expType = op1->type;
6940 op1->type->refCount++;
6945 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6947 short value2 = op2->s;
6950 exp->string = PrintShort(op1->s = value2);
6953 exp->expType = op1->type;
6955 op1->type->refCount++;
6960 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6962 unsigned short value2 = op2->us;
6965 exp->string = PrintUShort(op1->us = value2);
6968 exp->expType = op1->type;
6970 op1->type->refCount++;
6975 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6977 char value2 = op2->c;
6980 exp->string = PrintChar(op1->c = value2);
6983 exp->expType = op1->type;
6985 op1->type->refCount++;
6990 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6992 unsigned char value2 = op2->uc;
6995 exp->string = PrintUChar(op1->uc = value2);
6998 exp->expType = op1->type;
7000 op1->type->refCount++;
7005 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7007 float value2 = op2->f;
7010 exp->string = PrintFloat(op1->f = value2);
7013 exp->expType = op1->type;
7015 op1->type->refCount++;
7020 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7022 double value2 = op2->d;
7025 exp->string = PrintDouble(op1->d = value2);
7028 exp->expType = op1->type;
7030 op1->type->refCount++;
7035 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7037 int value2 = op2->i;
7040 exp->string = PrintInt(op1->i += value2);
7043 exp->expType = op1->type;
7045 op1->type->refCount++;
7050 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7052 unsigned int value2 = op2->ui;
7055 exp->string = PrintUInt(op1->ui += value2);
7058 exp->expType = op1->type;
7060 op1->type->refCount++;
7065 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7067 long long value2 = op2->i64;
7070 exp->string = PrintInt64(op1->i64 += value2);
7073 exp->expType = op1->type;
7075 op1->type->refCount++;
7080 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7082 uint64 value2 = op2->ui64;
7085 exp->string = PrintUInt64(op1->ui64 += value2);
7088 exp->expType = op1->type;
7090 op1->type->refCount++;
7095 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7097 short value2 = op2->s;
7100 exp->string = PrintShort(op1->s += value2);
7103 exp->expType = op1->type;
7105 op1->type->refCount++;
7110 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7112 unsigned short value2 = op2->us;
7115 exp->string = PrintUShort(op1->us += value2);
7118 exp->expType = op1->type;
7120 op1->type->refCount++;
7125 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7127 char value2 = op2->c;
7130 exp->string = PrintChar(op1->c += value2);
7133 exp->expType = op1->type;
7135 op1->type->refCount++;
7140 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7142 unsigned char value2 = op2->uc;
7145 exp->string = PrintUChar(op1->uc += value2);
7148 exp->expType = op1->type;
7150 op1->type->refCount++;
7155 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7157 float value2 = op2->f;
7160 exp->string = PrintFloat(op1->f += value2);
7163 exp->expType = op1->type;
7165 op1->type->refCount++;
7170 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7172 double value2 = op2->d;
7175 exp->string = PrintDouble(op1->d += value2);
7178 exp->expType = op1->type;
7180 op1->type->refCount++;
7185 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7187 int value2 = op2->i;
7190 exp->string = PrintInt(op1->i -= value2);
7193 exp->expType = op1->type;
7195 op1->type->refCount++;
7200 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7202 unsigned int value2 = op2->ui;
7205 exp->string = PrintUInt(op1->ui -= value2);
7208 exp->expType = op1->type;
7210 op1->type->refCount++;
7215 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7217 long long value2 = op2->i64;
7220 exp->string = PrintInt64(op1->i64 -= value2);
7223 exp->expType = op1->type;
7225 op1->type->refCount++;
7230 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7232 uint64 value2 = op2->ui64;
7235 exp->string = PrintUInt64(op1->ui64 -= value2);
7238 exp->expType = op1->type;
7240 op1->type->refCount++;
7245 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7247 short value2 = op2->s;
7250 exp->string = PrintShort(op1->s -= value2);
7253 exp->expType = op1->type;
7255 op1->type->refCount++;
7260 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7262 unsigned short value2 = op2->us;
7265 exp->string = PrintUShort(op1->us -= value2);
7268 exp->expType = op1->type;
7270 op1->type->refCount++;
7275 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7277 char value2 = op2->c;
7280 exp->string = PrintChar(op1->c -= value2);
7283 exp->expType = op1->type;
7285 op1->type->refCount++;
7290 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7292 unsigned char value2 = op2->uc;
7295 exp->string = PrintUChar(op1->uc -= value2);
7298 exp->expType = op1->type;
7300 op1->type->refCount++;
7305 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7307 float value2 = op2->f;
7310 exp->string = PrintFloat(op1->f -= value2);
7313 exp->expType = op1->type;
7315 op1->type->refCount++;
7320 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7322 double value2 = op2->d;
7325 exp->string = PrintDouble(op1->d -= value2);
7328 exp->expType = op1->type;
7330 op1->type->refCount++;
7335 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7337 int value2 = op2->i;
7340 exp->string = PrintInt(op1->i *= value2);
7343 exp->expType = op1->type;
7345 op1->type->refCount++;
7350 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7352 unsigned int value2 = op2->ui;
7355 exp->string = PrintUInt(op1->ui *= value2);
7358 exp->expType = op1->type;
7360 op1->type->refCount++;
7365 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7367 long long value2 = op2->i64;
7370 exp->string = PrintInt64(op1->i64 *= value2);
7373 exp->expType = op1->type;
7375 op1->type->refCount++;
7380 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7382 uint64 value2 = op2->ui64;
7385 exp->string = PrintUInt64(op1->ui64 *= value2);
7388 exp->expType = op1->type;
7390 op1->type->refCount++;
7395 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7397 short value2 = op2->s;
7400 exp->string = PrintShort(op1->s *= value2);
7403 exp->expType = op1->type;
7405 op1->type->refCount++;
7410 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7412 unsigned short value2 = op2->us;
7415 exp->string = PrintUShort(op1->us *= value2);
7418 exp->expType = op1->type;
7420 op1->type->refCount++;
7425 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7427 char value2 = op2->c;
7430 exp->string = PrintChar(op1->c *= value2);
7433 exp->expType = op1->type;
7435 op1->type->refCount++;
7440 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7442 unsigned char value2 = op2->uc;
7445 exp->string = PrintUChar(op1->uc *= value2);
7448 exp->expType = op1->type;
7450 op1->type->refCount++;
7455 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7457 float value2 = op2->f;
7460 exp->string = PrintFloat(op1->f *= value2);
7463 exp->expType = op1->type;
7465 op1->type->refCount++;
7470 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7472 double value2 = op2->d;
7475 exp->string = PrintDouble(op1->d *= value2);
7478 exp->expType = op1->type;
7480 op1->type->refCount++;
7485 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7487 int value2 = op2->i;
7490 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7493 exp->expType = op1->type;
7495 op1->type->refCount++;
7500 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7502 unsigned int value2 = op2->ui;
7505 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7508 exp->expType = op1->type;
7510 op1->type->refCount++;
7515 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7517 long long value2 = op2->i64;
7520 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7523 exp->expType = op1->type;
7525 op1->type->refCount++;
7530 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7532 uint64 value2 = op2->ui64;
7535 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7538 exp->expType = op1->type;
7540 op1->type->refCount++;
7545 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7547 short value2 = op2->s;
7550 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7553 exp->expType = op1->type;
7555 op1->type->refCount++;
7560 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7562 unsigned short value2 = op2->us;
7565 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7568 exp->expType = op1->type;
7570 op1->type->refCount++;
7575 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7577 char value2 = op2->c;
7580 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7583 exp->expType = op1->type;
7585 op1->type->refCount++;
7590 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7592 unsigned char value2 = op2->uc;
7595 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7598 exp->expType = op1->type;
7600 op1->type->refCount++;
7605 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7607 float value2 = op2->f;
7610 exp->string = PrintFloat(op1->f /= value2);
7613 exp->expType = op1->type;
7615 op1->type->refCount++;
7620 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7622 double value2 = op2->d;
7625 exp->string = PrintDouble(op1->d /= value2);
7628 exp->expType = op1->type;
7630 op1->type->refCount++;
7635 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7637 int value2 = op2->i;
7640 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7643 exp->expType = op1->type;
7645 op1->type->refCount++;
7650 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7652 unsigned int value2 = op2->ui;
7655 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7667 long long value2 = op2->i64;
7670 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7673 exp->expType = op1->type;
7675 op1->type->refCount++;
7680 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7682 uint64 value2 = op2->ui64;
7685 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7688 exp->expType = op1->type;
7690 op1->type->refCount++;
7695 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7697 short value2 = op2->s;
7700 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7703 exp->expType = op1->type;
7705 op1->type->refCount++;
7710 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7712 unsigned short value2 = op2->us;
7715 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7718 exp->expType = op1->type;
7720 op1->type->refCount++;
7725 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7727 char value2 = op2->c;
7730 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7733 exp->expType = op1->type;
7735 op1->type->refCount++;
7740 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7742 unsigned char value2 = op2->uc;
7745 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7748 exp->expType = op1->type;
7750 op1->type->refCount++;
7755 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7757 int value2 = op2->i;
7760 exp->string = PrintInt(op1->i & value2);
7763 exp->expType = op1->type;
7765 op1->type->refCount++;
7770 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7772 unsigned int value2 = op2->ui;
7775 exp->string = PrintUInt(op1->ui & value2);
7778 exp->expType = op1->type;
7780 op1->type->refCount++;
7785 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7787 long long value2 = op2->i64;
7790 exp->string = PrintInt64(op1->i64 & value2);
7793 exp->expType = op1->type;
7795 op1->type->refCount++;
7800 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7802 uint64 value2 = op2->ui64;
7805 exp->string = PrintUInt64(op1->ui64 & value2);
7808 exp->expType = op1->type;
7810 op1->type->refCount++;
7815 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7817 short value2 = op2->s;
7820 exp->string = PrintShort(op1->s & value2);
7823 exp->expType = op1->type;
7825 op1->type->refCount++;
7830 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7832 unsigned short value2 = op2->us;
7835 exp->string = PrintUShort(op1->us & value2);
7838 exp->expType = op1->type;
7840 op1->type->refCount++;
7845 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7847 char value2 = op2->c;
7850 exp->string = PrintChar(op1->c & value2);
7853 exp->expType = op1->type;
7855 op1->type->refCount++;
7860 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7862 unsigned char value2 = op2->uc;
7865 exp->string = PrintUChar(op1->uc & value2);
7868 exp->expType = op1->type;
7870 op1->type->refCount++;
7875 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7877 int value2 = op2->i;
7880 exp->string = PrintInt(op1->i | value2);
7883 exp->expType = op1->type;
7885 op1->type->refCount++;
7890 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7892 unsigned int value2 = op2->ui;
7895 exp->string = PrintUInt(op1->ui | value2);
7898 exp->expType = op1->type;
7900 op1->type->refCount++;
7905 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7907 long long value2 = op2->i64;
7910 exp->string = PrintInt64(op1->i64 | value2);
7913 exp->expType = op1->type;
7915 op1->type->refCount++;
7920 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7922 uint64 value2 = op2->ui64;
7925 exp->string = PrintUInt64(op1->ui64 | value2);
7928 exp->expType = op1->type;
7930 op1->type->refCount++;
7935 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7937 short value2 = op2->s;
7940 exp->string = PrintShort(op1->s | value2);
7943 exp->expType = op1->type;
7945 op1->type->refCount++;
7950 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7952 unsigned short value2 = op2->us;
7955 exp->string = PrintUShort(op1->us | value2);
7958 exp->expType = op1->type;
7960 op1->type->refCount++;
7965 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7967 char value2 = op2->c;
7970 exp->string = PrintChar(op1->c | value2);
7973 exp->expType = op1->type;
7975 op1->type->refCount++;
7980 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7982 unsigned char value2 = op2->uc;
7985 exp->string = PrintUChar(op1->uc | value2);
7988 exp->expType = op1->type;
7990 op1->type->refCount++;
7995 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7997 int value2 = op2->i;
8000 exp->string = PrintInt(op1->i ^ value2);
8003 exp->expType = op1->type;
8005 op1->type->refCount++;
8010 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8012 unsigned int value2 = op2->ui;
8015 exp->string = PrintUInt(op1->ui ^ value2);
8018 exp->expType = op1->type;
8020 op1->type->refCount++;
8025 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8027 long long value2 = op2->i64;
8030 exp->string = PrintInt64(op1->i64 ^ value2);
8033 exp->expType = op1->type;
8035 op1->type->refCount++;
8040 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8042 uint64 value2 = op2->ui64;
8045 exp->string = PrintUInt64(op1->ui64 ^ value2);
8048 exp->expType = op1->type;
8050 op1->type->refCount++;
8055 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8057 short value2 = op2->s;
8060 exp->string = PrintShort(op1->s ^ value2);
8063 exp->expType = op1->type;
8065 op1->type->refCount++;
8070 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8072 unsigned short value2 = op2->us;
8075 exp->string = PrintUShort(op1->us ^ value2);
8078 exp->expType = op1->type;
8080 op1->type->refCount++;
8085 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8087 char value2 = op2->c;
8090 exp->string = PrintChar(op1->c ^ value2);
8093 exp->expType = op1->type;
8095 op1->type->refCount++;
8100 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8102 unsigned char value2 = op2->uc;
8105 exp->string = PrintUChar(op1->uc ^ value2);
8108 exp->expType = op1->type;
8110 op1->type->refCount++;
8115 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8117 int value2 = op2->i;
8120 exp->string = PrintInt(op1->i << value2);
8123 exp->expType = op1->type;
8125 op1->type->refCount++;
8130 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8132 unsigned int value2 = op2->ui;
8135 exp->string = PrintUInt(op1->ui << value2);
8138 exp->expType = op1->type;
8140 op1->type->refCount++;
8145 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8147 long long value2 = op2->i64;
8150 exp->string = PrintInt64(op1->i64 << value2);
8153 exp->expType = op1->type;
8155 op1->type->refCount++;
8160 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8162 uint64 value2 = op2->ui64;
8165 exp->string = PrintUInt64(op1->ui64 << value2);
8168 exp->expType = op1->type;
8170 op1->type->refCount++;
8175 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8177 short value2 = op2->s;
8180 exp->string = PrintShort(op1->s << value2);
8183 exp->expType = op1->type;
8185 op1->type->refCount++;
8190 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8192 unsigned short value2 = op2->us;
8195 exp->string = PrintUShort(op1->us << value2);
8198 exp->expType = op1->type;
8200 op1->type->refCount++;
8205 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8207 char value2 = op2->c;
8210 exp->string = PrintChar(op1->c << value2);
8213 exp->expType = op1->type;
8215 op1->type->refCount++;
8220 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8222 unsigned char value2 = op2->uc;
8225 exp->string = PrintUChar(op1->uc << value2);
8228 exp->expType = op1->type;
8230 op1->type->refCount++;
8235 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8237 int value2 = op2->i;
8240 exp->string = PrintInt(op1->i >> value2);
8243 exp->expType = op1->type;
8245 op1->type->refCount++;
8250 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8252 unsigned int value2 = op2->ui;
8255 exp->string = PrintUInt(op1->ui >> value2);
8258 exp->expType = op1->type;
8260 op1->type->refCount++;
8265 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8267 long long value2 = op2->i64;
8270 exp->string = PrintInt64(op1->i64 >> value2);
8273 exp->expType = op1->type;
8275 op1->type->refCount++;
8280 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8282 uint64 value2 = op2->ui64;
8285 exp->string = PrintUInt64(op1->ui64 >> value2);
8288 exp->expType = op1->type;
8290 op1->type->refCount++;
8295 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8297 short value2 = op2->s;
8300 exp->string = PrintShort(op1->s >> value2);
8303 exp->expType = op1->type;
8305 op1->type->refCount++;
8310 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8312 unsigned short value2 = op2->us;
8315 exp->string = PrintUShort(op1->us >> value2);
8318 exp->expType = op1->type;
8320 op1->type->refCount++;
8325 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8327 char value2 = op2->c;
8330 exp->string = PrintChar(op1->c >> value2);
8333 exp->expType = op1->type;
8335 op1->type->refCount++;
8340 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8342 unsigned char value2 = op2->uc;
8345 exp->string = PrintUChar(op1->uc >> value2);
8348 exp->expType = op1->type;
8350 op1->type->refCount++;
8355 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8358 exp->string = PrintInt((~op1->i));
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8371 exp->string = PrintUInt((unsigned int)(~op1->ui));
8374 exp->expType = op1->type;
8376 op1->type->refCount++;
8381 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8384 exp->string = PrintInt64((long long)(~op1->i64));
8387 exp->expType = op1->type;
8389 op1->type->refCount++;
8394 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8397 exp->string = PrintUInt64((uint64)(~op1->ui64));
8400 exp->expType = op1->type;
8402 op1->type->refCount++;
8407 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8410 exp->string = PrintShort((short)(~op1->s));
8413 exp->expType = op1->type;
8415 op1->type->refCount++;
8420 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8423 exp->string = PrintUShort((unsigned short)(~op1->us));
8426 exp->expType = op1->type;
8428 op1->type->refCount++;
8433 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8436 exp->string = PrintChar((char)(~op1->c));
8439 exp->expType = op1->type;
8441 op1->type->refCount++;
8446 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8449 exp->string = PrintUChar((unsigned char)(~op1->uc));
8452 exp->expType = op1->type;
8454 op1->type->refCount++;
8459 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8461 int value2 = op2->i;
8464 exp->string = PrintInt(op1->i &= value2);
8467 exp->expType = op1->type;
8469 op1->type->refCount++;
8474 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8476 unsigned int value2 = op2->ui;
8479 exp->string = PrintUInt(op1->ui &= value2);
8482 exp->expType = op1->type;
8484 op1->type->refCount++;
8489 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8491 long long value2 = op2->i64;
8494 exp->string = PrintInt64(op1->i64 &= value2);
8497 exp->expType = op1->type;
8499 op1->type->refCount++;
8504 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8506 uint64 value2 = op2->ui64;
8509 exp->string = PrintUInt64(op1->ui64 &= value2);
8512 exp->expType = op1->type;
8514 op1->type->refCount++;
8519 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8521 short value2 = op2->s;
8524 exp->string = PrintShort(op1->s &= value2);
8527 exp->expType = op1->type;
8529 op1->type->refCount++;
8534 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8536 unsigned short value2 = op2->us;
8539 exp->string = PrintUShort(op1->us &= value2);
8542 exp->expType = op1->type;
8544 op1->type->refCount++;
8549 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8551 char value2 = op2->c;
8554 exp->string = PrintChar(op1->c &= value2);
8557 exp->expType = op1->type;
8559 op1->type->refCount++;
8564 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8566 unsigned char value2 = op2->uc;
8569 exp->string = PrintUChar(op1->uc &= value2);
8572 exp->expType = op1->type;
8574 op1->type->refCount++;
8579 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8581 int value2 = op2->i;
8584 exp->string = PrintInt(op1->i |= value2);
8587 exp->expType = op1->type;
8589 op1->type->refCount++;
8594 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8596 unsigned int value2 = op2->ui;
8599 exp->string = PrintUInt(op1->ui |= value2);
8602 exp->expType = op1->type;
8604 op1->type->refCount++;
8609 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8611 long long value2 = op2->i64;
8614 exp->string = PrintInt64(op1->i64 |= value2);
8617 exp->expType = op1->type;
8619 op1->type->refCount++;
8624 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8626 uint64 value2 = op2->ui64;
8629 exp->string = PrintUInt64(op1->ui64 |= value2);
8632 exp->expType = op1->type;
8634 op1->type->refCount++;
8639 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8641 short value2 = op2->s;
8644 exp->string = PrintShort(op1->s |= value2);
8647 exp->expType = op1->type;
8649 op1->type->refCount++;
8654 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8656 unsigned short value2 = op2->us;
8659 exp->string = PrintUShort(op1->us |= value2);
8662 exp->expType = op1->type;
8664 op1->type->refCount++;
8669 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8671 char value2 = op2->c;
8674 exp->string = PrintChar(op1->c |= value2);
8677 exp->expType = op1->type;
8679 op1->type->refCount++;
8684 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8686 unsigned char value2 = op2->uc;
8689 exp->string = PrintUChar(op1->uc |= value2);
8692 exp->expType = op1->type;
8694 op1->type->refCount++;
8699 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8701 int value2 = op2->i;
8704 exp->string = PrintInt(op1->i ^= value2);
8707 exp->expType = op1->type;
8709 op1->type->refCount++;
8714 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8716 unsigned int value2 = op2->ui;
8719 exp->string = PrintUInt(op1->ui ^= value2);
8722 exp->expType = op1->type;
8724 op1->type->refCount++;
8729 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8731 long long value2 = op2->i64;
8734 exp->string = PrintInt64(op1->i64 ^= value2);
8737 exp->expType = op1->type;
8739 op1->type->refCount++;
8744 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8746 uint64 value2 = op2->ui64;
8749 exp->string = PrintUInt64(op1->ui64 ^= value2);
8752 exp->expType = op1->type;
8754 op1->type->refCount++;
8759 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8761 short value2 = op2->s;
8764 exp->string = PrintShort(op1->s ^= value2);
8767 exp->expType = op1->type;
8769 op1->type->refCount++;
8774 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8776 unsigned short value2 = op2->us;
8779 exp->string = PrintUShort(op1->us ^= value2);
8782 exp->expType = op1->type;
8784 op1->type->refCount++;
8789 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8791 char value2 = op2->c;
8794 exp->string = PrintChar(op1->c ^= value2);
8797 exp->expType = op1->type;
8799 op1->type->refCount++;
8804 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8806 unsigned char value2 = op2->uc;
8809 exp->string = PrintUChar(op1->uc ^= value2);
8812 exp->expType = op1->type;
8814 op1->type->refCount++;
8819 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8821 int value2 = op2->i;
8824 exp->string = PrintInt(op1->i <<= value2);
8827 exp->expType = op1->type;
8829 op1->type->refCount++;
8834 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8836 unsigned int value2 = op2->ui;
8839 exp->string = PrintUInt(op1->ui <<= value2);
8842 exp->expType = op1->type;
8844 op1->type->refCount++;
8849 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8851 long long value2 = op2->i64;
8854 exp->string = PrintInt64(op1->i64 <<= value2);
8857 exp->expType = op1->type;
8859 op1->type->refCount++;
8864 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8866 uint64 value2 = op2->ui64;
8869 exp->string = PrintUInt64(op1->ui64 <<= value2);
8872 exp->expType = op1->type;
8874 op1->type->refCount++;
8879 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8881 short value2 = op2->s;
8884 exp->string = PrintShort(op1->s <<= value2);
8887 exp->expType = op1->type;
8889 op1->type->refCount++;
8894 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8896 unsigned short value2 = op2->us;
8899 exp->string = PrintUShort(op1->us <<= value2);
8902 exp->expType = op1->type;
8904 op1->type->refCount++;
8909 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8911 char value2 = op2->c;
8914 exp->string = PrintChar(op1->c <<= value2);
8917 exp->expType = op1->type;
8919 op1->type->refCount++;
8924 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8926 unsigned char value2 = op2->uc;
8929 exp->string = PrintUChar(op1->uc <<= value2);
8932 exp->expType = op1->type;
8934 op1->type->refCount++;
8939 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8941 int value2 = op2->i;
8944 exp->string = PrintInt(op1->i >>= value2);
8947 exp->expType = op1->type;
8949 op1->type->refCount++;
8954 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8956 unsigned int value2 = op2->ui;
8959 exp->string = PrintUInt(op1->ui >>= value2);
8962 exp->expType = op1->type;
8964 op1->type->refCount++;
8969 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8971 long long value2 = op2->i64;
8974 exp->string = PrintInt64(op1->i64 >>= value2);
8977 exp->expType = op1->type;
8979 op1->type->refCount++;
8984 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8986 uint64 value2 = op2->ui64;
8989 exp->string = PrintUInt64(op1->ui64 >>= value2);
8992 exp->expType = op1->type;
8994 op1->type->refCount++;
8999 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9001 short value2 = op2->s;
9004 exp->string = PrintShort(op1->s >>= value2);
9007 exp->expType = op1->type;
9009 op1->type->refCount++;
9014 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9016 unsigned short value2 = op2->us;
9019 exp->string = PrintUShort(op1->us >>= value2);
9022 exp->expType = op1->type;
9024 op1->type->refCount++;
9029 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9031 char value2 = op2->c;
9034 exp->string = PrintChar(op1->c >>= value2);
9037 exp->expType = op1->type;
9039 op1->type->refCount++;
9044 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9046 unsigned char value2 = op2->uc;
9049 exp->string = PrintUChar(op1->uc >>= value2);
9052 exp->expType = op1->type;
9054 op1->type->refCount++;
9059 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9062 exp->string = PrintInt((int)(!op1->i));
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9075 exp->string = PrintUInt((unsigned int)(!op1->ui));
9078 exp->expType = op1->type;
9080 op1->type->refCount++;
9085 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9088 exp->string = PrintInt64((long long)(!op1->i64));
9091 exp->expType = op1->type;
9093 op1->type->refCount++;
9098 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9101 exp->string = PrintUInt64((uint64)(!op1->ui64));
9104 exp->expType = op1->type;
9106 op1->type->refCount++;
9111 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9114 exp->string = PrintShort((short)(!op1->s));
9117 exp->expType = op1->type;
9119 op1->type->refCount++;
9124 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9127 exp->string = PrintUShort((unsigned short)(!op1->us));
9130 exp->expType = op1->type;
9132 op1->type->refCount++;
9137 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9140 exp->string = PrintChar((char)(!op1->c));
9143 exp->expType = op1->type;
9145 op1->type->refCount++;
9150 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9153 exp->string = PrintUChar((unsigned char)(!op1->uc));
9156 exp->expType = op1->type;
9158 op1->type->refCount++;
9163 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9165 int value2 = op2->i;
9168 exp->string = PrintInt(op1->i == value2);
9171 exp->expType = op1->type;
9173 op1->type->refCount++;
9178 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9180 unsigned int value2 = op2->ui;
9183 exp->string = PrintUInt(op1->ui == value2);
9186 exp->expType = op1->type;
9188 op1->type->refCount++;
9193 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9195 long long value2 = op2->i64;
9198 exp->string = PrintInt64(op1->i64 == value2);
9201 exp->expType = op1->type;
9203 op1->type->refCount++;
9208 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9210 uint64 value2 = op2->ui64;
9213 exp->string = PrintUInt64(op1->ui64 == value2);
9216 exp->expType = op1->type;
9218 op1->type->refCount++;
9223 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9225 short value2 = op2->s;
9228 exp->string = PrintShort(op1->s == value2);
9231 exp->expType = op1->type;
9233 op1->type->refCount++;
9238 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9240 unsigned short value2 = op2->us;
9243 exp->string = PrintUShort(op1->us == value2);
9246 exp->expType = op1->type;
9248 op1->type->refCount++;
9253 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9255 char value2 = op2->c;
9258 exp->string = PrintChar(op1->c == value2);
9261 exp->expType = op1->type;
9263 op1->type->refCount++;
9268 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9270 unsigned char value2 = op2->uc;
9273 exp->string = PrintUChar(op1->uc == value2);
9276 exp->expType = op1->type;
9278 op1->type->refCount++;
9283 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9285 float value2 = op2->f;
9288 exp->string = PrintFloat(op1->f == value2);
9291 exp->expType = op1->type;
9293 op1->type->refCount++;
9298 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9300 double value2 = op2->d;
9303 exp->string = PrintDouble(op1->d == value2);
9306 exp->expType = op1->type;
9308 op1->type->refCount++;
9313 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9315 int value2 = op2->i;
9318 exp->string = PrintInt(op1->i != value2);
9321 exp->expType = op1->type;
9323 op1->type->refCount++;
9328 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9330 unsigned int value2 = op2->ui;
9333 exp->string = PrintUInt(op1->ui != value2);
9336 exp->expType = op1->type;
9338 op1->type->refCount++;
9343 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9345 long long value2 = op2->i64;
9348 exp->string = PrintInt64(op1->i64 != value2);
9351 exp->expType = op1->type;
9353 op1->type->refCount++;
9358 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9360 uint64 value2 = op2->ui64;
9363 exp->string = PrintUInt64(op1->ui64 != value2);
9366 exp->expType = op1->type;
9368 op1->type->refCount++;
9373 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9375 short value2 = op2->s;
9378 exp->string = PrintShort(op1->s != value2);
9381 exp->expType = op1->type;
9383 op1->type->refCount++;
9388 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9390 unsigned short value2 = op2->us;
9393 exp->string = PrintUShort(op1->us != value2);
9396 exp->expType = op1->type;
9398 op1->type->refCount++;
9403 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9405 char value2 = op2->c;
9408 exp->string = PrintChar(op1->c != value2);
9411 exp->expType = op1->type;
9413 op1->type->refCount++;
9418 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9420 unsigned char value2 = op2->uc;
9423 exp->string = PrintUChar(op1->uc != value2);
9426 exp->expType = op1->type;
9428 op1->type->refCount++;
9433 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9435 float value2 = op2->f;
9438 exp->string = PrintFloat(op1->f != value2);
9441 exp->expType = op1->type;
9443 op1->type->refCount++;
9448 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9450 double value2 = op2->d;
9453 exp->string = PrintDouble(op1->d != value2);
9456 exp->expType = op1->type;
9458 op1->type->refCount++;
9463 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9465 int value2 = op2->i;
9468 exp->string = PrintInt(op1->i && value2);
9471 exp->expType = op1->type;
9473 op1->type->refCount++;
9478 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9480 unsigned int value2 = op2->ui;
9483 exp->string = PrintUInt(op1->ui && value2);
9486 exp->expType = op1->type;
9488 op1->type->refCount++;
9493 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9495 long long value2 = op2->i64;
9498 exp->string = PrintInt64(op1->i64 && value2);
9501 exp->expType = op1->type;
9503 op1->type->refCount++;
9508 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9510 uint64 value2 = op2->ui64;
9513 exp->string = PrintUInt64(op1->ui64 && value2);
9516 exp->expType = op1->type;
9518 op1->type->refCount++;
9523 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9525 short value2 = op2->s;
9528 exp->string = PrintShort(op1->s && value2);
9531 exp->expType = op1->type;
9533 op1->type->refCount++;
9538 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9540 unsigned short value2 = op2->us;
9543 exp->string = PrintUShort(op1->us && value2);
9546 exp->expType = op1->type;
9548 op1->type->refCount++;
9553 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9555 char value2 = op2->c;
9558 exp->string = PrintChar(op1->c && value2);
9561 exp->expType = op1->type;
9563 op1->type->refCount++;
9568 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9570 unsigned char value2 = op2->uc;
9573 exp->string = PrintUChar(op1->uc && value2);
9576 exp->expType = op1->type;
9578 op1->type->refCount++;
9583 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9585 float value2 = op2->f;
9588 exp->string = PrintFloat(op1->f && value2);
9591 exp->expType = op1->type;
9593 op1->type->refCount++;
9598 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9600 double value2 = op2->d;
9603 exp->string = PrintDouble(op1->d && value2);
9606 exp->expType = op1->type;
9608 op1->type->refCount++;
9613 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9615 int value2 = op2->i;
9618 exp->string = PrintInt(op1->i || value2);
9621 exp->expType = op1->type;
9623 op1->type->refCount++;
9628 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9630 unsigned int value2 = op2->ui;
9633 exp->string = PrintUInt(op1->ui || value2);
9636 exp->expType = op1->type;
9638 op1->type->refCount++;
9643 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9645 long long value2 = op2->i64;
9648 exp->string = PrintInt64(op1->i64 || value2);
9651 exp->expType = op1->type;
9653 op1->type->refCount++;
9658 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9660 uint64 value2 = op2->ui64;
9663 exp->string = PrintUInt64(op1->ui64 || value2);
9666 exp->expType = op1->type;
9668 op1->type->refCount++;
9673 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9675 short value2 = op2->s;
9678 exp->string = PrintShort(op1->s || value2);
9681 exp->expType = op1->type;
9683 op1->type->refCount++;
9688 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9690 unsigned short value2 = op2->us;
9693 exp->string = PrintUShort(op1->us || value2);
9696 exp->expType = op1->type;
9698 op1->type->refCount++;
9703 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9705 char value2 = op2->c;
9708 exp->string = PrintChar(op1->c || value2);
9711 exp->expType = op1->type;
9713 op1->type->refCount++;
9718 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9720 unsigned char value2 = op2->uc;
9723 exp->string = PrintUChar(op1->uc || value2);
9726 exp->expType = op1->type;
9728 op1->type->refCount++;
9733 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9735 float value2 = op2->f;
9738 exp->string = PrintFloat(op1->f || value2);
9741 exp->expType = op1->type;
9743 op1->type->refCount++;
9748 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9750 double value2 = op2->d;
9753 exp->string = PrintDouble(op1->d || value2);
9756 exp->expType = op1->type;
9758 op1->type->refCount++;
9763 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9765 int value2 = op2->i;
9768 exp->string = PrintInt(op1->i > value2);
9771 exp->expType = op1->type;
9773 op1->type->refCount++;
9778 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9780 unsigned int value2 = op2->ui;
9783 exp->string = PrintUInt(op1->ui > value2);
9786 exp->expType = op1->type;
9788 op1->type->refCount++;
9793 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9795 long long value2 = op2->i64;
9798 exp->string = PrintInt64(op1->i64 > value2);
9801 exp->expType = op1->type;
9803 op1->type->refCount++;
9808 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9810 uint64 value2 = op2->ui64;
9813 exp->string = PrintUInt64(op1->ui64 > value2);
9816 exp->expType = op1->type;
9818 op1->type->refCount++;
9823 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9825 short value2 = op2->s;
9828 exp->string = PrintShort(op1->s > value2);
9831 exp->expType = op1->type;
9833 op1->type->refCount++;
9838 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9840 unsigned short value2 = op2->us;
9843 exp->string = PrintUShort(op1->us > value2);
9846 exp->expType = op1->type;
9848 op1->type->refCount++;
9853 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9855 char value2 = op2->c;
9858 exp->string = PrintChar(op1->c > value2);
9861 exp->expType = op1->type;
9863 op1->type->refCount++;
9868 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9870 unsigned char value2 = op2->uc;
9873 exp->string = PrintUChar(op1->uc > value2);
9876 exp->expType = op1->type;
9878 op1->type->refCount++;
9883 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9885 float value2 = op2->f;
9888 exp->string = PrintFloat(op1->f > value2);
9891 exp->expType = op1->type;
9893 op1->type->refCount++;
9898 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9900 double value2 = op2->d;
9903 exp->string = PrintDouble(op1->d > value2);
9906 exp->expType = op1->type;
9908 op1->type->refCount++;
9913 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9915 int value2 = op2->i;
9918 exp->string = PrintInt(op1->i < value2);
9921 exp->expType = op1->type;
9923 op1->type->refCount++;
9928 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9930 unsigned int value2 = op2->ui;
9933 exp->string = PrintUInt(op1->ui < value2);
9936 exp->expType = op1->type;
9938 op1->type->refCount++;
9943 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9945 long long value2 = op2->i64;
9948 exp->string = PrintInt64(op1->i64 < value2);
9951 exp->expType = op1->type;
9953 op1->type->refCount++;
9958 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9960 uint64 value2 = op2->ui64;
9963 exp->string = PrintUInt64(op1->ui64 < value2);
9966 exp->expType = op1->type;
9968 op1->type->refCount++;
9973 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9975 short value2 = op2->s;
9978 exp->string = PrintShort(op1->s < value2);
9981 exp->expType = op1->type;
9983 op1->type->refCount++;
9988 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9990 unsigned short value2 = op2->us;
9993 exp->string = PrintUShort(op1->us < value2);
9996 exp->expType = op1->type;
9998 op1->type->refCount++;
10003 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10005 char value2 = op2->c;
10008 exp->string = PrintChar(op1->c < value2);
10011 exp->expType = op1->type;
10013 op1->type->refCount++;
10018 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10020 unsigned char value2 = op2->uc;
10023 exp->string = PrintUChar(op1->uc < value2);
10026 exp->expType = op1->type;
10028 op1->type->refCount++;
10033 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10035 float value2 = op2->f;
10038 exp->string = PrintFloat(op1->f < value2);
10041 exp->expType = op1->type;
10043 op1->type->refCount++;
10048 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10050 double value2 = op2->d;
10053 exp->string = PrintDouble(op1->d < value2);
10056 exp->expType = op1->type;
10058 op1->type->refCount++;
10063 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10065 int value2 = op2->i;
10068 exp->string = PrintInt(op1->i >= value2);
10071 exp->expType = op1->type;
10073 op1->type->refCount++;
10078 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10080 unsigned int value2 = op2->ui;
10083 exp->string = PrintUInt(op1->ui >= value2);
10086 exp->expType = op1->type;
10088 op1->type->refCount++;
10093 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10095 long long value2 = op2->i64;
10098 exp->string = PrintInt64(op1->i64 >= value2);
10101 exp->expType = op1->type;
10103 op1->type->refCount++;
10108 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10110 uint64 value2 = op2->ui64;
10113 exp->string = PrintUInt64(op1->ui64 >= value2);
10116 exp->expType = op1->type;
10118 op1->type->refCount++;
10123 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10125 short value2 = op2->s;
10128 exp->string = PrintShort(op1->s >= value2);
10131 exp->expType = op1->type;
10133 op1->type->refCount++;
10138 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10140 unsigned short value2 = op2->us;
10143 exp->string = PrintUShort(op1->us >= value2);
10146 exp->expType = op1->type;
10148 op1->type->refCount++;
10153 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10155 char value2 = op2->c;
10158 exp->string = PrintChar(op1->c >= value2);
10161 exp->expType = op1->type;
10163 op1->type->refCount++;
10168 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10170 unsigned char value2 = op2->uc;
10173 exp->string = PrintUChar(op1->uc >= value2);
10176 exp->expType = op1->type;
10178 op1->type->refCount++;
10183 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10185 float value2 = op2->f;
10188 exp->string = PrintFloat(op1->f >= value2);
10191 exp->expType = op1->type;
10193 op1->type->refCount++;
10198 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10200 double value2 = op2->d;
10203 exp->string = PrintDouble(op1->d >= value2);
10206 exp->expType = op1->type;
10208 op1->type->refCount++;
10213 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10215 int value2 = op2->i;
10218 exp->string = PrintInt(op1->i <= value2);
10221 exp->expType = op1->type;
10223 op1->type->refCount++;
10228 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10230 unsigned int value2 = op2->ui;
10233 exp->string = PrintUInt(op1->ui <= value2);
10236 exp->expType = op1->type;
10238 op1->type->refCount++;
10243 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10245 long long value2 = op2->i64;
10248 exp->string = PrintInt64(op1->i64 <= value2);
10251 exp->expType = op1->type;
10253 op1->type->refCount++;
10258 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10260 uint64 value2 = op2->ui64;
10263 exp->string = PrintUInt64(op1->ui64 <= value2);
10266 exp->expType = op1->type;
10268 op1->type->refCount++;
10273 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10275 short value2 = op2->s;
10278 exp->string = PrintShort(op1->s <= value2);
10281 exp->expType = op1->type;
10283 op1->type->refCount++;
10288 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10290 unsigned short value2 = op2->us;
10293 exp->string = PrintUShort(op1->us <= value2);
10296 exp->expType = op1->type;
10298 op1->type->refCount++;
10303 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10305 char value2 = op2->c;
10308 exp->string = PrintChar(op1->c <= value2);
10311 exp->expType = op1->type;
10313 op1->type->refCount++;
10318 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10320 unsigned char value2 = op2->uc;
10323 exp->string = PrintUChar(op1->uc <= value2);
10326 exp->expType = op1->type;
10328 op1->type->refCount++;
10333 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10335 float value2 = op2->f;
10338 exp->string = PrintFloat(op1->f <= value2);
10341 exp->expType = op1->type;
10343 op1->type->refCount++;
10348 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10350 double value2 = op2->d;
10353 exp->string = PrintDouble(op1->d <= value2);
10356 exp->expType = op1->type;
10358 op1->type->refCount++;
10363 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10366 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10369 exp->expType = op1->type;
10371 op1->type->refCount++;
10376 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10379 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10382 exp->expType = op1->type;
10384 op1->type->refCount++;
10389 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10392 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10395 exp->expType = op1->type;
10397 op1->type->refCount++;
10402 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10405 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10408 exp->expType = op1->type;
10410 op1->type->refCount++;
10415 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10418 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10421 exp->expType = op1->type;
10423 op1->type->refCount++;
10428 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10431 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10434 exp->expType = op1->type;
10436 op1->type->refCount++;
10441 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10444 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10447 exp->expType = op1->type;
10449 op1->type->refCount++;
10454 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10457 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10460 exp->expType = op1->type;
10462 op1->type->refCount++;
10467 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10470 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10473 exp->expType = op1->type;
10475 op1->type->refCount++;
10480 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10483 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10486 exp->expType = op1->type;
10488 op1->type->refCount++;
10493 struct OpTable intOps =
10495 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
10498 struct OpTable uintOps =
10500 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
10503 struct OpTable int64Ops =
10505 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
10508 struct OpTable uint64Ops =
10510 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
10513 struct OpTable shortOps =
10515 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
10518 struct OpTable ushortOps =
10520 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
10523 struct OpTable floatOps =
10525 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
10528 struct OpTable doubleOps =
10530 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
10533 struct OpTable charOps =
10535 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
10538 struct OpTable ucharOps =
10540 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
10543 void ReadString(char * output, char * string)
10545 int len = strlen(string);
10547 unsigned int quoted = 0x0, escaped = 0x0;
10549 for(c = 0; c < len; c++)
10551 char ch = string[c];
10609 int UnescapeString(char * d, char * s, int len)
10614 while(j < len && (ch = s[j]))
10619 switch((ch = s[++j]))
10665 char * OffsetEscapedString(char * s, int len, int offset)
10670 while(j < len && k < offset && (ch = s[j]))
10676 return (k == offset) ? s + j : (((void *)0));
10679 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10681 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10683 extern double strtod(char * , char * * );
10685 extern float (* __ecereMethod_float_inf)(void);
10687 extern float (* __ecereMethod_float_nan)(void);
10689 extern double (* __ecereMethod_double_inf)(void);
10691 extern double (* __ecereMethod_double_nan)(void);
10693 struct Operand GetOperand(struct Expression * exp)
10695 struct Operand op =
10699 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10702 struct Type * type = exp->expType;
10706 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10708 if(!type->_class->registered->dataType)
10709 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10710 type = type->_class->registered->dataType;
10712 if(exp->type == 3 && op.kind == 13)
10714 op.ui64 = (uint64)exp->string;
10716 op.ops = uint64Ops;
10718 else if(exp->isConstant && exp->type == 2)
10720 op.kind = type->kind;
10721 op.type = exp->expType;
10727 if(exp->constant[0] == '\'')
10729 op.c = exp->constant[1];
10732 else if(type->isSigned)
10734 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10739 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10747 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10752 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10753 op.ops = ushortOps;
10760 op.i = strtol(exp->constant, (((void *)0)), 0);
10765 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10773 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10778 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10786 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10791 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10792 op.ops = uint64Ops;
10799 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10804 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10805 op.ops = uint64Ops;
10810 if(!strcmp(exp->constant, "inf"))
10811 op.f = __ecereMethod_float_inf();
10812 else if(!strcmp(exp->constant, "-inf"))
10813 op.f = -__ecereMethod_float_inf();
10814 else if(!strcmp(exp->constant, "nan"))
10815 op.f = __ecereMethod_float_nan();
10816 else if(!strcmp(exp->constant, "-nan"))
10817 op.f = -__ecereMethod_float_nan();
10819 op.f = (float)strtod(exp->constant, (((void *)0)));
10823 if(!strcmp(exp->constant, "inf"))
10824 op.d = __ecereMethod_double_inf();
10825 else if(!strcmp(exp->constant, "-inf"))
10826 op.d = -__ecereMethod_double_inf();
10827 else if(!strcmp(exp->constant, "nan"))
10828 op.d = __ecereMethod_double_nan();
10829 else if(!strcmp(exp->constant, "-nan"))
10830 op.d = -__ecereMethod_double_nan();
10832 op.d = (double)strtod(exp->constant, (((void *)0)));
10833 op.ops = doubleOps;
10838 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10840 op.ops = uint64Ops;
10848 int __ecereVMethodID_class_OnGetString;
10850 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10852 static void UnusedFunction()
10856 ((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);
10859 extern int __ecereVMethodID_class_OnGetString;
10861 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10863 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10865 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10867 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10868 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10871 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10872 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10873 struct Type * type;
10874 void * ptr = inst->data + dataMember->offset + offset;
10875 char * result = (((void *)0));
10877 exp->loc = member->loc = inst->loc;
10878 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10879 if(!dataMember->dataType)
10880 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10881 type = dataMember->dataType;
10882 if(type->kind == 8)
10884 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10886 if(_class->type == 4)
10888 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10892 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10893 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10895 for(item = e->values.first; item; item = item->next)
10897 if((int)item->data == *(int *)ptr)
10899 result = item->name;
10905 exp->identifier = MkIdentifier(result);
10907 exp->destType = MkClassType(_class->fullName);
10908 ProcessExpressionType(exp);
10912 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10914 if(!_class->dataType)
10915 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10916 type = _class->dataType;
10925 FreeExpContents(exp);
10926 exp->constant = PrintFloat(*(float *)ptr);
10932 FreeExpContents(exp);
10933 exp->constant = PrintDouble(*(double *)ptr);
10939 FreeExpContents(exp);
10940 exp->constant = PrintInt(*(int *)ptr);
10946 FreeExpContents(exp);
10947 exp->constant = PrintInt64(*(long long *)ptr);
10953 FreeExpContents(exp);
10954 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10960 FreeExpContents(exp);
10961 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10966 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10969 ListAdd(memberList, member);
10971 if(parentDataMember->type == 1)
10976 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10978 void PopulateInstance(struct Instantiation * inst)
10980 struct Symbol * classSym = inst->_class->symbol;
10981 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10982 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10983 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10986 inst->members = MkListOne(MkMembersInitList(memberList));
10988 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10989 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10991 if(!dataMember->isProperty)
10993 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10994 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10997 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10998 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10999 struct Type * type;
11000 void * ptr = inst->data + dataMember->offset;
11001 char * result = (((void *)0));
11003 exp->loc = member->loc = inst->loc;
11004 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11005 if(!dataMember->dataType)
11006 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11007 type = dataMember->dataType;
11008 if(type->kind == 8)
11010 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11012 if(_class->type == 4)
11014 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11018 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11019 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11021 for(item = e->values.first; item; item = item->next)
11023 if((int)item->data == *(int *)ptr)
11025 result = item->name;
11032 exp->identifier = MkIdentifier(result);
11034 exp->destType = MkClassType(_class->fullName);
11035 ProcessExpressionType(exp);
11038 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11040 if(!_class->dataType)
11041 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11042 type = _class->dataType;
11051 exp->constant = PrintFloat(*(float *)ptr);
11057 exp->constant = PrintDouble(*(double *)ptr);
11063 exp->constant = PrintInt(*(int *)ptr);
11069 exp->constant = PrintInt64(*(long long *)ptr);
11075 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11080 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11083 ListAdd(memberList, member);
11089 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);
11091 extern void FreeInstance(struct Instantiation * inst);
11093 void ComputeInstantiation(struct Expression * exp)
11095 struct Instantiation * inst = exp->instance;
11096 struct MembersInit * members;
11097 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11098 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11099 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11100 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11101 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11102 int subMemberStackPos = 0;
11105 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11109 if(_class->type == 0 || _class->type == 5)
11111 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11112 if(_class->type == 0)
11113 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11116 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11120 for(members = (*inst->members).first; members; members = members->next)
11122 switch(members->type)
11126 if(members->dataMembers)
11128 struct MemberInit * member;
11130 for(member = (*members->dataMembers).first; member; member = member->next)
11132 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11133 unsigned int found = 0x0;
11134 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11135 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11136 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11137 unsigned int dataMemberOffset;
11141 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11144 if(curMember->isProperty)
11145 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11148 dataMember = curMember;
11149 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11150 if(_class->type == 0)
11151 dataMemberOffset += _class->base->structSize;
11158 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11162 if(prop->memberAccess == 1)
11164 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11165 curClass = prop->_class;
11170 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11171 int _subMemberStackPos = 0;
11173 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11177 if(dataMember->memberAccess == 1)
11179 curMember = dataMember;
11180 curClass = dataMember->_class;
11181 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11182 subMemberStackPos = _subMemberStackPos;
11187 if(found && member->initializer && member->initializer->type == 0)
11189 struct Expression * value = member->initializer->exp;
11190 struct Type * type = (((void *)0));
11191 unsigned int deepMember = 0x0;
11195 type = prop->dataType;
11197 else if(dataMember)
11199 if(!dataMember->dataType)
11200 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11201 type = dataMember->dataType;
11203 if(ident && ident->next)
11206 for(ident = ident->next; ident && type; ident = ident->next)
11208 if(type->kind == 8)
11210 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11212 type = prop->dataType;
11215 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11217 type = dataMember->dataType;
11220 else if(type->kind == 9 || type->kind == 10)
11222 struct Type * memberType;
11224 for(memberType = type->members.first; memberType; memberType = memberType->next)
11226 if(!strcmp(memberType->name, ident->string))
11237 FreeType(value->destType);
11238 value->destType = type;
11241 ComputeExpression(value);
11243 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11245 if(type->kind == 8)
11247 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11249 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11251 if(!_class->dataType)
11252 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11253 type = _class->dataType;
11258 void * ptr = inst->data + dataMemberOffset;
11260 if(value->type == 2)
11266 GetInt(value, (int *)ptr);
11271 GetInt64(value, (long long *)ptr);
11276 GetIntPtr(value, (intptr_t *)ptr);
11281 GetIntSize(value, (ssize_t *)ptr);
11286 GetFloat(value, (float *)ptr);
11291 GetDouble(value, (double *)ptr);
11296 else if(value->type == 1)
11298 if(type->kind == 8)
11300 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11302 if(_class->type == 1)
11304 ComputeTypeSize(type);
11305 if(value->instance->data)
11306 memcpy(ptr, value->instance->data, type->size);
11313 if(value->type == 1 && value->instance->data)
11315 if(type->kind == 8)
11317 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11319 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)))
11321 void (* Set)(void *, void *) = (void *)prop->Set;
11323 Set(inst->data, value->instance->data);
11324 PopulateInstance(inst);
11328 else if(value->type == 2)
11334 void (* Set)(void *, double) = (void *)prop->Set;
11336 Set(inst->data, strtod(value->constant, (((void *)0))));
11341 void (* Set)(void *, float) = (void *)prop->Set;
11343 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11348 void (* Set)(void *, int) = (void *)prop->Set;
11350 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11355 void (* Set)(void *, long long) = (void *)prop->Set;
11357 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11362 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11364 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11369 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11371 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11376 else if(value->type == 3)
11380 ReadString(temp, value->string);
11381 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11385 else if(!deepMember && type && _class->type == 3)
11389 if(value->type == 2)
11391 if(type->kind == 8)
11393 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11395 if(_class->type == 3)
11397 if(!_class->dataType)
11398 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11399 type = _class->dataType;
11407 float (* Set)(float) = (void *)prop->Set;
11409 GetFloat(member->initializer->exp, &fValue);
11410 exp->constant = PrintFloat(Set(fValue));
11417 double (* Set)(double) = (void *)prop->Set;
11419 GetDouble(member->initializer->exp, &dValue);
11420 exp->constant = PrintDouble(Set(dValue));
11428 else if(!deepMember && type && _class->type == 2)
11432 if(value->type == 1 && value->instance->data)
11434 unsigned int (* Set)(void *) = (void *)prop->Set;
11436 bits = Set(value->instance->data);
11438 else if(value->type == 2)
11442 else if(dataMember)
11444 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11445 struct Type * type;
11448 GetInt(value, &part);
11449 bits = (bits & ~bitMember->mask);
11450 if(!bitMember->dataType)
11451 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11452 type = bitMember->dataType;
11453 if(type->kind == 8 && type->_class && type->_class->registered)
11455 if(!type->_class->registered->dataType)
11456 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11457 type = type->_class->registered->dataType;
11464 bits |= ((char)part << bitMember->pos);
11466 bits |= ((unsigned char)part << bitMember->pos);
11470 bits |= ((short)part << bitMember->pos);
11472 bits |= ((unsigned short)part << bitMember->pos);
11477 bits |= (part << bitMember->pos);
11479 bits |= ((unsigned int)part << bitMember->pos);
11483 bits |= ((long long)part << bitMember->pos);
11485 bits |= ((uint64)part << bitMember->pos);
11490 bits |= ((intptr_t)part << bitMember->pos);
11494 bits |= ((uintptr_t)part << bitMember->pos);
11500 bits |= ((ssize_t)part << bitMember->pos);
11504 bits |= ((size_t)part << bitMember->pos);
11513 if(_class && _class->type == 3)
11515 ComputeExpression(member->initializer->exp);
11516 exp->constant = member->initializer->exp->constant;
11518 member->initializer->exp->constant = (((void *)0));
11528 if(_class && _class->type == 2)
11530 exp->constant = PrintHexUInt(bits);
11535 FreeInstance(inst);
11539 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11541 unsigned int result = 0x0;
11546 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11547 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11551 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11552 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11555 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)
11556 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11559 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)
11560 result = GetOpFloat(op, &op->f);
11563 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)
11564 result = GetOpDouble(op, &op->d);
11567 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)
11568 result = GetOpUIntPtr(op, &op->ui64);
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 = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11575 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11576 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11579 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11580 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11586 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11588 if(exp->op.op == SIZEOF)
11590 FreeExpContents(exp);
11592 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11602 struct Expression * exp2 = exp->op.exp2;
11604 exp->op.exp2 = (((void *)0));
11605 FreeExpContents(exp);
11606 FreeType(exp->expType);
11607 FreeType(exp->destType);
11609 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11615 FreeExpContents(exp);
11616 op1->ops.Neg(exp, op1);
11620 if(op1->ops.BitNot)
11622 FreeExpContents(exp);
11623 op1->ops.BitNot(exp, op1);
11629 FreeExpContents(exp);
11630 op1->ops.Not(exp, op1);
11637 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11639 if(Promote(op2, op1->kind, op1->type->isSigned))
11640 op2->kind = op1->kind, op2->ops = op1->ops;
11641 else if(Promote(op1, op2->kind, op2->type->isSigned))
11642 op1->kind = op2->kind, op1->ops = op2->ops;
11649 FreeExpContents(exp);
11650 op1->ops.Add(exp, op1, op2);
11656 FreeExpContents(exp);
11657 op1->ops.Sub(exp, op1, op2);
11663 FreeExpContents(exp);
11664 op1->ops.Mul(exp, op1, op2);
11670 FreeExpContents(exp);
11671 op1->ops.Div(exp, op1, op2);
11677 FreeExpContents(exp);
11678 op1->ops.Mod(exp, op1, op2);
11684 if(op1->ops.BitAnd)
11686 FreeExpContents(exp);
11687 op1->ops.BitAnd(exp, op1, op2);
11694 FreeExpContents(exp);
11695 op1->ops.BitOr(exp, op1, op2);
11699 if(op1->ops.BitXor)
11701 FreeExpContents(exp);
11702 op1->ops.BitXor(exp, op1, op2);
11706 if(op1->ops.LShift)
11708 FreeExpContents(exp);
11709 op1->ops.LShift(exp, op1, op2);
11713 if(op1->ops.RShift)
11715 FreeExpContents(exp);
11716 op1->ops.RShift(exp, op1, op2);
11722 FreeExpContents(exp);
11723 op1->ops.Equ(exp, op1, op2);
11729 FreeExpContents(exp);
11730 op1->ops.Nqu(exp, op1, op2);
11736 FreeExpContents(exp);
11737 op1->ops.And(exp, op1, op2);
11743 FreeExpContents(exp);
11744 op1->ops.Or(exp, op1, op2);
11750 FreeExpContents(exp);
11751 op1->ops.Grt(exp, op1, op2);
11757 FreeExpContents(exp);
11758 op1->ops.Sma(exp, op1, op2);
11762 if(op1->ops.GrtEqu)
11764 FreeExpContents(exp);
11765 op1->ops.GrtEqu(exp, op1, op2);
11769 if(op1->ops.SmaEqu)
11771 FreeExpContents(exp);
11772 op1->ops.SmaEqu(exp, op1, op2);
11780 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11782 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11784 void ComputeExpression(struct Expression * exp)
11786 char expString[10240];
11788 expString[0] = '\0';
11793 ComputeInstantiation(exp);
11798 struct Expression * exp1, * exp2 = (((void *)0));
11799 struct Operand op1 =
11803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11806 struct Operand op2 =
11810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11816 struct Expression * e = exp->op.exp2;
11818 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11820 if(e->type == 5 || e->type == 32 || e->type == 23)
11823 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11825 e = (*e->list).last;
11828 if(exp->op.op == 261 && e && e->expType)
11830 if(e->type == 3 && e->string)
11832 char * string = e->string;
11833 int len = strlen(string);
11834 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11836 len = UnescapeString(tmp, string + 1, len - 2);
11837 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11838 FreeExpContents(exp);
11840 exp->constant = PrintUInt(len + 1);
11844 struct Type * type = e->expType;
11847 FreeExpContents(exp);
11849 exp->constant = PrintUInt(ComputeTypeSize(type));
11855 ComputeExpression(exp->op.exp2);
11859 ComputeExpression(exp->op.exp1);
11860 exp1 = exp->op.exp1;
11861 exp2 = exp->op.exp2;
11862 op1 = GetOperand(exp1);
11864 op1.type->refCount++;
11867 op2 = GetOperand(exp2);
11869 op2.type->refCount++;
11874 exp1 = exp->op.exp2;
11875 op1 = GetOperand(exp1);
11877 op1.type->refCount++;
11879 CallOperator(exp, exp1, exp2, &op1, &op2);
11881 FreeType(op1.type);
11883 FreeType(op2.type);
11889 struct Expression * e, * n;
11891 for(e = (*exp->list).first; e; e = n)
11896 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11898 ComputeExpression(e);
11899 FreeType(exp->expType);
11900 FreeType(exp->destType);
11902 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11903 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11914 struct Expression * memberExp = exp->member.exp;
11915 struct Identifier * memberID = exp->member.member;
11916 struct Type * type;
11918 ComputeExpression(exp->member.exp);
11919 type = exp->member.exp->expType;
11922 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)));
11923 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11924 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11925 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11927 if(type->kind == 19 && exp->member.exp->type == 24)
11928 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11932 struct Symbol * classSym;
11935 PrintTypeNoConst(type, string, 0x0, 0x1);
11936 classSym = FindClass(string);
11937 _class = classSym ? classSym->registered : (((void *)0));
11939 if(exp->member.member)
11941 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11943 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11945 if(!prop && !member && _class && exp->member.member)
11947 struct Symbol * classSym = FindClass(exp->member.member->string);
11949 convertTo = _class;
11950 _class = classSym ? classSym->registered : (((void *)0));
11951 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11957 struct Type * type = prop->dataType;
11959 if(_class->type == 3)
11961 if(type->kind == 8)
11963 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11965 if(_class->type == 3)
11967 if(!_class->dataType)
11968 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11969 type = _class->dataType;
11977 float (* Get)(float) = (void *)prop->Get;
11979 GetFloat(exp->member.exp, &value);
11980 exp->constant = PrintFloat(Get ? Get(value) : value);
11987 double (* Get)(double);
11989 GetDouble(exp->member.exp, &value);
11991 Get = (void *)prop->Set;
11993 Get = (void *)prop->Get;
11994 exp->constant = PrintDouble(Get ? Get(value) : value);
12004 struct Expression * value = exp->member.exp;
12005 struct Type * type;
12007 if(!prop->dataType)
12008 ProcessPropertyType(prop);
12009 type = prop->dataType;
12013 else if(_class->type == 1)
12019 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12021 if(propertyClass->type == 1 && value->type == 1)
12023 void (* Set)(void *, void *) = (void *)prop->Set;
12025 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12026 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12027 exp->instance->_class = MkSpecifierName(_class->fullName);
12028 exp->instance->loc = exp->loc;
12030 Set(exp->instance->data, value->instance->data);
12031 PopulateInstance(exp->instance);
12038 void (* Set)(void *, int) = (void *)prop->Set;
12040 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12041 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12042 exp->instance->_class = MkSpecifierName(_class->fullName);
12043 exp->instance->loc = exp->loc;
12045 GetInt(value, &intValue);
12046 Set(exp->instance->data, intValue);
12047 PopulateInstance(exp->instance);
12052 long long intValue;
12053 void (* Set)(void *, long long) = (void *)prop->Set;
12055 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12056 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12057 exp->instance->_class = MkSpecifierName(_class->fullName);
12058 exp->instance->loc = exp->loc;
12060 GetInt64(value, &intValue);
12061 Set(exp->instance->data, intValue);
12062 PopulateInstance(exp->instance);
12068 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12070 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12071 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12072 exp->instance->_class = MkSpecifierName(_class->fullName);
12073 exp->instance->loc = exp->loc;
12075 GetIntPtr(value, &intValue);
12076 Set(exp->instance->data, intValue);
12077 PopulateInstance(exp->instance);
12083 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12085 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12086 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12087 exp->instance->_class = MkSpecifierName(_class->fullName);
12088 exp->instance->loc = exp->loc;
12090 GetIntSize(value, &intValue);
12091 Set(exp->instance->data, intValue);
12092 PopulateInstance(exp->instance);
12097 double doubleValue;
12098 void (* Set)(void *, double) = (void *)prop->Set;
12100 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12101 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12102 exp->instance->_class = MkSpecifierName(_class->fullName);
12103 exp->instance->loc = exp->loc;
12105 GetDouble(value, &doubleValue);
12106 Set(exp->instance->data, doubleValue);
12107 PopulateInstance(exp->instance);
12112 else if(_class->type == 2)
12118 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12120 if(propertyClass->type == 1 && value->instance->data)
12122 unsigned int (* Set)(void *) = (void *)prop->Set;
12123 unsigned int bits = Set(value->instance->data);
12125 exp->constant = PrintHexUInt(bits);
12129 else if(_class->type == 2)
12131 unsigned int value;
12132 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12135 GetUInt(exp->member.exp, &value);
12137 exp->constant = PrintHexUInt(bits);
12146 if(_class->type == 2)
12148 unsigned int value;
12150 GetUInt(exp->member.exp, &value);
12155 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12157 if(_class->type == 1)
12159 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12161 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12162 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12163 exp->instance->_class = MkSpecifierName(_class->fullName);
12164 exp->instance->loc = exp->loc;
12166 Get(value, exp->instance->data);
12167 PopulateInstance(exp->instance);
12169 else if(_class->type == 2)
12171 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12172 uint64 bits = Get(value);
12174 exp->constant = PrintHexUInt64(bits);
12181 else if(_class->type == 1)
12183 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12189 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12191 if(_class->type == 1 && value)
12193 void (* Get)(void *, void *) = (void *)prop->Get;
12195 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12196 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12197 exp->instance->_class = MkSpecifierName(_class->fullName);
12198 exp->instance->loc = exp->loc;
12200 Get(value, exp->instance->data);
12201 PopulateInstance(exp->instance);
12212 exp->isConstant = 0x0;
12221 FreeExpression(memberExp);
12222 FreeIdentifier(memberID);
12228 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12230 FreeExpContents(exp);
12231 exp->constant = PrintUInt(ComputeTypeSize(type));
12238 struct Symbol * classSym = exp->_class->symbol;
12240 if(classSym && classSym->registered)
12242 if(classSym->registered->fixed)
12244 FreeSpecifier(exp->_class);
12245 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12250 char className[1024];
12252 strcpy(className, "__ecereClass_");
12253 FullClassNameCat(className, classSym->string, 0x1);
12254 MangleClassName(className);
12255 DeclareClass(classSym, className);
12256 FreeExpContents(exp);
12258 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12259 exp->member.member = MkIdentifier("structSize");
12266 struct Type * type;
12267 struct Expression * e = exp;
12269 if(exp->type == 11)
12272 ComputeExpression(exp->cast.exp);
12275 if(e && exp->expType)
12277 type = exp->expType;
12278 if(type->kind == 8)
12280 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12282 if(_class && (_class->type == 3 || _class->type == 2))
12284 if(!_class->dataType)
12285 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12286 type = _class->dataType;
12295 char value = (char)0;
12297 if(GetChar(e, &value))
12299 FreeExpContents(exp);
12300 exp->constant = PrintChar(value);
12306 unsigned char value = (unsigned char)0;
12308 if(GetUChar(e, &value))
12310 FreeExpContents(exp);
12311 exp->constant = PrintUChar(value);
12319 short value = (short)0;
12321 if(GetShort(e, &value))
12323 FreeExpContents(exp);
12324 exp->constant = PrintShort(value);
12330 unsigned short value = (unsigned short)0;
12332 if(GetUShort(e, &value))
12334 FreeExpContents(exp);
12335 exp->constant = PrintUShort(value);
12345 if(GetInt(e, &value))
12347 FreeExpContents(exp);
12348 exp->constant = PrintInt(value);
12354 unsigned int value = 0;
12356 if(GetUInt(e, &value))
12358 FreeExpContents(exp);
12359 exp->constant = PrintUInt(value);
12367 long long value = 0;
12369 if(GetInt64(e, &value))
12371 FreeExpContents(exp);
12372 exp->constant = PrintInt64(value);
12380 if(GetUInt64(e, &value))
12382 FreeExpContents(exp);
12383 exp->constant = PrintUInt64(value);
12391 intptr_t value = 0;
12393 if(GetIntPtr(e, &value))
12395 FreeExpContents(exp);
12396 exp->constant = PrintInt64((long long)value);
12402 uintptr_t value = 0;
12404 if(GetUIntPtr(e, &value))
12406 FreeExpContents(exp);
12407 exp->constant = PrintUInt64((uint64)value);
12417 if(GetIntSize(e, &value))
12419 FreeExpContents(exp);
12420 exp->constant = PrintInt64((long long)value);
12428 if(GetUIntSize(e, &value))
12430 FreeExpContents(exp);
12431 exp->constant = PrintUInt64((uint64)value);
12440 if(GetFloat(e, &value))
12442 FreeExpContents(exp);
12443 exp->constant = PrintFloat(value);
12452 if(GetDouble(e, &value))
12454 FreeExpContents(exp);
12455 exp->constant = PrintDouble(value);
12466 struct Operand op1 =
12470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12473 struct Operand op2 =
12477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12480 struct Operand op3 =
12484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12489 ComputeExpression((*exp->cond.exp).last);
12490 if(exp->cond.elseExp)
12491 ComputeExpression(exp->cond.elseExp);
12493 ComputeExpression(exp->cond.cond);
12494 op1 = GetOperand(exp->cond.cond);
12496 op1.type->refCount++;
12497 op2 = GetOperand((*exp->cond.exp).last);
12499 op2.type->refCount++;
12500 op3 = GetOperand(exp->cond.elseExp);
12502 op3.type->refCount++;
12505 FreeExpContents(exp);
12506 op1.ops.Cond(exp, &op1, &op2, &op3);
12509 FreeType(op1.type);
12511 FreeType(op2.type);
12513 FreeType(op3.type);
12519 void ApplyAnyObjectLogic(struct Expression * e);
12521 extern void CopyTypeInto(struct Type * type, struct Type * src);
12523 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12525 unsigned int result = 0x1;
12529 struct __ecereNameSpace__ecere__sys__OldList converts =
12533 struct Conversion * convert;
12535 if(destType->kind == 0)
12537 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12541 for(convert = converts.first; convert; convert = convert->next)
12543 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12548 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12551 newExp->destType = (((void *)0));
12555 exp->addedThis = 0x1;
12556 exp->member.exp = newExp;
12557 FreeType(exp->member.exp->expType);
12558 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12559 exp->member.exp->expType->classObjectType = objectType;
12560 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12561 exp->member.memberType = 1;
12562 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12563 exp->needCast = 0x1;
12565 exp->expType->refCount++;
12566 ApplyAnyObjectLogic(exp->member.exp);
12572 exp->addedThis = 0x1;
12573 exp->member.exp = newExp;
12574 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12576 newExp->byReference = 0x1;
12578 FreeType(exp->member.exp->expType);
12579 exp->member.exp->expType = (((void *)0));
12580 if(convert->convert->dataType)
12582 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12583 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12584 exp->member.exp->expType->refCount = 1;
12585 exp->member.exp->expType->classObjectType = objectType;
12586 ApplyAnyObjectLogic(exp->member.exp);
12588 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12589 exp->member.memberType = 4;
12590 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12591 exp->needCast = 0x1;
12592 if(convert->resultType)
12593 convert->resultType->refCount++;
12599 FreeType(exp->expType);
12602 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12603 exp->needCast = 0x1;
12605 exp->expType->refCount++;
12609 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12610 exp->needCast = 0x1;
12611 if(convert->resultType)
12612 convert->resultType->refCount++;
12616 if(exp->isConstant && inCompiler)
12617 ComputeExpression(exp);
12618 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12620 if(!result && exp->expType && converts.count)
12622 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12624 if(!result && exp->expType && exp->destType)
12626 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))
12633 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12635 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12637 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12639 void CheckTemplateTypes(struct Expression * exp)
12641 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12643 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12644 struct Statement * compound;
12645 struct Context * context;
12649 exp->destType->refCount++;
12651 exp->expType->refCount++;
12652 newExp->prev = (((void *)0));
12653 newExp->next = (((void *)0));
12654 switch(exp->expType->kind)
12657 if(exp->destType->classObjectType)
12660 exp->destType->refCount--;
12662 exp->expType->refCount--;
12663 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12667 struct __ecereNameSpace__ecere__sys__OldList * specs;
12668 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12669 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12671 context = PushContext();
12672 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12673 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12674 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12676 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12677 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12678 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12679 exp->compound->compound.context = context;
12680 PopContext(context);
12685 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12686 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12690 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12692 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12693 struct Statement * compound;
12694 struct Context * context;
12698 exp->destType->refCount++;
12700 exp->expType->refCount++;
12701 newExp->prev = (((void *)0));
12702 newExp->next = (((void *)0));
12703 switch(exp->expType->kind)
12706 if(exp->destType->classObjectType)
12709 exp->destType->refCount--;
12711 exp->expType->refCount--;
12712 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12716 struct __ecereNameSpace__ecere__sys__OldList * specs;
12717 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12718 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12720 context = PushContext();
12721 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12722 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12723 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12725 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12726 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12727 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12728 exp->compound->compound.context = context;
12729 PopContext(context);
12734 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12737 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12738 ProcessExpressionType((*exp->list).first);
12744 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12745 newExp->needCast = 0x1;
12746 ProcessExpressionType((*exp->list).first);
12752 if(exp->expType->kind == 20)
12754 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12758 FreeType(exp->destType);
12759 FreeType(exp->expType);
12760 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12764 if(newExp->type == 8 && newExp->member.memberType == 3)
12768 exp->op.exp1 = (((void *)0));
12769 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12773 char typeString[1024];
12774 struct Declarator * decl;
12775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12777 typeString[0] = '\0';
12778 PrintType(exp->expType, typeString, 0x0, 0x0);
12779 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12781 exp->cast.typeName = MkTypeName(specs, decl);
12782 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12783 exp->cast.exp->needCast = 0x1;
12791 extern int strncmp(const char * , const char * , size_t n);
12793 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12795 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12797 int nsLen = strlen(nameSpace);
12798 struct Symbol * symbol;
12800 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)))
12802 char * s = symbol->string;
12804 if(!strncmp(s, nameSpace, nsLen))
12809 for(c = strlen(s) - 1; c >= 0; c--)
12812 namePart = s + c + 1;
12813 if(!strcmp(namePart, name))
12821 return (((void *)0));
12824 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12827 char nameSpace[1024];
12829 unsigned int gotColon = 0x0;
12831 nameSpace[0] = '\0';
12832 for(c = strlen(name) - 1; c >= 0; c--)
12838 namePart = name + c + 1;
12839 while(c >= 0 && name[c] == ':')
12843 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12847 memcpy(nameSpace, name, c + 1);
12848 nameSpace[c + 1] = (char)0;
12849 return ScanWithNameSpace(tree, nameSpace, namePart);
12853 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12859 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12863 return ScanWithNameSpace(tree, "", namePart);
12865 return (((void *)0));
12868 static void ProcessDeclaration(struct Declaration * decl);
12870 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12872 struct Context * ctx;
12873 struct Symbol * symbol = (((void *)0));
12875 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12877 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12879 symbol = (((void *)0));
12882 char curName[1024];
12884 strcpy(curName, thisNameSpace);
12885 strcat(curName, "::");
12886 strcat(curName, name);
12887 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12890 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12893 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12894 if(symbol || ctx == endContext)
12897 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12899 if(symbol->pointerExternal->type == 0)
12901 struct FunctionDefinition * function = symbol->pointerExternal->function;
12902 struct Context * tmpContext = curContext;
12904 curContext = (((void *)0));
12905 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12906 curContext = tmpContext;
12907 symbol->pointerExternal->symbol = symbol;
12908 DeclareType(symbol->type, 0x1, 0x1);
12909 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12910 symbol->id = curExternal->symbol->idCode;
12912 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12914 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12915 symbol->id = curExternal->symbol->idCode;
12921 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12923 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12924 ListAdd(specs, MkSpecifier(UNSIGNED));
12929 if(type->_class->registered)
12931 if(!type->_class->registered->dataType)
12932 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12933 GetTypeSpecs(type->_class->registered->dataType, specs);
12938 ListAdd(specs, MkSpecifier(DOUBLE));
12941 ListAdd(specs, MkSpecifier(FLOAT));
12944 ListAdd(specs, MkSpecifier(CHAR));
12947 ListAdd(specs, MkSpecifier(_BOOL));
12950 ListAdd(specs, MkSpecifier(SHORT));
12953 ListAdd(specs, MkSpecifier(INT64));
12956 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12959 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12963 ListAdd(specs, MkSpecifier(INT));
12968 static void PrintArraySize(struct Type * arrayType, char * string)
12974 if(arrayType->enumClass)
12975 strcat(size, arrayType->enumClass->string);
12976 else if(arrayType->arraySizeExp)
12977 PrintExpression(arrayType->arraySizeExp, size);
12979 strcat(string, size);
12982 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12986 if(printConst && type->constant)
12987 strcat(string, "const ");
12992 struct Symbol * c = type->_class;
12994 if(type->classObjectType == 2)
12995 strcat(string, "typed_object");
12996 else if(type->classObjectType == 3)
12997 strcat(string, "any_object");
13001 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13003 if(type->byReference)
13004 strcat(string, " &");
13008 strcat(string, "void");
13011 strcat(string, type->isSigned ? "int" : "uint");
13014 strcat(string, type->isSigned ? "int64" : "uint64");
13017 strcat(string, type->isSigned ? "intptr" : "uintptr");
13020 strcat(string, type->isSigned ? "intsize" : "uintsize");
13023 strcat(string, type->isSigned ? "char" : "byte");
13026 strcat(string, "_Bool");
13029 strcat(string, type->isSigned ? "short" : "uint16");
13032 strcat(string, "float");
13035 strcat(string, "double");
13040 strcat(string, "struct ");
13041 strcat(string, type->enumName);
13043 else if(type->typeName)
13044 strcat(string, type->typeName);
13047 struct Type * member;
13049 strcat(string, "struct { ");
13050 for(member = type->members.first; member; member = member->next)
13052 PrintType(member, string, 0x1, fullName);
13053 strcat(string, "; ");
13055 strcat(string, "}");
13061 strcat(string, "union ");
13062 strcat(string, type->enumName);
13064 else if(type->typeName)
13065 strcat(string, type->typeName);
13068 strcat(string, "union ");
13069 strcat(string, "(unnamed)");
13075 strcat(string, "enum ");
13076 strcat(string, type->enumName);
13078 else if(type->typeName)
13079 strcat(string, type->typeName);
13081 strcat(string, "int");
13084 strcat(string, "...");
13087 strcat(string, "subclass(");
13088 strcat(string, type->_class ? type->_class->string : "int");
13089 strcat(string, ")");
13092 strcat(string, type->templateParameter->identifier->string);
13095 strcat(string, "thisclass");
13098 strcat(string, "__builtin_va_list");
13104 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13106 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13108 if(type->name && type->name[0])
13111 strcat(string, type->name);
13114 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13120 strcat(string, name);
13125 static void PrintAttribs(struct Type * type, char * string)
13129 if(type->dllExport)
13130 strcat(string, "dllexport ");
13131 if(type->attrStdcall)
13132 strcat(string, "stdcall ");
13136 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13138 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13140 struct Type * attrType = (((void *)0));
13142 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13143 PrintAttribs(type, string);
13144 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13145 strcat(string, " const");
13146 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13147 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13148 strcat(string, " (");
13149 if(type->kind == 13)
13151 if(type->type->kind == 11 || type->type->kind == 16)
13152 PrintAttribs(type->type, string);
13154 if(type->kind == 13)
13156 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13157 strcat(string, "*");
13159 strcat(string, " *");
13161 if(printConst && type->constant && type->kind == 13)
13162 strcat(string, " const");
13165 PrintTypeSpecs(type, string, fullName, printConst);
13168 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13170 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13171 strcat(string, ")");
13172 if(type->kind == 12)
13173 PrintArraySize(type, string);
13174 else if(type->kind == 11)
13176 struct Type * param;
13178 strcat(string, "(");
13179 for(param = type->params.first; param; param = param->next)
13181 PrintType(param, string, 0x1, fullName);
13183 strcat(string, ", ");
13185 strcat(string, ")");
13187 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13188 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13191 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13193 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13194 if(type->thisClass || (printName && type->name && type->name[0]))
13195 strcat(string, " ");
13196 if((type->thisClass || type->staticMethod))
13198 struct Symbol * _class = type->thisClass;
13200 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13202 if(type->classObjectType == 1)
13203 strcat(string, "class");
13205 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13207 else if(_class && _class->string)
13209 char * s = _class->string;
13215 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13221 strcat(string, name);
13224 strcat(string, "::");
13226 if(printName && type->name)
13227 PrintName(type, string, fullName);
13228 PostPrintType(type, string, fullName);
13229 if(type->bitFieldCount)
13233 sprintf(count, ":%d", type->bitFieldCount);
13234 strcat(string, count);
13238 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13240 _PrintType(type, string, printName, fullName, 0x1);
13243 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13245 _PrintType(type, string, printName, fullName, 0x0);
13248 static struct Type * FindMember(struct Type * type, char * string)
13250 struct Type * memberType;
13252 for(memberType = type->members.first; memberType; memberType = memberType->next)
13254 if(!memberType->name)
13256 struct Type * subType = FindMember(memberType, string);
13261 else if(!strcmp(memberType->name, string))
13264 return (((void *)0));
13267 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
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);
13279 *offset += memberType->offset;
13283 else if(!strcmp(memberType->name, string))
13285 *offset += memberType->offset;
13289 return (((void *)0));
13292 extern unsigned int parseError;
13294 unsigned int GetParseError()
13299 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13301 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13303 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13305 struct Expression * ParseExpressionString(char * expression)
13308 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13309 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13310 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13312 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13313 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13314 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13315 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13317 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13318 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13320 parsedExpression = (((void *)0));
13322 expression_yyparse();
13323 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13324 return parsedExpression;
13327 extern char * QMkString(char * source);
13329 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13331 struct Identifier * id = exp->identifier;
13332 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13333 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13334 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13335 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13337 if(_class && _class->type == 4)
13339 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13340 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13344 struct __ecereNameSpace__ecere__com__Class * baseClass;
13346 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13348 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13350 for(value = e->values.first; value; value = value->next)
13352 if(!strcmp(value->name, id->string))
13357 char constant[256];
13359 FreeExpContents(exp);
13361 exp->isConstant = 0x1;
13362 if(!strcmp(baseClass->dataTypeString, "int"))
13363 sprintf(constant, "%d", (int)value->data);
13365 sprintf(constant, "0x%X", (int)value->data);
13366 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13367 exp->expType = MkClassType(baseClass->fullName);
13375 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13377 ProcessMethodType(method);
13378 exp->expType = __extension__ ({
13379 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13381 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13385 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13387 if(!prop->dataType)
13388 ProcessPropertyType(prop);
13389 exp->expType = prop->dataType;
13391 prop->dataType->refCount++;
13394 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13396 if(!member->dataType)
13397 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13398 exp->expType = member->dataType;
13399 if(member->dataType)
13400 member->dataType->refCount++;
13403 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13405 if(!classProp->dataType)
13406 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13407 if(classProp->constant)
13409 FreeExpContents(exp);
13410 exp->isConstant = 0x1;
13411 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13414 exp->constant = QMkString((char *)classProp->Get(_class));
13418 char constant[256];
13421 sprintf(constant, "%d", (int)classProp->Get(_class));
13422 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13428 exp->expType = classProp->dataType;
13429 if(classProp->dataType)
13430 classProp->dataType->refCount++;
13436 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13438 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13439 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13440 struct __ecereNameSpace__ecere__com__NameSpace * child;
13444 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)))
13446 data = ScanGlobalData(child, name);
13454 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13456 extern char * strncpy(char * , const char * , size_t n);
13458 static struct GlobalData * FindGlobalData(char * name)
13461 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13463 nameSpace = globalData;
13464 for(c = 0; name[c]; c++)
13466 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13468 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13469 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13471 strncpy(spaceName, name + start, c - start);
13472 spaceName[c - start] = '\0';
13473 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13474 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13476 return (((void *)0));
13477 nameSpace = newSpace;
13485 return ScanGlobalData(nameSpace, name + start);
13487 return (((void *)0));
13490 static int definedExpStackPos;
13492 static void * definedExpStack[512];
13494 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13496 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13498 FreeExpContents(checkedExp);
13499 FreeType(checkedExp->expType);
13500 FreeType(checkedExp->destType);
13501 *checkedExp = *newExp;
13502 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13503 checkedExp->prev = prev;
13504 checkedExp->next = next;
13507 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13509 extern int printf(char * , ...);
13511 void __ecereMethod_Expression_Clear();
13513 void ApplyAnyObjectLogic(struct Expression * e)
13515 struct Type * destType = e->destType;
13517 if(destType && (destType->classObjectType == 3))
13519 if(e && e->expType)
13521 struct Type * type = e->expType;
13522 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13524 if(type->kind == 8 && type->_class && type->_class->registered)
13526 _class = type->_class->registered;
13528 else if(type->kind == 19)
13530 _class = FindClass("ecere::com::Class")->registered;
13534 char string[1024] = "";
13535 struct Symbol * classSym;
13537 PrintTypeNoConst(type, string, 0x0, 0x1);
13538 classSym = FindClass(string);
13540 _class = classSym->registered;
13542 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)))
13544 if(!_class || strcmp(_class->fullName, "char *"))
13546 struct Expression * checkedExp = e, * newExp;
13548 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13550 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13552 if(checkedExp->type == 23)
13554 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13557 checkedExp = (*checkedExp->list).last;
13559 else if(checkedExp->type == 11)
13560 checkedExp = checkedExp->cast.exp;
13562 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13564 newExp = checkedExp->op.exp2;
13565 checkedExp->op.exp2 = (((void *)0));
13566 FreeExpContents(checkedExp);
13567 if(e->expType && e->expType->passAsTemplate)
13571 ComputeTypeSize(e->expType);
13572 sprintf(size, "%d", e->expType->size);
13573 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))))));
13575 ReplaceExpContents(checkedExp, newExp);
13576 e->byReference = 0x1;
13578 else if(!e->byReference || (_class && _class->type == 5))
13580 struct Expression * checkedExp, * newExp;
13583 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;
13585 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13587 struct Context * context = PushContext();
13588 struct Declarator * decl;
13589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13590 char typeString[1024];
13591 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13593 typeString[0] = '\0';
13595 newExp->prev = (((void *)0));
13596 newExp->next = (((void *)0));
13597 newExp->expType = (((void *)0));
13598 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13599 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13600 newExp->destType = ProcessType(specs, decl);
13601 curContext = context;
13605 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13608 sprintf(name, "__internalValue%03X", internalValueCounter++);
13609 if(!curCompound->compound.declarations)
13610 curCompound->compound.declarations = MkList();
13611 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13612 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13613 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13614 e->compound = MkCompoundStmt((((void *)0)), stmts);
13617 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13619 struct Type * type = e->destType;
13621 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13622 CopyTypeInto(e->destType, type);
13623 e->destType->refCount = 1;
13624 e->destType->classObjectType = 0;
13627 e->compound->compound.context = context;
13628 PopContext(context);
13629 curContext = context->parent;
13633 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13635 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13637 if(checkedExp->type == 23)
13639 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13642 checkedExp = (*checkedExp->list).last;
13644 else if(checkedExp->type == 11)
13645 checkedExp = checkedExp->cast.exp;
13648 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13650 *operand = *checkedExp;
13651 checkedExp->destType = (((void *)0));
13652 checkedExp->expType = (((void *)0));
13653 __ecereMethod_Expression_Clear(checkedExp);
13654 checkedExp->type = 4;
13655 checkedExp->op.op = '&';
13656 checkedExp->op.exp1 = (((void *)0));
13657 checkedExp->op.exp2 = operand;
13666 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))))
13668 if(e->expType->classObjectType && destType && destType->classObjectType)
13674 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13677 thisExp->prev = (((void *)0));
13678 thisExp->next = (((void *)0));
13679 __ecereMethod_Expression_Clear(e);
13681 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13682 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13683 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13685 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13686 CopyTypeInto(e->expType, thisExp->expType);
13687 e->expType->byReference = 0x0;
13688 e->expType->refCount = 1;
13689 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))
13691 e->expType->classObjectType = 0;
13696 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13698 if(destType->kind == 14)
13700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13702 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13704 unsigned int byReference = e->expType->byReference;
13705 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13706 struct Declarator * decl;
13707 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13708 char typeString[1024];
13709 struct Type * type;
13710 int backupClassObjectType;
13711 unsigned int backupByReference;
13713 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13717 backupClassObjectType = type->classObjectType;
13718 backupByReference = type->byReference;
13719 type->classObjectType = 0;
13720 type->byReference = 0x0;
13721 typeString[0] = '\0';
13722 PrintType(type, typeString, 0x0, 0x1);
13723 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13724 type->classObjectType = backupClassObjectType;
13725 type->byReference = backupByReference;
13727 thisExp->prev = (((void *)0));
13728 thisExp->next = (((void *)0));
13729 __ecereMethod_Expression_Clear(e);
13730 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)))
13734 e->op.exp1 = (((void *)0));
13735 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13736 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13737 CopyTypeInto(e->expType, type);
13738 e->expType->byReference = 0x0;
13739 e->expType->refCount = 1;
13744 e->cast.typeName = MkTypeName(specs, decl);
13745 e->cast.exp = thisExp;
13746 e->byReference = 0x1;
13750 e->destType = destType;
13751 destType->refCount++;
13756 extern char * strstr(const char * , const char * );
13758 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13760 struct __ecereNameSpace__ecere__com__DefinedExpression
13762 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13763 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13766 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13767 } __attribute__ ((gcc_struct));
13769 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13771 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13773 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13775 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13777 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13779 extern struct Expression * CopyExpression(struct Expression * exp);
13781 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13783 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13785 static void ProcessStatement(struct Statement * stmt);
13787 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13789 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13791 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13793 extern char * sourceFile;
13795 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13797 void ProcessExpressionType(struct Expression * exp)
13799 unsigned int unresolved = 0x0;
13800 struct Location oldyylloc = yylloc;
13801 unsigned int notByReference = 0x0;
13803 if(!exp || exp->expType)
13810 struct Identifier * id = exp->identifier;
13812 if(!id || !topContext)
13814 if(id->_class && id->_class->name)
13816 id->classSym = id->_class->symbol;
13818 if(strstr(id->string, "__ecereClass") == id->string)
13820 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13823 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13825 ReplaceClassMembers(exp, thisClass);
13828 ProcessExpressionType(exp);
13831 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13836 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13840 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13846 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13849 ProcessExpressionType(exp);
13853 else if(currentClass && !id->_class)
13855 if(ResolveIdWithClass(exp, currentClass, 0x1))
13858 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13863 struct Type * type = symbol->type;
13864 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13866 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13868 struct Context * context = SetupTemplatesContext(_class);
13870 type = ReplaceThisClassType(_class);
13871 FinishTemplatesContext(context);
13873 type->refCount = 0;
13875 FreeSpecifier(id->_class);
13876 id->_class = (((void *)0));
13877 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13878 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13879 id->classSym = (((void *)0));
13880 exp->expType = type;
13883 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13884 exp->isConstant = 0x1;
13885 if(symbol->isParam || !strcmp(id->string, "this"))
13887 if(_class && _class->type == 1 && !type->declaredWithStruct)
13888 exp->byReference = 0x1;
13890 if(symbol->isIterator)
13892 if(symbol->isIterator == 3)
13895 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13896 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13897 exp->expType = (((void *)0));
13898 ProcessExpressionType(exp);
13900 else if(symbol->isIterator != 4)
13903 exp->member.exp = MkExpIdentifier(exp->identifier);
13904 exp->member.exp->expType = exp->expType;
13905 exp->member.member = MkIdentifier("data");
13906 exp->expType = (((void *)0));
13907 ProcessExpressionType(exp);
13914 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13916 if(thisNameSpace && !(id->_class && !id->_class->name))
13920 strcpy(name, thisNameSpace);
13921 strcat(name, "::");
13922 strcat(name, id->string);
13923 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13926 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13931 for(c = 0; c < definedExpStackPos; c++)
13932 if(definedExpStack[c] == definedExp)
13934 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13936 struct Location backupYylloc = yylloc;
13937 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13939 definedExpStack[definedExpStackPos++] = definedExp;
13940 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13941 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13942 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13944 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13945 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13946 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13947 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13949 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13950 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13952 parsedExpression = (((void *)0));
13954 expression_yyparse();
13955 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13957 fileInput = backInput;
13958 yylloc = backupYylloc;
13959 if(parsedExpression)
13961 FreeIdentifier(id);
13963 exp->list = MkListOne(parsedExpression);
13964 parsedExpression->loc = yylloc;
13965 ProcessExpressionType(exp);
13966 definedExpStackPos--;
13969 definedExpStackPos--;
13975 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13981 struct GlobalData * data = (((void *)0));
13983 if(thisNameSpace && !(id->_class && !id->_class->name))
13987 strcpy(name, thisNameSpace);
13988 strcat(name, "::");
13989 strcat(name, id->string);
13990 data = FindGlobalData(name);
13993 data = FindGlobalData(id->string);
13996 DeclareGlobalData(data);
13997 exp->expType = data->dataType;
13999 data->dataType->refCount++;
14000 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14001 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14002 FreeSpecifier(id->_class);
14003 id->_class = (((void *)0));
14008 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14010 if(thisNameSpace && !(id->_class && !id->_class->name))
14014 strcpy(name, thisNameSpace);
14015 strcat(name, "::");
14016 strcat(name, id->string);
14017 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14020 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14025 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14026 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14028 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14029 strcpy(name, "__ecereFunction_");
14030 FullClassNameCat(name, id->string, 0x0);
14031 if(DeclareFunction(function, name))
14033 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14034 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14036 exp->expType = function->dataType;
14037 if(function->dataType)
14038 function->dataType->refCount++;
14039 FreeSpecifier(id->_class);
14040 id->_class = (((void *)0));
14052 struct __ecereNameSpace__ecere__com__Class * _class;
14054 if(!exp->instance->_class)
14056 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14058 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14061 ProcessInstantiationType(exp->instance);
14062 exp->isConstant = exp->instance->isConstant;
14063 if(exp->instance->_class)
14065 exp->expType = MkClassType(exp->instance->_class->name);
14073 char * constant = exp->constant;
14074 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14076 exp->expType = type;
14077 if(constant[0] == '\'')
14079 if((int)((unsigned char *)constant)[1] > 127)
14082 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14086 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14087 exp->constant = PrintUInt(ch);
14089 type->_class = FindClass("unichar");
14090 type->isSigned = 0x0;
14095 type->isSigned = 0x1;
14100 char * dot = strchr(constant, '.');
14101 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14106 exponent = strchr(constant, 'p');
14108 exponent = strchr(constant, 'P');
14112 exponent = strchr(constant, 'e');
14114 exponent = strchr(constant, 'E');
14116 if(dot || exponent)
14118 if(strchr(constant, 'f') || strchr(constant, 'F'))
14122 type->isSigned = 0x1;
14126 unsigned int isSigned = constant[0] == '-';
14127 long long i64 = strtoll(constant, (((void *)0)), 0);
14128 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14129 unsigned int is64Bit = 0x0;
14133 if(i64 < (((int)0x80000000)))
14138 if(ui64 > (((int)0x7fffffff)))
14140 if(ui64 > (0xffffffff))
14143 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14147 else if(constant[0] != '0' || !constant[1])
14150 type->kind = is64Bit ? 4 : 3;
14151 type->isSigned = isSigned;
14154 exp->isConstant = 0x1;
14155 if(exp->destType && exp->destType->kind == 7)
14157 else if(exp->destType && exp->destType->kind == 6)
14159 else if(exp->destType && exp->destType->kind == 4)
14166 exp->isConstant = 0x1;
14167 exp->expType = __extension__ ({
14168 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14170 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14171 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14173 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14174 }), __ecereInstance2;
14180 ProcessExpressionType(exp->_new.size);
14181 exp->expType = __extension__ ({
14182 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14184 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14186 DeclareType(exp->expType->type, 0x0, 0x0);
14190 ProcessExpressionType(exp->_renew.size);
14191 ProcessExpressionType(exp->_renew.exp);
14192 exp->expType = __extension__ ({
14193 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14195 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14197 DeclareType(exp->expType->type, 0x0, 0x0);
14201 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14202 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14203 unsigned int useDestType = 0x0, useSideType = 0x0;
14204 struct Location oldyylloc = yylloc;
14205 unsigned int useSideUnit = 0x0;
14206 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14248 if(exp->op.op != '*' || exp->op.exp1)
14255 if(exp->op.op == '&')
14257 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14259 struct Identifier * id = exp->op.exp2->identifier;
14260 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14262 if(symbol && symbol->isIterator == 2)
14265 exp->member.exp = exp->op.exp2;
14266 exp->member.member = MkIdentifier("key");
14267 exp->expType = (((void *)0));
14268 exp->op.exp2->expType = symbol->type;
14269 symbol->type->refCount++;
14270 ProcessExpressionType(exp);
14278 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))
14280 if(exp->op.exp1->destType)
14281 FreeType(exp->op.exp1->destType);
14282 exp->op.exp1->destType = exp->destType;
14284 exp->destType->refCount++;
14288 if(exp->op.exp1->destType)
14289 FreeType(exp->op.exp1->destType);
14290 exp->op.exp1->destType = dummy;
14293 if(exp->op.exp1->destType && exp->op.op != '=')
14294 exp->op.exp1->destType->count++;
14295 ProcessExpressionType(exp->op.exp1);
14296 if(exp->op.exp1->destType && exp->op.op != '=')
14297 exp->op.exp1->destType->count--;
14298 if(exp->op.exp1->destType == dummy)
14301 exp->op.exp1->destType = (((void *)0));
14303 type1 = exp->op.exp1->expType;
14307 char expString[10240];
14309 expString[0] = '\0';
14310 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14314 exp->op.exp2->destType = exp->op.exp1->expType;
14315 if(exp->op.exp1->expType)
14316 exp->op.exp1->expType->refCount++;
14320 exp->op.exp2->destType = exp->destType;
14322 exp->destType->refCount++;
14326 exp->expType = type1;
14331 PrintExpression(exp->op.exp2, expString);
14332 if(type1 && type1->kind == 13)
14334 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)
14335 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14336 else if(exp->op.op == '=')
14338 if(exp->op.exp2->destType)
14339 FreeType(exp->op.exp2->destType);
14340 exp->op.exp2->destType = type1;
14347 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)
14351 if(exp->op.exp2->destType)
14352 FreeType(exp->op.exp2->destType);
14353 exp->op.exp2->destType = type1;
14360 exp->expType = type1;
14362 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)))
14364 if(exp->op.exp2->destType)
14365 FreeType(exp->op.exp2->destType);
14366 exp->op.exp2->destType = exp->destType;
14368 exp->destType->refCount++;
14372 if(exp->op.exp2->destType)
14373 FreeType(exp->op.exp2->destType);
14374 exp->op.exp2->destType = dummy;
14377 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14379 FreeType(exp->op.exp2->destType);
14380 exp->op.exp2->destType = type1;
14383 if(exp->op.exp2->destType && exp->op.op != '=')
14384 exp->op.exp2->destType->count++;
14385 if(exp->op.op == SIZEOF)
14387 struct Expression * e = exp->op.exp2;
14389 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14391 if(e->type == 5 || e->type == 32 || e->type == 23)
14394 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14396 e = (*e->list).last;
14399 if(e->type == 11 && e->cast.exp)
14400 e->cast.exp->needCast = 0x1;
14402 ProcessExpressionType(exp->op.exp2);
14403 if(exp->op.exp2->destType && exp->op.op != '=')
14404 exp->op.exp2->destType->count--;
14405 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14407 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)
14409 if(exp->op.op != '=' && type1->type->kind == 0)
14410 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14412 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)))
14414 if(exp->op.op == ADD_ASSIGN)
14415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14417 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))
14419 if(exp->op.op == ADD_ASSIGN)
14420 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14422 else if(inCompiler)
14424 char type1String[1024];
14425 char type2String[1024];
14427 type1String[0] = '\0';
14428 type2String[0] = '\0';
14429 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14430 PrintType(type1, type2String, 0x0, 0x1);
14431 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14432 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14435 if(exp->op.exp2->destType == dummy)
14438 exp->op.exp2->destType = (((void *)0));
14440 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14442 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14443 type2->refCount = 1;
14444 CopyTypeInto(type2, exp->op.exp2->expType);
14445 type2->isSigned = 0x1;
14447 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14449 type2 = __extension__ ({
14450 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14452 __ecereInstance1->kind = 3, __ecereInstance1;
14454 type2->refCount = 1;
14455 type2->isSigned = 0x1;
14459 type2 = exp->op.exp2->expType;
14465 if(exp->op.op == SIZEOF)
14467 exp->expType = __extension__ ({
14468 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14470 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14472 exp->isConstant = 0x1;
14474 else if(exp->op.op == '*' && !exp->op.exp1)
14476 exp->expType = Dereference(type2);
14477 if(type2 && type2->kind == 8)
14478 notByReference = 0x1;
14480 else if(exp->op.op == '&' && !exp->op.exp1)
14481 exp->expType = Reference(type2);
14488 if(exp->op.exp1->destType)
14489 FreeType(exp->op.exp1->destType);
14490 exp->op.exp1->destType = MkClassType("bool");
14491 exp->op.exp1->destType->truth = 0x1;
14492 if(!exp->op.exp1->expType)
14493 ProcessExpressionType(exp->op.exp1);
14495 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14496 FreeType(exp->op.exp1->expType);
14497 exp->op.exp1->expType = MkClassType("bool");
14498 exp->op.exp1->expType->truth = 0x1;
14502 if(exp->op.exp2->destType)
14503 FreeType(exp->op.exp2->destType);
14504 exp->op.exp2->destType = MkClassType("bool");
14505 exp->op.exp2->destType->truth = 0x1;
14506 if(!exp->op.exp2->expType)
14507 ProcessExpressionType(exp->op.exp2);
14509 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14510 FreeType(exp->op.exp2->expType);
14511 exp->op.exp2->expType = MkClassType("bool");
14512 exp->op.exp2->expType->truth = 0x1;
14515 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")))))
14517 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14519 if(exp->op.exp2->destType)
14520 FreeType(exp->op.exp2->destType);
14521 exp->op.exp2->destType = type1;
14523 if(exp->op.exp1->destType)
14524 FreeType(exp->op.exp1->destType);
14525 exp->op.exp1->destType = type2;
14527 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)
14528 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);
14529 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14531 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14535 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14537 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14538 ProcessExpressionType(exp->op.exp1);
14539 if(type2->kind != 13)
14541 ProcessExpressionType(classExp);
14542 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"))))))));
14543 if(!exp->op.exp2->expType)
14547 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14550 ProcessExpressionType(exp->op.exp2);
14554 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)))
14556 if(type1->kind != 8 && type1->type->kind == 0)
14557 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14558 exp->expType = type1;
14562 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)))
14564 if(type2->kind != 8 && type2->type->kind == 0)
14565 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14566 exp->expType = type2;
14570 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))
14572 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14576 unsigned int success = 0x0;
14578 if(type1->kind == 13 && type2->kind == 13)
14580 if(exp->op.op == '+')
14581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14582 else if(exp->op.op == '-')
14584 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14586 exp->expType = __extension__ ({
14587 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14589 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14592 if(type1->type->kind == 20)
14594 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14598 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14600 ProcessExpressionType(classExp);
14602 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")))))));
14603 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14611 if(!success && exp->op.exp1->type == 2)
14613 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14616 FreeType(exp->expType);
14617 exp->expType = exp->op.exp1->destType;
14618 if(exp->op.exp1->destType)
14619 exp->op.exp1->destType->refCount++;
14622 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14625 FreeType(exp->expType);
14626 exp->expType = exp->op.exp2->destType;
14627 if(exp->op.exp2->destType)
14628 exp->op.exp2->destType->refCount++;
14634 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14637 FreeType(exp->expType);
14638 exp->expType = exp->op.exp2->destType;
14639 if(exp->op.exp2->destType)
14640 exp->op.exp2->destType->refCount++;
14643 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14646 FreeType(exp->expType);
14647 exp->expType = exp->op.exp1->destType;
14648 if(exp->op.exp1->destType)
14649 exp->op.exp1->destType->refCount++;
14655 char expString1[10240];
14656 char expString2[10240];
14660 expString1[0] = '\0';
14661 expString2[0] = '\0';
14666 PrintExpression(exp->op.exp1, expString1);
14667 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14668 PrintExpression(exp->op.exp2, expString2);
14669 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14670 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14671 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14673 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14677 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14679 if(exp->op.exp1->destType)
14680 FreeType(exp->op.exp1->destType);
14681 exp->op.exp1->destType = type2->_class->registered->dataType;
14682 if(type2->_class->registered->dataType)
14683 type2->_class->registered->dataType->refCount++;
14684 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14685 exp->expType = type2;
14689 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14691 if(exp->op.exp2->destType)
14692 FreeType(exp->op.exp2->destType);
14693 exp->op.exp2->destType = type1->_class->registered->dataType;
14694 if(type1->_class->registered->dataType)
14695 type1->_class->registered->dataType->refCount++;
14696 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14697 exp->expType = type1;
14703 unsigned int valid = 0x0;
14705 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14707 if(exp->op.exp2->destType)
14708 FreeType(exp->op.exp2->destType);
14709 if(!type1->_class->registered->dataType)
14710 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14711 exp->op.exp2->destType = type1->_class->registered->dataType;
14712 exp->op.exp2->destType->refCount++;
14713 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14716 type2 = exp->op.exp2->destType;
14719 exp->expType = type2;
14722 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14724 if(exp->op.exp1->destType)
14725 FreeType(exp->op.exp1->destType);
14726 if(!type2->_class->registered->dataType)
14727 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14728 exp->op.exp1->destType = type2->_class->registered->dataType;
14729 exp->op.exp1->destType->refCount++;
14730 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14731 type1 = exp->op.exp1->destType;
14732 exp->expType = type1;
14735 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14737 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14739 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14742 FreeType(exp->expType);
14743 exp->expType = exp->op.exp1->expType;
14744 if(exp->op.exp2->expType)
14745 exp->op.exp1->expType->refCount++;
14749 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14751 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14754 FreeType(exp->expType);
14755 exp->expType = exp->op.exp2->expType;
14756 if(exp->op.exp2->expType)
14757 exp->op.exp2->expType->refCount++;
14764 if(exp->op.exp2->destType)
14765 FreeType(exp->op.exp2->destType);
14766 exp->op.exp2->destType = type1;
14768 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14771 FreeType(exp->expType);
14772 exp->expType = exp->op.exp2->destType;
14773 if(exp->op.exp2->destType)
14774 exp->op.exp2->destType->refCount++;
14776 else if(type1 && type2)
14778 char expString1[10240];
14779 char expString2[10240];
14780 char type1String[1024];
14781 char type2String[1024];
14783 expString1[0] = '\0';
14784 expString2[0] = '\0';
14785 type1String[0] = '\0';
14786 type2String[0] = '\0';
14789 PrintExpression(exp->op.exp1, expString1);
14790 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14791 PrintExpression(exp->op.exp2, expString2);
14792 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14793 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14794 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14796 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14797 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14799 exp->expType = exp->op.exp1->expType;
14800 if(exp->op.exp1->expType)
14801 exp->op.exp1->expType->refCount++;
14803 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14805 exp->expType = exp->op.exp2->expType;
14806 if(exp->op.exp2->expType)
14807 exp->op.exp2->expType->refCount++;
14814 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14816 struct Type * oldType = exp->op.exp1->expType;
14818 exp->op.exp1->expType = (((void *)0));
14819 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14822 exp->op.exp1->expType = oldType;
14824 if(exp->op.exp1->destType)
14825 FreeType(exp->op.exp1->destType);
14826 exp->op.exp1->destType = type2;
14828 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14831 FreeType(exp->expType);
14832 exp->expType = exp->op.exp1->destType;
14833 if(exp->op.exp1->destType)
14834 exp->op.exp1->destType->refCount++;
14838 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14840 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14842 if(exp->op.exp1->destType)
14843 FreeType(exp->op.exp1->destType);
14844 exp->op.exp1->destType = type2->_class->registered->dataType;
14845 if(type2->_class->registered->dataType)
14846 type2->_class->registered->dataType->refCount++;
14847 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14849 if(exp->op.op == '!')
14851 exp->expType = MkClassType("bool");
14852 exp->expType->truth = 0x1;
14856 exp->expType = type2;
14861 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14863 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14865 if(exp->op.exp2->destType)
14866 FreeType(exp->op.exp2->destType);
14867 exp->op.exp2->destType = type1->_class->registered->dataType;
14868 if(type1->_class->registered->dataType)
14869 type1->_class->registered->dataType->refCount++;
14870 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14872 exp->expType = type1;
14878 if(exp->op.exp1 && !exp->op.exp1->expType)
14880 char expString[10000];
14882 expString[0] = '\0';
14885 PrintExpression(exp->op.exp1, expString);
14886 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14891 if(exp->op.exp2 && !exp->op.exp2->expType)
14893 char expString[10240];
14895 expString[0] = '\0';
14898 PrintExpression(exp->op.exp2, expString);
14899 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14906 FreeType(exp->expType);
14907 exp->expType = MkClassType("bool");
14908 exp->expType->truth = 0x1;
14910 if(exp->op.op != SIZEOF)
14911 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14912 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14914 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14916 yylloc = oldyylloc;
14925 struct Expression * e;
14927 exp->isConstant = 0x1;
14928 for(e = (*exp->list).first; e; e = e->next)
14930 unsigned int inced = 0x0;
14934 FreeType(e->destType);
14935 e->destType = exp->destType;
14938 exp->destType->refCount++;
14939 e->destType->count++;
14943 ProcessExpressionType(e);
14945 exp->destType->count--;
14946 if(!exp->expType && !e->next)
14948 exp->expType = e->expType;
14950 e->expType->refCount++;
14953 exp->isConstant = 0x0;
14955 e = (*exp->list).first;
14956 if(!e->next && e->type == 8)
14958 struct Expression * next = exp->next, * prev = exp->prev;
14960 FreeType(exp->expType);
14961 FreeType(exp->destType);
14962 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14966 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14967 ProcessExpressionType(exp);
14973 struct Expression * e;
14975 exp->isConstant = 0x1;
14976 ProcessExpressionType(exp->index.exp);
14977 if(!exp->index.exp->isConstant)
14978 exp->isConstant = 0x0;
14979 if(exp->index.exp->expType)
14981 struct Type * source = exp->index.exp->expType;
14983 if(source->kind == 8 && source->_class && source->_class->registered)
14985 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14986 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14988 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14990 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14991 if(exp->index.index && (*exp->index.index).last)
14993 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14998 for(e = (*exp->index.index).first; e; e = e->next)
15000 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15003 FreeType(e->destType);
15004 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15006 ProcessExpressionType(e);
15011 exp->isConstant = 0x0;
15014 exp->expType = Dereference(exp->index.exp->expType);
15016 DeclareType(exp->expType, 0x0, 0x0);
15021 struct Expression * e;
15022 struct Type * functionType;
15023 struct Type * methodType = (((void *)0));
15029 PrintExpression(exp->call.exp, name);
15030 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15032 PrintExpression(exp->call.exp, name);
15035 if(exp->call.exp->type == 0)
15037 struct Expression * idExp = exp->call.exp;
15038 struct Identifier * id = idExp->identifier;
15040 if(!strcmp(id->string, "__builtin_frame_address"))
15042 exp->expType = ProcessTypeString("void *", 0x1);
15043 if(exp->call.arguments && (*exp->call.arguments).first)
15044 ProcessExpressionType((*exp->call.arguments).first);
15047 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15049 exp->expType = ProcessTypeString("int", 0x1);
15050 if(exp->call.arguments && (*exp->call.arguments).first)
15051 ProcessExpressionType((*exp->call.arguments).first);
15054 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15056 struct Expression * a = (((void *)0));
15057 struct Expression * b = (((void *)0));
15058 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15060 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15062 a = (*exp->call.arguments).first;
15063 b = (*exp->call.arguments).last;
15067 else if((*exp->call.arguments).count == 1)
15069 a = (*exp->call.arguments).first;
15074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15075 idExp->identifier = (((void *)0));
15076 FreeExpContents(exp);
15077 ProcessExpressionType(a);
15079 ProcessExpressionType(b);
15081 exp->list = MkList();
15082 if(a->expType && (!b || b->expType))
15084 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15088 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15089 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15090 struct Declaration * decl;
15091 char temp1[1024], temp2[1024];
15093 GetTypeSpecs(a->expType, specs);
15094 if(a && !a->isConstant && a->type != 0)
15096 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15097 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15098 tempExp1 = QMkExpId(temp1);
15099 tempExp1->expType = a->expType;
15101 a->expType->refCount++;
15102 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15104 if(b && !b->isConstant && b->type != 0)
15106 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15107 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15108 tempExp2 = QMkExpId(temp2);
15109 tempExp2->expType = b->expType;
15111 b->expType->refCount++;
15112 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15114 decl = MkDeclaration(specs, decls);
15115 if(!curCompound->compound.declarations)
15116 curCompound->compound.declarations = MkList();
15117 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15121 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15123 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15125 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15126 exp->expType = a->expType;
15128 a->expType->refCount++;
15130 else if(!strcmp(id->string, "Abs"))
15132 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15133 exp->expType = a->expType;
15135 a->expType->refCount++;
15137 else if(!strcmp(id->string, "Sgn"))
15139 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"))))));
15140 exp->expType = ProcessTypeString("int", 0x0);
15142 FreeExpression(tempExp1);
15144 FreeExpression(tempExp2);
15145 FreeIdentifier(id);
15151 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15153 if(!exp->call.exp->destType)
15155 exp->call.exp->destType = dummy;
15158 ProcessExpressionType(exp->call.exp);
15159 if(exp->call.exp->destType == dummy)
15162 exp->call.exp->destType = (((void *)0));
15166 functionType = exp->call.exp->expType;
15167 if(functionType && functionType->kind == 16)
15169 methodType = functionType;
15170 functionType = methodType->method->dataType;
15171 if(exp->call.exp->expType->usedClass)
15173 char typeString[1024];
15175 typeString[0] = '\0';
15177 struct Symbol * back = functionType->thisClass;
15179 functionType->thisClass = (((void *)0));
15180 PrintType(functionType, typeString, 0x1, 0x1);
15181 functionType->thisClass = back;
15183 if(strstr(typeString, "thisclass"))
15185 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15186 struct Declarator * decl;
15189 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15191 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15192 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15193 thisClassParams = 0x0;
15194 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15196 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15198 thisClass = exp->call.exp->expType->usedClass;
15199 ProcessDeclarator(decl);
15200 thisClass = backupThisClass;
15202 thisClassParams = 0x1;
15203 functionType = ProcessType(specs, decl);
15204 functionType->refCount = 0;
15205 FinishTemplatesContext(context);
15207 FreeList(specs, FreeSpecifier);
15208 FreeDeclarator(decl);
15212 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15214 struct Type * type = functionType->type;
15216 if(!functionType->refCount)
15218 functionType->type = (((void *)0));
15219 FreeType(functionType);
15221 functionType = type;
15223 if(functionType && functionType->kind != 11)
15225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15227 else if(functionType)
15229 unsigned int emptyParams = 0x0, noParams = 0x0;
15230 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15231 struct Type * type = functionType->params.first;
15232 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15234 struct Location oldyylloc = yylloc;
15238 if(functionType->extraParam && e && functionType->thisClass)
15240 e->destType = MkClassType(functionType->thisClass->string);
15243 if(!functionType->staticMethod && !functionType->extraParam)
15245 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15247 type = MkClassType(memberExp->member.exp->expType->_class->string);
15250 e->destType = type;
15252 type = functionType->params.first;
15255 type->refCount = 0;
15257 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15259 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15260 type->byReference = functionType->byReference;
15261 type->typedByReference = functionType->typedByReference;
15264 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15266 e->destType = type;
15268 type = functionType->params.first;
15271 type->refCount = 0;
15274 if(type && type->kind == 0)
15277 if(!type->refCount)
15279 type = (((void *)0));
15281 for(; e; e = e->next)
15283 if(!type && !emptyParams)
15286 if(methodType && methodType->methodClass)
15287 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);
15289 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);
15292 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15294 struct Type * templatedType = (((void *)0));
15295 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15296 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15299 if(_class && _class->templateArgs)
15301 struct __ecereNameSpace__ecere__com__Class * sClass;
15303 for(sClass = _class; sClass; sClass = sClass->base)
15305 if(sClass->templateClass)
15306 sClass = sClass->templateClass;
15308 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15310 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15312 struct __ecereNameSpace__ecere__com__Class * nextClass;
15314 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15316 if(nextClass->templateClass)
15317 nextClass = nextClass->templateClass;
15318 id += nextClass->templateParams.count;
15328 if(curParam && _class->templateArgs[id].dataTypeString)
15330 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15333 struct Context * context = SetupTemplatesContext(_class);
15335 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15336 FinishTemplatesContext(context);
15338 e->destType = templatedType;
15341 templatedType->passAsTemplate = 0x1;
15346 e->destType = type;
15353 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15355 e->destType = type->prev;
15356 e->destType->refCount++;
15360 e->destType = type;
15365 if(type && type->kind != 14)
15367 struct Type * next = type->next;
15369 if(!type->refCount)
15374 if(type && type->kind != 14)
15376 if(methodType && methodType->methodClass)
15377 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);
15379 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);
15381 yylloc = oldyylloc;
15382 if(type && !type->refCount)
15387 functionType = __extension__ ({
15388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15390 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15392 if(exp->call.exp->type == 0)
15394 char * string = exp->call.exp->identifier->string;
15398 struct Symbol * symbol;
15399 struct Location oldyylloc = yylloc;
15401 yylloc = exp->call.exp->identifier->loc;
15402 if(strstr(string, "__builtin_") == string)
15406 functionType->returnType = exp->destType;
15407 exp->destType->refCount++;
15411 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15412 symbol = __extension__ ({
15413 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15415 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15417 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15418 if(strstr(symbol->string, "::"))
15419 globalContext->hasNameSpace = 0x1;
15420 yylloc = oldyylloc;
15423 else if(exp->call.exp->type == 8)
15427 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15428 if(!functionType->returnType)
15430 functionType->returnType = __extension__ ({
15431 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15433 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15437 if(functionType && functionType->kind == 11)
15439 exp->expType = functionType->returnType;
15440 if(functionType->returnType)
15441 functionType->returnType->refCount++;
15442 if(!functionType->refCount)
15443 FreeType(functionType);
15445 if(exp->call.arguments)
15447 for(e = (*exp->call.arguments).first; e; e = e->next)
15449 struct Type * destType = e->destType;
15451 ProcessExpressionType(e);
15458 struct Type * type;
15459 struct Location oldyylloc = yylloc;
15460 unsigned int thisPtr;
15461 struct Expression * checkExp = exp->member.exp;
15465 if(checkExp->type == 11)
15466 checkExp = checkExp->cast.exp;
15467 else if(checkExp->type == 5)
15468 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15472 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15473 exp->thisPtr = thisPtr;
15474 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15476 exp->member.member->classSym = exp->member.member->_class->symbol;
15478 ProcessExpressionType(exp->member.exp);
15479 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)
15481 exp->isConstant = 0x0;
15484 exp->isConstant = exp->member.exp->isConstant;
15485 type = exp->member.exp->expType;
15487 if(type && (type->kind == 20))
15489 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15490 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15494 for(param = _class->templateParams.first; param; param = param->next)
15496 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15500 if(param && param->defaultArg.member)
15502 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15506 struct Expression * expMember = exp->member.exp;
15507 struct Declarator * decl;
15508 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15509 char thisClassTypeString[1024];
15511 FreeIdentifier(exp->member.member);
15512 ProcessExpressionType(argExp);
15514 char * colon = strstr(param->defaultArg.memberString, "::");
15518 char className[1024];
15519 struct __ecereNameSpace__ecere__com__Class * sClass;
15521 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15522 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15525 strcpy(thisClassTypeString, _class->fullName);
15527 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15528 exp->expType = ProcessType(specs, decl);
15529 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15531 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15532 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15534 int paramCount = 0;
15535 int lastParam = -1;
15536 char templateString[1024];
15537 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15539 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15540 for(cClass = expClass; cClass; cClass = cClass->base)
15544 for(param = cClass->templateParams.first; param; param = param->next)
15547 struct __ecereNameSpace__ecere__com__Class * sClass;
15548 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15550 for(sClass = cClass->base; sClass; sClass = sClass->base)
15551 id += sClass->templateParams.count;
15552 arg = expClass->templateArgs[id];
15553 for(sClass = _class; sClass; sClass = sClass->base)
15555 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15557 struct __ecereNameSpace__ecere__com__Class * nextClass;
15559 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15560 p += nextClass->templateParams.count;
15561 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15563 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15565 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15567 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15568 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15575 char argument[256];
15577 argument[0] = '\0';
15578 switch(param->type)
15582 char expString[1024];
15583 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15584 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15585 struct Expression * exp;
15586 char * string = PrintHexUInt64(arg.expression.ui64);
15588 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15589 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15590 ProcessExpressionType(exp);
15591 ComputeExpression(exp);
15592 expString[0] = '\0';
15593 PrintExpression(exp, expString);
15594 strcat(argument, expString);
15595 FreeExpression(exp);
15600 strcat(argument, arg.member->name);
15605 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15607 if(!strcmp(arg.dataTypeString, "thisclass"))
15608 strcat(argument, thisClassTypeString);
15610 strcat(argument, arg.dataTypeString);
15618 strcat(templateString, ", ");
15619 if(lastParam != p - 1)
15621 strcat(templateString, param->name);
15622 strcat(templateString, " = ");
15624 strcat(templateString, argument);
15633 int len = strlen(templateString);
15635 if(templateString[len - 1] == '>')
15636 templateString[len++] = ' ';
15637 templateString[len++] = '>';
15638 templateString[len++] = '\0';
15641 struct Context * context = SetupTemplatesContext(_class);
15643 FreeType(exp->expType);
15644 exp->expType = ProcessTypeString(templateString, 0x0);
15645 FinishTemplatesContext(context);
15649 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")))))))));
15652 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15654 type = ProcessTemplateParameterType(type->templateParameter);
15657 if(type && (type->kind == 20))
15659 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)))
15661 struct Identifier * id = exp->member.member;
15662 int typeKind = type->kind;
15663 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));
15665 if(typeKind == 19 && exp->member.exp->type == 24)
15667 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15672 if(typeKind == 3 || typeKind == 15)
15673 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15676 if(type->kind == 8 && type->_class && type->_class->registered)
15678 _class = type->_class->registered;
15680 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15682 _class = FindClass("char *")->registered;
15684 else if(type->kind == 13)
15686 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15687 FreeType(exp->expType);
15688 exp->expType = ProcessTypeString("uintptr", 0x0);
15689 exp->byReference = 0x1;
15693 char string[1024] = "";
15694 struct Symbol * classSym;
15696 PrintTypeNoConst(type, string, 0x0, 0x1);
15697 classSym = FindClass(string);
15699 _class = classSym->registered;
15705 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15706 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15707 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15708 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15709 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15711 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15712 exp->member.memberType = 1;
15713 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15717 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15719 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15720 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15722 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15724 member = (((void *)0));
15726 if(!member && !prop)
15727 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15728 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15729 exp->member.thisPtr = 0x1;
15735 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15736 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15737 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15739 if(!prop && !member)
15741 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15744 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15745 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15746 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15751 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15752 prop = (((void *)0));
15754 member = (((void *)0));
15758 if(!prop && !member && !method)
15759 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15760 if(!prop && !member && !method)
15764 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15767 exp->member.memberType = 5;
15768 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15772 char structName[1024];
15773 struct Identifier * id = exp->member.member;
15774 struct Expression * classExp = exp->member.exp;
15777 FreeType(classExp->expType);
15778 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15779 strcpy(structName, "__ecereClassData_");
15780 FullClassNameCat(structName, type->_class->string, 0x0);
15782 exp->member.member = id;
15783 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"))))))));
15785 ProcessExpressionType(exp);
15791 struct Symbol * classSym = FindClass(id->string);
15795 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15798 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15804 exp->member.memberType = 1;
15805 if(!prop->dataType)
15806 ProcessPropertyType(prop);
15807 exp->expType = prop->dataType;
15809 prop->dataType->refCount++;
15813 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15815 FreeExpContents(exp);
15817 exp->identifier = MkIdentifier("class");
15818 ProcessExpressionType(exp);
15821 exp->member.memberType = 3;
15822 DeclareStruct(_class->fullName, 0x0);
15823 if(!member->dataType)
15825 struct Context * context = SetupTemplatesContext(_class);
15827 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15828 FinishTemplatesContext(context);
15830 exp->expType = member->dataType;
15831 if(member->dataType)
15832 member->dataType->refCount++;
15834 else if(revConvert)
15836 exp->member.memberType = 4;
15837 exp->expType = MkClassType(revConvert->_class->fullName);
15842 exp->member.memberType = 2;
15844 if(!method->dataType)
15845 ProcessMethodType(method);
15846 exp->expType = __extension__ ({
15847 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15849 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15851 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15852 exp->expType->usedClass = _class;
15854 else if(!classProp)
15856 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15858 FreeExpContents(exp);
15860 exp->identifier = MkIdentifier("class");
15861 FreeType(exp->expType);
15862 exp->expType = MkClassType("ecere::com::Class");
15865 yylloc = exp->member.member->loc;
15866 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15868 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15870 if(_class && exp->expType)
15872 struct __ecereNameSpace__ecere__com__Class * tClass;
15875 while(tClass && !tClass->templateClass)
15876 tClass = tClass->base;
15877 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15880 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15881 struct __ecereNameSpace__ecere__com__Class * sClass;
15883 for(sClass = tClass; sClass; sClass = sClass->base)
15886 if(sClass->templateClass)
15887 sClass = sClass->templateClass;
15888 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15890 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15892 for(sClass = sClass->base; sClass; sClass = sClass->base)
15893 id += sClass->templateParams.count;
15901 if(curParam && tClass->templateArgs[id].dataTypeString)
15903 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15904 struct Context * context = SetupTemplatesContext(tClass);
15906 FreeType(exp->expType);
15907 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15910 if(exp->expType->kind == 21)
15912 FreeType(exp->expType);
15913 exp->expType = ReplaceThisClassType(_class);
15915 if(tClass->templateClass)
15916 exp->expType->passAsTemplate = 0x1;
15919 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15920 if(exp->destType->kind == 21)
15922 FreeType(exp->destType);
15923 exp->destType = ReplaceThisClassType(_class);
15927 FinishTemplatesContext(context);
15930 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15933 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15934 struct __ecereNameSpace__ecere__com__Class * sClass;
15936 for(sClass = tClass; sClass; sClass = sClass->base)
15939 if(sClass->templateClass)
15940 sClass = sClass->templateClass;
15941 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15943 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15945 for(sClass = sClass->base; sClass; sClass = sClass->base)
15946 id += sClass->templateParams.count;
15956 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15957 struct Context * context = SetupTemplatesContext(tClass);
15958 struct Type * basicType;
15960 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15963 if(basicType->kind == 21)
15965 FreeType(basicType);
15966 basicType = ReplaceThisClassType(_class);
15968 FreeType(exp->expType);
15969 exp->expType = __extension__ ({
15970 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15972 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15976 exp->destType = exp->expType;
15977 exp->destType->refCount++;
15980 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15981 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15982 struct Declarator * decl;
15984 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15987 exp->destType->refCount++;
15989 exp->expType->refCount++;
15991 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15992 exp->cast.exp = newExp;
15995 FinishTemplatesContext(context);
15998 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16000 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16004 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16007 int paramCount = 0;
16008 int lastParam = -1;
16009 char templateString[1024];
16010 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16012 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16013 while(cClass != expClass)
16015 struct __ecereNameSpace__ecere__com__Class * sClass;
16017 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16020 for(param = cClass->templateParams.first; param; param = param->next)
16022 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16025 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16026 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16028 while(cClassCur != tClass && !paramCur)
16030 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16032 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16034 cClassCur = sClassCur;
16035 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16037 if(!strcmp(paramCur->name, param->name))
16044 if(paramCur && paramCur->type == 0)
16045 arg = tClass->templateArgs[cp];
16047 arg = expClass->templateArgs[p];
16049 char argument[256];
16051 argument[0] = '\0';
16052 switch(param->type)
16056 char expString[1024];
16057 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16058 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16059 struct Expression * exp;
16060 char * string = PrintHexUInt64(arg.expression.ui64);
16062 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16063 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16064 ProcessExpressionType(exp);
16065 ComputeExpression(exp);
16066 expString[0] = '\0';
16067 PrintExpression(exp, expString);
16068 strcat(argument, expString);
16069 FreeExpression(exp);
16074 strcat(argument, arg.member->name);
16079 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16080 strcat(argument, arg.dataTypeString);
16087 strcat(templateString, ", ");
16088 if(lastParam != p - 1)
16090 strcat(templateString, param->name);
16091 strcat(templateString, " = ");
16093 strcat(templateString, argument);
16102 int len = strlen(templateString);
16104 if(templateString[len - 1] == '>')
16105 templateString[len++] = ' ';
16106 templateString[len++] = '>';
16107 templateString[len++] = '\0';
16109 FreeType(exp->expType);
16111 struct Context * context = SetupTemplatesContext(tClass);
16113 exp->expType = ProcessTypeString(templateString, 0x0);
16114 FinishTemplatesContext(context);
16121 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)");
16123 else if(type && (type->kind == 9 || type->kind == 10))
16125 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16129 exp->expType = memberType;
16131 memberType->refCount++;
16136 char expString[10240];
16138 expString[0] = '\0';
16141 PrintExpression(exp, expString);
16142 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16144 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16146 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16148 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16150 struct Identifier * id = exp->member.member;
16151 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));
16155 FreeType(exp->expType);
16156 exp->expType = ReplaceThisClassType(_class);
16160 yylloc = oldyylloc;
16165 struct Type * destType = exp->destType;
16167 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16169 exp->member.member->classSym = exp->member.member->_class->symbol;
16171 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16175 ProcessExpressionType(exp);
16182 struct Symbol * classSym = exp->_class->symbol;
16184 if(classSym && classSym->registered)
16186 if(classSym->registered->type == 5)
16191 DeclareStruct(classSym->string, 0x0);
16192 FreeSpecifier(exp->_class);
16194 FullClassNameCat(name, classSym->string, 0x0);
16195 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16199 if(classSym->registered->fixed)
16201 FreeSpecifier(exp->_class);
16202 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16207 char className[1024];
16209 strcpy(className, "__ecereClass_");
16210 FullClassNameCat(className, classSym->string, 0x1);
16211 MangleClassName(className);
16212 DeclareClass(classSym, className);
16213 FreeExpContents(exp);
16215 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16216 exp->member.member = MkIdentifier("structSize");
16220 exp->expType = __extension__ ({
16221 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16223 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16229 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16231 exp->expType = __extension__ ({
16232 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16234 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16236 exp->isConstant = 0x1;
16237 DeclareType(type, 0x0, 0x0);
16243 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16246 FreeType(exp->cast.exp->destType);
16247 exp->cast.exp->destType = type;
16249 ProcessExpressionType(exp->cast.exp);
16251 exp->expType = type;
16252 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16254 void * prev = exp->prev, * next = exp->next;
16255 struct Type * expType = exp->cast.exp->destType;
16256 struct Expression * castExp = exp->cast.exp;
16257 struct Type * destType = exp->destType;
16260 expType->refCount++;
16261 FreeType(exp->expType);
16262 FreeTypeName(exp->cast.typeName);
16264 FreeType(exp->expType);
16265 FreeType(exp->destType);
16266 exp->expType = expType;
16267 exp->destType = destType;
16268 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16274 exp->isConstant = exp->cast.exp->isConstant;
16280 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16282 exp->expType = type;
16287 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16289 ProcessExpressionType(exp->vaArg.exp);
16290 exp->expType = type;
16295 struct Expression * e;
16297 exp->isConstant = 0x1;
16298 FreeType(exp->cond.cond->destType);
16299 exp->cond.cond->destType = MkClassType("bool");
16300 exp->cond.cond->destType->truth = 0x1;
16301 ProcessExpressionType(exp->cond.cond);
16302 if(!exp->cond.cond->isConstant)
16303 exp->isConstant = 0x0;
16304 for(e = (*exp->cond.exp).first; e; e = e->next)
16308 FreeType(e->destType);
16309 e->destType = exp->destType;
16311 e->destType->refCount++;
16313 ProcessExpressionType(e);
16316 exp->expType = e->expType;
16318 e->expType->refCount++;
16321 exp->isConstant = 0x0;
16323 FreeType(exp->cond.elseExp->destType);
16324 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16325 if(exp->cond.elseExp->destType)
16326 exp->cond.elseExp->destType->refCount++;
16327 ProcessExpressionType(exp->cond.elseExp);
16328 if(!exp->cond.elseExp->isConstant)
16329 exp->isConstant = 0x0;
16334 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16336 struct Statement * last = (*exp->compound->compound.statements).last;
16338 if(last->type == 3 && last->expressions && (*last->expressions).last)
16340 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16342 exp->destType->refCount++;
16344 ProcessStatement(exp->compound);
16345 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16347 exp->expType->refCount++;
16353 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16355 if(spec && spec->type == 1)
16357 exp->expType = MkClassType(spec->name);
16358 exp->expType->kind = 19;
16359 exp->byReference = 0x1;
16363 exp->expType = MkClassType("ecere::com::Class");
16364 exp->byReference = 0x1;
16370 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16374 struct Identifier * id = exp->classData.id;
16375 char structName[1024];
16376 struct Expression * classExp;
16378 strcpy(structName, "__ecereClassData_");
16379 FullClassNameCat(structName, _class->fullName, 0x0);
16381 exp->member.member = id;
16382 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16383 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16385 classExp = MkExpIdentifier(MkIdentifier("class"));
16386 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"))))))));
16387 ProcessExpressionType(exp);
16394 struct Type * type = (((void *)0));
16395 char * typeString = (((void *)0));
16396 char typeStringBuf[1024];
16398 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))
16400 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16402 typeString = templateClass->templateArgs[2].dataTypeString;
16406 struct Expression * e;
16408 for(e = (*exp->list).first; e; e = e->next)
16410 ProcessExpressionType(e);
16420 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16424 e->expType = (((void *)0));
16425 e = (*exp->list).first;
16426 ProcessExpressionType(e);
16429 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16431 FreeType(e->expType);
16432 e->expType = (((void *)0));
16434 type = (((void *)0));
16442 FreeType(e->expType);
16443 e->expType = (((void *)0));
16449 typeStringBuf[0] = '\0';
16450 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16451 typeString = typeStringBuf;
16453 type = (((void *)0));
16458 char templateString[1024];
16459 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16460 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16461 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16462 struct Expression * expExt;
16463 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16465 sprintf(templateString, "Container<%s>", typeString);
16468 struct Expression * e;
16470 type = ProcessTypeString(typeString, 0x0);
16471 while(e = (*exp->list).first)
16473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16474 e->destType = type;
16476 ProcessExpressionType(e);
16477 ListAdd(initializers, MkInitializerAssignment(e));
16480 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16482 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16483 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16484 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16485 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16486 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16487 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16488 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16489 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16490 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16491 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16492 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16494 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16496 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16497 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16498 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16499 exp->expType = ProcessTypeString(templateString, 0x0);
16501 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16502 ProcessExpressionType(expExt);
16506 exp->expType = ProcessTypeString("Container", 0x0);
16507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16512 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16514 FreeType(exp->expType);
16515 exp->expType = ReplaceThisClassType(thisClass);
16517 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16519 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16523 if(exp->expType->kind != 15)
16525 struct Type * member;
16526 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16528 FreeType(exp->expType);
16529 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16530 exp->expType->kind = symbol->type->kind;
16531 exp->expType->refCount++;
16532 exp->expType->enumName = enumName;
16533 exp->expType->members = symbol->type->members;
16534 for(member = symbol->type->members.first; member; member = member->next)
16535 member->refCount++;
16539 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16541 for(member = symbol->type->members.first; member; member = member->next)
16543 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16551 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16553 else if(exp->destType && !exp->destType->keepCast)
16555 if(!CheckExpressionType(exp, exp->destType, 0x0))
16557 if(!exp->destType->count || unresolved)
16562 if(exp->destType->kind != 14)
16569 char expString[10240];
16571 expString[0] = '\0';
16572 PrintType(exp->destType, type2, 0x0, 0x1);
16575 PrintExpression(exp, expString);
16576 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16580 else if(exp->type != 16)
16581 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16586 char expString[10240];
16588 expString[0] = '\0';
16591 PrintExpression(exp, expString);
16592 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16596 else if(exp->type != 16)
16597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16609 PrintType(exp->expType, type1, 0x0, 0x1);
16610 PrintType(exp->destType, type2, 0x0, 0x1);
16612 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)))
16616 char expString[10240];
16618 expString[0] = '\0';
16621 PrintExpression(exp, expString);
16622 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16624 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16625 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16626 FreeType(exp->expType);
16627 exp->destType->refCount++;
16628 exp->expType = exp->destType;
16633 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16635 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16636 char typeString[1024];
16637 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16638 struct Declarator * decl;
16640 typeString[0] = '\0';
16643 exp->expType->refCount++;
16645 exp->expType->refCount++;
16647 newExp->destType = exp->expType;
16648 PrintType(exp->expType, typeString, 0x0, 0x0);
16649 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16650 exp->cast.typeName = MkTypeName(specs, decl);
16651 exp->cast.exp = newExp;
16654 else if(unresolved)
16656 if(exp->identifier->_class && exp->identifier->_class->name)
16657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16658 else if(exp->identifier->string && exp->identifier->string[0])
16659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16661 else if(!exp->expType && exp->type != 16)
16663 char expString[10240];
16665 expString[0] = '\0';
16668 PrintExpression(exp, expString);
16669 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16671 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16674 ApplyAnyObjectLogic(exp);
16675 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)))
16677 exp->byReference = 0x1;
16679 yylloc = oldyylloc;
16682 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)
16686 *curMember = (*curMember)->next;
16687 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16689 *curMember = subMemberStack[--(*subMemberStackPos)];
16690 *curMember = (*curMember)->next;
16692 while((*curMember) && (*curMember)->isProperty)
16693 *curMember = (*curMember)->next;
16694 if(subMemberStackPos)
16696 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16698 subMemberStack[(*subMemberStackPos)++] = *curMember;
16699 *curMember = (*curMember)->members.first;
16700 while(*curMember && (*curMember)->isProperty)
16701 *curMember = (*curMember)->next;
16709 if(subMemberStackPos && *subMemberStackPos)
16711 *curMember = subMemberStack[--(*subMemberStackPos)];
16712 *curMember = (*curMember)->next;
16716 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16718 if(*curClass == _class)
16720 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16722 *curMember = (*curClass)->membersAndProperties.first;
16724 while((*curMember) && (*curMember)->isProperty)
16725 *curMember = (*curMember)->next;
16726 if(subMemberStackPos)
16728 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16730 subMemberStack[(*subMemberStackPos)++] = *curMember;
16731 *curMember = (*curMember)->members.first;
16732 while(*curMember && (*curMember)->isProperty)
16733 *curMember = (*curMember)->next;
16740 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16745 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16747 if(init->exp && !init->exp->destType)
16749 FreeType(init->exp->destType);
16750 init->exp->destType = type;
16756 ProcessExpressionType(init->exp);
16757 init->isConstant = init->exp->isConstant;
16763 struct Expression * exp = init->exp;
16764 struct Instantiation * inst = exp->instance;
16765 struct MembersInit * members;
16768 init->list = MkList();
16771 for(members = (*inst->members).first; members; members = members->next)
16773 if(members->type == 0)
16775 struct MemberInit * member;
16777 for(member = (*members->dataMembers).first; member; member = member->next)
16779 ListAdd(init->list, member->initializer);
16780 member->initializer = (((void *)0));
16785 FreeExpression(exp);
16789 struct Initializer * i;
16790 struct Type * initializerType = (((void *)0));
16791 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16792 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16793 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16794 int subMemberStackPos = 0;
16796 if(type && type->kind == 12)
16797 initializerType = Dereference(type);
16798 else if(type && (type->kind == 9 || type->kind == 10))
16799 initializerType = type->members.first;
16800 for(i = (*init->list).first; i; i = i->next)
16802 if(type && type->kind == 8 && type->_class && type->_class->registered)
16804 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16807 if(!curMember->dataType)
16808 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16809 initializerType = curMember->dataType;
16812 ProcessInitializer(i, initializerType);
16813 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16814 initializerType = initializerType->next;
16816 init->isConstant = 0x0;
16818 if(type && type->kind == 12)
16819 FreeType(initializerType);
16820 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16829 extern struct Symbol * FindType(struct Context * ctx, char * name);
16831 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16833 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16839 if(spec->specifier == THISCLASS)
16844 spec->name = ReplaceThisClass(thisClass);
16845 spec->symbol = FindClass(spec->name);
16846 ProcessSpecifier(spec, declareStruct);
16853 struct Symbol * symbol = FindType(curContext, spec->name);
16856 DeclareType(symbol->type, 0x1, 0x1);
16857 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16858 DeclareStruct(spec->name, 0x0);
16863 struct Enumerator * e;
16867 for(e = (*spec->list).first; e; e = e->next)
16870 ProcessExpressionType(e->exp);
16878 if(spec->definitions)
16880 struct ClassDef * def;
16881 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16883 ProcessClass(spec->definitions, symbol);
16890 static void ProcessDeclarator(struct Declarator * decl)
16895 if(decl->identifier->classSym)
16897 FreeSpecifier(decl->identifier->_class);
16898 decl->identifier->_class = (((void *)0));
16902 if(decl->array.exp)
16903 ProcessExpressionType(decl->array.exp);
16910 if(decl->declarator)
16911 ProcessDeclarator(decl->declarator);
16912 if(decl->type == 4)
16914 struct Identifier * id = GetDeclId(decl);
16916 if(id && id->_class)
16918 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16920 if(!decl->function.parameters)
16921 decl->function.parameters = MkList();
16922 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16923 id->_class = (((void *)0));
16925 if(decl->function.parameters)
16927 struct TypeName * param;
16929 for(param = (*decl->function.parameters).first; param; param = param->next)
16931 if(param->qualifiers && (*param->qualifiers).first)
16933 struct Specifier * spec = (*param->qualifiers).first;
16935 if(spec && spec->specifier == TYPED_OBJECT)
16937 struct Declarator * d = param->declarator;
16938 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);
16940 FreeList(param->qualifiers, FreeSpecifier);
16941 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16942 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16943 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16946 else if(spec && spec->specifier == ANY_OBJECT)
16948 struct Declarator * d = param->declarator;
16950 FreeList(param->qualifiers, FreeSpecifier);
16951 param->qualifiers = MkListOne(MkSpecifier(VOID));
16952 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16954 else if(spec->specifier == THISCLASS)
16959 spec->name = ReplaceThisClass(thisClass);
16960 spec->symbol = FindClass(spec->name);
16961 ProcessSpecifier(spec, 0x0);
16965 if(param->declarator)
16966 ProcessDeclarator(param->declarator);
16974 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16976 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16978 static void ProcessDeclaration(struct Declaration * decl)
16980 yylloc = decl->loc;
16985 unsigned int declareStruct = 0x0;
16987 if(decl->declarators)
16989 struct InitDeclarator * d;
16991 for(d = (*decl->declarators).first; d; d = d->next)
16993 struct Type * type, * subType;
16995 ProcessDeclarator(d->declarator);
16996 type = ProcessType(decl->specifiers, d->declarator);
16999 ProcessInitializer(d->initializer, type);
17000 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17002 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17004 struct Instantiation * inst = d->initializer->exp->instance;
17006 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17007 d->initializer->exp->instance = (((void *)0));
17008 if(decl->specifiers)
17009 FreeList(decl->specifiers, FreeSpecifier);
17010 FreeList(decl->declarators, FreeInitDeclarator);
17017 for(subType = type; subType; )
17019 if(subType->kind == 8)
17021 declareStruct = 0x1;
17024 else if(subType->kind == 13)
17026 else if(subType->kind == 12)
17027 subType = subType->arrayType;
17036 if(decl->specifiers)
17038 struct Specifier * s;
17040 for(s = (*decl->specifiers).first; s; s = s->next)
17042 ProcessSpecifier(s, declareStruct);
17049 ProcessInstantiationType(decl->inst);
17054 struct Specifier * spec;
17055 struct Declarator * d;
17056 unsigned int declareStruct = 0x0;
17058 if(decl->declarators)
17060 for(d = (*decl->declarators).first; d; d = d->next)
17062 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17063 struct Type * subType;
17065 ProcessDeclarator(d);
17066 for(subType = type; subType; )
17068 if(subType->kind == 8)
17070 declareStruct = 0x1;
17073 else if(subType->kind == 13)
17075 else if(subType->kind == 12)
17076 subType = subType->arrayType;
17083 if(decl->specifiers)
17085 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17086 ProcessSpecifier(spec, declareStruct);
17093 static struct FunctionDefinition * curFunction;
17095 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17097 char propName[1024], propNameM[1024];
17098 char getName[1024], setName[1024];
17099 struct __ecereNameSpace__ecere__sys__OldList * args;
17101 DeclareProperty(prop, setName, getName);
17102 strcpy(propName, "__ecereProp_");
17103 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17104 strcat(propName, "_");
17105 FullClassNameCat(propName, prop->name, 0x1);
17106 MangleClassName(propName);
17107 strcpy(propNameM, "__ecerePropM_");
17108 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17109 strcat(propNameM, "_");
17110 FullClassNameCat(propNameM, prop->name, 0x1);
17111 MangleClassName(propNameM);
17112 if(prop->isWatchable)
17115 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17116 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17117 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17119 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17120 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17121 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17125 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17126 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17127 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17129 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17130 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17131 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17133 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17134 curFunction->propSet->fireWatchersDone = 0x1;
17137 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17139 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17141 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17143 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17145 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17147 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17149 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17151 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17153 static void ProcessStatement(struct Statement * stmt)
17155 yylloc = stmt->loc;
17159 ProcessStatement(stmt->labeled.stmt);
17162 if(stmt->caseStmt.exp)
17164 FreeType(stmt->caseStmt.exp->destType);
17165 stmt->caseStmt.exp->destType = curSwitchType;
17167 curSwitchType->refCount++;
17168 ProcessExpressionType(stmt->caseStmt.exp);
17169 ComputeExpression(stmt->caseStmt.exp);
17171 if(stmt->caseStmt.stmt)
17172 ProcessStatement(stmt->caseStmt.stmt);
17176 if(stmt->compound.context)
17178 struct Declaration * decl;
17179 struct Statement * s;
17180 struct Statement * prevCompound = curCompound;
17181 struct Context * prevContext = curContext;
17183 if(!stmt->compound.isSwitch)
17184 curCompound = stmt;
17185 curContext = stmt->compound.context;
17186 if(stmt->compound.declarations)
17188 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17189 ProcessDeclaration(decl);
17191 if(stmt->compound.statements)
17193 for(s = (*stmt->compound.statements).first; s; s = s->next)
17194 ProcessStatement(s);
17196 curContext = prevContext;
17197 curCompound = prevCompound;
17203 struct Expression * exp;
17205 if(stmt->expressions)
17207 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17208 ProcessExpressionType(exp);
17214 struct Expression * exp;
17216 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17217 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17218 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17219 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17221 ProcessExpressionType(exp);
17223 if(stmt->ifStmt.stmt)
17224 ProcessStatement(stmt->ifStmt.stmt);
17225 if(stmt->ifStmt.elseStmt)
17226 ProcessStatement(stmt->ifStmt.elseStmt);
17231 struct Type * oldSwitchType = curSwitchType;
17233 if(stmt->switchStmt.exp)
17235 struct Expression * exp;
17237 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17241 ProcessExpressionType(exp);
17244 curSwitchType = exp->expType;
17247 ProcessStatement(stmt->switchStmt.stmt);
17248 curSwitchType = oldSwitchType;
17253 if(stmt->whileStmt.exp)
17255 struct Expression * exp;
17257 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17258 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17259 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17260 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17262 ProcessExpressionType(exp);
17265 if(stmt->whileStmt.stmt)
17266 ProcessStatement(stmt->whileStmt.stmt);
17271 if(stmt->doWhile.exp)
17273 struct Expression * exp;
17275 if((*stmt->doWhile.exp).last)
17277 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17278 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17279 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17281 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17283 ProcessExpressionType(exp);
17286 if(stmt->doWhile.stmt)
17287 ProcessStatement(stmt->doWhile.stmt);
17292 struct Expression * exp;
17294 if(stmt->forStmt.init)
17295 ProcessStatement(stmt->forStmt.init);
17296 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17298 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17299 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17300 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17302 if(stmt->forStmt.check)
17303 ProcessStatement(stmt->forStmt.check);
17304 if(stmt->forStmt.increment)
17306 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17307 ProcessExpressionType(exp);
17309 if(stmt->forStmt.stmt)
17310 ProcessStatement(stmt->forStmt.stmt);
17315 struct Identifier * id = stmt->forEachStmt.id;
17316 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17317 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17318 struct Statement * block = stmt->forEachStmt.stmt;
17319 char iteratorType[1024];
17320 struct Type * source;
17321 struct Expression * e;
17322 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));
17323 struct Expression * arrayExp;
17324 char * typeString = (((void *)0));
17325 int builtinCount = 0;
17327 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17331 FreeType(e->destType);
17332 e->destType = ProcessTypeString("Container", 0x0);
17334 if(!isBuiltin || e->next)
17335 ProcessExpressionType(e);
17337 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17338 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17340 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17341 struct Symbol * symbol;
17342 struct Expression * expIt = (((void *)0));
17343 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17344 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17345 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17346 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17349 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17350 stmt->compound.context->parent = curContext;
17351 curContext = stmt->compound.context;
17352 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17354 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17355 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17357 isCustomAVLTree = 0x1;
17358 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17360 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17363 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17365 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17367 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17370 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17374 struct Declarator * decl;
17375 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17377 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17378 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17379 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17383 struct Type * type = (((void *)0));
17384 char typeStringBuf[1024];
17386 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17387 if(((struct Expression *)(*exp).last)->type == 11)
17389 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17392 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17394 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)
17396 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17398 typeString = templateClass->templateArgs[2].dataTypeString;
17400 else if(arrayExp->list)
17402 struct Expression * e;
17404 for(e = (*arrayExp->list).first; e; e = e->next)
17406 ProcessExpressionType(e);
17416 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17420 e->expType = (((void *)0));
17421 e = (*arrayExp->list).first;
17422 ProcessExpressionType(e);
17425 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17427 FreeType(e->expType);
17428 e->expType = (((void *)0));
17430 type = (((void *)0));
17438 FreeType(e->expType);
17439 e->expType = (((void *)0));
17445 typeStringBuf[0] = '\0';
17446 PrintType(type, typeStringBuf, 0x0, 0x1);
17447 typeString = typeStringBuf;
17453 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17454 struct Declarator * decl;
17455 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17459 struct Expression * e;
17461 builtinCount = (*arrayExp->list).count;
17462 type = ProcessTypeString(typeString, 0x0);
17463 while(e = (*arrayExp->list).first)
17465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17466 e->destType = type;
17468 ProcessExpressionType(e);
17469 ListAdd(initializers, MkInitializerAssignment(e));
17472 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17474 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17475 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17476 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17477 FreeList(exp, FreeExpression);
17481 arrayExp->expType = ProcessTypeString("Container", 0x0);
17482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17485 else if(isLinkList && !isList)
17487 struct Declarator * decl;
17488 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17490 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17491 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17492 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17494 else if(_class->templateArgs)
17497 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17499 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17500 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17502 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17505 switch(block->type)
17508 if(block->compound.context)
17509 block->compound.context->parent = stmt->compound.context;
17512 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17513 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17514 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17515 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17518 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17519 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17522 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17523 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17526 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17527 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17530 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17531 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17534 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17535 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17541 block = MkIfStmt(filter, block, (((void *)0)));
17545 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));
17546 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17547 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17548 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17554 sprintf(count, "%d", builtinCount);
17555 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));
17556 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17557 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17558 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17560 else if(isLinkList && !isList)
17562 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17563 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17565 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17567 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));
17571 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17572 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17574 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));
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);
17582 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17584 ProcessExpressionType(expIt);
17585 if((*stmt->compound.declarations).first)
17586 ProcessDeclaration((*stmt->compound.declarations).first);
17588 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17589 ProcessStatement(stmt);
17590 curContext = stmt->compound.context->parent;
17595 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17607 struct Expression * exp;
17609 if(stmt->expressions)
17611 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17615 if(curFunction && !curFunction->type)
17616 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17617 FreeType(exp->destType);
17618 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17620 exp->destType->refCount++;
17622 ProcessExpressionType(exp);
17629 ProcessDeclaration(stmt->decl);
17634 struct AsmField * field;
17636 if(stmt->asmStmt.inputFields)
17638 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17639 if(field->expression)
17640 ProcessExpressionType(field->expression);
17642 if(stmt->asmStmt.outputFields)
17644 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17645 if(field->expression)
17646 ProcessExpressionType(field->expression);
17648 if(stmt->asmStmt.clobberedFields)
17650 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17652 if(field->expression)
17653 ProcessExpressionType(field->expression);
17660 struct PropertyWatch * propWatch;
17661 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17662 struct Expression * object = stmt->_watch.object;
17663 struct Expression * watcher = stmt->_watch.watcher;
17666 ProcessExpressionType(watcher);
17668 ProcessExpressionType(object);
17671 if(watcher || thisClass)
17673 struct External * external = curExternal;
17674 struct Context * context = curContext;
17677 stmt->expressions = MkList();
17678 curExternal = external->prev;
17679 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17681 struct ClassFunction * func;
17682 char watcherName[1024];
17683 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17684 struct External * createdExternal;
17685 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17687 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17688 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17689 if(propWatch->deleteWatch)
17690 strcat(watcherName, "_delete");
17693 struct Identifier * propID;
17695 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17697 strcat(watcherName, "_");
17698 strcat(watcherName, propID->string);
17701 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17703 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17704 ProcessClassFunctionBody(func, propWatch->compound);
17705 propWatch->compound = (((void *)0));
17706 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17707 createdExternal->symbol->idCode = external->symbol->idCode;
17708 curExternal = createdExternal;
17709 ProcessFunction(createdExternal->function);
17711 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17713 externalDecl->declaration = decl;
17714 if(decl->symbol && !decl->symbol->pointerExternal)
17715 decl->symbol->pointerExternal = externalDecl;
17717 if(propWatch->deleteWatch)
17719 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17721 ListAdd(args, CopyExpression(object));
17722 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17723 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17724 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17728 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17729 struct Identifier * propID;
17731 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17733 char propName[1024];
17734 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17738 char getName[1024], setName[1024];
17739 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17741 DeclareProperty(prop, setName, getName);
17742 strcpy(propName, "__ecereProp_");
17743 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17744 strcat(propName, "_");
17745 FullClassNameCat(propName, prop->name, 0x1);
17746 ListAdd(args, CopyExpression(object));
17747 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17748 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17749 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17750 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17760 curExternal = external;
17761 curContext = context;
17763 FreeExpression(watcher);
17765 FreeExpression(object);
17766 FreeList(watches, FreePropertyWatch);
17769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17773 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17775 ProcessStatement(propWatch->compound);
17782 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17783 struct Expression * object = stmt->_watch.object;
17784 struct __ecereNameSpace__ecere__com__Class * _class;
17787 ProcessExpressionType(object);
17790 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17793 struct Identifier * propID;
17796 stmt->expressions = MkList();
17797 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17799 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17806 for(propID = (*watches).first; propID; propID = propID->next)
17808 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17812 CreateFireWatcher(prop, object, stmt);
17815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17820 struct __ecereNameSpace__ecere__com__Property * prop;
17821 struct __ecereNameSpace__ecere__com__Class * base;
17823 for(base = _class; base; base = base->base)
17825 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17827 if(prop->isProperty && prop->isWatchable)
17829 CreateFireWatcher(prop, object, stmt);
17835 FreeExpression(object);
17836 FreeList(watches, FreeIdentifier);
17839 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17845 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17846 struct Expression * object = stmt->_watch.object;
17847 struct Expression * watcher = stmt->_watch.watcher;
17848 struct __ecereNameSpace__ecere__com__Class * _class;
17851 ProcessExpressionType(object);
17853 ProcessExpressionType(watcher);
17856 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17857 if(watcher || thisClass)
17861 struct Identifier * propID;
17864 stmt->expressions = MkList();
17867 struct __ecereNameSpace__ecere__sys__OldList * args;
17870 ListAdd(args, CopyExpression(object));
17871 ListAdd(args, MkExpConstant("0"));
17872 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17873 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17877 for(propID = (*watches).first; propID; propID = propID->next)
17879 char propName[1024];
17880 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17884 char getName[1024], setName[1024];
17885 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17887 DeclareProperty(prop, setName, getName);
17888 strcpy(propName, "__ecereProp_");
17889 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17890 strcat(propName, "_");
17891 FullClassNameCat(propName, prop->name, 0x1);
17892 MangleClassName(propName);
17893 ListAdd(args, CopyExpression(object));
17894 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17895 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17896 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17903 FreeExpression(object);
17905 FreeExpression(watcher);
17906 FreeList(watches, FreeIdentifier);
17909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17912 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17919 extern struct Expression * QBrackets(struct Expression * exp);
17921 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17923 extern struct Declarator * QMkPtrDecl(char * id);
17925 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17927 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17929 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17931 static void ProcessFunction(struct FunctionDefinition * function)
17933 struct Identifier * id = GetDeclId(function->declarator);
17934 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17935 struct Type * type = symbol ? symbol->type : (((void *)0));
17936 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17937 struct Context * oldTopContext = topContext;
17939 yylloc = function->loc;
17940 if(type && type->thisClass)
17942 struct Symbol * classSym = type->thisClass;
17943 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17944 char className[1024];
17945 char structName[1024];
17946 struct Declarator * funcDecl;
17947 struct Symbol * thisSymbol;
17948 unsigned int typedObject = 0x0;
17950 if(_class && !_class->base)
17952 _class = currentClass;
17953 if(_class && !_class->symbol)
17954 _class->symbol = FindClass(_class->fullName);
17955 classSym = _class ? _class->symbol : (((void *)0));
17958 thisClass = _class;
17959 if(inCompiler && _class)
17961 if(type->kind == 11)
17963 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17965 struct Type * param = symbol->type->params.first;
17967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17970 if(type->classObjectType != 1)
17972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17973 symbol->type->staticMethod = 0x1;
17974 symbol->type->thisClass = (((void *)0));
17975 symbol->type->extraParam = 0x0;
17978 strcpy(className, "__ecereClass_");
17979 FullClassNameCat(className, _class->fullName, 0x1);
17980 MangleClassName(className);
17981 structName[0] = (char)0;
17982 FullClassNameCat(structName, _class->fullName, 0x0);
17983 funcDecl = GetFuncDecl(function->declarator);
17986 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17988 struct TypeName * param = (*funcDecl->function.parameters).first;
17990 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17993 FreeTypeName(param);
17996 if(!function->propertyNoThis)
17998 struct TypeName * thisParam;
18000 if(type->classObjectType != 1)
18002 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18003 if(!funcDecl->function.parameters)
18004 funcDecl->function.parameters = MkList();
18005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18009 if(type->classObjectType != 1)
18011 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18012 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18014 thisParam = __extension__ ({
18015 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18017 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18023 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18025 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18027 funcDecl = GetFuncDecl(initDecl->declarator);
18030 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18032 struct TypeName * param = (*funcDecl->function.parameters).first;
18034 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18037 FreeTypeName(param);
18040 if(type->classObjectType != 1)
18042 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18044 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18046 if(!funcDecl->function.parameters)
18047 funcDecl->function.parameters = MkList();
18048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18056 if(type->classObjectType != 1)
18058 thisSymbol = __extension__ ({
18059 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18061 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18063 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18064 if(typedObject && thisSymbol->type)
18066 thisSymbol->type->classObjectType = 2;
18067 thisSymbol->type->byReference = type->byReference;
18068 thisSymbol->type->typedByReference = type->byReference;
18072 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18074 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18077 struct __ecereNameSpace__ecere__com__Class * base;
18079 for(base = _class; base && base->type != 1000; base = base->next)
18081 for(member = base->membersAndProperties.first; member; member = member->next)
18082 if(!member->isProperty)
18088 for(member = _class->membersAndProperties.first; member; member = member->next)
18089 if(!member->isProperty)
18093 char pointerName[1024];
18094 struct Declaration * decl;
18095 struct Initializer * initializer;
18096 struct Expression * exp, * bytePtr;
18098 strcpy(pointerName, "__ecerePointer_");
18099 FullClassNameCat(pointerName, _class->fullName, 0x0);
18101 char className[1024];
18103 strcpy(className, "__ecereClass_");
18104 FullClassNameCat(className, classSym->string, 0x1);
18105 MangleClassName(className);
18106 DeclareClass(classSym, className);
18108 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18113 sprintf(string, "%d", _class->offset);
18114 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18118 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18120 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18121 exp->expType = __extension__ ({
18122 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18124 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18125 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18127 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18128 }), __ecereInstance2;
18132 yylloc = function->body->loc;
18133 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18135 struct Context * prevContext = curContext;
18137 curContext = function->body->compound.context;
18138 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18139 curContext = prevContext;
18141 decl->symbol = (((void *)0));
18142 if(!function->body->compound.declarations)
18143 function->body->compound.declarations = MkList();
18144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18150 thisClass = (((void *)0));
18153 FreeSpecifier(id->_class);
18154 id->_class = (((void *)0));
18155 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18157 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18159 id = GetDeclId(initDecl->declarator);
18160 FreeSpecifier(id->_class);
18161 id->_class = (((void *)0));
18165 topContext = function->body->compound.context;
18167 struct FunctionDefinition * oldFunction = curFunction;
18169 curFunction = function;
18171 ProcessStatement(function->body);
18172 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18174 struct Statement * prevCompound = curCompound;
18175 struct Context * prevContext = curContext;
18176 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18178 if(!function->body->compound.statements)
18179 function->body->compound.statements = MkList();
18180 ListAdd(function->body->compound.statements, fireWatchers);
18181 curCompound = function->body;
18182 curContext = function->body->compound.context;
18183 ProcessStatement(fireWatchers);
18184 curContext = prevContext;
18185 curCompound = prevCompound;
18187 curFunction = oldFunction;
18189 if(function->declarator)
18191 ProcessDeclarator(function->declarator);
18193 topContext = oldTopContext;
18194 thisClass = oldThisClass;
18197 extern void FreeSymbol(struct Symbol * symbol);
18199 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18201 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18203 struct ClassDef * def;
18204 struct External * external = curExternal;
18205 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18207 for(def = definitions->first; def; def = def->next)
18211 if(def->function->declarator)
18212 curExternal = def->function->declarator->symbol->pointerExternal;
18214 curExternal = external;
18215 ProcessFunction((struct FunctionDefinition *)def->function);
18217 else if(def->type == 2)
18219 if(def->decl->type == 2)
18221 thisClass = regClass;
18222 ProcessInstantiationType(def->decl->inst);
18223 thisClass = (((void *)0));
18227 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18230 thisClass = regClass;
18231 ProcessDeclaration(def->decl);
18232 thisClass = backThisClass;
18235 else if(def->type == 1 && def->defProperties)
18237 struct MemberInit * defProperty;
18238 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);
18240 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18241 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18243 thisClass = regClass;
18244 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18245 thisClass = (((void *)0));
18247 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18248 FreeSymbol(thisSymbol);
18250 else if(def->type == 3 && def->propertyDef)
18252 struct PropertyDef * prop = def->propertyDef;
18254 thisClass = regClass;
18259 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18261 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18263 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18264 ProcessStatement(prop->setStmt);
18270 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18272 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18274 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18275 ProcessStatement(prop->getStmt);
18277 if(prop->issetStmt)
18281 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18283 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18285 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18286 ProcessStatement(prop->issetStmt);
18288 thisClass = (((void *)0));
18290 else if(def->type == 4 && def->propertyWatch)
18292 struct PropertyWatch * propertyWatch = def->propertyWatch;
18294 thisClass = regClass;
18295 if(propertyWatch->compound)
18297 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);
18299 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18300 curExternal = (((void *)0));
18301 ProcessStatement(propertyWatch->compound);
18303 thisClass = (((void *)0));
18308 void DeclareFunctionUtil(char * s)
18310 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18317 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18318 strcpy(name, "__ecereFunction_");
18319 FullClassNameCat(name, s, 0x0);
18320 DeclareFunction(function, name);
18324 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18326 void ComputeDataTypes()
18328 struct External * external;
18329 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18330 struct External * after = (((void *)0));
18332 currentClass = (((void *)0));
18333 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18334 for(external = (*ast).first; external; external = external->next)
18336 if(external->type == 1)
18338 struct Declaration * decl = external->declaration;
18342 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18346 struct InitDeclarator * initDecl = (*decls).first;
18350 struct Declarator * declarator = initDecl->declarator;
18352 if(declarator && declarator->type == 1)
18354 struct Identifier * id = declarator->identifier;
18356 if(id && id->string)
18358 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18360 external->symbol->id = -1001, external->symbol->idCode = -1001;
18370 temp->symbol = __extension__ ({
18371 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18373 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18376 curExternal = temp;
18377 DeclareFunctionUtil("eSystem_New");
18378 DeclareFunctionUtil("eSystem_New0");
18379 DeclareFunctionUtil("eSystem_Renew");
18380 DeclareFunctionUtil("eSystem_Renew0");
18381 DeclareFunctionUtil("eSystem_Delete");
18382 DeclareFunctionUtil("eClass_GetProperty");
18383 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18384 DeclareStruct("ecere::com::Class", 0x0);
18385 DeclareStruct("ecere::com::Instance", 0x0);
18386 DeclareStruct("ecere::com::Property", 0x0);
18387 DeclareStruct("ecere::com::DataMember", 0x0);
18388 DeclareStruct("ecere::com::Method", 0x0);
18389 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18390 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18392 for(external = (*ast).first; external; external = external->next)
18394 afterExternal = curExternal = external;
18395 if(external->type == 0)
18397 currentClass = external->function->_class;
18398 ProcessFunction(external->function);
18400 else if(external->type == 1)
18402 currentClass = (((void *)0));
18403 ProcessDeclaration(external->declaration);
18405 else if(external->type == 2)
18407 struct ClassDefinition * _class = external->_class;
18409 currentClass = external->symbol->registered;
18410 if(_class->definitions)
18412 ProcessClass(_class->definitions, _class->symbol);
18416 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18417 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18420 else if(external->type == 4)
18422 thisNameSpace = external->id->string;
18425 currentClass = (((void *)0));
18426 thisNameSpace = (((void *)0));
18427 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18428 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18431 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);
18433 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);
18435 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18437 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18439 struct __ecereNameSpace__ecere__com__Class * class;
18441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18467 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18468 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18469 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18470 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18471 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18472 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18473 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18474 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18475 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18476 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18477 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18478 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18479 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18480 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18481 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18482 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18483 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18484 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18485 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18486 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18487 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18488 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18489 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18490 __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);
18491 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18492 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18493 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18494 __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);
18495 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18496 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18497 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18498 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18499 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18500 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18501 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18502 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18503 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18504 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18505 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18506 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18507 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18508 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18509 __ecereClass_Conversion = class;
18510 __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);
18511 __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);
18512 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18513 __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);
18514 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18515 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18516 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18517 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18518 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18519 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18520 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18521 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18522 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18523 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18524 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18525 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18526 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18527 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18528 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18529 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18530 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18531 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18532 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18533 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18534 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18537 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)