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 const 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 const 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;
121 const char * category;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
135 } __attribute__ ((gcc_struct));
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
164 struct ClassDefinition
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList * definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
201 struct Instantiation * prev;
202 struct Instantiation * next;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList * members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char * data;
211 struct Location nameLoc;
212 struct Location insideLoc;
214 } __attribute__ ((gcc_struct));
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
220 struct Declaration * prev;
221 struct Declaration * next;
228 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList * declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
241 } __attribute__ ((gcc_struct));
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
247 struct Statement * prev;
248 struct Statement * next;
253 struct __ecereNameSpace__ecere__sys__OldList * expressions;
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
305 struct Specifier * spec;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
332 struct TypeName * prev;
333 struct TypeName * next;
335 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
336 struct Declarator * declarator;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
345 struct Initializer * prev;
346 struct Initializer * next;
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList * list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 struct Identifier * id;
356 } __attribute__ ((gcc_struct));
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
360 struct __ecereNameSpace__ecere__com__DataValue
375 } __attribute__ ((gcc_struct));
376 } __attribute__ ((gcc_struct));
378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
382 struct Expression * prev;
383 struct Expression * next;
391 struct Identifier * identifier;
392 } __attribute__ ((gcc_struct));
393 struct Statement * compound;
394 struct Instantiation * instance;
398 unsigned int intlString;
399 } __attribute__ ((gcc_struct));
400 struct __ecereNameSpace__ecere__sys__OldList * list;
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
423 struct Expression * exp;
424 struct Identifier * member;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct));
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
497 struct TemplateDatatype
499 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
500 struct Declarator * decl;
501 } __attribute__ ((gcc_struct));
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
505 struct TemplateArgument;
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
509 struct TemplateParameter
511 struct TemplateParameter * prev;
512 struct TemplateParameter * next;
515 struct Identifier * identifier;
518 struct TemplateDatatype * dataType;
520 } __attribute__ ((gcc_struct));
521 struct TemplateArgument * defaultArgument;
522 const char * dataTypeString;
523 struct Type * baseType;
524 } __attribute__ ((gcc_struct));
526 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
530 struct Specifier * prev;
531 struct Specifier * next;
539 struct ExtDecl * extDecl;
541 struct Symbol * symbol;
542 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
543 } __attribute__ ((gcc_struct));
546 struct Identifier * id;
547 struct __ecereNameSpace__ecere__sys__OldList * list;
548 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
549 struct __ecereNameSpace__ecere__sys__OldList * definitions;
550 unsigned int addNameSpace;
551 struct Context * ctx;
552 struct ExtDecl * extDeclStruct;
553 } __attribute__ ((gcc_struct));
554 struct Expression * expression;
555 struct Specifier * _class;
556 struct TemplateParameter * templateParameter;
557 } __attribute__ ((gcc_struct));
558 } __attribute__ ((gcc_struct));
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
564 struct Identifier * prev;
565 struct Identifier * next;
567 struct Symbol * classSym;
568 struct Specifier * _class;
570 struct Identifier * badID;
571 } __attribute__ ((gcc_struct));
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
577 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
581 struct Declarator * prev;
582 struct Declarator * next;
585 struct Symbol * symbol;
586 struct Declarator * declarator;
589 struct Identifier * identifier;
592 struct Expression * exp;
593 struct Expression * posExp;
594 struct Attrib * attrib;
595 } __attribute__ ((gcc_struct)) structDecl;
598 struct Expression * exp;
599 struct Specifier * enumClass;
600 } __attribute__ ((gcc_struct)) array;
603 struct __ecereNameSpace__ecere__sys__OldList * parameters;
604 } __attribute__ ((gcc_struct)) function;
607 struct Pointer * pointer;
608 } __attribute__ ((gcc_struct)) pointer;
611 struct ExtDecl * extended;
612 } __attribute__ ((gcc_struct)) extended;
613 } __attribute__ ((gcc_struct));
614 } __attribute__ ((gcc_struct));
616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
618 struct FunctionDefinition
620 struct FunctionDefinition * prev;
621 struct FunctionDefinition * next;
623 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
624 struct Declarator * declarator;
625 struct __ecereNameSpace__ecere__sys__OldList * declarations;
626 struct Statement * body;
627 struct __ecereNameSpace__ecere__com__Class * _class;
628 struct __ecereNameSpace__ecere__sys__OldList attached;
631 struct Symbol * propSet;
633 unsigned int propertyNoThis;
634 } __attribute__ ((gcc_struct));
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
644 struct External * prev;
645 struct External * next;
648 struct Symbol * symbol;
651 struct FunctionDefinition * function;
652 struct ClassDefinition * _class;
653 struct Declaration * declaration;
655 struct Identifier * id;
656 struct DBTableDef * table;
657 } __attribute__ ((gcc_struct));
659 } __attribute__ ((gcc_struct));
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
665 struct ModuleImport * prev;
666 struct ModuleImport * next;
668 struct __ecereNameSpace__ecere__sys__OldList classes;
669 struct __ecereNameSpace__ecere__sys__OldList functions;
672 } __attribute__ ((gcc_struct));
674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
678 struct ClassImport * prev;
679 struct ClassImport * next;
681 struct __ecereNameSpace__ecere__sys__OldList methods;
682 struct __ecereNameSpace__ecere__sys__OldList properties;
685 } __attribute__ ((gcc_struct));
687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
692 struct Symbol * parent;
693 struct Symbol * left;
694 struct Symbol * right;
699 struct __ecereNameSpace__ecere__com__Method * method;
700 struct __ecereNameSpace__ecere__com__Property * _property;
701 struct __ecereNameSpace__ecere__com__Class * registered;
702 } __attribute__ ((gcc_struct));
709 struct External * pointerExternal;
710 struct External * structExternal;
711 } __attribute__ ((gcc_struct));
714 struct External * externalGet;
715 struct External * externalSet;
716 struct External * externalPtr;
717 struct External * externalIsSet;
718 } __attribute__ ((gcc_struct));
721 struct External * methodExternal;
722 struct External * methodCodeExternal;
723 } __attribute__ ((gcc_struct));
724 } __attribute__ ((gcc_struct));
725 unsigned int imported;
726 unsigned int declaredStructSym;
727 struct __ecereNameSpace__ecere__com__Class * _class;
728 unsigned int declaredStruct;
729 unsigned int needConstructor;
730 unsigned int needDestructor;
731 char * constructorName;
734 char * destructorName;
735 struct ModuleImport * module;
736 struct ClassImport * _import;
737 struct Location nameLoc;
738 unsigned int isParam;
739 unsigned int isRemote;
740 unsigned int isStruct;
741 unsigned int fireWatchersDone;
743 unsigned int classData;
744 unsigned int isStatic;
746 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
747 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
748 struct Context * ctx;
750 struct Expression * propCategory;
751 } __attribute__ ((gcc_struct));
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
762 struct Symbol * _class;
765 struct __ecereNameSpace__ecere__sys__OldList members;
767 } __attribute__ ((gcc_struct));
770 struct Type * returnType;
771 struct __ecereNameSpace__ecere__sys__OldList params;
772 struct Symbol * thisClass;
773 unsigned int staticMethod;
774 struct TemplateParameter * thisClassTemplate;
775 } __attribute__ ((gcc_struct));
778 struct __ecereNameSpace__ecere__com__Method * method;
779 struct __ecereNameSpace__ecere__com__Class * methodClass;
780 struct __ecereNameSpace__ecere__com__Class * usedClass;
781 } __attribute__ ((gcc_struct));
784 struct Type * arrayType;
786 struct Expression * arraySizeExp;
787 unsigned int freeExp;
788 struct Symbol * enumClass;
789 } __attribute__ ((gcc_struct));
791 struct TemplateParameter * templateParameter;
792 } __attribute__ ((gcc_struct));
802 unsigned int isSigned : 1;
803 unsigned int constant : 1;
804 unsigned int truth : 1;
805 unsigned int byReference : 1;
806 unsigned int extraParam : 1;
807 unsigned int directClassAccess : 1;
808 unsigned int computing : 1;
809 unsigned int keepCast : 1;
810 unsigned int passAsTemplate : 1;
811 unsigned int dllExport : 1;
812 unsigned int attrStdcall : 1;
813 unsigned int declaredWithStruct : 1;
814 unsigned int typedByReference : 1;
815 unsigned int casted : 1;
816 } __attribute__ ((gcc_struct));
818 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
820 struct __ecereNameSpace__ecere__com__Class
822 struct __ecereNameSpace__ecere__com__Class * prev;
823 struct __ecereNameSpace__ecere__com__Class * next;
829 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
830 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
833 struct __ecereNameSpace__ecere__com__Class * base;
834 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
835 struct __ecereNameSpace__ecere__sys__BinaryTree members;
836 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
837 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
838 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
839 struct __ecereNameSpace__ecere__sys__OldList derivatives;
843 struct __ecereNameSpace__ecere__com__Instance * module;
844 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
845 const char * dataTypeString;
846 struct Type * dataType;
848 int defaultAlignment;
849 void (* Initialize)();
851 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
852 const char * designerClass;
853 unsigned int noExpansion;
854 const char * defaultProperty;
855 unsigned int comRedefinition;
858 unsigned int internalDecl;
860 unsigned int computeSize;
862 int destructionWatchOffset;
864 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
865 int inheritanceAccess;
866 const char * fullName;
868 struct __ecereNameSpace__ecere__sys__OldList conversions;
869 struct __ecereNameSpace__ecere__sys__OldList templateParams;
870 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
871 struct __ecereNameSpace__ecere__com__Class * templateClass;
872 struct __ecereNameSpace__ecere__sys__OldList templatized;
874 unsigned int isInstanceClass;
875 unsigned int byValueSystemClass;
876 } __attribute__ ((gcc_struct));
878 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
880 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
882 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
884 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
886 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
888 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
890 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
892 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
896 struct __ecereNameSpace__ecere__com__Instance
899 struct __ecereNameSpace__ecere__com__Class * _class;
901 } __attribute__ ((gcc_struct));
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
905 struct __ecereNameSpace__ecere__com__DataMember
907 struct __ecereNameSpace__ecere__com__DataMember * prev;
908 struct __ecereNameSpace__ecere__com__DataMember * next;
910 unsigned int isProperty;
913 struct __ecereNameSpace__ecere__com__Class * _class;
914 const char * dataTypeString;
915 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
916 struct Type * dataType;
920 struct __ecereNameSpace__ecere__sys__OldList members;
921 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
924 } __attribute__ ((gcc_struct));
926 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
928 struct __ecereNameSpace__ecere__com__SerialBuffer
930 unsigned char * _buffer;
934 } __attribute__ ((gcc_struct));
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
938 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
944 const char * dataTypeString;
945 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
946 } __attribute__ ((gcc_struct));
947 struct __ecereNameSpace__ecere__com__DataValue expression;
950 const char * memberString;
953 struct __ecereNameSpace__ecere__com__DataMember * member;
954 struct __ecereNameSpace__ecere__com__Property * prop;
955 struct __ecereNameSpace__ecere__com__Method * method;
956 } __attribute__ ((gcc_struct));
957 } __attribute__ ((gcc_struct));
958 } __attribute__ ((gcc_struct));
959 } __attribute__ ((gcc_struct));
961 void exit(int status);
963 void * calloc(size_t nmemb, size_t size);
965 void free(void * ptr);
967 void * malloc(size_t size);
969 void * realloc(void * ptr, size_t size);
971 long int strtol(const char * nptr, char ** endptr, int base);
973 long long int strtoll(const char * nptr, char ** endptr, int base);
975 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
979 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
982 typedef union YYSTYPE
987 struct Identifier * id;
988 struct Expression * exp;
989 struct Specifier * specifier;
990 struct __ecereNameSpace__ecere__sys__OldList * list;
991 struct Enumerator * enumerator;
992 struct Declarator * declarator;
993 struct Pointer * pointer;
994 struct Initializer * initializer;
995 struct InitDeclarator * initDeclarator;
996 struct TypeName * typeName;
997 struct Declaration * declaration;
998 struct Statement * stmt;
999 struct FunctionDefinition * function;
1000 struct External * external;
1001 struct Context * context;
1002 struct AsmField * asmField;
1003 struct Attrib * attrib;
1004 struct ExtDecl * extDecl;
1005 struct Attribute * attribute;
1006 struct Instantiation * instance;
1007 struct MembersInit * membersInit;
1008 struct MemberInit * memberInit;
1009 struct ClassFunction * classFunction;
1010 struct ClassDefinition * _class;
1011 struct ClassDef * classDef;
1012 struct PropertyDef * prop;
1014 struct Symbol * symbol;
1015 struct PropertyWatch * propertyWatch;
1016 struct TemplateParameter * templateParameter;
1017 struct TemplateArgument * templateArgument;
1018 struct TemplateDatatype * templateDatatype;
1019 struct DBTableEntry * dbtableEntry;
1020 struct DBIndexItem * dbindexItem;
1021 struct DBTableDef * dbtableDef;
1022 } __attribute__ ((gcc_struct)) YYSTYPE;
1024 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1028 struct Enumerator * prev;
1029 struct Enumerator * next;
1030 struct Location loc;
1031 struct Identifier * id;
1032 struct Expression * exp;
1033 } __attribute__ ((gcc_struct));
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1037 struct InitDeclarator
1039 struct InitDeclarator * prev;
1040 struct InitDeclarator * next;
1041 struct Location loc;
1042 struct Declarator * declarator;
1043 struct Initializer * initializer;
1044 } __attribute__ ((gcc_struct));
1046 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1050 struct AsmField * prev;
1051 struct AsmField * next;
1052 struct Location loc;
1054 struct Expression * expression;
1055 struct Identifier * symbolic;
1056 } __attribute__ ((gcc_struct));
1058 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1064 struct ClassFunction
1066 struct ClassFunction * prev;
1067 struct ClassFunction * next;
1068 struct Location loc;
1069 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1070 struct Declarator * declarator;
1071 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1072 struct Statement * body;
1073 struct __ecereNameSpace__ecere__com__Class * _class;
1074 struct __ecereNameSpace__ecere__sys__OldList attached;
1077 struct Symbol * propSet;
1078 unsigned int isVirtual;
1079 unsigned int isConstructor;
1080 unsigned int isDestructor;
1081 unsigned int dontMangle;
1084 } __attribute__ ((gcc_struct));
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1090 struct MembersInit * prev;
1091 struct MembersInit * next;
1092 struct Location loc;
1096 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1097 struct ClassFunction * function;
1098 } __attribute__ ((gcc_struct));
1099 } __attribute__ ((gcc_struct));
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1105 struct MemberInit * prev;
1106 struct MemberInit * next;
1107 struct Location loc;
1108 struct Location realLoc;
1109 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1110 struct Initializer * initializer;
1112 unsigned int variable;
1113 unsigned int takeOutExp;
1114 } __attribute__ ((gcc_struct));
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1120 struct PropertyDef * prev;
1121 struct PropertyDef * next;
1122 struct Location loc;
1123 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1124 struct Declarator * declarator;
1125 struct Identifier * id;
1126 struct Statement * getStmt;
1127 struct Statement * setStmt;
1128 struct Statement * issetStmt;
1129 struct Symbol * symbol;
1130 struct Expression * category;
1133 unsigned int conversion : 1;
1134 unsigned int isWatchable : 1;
1135 unsigned int isDBProp : 1;
1136 } __attribute__ ((gcc_struct));
1137 } __attribute__ ((gcc_struct));
1139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1141 struct PropertyWatch
1143 struct PropertyWatch * prev;
1144 struct PropertyWatch * next;
1145 struct Location loc;
1146 struct Statement * compound;
1147 struct __ecereNameSpace__ecere__sys__OldList * properties;
1148 unsigned int deleteWatch;
1149 } __attribute__ ((gcc_struct));
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1155 struct ClassDef * prev;
1156 struct ClassDef * next;
1157 struct Location loc;
1161 struct Declaration * decl;
1162 struct ClassFunction * function;
1163 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1164 struct PropertyDef * propertyDef;
1165 struct PropertyWatch * propertyWatch;
1167 struct Identifier * defaultProperty;
1170 struct Identifier * id;
1171 struct Initializer * initializer;
1172 } __attribute__ ((gcc_struct));
1173 } __attribute__ ((gcc_struct));
1176 } __attribute__ ((gcc_struct));
1178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1180 struct DBTableEntry;
1182 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1186 extern YYSTYPE yylval;
1188 extern struct Location yylloc;
1190 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1192 extern int returnCode;
1194 extern struct Expression * parsedExpression;
1196 extern unsigned int yydebug;
1198 void SetYydebug(unsigned int b)
1203 extern unsigned int echoOn;
1205 void resetScanner();
1209 int expression_yyparse();
1211 static struct Statement * curCompound;
1213 struct External * curExternal, * afterExternal;
1215 static struct Type * curSwitchType;
1217 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1219 struct __ecereNameSpace__ecere__com__Class * thisClass;
1221 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1226 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1231 static char * thisNameSpace;
1233 struct __ecereNameSpace__ecere__com__Class * containerClass;
1235 unsigned int thisClassParams = 0x1;
1237 unsigned int internalValueCounter;
1239 extern unsigned int outputLineNumbers;
1241 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1243 extern size_t strlen(const char * );
1245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1247 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1249 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1251 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1253 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1255 void PrintExpression(struct Expression * exp, char * string)
1258 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1260 unsigned int backOutputLineNumbers = outputLineNumbers;
1262 outputLineNumbers = 0x0;
1264 OutputExpression(exp, f);
1265 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1266 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1268 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1269 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1270 count = strlen(string);
1271 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1272 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1274 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1275 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1276 string[count] = '\0';
1277 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1278 outputLineNumbers = backOutputLineNumbers;
1282 extern struct Type * ProcessTypeString(const char * string, unsigned int staticMethod);
1284 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1286 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1288 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1290 if(!param->baseType)
1292 if(param->dataTypeString)
1293 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1295 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1297 return param->baseType;
1299 return (((void *)0));
1302 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1304 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1306 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1310 if(type1->kind == type2->kind)
1321 if(type1->passAsTemplate && !type2->passAsTemplate)
1323 return type1->isSigned != type2->isSigned;
1325 return type1->_class != type2->_class;
1327 return (type1->type && type2->type && type1->type->constant != type2->type->constant) || NeedCast(type1->type, type2->type);
1335 extern int strcmp(const char * , const char * );
1337 extern struct Context * curContext;
1339 extern struct Context * topContext;
1341 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1343 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1345 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1347 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1349 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1353 struct __ecereNameSpace__ecere__com__ClassProperty
1356 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1357 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1358 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1360 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1361 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1362 const char * dataTypeString;
1363 struct Type * dataType;
1364 unsigned int constant;
1365 } __attribute__ ((gcc_struct));
1367 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
1369 extern struct Expression * QMkExpId(const char * id);
1371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1373 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1375 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1376 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1381 const char * dataTypeString;
1383 } __attribute__ ((gcc_struct));
1384 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1386 } __attribute__ ((gcc_struct));
1388 extern struct Expression * GetTemplateArgExpByName(const char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1390 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1392 extern void FreeIdentifier(struct Identifier * id);
1394 void ProcessExpressionType(struct Expression * exp);
1396 extern struct Declarator * SpecDeclFromString(const char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1398 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1400 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1402 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1404 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1406 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1408 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1410 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
1412 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1414 if(exp->type == 0 && exp->identifier)
1416 struct Identifier * id = exp->identifier;
1417 struct Context * ctx;
1418 struct Symbol * symbol = (((void *)0));
1420 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1422 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1424 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1429 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1431 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1432 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1433 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1434 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1438 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1440 if(!prop && !method)
1441 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1442 if(!prop && !method && !member)
1444 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1446 if(prop || method || member || classProp)
1449 exp->member.member = id;
1450 exp->member.memberType = 0;
1451 exp->member.exp = QMkExpId("this");
1452 exp->addedThis = 0x1;
1454 else if(_class && _class->templateParams.first)
1456 struct __ecereNameSpace__ecere__com__Class * sClass;
1458 for(sClass = _class; sClass; sClass = sClass->base)
1460 if(sClass->templateParams.first)
1462 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1464 for(param = sClass->templateParams.first; param; param = param->next)
1466 if(param->type == 2 && !strcmp(param->name, id->string))
1468 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1472 struct Declarator * decl;
1473 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1475 FreeIdentifier(exp->member.member);
1476 ProcessExpressionType(argExp);
1477 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1478 exp->expType = ProcessType(specs, decl);
1480 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1491 extern int sprintf(char * , const char * , ...);
1493 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1495 extern char * strcat(char * , const char * );
1497 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
1499 char * PrintInt(long long result)
1503 if(result > (((int)0x7fffffff)))
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1507 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1512 char * PrintUInt(uint64 result)
1516 if(result > (0xffffffff))
1517 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1518 else if(result > (((int)0x7fffffff)))
1519 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1521 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1522 return __ecereNameSpace__ecere__sys__CopyString(temp);
1525 char * PrintInt64(long long result)
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1533 char * PrintUInt64(uint64 result)
1537 if(result > (((long long)0x7fffffffffffffffLL)))
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 char * PrintHexUInt(uint64 result)
1548 if(result > (0xffffffff))
1549 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1551 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1552 if(result > (0xffffffff))
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1557 char * PrintHexUInt64(uint64 result)
1561 if(result > (0xffffffff))
1562 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1564 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1565 return __ecereNameSpace__ecere__sys__CopyString(temp);
1568 char * PrintShort(short result)
1572 sprintf(temp, "%d", (unsigned short)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 char * PrintUShort(unsigned short result)
1580 if(result > (unsigned short)32767)
1581 sprintf(temp, "0x%X", (int)result);
1583 sprintf(temp, "%d", (int)result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 extern int isprint(int c);
1589 char * PrintChar(char result)
1593 if(result > (char)0 && isprint(result))
1594 sprintf(temp, "'%c'", result);
1595 else if(result < (char)0)
1596 sprintf(temp, "%d", (int)result);
1598 sprintf(temp, "0x%X", (unsigned char)result);
1599 return __ecereNameSpace__ecere__sys__CopyString(temp);
1602 char * PrintUChar(unsigned char result)
1606 sprintf(temp, "0x%X", result);
1607 return __ecereNameSpace__ecere__sys__CopyString(temp);
1610 extern char * strcpy(char * , const char * );
1612 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1614 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1616 extern int (* __ecereProp_float_Get_signBit)(float this);
1618 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1620 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1622 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1624 char * PrintFloat(float result)
1628 if(__ecereProp_float_Get_isInf(result))
1630 if(__ecereProp_float_Get_signBit(result))
1631 strcpy(temp, "-inf");
1633 strcpy(temp, "inf");
1635 else if(__ecereProp_float_Get_isNan(result))
1637 if(__ecereProp_float_Get_signBit(result))
1638 strcpy(temp, "-nan");
1640 strcpy(temp, "nan");
1643 sprintf(temp, "%.16ff", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1647 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1649 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1651 extern int (* __ecereProp_double_Get_signBit)(double this);
1653 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1655 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1657 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1659 char * PrintDouble(double result)
1663 if(__ecereProp_double_Get_isInf(result))
1665 if(__ecereProp_double_Get_signBit(result))
1666 strcpy(temp, "-inf");
1668 strcpy(temp, "inf");
1670 else if(__ecereProp_double_Get_isNan(result))
1672 if(__ecereProp_double_Get_signBit(result))
1673 strcpy(temp, "-nan");
1675 strcpy(temp, "nan");
1678 sprintf(temp, "%.16f", result);
1679 return __ecereNameSpace__ecere__sys__CopyString(temp);
1682 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1686 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* Neg)(struct Expression *, struct Operand *);
1692 unsigned int (* Inc)(struct Expression *, struct Operand *);
1693 unsigned int (* Dec)(struct Expression *, struct Operand *);
1694 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1706 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* Not)(struct Expression *, struct Operand *);
1712 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1721 } __attribute__ ((gcc_struct));
1723 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1729 unsigned int ptrSize;
1742 } __attribute__ ((gcc_struct));
1744 } __attribute__ ((gcc_struct));
1746 unsigned int GetOpInt(struct Operand * op2, int * value2)
1748 if(op2->kind == 3 && op2->type->isSigned)
1750 else if(op2->kind == 3)
1751 *value2 = (int)op2->ui;
1752 else if(op2->kind == 4 && op2->type->isSigned)
1753 *value2 = (int)op2->i64;
1754 else if(op2->kind == 4)
1755 *value2 = (int)op2->ui64;
1756 else if(op2->kind == 23 && op2->type->isSigned)
1757 *value2 = (int)op2->i64;
1758 else if(op2->kind == 23)
1759 *value2 = (int)op2->ui64;
1760 else if(op2->kind == 22 && op2->type->isSigned)
1761 *value2 = (int)op2->i64;
1762 else if(op2->kind == 22)
1763 *value2 = (int)op2->ui64;
1764 else if(op2->kind == 2 && op2->type->isSigned)
1765 *value2 = (int)op2->s;
1766 else if(op2->kind == 2)
1767 *value2 = (int)op2->us;
1768 else if(op2->kind == 1 && op2->type->isSigned)
1769 *value2 = (int)op2->c;
1770 else if(op2->kind == 24 || op2->kind == 1)
1771 *value2 = (int)op2->uc;
1772 else if(op2->kind == 6)
1773 *value2 = (int)op2->f;
1774 else if(op2->kind == 7)
1775 *value2 = (int)op2->d;
1776 else if(op2->kind == 13)
1777 *value2 = (int)op2->ui64;
1783 struct Operand GetOperand(struct Expression * exp);
1785 unsigned int GetInt(struct Expression * exp, int * value2)
1787 struct Operand op2 = GetOperand(exp);
1789 return GetOpInt(&op2, value2);
1792 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1794 if(op2->kind == 3 && op2->type->isSigned)
1795 *value2 = (unsigned int)op2->i;
1796 else if(op2->kind == 3)
1798 else if(op2->kind == 4 && op2->type->isSigned)
1799 *value2 = (unsigned int)op2->i64;
1800 else if(op2->kind == 4)
1801 *value2 = (unsigned int)op2->ui64;
1802 else if(op2->kind == 23 && op2->type->isSigned)
1803 *value2 = (unsigned int)op2->i64;
1804 else if(op2->kind == 23)
1805 *value2 = (unsigned int)op2->ui64;
1806 else if(op2->kind == 22 && op2->type->isSigned)
1807 *value2 = (unsigned int)op2->i64;
1808 else if(op2->kind == 22)
1809 *value2 = (unsigned int)op2->ui64;
1810 else if(op2->kind == 2 && op2->type->isSigned)
1811 *value2 = (unsigned int)op2->s;
1812 else if(op2->kind == 2)
1813 *value2 = (unsigned int)op2->us;
1814 else if(op2->kind == 1 && op2->type->isSigned)
1815 *value2 = (unsigned int)op2->c;
1816 else if(op2->kind == 24 || op2->kind == 1)
1817 *value2 = (unsigned int)op2->uc;
1818 else if(op2->kind == 6)
1819 *value2 = (unsigned int)op2->f;
1820 else if(op2->kind == 7)
1821 *value2 = (unsigned int)op2->d;
1822 else if(op2->kind == 13)
1823 *value2 = (unsigned int)op2->ui64;
1829 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1831 struct Operand op2 = GetOperand(exp);
1833 return GetOpUInt(&op2, value2);
1836 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1838 if(op2->kind == 3 && op2->type->isSigned)
1839 *value2 = (long long)op2->i;
1840 else if(op2->kind == 3)
1841 *value2 = (long long)op2->ui;
1842 else if(op2->kind == 4 && op2->type->isSigned)
1844 else if(op2->kind == 4)
1845 *value2 = (long long)op2->ui64;
1846 else if(op2->kind == 23 && op2->type->isSigned)
1848 else if(op2->kind == 23)
1849 *value2 = (long long)op2->ui64;
1850 else if(op2->kind == 22 && op2->type->isSigned)
1852 else if(op2->kind == 22)
1853 *value2 = (long long)op2->ui64;
1854 else if(op2->kind == 2 && op2->type->isSigned)
1855 *value2 = (long long)op2->s;
1856 else if(op2->kind == 2)
1857 *value2 = (long long)op2->us;
1858 else if(op2->kind == 1 && op2->type->isSigned)
1859 *value2 = (long long)op2->c;
1860 else if(op2->kind == 24 || op2->kind == 1)
1861 *value2 = (long long)op2->uc;
1862 else if(op2->kind == 6)
1863 *value2 = (long long)op2->f;
1864 else if(op2->kind == 7)
1865 *value2 = (long long)op2->d;
1866 else if(op2->kind == 13)
1867 *value2 = (long long)op2->ui64;
1873 unsigned int GetInt64(struct Expression * exp, long long * value2)
1875 struct Operand op2 = GetOperand(exp);
1877 return GetOpInt64(&op2, value2);
1880 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1882 if(op2->kind == 3 && op2->type->isSigned)
1883 *value2 = (uint64)op2->i;
1884 else if(op2->kind == 3)
1885 *value2 = (uint64)op2->ui;
1886 else if(op2->kind == 4 && op2->type->isSigned)
1887 *value2 = (uint64)op2->i64;
1888 else if(op2->kind == 4)
1889 *value2 = op2->ui64;
1890 else if(op2->kind == 23 && op2->type->isSigned)
1891 *value2 = (uint64)op2->i64;
1892 else if(op2->kind == 23)
1893 *value2 = op2->ui64;
1894 else if(op2->kind == 22 && op2->type->isSigned)
1895 *value2 = (uint64)op2->i64;
1896 else if(op2->kind == 22)
1897 *value2 = op2->ui64;
1898 else if(op2->kind == 2 && op2->type->isSigned)
1899 *value2 = (uint64)op2->s;
1900 else if(op2->kind == 2)
1901 *value2 = (uint64)op2->us;
1902 else if(op2->kind == 1 && op2->type->isSigned)
1903 *value2 = (uint64)op2->c;
1904 else if(op2->kind == 24 || op2->kind == 1)
1905 *value2 = (uint64)op2->uc;
1906 else if(op2->kind == 6)
1907 *value2 = (uint64)op2->f;
1908 else if(op2->kind == 7)
1909 *value2 = (uint64)op2->d;
1910 else if(op2->kind == 13)
1911 *value2 = op2->ui64;
1917 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1919 struct Operand op2 = GetOperand(exp);
1921 return GetOpUInt64(&op2, value2);
1924 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1926 if(op2->kind == 3 && op2->type->isSigned)
1927 *value2 = (intptr_t)op2->i;
1928 else if(op2->kind == 3)
1929 *value2 = (intptr_t)op2->ui;
1930 else if(op2->kind == 4 && op2->type->isSigned)
1931 *value2 = (intptr_t)op2->i64;
1932 else if(op2->kind == 4)
1933 *value2 = (intptr_t)op2->ui64;
1934 else if(op2->kind == 23 && op2->type->isSigned)
1935 *value2 = (intptr_t)op2->i64;
1936 else if(op2->kind == 23)
1937 *value2 = (intptr_t)op2->ui64;
1938 else if(op2->kind == 22 && op2->type->isSigned)
1939 *value2 = (intptr_t)op2->i64;
1940 else if(op2->kind == 22)
1941 *value2 = (intptr_t)op2->ui64;
1942 else if(op2->kind == 2 && op2->type->isSigned)
1943 *value2 = (intptr_t)op2->s;
1944 else if(op2->kind == 2)
1945 *value2 = (intptr_t)op2->us;
1946 else if(op2->kind == 1 && op2->type->isSigned)
1947 *value2 = (intptr_t)op2->c;
1948 else if(op2->kind == 24 || op2->kind == 1)
1949 *value2 = (intptr_t)op2->uc;
1950 else if(op2->kind == 6)
1951 *value2 = (intptr_t)op2->f;
1952 else if(op2->kind == 7)
1953 *value2 = (intptr_t)op2->d;
1954 else if(op2->kind == 13)
1955 *value2 = (intptr_t)op2->ui64;
1961 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1963 struct Operand op2 = GetOperand(exp);
1965 return GetOpIntPtr(&op2, value2);
1968 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1970 if(op2->kind == 3 && op2->type->isSigned)
1971 *value2 = (uintptr_t)op2->i;
1972 else if(op2->kind == 3)
1973 *value2 = (uintptr_t)op2->ui;
1974 else if(op2->kind == 4 && op2->type->isSigned)
1975 *value2 = (uintptr_t)op2->i64;
1976 else if(op2->kind == 4)
1977 *value2 = (uintptr_t)op2->ui64;
1978 else if(op2->kind == 23 && op2->type->isSigned)
1979 *value2 = (uintptr_t)op2->i64;
1980 else if(op2->kind == 23)
1981 *value2 = (uintptr_t)op2->ui64;
1982 else if(op2->kind == 22 && op2->type->isSigned)
1983 *value2 = (uintptr_t)op2->i64;
1984 else if(op2->kind == 22)
1985 *value2 = (uintptr_t)op2->ui64;
1986 else if(op2->kind == 2 && op2->type->isSigned)
1987 *value2 = (uintptr_t)op2->s;
1988 else if(op2->kind == 2)
1989 *value2 = (uintptr_t)op2->us;
1990 else if(op2->kind == 1 && op2->type->isSigned)
1991 *value2 = (uintptr_t)op2->c;
1992 else if(op2->kind == 24 || op2->kind == 1)
1993 *value2 = (uintptr_t)op2->uc;
1994 else if(op2->kind == 6)
1995 *value2 = (uintptr_t)op2->f;
1996 else if(op2->kind == 7)
1997 *value2 = (uintptr_t)op2->d;
1998 else if(op2->kind == 13)
1999 *value2 = (uintptr_t)op2->ui64;
2005 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2007 struct Operand op2 = GetOperand(exp);
2009 return GetOpUIntPtr(&op2, value2);
2012 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2014 if(op2->kind == 3 && op2->type->isSigned)
2015 *value2 = (ssize_t)op2->i;
2016 else if(op2->kind == 3)
2017 *value2 = (ssize_t)op2->ui;
2018 else if(op2->kind == 4 && op2->type->isSigned)
2019 *value2 = (ssize_t)op2->i64;
2020 else if(op2->kind == 4)
2021 *value2 = (ssize_t)op2->ui64;
2022 else if(op2->kind == 23 && op2->type->isSigned)
2023 *value2 = (ssize_t)op2->i64;
2024 else if(op2->kind == 23)
2025 *value2 = (ssize_t)op2->ui64;
2026 else if(op2->kind == 22 && op2->type->isSigned)
2027 *value2 = (ssize_t)op2->i64;
2028 else if(op2->kind == 22)
2029 *value2 = (ssize_t)op2->ui64;
2030 else if(op2->kind == 2 && op2->type->isSigned)
2031 *value2 = (ssize_t)op2->s;
2032 else if(op2->kind == 2)
2033 *value2 = (ssize_t)op2->us;
2034 else if(op2->kind == 1 && op2->type->isSigned)
2035 *value2 = (ssize_t)op2->c;
2036 else if(op2->kind == 24 || op2->kind == 1)
2037 *value2 = (ssize_t)op2->uc;
2038 else if(op2->kind == 6)
2039 *value2 = (ssize_t)op2->f;
2040 else if(op2->kind == 7)
2041 *value2 = (ssize_t)op2->d;
2042 else if(op2->kind == 13)
2043 *value2 = (ssize_t)op2->ui64;
2049 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2051 struct Operand op2 = GetOperand(exp);
2053 return GetOpIntSize(&op2, value2);
2056 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2058 if(op2->kind == 3 && op2->type->isSigned)
2059 *value2 = (size_t)op2->i;
2060 else if(op2->kind == 3)
2061 *value2 = (size_t)op2->ui;
2062 else if(op2->kind == 4 && op2->type->isSigned)
2063 *value2 = (size_t)op2->i64;
2064 else if(op2->kind == 4)
2065 *value2 = (size_t)op2->ui64;
2066 else if(op2->kind == 23 && op2->type->isSigned)
2067 *value2 = (size_t)op2->i64;
2068 else if(op2->kind == 23)
2069 *value2 = (size_t)op2->ui64;
2070 else if(op2->kind == 22 && op2->type->isSigned)
2071 *value2 = (size_t)op2->i64;
2072 else if(op2->kind == 22)
2073 *value2 = (size_t)op2->ui64;
2074 else if(op2->kind == 2 && op2->type->isSigned)
2075 *value2 = (size_t)op2->s;
2076 else if(op2->kind == 2)
2077 *value2 = (size_t)op2->us;
2078 else if(op2->kind == 1 && op2->type->isSigned)
2079 *value2 = (size_t)op2->c;
2080 else if(op2->kind == 24 || op2->kind == 1)
2081 *value2 = (size_t)op2->uc;
2082 else if(op2->kind == 6)
2083 *value2 = (size_t)op2->f;
2084 else if(op2->kind == 7)
2085 *value2 = (size_t)op2->d;
2086 else if(op2->kind == 13)
2087 *value2 = (size_t)op2->ui64;
2093 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2095 struct Operand op2 = GetOperand(exp);
2097 return GetOpUIntSize(&op2, value2);
2100 unsigned int GetOpShort(struct Operand * op2, short * value2)
2102 if(op2->kind == 3 && op2->type->isSigned)
2103 *value2 = (short)op2->i;
2104 else if(op2->kind == 3)
2105 *value2 = (short)op2->ui;
2106 else if(op2->kind == 4 && op2->type->isSigned)
2107 *value2 = (short)op2->i64;
2108 else if(op2->kind == 4)
2109 *value2 = (short)op2->ui64;
2110 else if(op2->kind == 23 && op2->type->isSigned)
2111 *value2 = (short)op2->i64;
2112 else if(op2->kind == 23)
2113 *value2 = (short)op2->ui64;
2114 else if(op2->kind == 22 && op2->type->isSigned)
2115 *value2 = (short)op2->i64;
2116 else if(op2->kind == 22)
2117 *value2 = (short)op2->ui64;
2118 else if(op2->kind == 2 && op2->type->isSigned)
2120 else if(op2->kind == 2)
2121 *value2 = (short)op2->us;
2122 else if(op2->kind == 1 && op2->type->isSigned)
2123 *value2 = (short)op2->c;
2124 else if(op2->kind == 24 || op2->kind == 1)
2125 *value2 = (short)op2->uc;
2126 else if(op2->kind == 6)
2127 *value2 = (short)op2->f;
2128 else if(op2->kind == 7)
2129 *value2 = (short)op2->d;
2130 else if(op2->kind == 13)
2131 *value2 = (short)op2->ui64;
2137 unsigned int GetShort(struct Expression * exp, short * value2)
2139 struct Operand op2 = GetOperand(exp);
2141 return GetOpShort(&op2, value2);
2144 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2146 if(op2->kind == 3 && op2->type->isSigned)
2147 *value2 = (unsigned short)op2->i;
2148 else if(op2->kind == 3)
2149 *value2 = (unsigned short)op2->ui;
2150 else if(op2->kind == 4 && op2->type->isSigned)
2151 *value2 = (unsigned short)op2->i64;
2152 else if(op2->kind == 4)
2153 *value2 = (unsigned short)op2->ui64;
2154 else if(op2->kind == 23 && op2->type->isSigned)
2155 *value2 = (unsigned short)op2->i64;
2156 else if(op2->kind == 23)
2157 *value2 = (unsigned short)op2->ui64;
2158 else if(op2->kind == 22 && op2->type->isSigned)
2159 *value2 = (unsigned short)op2->i64;
2160 else if(op2->kind == 22)
2161 *value2 = (unsigned short)op2->ui64;
2162 else if(op2->kind == 2 && op2->type->isSigned)
2163 *value2 = (unsigned short)op2->s;
2164 else if(op2->kind == 2)
2166 else if(op2->kind == 1 && op2->type->isSigned)
2167 *value2 = (unsigned short)op2->c;
2168 else if(op2->kind == 24 || op2->kind == 1)
2169 *value2 = (unsigned short)op2->uc;
2170 else if(op2->kind == 6)
2171 *value2 = (unsigned short)op2->f;
2172 else if(op2->kind == 7)
2173 *value2 = (unsigned short)op2->d;
2174 else if(op2->kind == 13)
2175 *value2 = (unsigned short)op2->ui64;
2181 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2183 struct Operand op2 = GetOperand(exp);
2185 return GetOpUShort(&op2, value2);
2188 unsigned int GetOpChar(struct Operand * op2, char * value2)
2190 if(op2->kind == 3 && op2->type->isSigned)
2191 *value2 = (char)op2->i;
2192 else if(op2->kind == 3)
2193 *value2 = (char)op2->ui;
2194 else if(op2->kind == 4 && op2->type->isSigned)
2195 *value2 = (char)op2->i64;
2196 else if(op2->kind == 4)
2197 *value2 = (char)op2->ui64;
2198 else if(op2->kind == 23 && op2->type->isSigned)
2199 *value2 = (char)op2->i64;
2200 else if(op2->kind == 23)
2201 *value2 = (char)op2->ui64;
2202 else if(op2->kind == 22 && op2->type->isSigned)
2203 *value2 = (char)op2->i64;
2204 else if(op2->kind == 22)
2205 *value2 = (char)op2->ui64;
2206 else if(op2->kind == 2 && op2->type->isSigned)
2207 *value2 = (char)op2->s;
2208 else if(op2->kind == 2)
2209 *value2 = (char)op2->us;
2210 else if(op2->kind == 1 && op2->type->isSigned)
2212 else if(op2->kind == 24 || op2->kind == 1)
2213 *value2 = (char)op2->uc;
2214 else if(op2->kind == 6)
2215 *value2 = (char)op2->f;
2216 else if(op2->kind == 7)
2217 *value2 = (char)op2->d;
2218 else if(op2->kind == 13)
2219 *value2 = (char)op2->ui64;
2225 unsigned int GetChar(struct Expression * exp, char * value2)
2227 struct Operand op2 = GetOperand(exp);
2229 return GetOpChar(&op2, value2);
2232 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2234 if(op2->kind == 3 && op2->type->isSigned)
2235 *value2 = (unsigned char)op2->i;
2236 else if(op2->kind == 3)
2237 *value2 = (unsigned char)op2->ui;
2238 else if(op2->kind == 4 && op2->type->isSigned)
2239 *value2 = (unsigned char)op2->i64;
2240 else if(op2->kind == 4)
2241 *value2 = (unsigned char)op2->ui64;
2242 else if(op2->kind == 23 && op2->type->isSigned)
2243 *value2 = (unsigned char)op2->i64;
2244 else if(op2->kind == 23)
2245 *value2 = (unsigned char)op2->ui64;
2246 else if(op2->kind == 22 && op2->type->isSigned)
2247 *value2 = (unsigned char)op2->i64;
2248 else if(op2->kind == 22)
2249 *value2 = (unsigned char)op2->ui64;
2250 else if(op2->kind == 2 && op2->type->isSigned)
2251 *value2 = (unsigned char)op2->s;
2252 else if(op2->kind == 2)
2253 *value2 = (unsigned char)op2->us;
2254 else if(op2->kind == 1 && op2->type->isSigned)
2255 *value2 = (unsigned char)op2->c;
2256 else if(op2->kind == 24 || op2->kind == 1)
2258 else if(op2->kind == 6)
2259 *value2 = (unsigned char)op2->f;
2260 else if(op2->kind == 7)
2261 *value2 = (unsigned char)op2->d;
2262 else if(op2->kind == 13)
2263 *value2 = (unsigned char)op2->ui64;
2269 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2271 struct Operand op2 = GetOperand(exp);
2273 return GetOpUChar(&op2, value2);
2276 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2278 if(op2->kind == 3 && op2->type->isSigned)
2279 *value2 = (float)(float)op2->i;
2280 else if(op2->kind == 3)
2281 *value2 = (float)(float)op2->ui;
2282 else if(op2->kind == 4 && op2->type->isSigned)
2283 *value2 = (float)(float)op2->i64;
2284 else if(op2->kind == 4)
2285 *value2 = (float)(float)op2->ui64;
2286 else if(op2->kind == 23 && op2->type->isSigned)
2287 *value2 = (float)(float)op2->i64;
2288 else if(op2->kind == 23)
2289 *value2 = (float)(float)op2->ui64;
2290 else if(op2->kind == 22 && op2->type->isSigned)
2291 *value2 = (float)(float)op2->i64;
2292 else if(op2->kind == 22)
2293 *value2 = (float)(float)op2->ui64;
2294 else if(op2->kind == 2 && op2->type->isSigned)
2295 *value2 = (float)(float)op2->s;
2296 else if(op2->kind == 2)
2297 *value2 = (float)(float)op2->us;
2298 else if(op2->kind == 1 && op2->type->isSigned)
2299 *value2 = (float)(float)op2->c;
2300 else if(op2->kind == 24 || op2->kind == 1)
2301 *value2 = (float)(float)op2->uc;
2302 else if(op2->kind == 6)
2303 *value2 = (float)op2->f;
2304 else if(op2->kind == 7)
2305 *value2 = (float)op2->d;
2306 else if(op2->kind == 13)
2307 *value2 = (float)(float)op2->ui64;
2313 unsigned int GetFloat(struct Expression * exp, float * value2)
2315 struct Operand op2 = GetOperand(exp);
2317 return GetOpFloat(&op2, value2);
2320 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2322 if(op2->kind == 3 && op2->type->isSigned)
2323 *value2 = (double)(double)op2->i;
2324 else if(op2->kind == 3)
2325 *value2 = (double)(double)op2->ui;
2326 else if(op2->kind == 4 && op2->type->isSigned)
2327 *value2 = (double)(double)op2->i64;
2328 else if(op2->kind == 4)
2329 *value2 = (double)(double)op2->ui64;
2330 else if(op2->kind == 23 && op2->type->isSigned)
2331 *value2 = (double)(double)op2->i64;
2332 else if(op2->kind == 23)
2333 *value2 = (double)(double)op2->ui64;
2334 else if(op2->kind == 22 && op2->type->isSigned)
2335 *value2 = (double)(double)op2->i64;
2336 else if(op2->kind == 22)
2337 *value2 = (double)(double)op2->ui64;
2338 else if(op2->kind == 2 && op2->type->isSigned)
2339 *value2 = (double)(double)op2->s;
2340 else if(op2->kind == 2)
2341 *value2 = (double)(double)op2->us;
2342 else if(op2->kind == 1 && op2->type->isSigned)
2343 *value2 = (double)(double)op2->c;
2344 else if(op2->kind == 24 || op2->kind == 1)
2345 *value2 = (double)(double)op2->uc;
2346 else if(op2->kind == 6)
2347 *value2 = (double)op2->f;
2348 else if(op2->kind == 7)
2349 *value2 = (double)op2->d;
2350 else if(op2->kind == 13)
2351 *value2 = (double)(double)op2->ui64;
2357 unsigned int GetDouble(struct Expression * exp, double * value2)
2359 struct Operand op2 = GetOperand(exp);
2361 return GetOpDouble(&op2, value2);
2364 void ComputeExpression(struct Expression * exp);
2366 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2368 extern int targetBits;
2370 int ComputeTypeSize(struct Type * type);
2372 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2374 struct __ecereNameSpace__ecere__com__BitMember
2376 struct __ecereNameSpace__ecere__com__BitMember * prev;
2377 struct __ecereNameSpace__ecere__com__BitMember * next;
2379 unsigned int isProperty;
2382 struct __ecereNameSpace__ecere__com__Class * _class;
2383 const char * dataTypeString;
2384 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2385 struct Type * dataType;
2390 } __attribute__ ((gcc_struct));
2392 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2394 struct __ecereNameSpace__ecere__sys__OldLink
2396 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2397 struct __ecereNameSpace__ecere__sys__OldLink * next;
2399 } __attribute__ ((gcc_struct));
2401 void FinishTemplatesContext(struct Context * context);
2403 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2405 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2406 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2408 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))
2410 int unionMemberOffset = 0;
2415 member->memberOffset = 0;
2416 if(targetBits < sizeof(void *) * 8)
2417 member->structAlignment = 0;
2419 else if(targetBits < sizeof(void *) * 8)
2420 _class->structAlignment = 0;
2421 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2422 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2423 if(!member && _class->destructionWatchOffset)
2424 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2426 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2428 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2430 if(!dataMember->isProperty)
2432 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2434 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2440 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2442 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2444 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2446 if(!isMember && _class->type == 2 && dataMember->dataType)
2448 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2452 ComputeTypeSize(dataMember->dataType);
2453 if(bitMember->pos == -1)
2454 bitMember->pos = _class->memberOffset;
2455 if(!bitMember->size)
2456 bitMember->size = dataMember->dataType->size * 8;
2457 _class->memberOffset = bitMember->pos + bitMember->size;
2458 for(d = 0; d < bitMember->size; d++)
2464 bitMember->mask = mask << bitMember->pos;
2466 else if(dataMember->type == 0 && dataMember->dataType)
2471 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2472 ComputeTypeSize(dataMember->dataType);
2473 if(dataMember->dataType->bitFieldCount)
2475 bitFields += dataMember->dataType->bitFieldCount;
2482 int size = (bitFields + 7) / 8;
2486 int __simpleStruct0;
2490 int __simpleStruct0;
2492 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2493 if(member->memberOffset % alignment)
2494 member->memberOffset += alignment - (member->memberOffset % alignment);
2496 dataMember->offset = member->memberOffset;
2497 if(member->type == 1)
2498 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2501 member->memberOffset += size;
2508 int __simpleStruct0;
2510 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2511 if(_class->memberOffset % alignment)
2512 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2514 dataMember->offset = _class->memberOffset;
2515 _class->memberOffset += size;
2519 size = dataMember->dataType->size;
2520 alignment = dataMember->dataType->alignment;
2524 int __simpleStruct0;
2528 int __simpleStruct0;
2530 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2531 if(member->memberOffset % alignment)
2532 member->memberOffset += alignment - (member->memberOffset % alignment);
2534 dataMember->offset = member->memberOffset;
2535 if(member->type == 1)
2536 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2539 member->memberOffset += size;
2546 int __simpleStruct0;
2548 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2549 if(_class->memberOffset % alignment)
2550 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2552 dataMember->offset = _class->memberOffset;
2553 _class->memberOffset += size;
2560 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2561 alignment = dataMember->structAlignment;
2564 int __simpleStruct0;
2568 int __simpleStruct0;
2570 if(member->memberOffset % alignment)
2571 member->memberOffset += alignment - (member->memberOffset % alignment);
2572 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2574 dataMember->offset = member->memberOffset;
2575 if(member->type == 1)
2576 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2578 member->memberOffset += dataMember->memberOffset;
2584 int __simpleStruct0;
2586 if(_class->memberOffset % alignment)
2587 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2588 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2590 dataMember->offset = _class->memberOffset;
2591 _class->memberOffset += dataMember->memberOffset;
2599 int size = (bitFields + 7) / 8;
2603 int __simpleStruct0;
2607 int __simpleStruct0;
2609 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2610 if(member->memberOffset % alignment)
2611 member->memberOffset += alignment - (member->memberOffset % alignment);
2613 if(member->type == 1)
2614 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2617 member->memberOffset += size;
2624 int __simpleStruct0;
2626 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2627 if(_class->memberOffset % alignment)
2628 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2630 _class->memberOffset += size;
2635 if(member && member->type == 1)
2637 member->memberOffset = unionMemberOffset;
2641 if(_class->type != 2)
2645 if(_class->structAlignment)
2647 if(_class->memberOffset % _class->structAlignment)
2648 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2650 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2653 struct __ecereNameSpace__ecere__com__Property * prop;
2655 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2657 if(prop->isProperty && prop->isWatchable)
2659 prop->watcherOffset = _class->structSize;
2660 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2665 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2667 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2669 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2671 if(deriv->computeSize)
2673 deriv->offset = _class->structSize;
2674 deriv->memberOffset = 0;
2675 deriv->structSize = deriv->offset;
2676 ComputeClassMembers(deriv, 0x0);
2684 FinishTemplatesContext(context);
2687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2689 struct __ecereNameSpace__ecere__com__NameSpace
2692 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2693 struct __ecereNameSpace__ecere__com__NameSpace * left;
2694 struct __ecereNameSpace__ecere__com__NameSpace * right;
2696 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2697 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2698 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2699 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2700 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2701 } __attribute__ ((gcc_struct));
2703 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2705 struct __ecereNameSpace__ecere__com__Module
2707 struct __ecereNameSpace__ecere__com__Instance * application;
2708 struct __ecereNameSpace__ecere__sys__OldList classes;
2709 struct __ecereNameSpace__ecere__sys__OldList defines;
2710 struct __ecereNameSpace__ecere__sys__OldList functions;
2711 struct __ecereNameSpace__ecere__sys__OldList modules;
2712 struct __ecereNameSpace__ecere__com__Instance * prev;
2713 struct __ecereNameSpace__ecere__com__Instance * next;
2719 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2720 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2721 } __attribute__ ((gcc_struct));
2723 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2725 struct __ecereNameSpace__ecere__com__Class * _class;
2726 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2728 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2729 ComputeModuleClasses(subModule->data);
2730 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2731 ComputeClassMembers(_class, 0x0);
2734 extern unsigned int inCompiler;
2736 extern void Compiler_Error(const char * format, ...);
2738 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
2740 int ComputeTypeSize(struct Type * type)
2742 unsigned int size = type ? type->size : 0;
2744 if(!size && type && !type->computing)
2746 type->computing = 0x1;
2750 type->alignment = size = sizeof(char);
2753 type->alignment = size = sizeof(char);
2756 type->alignment = size = sizeof(int);
2759 type->alignment = size = sizeof(long long);
2762 type->alignment = size = targetBits / 8;
2765 type->alignment = size = targetBits / 8;
2768 type->alignment = size = sizeof(long);
2771 type->alignment = size = sizeof(short);
2774 type->alignment = size = sizeof(float);
2777 type->alignment = size = sizeof(double);
2781 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2783 if(_class && _class->type == 1)
2785 ComputeClassMembers(_class, 0x0);
2786 type->alignment = _class->structAlignment;
2787 size = _class->structSize;
2788 if(type->alignment && size % type->alignment)
2789 size += type->alignment - (size % type->alignment);
2791 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2793 if(!_class->dataType)
2794 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2795 size = type->alignment = ComputeTypeSize(_class->dataType);
2798 size = type->alignment = targetBits / 8;
2803 size = type->alignment = targetBits / 8;
2806 if(type->arraySizeExp)
2808 ProcessExpressionType(type->arraySizeExp);
2809 ComputeExpression(type->arraySizeExp);
2810 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 2 && type->arraySizeExp->expType->kind != 1 && type->arraySizeExp->expType->kind != 5 && type->arraySizeExp->expType->kind != 4 && type->arraySizeExp->expType->kind != 23 && type->arraySizeExp->expType->kind != 22 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2812 struct Location oldLoc = yylloc;
2813 char expression[10240];
2815 expression[0] = '\0';
2816 type->arraySizeExp->expType = (((void *)0));
2817 yylloc = type->arraySizeExp->loc;
2819 PrintExpression(type->arraySizeExp, expression);
2820 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2823 GetInt(type->arraySizeExp, &type->arraySize);
2825 else if(type->enumClass)
2827 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2829 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2832 type->arraySize = 0;
2836 type->arraySize = 0;
2838 size = ComputeTypeSize(type->type) * type->arraySize;
2840 type->alignment = type->type->alignment;
2844 struct Type * member;
2846 for(member = type->members.first; member; member = member->next)
2848 int __simpleStruct0, __simpleStruct1;
2849 unsigned int addSize = ComputeTypeSize(member);
2851 member->offset = size;
2852 if(member->alignment && size % member->alignment)
2853 member->offset += member->alignment - (size % member->alignment);
2854 size = member->offset;
2855 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2858 if(type->alignment && size % type->alignment)
2859 size += type->alignment - (size % type->alignment);
2864 struct Type * member;
2866 for(member = type->members.first; member; member = member->next)
2868 int __simpleStruct0, __simpleStruct1;
2869 unsigned int addSize = ComputeTypeSize(member);
2871 member->offset = size;
2872 if(member->alignment && size % member->alignment)
2873 member->offset += member->alignment - (size % member->alignment);
2874 size = member->offset;
2875 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2876 size = ((size > addSize) ? size : addSize);
2878 if(type->alignment && size % type->alignment)
2879 size += type->alignment - (size % type->alignment);
2884 struct TemplateParameter * param = type->templateParameter;
2885 struct Type * baseType = ProcessTemplateParameterType(param);
2889 size = ComputeTypeSize(baseType);
2890 type->alignment = baseType->alignment;
2893 type->alignment = size = sizeof(uint64);
2898 type->alignment = size = sizeof(enum
2906 type->alignment = size = targetBits / 8;
2911 type->computing = 0x0;
2916 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2918 extern struct Identifier * MkIdentifier(const char * string);
2920 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2922 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2924 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2926 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2928 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2930 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2932 extern void FreeType(struct Type * type);
2934 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2936 extern struct Specifier * MkSpecifier(int specifier);
2938 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2940 extern struct Expression * MkExpConstant(const char * string);
2942 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)
2944 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2945 unsigned int totalSize = 0;
2946 unsigned int maxSize = 0;
2949 struct __ecereNameSpace__ecere__com__DataMember * member;
2950 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2953 *addedPadding = 0x0;
2954 if(!isMember && _class->base)
2956 maxSize = _class->structSize;
2958 if(_class->type == 1 || _class->type == 5)
2959 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2962 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2964 if(maxSize > baseSize)
2965 maxSize -= baseSize;
2971 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2973 if(!member->isProperty)
2975 switch(member->type)
2979 if(member->dataTypeString)
2981 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2982 struct Declarator * decl;
2984 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2985 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2986 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2987 if(!member->dataType)
2988 member->dataType = ProcessType(specs, decl);
2989 ReplaceThisClassSpecifiers(specs, topClass);
2991 struct Type * type = ProcessType(specs, decl);
2993 DeclareType(member->dataType, 0x0, 0x0);
2996 ComputeTypeSize(member->dataType);
2997 size = member->dataType->size;
2998 alignment = member->dataType->alignment;
3001 if(totalSize % alignment)
3002 totalSize += alignment - (totalSize % alignment);
3011 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3014 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3015 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3016 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
3017 alignment = member->structAlignment;
3020 if(totalSize % alignment)
3021 totalSize += alignment - (totalSize % alignment);
3031 unsigned int __simpleStruct0;
3033 if(topMember && topMember->type == 1)
3034 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3036 *retSize += totalSize;
3038 else if(totalSize < maxSize && _class->type != 1000)
3040 int autoPadding = 0;
3042 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3043 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3044 if(totalSize + autoPadding < maxSize)
3046 char sizeString[50];
3048 sprintf(sizeString, "%d", maxSize - totalSize);
3049 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3051 *addedPadding = 0x1;
3055 FinishTemplatesContext(context);
3056 return topMember ? topMember->memberID : _class->memberID;
3059 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3061 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3062 struct __ecereNameSpace__ecere__com__DataMember * member;
3063 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3065 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3066 DeclareMembers(_class->base, 0x0);
3067 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3069 if(!member->isProperty)
3071 switch(member->type)
3075 if(!member->dataType && member->dataTypeString)
3076 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3077 if(member->dataType)
3078 DeclareType(member->dataType, 0x0, 0x0);
3084 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3091 FinishTemplatesContext(context);
3092 return topMember ? topMember->memberID : _class->memberID;
3095 extern struct Symbol * FindClass(const char * name);
3097 extern char * strchr(const char * , int);
3099 extern void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams);
3101 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3103 extern void FreeClassDef(struct ClassDef * def);
3105 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3107 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3109 extern void MangleClassName(char * className);
3111 extern void DeclareClass(struct Symbol * classSym, const char * className);
3113 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3115 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3117 void DeclareStruct(const char * name, unsigned int skipNoHead)
3119 struct External * external = (((void *)0));
3120 struct Symbol * classSym = FindClass(name);
3122 if(!inCompiler || !classSym)
3124 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3126 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3128 struct Declaration * decl;
3129 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3130 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3131 char structName[1024];
3132 struct Specifier * spec = (((void *)0));
3134 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3135 classSym->declaring++;
3136 if(strchr(classSym->string, '<'))
3138 if(classSym->registered->templateClass)
3140 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3141 classSym->declaring--;
3145 DeclareMembers(classSym->registered, 0x0);
3146 structName[0] = (char)0;
3147 FullClassNameCat(structName, name, 0x0);
3148 if(external && external->declaration && external->declaration->specifiers)
3150 for(spec = (*external->declaration->specifiers).first; spec; spec = spec->next)
3152 if(spec->type == 3 || spec->type == 4)
3156 if(!skipNoHead && (!spec || !spec->definitions))
3158 unsigned int addedPadding = 0x0;
3160 classSym->declaredStructSym = 0x1;
3161 declarations = MkList();
3162 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3163 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3165 FreeList(declarations, FreeClassDef);
3166 declarations = (((void *)0));
3169 if(skipNoHead || declarations)
3174 spec->definitions = declarations;
3175 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3177 if(classSym->structExternal)
3178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3179 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3180 classSym->id = curExternal->symbol->idCode;
3181 classSym->idCode = curExternal->symbol->idCode;
3187 external = MkExternalDeclaration((((void *)0)));
3188 specifiers = MkList();
3189 declarators = MkList();
3190 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3191 external->declaration = decl = MkDeclaration(specifiers, declarators);
3192 if(decl->symbol && !decl->symbol->pointerExternal)
3193 decl->symbol->pointerExternal = external;
3194 if(classSym->registered && classSym->registered->type == 1)
3196 char className[1024];
3198 strcpy(className, "__ecereClass_");
3199 FullClassNameCat(className, classSym->string, 0x1);
3200 MangleClassName(className);
3201 DeclareClass(classSym, className);
3202 external->symbol = classSym;
3203 classSym->pointerExternal = external;
3204 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3205 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3209 char className[1024];
3211 strcpy(className, "__ecereClass_");
3212 FullClassNameCat(className, classSym->string, 0x1);
3213 MangleClassName(className);
3214 classSym->structExternal = external;
3215 DeclareClass(classSym, className);
3216 external->symbol = classSym;
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3221 classSym->declaring--;
3223 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3225 classSym->declaring++;
3227 if(classSym->registered)
3228 DeclareMembers(classSym->registered, 0x0);
3230 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3232 if(classSym->structExternal)
3233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3235 classSym->id = curExternal->symbol->idCode;
3236 classSym->idCode = curExternal->symbol->idCode;
3238 classSym->declaring--;
3242 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3244 extern struct ModuleImport * mainModule;
3246 extern struct Specifier * MkSpecifierName(const char * name);
3248 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3250 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3252 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3254 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3256 extern void FreeDeclarator(struct Declarator * decl);
3258 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3260 struct PropertyImport
3262 struct PropertyImport * prev;
3263 struct PropertyImport * next;
3265 unsigned int isVirtual;
3266 unsigned int hasSet;
3267 unsigned int hasGet;
3268 } __attribute__ ((gcc_struct));
3270 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3272 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3274 struct Symbol * symbol = prop->symbol;
3275 char propName[1024];
3277 strcpy(setName, "__ecereProp_");
3278 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3279 strcat(setName, "_Set_");
3280 FullClassNameCat(setName, prop->name, 0x1);
3281 strcpy(getName, "__ecereProp_");
3282 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3283 strcat(getName, "_Get_");
3284 FullClassNameCat(getName, prop->name, 0x1);
3285 strcpy(propName, "__ecereProp_");
3286 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3287 strcat(propName, "_");
3288 FullClassNameCat(propName, prop->name, 0x1);
3289 MangleClassName(getName);
3290 MangleClassName(setName);
3291 MangleClassName(propName);
3292 if(prop->_class->type == 1)
3293 DeclareStruct(prop->_class->fullName, 0x0);
3294 if(!symbol || curExternal->symbol->idCode < symbol->id)
3296 unsigned int imported = 0x0;
3297 unsigned int dllImport = 0x0;
3299 if(!symbol || symbol->_import)
3303 struct Symbol * classSym;
3305 if(!prop->_class->symbol)
3306 prop->_class->symbol = FindClass(prop->_class->fullName);
3307 classSym = prop->_class->symbol;
3308 if(classSym && !classSym->_import)
3310 struct ModuleImport * module;
3312 if(prop->_class->module)
3313 module = FindModule(prop->_class->module);
3315 module = mainModule;
3316 classSym->_import = __extension__ ({
3317 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3319 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3323 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3324 symbol->_import = (struct ClassImport *)__extension__ ({
3325 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3327 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3330 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3333 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)
3338 struct Context * context = SetupTemplatesContext(prop->_class);
3340 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3341 FinishTemplatesContext(context);
3345 if(!symbol->externalGet || symbol->externalGet->type == 0)
3347 struct Declaration * decl;
3348 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3349 struct Declarator * d;
3350 struct __ecereNameSpace__ecere__sys__OldList * params;
3351 struct Specifier * spec;
3352 struct External * external;
3353 struct Declarator * typeDecl;
3354 unsigned int simple = 0x0;
3356 specifiers = MkList();
3357 declarators = MkList();
3359 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3360 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3362 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3364 struct Context * context = SetupTemplatesContext(prop->_class);
3366 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3367 FinishTemplatesContext(context);
3369 for(spec = (*specifiers).first; spec; spec = spec->next)
3373 if((!typeDecl || typeDecl->type == 1))
3375 struct Symbol * classSym = spec->symbol;
3377 symbol->_class = classSym->registered;
3378 if(classSym->registered && classSym->registered->type == 1)
3380 DeclareStruct(spec->name, 0x0);
3387 d = PlugDeclarator(typeDecl, d);
3390 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3391 specifiers = MkList();
3393 d = MkDeclaratorFunction(d, params);
3395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3396 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3399 ListAdd(specifiers, MkSpecifier(VOID));
3400 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3401 decl = MkDeclaration(specifiers, declarators);
3402 external = MkExternalDeclaration(decl);
3403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3404 external->symbol = symbol;
3405 symbol->externalGet = external;
3406 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3408 FreeDeclarator(typeDecl);
3412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3417 if(!symbol->externalSet || symbol->externalSet->type == 0)
3419 struct Declaration * decl;
3420 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3421 struct Declarator * d;
3422 struct __ecereNameSpace__ecere__sys__OldList * params;
3423 struct Specifier * spec;
3424 struct External * external;
3425 struct Declarator * typeDecl;
3427 declarators = MkList();
3429 if(!prop->conversion || prop->_class->type == 1)
3431 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3433 specifiers = MkList();
3435 struct Context * context = SetupTemplatesContext(prop->_class);
3437 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3438 FinishTemplatesContext(context);
3440 ListAdd(params, MkTypeName(specifiers, d));
3441 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3443 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3444 d = MkDeclaratorFunction(d, params);
3445 for(spec = (*specifiers).first; spec; spec = spec->next)
3449 if((!typeDecl || typeDecl->type == 1))
3451 struct Symbol * classSym = spec->symbol;
3453 symbol->_class = classSym->registered;
3454 if(classSym->registered && classSym->registered->type == 1)
3455 DeclareStruct(spec->name, 0x0);
3459 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3460 specifiers = MkList();
3462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3463 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3465 if(!prop->conversion || prop->_class->type == 1)
3466 ListAdd(specifiers, MkSpecifier(VOID));
3468 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3469 decl = MkDeclaration(specifiers, declarators);
3470 external = MkExternalDeclaration(decl);
3471 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3472 external->symbol = symbol;
3473 symbol->externalSet = external;
3474 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3478 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3481 if(!symbol->externalPtr)
3483 struct Declaration * decl;
3484 struct External * external;
3485 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3488 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3490 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3491 ListAdd(specifiers, MkSpecifierName("Property"));
3493 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3495 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3498 strcpy(propName, "__ecerePropM_");
3499 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3500 strcat(propName, "_");
3501 FullClassNameCat(propName, prop->name, 0x1);
3502 MangleClassName(propName);
3503 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3505 decl = MkDeclaration(specifiers, list);
3507 external = MkExternalDeclaration(decl);
3508 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3509 external->symbol = symbol;
3510 symbol->externalPtr = external;
3514 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3516 symbol->id = curExternal->symbol->idCode;
3520 struct Type * Dereference(struct Type * source)
3522 struct Type * type = (((void *)0));
3526 if(source->kind == 13 || source->kind == 12)
3528 type = source->type;
3529 source->type->refCount++;
3531 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3533 type = __extension__ ({
3534 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3536 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3539 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3545 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3550 static struct Type * Reference(struct Type * source)
3552 struct Type * type = (((void *)0));
3556 type = __extension__ ({
3557 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3559 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3566 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);
3568 extern void * memcpy(void * , const void * , size_t size);
3570 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3572 extern void FreeExpression(struct Expression * exp);
3574 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3576 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, unsigned int warnConst);
3578 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3580 extern struct Type * MkClassType(const char * name);
3582 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
3584 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)
3586 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3587 unsigned int found = 0x0;
3588 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3589 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3590 unsigned int freeType = 0x0;
3592 yylloc = member->loc;
3597 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3601 dataMember = *curMember;
3607 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3608 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3609 int _subMemberStackPos = 0;
3612 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3615 dataMember = thisMember;
3616 if(curMember && thisMember->memberAccess == 1)
3618 *curMember = thisMember;
3619 *curClass = thisMember->_class;
3620 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3621 *subMemberStackPos = _subMemberStackPos;
3627 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3628 if(method && method->type == 1)
3631 method = (((void *)0));
3636 struct Type * type = (((void *)0));
3640 if(!dataMember->dataType && dataMember->dataTypeString)
3642 struct Context * context = SetupTemplatesContext(_class);
3644 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3645 FinishTemplatesContext(context);
3647 type = dataMember->dataType;
3651 if(!method->dataType)
3652 ProcessMethodType(method);
3653 type = method->dataType;
3655 if(ident && ident->next)
3657 for(ident = ident->next; ident && type; ident = ident->next)
3661 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3663 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3665 type = dataMember->dataType;
3667 else if(type->kind == 9 || type->kind == 10)
3669 struct Type * memberType;
3671 for(memberType = type->members.first; memberType; memberType = memberType->next)
3673 if(!strcmp(memberType->name, ident->string))
3682 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3685 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3686 struct __ecereNameSpace__ecere__com__Class * sClass;
3688 for(sClass = _class; sClass; sClass = sClass->base)
3691 if(sClass->templateClass)
3692 sClass = sClass->templateClass;
3693 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3695 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3697 for(sClass = sClass->base; sClass; sClass = sClass->base)
3699 if(sClass->templateClass)
3700 sClass = sClass->templateClass;
3701 id += sClass->templateParams.count;
3712 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3714 if(arg.dataTypeString)
3716 unsigned int constant = type->constant;
3718 type = ProcessTypeString(arg.dataTypeString, 0x0);
3719 if(type->kind == 8 && constant)
3720 type->constant = 0x1;
3721 else if(type->kind == 13)
3723 struct Type * t = type->type;
3725 while(t->kind == 13)
3728 t->constant = constant;
3731 if(type && _class->templateClass)
3732 type->passAsTemplate = 0x1;
3739 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3741 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3742 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3746 char templateString[1024];
3747 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3749 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3750 for(cClass = expClass; cClass; cClass = cClass->base)
3754 if(cClass->templateClass)
3755 cClass = cClass->templateClass;
3756 for(param = cClass->templateParams.first; param; param = param->next)
3759 struct __ecereNameSpace__ecere__com__Class * sClass;
3760 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3762 for(sClass = cClass->base; sClass; sClass = sClass->base)
3764 if(sClass->templateClass)
3765 sClass = sClass->templateClass;
3766 id += sClass->templateParams.count;
3768 arg = expClass->templateArgs[id];
3769 for(sClass = _class; sClass; sClass = sClass->base)
3771 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3773 struct __ecereNameSpace__ecere__com__Class * nextClass;
3775 if(sClass->templateClass)
3776 sClass = sClass->templateClass;
3777 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3779 if(nextClass->templateClass)
3780 nextClass = nextClass->templateClass;
3781 p += nextClass->templateParams.count;
3783 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3785 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3787 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3789 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3790 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3804 char expString[1024];
3805 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3806 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3807 struct Expression * exp;
3808 char * string = PrintHexUInt64(arg.expression.ui64);
3810 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3811 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3812 ProcessExpressionType(exp);
3813 ComputeExpression(exp);
3814 expString[0] = '\0';
3815 PrintExpression(exp, expString);
3816 strcat(argument, expString);
3817 FreeExpression(exp);
3822 strcat(argument, arg.member->name);
3827 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3828 strcat(argument, arg.dataTypeString);
3835 strcat(templateString, ", ");
3836 if(lastParam != p - 1)
3838 strcat(templateString, param->name);
3839 strcat(templateString, " = ");
3841 strcat(templateString, argument);
3850 int len = strlen(templateString);
3852 if(templateString[len - 1] == '<')
3856 if(templateString[len - 1] == '>')
3857 templateString[len++] = ' ';
3858 templateString[len++] = '>';
3860 templateString[len++] = '\0';
3863 struct Context * context = SetupTemplatesContext(_class);
3867 type = ProcessTypeString(templateString, 0x0);
3869 FinishTemplatesContext(context);
3872 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3874 ProcessExpressionType(member->initializer->exp);
3875 if(!member->initializer->exp->expType)
3879 char expString[10240];
3881 expString[0] = '\0';
3882 PrintExpression(member->initializer->exp, expString);
3883 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3887 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0, 0x1))
3889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3892 else if(member->initializer)
3894 ProcessInitializer(member->initializer, type);
3901 if(_class && _class->type == 3)
3903 if(member->initializer)
3905 struct Type * type = MkClassType(_class->fullName);
3907 ProcessInitializer(member->initializer, type);
3913 if(member->initializer)
3915 ProcessInitializer(member->initializer, (((void *)0)));
3921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3925 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3927 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3936 extern struct Identifier * GetDeclId(struct Declarator * decl);
3938 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);
3940 extern void FreeSpecifier(struct Specifier * spec);
3942 static void ProcessFunction(struct FunctionDefinition * function);
3944 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3946 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3948 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3950 extern void FreeClassFunction(struct ClassFunction * func);
3952 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3954 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3956 void ProcessInstantiationType(struct Instantiation * inst)
3961 struct MembersInit * members;
3962 struct Symbol * classSym;
3963 struct __ecereNameSpace__ecere__com__Class * _class;
3965 classSym = inst->_class->symbol;
3966 _class = classSym ? classSym->registered : (((void *)0));
3967 if(!_class || _class->type != 5)
3968 DeclareStruct(inst->_class->name, 0x0);
3969 afterExternal = afterExternal ? afterExternal : curExternal;
3971 ProcessExpressionType(inst->exp);
3972 inst->isConstant = 0x1;
3975 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3976 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3977 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3978 int subMemberStackPos = 0;
3980 for(members = (*inst->members).first; members; members = members->next)
3982 switch(members->type)
3987 static unsigned int instMethodID = 0;
3988 struct External * external = curExternal;
3989 struct Context * context = curContext;
3990 struct Declarator * declarator = members->function->declarator;
3991 struct Identifier * nameID = GetDeclId(declarator);
3992 char * unmangled = nameID ? nameID->string : (((void *)0));
3993 struct Expression * exp;
3994 struct External * createdExternal = (((void *)0));
4000 strcpy(name, "__ecereInstMeth_");
4001 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
4003 strcat(name, nameID->string);
4005 sprintf(number, "_%08d", instMethodID++);
4006 strcat(name, number);
4007 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
4011 struct Symbol * symbol = declarator->symbol;
4012 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4014 if(method && method->type == 1)
4016 symbol->method = method;
4017 ProcessMethodType(method);
4018 if(!symbol->type->thisClass)
4020 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
4022 if(!currentClass->symbol)
4023 currentClass->symbol = FindClass(currentClass->fullName);
4024 symbol->type->thisClass = currentClass->symbol;
4029 _class->symbol = FindClass(_class->fullName);
4030 symbol->type->thisClass = _class->symbol;
4033 DeclareType(symbol->type, 0x1, 0x1);
4037 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4040 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4043 FreeSpecifier(nameID->_class);
4044 nameID->_class = (((void *)0));
4048 struct External * oldExternal = curExternal;
4050 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4052 struct External * externalDecl;
4054 externalDecl = MkExternalDeclaration((((void *)0)));
4055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4056 if(createdExternal->function)
4058 ProcessFunction(createdExternal->function);
4060 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4062 externalDecl->declaration = decl;
4063 if(decl->symbol && !decl->symbol->pointerExternal)
4064 decl->symbol->pointerExternal = externalDecl;
4065 declarator->symbol->pointerExternal = externalDecl;
4072 curExternal = declarator->symbol->pointerExternal;
4073 ProcessFunction((struct FunctionDefinition *)members->function);
4075 curExternal = external;
4076 curContext = context;
4079 FreeClassFunction(members->function);
4080 exp = QMkExpId(name);
4082 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4083 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4089 if(members->dataMembers && classSym)
4091 struct MemberInit * member;
4092 struct Location oldyyloc = yylloc;
4094 for(member = (*members->dataMembers).first; member; member = member->next)
4096 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4097 if(member->initializer && !member->initializer->isConstant)
4098 inst->isConstant = 0x0;
4110 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4114 if(type->kind == 11)
4116 struct Type * param;
4120 for(param = type->params.first; param; param = param->next)
4121 DeclareType(param, declarePointers, 0x1);
4123 DeclareType(type->returnType, declarePointers, 0x1);
4125 else if(type->kind == 13 && declarePointers)
4126 DeclareType(type->type, declarePointers, 0x0);
4127 else if(type->kind == 8)
4129 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4130 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4132 else if(type->kind == 9 || type->kind == 10)
4134 struct Type * member;
4136 for(member = type->members.first; member; member = member->next)
4137 DeclareType(member, 0x0, 0x0);
4139 else if(type->kind == 12)
4140 DeclareType(type->arrayType, declarePointers, 0x0);
4144 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
4146 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4148 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4150 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4151 struct __ecereNameSpace__ecere__com__Class * sClass;
4153 for(sClass = _class; sClass; sClass = sClass->base)
4156 if(sClass->templateClass)
4157 sClass = sClass->templateClass;
4158 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4160 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4162 for(sClass = sClass->base; sClass; sClass = sClass->base)
4164 if(sClass->templateClass)
4165 sClass = sClass->templateClass;
4166 id += sClass->templateParams.count;
4177 arg = &_class->templateArgs[id];
4178 if(arg && param->type == 0)
4179 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4184 extern struct Context * PushContext(void);
4186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4188 struct TemplatedType
4191 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4192 struct __ecereNameSpace__ecere__sys__BTNode * left;
4193 struct __ecereNameSpace__ecere__sys__BTNode * right;
4195 struct TemplateParameter * param;
4196 } __attribute__ ((gcc_struct));
4198 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4200 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4202 struct Context * context = PushContext();
4204 context->templateTypesOnly = 0x1;
4205 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4207 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4209 for(; param; param = param->next)
4211 if(param->type == 0 && param->identifier)
4213 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4215 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4221 struct __ecereNameSpace__ecere__com__Class * sClass;
4223 for(sClass = _class; sClass; sClass = sClass->base)
4225 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4227 for(p = sClass->templateParams.first; p; p = p->next)
4231 struct TemplateParameter * param = p->param;
4232 struct TemplatedType * type;
4236 p->param = param = __extension__ ({
4237 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4239 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4242 type = __extension__ ({
4243 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4245 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4247 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4255 extern void PopContext(struct Context * ctx);
4257 extern void FreeContext(struct Context * context);
4259 void FinishTemplatesContext(struct Context * context)
4261 PopContext(context);
4262 FreeContext(context);
4263 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4266 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4268 if(!method->dataType)
4270 struct Context * context = SetupTemplatesContext(method->_class);
4272 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4273 FinishTemplatesContext(context);
4274 if(method->type != 1 && method->dataType)
4276 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4278 if(!method->_class->symbol)
4279 method->_class->symbol = FindClass(method->_class->fullName);
4280 method->dataType->thisClass = method->_class->symbol;
4286 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4290 struct Context * context = SetupTemplatesContext(prop->_class);
4292 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4293 FinishTemplatesContext(context);
4297 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4299 extern void FreeTypeName(struct TypeName * typeName);
4301 static void ProcessDeclarator(struct Declarator * decl);
4303 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4305 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4309 struct MethodImport * prev;
4310 struct MethodImport * next;
4312 unsigned int isVirtual;
4313 } __attribute__ ((gcc_struct));
4315 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4317 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, const char * name)
4319 struct Symbol * symbol = method->symbol;
4321 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4323 unsigned int imported = 0x0;
4324 unsigned int dllImport = 0x0;
4326 if(!method->dataType)
4327 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4328 if(!symbol || symbol->_import || method->type == 1)
4330 if(!symbol || method->type == 1)
4332 struct Symbol * classSym;
4334 if(!method->_class->symbol)
4335 method->_class->symbol = FindClass(method->_class->fullName);
4336 classSym = method->_class->symbol;
4337 if(!classSym->_import)
4339 struct ModuleImport * module;
4341 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4342 module = FindModule(method->_class->module);
4344 module = mainModule;
4345 classSym->_import = __extension__ ({
4346 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4348 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4354 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4356 if(!symbol->_import)
4358 symbol->_import = (struct ClassImport *)__extension__ ({
4359 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4361 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4363 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4367 symbol->type = method->dataType;
4369 symbol->type->refCount++;
4372 if(!method->dataType->dllExport)
4375 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)
4379 if(method->type != 1 && method->dataType)
4380 DeclareType(method->dataType, 0x1, 0x1);
4381 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4383 struct Declaration * decl;
4384 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4385 struct Declarator * d;
4386 struct Declarator * funcDecl;
4387 struct External * external;
4389 specifiers = MkList();
4390 declarators = MkList();
4392 ListAdd(specifiers, MkSpecifier(EXTERN));
4393 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4394 ListAdd(specifiers, MkSpecifier(STATIC));
4395 if(method->type == 1)
4397 ListAdd(specifiers, MkSpecifier(INT));
4398 d = MkDeclaratorIdentifier(MkIdentifier(name));
4402 d = MkDeclaratorIdentifier(MkIdentifier(name));
4404 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4406 struct Context * context = SetupTemplatesContext(method->_class);
4408 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4409 FinishTemplatesContext(context);
4411 funcDecl = GetFuncDecl(d);
4414 struct Specifier * spec, * next;
4416 for(spec = (*specifiers).first; spec; spec = next)
4421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4422 FreeSpecifier(spec);
4426 if(method->dataType && !method->dataType->staticMethod)
4428 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4430 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4431 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")));
4432 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4433 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4435 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4437 struct TypeName * param = (*funcDecl->function.parameters).first;
4439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4440 FreeTypeName(param);
4442 if(!funcDecl->function.parameters)
4443 funcDecl->function.parameters = MkList();
4444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4448 ProcessDeclarator(d);
4449 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4450 decl = MkDeclaration(specifiers, declarators);
4451 ReplaceThisClassSpecifiers(specifiers, method->_class);
4452 if(symbol->pointerExternal)
4454 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4457 *functionSymbol = *symbol;
4458 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4459 if(functionSymbol->type)
4460 functionSymbol->type->refCount++;
4462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4463 symbol->pointerExternal->symbol = functionSymbol;
4465 external = MkExternalDeclaration(decl);
4467 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4468 external->symbol = symbol;
4469 symbol->pointerExternal = external;
4473 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4475 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4479 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4481 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4483 unsigned int first = 0x1;
4485 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4487 char className[1024];
4489 strcpy(className, _class->fullName);
4490 for(param = _class->templateParams.first; param; param = param->next)
4494 strcat(className, "<");
4496 strcat(className, ", ");
4497 if(lastParam + 1 != p)
4499 strcat(className, param->name);
4500 strcat(className, " = ");
4502 strcat(className, param->name);
4510 int len = strlen(className);
4512 if(className[len - 1] == '>')
4513 className[len++] = ' ';
4514 className[len++] = '>';
4515 className[len++] = '\0';
4517 return __ecereNameSpace__ecere__sys__CopyString(className);
4520 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4523 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4525 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4527 unsigned int first = 0x1;
4529 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4531 char className[1024];
4533 strcpy(className, _class->fullName);
4534 for(param = _class->templateParams.first; param; param = param->next)
4538 strcat(className, "<");
4540 strcat(className, ", ");
4541 if(lastParam + 1 != p)
4543 strcat(className, param->name);
4544 strcat(className, " = ");
4546 strcat(className, param->name);
4554 int len = strlen(className);
4556 if(className[len - 1] == '>')
4557 className[len++] = ' ';
4558 className[len++] = '>';
4559 className[len++] = '\0';
4561 return MkClassType(className);
4565 return MkClassType(_class->fullName);
4569 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4571 if(specs != (((void *)0)) && _class)
4573 struct Specifier * spec;
4575 for(spec = specs->first; spec; spec = spec->next)
4577 if(spec->type == 0 && spec->specifier == THISCLASS)
4580 spec->name = ReplaceThisClass(_class);
4581 spec->symbol = FindClass(spec->name);
4587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4589 struct __ecereNameSpace__ecere__com__GlobalFunction
4591 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4592 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4595 struct __ecereNameSpace__ecere__com__Instance * module;
4596 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4597 const char * dataTypeString;
4598 struct Type * dataType;
4600 } __attribute__ ((gcc_struct));
4602 extern struct Context * globalContext;
4604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4606 struct FunctionImport
4608 struct FunctionImport * prev;
4609 struct FunctionImport * next;
4611 } __attribute__ ((gcc_struct));
4613 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4615 struct Symbol * symbol = function->symbol;
4617 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4619 unsigned int imported = 0x0;
4620 unsigned int dllImport = 0x0;
4622 if(!function->dataType)
4624 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4625 if(!function->dataType->thisClass)
4626 function->dataType->staticMethod = 0x1;
4632 struct ModuleImport * module = FindModule(function->module);
4634 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4637 if(!function->dataType->dllExport)
4639 symbol->_import = (struct ClassImport *)__extension__ ({
4640 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4642 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4648 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4649 if(!symbol->type->thisClass)
4650 symbol->type->staticMethod = 0x1;
4653 imported = symbol->_import ? 0x1 : 0x0;
4654 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4657 DeclareType(function->dataType, 0x1, 0x1);
4660 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4662 struct Declaration * decl;
4663 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4664 struct Declarator * d;
4665 struct Declarator * funcDecl;
4666 struct External * external;
4668 specifiers = MkList();
4669 declarators = MkList();
4670 ListAdd(specifiers, MkSpecifier(EXTERN));
4671 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4673 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4674 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4675 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4677 struct Specifier * spec;
4679 for(spec = (*specifiers).first; spec; spec = spec->next)
4680 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4682 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4683 FreeSpecifier(spec);
4687 funcDecl = GetFuncDecl(d);
4688 if(funcDecl && !funcDecl->function.parameters)
4690 funcDecl->function.parameters = MkList();
4691 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4693 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4695 struct Context * oldCtx = curContext;
4697 curContext = globalContext;
4698 decl = MkDeclaration(specifiers, declarators);
4699 curContext = oldCtx;
4701 if(symbol->pointerExternal)
4703 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4706 *functionSymbol = *symbol;
4707 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4708 if(functionSymbol->type)
4709 functionSymbol->type->refCount++;
4711 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4712 symbol->pointerExternal->symbol = functionSymbol;
4714 external = MkExternalDeclaration(decl);
4716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4717 external->symbol = symbol;
4718 symbol->pointerExternal = external;
4722 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4725 symbol->id = curExternal->symbol->idCode;
4728 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4731 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4736 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4737 struct __ecereNameSpace__ecere__sys__BTNode * left;
4738 struct __ecereNameSpace__ecere__sys__BTNode * right;
4740 struct __ecereNameSpace__ecere__com__Instance * module;
4741 char * dataTypeString;
4742 struct Type * dataType;
4745 } __attribute__ ((gcc_struct));
4747 void DeclareGlobalData(struct GlobalData * data)
4749 struct Symbol * symbol = data->symbol;
4751 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4756 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4759 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4760 DeclareType(data->dataType, 0x1, 0x1);
4763 if(!symbol->pointerExternal)
4765 struct Declaration * decl;
4766 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4767 struct Declarator * d;
4768 struct External * external;
4770 specifiers = MkList();
4771 declarators = MkList();
4772 ListAdd(specifiers, MkSpecifier(EXTERN));
4773 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4774 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4775 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4776 decl = MkDeclaration(specifiers, declarators);
4777 external = MkExternalDeclaration(decl);
4779 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4780 external->symbol = symbol;
4781 symbol->pointerExternal = external;
4785 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4788 symbol->id = curExternal->symbol->idCode;
4795 struct Conversion * prev, * next;
4796 struct __ecereNameSpace__ecere__com__Property * convert;
4798 struct Type * resultType;
4799 } __attribute__ ((gcc_struct));
4801 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4803 extern void Compiler_Warning(const char * format, ...);
4805 extern void CopyTypeInto(struct Type * type, struct Type * src);
4807 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4809 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, unsigned int warnConst)
4813 if(warnConst && ((source->kind == 8 && source->_class && source->_class->registered) || source->kind == 12 || source->kind == 13) && ((dest->kind == 8 && dest->_class && dest->_class->registered) || dest->kind == 13))
4815 struct __ecereNameSpace__ecere__com__Class * sourceClass = source->kind == 8 ? source->_class->registered : (((void *)0));
4816 struct __ecereNameSpace__ecere__com__Class * destClass = dest->kind == 8 ? dest->_class->registered : (((void *)0));
4818 if((!sourceClass || (sourceClass && sourceClass->type == 0 && !sourceClass->structSize)) && (!destClass || (destClass && destClass->type == 0 && !destClass->structSize)))
4820 struct Type * sourceType = source, * destType = dest;
4822 while(sourceType->type && (sourceType->kind == 13 || sourceType->kind == 12))
4823 sourceType = sourceType->type;
4824 while(destType->type && (destType->kind == 13 || destType->kind == 12))
4825 destType = destType->type;
4826 if(!destType->constant && sourceType->constant)
4827 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "discarding const qualifier\n", (((void *)0))));
4830 if(source->kind == 20 && dest->kind != 20)
4832 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4837 if(dest->kind == 20 && source->kind != 20)
4839 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4844 if(dest->classObjectType == 2)
4846 if(source->classObjectType != 3)
4850 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4858 if(source->classObjectType == 3)
4860 if(dest->classObjectType == 3 && source->classObjectType != 2)
4863 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4865 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4868 if(dest->kind == 14 && source->kind != 0)
4870 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))
4872 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))
4874 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4876 if(source->_class->registered && source->_class->registered->type == 3)
4878 if(conversions != (((void *)0)))
4880 if(source->_class->registered == dest->_class->registered)
4885 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4887 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4889 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4891 if(sourceBase == destBase)
4895 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))
4899 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))
4901 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4908 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4912 if(source->kind == 8)
4914 struct __ecereNameSpace__ecere__com__Class * _class;
4916 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4918 struct __ecereNameSpace__ecere__com__Property * convert;
4920 for(convert = _class->conversions.first; convert; convert = convert->next)
4922 if(convert->memberAccess == 1 || _class->module == privateModule)
4924 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4926 if(!convert->dataType)
4927 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4928 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1, warnConst))
4930 if(!conversions && !convert->Get)
4932 else if(conversions != (((void *)0)))
4934 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))
4938 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4951 struct __ecereNameSpace__ecere__com__Class * _class;
4953 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4955 struct __ecereNameSpace__ecere__com__Property * convert;
4957 for(convert = _class->conversions.first; convert; convert = convert->next)
4959 if(convert->memberAccess == 1 || _class->module == privateModule)
4961 struct Type * constType = (((void *)0));
4962 unsigned int success = 0x0;
4964 if(!convert->dataType)
4965 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4966 if(warnConst && convert->dataType->kind == 13 && convert->dataType->type && dest->constant)
4968 struct Type * ptrType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4970 constType = __extension__ ({
4971 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4973 __ecereInstance1->kind = 13, __ecereInstance1->refCount = 1, __ecereInstance1->type = ptrType, __ecereInstance1;
4975 CopyTypeInto(ptrType, convert->dataType->type);
4976 ptrType->refCount++;
4977 ptrType->constant = 0x1;
4979 if((constType || convert->dataType != dest) && MatchTypes(source, constType ? constType : convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1, warnConst))
4981 if(!conversions && !convert->Set)
4983 else if(conversions != (((void *)0)))
4985 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))
4989 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4999 FreeType(constType);
5003 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5005 if(!dest->_class->registered->dataType)
5006 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5007 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
5009 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0, warnConst))
5016 if(source->kind == 8)
5018 struct __ecereNameSpace__ecere__com__Class * _class;
5020 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
5022 struct __ecereNameSpace__ecere__com__Property * convert;
5024 for(convert = _class->conversions.first; convert; convert = convert->next)
5026 if(convert->memberAccess == 1 || _class->module == privateModule)
5028 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
5030 if(!convert->dataType)
5031 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
5032 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1, warnConst))
5034 if(!conversions && !convert->Get)
5036 else if(conversions != (((void *)0)))
5038 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))
5042 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
5044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
5052 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
5054 if(!source->_class->registered->dataType)
5055 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5056 if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
5058 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->_class->registered->dataType->kind == 8, source->_class->registered->dataType->kind == 8, 0x0, 0x0, warnConst))
5060 else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, warnConst))
5066 if(source->kind == 8 || source->kind == 19)
5068 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5070 else if(dest->kind == 7 && source->kind == 6)
5072 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5074 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5076 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5078 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5080 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5082 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))
5084 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5086 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)))
5088 struct Type * paramSource, * paramDest;
5090 if(dest->kind == 16)
5091 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5092 if(source->kind == 16)
5093 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5094 if(dest->kind == 13 && dest->type->kind == 11)
5096 if(source->kind == 13 && source->type->kind == 11)
5097 source = source->type;
5098 if(dest->kind == 16)
5099 dest = dest->method->dataType;
5100 if(source->kind == 16)
5101 source = source->method->dataType;
5102 paramSource = source->params.first;
5103 if(paramSource && paramSource->kind == 0)
5104 paramSource = (((void *)0));
5105 paramDest = dest->params.first;
5106 if(paramDest && paramDest->kind == 0)
5107 paramDest = (((void *)0));
5108 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5110 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))))
5112 if(paramDest && paramDest->kind == 8)
5113 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5115 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5118 paramDest = paramDest->next;
5120 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5122 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5126 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5134 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5137 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5139 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5143 paramSource = paramSource->next;
5149 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5151 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5157 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5159 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5165 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5167 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5170 for(; paramDest; paramDest = paramDest->next)
5174 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5178 struct Type * paramDestType = paramDest;
5179 struct Type * paramSourceType = paramSource;
5180 struct Type * type = paramDestType;
5182 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5185 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5186 struct __ecereNameSpace__ecere__com__Class * sClass;
5188 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5191 if(sClass->templateClass)
5192 sClass = sClass->templateClass;
5193 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5195 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5197 for(sClass = sClass->base; sClass; sClass = sClass->base)
5199 if(sClass->templateClass)
5200 sClass = sClass->templateClass;
5201 id += sClass->templateParams.count;
5212 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5214 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5217 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst)))
5222 PrintType(paramDest, type, 0x0, 0x1);
5223 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5224 if(paramDestType != paramDest)
5225 FreeType(paramDestType);
5228 if(paramDestType != paramDest)
5229 FreeType(paramDestType);
5231 paramSource = paramSource->next;
5235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5240 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5244 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5246 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5253 static void FreeConvert(struct Conversion * convert)
5255 if(convert->resultType)
5256 FreeType(convert->resultType);
5259 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5261 struct __ecereNameSpace__ecere__com__BTNamedLink
5264 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5265 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5266 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5269 } __attribute__ ((gcc_struct));
5271 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5273 struct __ecereNameSpace__ecere__com__EnumClassData
5275 struct __ecereNameSpace__ecere__sys__OldList values;
5277 } __attribute__ ((gcc_struct));
5279 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5281 struct __ecereNameSpace__ecere__sys__NamedLink
5283 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5284 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5287 } __attribute__ ((gcc_struct));
5289 extern void FreeExpContents(struct Expression * exp);
5291 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5293 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5295 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5297 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5299 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5301 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5303 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5305 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)))
5307 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5309 if(_class->type == 4)
5311 struct __ecereNameSpace__ecere__sys__OldList converts =
5315 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5319 _class->symbol = FindClass(_class->fullName);
5320 type->_class = _class->symbol;
5321 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0, 0x0))
5323 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5324 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5328 struct __ecereNameSpace__ecere__com__Class * baseClass;
5330 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5332 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5334 for(value = e->values.first; value; value = value->next)
5336 if(!strcmp(value->name, string))
5341 FreeExpContents(sourceExp);
5342 FreeType(sourceExp->expType);
5343 sourceExp->isConstant = 0x1;
5344 sourceExp->expType = MkClassType(baseClass->fullName);
5348 sourceExp->type = 2;
5349 if(!strcmp(baseClass->dataTypeString, "int"))
5350 sprintf(constant, "%d", (int)value->data);
5352 sprintf(constant, "0x%X", (int)value->data);
5353 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5355 while(converts.first)
5357 struct Conversion * convert = converts.first;
5359 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5360 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5362 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5369 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5370 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5373 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)))
5374 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5381 struct __ecereNameSpace__ecere__com__SubModule
5383 struct __ecereNameSpace__ecere__com__SubModule * prev;
5384 struct __ecereNameSpace__ecere__com__SubModule * next;
5385 struct __ecereNameSpace__ecere__com__Instance * module;
5387 } __attribute__ ((gcc_struct));
5389 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5391 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5393 if(searchFor == searchIn)
5395 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5397 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5399 if(ModuleVisibility(subModule->module, searchFor))
5406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5408 struct __ecereNameSpace__ecere__com__Application
5411 const char * * argv;
5413 unsigned int isGUIApp;
5414 struct __ecereNameSpace__ecere__sys__OldList allModules;
5415 char * parsedCommand;
5416 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5417 } __attribute__ ((gcc_struct));
5419 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5421 struct __ecereNameSpace__ecere__com__Instance * module;
5423 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))
5425 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))
5427 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))
5429 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)
5431 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5437 extern struct Expression * CopyExpression(struct Expression * exp);
5439 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5441 void ReadString(char * output, char * string);
5443 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5445 extern struct TypeName * QMkClass(const char * spec, struct Declarator * decl);
5447 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5449 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla, unsigned int warnConst)
5451 struct Type * source;
5452 struct Type * realDest = dest;
5453 struct Type * backupSourceExpType = (((void *)0));
5454 struct Expression * computedExp = sourceExp;
5457 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5459 computedExp = CopyExpression(sourceExp);
5460 ComputeExpression(computedExp);
5462 source = sourceExp->expType;
5463 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5465 if(computedExp != sourceExp)
5467 FreeExpression(computedExp);
5468 computedExp = sourceExp;
5473 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5475 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5477 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5479 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5481 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5483 if(sourceBase == destBase)
5485 if(computedExp != sourceExp)
5487 FreeExpression(computedExp);
5488 computedExp = sourceExp;
5497 struct __ecereNameSpace__ecere__sys__OldList * specs;
5498 unsigned int flag = 0x0;
5499 long long value = (((int)0x7fffffff));
5502 if(computedExp->type == 2)
5504 if(source->isSigned)
5505 value = strtoll(computedExp->constant, (((void *)0)), 0);
5507 value = strtoull(computedExp->constant, (((void *)0)), 0);
5509 else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
5511 if(source->isSigned)
5512 value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
5514 value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
5516 if(computedExp != sourceExp)
5518 FreeExpression(computedExp);
5519 computedExp = sourceExp;
5521 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5524 source = __extension__ ({
5525 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5527 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5532 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5534 if(_class && _class->type == 3)
5536 if(source->kind != 8)
5538 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5539 struct Type * tempDest, * tempSource;
5541 for(; _class->base->type != 1000; _class = _class->base)
5544 tempDest = tempType;
5547 _class->symbol = FindClass(_class->fullName);
5548 tempType->_class = _class->symbol;
5549 tempType->truth = dest->truth;
5550 if(tempType->_class)
5551 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5552 backupSourceExpType = sourceExp->expType;
5553 sourceExp->expType = dest;
5556 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5559 if(_class && _class->type == 2 && source->kind != 8)
5561 if(!dest->_class->registered->dataType)
5562 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5563 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5566 FreeType(sourceExp->expType);
5567 source = sourceExp->expType = MkClassType(dest->_class->string);
5571 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5574 struct Declarator * decl;
5577 ReadString(string, sourceExp->string);
5578 decl = SpecDeclFromString(string, specs, (((void *)0)));
5579 FreeExpContents(sourceExp);
5580 FreeType(sourceExp->expType);
5581 sourceExp->type = 24;
5582 sourceExp->_classExp.specifiers = specs;
5583 sourceExp->_classExp.decl = decl;
5584 sourceExp->expType = dest;
5588 if(backupSourceExpType)
5589 FreeType(backupSourceExpType);
5593 else if(source->kind == 8)
5595 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5597 if(_class && (_class->type == 3 || _class->type == 2))
5601 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5602 struct Type * tempDest, * tempSource;
5604 if(!source->_class->registered->dataType)
5605 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5606 for(; _class->base->type != 1000; _class = _class->base)
5609 tempSource = tempType;
5611 tempType->_class = FindClass(_class->fullName);
5612 tempType->truth = source->truth;
5613 tempType->classObjectType = source->classObjectType;
5614 if(tempType->_class)
5615 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
5616 if(conversions->last)
5618 ((struct Conversion *)conversions->last)->resultType = dest;
5621 FreeType(sourceExp->expType);
5622 sourceExp->expType = MkClassType(_class->fullName);
5623 sourceExp->expType->truth = source->truth;
5624 sourceExp->expType->classObjectType = source->classObjectType;
5625 if(!sourceExp->destType)
5627 FreeType(sourceExp->destType);
5628 sourceExp->destType = sourceExp->expType;
5629 if(sourceExp->expType)
5630 sourceExp->expType->refCount++;
5632 if(!_class->dataType)
5633 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5635 dest = MkClassType(source->_class->string);
5636 dest->truth = source->truth;
5637 dest->classObjectType = source->classObjectType;
5639 source = _class->dataType;
5641 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5647 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst))
5656 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5657 unsigned int fittingValue = 0x0;
5659 if(_class && _class->type == 4)
5661 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5662 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5664 if(c && value >= 0 && value <= c->largest)
5667 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5669 if(_class->type == 0 || _class->type == 5)
5671 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5673 *newExp = *sourceExp;
5674 if(sourceExp->destType)
5675 sourceExp->destType->refCount++;
5676 if(sourceExp->expType)
5677 sourceExp->expType->refCount++;
5678 sourceExp->type = 11;
5679 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5680 sourceExp->cast.exp = newExp;
5681 FreeType(sourceExp->expType);
5682 sourceExp->expType = (((void *)0));
5683 ProcessExpressionType(sourceExp);
5686 FreeType(sourceExp->expType);
5687 sourceExp->expType = dest;
5692 if(backupSourceExpType)
5693 FreeType(backupSourceExpType);
5696 if(!_class->dataType)
5697 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5699 dest = _class->dataType;
5702 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))
5704 specs = MkListOne(MkSpecifier(DOUBLE));
5706 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))
5708 specs = MkListOne(MkSpecifier(FLOAT));
5710 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))
5714 ListAdd(specs, MkSpecifier(UNSIGNED));
5715 ListAdd(specs, MkSpecifier(INT64));
5717 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5721 ListAdd(specs, MkSpecifier(UNSIGNED));
5722 ListAdd(specs, MkSpecifier(INT));
5724 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5728 ListAdd(specs, MkSpecifier(UNSIGNED));
5729 ListAdd(specs, MkSpecifier(SHORT));
5731 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5735 ListAdd(specs, MkSpecifier(UNSIGNED));
5736 ListAdd(specs, MkSpecifier(CHAR));
5742 if(backupSourceExpType)
5744 if(sourceExp->expType)
5745 FreeType(sourceExp->expType);
5746 sourceExp->expType = backupSourceExpType;
5751 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))
5753 specs = MkListOne(MkSpecifier(DOUBLE));
5755 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))
5757 specs = MkListOne(MkSpecifier(FLOAT));
5759 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5762 ListAdd(specs, MkSpecifier(BOOL));
5764 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)))
5768 ListAdd(specs, MkSpecifier(UNSIGNED));
5769 ListAdd(specs, MkSpecifier(CHAR));
5771 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)))))
5775 ListAdd(specs, MkSpecifier(UNSIGNED));
5776 ListAdd(specs, MkSpecifier(SHORT));
5778 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5782 ListAdd(specs, MkSpecifier(UNSIGNED));
5783 ListAdd(specs, MkSpecifier(INT));
5785 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5789 ListAdd(specs, MkSpecifier(UNSIGNED));
5790 ListAdd(specs, MkSpecifier(INT64));
5792 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5794 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5800 if(backupSourceExpType)
5802 if(sourceExp->expType)
5803 FreeType(sourceExp->expType);
5804 sourceExp->expType = backupSourceExpType;
5808 if(!flag && !sourceExp->opDestType)
5810 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5812 *newExp = *sourceExp;
5813 newExp->prev = (((void *)0));
5814 newExp->next = (((void *)0));
5815 if(sourceExp->destType)
5816 sourceExp->destType->refCount++;
5817 if(sourceExp->expType)
5818 sourceExp->expType->refCount++;
5819 sourceExp->type = 11;
5820 if(realDest->kind == 8)
5822 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5823 FreeList(specs, FreeSpecifier);
5826 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5827 if(newExp->type == 4)
5829 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5832 sourceExp->cast.exp = newExp;
5833 FreeType(sourceExp->expType);
5834 sourceExp->expType = (((void *)0));
5835 ProcessExpressionType(sourceExp);
5838 FreeList(specs, FreeSpecifier);
5841 if(backupSourceExpType)
5842 FreeType(backupSourceExpType);
5847 if(computedExp != sourceExp)
5849 FreeExpression(computedExp);
5850 computedExp = sourceExp;
5852 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5853 sourceExp = (*sourceExp->list).last;
5854 if(sourceExp->type == 0)
5856 struct Identifier * id = sourceExp->identifier;
5860 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5862 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5863 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5867 for(; _class && _class->type == 4; _class = _class->base)
5869 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5870 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5872 for(value = e->values.first; value; value = value->next)
5874 if(!strcmp(value->name, id->string))
5879 FreeExpContents(sourceExp);
5880 FreeType(sourceExp->expType);
5881 sourceExp->isConstant = 0x1;
5882 sourceExp->expType = MkClassType(_class->fullName);
5886 sourceExp->type = 2;
5887 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5888 sprintf(constant, "%d", (int)value->data);
5890 sprintf(constant, "0x%X", (int)value->data);
5891 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5900 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5911 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5913 int value2 = op2->i;
5916 exp->string = PrintInt((op1->i + value2));
5919 exp->expType = op1->type;
5921 op1->type->refCount++;
5926 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5928 unsigned int value2 = op2->ui;
5931 exp->string = PrintUInt((op1->ui + value2));
5934 exp->expType = op1->type;
5936 op1->type->refCount++;
5941 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5943 long long value2 = op2->i64;
5946 exp->string = PrintInt64((op1->i64 + value2));
5949 exp->expType = op1->type;
5951 op1->type->refCount++;
5956 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5958 uint64 value2 = op2->ui64;
5961 exp->string = PrintUInt64((op1->ui64 + value2));
5964 exp->expType = op1->type;
5966 op1->type->refCount++;
5971 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5973 short value2 = op2->s;
5976 exp->string = PrintShort((op1->s + value2));
5979 exp->expType = op1->type;
5981 op1->type->refCount++;
5986 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5988 unsigned short value2 = op2->us;
5991 exp->string = PrintUShort((op1->us + value2));
5994 exp->expType = op1->type;
5996 op1->type->refCount++;
6001 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6003 char value2 = op2->c;
6006 exp->string = PrintChar((op1->c + value2));
6009 exp->expType = op1->type;
6011 op1->type->refCount++;
6016 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6018 unsigned char value2 = op2->uc;
6021 exp->string = PrintUChar((op1->uc + value2));
6024 exp->expType = op1->type;
6026 op1->type->refCount++;
6031 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6033 float value2 = op2->f;
6036 exp->string = PrintFloat((float)(op1->f + value2));
6039 exp->expType = op1->type;
6041 op1->type->refCount++;
6046 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6048 double value2 = op2->d;
6051 exp->string = PrintDouble((double)(op1->d + value2));
6054 exp->expType = op1->type;
6056 op1->type->refCount++;
6061 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6063 int value2 = op2->i;
6066 exp->string = PrintInt((op1->i - value2));
6069 exp->expType = op1->type;
6071 op1->type->refCount++;
6076 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6078 unsigned int value2 = op2->ui;
6081 exp->string = PrintUInt((op1->ui - value2));
6084 exp->expType = op1->type;
6086 op1->type->refCount++;
6091 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6093 long long value2 = op2->i64;
6096 exp->string = PrintInt64((op1->i64 - value2));
6099 exp->expType = op1->type;
6101 op1->type->refCount++;
6106 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6108 uint64 value2 = op2->ui64;
6111 exp->string = PrintUInt64((op1->ui64 - value2));
6114 exp->expType = op1->type;
6116 op1->type->refCount++;
6121 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6123 short value2 = op2->s;
6126 exp->string = PrintShort((op1->s - value2));
6129 exp->expType = op1->type;
6131 op1->type->refCount++;
6136 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6138 unsigned short value2 = op2->us;
6141 exp->string = PrintUShort((op1->us - value2));
6144 exp->expType = op1->type;
6146 op1->type->refCount++;
6151 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6153 char value2 = op2->c;
6156 exp->string = PrintChar((op1->c - value2));
6159 exp->expType = op1->type;
6161 op1->type->refCount++;
6166 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6168 unsigned char value2 = op2->uc;
6171 exp->string = PrintUChar((op1->uc - value2));
6174 exp->expType = op1->type;
6176 op1->type->refCount++;
6181 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6183 float value2 = op2->f;
6186 exp->string = PrintFloat((float)(op1->f - value2));
6189 exp->expType = op1->type;
6191 op1->type->refCount++;
6196 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6198 double value2 = op2->d;
6201 exp->string = PrintDouble((double)(op1->d - value2));
6204 exp->expType = op1->type;
6206 op1->type->refCount++;
6211 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6213 int value2 = op2->i;
6216 exp->string = PrintInt((op1->i * value2));
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6228 unsigned int value2 = op2->ui;
6231 exp->string = PrintUInt((op1->ui * value2));
6234 exp->expType = op1->type;
6236 op1->type->refCount++;
6241 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6243 long long value2 = op2->i64;
6246 exp->string = PrintInt64((op1->i64 * value2));
6249 exp->expType = op1->type;
6251 op1->type->refCount++;
6256 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6258 uint64 value2 = op2->ui64;
6261 exp->string = PrintUInt64((op1->ui64 * value2));
6264 exp->expType = op1->type;
6266 op1->type->refCount++;
6271 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6273 short value2 = op2->s;
6276 exp->string = PrintShort((op1->s * value2));
6279 exp->expType = op1->type;
6281 op1->type->refCount++;
6286 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6288 unsigned short value2 = op2->us;
6291 exp->string = PrintUShort((op1->us * value2));
6294 exp->expType = op1->type;
6296 op1->type->refCount++;
6301 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6303 char value2 = op2->c;
6306 exp->string = PrintChar((op1->c * value2));
6309 exp->expType = op1->type;
6311 op1->type->refCount++;
6316 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6318 unsigned char value2 = op2->uc;
6321 exp->string = PrintUChar((op1->uc * value2));
6324 exp->expType = op1->type;
6326 op1->type->refCount++;
6331 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6333 float value2 = op2->f;
6336 exp->string = PrintFloat((float)(op1->f * value2));
6339 exp->expType = op1->type;
6341 op1->type->refCount++;
6346 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6348 double value2 = op2->d;
6351 exp->string = PrintDouble((double)(op1->d * value2));
6354 exp->expType = op1->type;
6356 op1->type->refCount++;
6361 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6363 int value2 = op2->i;
6366 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6369 exp->expType = op1->type;
6371 op1->type->refCount++;
6376 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6378 unsigned int value2 = op2->ui;
6381 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6384 exp->expType = op1->type;
6386 op1->type->refCount++;
6391 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6393 long long value2 = op2->i64;
6396 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6399 exp->expType = op1->type;
6401 op1->type->refCount++;
6406 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6408 uint64 value2 = op2->ui64;
6411 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6414 exp->expType = op1->type;
6416 op1->type->refCount++;
6421 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6423 short value2 = op2->s;
6426 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6429 exp->expType = op1->type;
6431 op1->type->refCount++;
6436 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6438 unsigned short value2 = op2->us;
6441 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6444 exp->expType = op1->type;
6446 op1->type->refCount++;
6451 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6453 char value2 = op2->c;
6456 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6459 exp->expType = op1->type;
6461 op1->type->refCount++;
6466 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6468 unsigned char value2 = op2->uc;
6471 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6474 exp->expType = op1->type;
6476 op1->type->refCount++;
6481 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6483 float value2 = op2->f;
6486 exp->string = PrintFloat(op1->f / value2);
6489 exp->expType = op1->type;
6491 op1->type->refCount++;
6496 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6498 double value2 = op2->d;
6501 exp->string = PrintDouble(op1->d / value2);
6504 exp->expType = op1->type;
6506 op1->type->refCount++;
6511 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6513 int value2 = op2->i;
6516 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6519 exp->expType = op1->type;
6521 op1->type->refCount++;
6526 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6528 unsigned int value2 = op2->ui;
6531 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6534 exp->expType = op1->type;
6536 op1->type->refCount++;
6541 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6543 long long value2 = op2->i64;
6546 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6549 exp->expType = op1->type;
6551 op1->type->refCount++;
6556 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6558 uint64 value2 = op2->ui64;
6561 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6564 exp->expType = op1->type;
6566 op1->type->refCount++;
6571 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6573 short value2 = op2->s;
6576 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6579 exp->expType = op1->type;
6581 op1->type->refCount++;
6586 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6588 unsigned short value2 = op2->us;
6591 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6594 exp->expType = op1->type;
6596 op1->type->refCount++;
6601 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6603 char value2 = op2->c;
6606 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6609 exp->expType = op1->type;
6611 op1->type->refCount++;
6616 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6618 unsigned char value2 = op2->uc;
6621 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6624 exp->expType = op1->type;
6626 op1->type->refCount++;
6631 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6634 exp->string = PrintInt((-op1->i));
6637 exp->expType = op1->type;
6639 op1->type->refCount++;
6644 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6647 exp->string = PrintUInt((unsigned int)(-op1->ui));
6650 exp->expType = op1->type;
6652 op1->type->refCount++;
6657 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6660 exp->string = PrintInt64((-op1->i64));
6663 exp->expType = op1->type;
6665 op1->type->refCount++;
6670 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6673 exp->string = PrintUInt64((uint64)(-op1->ui64));
6676 exp->expType = op1->type;
6678 op1->type->refCount++;
6683 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6686 exp->string = PrintShort((-op1->s));
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6699 exp->string = PrintUShort((unsigned short)(-op1->us));
6702 exp->expType = op1->type;
6704 op1->type->refCount++;
6709 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6712 exp->string = PrintChar((-op1->c));
6715 exp->expType = op1->type;
6717 op1->type->refCount++;
6722 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6725 exp->string = PrintUChar((unsigned char)(-op1->uc));
6728 exp->expType = op1->type;
6730 op1->type->refCount++;
6735 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6738 exp->string = PrintFloat((float)(-op1->f));
6741 exp->expType = op1->type;
6743 op1->type->refCount++;
6748 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6751 exp->string = PrintDouble((double)(-op1->d));
6754 exp->expType = op1->type;
6756 op1->type->refCount++;
6761 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6764 exp->string = PrintInt((++op1->i));
6767 exp->expType = op1->type;
6769 op1->type->refCount++;
6774 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6777 exp->string = PrintUInt((++op1->ui));
6780 exp->expType = op1->type;
6782 op1->type->refCount++;
6787 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6790 exp->string = PrintInt64((++op1->i64));
6793 exp->expType = op1->type;
6795 op1->type->refCount++;
6800 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6803 exp->string = PrintUInt64((++op1->ui64));
6806 exp->expType = op1->type;
6808 op1->type->refCount++;
6813 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6816 exp->string = PrintShort((++op1->s));
6819 exp->expType = op1->type;
6821 op1->type->refCount++;
6826 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6829 exp->string = PrintUShort((++op1->us));
6832 exp->expType = op1->type;
6834 op1->type->refCount++;
6839 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6842 exp->string = PrintChar((++op1->c));
6845 exp->expType = op1->type;
6847 op1->type->refCount++;
6852 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6855 exp->string = PrintUChar((++op1->uc));
6858 exp->expType = op1->type;
6860 op1->type->refCount++;
6865 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6868 exp->string = PrintFloat((float)(++op1->f));
6871 exp->expType = op1->type;
6873 op1->type->refCount++;
6878 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6881 exp->string = PrintDouble((double)(++op1->d));
6884 exp->expType = op1->type;
6886 op1->type->refCount++;
6891 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6894 exp->string = PrintInt((--op1->i));
6897 exp->expType = op1->type;
6899 op1->type->refCount++;
6904 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6907 exp->string = PrintUInt((--op1->ui));
6910 exp->expType = op1->type;
6912 op1->type->refCount++;
6917 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6920 exp->string = PrintInt64((--op1->i64));
6923 exp->expType = op1->type;
6925 op1->type->refCount++;
6930 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6933 exp->string = PrintUInt64((--op1->ui64));
6936 exp->expType = op1->type;
6938 op1->type->refCount++;
6943 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6946 exp->string = PrintShort((--op1->s));
6949 exp->expType = op1->type;
6951 op1->type->refCount++;
6956 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6959 exp->string = PrintUShort((--op1->us));
6962 exp->expType = op1->type;
6964 op1->type->refCount++;
6969 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6972 exp->string = PrintChar((--op1->c));
6975 exp->expType = op1->type;
6977 op1->type->refCount++;
6982 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6985 exp->string = PrintUChar((--op1->uc));
6988 exp->expType = op1->type;
6990 op1->type->refCount++;
6995 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6998 exp->string = PrintFloat((float)(--op1->f));
7001 exp->expType = op1->type;
7003 op1->type->refCount++;
7008 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
7011 exp->string = PrintDouble((double)(--op1->d));
7014 exp->expType = op1->type;
7016 op1->type->refCount++;
7021 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7023 int value2 = op2->i;
7026 exp->string = PrintInt((op1->i = value2));
7029 exp->expType = op1->type;
7031 op1->type->refCount++;
7036 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7038 unsigned int value2 = op2->ui;
7041 exp->string = PrintUInt((op1->ui = value2));
7044 exp->expType = op1->type;
7046 op1->type->refCount++;
7051 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7053 long long value2 = op2->i64;
7056 exp->string = PrintInt64((op1->i64 = value2));
7059 exp->expType = op1->type;
7061 op1->type->refCount++;
7066 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7068 uint64 value2 = op2->ui64;
7071 exp->string = PrintUInt64((op1->ui64 = value2));
7074 exp->expType = op1->type;
7076 op1->type->refCount++;
7081 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7083 short value2 = op2->s;
7086 exp->string = PrintShort((op1->s = value2));
7089 exp->expType = op1->type;
7091 op1->type->refCount++;
7096 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7098 unsigned short value2 = op2->us;
7101 exp->string = PrintUShort((op1->us = value2));
7104 exp->expType = op1->type;
7106 op1->type->refCount++;
7111 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7113 char value2 = op2->c;
7116 exp->string = PrintChar((op1->c = value2));
7119 exp->expType = op1->type;
7121 op1->type->refCount++;
7126 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7128 unsigned char value2 = op2->uc;
7131 exp->string = PrintUChar((op1->uc = value2));
7134 exp->expType = op1->type;
7136 op1->type->refCount++;
7141 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7143 float value2 = op2->f;
7146 exp->string = PrintFloat((float)(op1->f = value2));
7149 exp->expType = op1->type;
7151 op1->type->refCount++;
7156 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7158 double value2 = op2->d;
7161 exp->string = PrintDouble((double)(op1->d = value2));
7164 exp->expType = op1->type;
7166 op1->type->refCount++;
7171 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7173 int value2 = op2->i;
7176 exp->string = PrintInt((op1->i += value2));
7179 exp->expType = op1->type;
7181 op1->type->refCount++;
7186 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7188 unsigned int value2 = op2->ui;
7191 exp->string = PrintUInt((op1->ui += value2));
7194 exp->expType = op1->type;
7196 op1->type->refCount++;
7201 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7203 long long value2 = op2->i64;
7206 exp->string = PrintInt64((op1->i64 += value2));
7209 exp->expType = op1->type;
7211 op1->type->refCount++;
7216 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7218 uint64 value2 = op2->ui64;
7221 exp->string = PrintUInt64((op1->ui64 += value2));
7224 exp->expType = op1->type;
7226 op1->type->refCount++;
7231 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7233 short value2 = op2->s;
7236 exp->string = PrintShort((op1->s += value2));
7239 exp->expType = op1->type;
7241 op1->type->refCount++;
7246 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7248 unsigned short value2 = op2->us;
7251 exp->string = PrintUShort((op1->us += value2));
7254 exp->expType = op1->type;
7256 op1->type->refCount++;
7261 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7263 char value2 = op2->c;
7266 exp->string = PrintChar((op1->c += value2));
7269 exp->expType = op1->type;
7271 op1->type->refCount++;
7276 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7278 unsigned char value2 = op2->uc;
7281 exp->string = PrintUChar((op1->uc += value2));
7284 exp->expType = op1->type;
7286 op1->type->refCount++;
7291 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7293 float value2 = op2->f;
7296 exp->string = PrintFloat((float)(op1->f += value2));
7299 exp->expType = op1->type;
7301 op1->type->refCount++;
7306 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7308 double value2 = op2->d;
7311 exp->string = PrintDouble((double)(op1->d += value2));
7314 exp->expType = op1->type;
7316 op1->type->refCount++;
7321 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7323 int value2 = op2->i;
7326 exp->string = PrintInt((op1->i -= value2));
7329 exp->expType = op1->type;
7331 op1->type->refCount++;
7336 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7338 unsigned int value2 = op2->ui;
7341 exp->string = PrintUInt((op1->ui -= value2));
7344 exp->expType = op1->type;
7346 op1->type->refCount++;
7351 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7353 long long value2 = op2->i64;
7356 exp->string = PrintInt64((op1->i64 -= value2));
7359 exp->expType = op1->type;
7361 op1->type->refCount++;
7366 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7368 uint64 value2 = op2->ui64;
7371 exp->string = PrintUInt64((op1->ui64 -= value2));
7374 exp->expType = op1->type;
7376 op1->type->refCount++;
7381 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7383 short value2 = op2->s;
7386 exp->string = PrintShort((op1->s -= value2));
7389 exp->expType = op1->type;
7391 op1->type->refCount++;
7396 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7398 unsigned short value2 = op2->us;
7401 exp->string = PrintUShort((op1->us -= value2));
7404 exp->expType = op1->type;
7406 op1->type->refCount++;
7411 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7413 char value2 = op2->c;
7416 exp->string = PrintChar((op1->c -= value2));
7419 exp->expType = op1->type;
7421 op1->type->refCount++;
7426 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7428 unsigned char value2 = op2->uc;
7431 exp->string = PrintUChar((op1->uc -= value2));
7434 exp->expType = op1->type;
7436 op1->type->refCount++;
7441 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7443 float value2 = op2->f;
7446 exp->string = PrintFloat((float)(op1->f -= value2));
7449 exp->expType = op1->type;
7451 op1->type->refCount++;
7456 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7458 double value2 = op2->d;
7461 exp->string = PrintDouble((double)(op1->d -= value2));
7464 exp->expType = op1->type;
7466 op1->type->refCount++;
7471 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7473 int value2 = op2->i;
7476 exp->string = PrintInt((op1->i *= value2));
7479 exp->expType = op1->type;
7481 op1->type->refCount++;
7486 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7488 unsigned int value2 = op2->ui;
7491 exp->string = PrintUInt((op1->ui *= value2));
7494 exp->expType = op1->type;
7496 op1->type->refCount++;
7501 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7503 long long value2 = op2->i64;
7506 exp->string = PrintInt64((op1->i64 *= value2));
7509 exp->expType = op1->type;
7511 op1->type->refCount++;
7516 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7518 uint64 value2 = op2->ui64;
7521 exp->string = PrintUInt64((op1->ui64 *= value2));
7524 exp->expType = op1->type;
7526 op1->type->refCount++;
7531 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7533 short value2 = op2->s;
7536 exp->string = PrintShort((op1->s *= value2));
7539 exp->expType = op1->type;
7541 op1->type->refCount++;
7546 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7548 unsigned short value2 = op2->us;
7551 exp->string = PrintUShort((op1->us *= value2));
7554 exp->expType = op1->type;
7556 op1->type->refCount++;
7561 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7563 char value2 = op2->c;
7566 exp->string = PrintChar((op1->c *= value2));
7569 exp->expType = op1->type;
7571 op1->type->refCount++;
7576 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7578 unsigned char value2 = op2->uc;
7581 exp->string = PrintUChar((op1->uc *= value2));
7584 exp->expType = op1->type;
7586 op1->type->refCount++;
7591 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7593 float value2 = op2->f;
7596 exp->string = PrintFloat((float)(op1->f *= value2));
7599 exp->expType = op1->type;
7601 op1->type->refCount++;
7606 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7608 double value2 = op2->d;
7611 exp->string = PrintDouble((double)(op1->d *= value2));
7614 exp->expType = op1->type;
7616 op1->type->refCount++;
7621 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7623 int value2 = op2->i;
7626 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7629 exp->expType = op1->type;
7631 op1->type->refCount++;
7636 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7638 unsigned int value2 = op2->ui;
7641 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7644 exp->expType = op1->type;
7646 op1->type->refCount++;
7651 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7653 long long value2 = op2->i64;
7656 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7659 exp->expType = op1->type;
7661 op1->type->refCount++;
7666 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7668 uint64 value2 = op2->ui64;
7671 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7674 exp->expType = op1->type;
7676 op1->type->refCount++;
7681 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7683 short value2 = op2->s;
7686 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7689 exp->expType = op1->type;
7691 op1->type->refCount++;
7696 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7698 unsigned short value2 = op2->us;
7701 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7704 exp->expType = op1->type;
7706 op1->type->refCount++;
7711 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7713 char value2 = op2->c;
7716 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7719 exp->expType = op1->type;
7721 op1->type->refCount++;
7726 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7728 unsigned char value2 = op2->uc;
7731 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7734 exp->expType = op1->type;
7736 op1->type->refCount++;
7741 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7743 float value2 = op2->f;
7746 exp->string = PrintFloat(op1->f /= value2);
7749 exp->expType = op1->type;
7751 op1->type->refCount++;
7756 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7758 double value2 = op2->d;
7761 exp->string = PrintDouble(op1->d /= value2);
7764 exp->expType = op1->type;
7766 op1->type->refCount++;
7771 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7773 int value2 = op2->i;
7776 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7779 exp->expType = op1->type;
7781 op1->type->refCount++;
7786 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7788 unsigned int value2 = op2->ui;
7791 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7794 exp->expType = op1->type;
7796 op1->type->refCount++;
7801 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7803 long long value2 = op2->i64;
7806 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7809 exp->expType = op1->type;
7811 op1->type->refCount++;
7816 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7818 uint64 value2 = op2->ui64;
7821 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7824 exp->expType = op1->type;
7826 op1->type->refCount++;
7831 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7833 short value2 = op2->s;
7836 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7839 exp->expType = op1->type;
7841 op1->type->refCount++;
7846 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7848 unsigned short value2 = op2->us;
7851 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7854 exp->expType = op1->type;
7856 op1->type->refCount++;
7861 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7863 char value2 = op2->c;
7866 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7869 exp->expType = op1->type;
7871 op1->type->refCount++;
7876 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7878 unsigned char value2 = op2->uc;
7881 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7884 exp->expType = op1->type;
7886 op1->type->refCount++;
7891 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7893 int value2 = op2->i;
7896 exp->string = PrintInt((op1->i & value2));
7899 exp->expType = op1->type;
7901 op1->type->refCount++;
7906 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7908 unsigned int value2 = op2->ui;
7911 exp->string = PrintUInt((op1->ui & value2));
7914 exp->expType = op1->type;
7916 op1->type->refCount++;
7921 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7923 long long value2 = op2->i64;
7926 exp->string = PrintInt64((op1->i64 & value2));
7929 exp->expType = op1->type;
7931 op1->type->refCount++;
7936 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7938 uint64 value2 = op2->ui64;
7941 exp->string = PrintUInt64((op1->ui64 & value2));
7944 exp->expType = op1->type;
7946 op1->type->refCount++;
7951 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7953 short value2 = op2->s;
7956 exp->string = PrintShort((op1->s & value2));
7959 exp->expType = op1->type;
7961 op1->type->refCount++;
7966 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7968 unsigned short value2 = op2->us;
7971 exp->string = PrintUShort((op1->us & value2));
7974 exp->expType = op1->type;
7976 op1->type->refCount++;
7981 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7983 char value2 = op2->c;
7986 exp->string = PrintChar((op1->c & value2));
7989 exp->expType = op1->type;
7991 op1->type->refCount++;
7996 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7998 unsigned char value2 = op2->uc;
8001 exp->string = PrintUChar((op1->uc & value2));
8004 exp->expType = op1->type;
8006 op1->type->refCount++;
8011 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8013 int value2 = op2->i;
8016 exp->string = PrintInt((op1->i | value2));
8019 exp->expType = op1->type;
8021 op1->type->refCount++;
8026 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8028 unsigned int value2 = op2->ui;
8031 exp->string = PrintUInt((op1->ui | value2));
8034 exp->expType = op1->type;
8036 op1->type->refCount++;
8041 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8043 long long value2 = op2->i64;
8046 exp->string = PrintInt64((op1->i64 | value2));
8049 exp->expType = op1->type;
8051 op1->type->refCount++;
8056 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8058 uint64 value2 = op2->ui64;
8061 exp->string = PrintUInt64((op1->ui64 | value2));
8064 exp->expType = op1->type;
8066 op1->type->refCount++;
8071 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8073 short value2 = op2->s;
8076 exp->string = PrintShort((op1->s | value2));
8079 exp->expType = op1->type;
8081 op1->type->refCount++;
8086 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8088 unsigned short value2 = op2->us;
8091 exp->string = PrintUShort((op1->us | value2));
8094 exp->expType = op1->type;
8096 op1->type->refCount++;
8101 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8103 char value2 = op2->c;
8106 exp->string = PrintChar((op1->c | value2));
8109 exp->expType = op1->type;
8111 op1->type->refCount++;
8116 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8118 unsigned char value2 = op2->uc;
8121 exp->string = PrintUChar((op1->uc | value2));
8124 exp->expType = op1->type;
8126 op1->type->refCount++;
8131 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8133 int value2 = op2->i;
8136 exp->string = PrintInt((op1->i ^ value2));
8139 exp->expType = op1->type;
8141 op1->type->refCount++;
8146 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8148 unsigned int value2 = op2->ui;
8151 exp->string = PrintUInt((op1->ui ^ value2));
8154 exp->expType = op1->type;
8156 op1->type->refCount++;
8161 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8163 long long value2 = op2->i64;
8166 exp->string = PrintInt64((op1->i64 ^ value2));
8169 exp->expType = op1->type;
8171 op1->type->refCount++;
8176 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8178 uint64 value2 = op2->ui64;
8181 exp->string = PrintUInt64((op1->ui64 ^ value2));
8184 exp->expType = op1->type;
8186 op1->type->refCount++;
8191 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8193 short value2 = op2->s;
8196 exp->string = PrintShort((op1->s ^ value2));
8199 exp->expType = op1->type;
8201 op1->type->refCount++;
8206 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8208 unsigned short value2 = op2->us;
8211 exp->string = PrintUShort((op1->us ^ value2));
8214 exp->expType = op1->type;
8216 op1->type->refCount++;
8221 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8223 char value2 = op2->c;
8226 exp->string = PrintChar((op1->c ^ value2));
8229 exp->expType = op1->type;
8231 op1->type->refCount++;
8236 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8238 unsigned char value2 = op2->uc;
8241 exp->string = PrintUChar((op1->uc ^ value2));
8244 exp->expType = op1->type;
8246 op1->type->refCount++;
8251 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8253 int value2 = op2->i;
8256 exp->string = PrintInt((op1->i << value2));
8259 exp->expType = op1->type;
8261 op1->type->refCount++;
8266 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8268 unsigned int value2 = op2->ui;
8271 exp->string = PrintUInt((op1->ui << value2));
8274 exp->expType = op1->type;
8276 op1->type->refCount++;
8281 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8283 long long value2 = op2->i64;
8286 exp->string = PrintInt64((op1->i64 << value2));
8289 exp->expType = op1->type;
8291 op1->type->refCount++;
8296 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8298 uint64 value2 = op2->ui64;
8301 exp->string = PrintUInt64((op1->ui64 << value2));
8304 exp->expType = op1->type;
8306 op1->type->refCount++;
8311 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8313 short value2 = op2->s;
8316 exp->string = PrintShort((op1->s << value2));
8319 exp->expType = op1->type;
8321 op1->type->refCount++;
8326 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8328 unsigned short value2 = op2->us;
8331 exp->string = PrintUShort((op1->us << value2));
8334 exp->expType = op1->type;
8336 op1->type->refCount++;
8341 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8343 char value2 = op2->c;
8346 exp->string = PrintChar((op1->c << value2));
8349 exp->expType = op1->type;
8351 op1->type->refCount++;
8356 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8358 unsigned char value2 = op2->uc;
8361 exp->string = PrintUChar((op1->uc << value2));
8364 exp->expType = op1->type;
8366 op1->type->refCount++;
8371 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8373 int value2 = op2->i;
8376 exp->string = PrintInt((op1->i >> value2));
8379 exp->expType = op1->type;
8381 op1->type->refCount++;
8386 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8388 unsigned int value2 = op2->ui;
8391 exp->string = PrintUInt((op1->ui >> value2));
8394 exp->expType = op1->type;
8396 op1->type->refCount++;
8401 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8403 long long value2 = op2->i64;
8406 exp->string = PrintInt64((op1->i64 >> value2));
8409 exp->expType = op1->type;
8411 op1->type->refCount++;
8416 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8418 uint64 value2 = op2->ui64;
8421 exp->string = PrintUInt64((op1->ui64 >> value2));
8424 exp->expType = op1->type;
8426 op1->type->refCount++;
8431 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8433 short value2 = op2->s;
8436 exp->string = PrintShort((op1->s >> value2));
8439 exp->expType = op1->type;
8441 op1->type->refCount++;
8446 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8448 unsigned short value2 = op2->us;
8451 exp->string = PrintUShort((op1->us >> value2));
8454 exp->expType = op1->type;
8456 op1->type->refCount++;
8461 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8463 char value2 = op2->c;
8466 exp->string = PrintChar((op1->c >> value2));
8469 exp->expType = op1->type;
8471 op1->type->refCount++;
8476 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8478 unsigned char value2 = op2->uc;
8481 exp->string = PrintUChar((op1->uc >> value2));
8484 exp->expType = op1->type;
8486 op1->type->refCount++;
8491 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8494 exp->string = PrintInt((~op1->i));
8497 exp->expType = op1->type;
8499 op1->type->refCount++;
8504 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8507 exp->string = PrintUInt((unsigned int)(~op1->ui));
8510 exp->expType = op1->type;
8512 op1->type->refCount++;
8517 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8520 exp->string = PrintInt64((long long)(~op1->i64));
8523 exp->expType = op1->type;
8525 op1->type->refCount++;
8530 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8533 exp->string = PrintUInt64((uint64)(~op1->ui64));
8536 exp->expType = op1->type;
8538 op1->type->refCount++;
8543 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8546 exp->string = PrintShort((short)(~op1->s));
8549 exp->expType = op1->type;
8551 op1->type->refCount++;
8556 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8559 exp->string = PrintUShort((unsigned short)(~op1->us));
8562 exp->expType = op1->type;
8564 op1->type->refCount++;
8569 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8572 exp->string = PrintChar((char)(~op1->c));
8575 exp->expType = op1->type;
8577 op1->type->refCount++;
8582 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8585 exp->string = PrintUChar((unsigned char)(~op1->uc));
8588 exp->expType = op1->type;
8590 op1->type->refCount++;
8595 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8597 int value2 = op2->i;
8600 exp->string = PrintInt((op1->i &= value2));
8603 exp->expType = op1->type;
8605 op1->type->refCount++;
8610 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8612 unsigned int value2 = op2->ui;
8615 exp->string = PrintUInt((op1->ui &= value2));
8618 exp->expType = op1->type;
8620 op1->type->refCount++;
8625 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8627 long long value2 = op2->i64;
8630 exp->string = PrintInt64((op1->i64 &= value2));
8633 exp->expType = op1->type;
8635 op1->type->refCount++;
8640 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8642 uint64 value2 = op2->ui64;
8645 exp->string = PrintUInt64((op1->ui64 &= value2));
8648 exp->expType = op1->type;
8650 op1->type->refCount++;
8655 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8657 short value2 = op2->s;
8660 exp->string = PrintShort((op1->s &= value2));
8663 exp->expType = op1->type;
8665 op1->type->refCount++;
8670 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8672 unsigned short value2 = op2->us;
8675 exp->string = PrintUShort((op1->us &= value2));
8678 exp->expType = op1->type;
8680 op1->type->refCount++;
8685 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8687 char value2 = op2->c;
8690 exp->string = PrintChar((op1->c &= value2));
8693 exp->expType = op1->type;
8695 op1->type->refCount++;
8700 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8702 unsigned char value2 = op2->uc;
8705 exp->string = PrintUChar((op1->uc &= value2));
8708 exp->expType = op1->type;
8710 op1->type->refCount++;
8715 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8717 int value2 = op2->i;
8720 exp->string = PrintInt((op1->i |= value2));
8723 exp->expType = op1->type;
8725 op1->type->refCount++;
8730 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8732 unsigned int value2 = op2->ui;
8735 exp->string = PrintUInt((op1->ui |= value2));
8738 exp->expType = op1->type;
8740 op1->type->refCount++;
8745 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8747 long long value2 = op2->i64;
8750 exp->string = PrintInt64((op1->i64 |= value2));
8753 exp->expType = op1->type;
8755 op1->type->refCount++;
8760 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8762 uint64 value2 = op2->ui64;
8765 exp->string = PrintUInt64((op1->ui64 |= value2));
8768 exp->expType = op1->type;
8770 op1->type->refCount++;
8775 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8777 short value2 = op2->s;
8780 exp->string = PrintShort((op1->s |= value2));
8783 exp->expType = op1->type;
8785 op1->type->refCount++;
8790 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8792 unsigned short value2 = op2->us;
8795 exp->string = PrintUShort((op1->us |= value2));
8798 exp->expType = op1->type;
8800 op1->type->refCount++;
8805 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8807 char value2 = op2->c;
8810 exp->string = PrintChar((op1->c |= value2));
8813 exp->expType = op1->type;
8815 op1->type->refCount++;
8820 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8822 unsigned char value2 = op2->uc;
8825 exp->string = PrintUChar((op1->uc |= value2));
8828 exp->expType = op1->type;
8830 op1->type->refCount++;
8835 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8837 int value2 = op2->i;
8840 exp->string = PrintInt((op1->i ^= value2));
8843 exp->expType = op1->type;
8845 op1->type->refCount++;
8850 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8852 unsigned int value2 = op2->ui;
8855 exp->string = PrintUInt((op1->ui ^= value2));
8858 exp->expType = op1->type;
8860 op1->type->refCount++;
8865 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8867 long long value2 = op2->i64;
8870 exp->string = PrintInt64((op1->i64 ^= value2));
8873 exp->expType = op1->type;
8875 op1->type->refCount++;
8880 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8882 uint64 value2 = op2->ui64;
8885 exp->string = PrintUInt64((op1->ui64 ^= value2));
8888 exp->expType = op1->type;
8890 op1->type->refCount++;
8895 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8897 short value2 = op2->s;
8900 exp->string = PrintShort((op1->s ^= value2));
8903 exp->expType = op1->type;
8905 op1->type->refCount++;
8910 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8912 unsigned short value2 = op2->us;
8915 exp->string = PrintUShort((op1->us ^= value2));
8918 exp->expType = op1->type;
8920 op1->type->refCount++;
8925 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8927 char value2 = op2->c;
8930 exp->string = PrintChar((op1->c ^= value2));
8933 exp->expType = op1->type;
8935 op1->type->refCount++;
8940 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8942 unsigned char value2 = op2->uc;
8945 exp->string = PrintUChar((op1->uc ^= value2));
8948 exp->expType = op1->type;
8950 op1->type->refCount++;
8955 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8957 int value2 = op2->i;
8960 exp->string = PrintInt((op1->i <<= value2));
8963 exp->expType = op1->type;
8965 op1->type->refCount++;
8970 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8972 unsigned int value2 = op2->ui;
8975 exp->string = PrintUInt((op1->ui <<= value2));
8978 exp->expType = op1->type;
8980 op1->type->refCount++;
8985 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8987 long long value2 = op2->i64;
8990 exp->string = PrintInt64((op1->i64 <<= value2));
8993 exp->expType = op1->type;
8995 op1->type->refCount++;
9000 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9002 uint64 value2 = op2->ui64;
9005 exp->string = PrintUInt64((op1->ui64 <<= value2));
9008 exp->expType = op1->type;
9010 op1->type->refCount++;
9015 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9017 short value2 = op2->s;
9020 exp->string = PrintShort((op1->s <<= value2));
9023 exp->expType = op1->type;
9025 op1->type->refCount++;
9030 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9032 unsigned short value2 = op2->us;
9035 exp->string = PrintUShort((op1->us <<= value2));
9038 exp->expType = op1->type;
9040 op1->type->refCount++;
9045 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9047 char value2 = op2->c;
9050 exp->string = PrintChar((op1->c <<= value2));
9053 exp->expType = op1->type;
9055 op1->type->refCount++;
9060 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9062 unsigned char value2 = op2->uc;
9065 exp->string = PrintUChar((op1->uc <<= value2));
9068 exp->expType = op1->type;
9070 op1->type->refCount++;
9075 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9077 int value2 = op2->i;
9080 exp->string = PrintInt((op1->i >>= value2));
9083 exp->expType = op1->type;
9085 op1->type->refCount++;
9090 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9092 unsigned int value2 = op2->ui;
9095 exp->string = PrintUInt((op1->ui >>= value2));
9098 exp->expType = op1->type;
9100 op1->type->refCount++;
9105 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9107 long long value2 = op2->i64;
9110 exp->string = PrintInt64((op1->i64 >>= value2));
9113 exp->expType = op1->type;
9115 op1->type->refCount++;
9120 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9122 uint64 value2 = op2->ui64;
9125 exp->string = PrintUInt64((op1->ui64 >>= value2));
9128 exp->expType = op1->type;
9130 op1->type->refCount++;
9135 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9137 short value2 = op2->s;
9140 exp->string = PrintShort((op1->s >>= value2));
9143 exp->expType = op1->type;
9145 op1->type->refCount++;
9150 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9152 unsigned short value2 = op2->us;
9155 exp->string = PrintUShort((op1->us >>= value2));
9158 exp->expType = op1->type;
9160 op1->type->refCount++;
9165 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9167 char value2 = op2->c;
9170 exp->string = PrintChar((op1->c >>= value2));
9173 exp->expType = op1->type;
9175 op1->type->refCount++;
9180 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9182 unsigned char value2 = op2->uc;
9185 exp->string = PrintUChar((op1->uc >>= value2));
9188 exp->expType = op1->type;
9190 op1->type->refCount++;
9195 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9198 exp->string = PrintInt((int)(!op1->i));
9201 exp->expType = op1->type;
9203 op1->type->refCount++;
9208 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9211 exp->string = PrintUInt((unsigned int)(!op1->ui));
9214 exp->expType = op1->type;
9216 op1->type->refCount++;
9221 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9224 exp->string = PrintInt64((long long)(!op1->i64));
9227 exp->expType = op1->type;
9229 op1->type->refCount++;
9234 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9237 exp->string = PrintUInt64((uint64)(!op1->ui64));
9240 exp->expType = op1->type;
9242 op1->type->refCount++;
9247 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9250 exp->string = PrintShort((short)(!op1->s));
9253 exp->expType = op1->type;
9255 op1->type->refCount++;
9260 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9263 exp->string = PrintUShort((unsigned short)(!op1->us));
9266 exp->expType = op1->type;
9268 op1->type->refCount++;
9273 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9276 exp->string = PrintChar((char)(!op1->c));
9279 exp->expType = op1->type;
9281 op1->type->refCount++;
9286 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9289 exp->string = PrintUChar((unsigned char)(!op1->uc));
9292 exp->expType = op1->type;
9294 op1->type->refCount++;
9299 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9301 int value2 = op2->i;
9304 exp->string = PrintInt((int)(op1->i == value2));
9307 exp->expType = op1->type;
9309 op1->type->refCount++;
9314 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9316 unsigned int value2 = op2->ui;
9319 exp->string = PrintUInt((unsigned int)(op1->ui == value2));
9322 exp->expType = op1->type;
9324 op1->type->refCount++;
9329 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9331 long long value2 = op2->i64;
9334 exp->string = PrintInt64((long long)(op1->i64 == value2));
9337 exp->expType = op1->type;
9339 op1->type->refCount++;
9344 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9346 uint64 value2 = op2->ui64;
9349 exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
9352 exp->expType = op1->type;
9354 op1->type->refCount++;
9359 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9361 short value2 = op2->s;
9364 exp->string = PrintShort((short)(op1->s == value2));
9367 exp->expType = op1->type;
9369 op1->type->refCount++;
9374 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9376 unsigned short value2 = op2->us;
9379 exp->string = PrintUShort((unsigned short)(op1->us == value2));
9382 exp->expType = op1->type;
9384 op1->type->refCount++;
9389 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9391 char value2 = op2->c;
9394 exp->string = PrintChar((char)(op1->c == value2));
9397 exp->expType = op1->type;
9399 op1->type->refCount++;
9404 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9406 unsigned char value2 = op2->uc;
9409 exp->string = PrintUChar((unsigned char)(op1->uc == value2));
9412 exp->expType = op1->type;
9414 op1->type->refCount++;
9419 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9421 float value2 = op2->f;
9424 exp->string = PrintFloat((float)(op1->f == value2));
9427 exp->expType = op1->type;
9429 op1->type->refCount++;
9434 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9436 double value2 = op2->d;
9439 exp->string = PrintDouble((double)(op1->d == value2));
9442 exp->expType = op1->type;
9444 op1->type->refCount++;
9449 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9451 int value2 = op2->i;
9454 exp->string = PrintInt((int)(op1->i != value2));
9457 exp->expType = op1->type;
9459 op1->type->refCount++;
9464 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9466 unsigned int value2 = op2->ui;
9469 exp->string = PrintUInt((unsigned int)(op1->ui != value2));
9472 exp->expType = op1->type;
9474 op1->type->refCount++;
9479 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9481 long long value2 = op2->i64;
9484 exp->string = PrintInt64((long long)(op1->i64 != value2));
9487 exp->expType = op1->type;
9489 op1->type->refCount++;
9494 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9496 uint64 value2 = op2->ui64;
9499 exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
9502 exp->expType = op1->type;
9504 op1->type->refCount++;
9509 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9511 short value2 = op2->s;
9514 exp->string = PrintShort((short)(op1->s != value2));
9517 exp->expType = op1->type;
9519 op1->type->refCount++;
9524 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9526 unsigned short value2 = op2->us;
9529 exp->string = PrintUShort((unsigned short)(op1->us != value2));
9532 exp->expType = op1->type;
9534 op1->type->refCount++;
9539 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9541 char value2 = op2->c;
9544 exp->string = PrintChar((char)(op1->c != value2));
9547 exp->expType = op1->type;
9549 op1->type->refCount++;
9554 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9556 unsigned char value2 = op2->uc;
9559 exp->string = PrintUChar((unsigned char)(op1->uc != value2));
9562 exp->expType = op1->type;
9564 op1->type->refCount++;
9569 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9571 float value2 = op2->f;
9574 exp->string = PrintFloat((float)(op1->f != value2));
9577 exp->expType = op1->type;
9579 op1->type->refCount++;
9584 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9586 double value2 = op2->d;
9589 exp->string = PrintDouble((double)(op1->d != value2));
9592 exp->expType = op1->type;
9594 op1->type->refCount++;
9599 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9601 int value2 = op2->i;
9604 exp->string = PrintInt((int)(op1->i && value2));
9607 exp->expType = op1->type;
9609 op1->type->refCount++;
9614 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9616 unsigned int value2 = op2->ui;
9619 exp->string = PrintUInt((unsigned int)(op1->ui && value2));
9622 exp->expType = op1->type;
9624 op1->type->refCount++;
9629 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9631 long long value2 = op2->i64;
9634 exp->string = PrintInt64((long long)(op1->i64 && value2));
9637 exp->expType = op1->type;
9639 op1->type->refCount++;
9644 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9646 uint64 value2 = op2->ui64;
9649 exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
9652 exp->expType = op1->type;
9654 op1->type->refCount++;
9659 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9661 short value2 = op2->s;
9664 exp->string = PrintShort((short)(op1->s && value2));
9667 exp->expType = op1->type;
9669 op1->type->refCount++;
9674 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9676 unsigned short value2 = op2->us;
9679 exp->string = PrintUShort((unsigned short)(op1->us && value2));
9682 exp->expType = op1->type;
9684 op1->type->refCount++;
9689 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9691 char value2 = op2->c;
9694 exp->string = PrintChar((char)(op1->c && value2));
9697 exp->expType = op1->type;
9699 op1->type->refCount++;
9704 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9706 unsigned char value2 = op2->uc;
9709 exp->string = PrintUChar((unsigned char)(op1->uc && value2));
9712 exp->expType = op1->type;
9714 op1->type->refCount++;
9719 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9721 float value2 = op2->f;
9724 exp->string = PrintFloat((float)(op1->f && value2));
9727 exp->expType = op1->type;
9729 op1->type->refCount++;
9734 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9736 double value2 = op2->d;
9739 exp->string = PrintDouble((double)(op1->d && value2));
9742 exp->expType = op1->type;
9744 op1->type->refCount++;
9749 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9751 int value2 = op2->i;
9754 exp->string = PrintInt((int)(op1->i || value2));
9757 exp->expType = op1->type;
9759 op1->type->refCount++;
9764 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9766 unsigned int value2 = op2->ui;
9769 exp->string = PrintUInt((unsigned int)(op1->ui || value2));
9772 exp->expType = op1->type;
9774 op1->type->refCount++;
9779 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9781 long long value2 = op2->i64;
9784 exp->string = PrintInt64((long long)(op1->i64 || value2));
9787 exp->expType = op1->type;
9789 op1->type->refCount++;
9794 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9796 uint64 value2 = op2->ui64;
9799 exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
9802 exp->expType = op1->type;
9804 op1->type->refCount++;
9809 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9811 short value2 = op2->s;
9814 exp->string = PrintShort((short)(op1->s || value2));
9817 exp->expType = op1->type;
9819 op1->type->refCount++;
9824 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9826 unsigned short value2 = op2->us;
9829 exp->string = PrintUShort((unsigned short)(op1->us || value2));
9832 exp->expType = op1->type;
9834 op1->type->refCount++;
9839 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9841 char value2 = op2->c;
9844 exp->string = PrintChar((char)(op1->c || value2));
9847 exp->expType = op1->type;
9849 op1->type->refCount++;
9854 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9856 unsigned char value2 = op2->uc;
9859 exp->string = PrintUChar((unsigned char)(op1->uc || value2));
9862 exp->expType = op1->type;
9864 op1->type->refCount++;
9869 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9871 float value2 = op2->f;
9874 exp->string = PrintFloat((float)(op1->f || value2));
9877 exp->expType = op1->type;
9879 op1->type->refCount++;
9884 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9886 double value2 = op2->d;
9889 exp->string = PrintDouble((double)(op1->d || value2));
9892 exp->expType = op1->type;
9894 op1->type->refCount++;
9899 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9901 int value2 = op2->i;
9904 exp->string = PrintInt((int)(op1->i > value2));
9907 exp->expType = op1->type;
9909 op1->type->refCount++;
9914 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9916 unsigned int value2 = op2->ui;
9919 exp->string = PrintUInt((unsigned int)(op1->ui > value2));
9922 exp->expType = op1->type;
9924 op1->type->refCount++;
9929 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9931 long long value2 = op2->i64;
9934 exp->string = PrintInt64((long long)(op1->i64 > value2));
9937 exp->expType = op1->type;
9939 op1->type->refCount++;
9944 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9946 uint64 value2 = op2->ui64;
9949 exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
9952 exp->expType = op1->type;
9954 op1->type->refCount++;
9959 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9961 short value2 = op2->s;
9964 exp->string = PrintShort((short)(op1->s > value2));
9967 exp->expType = op1->type;
9969 op1->type->refCount++;
9974 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9976 unsigned short value2 = op2->us;
9979 exp->string = PrintUShort((unsigned short)(op1->us > value2));
9982 exp->expType = op1->type;
9984 op1->type->refCount++;
9989 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9991 char value2 = op2->c;
9994 exp->string = PrintChar((char)(op1->c > value2));
9997 exp->expType = op1->type;
9999 op1->type->refCount++;
10004 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10006 unsigned char value2 = op2->uc;
10009 exp->string = PrintUChar((unsigned char)(op1->uc > value2));
10012 exp->expType = op1->type;
10014 op1->type->refCount++;
10019 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10021 float value2 = op2->f;
10024 exp->string = PrintFloat((float)(op1->f > value2));
10027 exp->expType = op1->type;
10029 op1->type->refCount++;
10034 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10036 double value2 = op2->d;
10039 exp->string = PrintDouble((double)(op1->d > value2));
10042 exp->expType = op1->type;
10044 op1->type->refCount++;
10049 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10051 int value2 = op2->i;
10054 exp->string = PrintInt((int)(op1->i < value2));
10057 exp->expType = op1->type;
10059 op1->type->refCount++;
10064 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10066 unsigned int value2 = op2->ui;
10069 exp->string = PrintUInt((unsigned int)(op1->ui < value2));
10072 exp->expType = op1->type;
10074 op1->type->refCount++;
10079 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10081 long long value2 = op2->i64;
10084 exp->string = PrintInt64((long long)(op1->i64 < value2));
10087 exp->expType = op1->type;
10089 op1->type->refCount++;
10094 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10096 uint64 value2 = op2->ui64;
10099 exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
10102 exp->expType = op1->type;
10104 op1->type->refCount++;
10109 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10111 short value2 = op2->s;
10114 exp->string = PrintShort((short)(op1->s < value2));
10117 exp->expType = op1->type;
10119 op1->type->refCount++;
10124 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10126 unsigned short value2 = op2->us;
10129 exp->string = PrintUShort((unsigned short)(op1->us < value2));
10132 exp->expType = op1->type;
10134 op1->type->refCount++;
10139 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10141 char value2 = op2->c;
10144 exp->string = PrintChar((char)(op1->c < value2));
10147 exp->expType = op1->type;
10149 op1->type->refCount++;
10154 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10156 unsigned char value2 = op2->uc;
10159 exp->string = PrintUChar((unsigned char)(op1->uc < value2));
10162 exp->expType = op1->type;
10164 op1->type->refCount++;
10169 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10171 float value2 = op2->f;
10174 exp->string = PrintFloat((float)(op1->f < value2));
10177 exp->expType = op1->type;
10179 op1->type->refCount++;
10184 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10186 double value2 = op2->d;
10189 exp->string = PrintDouble((double)(op1->d < value2));
10192 exp->expType = op1->type;
10194 op1->type->refCount++;
10199 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10201 int value2 = op2->i;
10204 exp->string = PrintInt((int)(op1->i >= value2));
10207 exp->expType = op1->type;
10209 op1->type->refCount++;
10214 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10216 unsigned int value2 = op2->ui;
10219 exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
10222 exp->expType = op1->type;
10224 op1->type->refCount++;
10229 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10231 long long value2 = op2->i64;
10234 exp->string = PrintInt64((long long)(op1->i64 >= value2));
10237 exp->expType = op1->type;
10239 op1->type->refCount++;
10244 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10246 uint64 value2 = op2->ui64;
10249 exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
10252 exp->expType = op1->type;
10254 op1->type->refCount++;
10259 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10261 short value2 = op2->s;
10264 exp->string = PrintShort((short)(op1->s >= value2));
10267 exp->expType = op1->type;
10269 op1->type->refCount++;
10274 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10276 unsigned short value2 = op2->us;
10279 exp->string = PrintUShort((unsigned short)(op1->us >= value2));
10282 exp->expType = op1->type;
10284 op1->type->refCount++;
10289 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10291 char value2 = op2->c;
10294 exp->string = PrintChar((char)(op1->c >= value2));
10297 exp->expType = op1->type;
10299 op1->type->refCount++;
10304 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10306 unsigned char value2 = op2->uc;
10309 exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
10312 exp->expType = op1->type;
10314 op1->type->refCount++;
10319 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10321 float value2 = op2->f;
10324 exp->string = PrintFloat((float)(op1->f >= value2));
10327 exp->expType = op1->type;
10329 op1->type->refCount++;
10334 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10336 double value2 = op2->d;
10339 exp->string = PrintDouble((double)(op1->d >= value2));
10342 exp->expType = op1->type;
10344 op1->type->refCount++;
10349 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10351 int value2 = op2->i;
10354 exp->string = PrintInt((int)(op1->i <= value2));
10357 exp->expType = op1->type;
10359 op1->type->refCount++;
10364 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10366 unsigned int value2 = op2->ui;
10369 exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
10372 exp->expType = op1->type;
10374 op1->type->refCount++;
10379 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10381 long long value2 = op2->i64;
10384 exp->string = PrintInt64((long long)(op1->i64 <= value2));
10387 exp->expType = op1->type;
10389 op1->type->refCount++;
10394 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10396 uint64 value2 = op2->ui64;
10399 exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
10402 exp->expType = op1->type;
10404 op1->type->refCount++;
10409 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10411 short value2 = op2->s;
10414 exp->string = PrintShort((short)(op1->s <= value2));
10417 exp->expType = op1->type;
10419 op1->type->refCount++;
10424 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10426 unsigned short value2 = op2->us;
10429 exp->string = PrintUShort((unsigned short)(op1->us <= value2));
10432 exp->expType = op1->type;
10434 op1->type->refCount++;
10439 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10441 char value2 = op2->c;
10444 exp->string = PrintChar((char)(op1->c <= value2));
10447 exp->expType = op1->type;
10449 op1->type->refCount++;
10454 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10456 unsigned char value2 = op2->uc;
10459 exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
10462 exp->expType = op1->type;
10464 op1->type->refCount++;
10469 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10471 float value2 = op2->f;
10474 exp->string = PrintFloat((float)(op1->f <= value2));
10477 exp->expType = op1->type;
10479 op1->type->refCount++;
10484 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10486 double value2 = op2->d;
10489 exp->string = PrintDouble((double)(op1->d <= value2));
10492 exp->expType = op1->type;
10494 op1->type->refCount++;
10499 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10502 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10505 exp->expType = op1->type;
10507 op1->type->refCount++;
10512 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10515 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10518 exp->expType = op1->type;
10520 op1->type->refCount++;
10525 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10528 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10531 exp->expType = op1->type;
10533 op1->type->refCount++;
10538 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10541 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10544 exp->expType = op1->type;
10546 op1->type->refCount++;
10551 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10554 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10557 exp->expType = op1->type;
10559 op1->type->refCount++;
10564 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10567 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10570 exp->expType = op1->type;
10572 op1->type->refCount++;
10577 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10580 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10583 exp->expType = op1->type;
10585 op1->type->refCount++;
10590 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10593 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10596 exp->expType = op1->type;
10598 op1->type->refCount++;
10603 struct OpTable intOps =
10605 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
10608 struct OpTable uintOps =
10610 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
10613 struct OpTable int64Ops =
10615 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
10618 struct OpTable uint64Ops =
10620 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
10623 struct OpTable shortOps =
10625 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
10628 struct OpTable ushortOps =
10630 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
10633 struct OpTable floatOps =
10635 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
10638 struct OpTable doubleOps =
10640 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
10643 struct OpTable charOps =
10645 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
10648 struct OpTable ucharOps =
10650 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
10653 void ReadString(char * output, char * string)
10655 int len = strlen(string);
10657 unsigned int quoted = 0x0, escaped = 0x0;
10659 for(c = 0; c < len; c++)
10661 char ch = string[c];
10719 int UnescapeString(char * d, char * s, int len)
10724 while(j < len && (ch = s[j]))
10729 switch((ch = s[++j]))
10775 char * OffsetEscapedString(char * s, int len, int offset)
10780 while(j < len && k < offset && (ch = s[j]))
10786 return (k == offset) ? s + j : (((void *)0));
10789 extern long long __ecereNameSpace__ecere__com___strtoi64(const char * string, const char * * endString, int base);
10791 extern uint64 __ecereNameSpace__ecere__com___strtoui64(const char * string, const char * * endString, int base);
10793 extern double strtod(const char * , char * * );
10795 extern float (* __ecereMethod_float_inf)(void);
10797 extern float (* __ecereMethod_float_nan)(void);
10799 extern double (* __ecereMethod_double_inf)(void);
10801 extern double (* __ecereMethod_double_nan)(void);
10803 struct Operand GetOperand(struct Expression * exp)
10805 struct Operand op =
10809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10812 struct Type * type = exp->expType;
10816 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10818 if(!type->_class->registered->dataType)
10819 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10820 type = type->_class->registered->dataType;
10822 if(exp->type == 3 && op.kind == 13)
10824 op.ui64 = (uint64)exp->string;
10826 op.ops = uint64Ops;
10828 else if(exp->isConstant && exp->type == 2)
10830 op.kind = type->kind;
10831 op.type = exp->expType;
10837 if(exp->constant[0] == '\'')
10839 op.c = exp->constant[1];
10842 else if(type->isSigned)
10844 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10849 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10857 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10862 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10863 op.ops = ushortOps;
10870 op.i = strtol(exp->constant, (((void *)0)), 0);
10875 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10883 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10888 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10889 op.ops = uint64Ops;
10896 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10901 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10902 op.ops = uint64Ops;
10909 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10914 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10915 op.ops = uint64Ops;
10920 if(!strcmp(exp->constant, "inf"))
10921 op.f = __ecereMethod_float_inf();
10922 else if(!strcmp(exp->constant, "-inf"))
10923 op.f = -__ecereMethod_float_inf();
10924 else if(!strcmp(exp->constant, "nan"))
10925 op.f = __ecereMethod_float_nan();
10926 else if(!strcmp(exp->constant, "-nan"))
10927 op.f = -__ecereMethod_float_nan();
10929 op.f = (float)strtod(exp->constant, (((void *)0)));
10933 if(!strcmp(exp->constant, "inf"))
10934 op.d = __ecereMethod_double_inf();
10935 else if(!strcmp(exp->constant, "-inf"))
10936 op.d = -__ecereMethod_double_inf();
10937 else if(!strcmp(exp->constant, "nan"))
10938 op.d = __ecereMethod_double_nan();
10939 else if(!strcmp(exp->constant, "-nan"))
10940 op.d = -__ecereMethod_double_nan();
10942 op.d = (double)strtod(exp->constant, (((void *)0)));
10943 op.ops = doubleOps;
10948 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10950 op.ops = uint64Ops;
10958 int __ecereVMethodID_class_OnGetString;
10960 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10962 static __attribute__((unused)) void UnusedFunction()
10966 ((const char * (*)(struct __ecereNameSpace__ecere__com__Class *, const void *, char * tempString, void * fieldData, unsigned int * needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
10969 extern int __ecereVMethodID_class_OnGetString;
10971 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10973 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10975 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10977 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10978 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10981 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10982 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10983 struct Type * type;
10984 void * ptr = inst->data + dataMember->offset + offset;
10985 char * result = (((void *)0));
10987 exp->loc = member->loc = inst->loc;
10988 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10989 if(!dataMember->dataType)
10990 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10991 type = dataMember->dataType;
10992 if(type->kind == 8)
10994 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10996 if(_class->type == 4)
10998 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11002 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11003 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11005 for(item = e->values.first; item; item = item->next)
11007 if((int)item->data == *(int *)ptr)
11009 result = item->name;
11015 exp->identifier = MkIdentifier(result);
11017 exp->destType = MkClassType(_class->fullName);
11018 ProcessExpressionType(exp);
11022 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11024 if(!_class->dataType)
11025 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11026 type = _class->dataType;
11035 FreeExpContents(exp);
11036 exp->constant = PrintFloat(*(float *)ptr);
11042 FreeExpContents(exp);
11043 exp->constant = PrintDouble(*(double *)ptr);
11049 FreeExpContents(exp);
11050 exp->constant = PrintInt(*(int *)ptr);
11056 FreeExpContents(exp);
11057 exp->constant = PrintInt64(*(long long *)ptr);
11063 FreeExpContents(exp);
11064 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11070 FreeExpContents(exp);
11071 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11076 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11079 ListAdd(memberList, member);
11081 if(parentDataMember->type == 1)
11086 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11088 void PopulateInstance(struct Instantiation * inst)
11090 struct Symbol * classSym = inst->_class->symbol;
11091 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
11092 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11093 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11096 inst->members = MkListOne(MkMembersInitList(memberList));
11098 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11099 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11101 if(!dataMember->isProperty)
11103 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11104 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11107 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11108 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11109 struct Type * type;
11110 void * ptr = inst->data + dataMember->offset;
11111 char * result = (((void *)0));
11113 exp->loc = member->loc = inst->loc;
11114 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11115 if(!dataMember->dataType)
11116 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11117 type = dataMember->dataType;
11118 if(type->kind == 8)
11120 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11122 if(_class->type == 4)
11124 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11128 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11129 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11131 for(item = e->values.first; item; item = item->next)
11133 if((int)item->data == *(int *)ptr)
11135 result = item->name;
11142 exp->identifier = MkIdentifier(result);
11144 exp->destType = MkClassType(_class->fullName);
11145 ProcessExpressionType(exp);
11148 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11150 if(!_class->dataType)
11151 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11152 type = _class->dataType;
11161 exp->constant = PrintFloat(*(float *)ptr);
11167 exp->constant = PrintDouble(*(double *)ptr);
11173 exp->constant = PrintInt(*(int *)ptr);
11179 exp->constant = PrintInt64(*(long long *)ptr);
11185 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11190 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11193 ListAdd(memberList, member);
11199 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, unsigned int * offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
11201 extern void FreeInstance(struct Instantiation * inst);
11203 void ComputeInstantiation(struct Expression * exp)
11205 struct Instantiation * inst = exp->instance;
11206 struct MembersInit * members;
11207 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11208 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11209 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11210 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11211 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11212 int subMemberStackPos = 0;
11215 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11219 if(_class->type == 0 || _class->type == 5)
11221 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11222 if(_class->type == 0)
11223 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11226 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11230 for(members = (*inst->members).first; members; members = members->next)
11232 switch(members->type)
11236 if(members->dataMembers)
11238 struct MemberInit * member;
11240 for(member = (*members->dataMembers).first; member; member = member->next)
11242 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11243 unsigned int found = 0x0;
11244 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11245 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11246 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11247 unsigned int dataMemberOffset;
11251 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11254 if(curMember->isProperty)
11255 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11258 dataMember = curMember;
11259 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11260 if(_class->type == 0)
11261 dataMemberOffset += _class->base->structSize;
11268 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11272 if(prop->memberAccess == 1)
11274 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11275 curClass = prop->_class;
11280 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11281 int _subMemberStackPos = 0;
11283 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11287 if(dataMember->memberAccess == 1)
11289 curMember = dataMember;
11290 curClass = dataMember->_class;
11291 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11292 subMemberStackPos = _subMemberStackPos;
11297 if(found && member->initializer && member->initializer->type == 0)
11299 struct Expression * value = member->initializer->exp;
11300 struct Type * type = (((void *)0));
11301 unsigned int deepMember = 0x0;
11305 type = prop->dataType;
11307 else if(dataMember)
11309 if(!dataMember->dataType)
11310 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11311 type = dataMember->dataType;
11313 if(ident && ident->next)
11316 for(ident = ident->next; ident && type; ident = ident->next)
11318 if(type->kind == 8)
11320 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11322 type = prop->dataType;
11325 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11327 type = dataMember->dataType;
11330 else if(type->kind == 9 || type->kind == 10)
11332 struct Type * memberType;
11334 for(memberType = type->members.first; memberType; memberType = memberType->next)
11336 if(!strcmp(memberType->name, ident->string))
11347 FreeType(value->destType);
11348 value->destType = type;
11351 ComputeExpression(value);
11353 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11355 if(type->kind == 8)
11357 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11359 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11361 if(!_class->dataType)
11362 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11363 type = _class->dataType;
11368 void * ptr = inst->data + dataMemberOffset;
11370 if(value->type == 2)
11376 GetInt(value, (int *)ptr);
11381 GetInt64(value, (long long *)ptr);
11386 GetIntPtr(value, (intptr_t *)ptr);
11391 GetIntSize(value, (ssize_t *)ptr);
11396 GetFloat(value, (float *)ptr);
11401 GetDouble(value, (double *)ptr);
11406 else if(value->type == 1)
11408 if(type->kind == 8)
11410 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11412 if(_class->type == 1)
11414 ComputeTypeSize(type);
11415 if(value->instance->data)
11416 memcpy(ptr, value->instance->data, type->size);
11423 if(value->type == 1 && value->instance->data)
11425 if(type->kind == 8)
11427 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11429 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)))
11431 void (* Set)(void *, void *) = (void *)prop->Set;
11433 Set(inst->data, value->instance->data);
11434 PopulateInstance(inst);
11438 else if(value->type == 2)
11444 void (* Set)(void *, double) = (void *)prop->Set;
11446 Set(inst->data, strtod(value->constant, (((void *)0))));
11451 void (* Set)(void *, float) = (void *)prop->Set;
11453 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11458 void (* Set)(void *, int) = (void *)prop->Set;
11460 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11465 void (* Set)(void *, long long) = (void *)prop->Set;
11467 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11472 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11474 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11479 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11481 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11486 else if(value->type == 3)
11490 ReadString(temp, value->string);
11491 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11495 else if(!deepMember && type && _class->type == 3)
11499 if(value->type == 2)
11501 if(type->kind == 8)
11503 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11505 if(_class->type == 3)
11507 if(!_class->dataType)
11508 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11509 type = _class->dataType;
11517 float (* Set)(float) = (void *)prop->Set;
11519 GetFloat(member->initializer->exp, &fValue);
11520 exp->constant = PrintFloat(Set(fValue));
11527 double (* Set)(double) = (void *)prop->Set;
11529 GetDouble(member->initializer->exp, &dValue);
11530 exp->constant = PrintDouble(Set(dValue));
11538 else if(!deepMember && type && _class->type == 2)
11542 if(value->type == 1 && value->instance->data)
11544 unsigned int (* Set)(void *) = (void *)prop->Set;
11546 bits = Set(value->instance->data);
11548 else if(value->type == 2)
11552 else if(dataMember)
11554 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11555 struct Type * type;
11558 bits = (bits & ~bitMember->mask);
11559 if(!bitMember->dataType)
11560 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11561 type = bitMember->dataType;
11562 if(type->kind == 8 && type->_class && type->_class->registered)
11564 if(!type->_class->registered->dataType)
11565 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11566 type = type->_class->registered->dataType;
11575 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11583 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11592 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11600 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11608 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11616 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11621 bits |= part << bitMember->pos;
11627 if(_class && _class->type == 3)
11629 ComputeExpression(member->initializer->exp);
11630 exp->constant = member->initializer->exp->constant;
11632 member->initializer->exp->constant = (((void *)0));
11642 if(_class && _class->type == 2)
11644 exp->constant = PrintHexUInt(bits);
11649 FreeInstance(inst);
11653 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11655 unsigned int result = 0x0;
11660 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11661 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11665 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11666 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11669 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)
11670 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11673 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)
11674 result = GetOpFloat(op, &op->f);
11677 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)
11678 result = GetOpDouble(op, &op->d);
11681 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)
11682 result = GetOpUIntPtr(op, &op->ui64);
11685 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)
11686 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11689 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11690 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11693 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11694 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11700 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11702 if(exp->op.op == SIZEOF)
11704 FreeExpContents(exp);
11706 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11716 struct Expression * exp2 = exp->op.exp2;
11718 exp->op.exp2 = (((void *)0));
11719 FreeExpContents(exp);
11720 FreeType(exp->expType);
11721 FreeType(exp->destType);
11723 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11729 FreeExpContents(exp);
11730 op1->ops.Neg(exp, op1);
11734 if(op1->ops.BitNot)
11736 FreeExpContents(exp);
11737 op1->ops.BitNot(exp, op1);
11743 FreeExpContents(exp);
11744 op1->ops.Not(exp, op1);
11751 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11753 if(Promote(op2, op1->kind, op1->type->isSigned))
11754 op2->kind = op1->kind, op2->ops = op1->ops;
11755 else if(Promote(op1, op2->kind, op2->type->isSigned))
11756 op1->kind = op2->kind, op1->ops = op2->ops;
11763 FreeExpContents(exp);
11764 op1->ops.Add(exp, op1, op2);
11770 FreeExpContents(exp);
11771 op1->ops.Sub(exp, op1, op2);
11777 FreeExpContents(exp);
11778 op1->ops.Mul(exp, op1, op2);
11784 FreeExpContents(exp);
11785 op1->ops.Div(exp, op1, op2);
11791 FreeExpContents(exp);
11792 op1->ops.Mod(exp, op1, op2);
11798 if(op1->ops.BitAnd)
11800 FreeExpContents(exp);
11801 op1->ops.BitAnd(exp, op1, op2);
11808 FreeExpContents(exp);
11809 op1->ops.BitOr(exp, op1, op2);
11813 if(op1->ops.BitXor)
11815 FreeExpContents(exp);
11816 op1->ops.BitXor(exp, op1, op2);
11820 if(op1->ops.LShift)
11822 FreeExpContents(exp);
11823 op1->ops.LShift(exp, op1, op2);
11827 if(op1->ops.RShift)
11829 FreeExpContents(exp);
11830 op1->ops.RShift(exp, op1, op2);
11836 FreeExpContents(exp);
11837 op1->ops.Equ(exp, op1, op2);
11843 FreeExpContents(exp);
11844 op1->ops.Nqu(exp, op1, op2);
11850 FreeExpContents(exp);
11851 op1->ops.And(exp, op1, op2);
11857 FreeExpContents(exp);
11858 op1->ops.Or(exp, op1, op2);
11864 FreeExpContents(exp);
11865 op1->ops.Grt(exp, op1, op2);
11871 FreeExpContents(exp);
11872 op1->ops.Sma(exp, op1, op2);
11876 if(op1->ops.GrtEqu)
11878 FreeExpContents(exp);
11879 op1->ops.GrtEqu(exp, op1, op2);
11883 if(op1->ops.SmaEqu)
11885 FreeExpContents(exp);
11886 op1->ops.SmaEqu(exp, op1, op2);
11894 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11896 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11898 void ComputeExpression(struct Expression * exp)
11900 char expString[10240];
11902 expString[0] = '\0';
11907 ComputeInstantiation(exp);
11912 struct Expression * exp1, * exp2 = (((void *)0));
11913 struct Operand op1 =
11917 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11920 struct Operand op2 =
11924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11930 struct Expression * e = exp->op.exp2;
11932 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11934 if(e->type == 5 || e->type == 32 || e->type == 23)
11937 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11939 e = (*e->list).last;
11942 if(exp->op.op == 261 && e && e->expType)
11944 if(e->type == 3 && e->string)
11946 char * string = e->string;
11947 int len = strlen(string);
11948 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11950 len = UnescapeString(tmp, string + 1, len - 2);
11951 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11952 FreeExpContents(exp);
11954 exp->constant = PrintUInt(len + 1);
11958 struct Type * type = e->expType;
11961 FreeExpContents(exp);
11963 exp->constant = PrintUInt(ComputeTypeSize(type));
11969 ComputeExpression(exp->op.exp2);
11973 ComputeExpression(exp->op.exp1);
11974 exp1 = exp->op.exp1;
11975 exp2 = exp->op.exp2;
11976 op1 = GetOperand(exp1);
11978 op1.type->refCount++;
11981 op2 = GetOperand(exp2);
11983 op2.type->refCount++;
11988 exp1 = exp->op.exp2;
11989 op1 = GetOperand(exp1);
11991 op1.type->refCount++;
11993 CallOperator(exp, exp1, exp2, &op1, &op2);
11995 FreeType(op1.type);
11997 FreeType(op2.type);
12003 struct Expression * e, * n;
12005 for(e = (*exp->list).first; e; e = n)
12010 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
12011 struct Expression * prev = exp->prev;
12012 struct Expression * next = exp->next;
12014 ComputeExpression(e);
12015 FreeType(exp->expType);
12016 FreeType(exp->destType);
12020 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12021 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
12032 struct Expression * memberExp = exp->member.exp;
12033 struct Identifier * memberID = exp->member.member;
12034 struct Type * type;
12036 ComputeExpression(exp->member.exp);
12037 type = exp->member.exp->expType;
12040 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)));
12041 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12042 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12043 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
12045 if(type->kind == 19 && exp->member.exp->type == 24)
12046 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
12050 struct Symbol * classSym;
12053 PrintTypeNoConst(type, string, 0x0, 0x1);
12054 classSym = FindClass(string);
12055 _class = classSym ? classSym->registered : (((void *)0));
12057 if(exp->member.member)
12059 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
12061 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
12063 if(!prop && !member && _class && exp->member.member)
12065 struct Symbol * classSym = FindClass(exp->member.member->string);
12067 convertTo = _class;
12068 _class = classSym ? classSym->registered : (((void *)0));
12069 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12075 struct Type * type = prop->dataType;
12077 if(_class->type == 3)
12079 if(type->kind == 8)
12081 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12083 if(_class->type == 3)
12085 if(!_class->dataType)
12086 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12087 type = _class->dataType;
12095 float (* Get)(float) = (void *)prop->Get;
12097 GetFloat(exp->member.exp, &value);
12098 exp->constant = PrintFloat(Get ? Get(value) : value);
12105 double (* Get)(double);
12107 GetDouble(exp->member.exp, &value);
12109 Get = (void *)prop->Set;
12111 Get = (void *)prop->Get;
12112 exp->constant = PrintDouble(Get ? Get(value) : value);
12122 struct Expression * value = exp->member.exp;
12123 struct Type * type;
12125 if(!prop->dataType)
12126 ProcessPropertyType(prop);
12127 type = prop->dataType;
12131 else if(_class->type == 1)
12137 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12139 if(propertyClass->type == 1 && value->type == 1)
12141 void (* Set)(void *, void *) = (void *)prop->Set;
12143 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12144 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12145 exp->instance->_class = MkSpecifierName(_class->fullName);
12146 exp->instance->loc = exp->loc;
12148 Set(exp->instance->data, value->instance->data);
12149 PopulateInstance(exp->instance);
12156 void (* Set)(void *, int) = (void *)prop->Set;
12158 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12159 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12160 exp->instance->_class = MkSpecifierName(_class->fullName);
12161 exp->instance->loc = exp->loc;
12163 GetInt(value, &intValue);
12164 Set(exp->instance->data, intValue);
12165 PopulateInstance(exp->instance);
12170 long long intValue;
12171 void (* Set)(void *, long long) = (void *)prop->Set;
12173 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12174 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12175 exp->instance->_class = MkSpecifierName(_class->fullName);
12176 exp->instance->loc = exp->loc;
12178 GetInt64(value, &intValue);
12179 Set(exp->instance->data, intValue);
12180 PopulateInstance(exp->instance);
12186 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12188 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12189 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12190 exp->instance->_class = MkSpecifierName(_class->fullName);
12191 exp->instance->loc = exp->loc;
12193 GetIntPtr(value, &intValue);
12194 Set(exp->instance->data, intValue);
12195 PopulateInstance(exp->instance);
12201 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12203 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12204 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12205 exp->instance->_class = MkSpecifierName(_class->fullName);
12206 exp->instance->loc = exp->loc;
12208 GetIntSize(value, &intValue);
12209 Set(exp->instance->data, intValue);
12210 PopulateInstance(exp->instance);
12216 void (* Set)(void *, float) = (void *)prop->Set;
12218 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12219 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12220 exp->instance->_class = MkSpecifierName(_class->fullName);
12221 exp->instance->loc = exp->loc;
12223 GetFloat(value, &floatValue);
12224 Set(exp->instance->data, floatValue);
12225 PopulateInstance(exp->instance);
12230 double doubleValue;
12231 void (* Set)(void *, double) = (void *)prop->Set;
12233 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12234 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12235 exp->instance->_class = MkSpecifierName(_class->fullName);
12236 exp->instance->loc = exp->loc;
12238 GetDouble(value, &doubleValue);
12239 Set(exp->instance->data, doubleValue);
12240 PopulateInstance(exp->instance);
12245 else if(_class->type == 2)
12251 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12253 if(propertyClass->type == 1 && value->instance->data)
12255 unsigned int (* Set)(void *) = (void *)prop->Set;
12256 unsigned int bits = Set(value->instance->data);
12258 exp->constant = PrintHexUInt(bits);
12262 else if(_class->type == 2)
12264 unsigned int value;
12265 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12268 GetUInt(exp->member.exp, &value);
12270 exp->constant = PrintHexUInt(bits);
12279 if(_class->type == 2)
12281 unsigned int value;
12283 GetUInt(exp->member.exp, &value);
12288 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12290 if(_class->type == 1)
12292 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12294 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12295 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12296 exp->instance->_class = MkSpecifierName(_class->fullName);
12297 exp->instance->loc = exp->loc;
12299 Get(value, exp->instance->data);
12300 PopulateInstance(exp->instance);
12302 else if(_class->type == 2)
12304 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12305 uint64 bits = Get(value);
12307 exp->constant = PrintHexUInt64(bits);
12314 else if(_class->type == 1)
12316 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12322 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12324 if(_class->type == 1 && value)
12326 void (* Get)(void *, void *) = (void *)prop->Get;
12328 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12329 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12330 exp->instance->_class = MkSpecifierName(_class->fullName);
12331 exp->instance->loc = exp->loc;
12333 Get(value, exp->instance->data);
12334 PopulateInstance(exp->instance);
12345 exp->isConstant = 0x0;
12354 FreeExpression(memberExp);
12355 FreeIdentifier(memberID);
12361 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12363 FreeExpContents(exp);
12364 exp->constant = PrintUInt(ComputeTypeSize(type));
12371 struct Symbol * classSym = exp->_class->symbol;
12373 if(classSym && classSym->registered)
12375 if(classSym->registered->fixed)
12377 FreeSpecifier(exp->_class);
12378 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12383 char className[1024];
12385 strcpy(className, "__ecereClass_");
12386 FullClassNameCat(className, classSym->string, 0x1);
12387 MangleClassName(className);
12388 DeclareClass(classSym, className);
12389 FreeExpContents(exp);
12391 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12392 exp->member.member = MkIdentifier("structSize");
12399 struct Type * type;
12400 struct Expression * e = exp;
12402 if(exp->type == 11)
12405 ComputeExpression(exp->cast.exp);
12408 if(e && exp->expType)
12410 type = exp->expType;
12411 if(type->kind == 8)
12413 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12415 if(_class && (_class->type == 3 || _class->type == 2))
12417 if(!_class->dataType)
12418 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12419 type = _class->dataType;
12428 char value = (char)0;
12430 if(GetChar(e, &value))
12432 FreeExpContents(exp);
12433 exp->constant = PrintChar(value);
12439 unsigned char value = (unsigned char)0;
12441 if(GetUChar(e, &value))
12443 FreeExpContents(exp);
12444 exp->constant = PrintUChar(value);
12452 short value = (short)0;
12454 if(GetShort(e, &value))
12456 FreeExpContents(exp);
12457 exp->constant = PrintShort(value);
12463 unsigned short value = (unsigned short)0;
12465 if(GetUShort(e, &value))
12467 FreeExpContents(exp);
12468 exp->constant = PrintUShort(value);
12478 if(GetInt(e, &value))
12480 FreeExpContents(exp);
12481 exp->constant = PrintInt(value);
12487 unsigned int value = 0;
12489 if(GetUInt(e, &value))
12491 FreeExpContents(exp);
12492 exp->constant = PrintUInt(value);
12500 long long value = 0;
12502 if(GetInt64(e, &value))
12504 FreeExpContents(exp);
12505 exp->constant = PrintInt64(value);
12513 if(GetUInt64(e, &value))
12515 FreeExpContents(exp);
12516 exp->constant = PrintUInt64(value);
12524 intptr_t value = 0;
12526 if(GetIntPtr(e, &value))
12528 FreeExpContents(exp);
12529 exp->constant = PrintInt64((long long)value);
12535 uintptr_t value = 0;
12537 if(GetUIntPtr(e, &value))
12539 FreeExpContents(exp);
12540 exp->constant = PrintUInt64((uint64)value);
12550 if(GetIntSize(e, &value))
12552 FreeExpContents(exp);
12553 exp->constant = PrintInt64((long long)value);
12561 if(GetUIntSize(e, &value))
12563 FreeExpContents(exp);
12564 exp->constant = PrintUInt64((uint64)value);
12573 if(GetFloat(e, &value))
12575 FreeExpContents(exp);
12576 exp->constant = PrintFloat(value);
12585 if(GetDouble(e, &value))
12587 FreeExpContents(exp);
12588 exp->constant = PrintDouble(value);
12599 struct Operand op1 =
12603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12606 struct Operand op2 =
12610 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12613 struct Operand op3 =
12617 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12622 ComputeExpression((*exp->cond.exp).last);
12623 if(exp->cond.elseExp)
12624 ComputeExpression(exp->cond.elseExp);
12626 ComputeExpression(exp->cond.cond);
12627 op1 = GetOperand(exp->cond.cond);
12629 op1.type->refCount++;
12630 op2 = GetOperand((*exp->cond.exp).last);
12632 op2.type->refCount++;
12633 op3 = GetOperand(exp->cond.elseExp);
12635 op3.type->refCount++;
12638 FreeExpContents(exp);
12639 op1.ops.Cond(exp, &op1, &op2, &op3);
12642 FreeType(op1.type);
12644 FreeType(op2.type);
12646 FreeType(op3.type);
12652 void ApplyAnyObjectLogic(struct Expression * e);
12654 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla, unsigned int warnConst)
12656 unsigned int result = 0x1;
12660 struct __ecereNameSpace__ecere__sys__OldList converts =
12664 struct Conversion * convert;
12666 if(destType->kind == 0)
12668 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla, warnConst))
12672 for(convert = converts.first; convert; convert = convert->next)
12674 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12678 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12679 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12682 newExp->prev = (((void *)0));
12683 newExp->next = (((void *)0));
12684 newExp->destType = (((void *)0));
12688 exp->addedThis = 0x1;
12689 exp->member.exp = newExp;
12690 FreeType(exp->member.exp->expType);
12691 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12692 exp->member.exp->expType->classObjectType = objectType;
12693 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12694 exp->member.memberType = 1;
12695 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12696 exp->needCast = 0x1;
12698 exp->expType->refCount++;
12699 ApplyAnyObjectLogic(exp->member.exp);
12705 exp->addedThis = 0x1;
12706 exp->member.exp = newExp;
12707 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12709 newExp->byReference = 0x1;
12711 FreeType(exp->member.exp->expType);
12712 exp->member.exp->expType = (((void *)0));
12713 if(convert->convert->dataType)
12715 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12716 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12717 exp->member.exp->expType->refCount = 1;
12718 exp->member.exp->expType->classObjectType = objectType;
12719 ApplyAnyObjectLogic(exp->member.exp);
12721 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12722 exp->member.memberType = 4;
12723 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12724 exp->needCast = 0x1;
12725 if(convert->resultType)
12726 convert->resultType->refCount++;
12732 FreeType(exp->expType);
12735 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12736 exp->needCast = 0x1;
12738 exp->expType->refCount++;
12742 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12743 exp->needCast = 0x1;
12744 if(convert->resultType)
12745 convert->resultType->refCount++;
12749 if(exp->isConstant && inCompiler)
12750 ComputeExpression(exp);
12751 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12753 if(!result && exp->expType && converts.count)
12755 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0, warnConst);
12757 if(!result && exp->expType && exp->destType)
12759 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))
12766 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12768 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12770 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12772 void CheckTemplateTypes(struct Expression * exp)
12774 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12776 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12777 struct Context * context;
12781 exp->destType->refCount++;
12783 exp->expType->refCount++;
12784 newExp->prev = (((void *)0));
12785 newExp->next = (((void *)0));
12786 switch(exp->expType->kind)
12789 if(exp->destType->classObjectType)
12792 exp->destType->refCount--;
12794 exp->expType->refCount--;
12795 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12799 struct __ecereNameSpace__ecere__sys__OldList * specs;
12800 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12801 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12803 context = PushContext();
12804 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12805 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12806 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12808 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12809 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12810 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12811 exp->compound->compound.context = context;
12812 PopContext(context);
12817 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12818 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12822 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12824 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12825 struct Statement * compound;
12826 struct Context * context;
12830 exp->destType->refCount++;
12832 exp->expType->refCount++;
12833 newExp->prev = (((void *)0));
12834 newExp->next = (((void *)0));
12835 switch(exp->expType->kind)
12838 if(exp->destType->classObjectType)
12841 exp->destType->refCount--;
12843 exp->expType->refCount--;
12844 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12848 struct __ecereNameSpace__ecere__sys__OldList * specs;
12849 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12850 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12852 context = PushContext();
12853 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12854 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12855 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12857 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12858 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12859 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12860 exp->compound->compound.context = context;
12861 PopContext(context);
12866 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12869 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12870 ProcessExpressionType((*exp->list).first);
12876 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12877 newExp->needCast = 0x1;
12878 ProcessExpressionType((*exp->list).first);
12884 if(exp->expType->kind == 20)
12886 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12890 FreeType(exp->destType);
12891 FreeType(exp->expType);
12892 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12896 if(newExp->type == 8 && newExp->member.memberType == 3)
12900 exp->op.exp1 = (((void *)0));
12901 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12905 char typeString[1024];
12906 struct Declarator * decl;
12907 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12909 typeString[0] = '\0';
12910 PrintType(exp->expType, typeString, 0x0, 0x0);
12911 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12913 exp->cast.typeName = MkTypeName(specs, decl);
12914 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12915 exp->cast.exp->needCast = 0x1;
12923 extern int strncmp(const char * , const char * , size_t n);
12925 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
12927 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * nameSpace, const char * name)
12929 int nsLen = strlen(nameSpace);
12930 struct Symbol * symbol;
12932 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)))
12934 char * s = symbol->string;
12936 if(!strncmp(s, nameSpace, nsLen))
12941 for(c = strlen(s) - 1; c >= 0; c--)
12944 namePart = s + c + 1;
12945 if(!strcmp(namePart, name))
12953 return (((void *)0));
12956 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, const char * name)
12959 char nameSpace[1024];
12960 const char * namePart;
12961 unsigned int gotColon = 0x0;
12963 nameSpace[0] = '\0';
12964 for(c = strlen(name) - 1; c >= 0; c--)
12970 namePart = name + c + 1;
12971 while(c >= 0 && name[c] == ':')
12975 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12979 memcpy(nameSpace, name, c + 1);
12980 nameSpace[c + 1] = (char)0;
12981 return ScanWithNameSpace(tree, nameSpace, namePart);
12985 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12991 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12995 return ScanWithNameSpace(tree, "", namePart);
12997 return (((void *)0));
13000 static void ProcessDeclaration(struct Declaration * decl);
13002 struct Symbol * FindSymbol(const char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
13004 struct Context * ctx;
13005 struct Symbol * symbol = (((void *)0));
13007 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
13009 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
13011 symbol = (((void *)0));
13014 char curName[1024];
13016 strcpy(curName, thisNameSpace);
13017 strcat(curName, "::");
13018 strcat(curName, name);
13019 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
13022 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
13025 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
13026 if(symbol || ctx == endContext)
13029 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
13031 if(symbol->pointerExternal->type == 0)
13033 struct FunctionDefinition * function = symbol->pointerExternal->function;
13034 struct Context * tmpContext = curContext;
13036 curContext = (((void *)0));
13037 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
13038 curContext = tmpContext;
13039 symbol->pointerExternal->symbol = symbol;
13040 DeclareType(symbol->type, 0x1, 0x1);
13041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
13042 symbol->id = curExternal->symbol->idCode;
13044 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
13046 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
13047 symbol->id = curExternal->symbol->idCode;
13053 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13055 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13056 ListAdd(specs, MkSpecifier(UNSIGNED));
13061 if(type->_class->registered)
13063 if(!type->_class->registered->dataType)
13064 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
13065 GetTypeSpecs(type->_class->registered->dataType, specs);
13070 ListAdd(specs, MkSpecifier(DOUBLE));
13073 ListAdd(specs, MkSpecifier(FLOAT));
13076 ListAdd(specs, MkSpecifier(CHAR));
13079 ListAdd(specs, MkSpecifier(_BOOL));
13082 ListAdd(specs, MkSpecifier(SHORT));
13085 ListAdd(specs, MkSpecifier(INT64));
13088 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13091 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13095 ListAdd(specs, MkSpecifier(INT));
13100 static void PrintArraySize(struct Type * arrayType, char * string)
13106 if(arrayType->enumClass)
13107 strcat(size, arrayType->enumClass->string);
13108 else if(arrayType->arraySizeExp)
13109 PrintExpression(arrayType->arraySizeExp, size);
13111 strcat(string, size);
13114 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13118 if(printConst && type->constant)
13119 strcat(string, "const ");
13124 struct Symbol * c = type->_class;
13126 if(type->classObjectType == 2)
13127 strcat(string, "typed_object");
13128 else if(type->classObjectType == 3)
13129 strcat(string, "any_object");
13133 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13135 if(type->byReference)
13136 strcat(string, " &");
13140 strcat(string, "void");
13143 strcat(string, type->isSigned ? "int" : "uint");
13146 strcat(string, type->isSigned ? "int64" : "uint64");
13149 strcat(string, type->isSigned ? "intptr" : "uintptr");
13152 strcat(string, type->isSigned ? "intsize" : "uintsize");
13155 strcat(string, type->isSigned ? "char" : "byte");
13158 strcat(string, "_Bool");
13161 strcat(string, type->isSigned ? "short" : "uint16");
13164 strcat(string, "float");
13167 strcat(string, "double");
13172 strcat(string, "struct ");
13173 strcat(string, type->enumName);
13175 else if(type->typeName)
13176 strcat(string, type->typeName);
13179 struct Type * member;
13181 strcat(string, "struct { ");
13182 for(member = type->members.first; member; member = member->next)
13184 PrintType(member, string, 0x1, fullName);
13185 strcat(string, "; ");
13187 strcat(string, "}");
13193 strcat(string, "union ");
13194 strcat(string, type->enumName);
13196 else if(type->typeName)
13197 strcat(string, type->typeName);
13200 strcat(string, "union ");
13201 strcat(string, "(unnamed)");
13207 strcat(string, "enum ");
13208 strcat(string, type->enumName);
13210 else if(type->typeName)
13211 strcat(string, type->typeName);
13213 strcat(string, "int");
13216 strcat(string, "...");
13219 strcat(string, "subclass(");
13220 strcat(string, type->_class ? type->_class->string : "int");
13221 strcat(string, ")");
13224 strcat(string, type->templateParameter->identifier->string);
13227 strcat(string, "thisclass");
13230 strcat(string, "__builtin_va_list");
13236 extern char * __ecereNameSpace__ecere__sys__RSearchString(const char * buffer, const char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13238 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13240 if(type->name && type->name[0])
13243 strcat(string, type->name);
13246 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13252 strcat(string, name);
13257 static void PrintAttribs(struct Type * type, char * string)
13261 if(type->dllExport)
13262 strcat(string, "dllexport ");
13263 if(type->attrStdcall)
13264 strcat(string, "stdcall ");
13268 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13270 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13272 struct Type * attrType = (((void *)0));
13274 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13275 PrintAttribs(type, string);
13276 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13277 strcat(string, " const");
13278 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13279 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13280 strcat(string, " (");
13281 if(type->kind == 13)
13283 if(type->type->kind == 11 || type->type->kind == 16)
13284 PrintAttribs(type->type, string);
13286 if(type->kind == 13)
13288 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13289 strcat(string, "*");
13291 strcat(string, " *");
13293 if(printConst && type->constant && type->kind == 13)
13294 strcat(string, " const");
13297 PrintTypeSpecs(type, string, fullName, printConst);
13300 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13302 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13303 strcat(string, ")");
13304 if(type->kind == 12)
13305 PrintArraySize(type, string);
13306 else if(type->kind == 11)
13308 struct Type * param;
13310 strcat(string, "(");
13311 for(param = type->params.first; param; param = param->next)
13313 PrintType(param, string, 0x1, fullName);
13315 strcat(string, ", ");
13317 strcat(string, ")");
13319 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13320 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13323 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13325 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13326 if(type->thisClass || (printName && type->name && type->name[0]))
13327 strcat(string, " ");
13328 if((type->thisClass || type->staticMethod))
13330 struct Symbol * _class = type->thisClass;
13332 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13334 if(type->classObjectType == 1)
13335 strcat(string, "class");
13337 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13339 else if(_class && _class->string)
13341 char * s = _class->string;
13347 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13353 strcat(string, name);
13356 strcat(string, "::");
13358 if(printName && type->name)
13359 PrintName(type, string, fullName);
13360 PostPrintType(type, string, fullName);
13361 if(type->bitFieldCount)
13365 sprintf(count, ":%d", type->bitFieldCount);
13366 strcat(string, count);
13370 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13372 _PrintType(type, string, printName, fullName, 0x1);
13375 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13377 _PrintType(type, string, printName, fullName, 0x0);
13380 static struct Type * FindMember(struct Type * type, char * string)
13382 struct Type * memberType;
13384 for(memberType = type->members.first; memberType; memberType = memberType->next)
13386 if(!memberType->name)
13388 struct Type * subType = FindMember(memberType, string);
13393 else if(!strcmp(memberType->name, string))
13396 return (((void *)0));
13399 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13401 struct Type * memberType;
13403 for(memberType = type->members.first; memberType; memberType = memberType->next)
13405 if(!memberType->name)
13407 struct Type * subType = FindMember(memberType, string);
13411 *offset += memberType->offset;
13415 else if(!strcmp(memberType->name, string))
13417 *offset += memberType->offset;
13421 return (((void *)0));
13424 extern unsigned int parseError;
13426 unsigned int GetParseError()
13431 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13433 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13435 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13437 struct Expression * ParseExpressionString(char * expression)
13440 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13441 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
13442 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13444 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13445 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13446 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13447 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13449 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13450 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13452 parsedExpression = (((void *)0));
13454 expression_yyparse();
13455 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13456 return parsedExpression;
13459 extern char * QMkString(const char * source);
13461 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13463 struct Identifier * id = exp->identifier;
13464 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13465 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13466 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13467 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13469 if(_class && _class->type == 4)
13471 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13472 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13476 struct __ecereNameSpace__ecere__com__Class * baseClass;
13478 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13480 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13482 for(value = e->values.first; value; value = value->next)
13484 if(!strcmp(value->name, id->string))
13489 char constant[256];
13491 FreeExpContents(exp);
13493 exp->isConstant = 0x1;
13494 if(!strcmp(baseClass->dataTypeString, "int"))
13495 sprintf(constant, "%d", (int)value->data);
13497 sprintf(constant, "0x%X", (int)value->data);
13498 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13499 exp->expType = MkClassType(baseClass->fullName);
13507 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13509 ProcessMethodType(method);
13510 exp->expType = __extension__ ({
13511 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13513 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13517 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13519 if(!prop->dataType)
13520 ProcessPropertyType(prop);
13521 exp->expType = prop->dataType;
13523 prop->dataType->refCount++;
13526 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13528 if(!member->dataType)
13529 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13530 exp->expType = member->dataType;
13531 if(member->dataType)
13532 member->dataType->refCount++;
13535 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13537 if(!classProp->dataType)
13538 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13539 if(classProp->constant)
13541 FreeExpContents(exp);
13542 exp->isConstant = 0x1;
13543 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13546 exp->constant = QMkString((char *)classProp->Get(_class));
13550 char constant[256];
13553 sprintf(constant, "%d", (int)classProp->Get(_class));
13554 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13560 exp->expType = classProp->dataType;
13561 if(classProp->dataType)
13562 classProp->dataType->refCount++;
13568 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13570 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13571 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13572 struct __ecereNameSpace__ecere__com__NameSpace * child;
13576 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)))
13578 data = ScanGlobalData(child, name);
13586 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13588 extern char * strncpy(char * , const char * , size_t n);
13590 static struct GlobalData * FindGlobalData(char * name)
13593 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13595 nameSpace = globalData;
13596 for(c = 0; name[c]; c++)
13598 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13600 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13601 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13603 strncpy(spaceName, name + start, c - start);
13604 spaceName[c - start] = '\0';
13605 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13606 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13608 return (((void *)0));
13609 nameSpace = newSpace;
13617 return ScanGlobalData(nameSpace, name + start);
13619 return (((void *)0));
13622 static int definedExpStackPos;
13624 static void * definedExpStack[512];
13626 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13628 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13630 FreeExpContents(checkedExp);
13631 FreeType(checkedExp->expType);
13632 FreeType(checkedExp->destType);
13633 *checkedExp = *newExp;
13634 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13635 checkedExp->prev = prev;
13636 checkedExp->next = next;
13639 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13641 extern int printf(const char * , ...);
13643 void __ecereMethod_Expression_Clear();
13645 void ApplyAnyObjectLogic(struct Expression * e)
13647 struct Type * destType = e->destType;
13649 if(destType && (destType->classObjectType == 3))
13651 if(e && e->expType)
13653 struct Type * type = e->expType;
13654 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13656 if(type->kind == 8 && type->_class && type->_class->registered)
13658 _class = type->_class->registered;
13660 else if(type->kind == 19)
13662 _class = FindClass("ecere::com::Class")->registered;
13666 char string[1024] = "";
13667 struct Symbol * classSym;
13669 PrintTypeNoConst(type, string, 0x0, 0x1);
13670 classSym = FindClass(string);
13672 _class = classSym->registered;
13674 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)))
13676 if(!_class || strcmp(_class->fullName, "char *"))
13678 struct Expression * checkedExp = e, * newExp;
13680 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13682 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13684 if(checkedExp->type == 23)
13686 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13689 checkedExp = (*checkedExp->list).last;
13691 else if(checkedExp->type == 11)
13692 checkedExp = checkedExp->cast.exp;
13694 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13696 newExp = checkedExp->op.exp2;
13697 checkedExp->op.exp2 = (((void *)0));
13698 FreeExpContents(checkedExp);
13699 if(e->expType && e->expType->passAsTemplate)
13703 ComputeTypeSize(e->expType);
13704 sprintf(size, "%d", e->expType->size);
13705 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))))));
13707 ReplaceExpContents(checkedExp, newExp);
13708 e->byReference = 0x1;
13710 else if(!e->byReference || (_class && _class->type == 5))
13712 struct Expression * checkedExp;
13715 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;
13717 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13719 struct Context * context = PushContext();
13720 struct Declarator * decl;
13721 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13722 char typeString[1024];
13723 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13725 typeString[0] = '\0';
13727 newExp->prev = (((void *)0));
13728 newExp->next = (((void *)0));
13729 newExp->expType = (((void *)0));
13730 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13731 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13732 newExp->destType = ProcessType(specs, decl);
13733 curContext = context;
13737 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13740 sprintf(name, "__internalValue%03X", internalValueCounter++);
13741 if(!curCompound->compound.declarations)
13742 curCompound->compound.declarations = MkList();
13743 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13744 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13745 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13746 e->compound = MkCompoundStmt((((void *)0)), stmts);
13749 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13751 struct Type * type = e->destType;
13753 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13754 CopyTypeInto(e->destType, type);
13755 e->destType->refCount = 1;
13756 e->destType->classObjectType = 0;
13759 e->compound->compound.context = context;
13760 PopContext(context);
13761 curContext = context->parent;
13765 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13767 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13769 if(checkedExp->type == 23)
13771 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13774 checkedExp = (*checkedExp->list).last;
13776 else if(checkedExp->type == 11)
13777 checkedExp = checkedExp->cast.exp;
13780 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13782 *operand = *checkedExp;
13783 checkedExp->destType = (((void *)0));
13784 checkedExp->expType = (((void *)0));
13785 __ecereMethod_Expression_Clear(checkedExp);
13786 checkedExp->type = 4;
13787 checkedExp->op.op = '&';
13788 checkedExp->op.exp1 = (((void *)0));
13789 checkedExp->op.exp2 = operand;
13798 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))))
13800 if(e->expType->classObjectType && destType && destType->classObjectType)
13806 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13809 thisExp->prev = (((void *)0));
13810 thisExp->next = (((void *)0));
13811 __ecereMethod_Expression_Clear(e);
13813 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13814 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13815 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13817 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13818 CopyTypeInto(e->expType, thisExp->expType);
13819 e->expType->byReference = 0x0;
13820 e->expType->refCount = 1;
13821 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))
13823 e->expType->classObjectType = 0;
13828 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13830 if(destType->kind == 14)
13832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13834 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13836 unsigned int byReference = e->expType->byReference;
13837 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13838 struct Declarator * decl;
13839 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13840 char typeString[1024];
13841 struct Type * type;
13842 int backupClassObjectType;
13843 unsigned int backupByReference;
13845 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13849 backupClassObjectType = type->classObjectType;
13850 backupByReference = type->byReference;
13851 type->classObjectType = 0;
13852 type->byReference = 0x0;
13853 typeString[0] = '\0';
13854 PrintType(type, typeString, 0x0, 0x1);
13855 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13856 type->classObjectType = backupClassObjectType;
13857 type->byReference = backupByReference;
13859 thisExp->prev = (((void *)0));
13860 thisExp->next = (((void *)0));
13861 __ecereMethod_Expression_Clear(e);
13862 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)))
13866 e->op.exp1 = (((void *)0));
13867 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13868 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13869 CopyTypeInto(e->expType, type);
13870 e->expType->byReference = 0x0;
13871 e->expType->refCount = 1;
13876 e->cast.typeName = MkTypeName(specs, decl);
13877 e->cast.exp = thisExp;
13878 e->byReference = 0x1;
13882 e->destType = destType;
13883 destType->refCount++;
13888 void ApplyLocation(struct Expression * exp, struct Location * loc)
13895 ApplyLocation(exp->op.exp1, loc);
13897 ApplyLocation(exp->op.exp2, loc);
13902 struct Expression * e;
13904 for(e = (*exp->list).first; e; e = e->next)
13905 ApplyLocation(e, loc);
13909 if(exp->index.index)
13911 struct Expression * e;
13913 for(e = (*exp->index.index).first; e; e = e->next)
13914 ApplyLocation(e, loc);
13917 ApplyLocation(exp->index.exp, loc);
13920 if(exp->call.arguments)
13922 struct Expression * arg;
13924 for(arg = (*exp->call.arguments).first; arg; arg = arg->next)
13925 ApplyLocation(arg, loc);
13928 ApplyLocation(exp->call.exp, loc);
13932 if(exp->member.exp)
13933 ApplyLocation(exp->member.exp, loc);
13937 ApplyLocation(exp->cast.exp, loc);
13942 struct Expression * e;
13944 for(e = (*exp->cond.exp).first; e; e = e->next)
13945 ApplyLocation(e, loc);
13948 ApplyLocation(exp->cond.cond, loc);
13949 if(exp->cond.elseExp)
13950 ApplyLocation(exp->cond.elseExp, loc);
13954 ApplyLocation(exp->vaArg.exp, loc);
13961 extern char * strstr(const char * , const char * );
13963 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13965 struct __ecereNameSpace__ecere__com__DefinedExpression
13967 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13968 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13970 const char * value;
13971 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13972 } __attribute__ ((gcc_struct));
13974 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
13976 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
13978 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(const char * string, int * numBytes);
13980 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13982 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13984 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13986 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13988 static void ProcessStatement(struct Statement * stmt);
13990 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13992 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13994 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, const void * object, ...);
13996 extern const char * sourceFile;
13998 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
14000 void ProcessExpressionType(struct Expression * exp)
14002 unsigned int unresolved = 0x0;
14003 struct Location oldyylloc = yylloc;
14004 unsigned int notByReference = 0x0;
14006 if(!exp || exp->expType)
14013 struct Identifier * id = exp->identifier;
14015 if(!id || !topContext)
14017 if(id->_class && id->_class->name)
14019 id->classSym = id->_class->symbol;
14021 if(strstr(id->string, "__ecereClass") == id->string)
14023 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
14026 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
14028 ReplaceClassMembers(exp, thisClass);
14031 ProcessExpressionType(exp);
14034 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
14039 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14043 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0, 0x0))
14049 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
14052 ProcessExpressionType(exp);
14056 else if(currentClass && !id->_class)
14058 if(ResolveIdWithClass(exp, currentClass, 0x1))
14061 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14066 struct Type * type = symbol->type;
14067 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
14069 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
14071 struct Context * context = SetupTemplatesContext(_class);
14073 type = ReplaceThisClassType(_class);
14074 FinishTemplatesContext(context);
14076 type->refCount = 0;
14078 FreeSpecifier(id->_class);
14079 id->_class = (((void *)0));
14080 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14081 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
14082 id->classSym = (((void *)0));
14083 exp->expType = type;
14086 if(type && (type->kind == 15))
14087 exp->isConstant = 0x1;
14088 if(symbol->isParam || !strcmp(id->string, "this"))
14090 if(_class && _class->type == 1 && !type->declaredWithStruct)
14091 exp->byReference = 0x1;
14093 if(symbol->isIterator)
14095 if(symbol->isIterator == 3)
14098 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
14099 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
14100 exp->expType = (((void *)0));
14101 ProcessExpressionType(exp);
14103 else if(symbol->isIterator != 4)
14106 exp->member.exp = MkExpIdentifier(exp->identifier);
14107 exp->member.exp->expType = exp->expType;
14108 exp->member.member = MkIdentifier("data");
14109 exp->expType = (((void *)0));
14110 ProcessExpressionType(exp);
14117 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
14119 if(thisNameSpace && !(id->_class && !id->_class->name))
14123 strcpy(name, thisNameSpace);
14124 strcat(name, "::");
14125 strcat(name, id->string);
14126 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14129 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14134 for(c = 0; c < definedExpStackPos; c++)
14135 if(definedExpStack[c] == definedExp)
14137 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14139 struct Location backupYylloc = yylloc;
14140 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14142 definedExpStack[definedExpStackPos++] = definedExp;
14143 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14144 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void * buffer, unsigned int size, unsigned int count))__extension__ ({
14145 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14147 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14148 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14149 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14150 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14152 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14153 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14155 parsedExpression = (((void *)0));
14157 expression_yyparse();
14158 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14160 fileInput = backInput;
14161 yylloc = backupYylloc;
14162 if(parsedExpression)
14164 FreeIdentifier(id);
14166 exp->list = MkListOne(parsedExpression);
14167 ApplyLocation(parsedExpression, &yylloc);
14168 ProcessExpressionType(exp);
14169 definedExpStackPos--;
14172 definedExpStackPos--;
14178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14184 struct GlobalData * data = (((void *)0));
14186 if(thisNameSpace && !(id->_class && !id->_class->name))
14190 strcpy(name, thisNameSpace);
14191 strcat(name, "::");
14192 strcat(name, id->string);
14193 data = FindGlobalData(name);
14196 data = FindGlobalData(id->string);
14199 DeclareGlobalData(data);
14200 exp->expType = data->dataType;
14202 data->dataType->refCount++;
14203 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14204 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14205 FreeSpecifier(id->_class);
14206 id->_class = (((void *)0));
14211 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14213 if(thisNameSpace && !(id->_class && !id->_class->name))
14217 strcpy(name, thisNameSpace);
14218 strcat(name, "::");
14219 strcat(name, id->string);
14220 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14223 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14228 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14229 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14231 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14232 strcpy(name, "__ecereFunction_");
14233 FullClassNameCat(name, id->string, 0x0);
14234 if(DeclareFunction(function, name))
14236 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14237 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14239 exp->expType = function->dataType;
14240 if(function->dataType)
14241 function->dataType->refCount++;
14242 FreeSpecifier(id->_class);
14243 id->_class = (((void *)0));
14255 struct __ecereNameSpace__ecere__com__Class * _class;
14257 if(!exp->instance->_class)
14259 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14261 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14264 ProcessInstantiationType(exp->instance);
14265 exp->isConstant = exp->instance->isConstant;
14266 if(exp->instance->_class)
14268 exp->expType = MkClassType(exp->instance->_class->name);
14276 char * constant = exp->constant;
14277 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14279 exp->expType = type;
14280 if(constant[0] == '\'')
14282 if((int)((unsigned char *)constant)[1] > 127)
14285 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14289 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14290 exp->constant = PrintUInt(ch);
14292 type->_class = FindClass("unichar");
14293 type->isSigned = 0x0;
14298 type->isSigned = 0x1;
14303 char * dot = strchr(constant, '.');
14304 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14309 exponent = strchr(constant, 'p');
14311 exponent = strchr(constant, 'P');
14315 exponent = strchr(constant, 'e');
14317 exponent = strchr(constant, 'E');
14319 if(dot || exponent)
14321 if(strchr(constant, 'f') || strchr(constant, 'F'))
14325 type->isSigned = 0x1;
14329 unsigned int isSigned = constant[0] == '-';
14330 char * endP = (((void *)0));
14331 long long i64 = strtoll(constant, &endP, 0);
14332 uint64 ui64 = strtoull(constant, &endP, 0);
14333 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14337 if(i64 < (((int)0x80000000)))
14342 if(ui64 > (((int)0x7fffffff)))
14344 if(ui64 > (0xffffffff))
14347 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14351 else if(constant[0] != '0' || !constant[1])
14354 type->kind = is64Bit ? 4 : 3;
14355 type->isSigned = isSigned;
14358 exp->isConstant = 0x1;
14359 if(exp->destType && exp->destType->kind == 7)
14361 else if(exp->destType && exp->destType->kind == 6)
14363 else if(exp->destType && exp->destType->kind == 4)
14370 exp->isConstant = 0x1;
14371 exp->expType = __extension__ ({
14372 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14374 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14375 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14377 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14378 }), __ecereInstance2;
14384 ProcessExpressionType(exp->_new.size);
14385 exp->expType = __extension__ ({
14386 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14388 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14390 DeclareType(exp->expType->type, 0x0, 0x0);
14394 ProcessExpressionType(exp->_renew.size);
14395 ProcessExpressionType(exp->_renew.exp);
14396 exp->expType = __extension__ ({
14397 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14399 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14401 DeclareType(exp->expType->type, 0x0, 0x0);
14405 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14406 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14407 unsigned int useDestType = 0x0, useSideType = 0x0;
14408 struct Location oldyylloc = yylloc;
14409 unsigned int useSideUnit = 0x0;
14410 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
14411 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14474 if(exp->op.op == '&')
14476 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14478 struct Identifier * id = exp->op.exp2->identifier;
14479 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14481 if(symbol && symbol->isIterator == 2)
14484 exp->member.exp = exp->op.exp2;
14485 exp->member.member = MkIdentifier("key");
14486 exp->expType = (((void *)0));
14487 exp->op.exp2->expType = symbol->type;
14488 symbol->type->refCount++;
14489 ProcessExpressionType(exp);
14497 if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14499 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14501 if(exp->op.exp1->destType)
14502 FreeType(exp->op.exp1->destType);
14503 exp->op.exp1->destType = exp->destType;
14504 exp->op.exp1->opDestType = 0x1;
14506 exp->destType->refCount++;
14510 if(exp->op.exp1->destType)
14511 FreeType(exp->op.exp1->destType);
14512 exp->op.exp1->destType = dummy;
14515 if(exp->op.exp1->destType && exp->op.op != '=')
14516 exp->op.exp1->destType->count++;
14517 ProcessExpressionType(exp->op.exp1);
14518 if(exp->op.exp1->destType && exp->op.op != '=')
14519 exp->op.exp1->destType->count--;
14520 exp->op.exp1->opDestType = 0x0;
14521 if(!exp->op.exp2 && (exp->op.op == INC_OP || exp->op.op == DEC_OP) && exp->op.exp1->expType && exp->op.exp1->expType->kind == 8 && exp->op.exp1->expType->_class && exp->op.exp1->expType->_class->registered && exp->op.exp1->expType->_class->registered->type == 3)
14523 exp->op.exp2 = MkExpConstant("1");
14524 exp->op.op = exp->op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14527 if(exp->op.exp1->destType == dummy)
14530 exp->op.exp1->destType = (((void *)0));
14532 type1 = exp->op.exp1->expType;
14536 char expString[10240];
14538 expString[0] = '\0';
14539 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14543 exp->op.exp2->destType = exp->op.exp1->expType;
14544 if(exp->op.exp1->expType)
14545 exp->op.exp1->expType->refCount++;
14549 exp->op.exp2->destType = exp->destType;
14550 if(!exp->op.exp1 || exp->op.op != '&')
14551 exp->op.exp2->opDestType = 0x1;
14553 exp->destType->refCount++;
14557 exp->expType = type1;
14562 PrintExpression(exp->op.exp2, expString);
14563 if(type1 && type1->kind == 13)
14565 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)
14566 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14567 else if(exp->op.op == '=')
14569 if(exp->op.exp2->destType)
14570 FreeType(exp->op.exp2->destType);
14571 exp->op.exp2->destType = type1;
14578 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)
14582 if(exp->op.exp2->destType)
14583 FreeType(exp->op.exp2->destType);
14584 exp->op.exp2->destType = type1;
14591 exp->expType = type1;
14593 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14595 if(exp->op.exp2->destType)
14596 FreeType(exp->op.exp2->destType);
14597 exp->op.exp2->destType = exp->destType;
14598 if(exp->op.op != '&')
14599 exp->op.exp2->opDestType = 0x1;
14601 exp->destType->refCount++;
14605 if(exp->op.exp2->destType)
14606 FreeType(exp->op.exp2->destType);
14607 exp->op.exp2->destType = dummy;
14610 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14612 FreeType(exp->op.exp2->destType);
14613 exp->op.exp2->destType = type1;
14616 if(exp->op.exp2->destType && exp->op.op != '=')
14617 exp->op.exp2->destType->count++;
14618 if(exp->op.op == SIZEOF)
14620 struct Expression * e = exp->op.exp2;
14622 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14624 if(e->type == 5 || e->type == 32 || e->type == 23)
14627 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14629 e = (*e->list).last;
14632 if(e->type == 11 && e->cast.exp)
14633 e->cast.exp->needCast = 0x1;
14635 ProcessExpressionType(exp->op.exp2);
14636 exp->op.exp2->opDestType = 0x0;
14637 if(exp->op.exp2->destType && exp->op.op != '=')
14638 exp->op.exp2->destType->count--;
14639 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14641 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)
14643 if(exp->op.op != '=' && type1->type->kind == 0)
14644 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14646 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)))
14648 if(exp->op.op == ADD_ASSIGN)
14649 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14651 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))
14653 if(exp->op.op == ADD_ASSIGN)
14654 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14656 else if(inCompiler)
14658 char type1String[1024];
14659 char type2String[1024];
14661 type1String[0] = '\0';
14662 type2String[0] = '\0';
14663 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14664 PrintType(type1, type2String, 0x0, 0x1);
14665 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14666 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14669 if(exp->op.exp2->destType == dummy)
14672 exp->op.exp2->destType = (((void *)0));
14674 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14676 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14677 type2->refCount = 1;
14678 CopyTypeInto(type2, exp->op.exp2->expType);
14679 type2->isSigned = 0x1;
14681 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14683 type2 = __extension__ ({
14684 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14686 __ecereInstance1->kind = 3, __ecereInstance1;
14688 type2->refCount = 1;
14689 type2->isSigned = 0x1;
14693 type2 = exp->op.exp2->expType;
14699 if(exp->op.op == SIZEOF)
14701 exp->expType = __extension__ ({
14702 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14704 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14706 exp->isConstant = 0x1;
14708 else if(exp->op.op == '*' && !exp->op.exp1)
14710 exp->expType = Dereference(type2);
14711 if(type2 && type2->kind == 8)
14712 notByReference = 0x1;
14714 else if(exp->op.op == '&' && !exp->op.exp1)
14715 exp->expType = Reference(type2);
14722 if(exp->op.exp1->destType)
14723 FreeType(exp->op.exp1->destType);
14724 exp->op.exp1->destType = MkClassType("bool");
14725 exp->op.exp1->destType->truth = 0x1;
14726 if(!exp->op.exp1->expType)
14727 ProcessExpressionType(exp->op.exp1);
14729 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0);
14730 FreeType(exp->op.exp1->expType);
14731 exp->op.exp1->expType = MkClassType("bool");
14732 exp->op.exp1->expType->truth = 0x1;
14736 if(exp->op.exp2->destType)
14737 FreeType(exp->op.exp2->destType);
14738 exp->op.exp2->destType = MkClassType("bool");
14739 exp->op.exp2->destType->truth = 0x1;
14740 if(!exp->op.exp2->expType)
14741 ProcessExpressionType(exp->op.exp2);
14743 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0);
14744 FreeType(exp->op.exp2->expType);
14745 exp->op.exp2->expType = MkClassType("bool");
14746 exp->op.exp2->expType->truth = 0x1;
14749 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")))))
14751 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14753 if(exp->op.op == '-' && ((type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 4) || (type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 4)))
14755 struct Type * intType;
14757 if(!type1->_class->registered->dataType)
14758 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14759 if(!type2->_class->registered->dataType)
14760 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14761 intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14762 if(exp->op.exp1->destType)
14763 FreeType(exp->op.exp1->destType);
14764 if(exp->op.exp2->destType)
14765 FreeType(exp->op.exp2->destType);
14766 exp->op.exp1->destType = intType;
14767 exp->op.exp2->destType = intType;
14768 intType->refCount++;
14772 if(exp->op.exp2->destType)
14773 FreeType(exp->op.exp2->destType);
14774 exp->op.exp2->destType = type1;
14776 if(exp->op.exp1->destType)
14777 FreeType(exp->op.exp1->destType);
14778 exp->op.exp1->destType = type2;
14781 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)
14782 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);
14783 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14785 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14789 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14791 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14792 ProcessExpressionType(exp->op.exp1);
14793 if(type2->kind != 13)
14795 ProcessExpressionType(classExp);
14796 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"))))))));
14797 if(!exp->op.exp2->expType)
14801 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14804 ProcessExpressionType(exp->op.exp2);
14808 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)))
14810 if(type1->kind != 8 && type1->type->kind == 0)
14811 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14812 exp->expType = type1;
14816 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)))
14818 if(type2->kind != 8 && type2->type->kind == 0)
14819 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14820 exp->expType = type2;
14824 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))
14826 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14830 unsigned int success = 0x0;
14832 if(type1->kind == 13 && type2->kind == 13)
14834 if(exp->op.op == '+')
14835 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14836 else if(exp->op.op == '-')
14838 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0, 0x0))
14840 exp->expType = __extension__ ({
14841 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14843 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14846 if(type1->type->kind == 20)
14848 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14852 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14854 ProcessExpressionType(classExp);
14856 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")))))));
14857 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14865 if(!success && exp->op.exp1->type == 2)
14867 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0))
14870 FreeType(exp->expType);
14871 exp->expType = exp->op.exp1->destType;
14872 if(exp->op.exp1->destType)
14873 exp->op.exp1->destType->refCount++;
14876 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0))
14879 FreeType(exp->expType);
14880 exp->expType = exp->op.exp2->destType;
14881 if(exp->op.exp2->destType)
14882 exp->op.exp2->destType->refCount++;
14888 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0))
14891 FreeType(exp->expType);
14892 exp->expType = exp->op.exp2->destType;
14893 if(exp->op.exp2->destType)
14894 exp->op.exp2->destType->refCount++;
14897 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0))
14900 FreeType(exp->expType);
14901 exp->expType = exp->op.exp1->destType;
14902 if(exp->op.exp1->destType)
14903 exp->op.exp1->destType->refCount++;
14909 char expString1[10240];
14910 char expString2[10240];
14914 expString1[0] = '\0';
14915 expString2[0] = '\0';
14920 PrintExpression(exp->op.exp1, expString1);
14921 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14922 PrintExpression(exp->op.exp2, expString2);
14923 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14924 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14925 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14927 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14931 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14933 if(exp->op.exp1->destType)
14934 FreeType(exp->op.exp1->destType);
14935 exp->op.exp1->destType = type2->_class->registered->dataType;
14936 if(type2->_class->registered->dataType)
14937 type2->_class->registered->dataType->refCount++;
14938 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0);
14939 exp->expType = type2;
14943 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14945 if(exp->op.exp2->destType)
14946 FreeType(exp->op.exp2->destType);
14947 exp->op.exp2->destType = type1->_class->registered->dataType;
14948 if(type1->_class->registered->dataType)
14949 type1->_class->registered->dataType->refCount++;
14950 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0);
14951 exp->expType = type1;
14957 unsigned int valid = 0x0;
14959 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14961 if(exp->op.exp2->destType)
14962 FreeType(exp->op.exp2->destType);
14963 if(!type1->_class->registered->dataType)
14964 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14965 exp->op.exp2->destType = type1->_class->registered->dataType;
14966 exp->op.exp2->destType->refCount++;
14967 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0);
14970 type2 = exp->op.exp2->destType;
14973 exp->expType = type2;
14976 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14978 if(exp->op.exp1->destType)
14979 FreeType(exp->op.exp1->destType);
14980 if(!type2->_class->registered->dataType)
14981 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14982 exp->op.exp1->destType = type2->_class->registered->dataType;
14983 exp->op.exp1->destType->refCount++;
14984 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0);
14985 type1 = exp->op.exp1->destType;
14986 exp->expType = type1;
14989 if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
14991 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
14992 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
14994 if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
14996 if(op1IsEnum && exp->op.exp2->expType)
14998 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0, 0x0))
15001 FreeType(exp->expType);
15002 exp->expType = exp->op.exp2->expType;
15003 if(exp->op.exp2->expType)
15004 exp->op.exp2->expType->refCount++;
15008 else if(op2IsEnum && exp->op.exp1->expType)
15010 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0, 0x0))
15013 FreeType(exp->expType);
15014 exp->expType = exp->op.exp1->expType;
15015 if(exp->op.exp1->expType)
15016 exp->op.exp1->expType->refCount++;
15023 if(op1IsEnum && exp->op.exp2->expType)
15025 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0, 0x0))
15028 FreeType(exp->expType);
15029 exp->expType = exp->op.exp1->expType;
15030 if(exp->op.exp1->expType)
15031 exp->op.exp1->expType->refCount++;
15035 else if(op2IsEnum && exp->op.exp1->expType)
15037 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0, 0x0))
15040 FreeType(exp->expType);
15041 exp->expType = exp->op.exp2->expType;
15042 if(exp->op.exp2->expType)
15043 exp->op.exp2->expType->refCount++;
15051 if(type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3 && (type1->kind != 8 || !type1->_class || !type1->_class->registered || type1->_class->registered->type != 3))
15053 if(exp->op.exp1->destType)
15054 FreeType(exp->op.exp1->destType);
15055 exp->op.exp1->destType = type2;
15057 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0))
15060 FreeType(exp->expType);
15061 exp->expType = exp->op.exp1->destType;
15062 if(exp->op.exp1->destType)
15063 exp->op.exp1->destType->refCount++;
15068 if(exp->op.exp2->destType)
15069 FreeType(exp->op.exp2->destType);
15070 exp->op.exp2->destType = type1;
15072 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0))
15075 FreeType(exp->expType);
15076 exp->expType = exp->op.exp2->destType;
15077 if(exp->op.exp2->destType)
15078 exp->op.exp2->destType->refCount++;
15080 else if(type1 && type2)
15082 char expString1[10240];
15083 char expString2[10240];
15084 char type1String[1024];
15085 char type2String[1024];
15087 expString1[0] = '\0';
15088 expString2[0] = '\0';
15089 type1String[0] = '\0';
15090 type2String[0] = '\0';
15093 PrintExpression(exp->op.exp1, expString1);
15094 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
15095 PrintExpression(exp->op.exp2, expString2);
15096 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
15097 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
15098 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
15100 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
15101 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
15103 exp->expType = exp->op.exp1->expType;
15104 if(exp->op.exp1->expType)
15105 exp->op.exp1->expType->refCount++;
15107 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
15109 exp->expType = exp->op.exp2->expType;
15110 if(exp->op.exp2->expType)
15111 exp->op.exp2->expType->refCount++;
15119 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
15121 struct Type * oldType = exp->op.exp1->expType;
15123 exp->op.exp1->expType = (((void *)0));
15124 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0))
15127 exp->op.exp1->expType = oldType;
15129 if(exp->op.exp1->destType)
15130 FreeType(exp->op.exp1->destType);
15131 exp->op.exp1->destType = type2;
15133 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0))
15136 FreeType(exp->expType);
15137 exp->expType = exp->op.exp1->destType;
15138 if(exp->op.exp1->destType)
15139 exp->op.exp1->destType->refCount++;
15143 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15145 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
15147 if(exp->op.exp1->destType)
15148 FreeType(exp->op.exp1->destType);
15149 exp->op.exp1->destType = type2->_class->registered->dataType;
15150 if(type2->_class->registered->dataType)
15151 type2->_class->registered->dataType->refCount++;
15152 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0, 0x0);
15154 if(exp->op.op == '!')
15156 exp->expType = MkClassType("bool");
15157 exp->expType->truth = 0x1;
15161 exp->expType = type2;
15166 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15168 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
15170 if(exp->op.exp2->destType)
15171 FreeType(exp->op.exp2->destType);
15172 exp->op.exp2->destType = type1->_class->registered->dataType;
15173 if(type1->_class->registered->dataType)
15174 type1->_class->registered->dataType->refCount++;
15175 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0, 0x0);
15177 exp->expType = type1;
15183 if(exp->op.exp1 && !exp->op.exp1->expType)
15185 char expString[10000];
15187 expString[0] = '\0';
15190 PrintExpression(exp->op.exp1, expString);
15191 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15194 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15196 if(exp->op.exp2 && !exp->op.exp2->expType)
15198 char expString[10240];
15200 expString[0] = '\0';
15203 PrintExpression(exp->op.exp2, expString);
15204 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15207 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15211 FreeType(exp->expType);
15212 exp->expType = MkClassType("bool");
15213 exp->expType->truth = 0x1;
15215 if(exp->op.op != SIZEOF)
15216 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
15217 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
15219 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
15221 yylloc = oldyylloc;
15230 struct Expression * e;
15232 exp->isConstant = 0x1;
15233 for(e = (*exp->list).first; e; e = e->next)
15235 unsigned int inced = 0x0;
15239 FreeType(e->destType);
15240 e->opDestType = exp->opDestType;
15241 e->destType = exp->destType;
15244 exp->destType->refCount++;
15245 e->destType->count++;
15249 ProcessExpressionType(e);
15251 exp->destType->count--;
15252 if(!exp->expType && !e->next)
15254 exp->expType = e->expType;
15256 e->expType->refCount++;
15259 exp->isConstant = 0x0;
15261 e = (*exp->list).first;
15262 if(!e->next && e->type == 8)
15264 struct Expression * next = exp->next, * prev = exp->prev;
15266 FreeType(exp->expType);
15267 FreeType(exp->destType);
15268 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
15272 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15273 ProcessExpressionType(exp);
15279 struct Expression * e;
15281 exp->isConstant = 0x1;
15282 ProcessExpressionType(exp->index.exp);
15283 if(!exp->index.exp->isConstant)
15284 exp->isConstant = 0x0;
15285 if(exp->index.exp->expType)
15287 struct Type * source = exp->index.exp->expType;
15289 if(source->kind == 8 && source->_class && source->_class->registered)
15291 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15292 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15294 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15296 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15297 if(exp->index.index && (*exp->index.index).last)
15299 struct Type * type = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15301 if(type->kind == 8)
15302 type->constant = 0x1;
15303 else if(type->kind == 13)
15305 struct Type * t = type;
15307 while(t->kind == 13)
15311 ((struct Expression *)(*exp->index.index).last)->destType = type;
15316 for(e = (*exp->index.index).first; e; e = e->next)
15318 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15321 FreeType(e->destType);
15322 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15324 ProcessExpressionType(e);
15329 exp->isConstant = 0x0;
15332 exp->expType = Dereference(exp->index.exp->expType);
15334 DeclareType(exp->expType, 0x0, 0x0);
15339 struct Expression * e;
15340 struct Type * functionType;
15341 struct Type * methodType = (((void *)0));
15347 PrintExpression(exp->call.exp, name);
15348 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15350 PrintExpression(exp->call.exp, name);
15353 if(exp->call.exp->type == 0)
15355 struct Expression * idExp = exp->call.exp;
15356 struct Identifier * id = idExp->identifier;
15358 if(!strcmp(id->string, "__builtin_frame_address"))
15360 exp->expType = ProcessTypeString("void *", 0x1);
15361 if(exp->call.arguments && (*exp->call.arguments).first)
15362 ProcessExpressionType((*exp->call.arguments).first);
15365 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15367 exp->expType = ProcessTypeString("int", 0x1);
15368 if(exp->call.arguments && (*exp->call.arguments).first)
15369 ProcessExpressionType((*exp->call.arguments).first);
15372 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15374 struct Expression * a = (((void *)0));
15375 struct Expression * b = (((void *)0));
15376 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15378 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15380 a = (*exp->call.arguments).first;
15381 b = (*exp->call.arguments).last;
15385 else if((*exp->call.arguments).count == 1)
15387 a = (*exp->call.arguments).first;
15392 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15393 idExp->identifier = (((void *)0));
15394 FreeExpContents(exp);
15395 ProcessExpressionType(a);
15397 ProcessExpressionType(b);
15399 exp->list = MkList();
15400 if(a->expType && (!b || b->expType))
15402 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15406 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15407 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15408 struct Declaration * decl;
15409 char temp1[1024], temp2[1024];
15411 GetTypeSpecs(a->expType, specs);
15412 if(a && !a->isConstant && a->type != 0)
15414 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15415 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15416 tempExp1 = QMkExpId(temp1);
15417 tempExp1->expType = a->expType;
15419 a->expType->refCount++;
15420 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15422 if(b && !b->isConstant && b->type != 0)
15424 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15425 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15426 tempExp2 = QMkExpId(temp2);
15427 tempExp2->expType = b->expType;
15429 b->expType->refCount++;
15430 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15432 decl = MkDeclaration(specs, decls);
15433 if(!curCompound->compound.declarations)
15434 curCompound->compound.declarations = MkList();
15435 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15439 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15441 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15443 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15444 exp->expType = a->expType;
15446 a->expType->refCount++;
15448 else if(!strcmp(id->string, "Abs"))
15450 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15451 exp->expType = a->expType;
15453 a->expType->refCount++;
15455 else if(!strcmp(id->string, "Sgn"))
15457 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"))))));
15458 exp->expType = ProcessTypeString("int", 0x0);
15460 FreeExpression(tempExp1);
15462 FreeExpression(tempExp2);
15463 FreeIdentifier(id);
15469 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15471 if(!exp->call.exp->destType)
15473 exp->call.exp->destType = dummy;
15476 ProcessExpressionType(exp->call.exp);
15477 if(exp->call.exp->destType == dummy)
15480 exp->call.exp->destType = (((void *)0));
15484 functionType = exp->call.exp->expType;
15485 if(functionType && functionType->kind == 16)
15487 methodType = functionType;
15488 functionType = methodType->method->dataType;
15489 if(exp->call.exp->expType->usedClass)
15491 char typeString[1024];
15493 typeString[0] = '\0';
15495 struct Symbol * back = functionType->thisClass;
15497 functionType->thisClass = (((void *)0));
15498 PrintType(functionType, typeString, 0x1, 0x1);
15499 functionType->thisClass = back;
15501 if(strstr(typeString, "thisclass"))
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504 struct Declarator * decl;
15507 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15509 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15510 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15511 thisClassParams = 0x0;
15512 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15514 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15516 thisClass = exp->call.exp->expType->usedClass;
15517 ProcessDeclarator(decl);
15518 thisClass = backupThisClass;
15520 thisClassParams = 0x1;
15521 functionType = ProcessType(specs, decl);
15522 functionType->refCount = 0;
15523 FinishTemplatesContext(context);
15525 FreeList(specs, FreeSpecifier);
15526 FreeDeclarator(decl);
15530 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15532 struct Type * type = functionType->type;
15534 if(!functionType->refCount)
15536 functionType->type = (((void *)0));
15537 FreeType(functionType);
15539 functionType = type;
15541 if(functionType && functionType->kind != 11)
15543 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15545 else if(functionType)
15547 unsigned int emptyParams = 0x0, noParams = 0x0;
15548 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15549 struct Type * type = functionType->params.first;
15550 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15552 struct Location oldyylloc = yylloc;
15556 if(functionType->extraParam && e && functionType->thisClass)
15558 e->destType = MkClassType(functionType->thisClass->string);
15561 if(!functionType->staticMethod && !functionType->extraParam)
15563 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15565 type = MkClassType(memberExp->member.exp->expType->_class->string);
15568 e->destType = type;
15570 type = functionType->params.first;
15573 type->refCount = 0;
15575 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15577 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15578 type->byReference = functionType->byReference;
15579 type->typedByReference = functionType->typedByReference;
15582 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15584 e->destType = type;
15586 type = functionType->params.first;
15589 type->refCount = 0;
15592 if(type && type->kind == 0)
15595 if(!type->refCount)
15597 type = (((void *)0));
15599 for(; e; e = e->next)
15601 if(!type && !emptyParams)
15604 if(methodType && methodType->methodClass)
15605 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);
15607 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);
15610 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15612 struct Type * templatedType = (((void *)0));
15613 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15614 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15617 if(_class && _class->templateArgs)
15619 struct __ecereNameSpace__ecere__com__Class * sClass;
15621 for(sClass = _class; sClass; sClass = sClass->base)
15623 if(sClass->templateClass)
15624 sClass = sClass->templateClass;
15626 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15628 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15630 struct __ecereNameSpace__ecere__com__Class * nextClass;
15632 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15634 if(nextClass->templateClass)
15635 nextClass = nextClass->templateClass;
15636 id += nextClass->templateParams.count;
15646 if(curParam && _class->templateArgs[id].dataTypeString)
15648 unsigned int constant = type->constant;
15649 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15652 struct Context * context = SetupTemplatesContext(_class);
15654 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15655 FinishTemplatesContext(context);
15657 if(templatedType->kind == 8 && constant)
15658 templatedType->constant = 0x1;
15659 else if(templatedType->kind == 13)
15661 struct Type * t = templatedType->type;
15663 while(t->kind == 13)
15666 t->constant = constant;
15668 e->destType = templatedType;
15671 templatedType->passAsTemplate = 0x1;
15676 e->destType = type;
15683 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15685 e->destType = type->prev;
15686 e->destType->refCount++;
15690 e->destType = type;
15695 if(type && type->kind != 14)
15697 struct Type * next = type->next;
15699 if(!type->refCount)
15704 if(type && type->kind != 14)
15706 if(methodType && methodType->methodClass)
15707 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);
15709 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);
15711 yylloc = oldyylloc;
15712 if(type && !type->refCount)
15717 functionType = __extension__ ({
15718 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15720 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15722 if(exp->call.exp->type == 0)
15724 char * string = exp->call.exp->identifier->string;
15728 struct Symbol * symbol;
15729 struct Location oldyylloc = yylloc;
15731 yylloc = exp->call.exp->identifier->loc;
15732 if(strstr(string, "__builtin_") == string)
15736 functionType->returnType = exp->destType;
15737 exp->destType->refCount++;
15741 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15742 symbol = __extension__ ({
15743 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15745 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15747 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15748 if(strstr(symbol->string, "::"))
15749 globalContext->hasNameSpace = 0x1;
15750 yylloc = oldyylloc;
15753 else if(exp->call.exp->type == 8)
15757 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15758 if(!functionType->returnType)
15760 functionType->returnType = __extension__ ({
15761 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15763 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15767 if(functionType && functionType->kind == 11)
15769 exp->expType = functionType->returnType;
15770 if(functionType->returnType)
15771 functionType->returnType->refCount++;
15772 if(!functionType->refCount)
15773 FreeType(functionType);
15775 if(exp->call.arguments)
15777 for(e = (*exp->call.arguments).first; e; e = e->next)
15779 struct Type * destType = e->destType;
15781 ProcessExpressionType(e);
15788 struct Type * type;
15789 struct Location oldyylloc = yylloc;
15790 unsigned int thisPtr;
15791 struct Expression * checkExp = exp->member.exp;
15795 if(checkExp->type == 11)
15796 checkExp = checkExp->cast.exp;
15797 else if(checkExp->type == 5)
15798 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15802 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15803 exp->thisPtr = thisPtr;
15804 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15806 exp->member.member->classSym = exp->member.member->_class->symbol;
15808 ProcessExpressionType(exp->member.exp);
15809 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)
15811 exp->isConstant = 0x0;
15814 exp->isConstant = exp->member.exp->isConstant;
15815 type = exp->member.exp->expType;
15817 if(type && (type->kind == 20))
15819 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15820 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15824 for(param = _class->templateParams.first; param; param = param->next)
15826 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15830 if(param && param->defaultArg.member)
15832 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15836 struct Expression * expMember = exp->member.exp;
15837 struct Declarator * decl;
15838 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15839 char thisClassTypeString[1024];
15841 FreeIdentifier(exp->member.member);
15842 ProcessExpressionType(argExp);
15844 char * colon = strstr(param->defaultArg.memberString, "::");
15848 char className[1024];
15849 struct __ecereNameSpace__ecere__com__Class * sClass;
15851 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15852 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15855 strcpy(thisClassTypeString, _class->fullName);
15857 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15858 exp->expType = ProcessType(specs, decl);
15859 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15861 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15862 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15864 int paramCount = 0;
15865 int lastParam = -1;
15866 char templateString[1024];
15867 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15869 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15870 for(cClass = expClass; cClass; cClass = cClass->base)
15874 for(param = cClass->templateParams.first; param; param = param->next)
15877 struct __ecereNameSpace__ecere__com__Class * sClass;
15878 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15880 for(sClass = cClass->base; sClass; sClass = sClass->base)
15881 id += sClass->templateParams.count;
15882 arg = expClass->templateArgs[id];
15883 for(sClass = _class; sClass; sClass = sClass->base)
15885 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15887 struct __ecereNameSpace__ecere__com__Class * nextClass;
15889 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15890 p += nextClass->templateParams.count;
15891 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15893 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15895 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15897 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15898 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15905 char argument[256];
15907 argument[0] = '\0';
15908 switch(param->type)
15912 char expString[1024];
15913 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15914 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15915 struct Expression * exp;
15916 char * string = PrintHexUInt64(arg.expression.ui64);
15918 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15919 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15920 ProcessExpressionType(exp);
15921 ComputeExpression(exp);
15922 expString[0] = '\0';
15923 PrintExpression(exp, expString);
15924 strcat(argument, expString);
15925 FreeExpression(exp);
15930 strcat(argument, arg.member->name);
15935 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15937 if(!strcmp(arg.dataTypeString, "thisclass"))
15938 strcat(argument, thisClassTypeString);
15940 strcat(argument, arg.dataTypeString);
15948 strcat(templateString, ", ");
15949 if(lastParam != p - 1)
15951 strcat(templateString, param->name);
15952 strcat(templateString, " = ");
15954 strcat(templateString, argument);
15963 int len = strlen(templateString);
15965 if(templateString[len - 1] == '>')
15966 templateString[len++] = ' ';
15967 templateString[len++] = '>';
15968 templateString[len++] = '\0';
15971 struct Context * context = SetupTemplatesContext(_class);
15973 FreeType(exp->expType);
15974 exp->expType = ProcessTypeString(templateString, 0x0);
15975 FinishTemplatesContext(context);
15979 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")))))))));
15982 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15984 type = ProcessTemplateParameterType(type->templateParameter);
15987 if(type && (type->kind == 20))
15989 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)))
15991 struct Identifier * id = exp->member.member;
15992 int typeKind = type->kind;
15993 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));
15995 if(typeKind == 19 && exp->member.exp->type == 24)
15997 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
16002 if(typeKind == 3 || typeKind == 15)
16003 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
16006 if(type->kind == 8 && type->_class && type->_class->registered)
16008 _class = type->_class->registered;
16010 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
16012 _class = FindClass("char *")->registered;
16014 else if(type->kind == 13)
16016 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
16017 FreeType(exp->expType);
16018 exp->expType = ProcessTypeString("uintptr", 0x0);
16019 exp->byReference = 0x1;
16023 char string[1024] = "";
16024 struct Symbol * classSym;
16026 PrintTypeNoConst(type, string, 0x0, 0x1);
16027 classSym = FindClass(string);
16029 _class = classSym->registered;
16035 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
16036 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
16037 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16038 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
16039 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
16041 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
16042 exp->member.memberType = 1;
16043 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
16044 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
16047 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
16049 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16050 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
16052 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16054 member = (((void *)0));
16056 if(!member && !prop)
16057 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16058 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
16059 exp->member.thisPtr = 0x1;
16063 unsigned int useMemberForNonConst = 0x0;
16067 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
16068 useMemberForNonConst = prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->type && !exp->destType->type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16069 if(useMemberForNonConst || !id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
16070 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
16072 if((!prop || useMemberForNonConst) && !member)
16074 method = useMemberForNonConst ? (((void *)0)) : __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
16077 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
16078 useMemberForNonConst |= prop && exp->destType && ((exp->destType->kind == 8 && !exp->destType->constant) || ((exp->destType->kind == 13 || exp->destType->kind == 12) && exp->destType->type && !exp->destType->type->constant)) && !strncmp(prop->dataTypeString, "const ", 6);
16079 if(useMemberForNonConst || !id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
16080 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
16085 if(useMemberForNonConst || (member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class)))
16086 prop = (((void *)0));
16088 member = (((void *)0));
16092 if(!prop && !member && !method)
16093 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
16094 if(!prop && !member && !method)
16098 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
16101 exp->member.memberType = 5;
16102 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
16106 char structName[1024];
16107 struct Identifier * id = exp->member.member;
16108 struct Expression * classExp = exp->member.exp;
16111 FreeType(classExp->expType);
16112 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
16113 strcpy(structName, "__ecereClassData_");
16114 FullClassNameCat(structName, type->_class->string, 0x0);
16116 exp->member.member = id;
16117 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"))))))));
16119 ProcessExpressionType(exp);
16125 struct Symbol * classSym = FindClass(id->string);
16129 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
16132 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
16138 exp->member.memberType = 1;
16139 if(!prop->dataType)
16140 ProcessPropertyType(prop);
16141 exp->expType = prop->dataType;
16143 prop->dataType->refCount++;
16147 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16149 FreeExpContents(exp);
16151 exp->identifier = MkIdentifier("class");
16152 ProcessExpressionType(exp);
16155 exp->member.memberType = 3;
16156 DeclareStruct(_class->fullName, 0x0);
16157 if(!member->dataType)
16159 struct Context * context = SetupTemplatesContext(_class);
16161 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16162 FinishTemplatesContext(context);
16164 exp->expType = member->dataType;
16165 if(member->dataType)
16166 member->dataType->refCount++;
16168 else if(revConvert)
16170 exp->member.memberType = 4;
16171 exp->expType = MkClassType(revConvert->_class->fullName);
16176 exp->member.memberType = 2;
16178 if(!method->dataType)
16179 ProcessMethodType(method);
16180 exp->expType = __extension__ ({
16181 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16183 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
16185 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
16186 exp->expType->usedClass = _class;
16188 else if(!classProp)
16190 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16192 FreeExpContents(exp);
16194 exp->identifier = MkIdentifier("class");
16195 FreeType(exp->expType);
16196 exp->expType = MkClassType("ecere::com::Class");
16199 yylloc = exp->member.member->loc;
16200 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16202 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16204 if(_class && exp->expType)
16206 struct __ecereNameSpace__ecere__com__Class * tClass;
16209 while(tClass && !tClass->templateClass)
16210 tClass = tClass->base;
16211 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
16214 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16215 struct __ecereNameSpace__ecere__com__Class * sClass;
16217 for(sClass = tClass; sClass; sClass = sClass->base)
16220 if(sClass->templateClass)
16221 sClass = sClass->templateClass;
16222 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16224 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
16226 for(sClass = sClass->base; sClass; sClass = sClass->base)
16227 id += sClass->templateParams.count;
16235 if(curParam && tClass->templateArgs[id].dataTypeString)
16237 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16238 struct Context * context = SetupTemplatesContext(tClass);
16239 unsigned int constant = exp->expType->constant;
16241 FreeType(exp->expType);
16242 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
16243 if(exp->expType->kind == 8 && constant)
16244 exp->expType->constant = 0x1;
16245 else if(exp->expType->kind == 13)
16247 struct Type * t = exp->expType->type;
16249 while(t->kind == 13)
16252 t->constant = constant;
16256 if(exp->expType->kind == 21)
16258 FreeType(exp->expType);
16259 exp->expType = ReplaceThisClassType(_class);
16261 if(tClass->templateClass)
16262 exp->expType->passAsTemplate = 0x1;
16265 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
16266 if(exp->destType->kind == 8 && constant)
16267 exp->destType->constant = 0x1;
16268 else if(exp->destType->kind == 13)
16270 struct Type * t = exp->destType->type;
16272 while(t->kind == 13)
16275 t->constant = constant;
16277 if(exp->destType->kind == 21)
16279 FreeType(exp->destType);
16280 exp->destType = ReplaceThisClassType(_class);
16284 FinishTemplatesContext(context);
16287 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
16290 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16291 struct __ecereNameSpace__ecere__com__Class * sClass;
16293 for(sClass = tClass; sClass; sClass = sClass->base)
16296 if(sClass->templateClass)
16297 sClass = sClass->templateClass;
16298 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16300 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
16302 for(sClass = sClass->base; sClass; sClass = sClass->base)
16303 id += sClass->templateParams.count;
16313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16314 struct Context * context = SetupTemplatesContext(tClass);
16315 struct Type * basicType;
16317 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
16320 if(basicType->kind == 21)
16322 FreeType(basicType);
16323 basicType = ReplaceThisClassType(_class);
16325 FreeType(exp->expType);
16326 exp->expType = __extension__ ({
16327 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16329 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
16333 exp->destType = exp->expType;
16334 exp->destType->refCount++;
16337 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16338 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16339 struct Declarator * decl;
16341 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16344 exp->destType->refCount++;
16346 exp->expType->refCount++;
16348 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16349 exp->cast.exp = newExp;
16352 FinishTemplatesContext(context);
16355 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16357 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16361 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16364 int paramCount = 0;
16365 int lastParam = -1;
16366 char templateString[1024];
16367 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16369 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16370 while(cClass != expClass)
16372 struct __ecereNameSpace__ecere__com__Class * sClass;
16374 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16377 for(param = cClass->templateParams.first; param; param = param->next)
16379 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16382 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16383 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16385 while(cClassCur != tClass && !paramCur)
16387 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16389 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16391 cClassCur = sClassCur;
16392 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16394 if(!strcmp(paramCur->name, param->name))
16401 if(paramCur && paramCur->type == 0)
16402 arg = tClass->templateArgs[cp];
16404 arg = expClass->templateArgs[p];
16406 char argument[256];
16408 argument[0] = '\0';
16409 switch(param->type)
16413 char expString[1024];
16414 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16415 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16416 struct Expression * exp;
16417 char * string = PrintHexUInt64(arg.expression.ui64);
16419 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16420 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16421 ProcessExpressionType(exp);
16422 ComputeExpression(exp);
16423 expString[0] = '\0';
16424 PrintExpression(exp, expString);
16425 strcat(argument, expString);
16426 FreeExpression(exp);
16431 strcat(argument, arg.member->name);
16436 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16437 strcat(argument, arg.dataTypeString);
16444 strcat(templateString, ", ");
16445 if(lastParam != p - 1)
16447 strcat(templateString, param->name);
16448 strcat(templateString, " = ");
16450 strcat(templateString, argument);
16459 int len = strlen(templateString);
16461 if(templateString[len - 1] == '>')
16462 templateString[len++] = ' ';
16463 templateString[len++] = '>';
16464 templateString[len++] = '\0';
16466 FreeType(exp->expType);
16468 struct Context * context = SetupTemplatesContext(tClass);
16470 exp->expType = ProcessTypeString(templateString, 0x0);
16471 FinishTemplatesContext(context);
16478 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)");
16480 else if(type && (type->kind == 9 || type->kind == 10))
16482 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16486 exp->expType = memberType;
16488 memberType->refCount++;
16493 char expString[10240];
16495 expString[0] = '\0';
16498 PrintExpression(exp, expString);
16499 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16503 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16505 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16507 struct Identifier * id = exp->member.member;
16508 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));
16512 FreeType(exp->expType);
16513 exp->expType = ReplaceThisClassType(_class);
16517 yylloc = oldyylloc;
16522 struct Type * destType = exp->destType;
16524 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16526 exp->member.member->classSym = exp->member.member->_class->symbol;
16528 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16532 ProcessExpressionType(exp);
16539 struct Symbol * classSym = exp->_class->symbol;
16541 if(classSym && classSym->registered)
16543 if(classSym->registered->type == 5)
16548 DeclareStruct(classSym->string, 0x0);
16549 FreeSpecifier(exp->_class);
16551 FullClassNameCat(name, classSym->string, 0x0);
16552 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16556 if(classSym->registered->fixed)
16558 FreeSpecifier(exp->_class);
16559 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16564 char className[1024];
16566 strcpy(className, "__ecereClass_");
16567 FullClassNameCat(className, classSym->string, 0x1);
16568 MangleClassName(className);
16569 DeclareClass(classSym, className);
16570 FreeExpContents(exp);
16572 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16573 exp->member.member = MkIdentifier("structSize");
16577 exp->expType = __extension__ ({
16578 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16580 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16586 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16588 exp->expType = __extension__ ({
16589 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16591 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16593 exp->isConstant = 0x1;
16594 DeclareType(type, 0x0, 0x0);
16600 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16603 FreeType(exp->cast.exp->destType);
16604 exp->cast.exp->destType = type;
16606 type->casted = 0x1;
16607 ProcessExpressionType(exp->cast.exp);
16608 type->casted = 0x0;
16610 exp->expType = type;
16611 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16613 void * prev = exp->prev, * next = exp->next;
16614 struct Type * expType = exp->cast.exp->destType;
16615 struct Expression * castExp = exp->cast.exp;
16616 struct Type * destType = exp->destType;
16619 expType->refCount++;
16620 FreeType(exp->expType);
16621 FreeTypeName(exp->cast.typeName);
16623 FreeType(exp->expType);
16624 FreeType(exp->destType);
16625 exp->expType = expType;
16626 exp->destType = destType;
16627 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16633 exp->isConstant = exp->cast.exp->isConstant;
16639 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16641 exp->expType = type;
16646 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16648 ProcessExpressionType(exp->vaArg.exp);
16649 exp->expType = type;
16654 struct Expression * e;
16656 exp->isConstant = 0x1;
16657 FreeType(exp->cond.cond->destType);
16658 exp->cond.cond->destType = MkClassType("bool");
16659 exp->cond.cond->destType->truth = 0x1;
16660 ProcessExpressionType(exp->cond.cond);
16661 if(!exp->cond.cond->isConstant)
16662 exp->isConstant = 0x0;
16663 for(e = (*exp->cond.exp).first; e; e = e->next)
16667 FreeType(e->destType);
16668 e->destType = exp->destType;
16670 e->destType->refCount++;
16672 ProcessExpressionType(e);
16675 exp->expType = e->expType;
16677 e->expType->refCount++;
16680 exp->isConstant = 0x0;
16682 FreeType(exp->cond.elseExp->destType);
16683 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16684 if(exp->cond.elseExp->destType)
16685 exp->cond.elseExp->destType->refCount++;
16686 ProcessExpressionType(exp->cond.elseExp);
16687 if(!exp->cond.elseExp->isConstant)
16688 exp->isConstant = 0x0;
16693 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16695 struct Statement * last = (*exp->compound->compound.statements).last;
16697 if(last->type == 3 && last->expressions && (*last->expressions).last)
16699 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16701 exp->destType->refCount++;
16703 ProcessStatement(exp->compound);
16704 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16706 exp->expType->refCount++;
16712 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16714 if(spec && spec->type == 1)
16716 exp->expType = MkClassType(spec->name);
16717 exp->expType->kind = 19;
16718 exp->byReference = 0x1;
16722 exp->expType = MkClassType("ecere::com::Class");
16723 exp->byReference = 0x1;
16729 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16733 struct Identifier * id = exp->classData.id;
16734 char structName[1024];
16735 struct Expression * classExp;
16737 strcpy(structName, "__ecereClassData_");
16738 FullClassNameCat(structName, _class->fullName, 0x0);
16740 exp->member.member = id;
16741 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16742 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16744 classExp = MkExpIdentifier(MkIdentifier("class"));
16745 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"))))))));
16746 ProcessExpressionType(exp);
16753 struct Type * type = (((void *)0));
16754 const char * typeString = (((void *)0));
16755 char typeStringBuf[1024];
16757 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))
16759 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16761 typeString = templateClass->templateArgs[2].dataTypeString;
16765 struct Expression * e;
16767 for(e = (*exp->list).first; e; e = e->next)
16769 ProcessExpressionType(e);
16779 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16783 e->expType = (((void *)0));
16784 e = (*exp->list).first;
16785 ProcessExpressionType(e);
16788 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
16790 FreeType(e->expType);
16791 e->expType = (((void *)0));
16793 type = (((void *)0));
16801 FreeType(e->expType);
16802 e->expType = (((void *)0));
16808 typeStringBuf[0] = '\0';
16809 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16810 typeString = typeStringBuf;
16812 type = (((void *)0));
16817 char templateString[1024];
16818 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16819 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16820 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16821 struct Expression * expExt;
16822 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16824 sprintf(templateString, "Container<%s>", typeString);
16827 struct Expression * e;
16829 type = ProcessTypeString(typeString, 0x0);
16830 while(e = (*exp->list).first)
16832 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16833 e->destType = type;
16835 ProcessExpressionType(e);
16836 ListAdd(initializers, MkInitializerAssignment(e));
16839 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16841 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16842 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16843 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16844 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16845 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16846 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16847 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16848 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16849 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16850 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16851 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16853 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16855 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16856 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16857 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16858 exp->expType = ProcessTypeString(templateString, 0x0);
16860 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16861 ProcessExpressionType(expExt);
16865 exp->expType = ProcessTypeString("Container", 0x0);
16866 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16871 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16873 FreeType(exp->expType);
16874 exp->expType = ReplaceThisClassType(thisClass);
16876 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16878 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16882 if(exp->expType->kind != 15)
16884 struct Type * member;
16885 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16887 FreeType(exp->expType);
16888 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16889 exp->expType->kind = symbol->type->kind;
16890 exp->expType->refCount++;
16891 exp->expType->enumName = enumName;
16892 exp->expType->members = symbol->type->members;
16893 for(member = symbol->type->members.first; member; member = member->next)
16894 member->refCount++;
16898 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16900 for(member = symbol->type->members.first; member; member = member->next)
16902 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16910 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16912 else if(exp->destType && !exp->destType->keepCast)
16914 if(!CheckExpressionType(exp, exp->destType, 0x0, !exp->destType->casted))
16916 if(!exp->destType->count || unresolved)
16921 if(exp->destType->kind != 14)
16928 char expString[10240];
16930 expString[0] = '\0';
16931 PrintType(exp->destType, type2, 0x0, 0x1);
16934 PrintExpression(exp, expString);
16935 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16938 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16939 else if(exp->type != 16)
16940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16945 char expString[10240];
16947 expString[0] = '\0';
16950 PrintExpression(exp, expString);
16951 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16954 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16955 else if(exp->type != 16)
16956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16968 PrintType(exp->expType, type1, 0x0, 0x1);
16969 PrintType(exp->destType, type2, 0x0, 0x1);
16971 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)))
16975 char expString[10240];
16977 expString[0] = '\0';
16980 PrintExpression(exp, expString);
16981 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16983 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16984 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16985 FreeType(exp->expType);
16986 exp->destType->refCount++;
16987 exp->expType = exp->destType;
16992 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16994 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16995 char typeString[1024];
16996 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16997 struct Declarator * decl;
16999 typeString[0] = '\0';
17002 exp->expType->refCount++;
17004 exp->expType->refCount++;
17006 newExp->destType = exp->expType;
17007 PrintType(exp->expType, typeString, 0x0, 0x0);
17008 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
17009 exp->cast.typeName = MkTypeName(specs, decl);
17010 exp->cast.exp = newExp;
17013 else if(unresolved)
17015 if(exp->identifier->_class && exp->identifier->_class->name)
17016 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
17017 else if(exp->identifier->string && exp->identifier->string[0])
17018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
17020 else if(!exp->expType && exp->type != 16)
17022 char expString[10240];
17024 expString[0] = '\0';
17027 PrintExpression(exp, expString);
17028 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
17030 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
17033 ApplyAnyObjectLogic(exp);
17034 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)))
17036 exp->byReference = 0x1;
17038 yylloc = oldyylloc;
17041 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)
17045 *curMember = (*curMember)->next;
17046 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
17048 *curMember = subMemberStack[--(*subMemberStackPos)];
17049 *curMember = (*curMember)->next;
17051 while((*curMember) && (*curMember)->isProperty)
17052 *curMember = (*curMember)->next;
17053 if(subMemberStackPos)
17055 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17057 subMemberStack[(*subMemberStackPos)++] = *curMember;
17058 *curMember = (*curMember)->members.first;
17059 while(*curMember && (*curMember)->isProperty)
17060 *curMember = (*curMember)->next;
17068 if(subMemberStackPos && *subMemberStackPos)
17070 *curMember = subMemberStack[--(*subMemberStackPos)];
17071 *curMember = (*curMember)->next;
17075 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
17077 if(*curClass == _class)
17079 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
17081 *curMember = (*curClass)->membersAndProperties.first;
17083 while((*curMember) && (*curMember)->isProperty)
17084 *curMember = (*curMember)->next;
17085 if(subMemberStackPos)
17087 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
17089 subMemberStack[(*subMemberStackPos)++] = *curMember;
17090 *curMember = (*curMember)->members.first;
17091 while(*curMember && (*curMember)->isProperty)
17092 *curMember = (*curMember)->next;
17099 static void ProcessInitializer(struct Initializer * init, struct Type * type)
17104 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
17106 if(init->exp && !init->exp->destType)
17108 FreeType(init->exp->destType);
17109 init->exp->destType = type;
17115 ProcessExpressionType(init->exp);
17116 init->isConstant = init->exp->isConstant;
17122 struct Expression * exp = init->exp;
17123 struct Instantiation * inst = exp->instance;
17124 struct MembersInit * members;
17127 init->list = MkList();
17130 for(members = (*inst->members).first; members; members = members->next)
17132 if(members->type == 0)
17134 struct MemberInit * member;
17136 for(member = (*members->dataMembers).first; member; member = member->next)
17138 ListAdd(init->list, member->initializer);
17139 member->initializer = (((void *)0));
17144 FreeExpression(exp);
17148 struct Initializer * i;
17149 struct Type * initializerType = (((void *)0));
17150 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
17151 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
17152 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
17153 int subMemberStackPos = 0;
17155 if(type && type->kind == 12)
17156 initializerType = Dereference(type);
17157 else if(type && (type->kind == 9 || type->kind == 10))
17158 initializerType = type->members.first;
17159 for(i = (*init->list).first; i; i = i->next)
17161 if(type && type->kind == 8 && type->_class && type->_class->registered)
17163 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
17166 if(!curMember->dataType)
17167 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
17168 initializerType = curMember->dataType;
17171 ProcessInitializer(i, initializerType);
17172 if(initializerType && type && (type->kind == 9 || type->kind == 10))
17173 initializerType = initializerType->next;
17175 init->isConstant = 0x0;
17177 if(type && type->kind == 12)
17178 FreeType(initializerType);
17179 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
17181 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17188 extern struct Symbol * FindType(struct Context * ctx, const char * name);
17190 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17192 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17198 if(spec->specifier == THISCLASS)
17203 spec->name = ReplaceThisClass(thisClass);
17204 spec->symbol = FindClass(spec->name);
17205 ProcessSpecifier(spec, declareStruct);
17212 struct Symbol * symbol = FindType(curContext, spec->name);
17215 DeclareType(symbol->type, 0x1, 0x1);
17216 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
17217 DeclareStruct(spec->name, 0x0);
17222 struct Enumerator * e;
17226 for(e = (*spec->list).first; e; e = e->next)
17229 ProcessExpressionType(e->exp);
17237 if(spec->definitions)
17239 struct ClassDef * def;
17240 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
17242 ProcessClass(spec->definitions, symbol);
17249 static void ProcessDeclarator(struct Declarator * decl)
17254 if(decl->identifier->classSym)
17256 FreeSpecifier(decl->identifier->_class);
17257 decl->identifier->_class = (((void *)0));
17261 if(decl->array.exp)
17262 ProcessExpressionType(decl->array.exp);
17269 if(decl->declarator)
17270 ProcessDeclarator(decl->declarator);
17271 if(decl->type == 4)
17273 struct Identifier * id = GetDeclId(decl);
17275 if(id && id->_class)
17277 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17279 if(!decl->function.parameters)
17280 decl->function.parameters = MkList();
17281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
17282 id->_class = (((void *)0));
17284 if(decl->function.parameters)
17286 struct TypeName * param;
17288 for(param = (*decl->function.parameters).first; param; param = param->next)
17290 if(param->qualifiers && (*param->qualifiers).first)
17292 struct Specifier * spec = (*param->qualifiers).first;
17294 if(spec && spec->specifier == TYPED_OBJECT)
17296 struct Declarator * d = param->declarator;
17297 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);
17300 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*newParam->qualifiers), (((void *)0)), MkSpecifier(CONST));
17301 FreeList(param->qualifiers, FreeSpecifier);
17302 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17303 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
17307 else if(spec && spec->specifier == ANY_OBJECT)
17309 struct Declarator * d = param->declarator;
17311 FreeList(param->qualifiers, FreeSpecifier);
17312 param->qualifiers = MkListOne(MkSpecifier(VOID));
17314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*param->qualifiers), (((void *)0)), MkSpecifier(CONST));
17315 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17317 else if(spec->specifier == THISCLASS)
17322 spec->name = ReplaceThisClass(thisClass);
17323 spec->symbol = FindClass(spec->name);
17324 ProcessSpecifier(spec, 0x0);
17328 if(param->declarator)
17329 ProcessDeclarator(param->declarator);
17337 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17339 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17341 static void ProcessDeclaration(struct Declaration * decl)
17343 yylloc = decl->loc;
17348 unsigned int declareStruct = 0x0;
17350 if(decl->declarators)
17352 struct InitDeclarator * d;
17354 for(d = (*decl->declarators).first; d; d = d->next)
17356 struct Type * type, * subType;
17358 ProcessDeclarator(d->declarator);
17359 type = ProcessType(decl->specifiers, d->declarator);
17362 ProcessInitializer(d->initializer, type);
17363 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17365 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17367 struct Instantiation * inst = d->initializer->exp->instance;
17369 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17370 d->initializer->exp->instance = (((void *)0));
17371 if(decl->specifiers)
17372 FreeList(decl->specifiers, FreeSpecifier);
17373 FreeList(decl->declarators, FreeInitDeclarator);
17380 for(subType = type; subType; )
17382 if(subType->kind == 8)
17384 declareStruct = 0x1;
17387 else if(subType->kind == 13)
17389 else if(subType->kind == 12)
17390 subType = subType->arrayType;
17399 if(decl->specifiers)
17401 struct Specifier * s;
17403 for(s = (*decl->specifiers).first; s; s = s->next)
17405 ProcessSpecifier(s, declareStruct);
17412 ProcessInstantiationType(decl->inst);
17417 struct Specifier * spec;
17418 struct Declarator * d;
17419 unsigned int declareStruct = 0x0;
17421 if(decl->declarators)
17423 for(d = (*decl->declarators).first; d; d = d->next)
17425 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17426 struct Type * subType;
17428 ProcessDeclarator(d);
17429 for(subType = type; subType; )
17431 if(subType->kind == 8)
17433 declareStruct = 0x1;
17436 else if(subType->kind == 13)
17438 else if(subType->kind == 12)
17439 subType = subType->arrayType;
17446 if(decl->specifiers)
17448 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17449 ProcessSpecifier(spec, declareStruct);
17456 static struct FunctionDefinition * curFunction;
17458 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17460 char propName[1024], propNameM[1024];
17461 char getName[1024], setName[1024];
17462 struct __ecereNameSpace__ecere__sys__OldList * args;
17464 DeclareProperty(prop, setName, getName);
17465 strcpy(propName, "__ecereProp_");
17466 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17467 strcat(propName, "_");
17468 FullClassNameCat(propName, prop->name, 0x1);
17469 MangleClassName(propName);
17470 strcpy(propNameM, "__ecerePropM_");
17471 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17472 strcat(propNameM, "_");
17473 FullClassNameCat(propNameM, prop->name, 0x1);
17474 MangleClassName(propNameM);
17475 if(prop->isWatchable)
17478 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17479 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17480 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17482 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17483 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17484 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17488 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17489 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17490 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17492 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17493 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17494 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17496 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17497 curFunction->propSet->fireWatchersDone = 0x1;
17500 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17502 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17504 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17506 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17508 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17510 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17512 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17514 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17516 static void ProcessStatement(struct Statement * stmt)
17518 yylloc = stmt->loc;
17522 ProcessStatement(stmt->labeled.stmt);
17525 if(stmt->caseStmt.exp)
17527 FreeType(stmt->caseStmt.exp->destType);
17528 stmt->caseStmt.exp->destType = curSwitchType;
17530 curSwitchType->refCount++;
17531 ProcessExpressionType(stmt->caseStmt.exp);
17532 ComputeExpression(stmt->caseStmt.exp);
17534 if(stmt->caseStmt.stmt)
17535 ProcessStatement(stmt->caseStmt.stmt);
17539 if(stmt->compound.context)
17541 struct Declaration * decl;
17542 struct Statement * s;
17543 struct Statement * prevCompound = curCompound;
17544 struct Context * prevContext = curContext;
17546 if(!stmt->compound.isSwitch)
17547 curCompound = stmt;
17548 curContext = stmt->compound.context;
17549 if(stmt->compound.declarations)
17551 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17552 ProcessDeclaration(decl);
17554 if(stmt->compound.statements)
17556 for(s = (*stmt->compound.statements).first; s; s = s->next)
17557 ProcessStatement(s);
17559 curContext = prevContext;
17560 curCompound = prevCompound;
17566 struct Expression * exp;
17568 if(stmt->expressions)
17570 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17571 ProcessExpressionType(exp);
17577 struct Expression * exp;
17579 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17580 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17581 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17582 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17584 ProcessExpressionType(exp);
17586 if(stmt->ifStmt.stmt)
17587 ProcessStatement(stmt->ifStmt.stmt);
17588 if(stmt->ifStmt.elseStmt)
17589 ProcessStatement(stmt->ifStmt.elseStmt);
17594 struct Type * oldSwitchType = curSwitchType;
17596 if(stmt->switchStmt.exp)
17598 struct Expression * exp;
17600 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17604 ProcessExpressionType(exp);
17607 curSwitchType = exp->expType;
17610 ProcessStatement(stmt->switchStmt.stmt);
17611 curSwitchType = oldSwitchType;
17616 if(stmt->whileStmt.exp)
17618 struct Expression * exp;
17620 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17621 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17622 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17623 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17625 ProcessExpressionType(exp);
17628 if(stmt->whileStmt.stmt)
17629 ProcessStatement(stmt->whileStmt.stmt);
17634 if(stmt->doWhile.exp)
17636 struct Expression * exp;
17638 if((*stmt->doWhile.exp).last)
17640 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17641 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17642 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17644 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17646 ProcessExpressionType(exp);
17649 if(stmt->doWhile.stmt)
17650 ProcessStatement(stmt->doWhile.stmt);
17655 struct Expression * exp;
17657 if(stmt->forStmt.init)
17658 ProcessStatement(stmt->forStmt.init);
17659 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17661 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17662 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17663 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17665 if(stmt->forStmt.check)
17666 ProcessStatement(stmt->forStmt.check);
17667 if(stmt->forStmt.increment)
17669 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17670 ProcessExpressionType(exp);
17672 if(stmt->forStmt.stmt)
17673 ProcessStatement(stmt->forStmt.stmt);
17678 struct Identifier * id = stmt->forEachStmt.id;
17679 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17680 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17681 struct Statement * block = stmt->forEachStmt.stmt;
17682 char iteratorType[1024];
17683 struct Type * source;
17684 struct Expression * e;
17685 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));
17686 struct Expression * arrayExp;
17687 const char * typeString = (((void *)0));
17688 int builtinCount = 0;
17690 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17694 FreeType(e->destType);
17695 e->destType = ProcessTypeString("Container", 0x0);
17697 if(!isBuiltin || e->next)
17698 ProcessExpressionType(e);
17700 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17701 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17703 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17704 struct Symbol * symbol;
17705 struct Expression * expIt = (((void *)0));
17706 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17707 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17708 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17709 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17712 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17713 stmt->compound.context->parent = curContext;
17714 curContext = stmt->compound.context;
17715 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17717 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17719 isCustomAVLTree = 0x1;
17720 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17723 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17725 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17727 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17730 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17734 struct Declarator * decl;
17735 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17737 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17738 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17739 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17743 struct Type * type = (((void *)0));
17744 char typeStringBuf[1024];
17746 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17747 if(((struct Expression *)(*exp).last)->type == 11)
17749 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17752 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17754 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)
17756 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17758 typeString = templateClass->templateArgs[2].dataTypeString;
17760 else if(arrayExp->list)
17762 struct Expression * e;
17764 for(e = (*arrayExp->list).first; e; e = e->next)
17766 ProcessExpressionType(e);
17776 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17780 e->expType = (((void *)0));
17781 e = (*arrayExp->list).first;
17782 ProcessExpressionType(e);
17785 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0, 0x1))
17787 FreeType(e->expType);
17788 e->expType = (((void *)0));
17790 type = (((void *)0));
17798 FreeType(e->expType);
17799 e->expType = (((void *)0));
17805 typeStringBuf[0] = '\0';
17806 PrintType(type, typeStringBuf, 0x0, 0x1);
17807 typeString = typeStringBuf;
17813 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17814 struct Declarator * decl;
17815 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17819 struct Expression * e;
17821 builtinCount = (*arrayExp->list).count;
17822 type = ProcessTypeString(typeString, 0x0);
17823 while(e = (*arrayExp->list).first)
17825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17826 e->destType = type;
17828 ProcessExpressionType(e);
17829 ListAdd(initializers, MkInitializerAssignment(e));
17832 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17834 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17835 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17836 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17837 FreeList(exp, FreeExpression);
17841 arrayExp->expType = ProcessTypeString("Container", 0x0);
17842 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17845 else if(isLinkList && !isList)
17847 struct Declarator * decl;
17848 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17850 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17851 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17852 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17854 else if(_class->templateArgs)
17857 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17859 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17860 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17862 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17865 switch(block->type)
17868 if(block->compound.context)
17869 block->compound.context->parent = stmt->compound.context;
17872 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17873 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17874 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17875 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17878 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17879 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17882 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17883 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17886 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17887 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17890 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17891 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17894 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17895 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17901 block = MkIfStmt(filter, block, (((void *)0)));
17905 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));
17906 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17907 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17908 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17914 sprintf(count, "%d", builtinCount);
17915 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));
17916 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17917 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17918 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17920 else if(isLinkList && !isList)
17922 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17923 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17925 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17927 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));
17931 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17932 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17934 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));
17936 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17937 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17938 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17942 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17944 ProcessExpressionType(expIt);
17945 if((*stmt->compound.declarations).first)
17946 ProcessDeclaration((*stmt->compound.declarations).first);
17948 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17949 ProcessStatement(stmt);
17950 curContext = stmt->compound.context->parent;
17955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17967 struct Expression * exp;
17969 if(stmt->expressions)
17971 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17975 if(curFunction && !curFunction->type)
17976 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17977 FreeType(exp->destType);
17978 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17980 exp->destType->refCount++;
17982 ProcessExpressionType(exp);
17989 ProcessDeclaration(stmt->decl);
17994 struct AsmField * field;
17996 if(stmt->asmStmt.inputFields)
17998 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17999 if(field->expression)
18000 ProcessExpressionType(field->expression);
18002 if(stmt->asmStmt.outputFields)
18004 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
18005 if(field->expression)
18006 ProcessExpressionType(field->expression);
18008 if(stmt->asmStmt.clobberedFields)
18010 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
18012 if(field->expression)
18013 ProcessExpressionType(field->expression);
18020 struct PropertyWatch * propWatch;
18021 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18022 struct Expression * object = stmt->_watch.object;
18023 struct Expression * watcher = stmt->_watch.watcher;
18026 ProcessExpressionType(watcher);
18028 ProcessExpressionType(object);
18031 if(watcher || thisClass)
18033 struct External * external = curExternal;
18034 struct Context * context = curContext;
18037 stmt->expressions = MkList();
18038 curExternal = external->prev;
18039 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18041 struct ClassFunction * func;
18042 char watcherName[1024];
18043 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
18044 struct External * createdExternal;
18045 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
18047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
18048 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
18049 if(propWatch->deleteWatch)
18050 strcat(watcherName, "_delete");
18053 struct Identifier * propID;
18055 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18057 strcat(watcherName, "_");
18058 strcat(watcherName, propID->string);
18061 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
18063 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
18064 ProcessClassFunctionBody(func, propWatch->compound);
18065 propWatch->compound = (((void *)0));
18066 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
18067 createdExternal->symbol->idCode = external->symbol->idCode;
18068 curExternal = createdExternal;
18069 ProcessFunction(createdExternal->function);
18071 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
18073 externalDecl->declaration = decl;
18074 if(decl->symbol && !decl->symbol->pointerExternal)
18075 decl->symbol->pointerExternal = externalDecl;
18077 if(propWatch->deleteWatch)
18079 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18081 ListAdd(args, CopyExpression(object));
18082 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18083 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18084 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
18088 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
18089 struct Identifier * propID;
18091 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
18093 char propName[1024];
18094 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18098 char getName[1024], setName[1024];
18099 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18101 DeclareProperty(prop, setName, getName);
18102 strcpy(propName, "__ecereProp_");
18103 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18104 strcat(propName, "_");
18105 FullClassNameCat(propName, prop->name, 0x1);
18106 ListAdd(args, CopyExpression(object));
18107 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18108 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18109 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
18110 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
18113 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18118 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
18120 curExternal = external;
18121 curContext = context;
18123 FreeExpression(watcher);
18125 FreeExpression(object);
18126 FreeList(watches, FreePropertyWatch);
18129 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
18133 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
18135 ProcessStatement(propWatch->compound);
18142 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18143 struct Expression * object = stmt->_watch.object;
18144 struct __ecereNameSpace__ecere__com__Class * _class;
18147 ProcessExpressionType(object);
18150 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
18153 struct Identifier * propID;
18156 stmt->expressions = MkList();
18157 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
18159 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
18166 for(propID = (*watches).first; propID; propID = propID->next)
18168 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18172 CreateFireWatcher(prop, object, stmt);
18175 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18180 struct __ecereNameSpace__ecere__com__Property * prop;
18181 struct __ecereNameSpace__ecere__com__Class * base;
18183 for(base = _class; base; base = base->base)
18185 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18187 if(prop->isProperty && prop->isWatchable)
18189 CreateFireWatcher(prop, object, stmt);
18195 FreeExpression(object);
18196 FreeList(watches, FreeIdentifier);
18199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18205 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18206 struct Expression * object = stmt->_watch.object;
18207 struct Expression * watcher = stmt->_watch.watcher;
18208 struct __ecereNameSpace__ecere__com__Class * _class;
18211 ProcessExpressionType(object);
18213 ProcessExpressionType(watcher);
18216 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
18217 if(watcher || thisClass)
18221 struct Identifier * propID;
18224 stmt->expressions = MkList();
18227 struct __ecereNameSpace__ecere__sys__OldList * args;
18230 ListAdd(args, CopyExpression(object));
18231 ListAdd(args, MkExpConstant("0"));
18232 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18233 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18237 for(propID = (*watches).first; propID; propID = propID->next)
18239 char propName[1024];
18240 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18244 char getName[1024], setName[1024];
18245 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18247 DeclareProperty(prop, setName, getName);
18248 strcpy(propName, "__ecereProp_");
18249 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18250 strcat(propName, "_");
18251 FullClassNameCat(propName, prop->name, 0x1);
18252 MangleClassName(propName);
18253 ListAdd(args, CopyExpression(object));
18254 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18255 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18256 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18263 FreeExpression(object);
18265 FreeExpression(watcher);
18266 FreeList(watches, FreeIdentifier);
18269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18279 extern struct Expression * QBrackets(struct Expression * exp);
18281 extern struct TypeName * QMkType(const char * spec, struct Declarator * decl);
18283 extern struct Declarator * QMkPtrDecl(const char * id);
18285 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18287 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18289 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18291 static void ProcessFunction(struct FunctionDefinition * function)
18293 struct Identifier * id = GetDeclId(function->declarator);
18294 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18295 struct Type * type = symbol ? symbol->type : (((void *)0));
18296 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18297 struct Context * oldTopContext = topContext;
18299 yylloc = function->loc;
18300 if(type && type->thisClass)
18302 struct Symbol * classSym = type->thisClass;
18303 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
18304 char className[1024];
18305 char structName[1024];
18306 struct Declarator * funcDecl;
18307 struct Symbol * thisSymbol;
18308 unsigned int typedObject = 0x0;
18310 if(_class && !_class->base)
18312 _class = currentClass;
18313 if(_class && !_class->symbol)
18314 _class->symbol = FindClass(_class->fullName);
18315 classSym = _class ? _class->symbol : (((void *)0));
18318 thisClass = _class;
18319 if(inCompiler && _class)
18321 if(type->kind == 11)
18323 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
18325 struct Type * param = symbol->type->params.first;
18327 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
18330 if(type->classObjectType != 1)
18332 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
18333 symbol->type->staticMethod = 0x1;
18334 symbol->type->thisClass = (((void *)0));
18335 symbol->type->extraParam = 0x0;
18338 strcpy(className, "__ecereClass_");
18339 FullClassNameCat(className, _class->fullName, 0x1);
18340 MangleClassName(className);
18341 structName[0] = (char)0;
18342 FullClassNameCat(structName, _class->fullName, 0x0);
18343 funcDecl = GetFuncDecl(function->declarator);
18346 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18348 struct TypeName * param = (*funcDecl->function.parameters).first;
18350 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18352 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18353 FreeTypeName(param);
18356 if(!function->propertyNoThis)
18358 struct TypeName * thisParam;
18360 if(type->classObjectType != 1)
18362 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18363 if(!funcDecl->function.parameters)
18364 funcDecl->function.parameters = MkList();
18365 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18369 if(type->classObjectType != 1)
18371 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18372 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18374 thisParam = __extension__ ({
18375 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18377 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18379 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18383 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18385 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18387 funcDecl = GetFuncDecl(initDecl->declarator);
18390 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18392 struct TypeName * param = (*funcDecl->function.parameters).first;
18394 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18397 FreeTypeName(param);
18400 if(type->classObjectType != 1)
18402 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18404 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18406 if(!funcDecl->function.parameters)
18407 funcDecl->function.parameters = MkList();
18408 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18416 if(type->classObjectType != 1)
18418 thisSymbol = __extension__ ({
18419 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18421 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18423 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18424 if(typedObject && thisSymbol->type)
18426 thisSymbol->type->classObjectType = 2;
18427 thisSymbol->type->byReference = type->byReference;
18428 thisSymbol->type->typedByReference = type->byReference;
18432 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18434 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18437 struct __ecereNameSpace__ecere__com__Class * base;
18439 for(base = _class; base && base->type != 1000; base = base->next)
18441 for(member = base->membersAndProperties.first; member; member = member->next)
18442 if(!member->isProperty)
18448 for(member = _class->membersAndProperties.first; member; member = member->next)
18449 if(!member->isProperty)
18453 char pointerName[1024];
18454 struct Declaration * decl;
18455 struct Initializer * initializer;
18456 struct Expression * exp, * bytePtr;
18458 strcpy(pointerName, "__ecerePointer_");
18459 FullClassNameCat(pointerName, _class->fullName, 0x0);
18461 char className[1024];
18463 strcpy(className, "__ecereClass_");
18464 FullClassNameCat(className, classSym->string, 0x1);
18465 MangleClassName(className);
18466 DeclareClass(classSym, className);
18468 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18473 sprintf(string, "%d", _class->offset);
18474 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18478 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18480 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18481 exp->expType = __extension__ ({
18482 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18484 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18485 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18487 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18488 }), __ecereInstance2;
18492 yylloc = function->body->loc;
18493 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18495 struct Context * prevContext = curContext;
18497 curContext = function->body->compound.context;
18498 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18499 curContext = prevContext;
18501 decl->symbol = (((void *)0));
18502 if(!function->body->compound.declarations)
18503 function->body->compound.declarations = MkList();
18504 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18510 thisClass = (((void *)0));
18513 FreeSpecifier(id->_class);
18514 id->_class = (((void *)0));
18515 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18517 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18519 id = GetDeclId(initDecl->declarator);
18520 FreeSpecifier(id->_class);
18521 id->_class = (((void *)0));
18525 topContext = function->body->compound.context;
18527 struct FunctionDefinition * oldFunction = curFunction;
18529 curFunction = function;
18531 ProcessStatement(function->body);
18532 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18534 struct Statement * prevCompound = curCompound;
18535 struct Context * prevContext = curContext;
18536 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18538 if(!function->body->compound.statements)
18539 function->body->compound.statements = MkList();
18540 ListAdd(function->body->compound.statements, fireWatchers);
18541 curCompound = function->body;
18542 curContext = function->body->compound.context;
18543 ProcessStatement(fireWatchers);
18544 curContext = prevContext;
18545 curCompound = prevCompound;
18547 curFunction = oldFunction;
18549 if(function->declarator)
18551 ProcessDeclarator(function->declarator);
18553 topContext = oldTopContext;
18554 thisClass = oldThisClass;
18557 extern void FreeSymbol(struct Symbol * symbol);
18559 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18561 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18563 struct ClassDef * def;
18564 struct External * external = curExternal;
18565 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18567 for(def = definitions->first; def; def = def->next)
18571 if(def->function->declarator)
18572 curExternal = def->function->declarator->symbol->pointerExternal;
18574 curExternal = external;
18575 ProcessFunction((struct FunctionDefinition *)def->function);
18577 else if(def->type == 2)
18579 if(def->decl->type == 2)
18581 thisClass = regClass;
18582 ProcessInstantiationType(def->decl->inst);
18583 thisClass = (((void *)0));
18587 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18590 thisClass = regClass;
18591 ProcessDeclaration(def->decl);
18592 thisClass = backThisClass;
18595 else if(def->type == 1 && def->defProperties)
18597 struct MemberInit * defProperty;
18598 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);
18600 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18601 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18603 thisClass = regClass;
18604 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18605 thisClass = (((void *)0));
18607 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18608 FreeSymbol(thisSymbol);
18610 else if(def->type == 3 && def->propertyDef)
18612 struct PropertyDef * prop = def->propertyDef;
18614 thisClass = regClass;
18619 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18621 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18623 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18624 ProcessStatement(prop->setStmt);
18630 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18632 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18634 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18635 ProcessStatement(prop->getStmt);
18637 if(prop->issetStmt)
18641 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18643 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18645 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18646 ProcessStatement(prop->issetStmt);
18648 thisClass = (((void *)0));
18650 else if(def->type == 4 && def->propertyWatch)
18652 struct PropertyWatch * propertyWatch = def->propertyWatch;
18654 thisClass = regClass;
18655 if(propertyWatch->compound)
18657 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);
18659 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18660 curExternal = (((void *)0));
18661 ProcessStatement(propertyWatch->compound);
18663 thisClass = (((void *)0));
18668 void DeclareFunctionUtil(const char * s)
18670 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18677 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18678 strcpy(name, "__ecereFunction_");
18679 FullClassNameCat(name, s, 0x0);
18680 DeclareFunction(function, name);
18684 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18686 void ComputeDataTypes()
18688 struct External * external;
18689 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18690 struct External * after = (((void *)0));
18692 currentClass = (((void *)0));
18693 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18694 for(external = (*ast).first; external; external = external->next)
18696 if(external->type == 1)
18698 struct Declaration * decl = external->declaration;
18702 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18706 struct InitDeclarator * initDecl = (*decls).first;
18710 struct Declarator * declarator = initDecl->declarator;
18712 if(declarator && declarator->type == 1)
18714 struct Identifier * id = declarator->identifier;
18716 if(id && id->string)
18718 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18720 external->symbol->id = -1001, external->symbol->idCode = -1001;
18730 temp->symbol = __extension__ ({
18731 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18733 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18735 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18736 curExternal = temp;
18737 DeclareFunctionUtil("eSystem_New");
18738 DeclareFunctionUtil("eSystem_New0");
18739 DeclareFunctionUtil("eSystem_Renew");
18740 DeclareFunctionUtil("eSystem_Renew0");
18741 DeclareFunctionUtil("eSystem_Delete");
18742 DeclareFunctionUtil("eClass_GetProperty");
18743 DeclareFunctionUtil("eClass_SetProperty");
18744 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18745 DeclareFunctionUtil("eInstance_SetMethod");
18746 DeclareFunctionUtil("eInstance_IncRef");
18747 DeclareFunctionUtil("eInstance_StopWatching");
18748 DeclareFunctionUtil("eInstance_Watch");
18749 DeclareFunctionUtil("eInstance_FireWatchers");
18750 DeclareStruct("ecere::com::Class", 0x0);
18751 DeclareStruct("ecere::com::Instance", 0x0);
18752 DeclareStruct("ecere::com::Property", 0x0);
18753 DeclareStruct("ecere::com::DataMember", 0x0);
18754 DeclareStruct("ecere::com::Method", 0x0);
18755 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18756 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18757 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18758 for(external = (*ast).first; external; external = external->next)
18760 afterExternal = curExternal = external;
18761 if(external->type == 0)
18763 currentClass = external->function->_class;
18764 ProcessFunction(external->function);
18766 else if(external->type == 1)
18768 currentClass = (((void *)0));
18769 if(external->declaration)
18770 ProcessDeclaration(external->declaration);
18772 else if(external->type == 2)
18774 struct ClassDefinition * _class = external->_class;
18776 currentClass = external->symbol->registered;
18777 if(_class->definitions)
18779 ProcessClass(_class->definitions, _class->symbol);
18783 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18784 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18787 else if(external->type == 4)
18789 thisNameSpace = external->id->string;
18792 currentClass = (((void *)0));
18793 thisNameSpace = (((void *)0));
18794 curExternal = (((void *)0));
18795 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18796 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18799 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
18801 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char * name, const char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18803 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18805 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18807 struct __ecereNameSpace__ecere__com__Class * class;
18809 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18810 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18811 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18812 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18813 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18814 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18815 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18816 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18817 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18818 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18819 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18820 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18821 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18822 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18823 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18824 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18825 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18826 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18827 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18828 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18829 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18830 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18831 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18832 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18833 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18834 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18835 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18836 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18837 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18838 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18839 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18840 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18841 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18842 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18843 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18844 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18845 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18846 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18847 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18848 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18849 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18850 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18851 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18852 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18853 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18854 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18855 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18856 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18857 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18858 __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);
18859 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(const char * name, bool skipNoHead)", DeclareStruct, module, 2);
18860 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18861 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18862 __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);
18863 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18864 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18865 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18866 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18867 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18868 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18869 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, const char * name)", DeclareMethod, module, 1);
18870 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18871 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18872 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18873 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18874 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18875 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18876 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18877 __ecereClass_Conversion = class;
18878 __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, bool warnConst)", MatchTypes, module, 1);
18879 __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);
18880 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18881 __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);
18882 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla, bool warnConst)", MatchTypeExpression, module, 2);
18883 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18884 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18885 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18886 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18887 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18888 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18889 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18890 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18891 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18892 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18893 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18894 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18895 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18896 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18897 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18898 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18899 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18900 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyLocation", "void ApplyLocation(Expression exp, Location loc)", ApplyLocation, module, 1);
18901 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18902 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(const String s)", DeclareFunctionUtil, module, 1);
18903 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18906 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)