1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
57 struct __ecereNameSpace__ecere__sys__BTNode;
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
61 struct __ecereNameSpace__ecere__sys__BinaryTree
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
65 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (* FreeKey)(void * key);
67 } __attribute__ ((gcc_struct));
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
71 struct __ecereNameSpace__ecere__sys__OldList
78 } __attribute__ ((gcc_struct));
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
82 struct __ecereNameSpace__ecere__com__Method
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
92 struct __ecereNameSpace__ecere__com__Class * _class;
94 char * dataTypeString;
95 struct Type * dataType;
97 } __attribute__ ((gcc_struct));
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
101 struct __ecereNameSpace__ecere__com__Property
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
106 unsigned int isProperty;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char * dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (* Set)(void * , int);
114 int (* Get)(void * );
115 unsigned int (* IsSet)(void * );
119 unsigned int conversion;
120 unsigned int watcherOffset;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
135 } __attribute__ ((gcc_struct));
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
164 struct ClassDefinition
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList * definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
201 struct Instantiation * prev;
202 struct Instantiation * next;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList * members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char * data;
211 struct Location nameLoc;
212 struct Location insideLoc;
214 } __attribute__ ((gcc_struct));
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
220 struct Declaration * prev;
221 struct Declaration * next;
228 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList * declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
241 } __attribute__ ((gcc_struct));
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
247 struct Statement * prev;
248 struct Statement * next;
253 struct __ecereNameSpace__ecere__sys__OldList * expressions;
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
305 struct Specifier * spec;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
332 struct TypeName * prev;
333 struct TypeName * next;
335 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
336 struct Declarator * declarator;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
345 struct Initializer * prev;
346 struct Initializer * next;
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList * list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 struct Identifier * id;
356 } __attribute__ ((gcc_struct));
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
360 struct __ecereNameSpace__ecere__com__DataValue
375 } __attribute__ ((gcc_struct));
376 } __attribute__ ((gcc_struct));
378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
382 struct Expression * prev;
383 struct Expression * next;
391 struct Identifier * identifier;
392 } __attribute__ ((gcc_struct));
393 struct Statement * compound;
394 struct Instantiation * instance;
398 unsigned int intlString;
399 } __attribute__ ((gcc_struct));
400 struct __ecereNameSpace__ecere__sys__OldList * list;
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
423 struct Expression * exp;
424 struct Identifier * member;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct));
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
497 struct TemplateDatatype
499 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
500 struct Declarator * decl;
501 } __attribute__ ((gcc_struct));
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
505 struct TemplateArgument;
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
509 struct TemplateParameter
511 struct TemplateParameter * prev;
512 struct TemplateParameter * next;
515 struct Identifier * identifier;
518 struct TemplateDatatype * dataType;
520 } __attribute__ ((gcc_struct));
521 struct TemplateArgument * defaultArgument;
522 char * dataTypeString;
523 struct Type * baseType;
524 } __attribute__ ((gcc_struct));
526 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
530 struct Specifier * prev;
531 struct Specifier * next;
539 struct ExtDecl * extDecl;
541 struct Symbol * symbol;
542 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
543 } __attribute__ ((gcc_struct));
546 struct Identifier * id;
547 struct __ecereNameSpace__ecere__sys__OldList * list;
548 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
549 struct __ecereNameSpace__ecere__sys__OldList * definitions;
550 unsigned int addNameSpace;
551 struct Context * ctx;
552 struct ExtDecl * extDeclStruct;
553 } __attribute__ ((gcc_struct));
554 struct Expression * expression;
555 struct Specifier * _class;
556 struct TemplateParameter * templateParameter;
557 } __attribute__ ((gcc_struct));
558 } __attribute__ ((gcc_struct));
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
564 struct Identifier * prev;
565 struct Identifier * next;
567 struct Symbol * classSym;
568 struct Specifier * _class;
570 struct Identifier * badID;
571 } __attribute__ ((gcc_struct));
573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
577 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
581 struct Declarator * prev;
582 struct Declarator * next;
585 struct Symbol * symbol;
586 struct Declarator * declarator;
589 struct Identifier * identifier;
592 struct Expression * exp;
593 struct Expression * posExp;
594 struct Attrib * attrib;
595 } __attribute__ ((gcc_struct)) structDecl;
598 struct Expression * exp;
599 struct Specifier * enumClass;
600 } __attribute__ ((gcc_struct)) array;
603 struct __ecereNameSpace__ecere__sys__OldList * parameters;
604 } __attribute__ ((gcc_struct)) function;
607 struct Pointer * pointer;
608 } __attribute__ ((gcc_struct)) pointer;
611 struct ExtDecl * extended;
612 } __attribute__ ((gcc_struct)) extended;
613 } __attribute__ ((gcc_struct));
614 } __attribute__ ((gcc_struct));
616 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
618 struct FunctionDefinition
620 struct FunctionDefinition * prev;
621 struct FunctionDefinition * next;
623 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
624 struct Declarator * declarator;
625 struct __ecereNameSpace__ecere__sys__OldList * declarations;
626 struct Statement * body;
627 struct __ecereNameSpace__ecere__com__Class * _class;
628 struct __ecereNameSpace__ecere__sys__OldList attached;
631 struct Symbol * propSet;
633 unsigned int propertyNoThis;
634 } __attribute__ ((gcc_struct));
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
644 struct External * prev;
645 struct External * next;
648 struct Symbol * symbol;
651 struct FunctionDefinition * function;
652 struct ClassDefinition * _class;
653 struct Declaration * declaration;
655 struct Identifier * id;
656 struct DBTableDef * table;
657 } __attribute__ ((gcc_struct));
659 } __attribute__ ((gcc_struct));
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
665 struct ModuleImport * prev;
666 struct ModuleImport * next;
668 struct __ecereNameSpace__ecere__sys__OldList classes;
669 struct __ecereNameSpace__ecere__sys__OldList functions;
672 } __attribute__ ((gcc_struct));
674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
678 struct ClassImport * prev;
679 struct ClassImport * next;
681 struct __ecereNameSpace__ecere__sys__OldList methods;
682 struct __ecereNameSpace__ecere__sys__OldList properties;
685 } __attribute__ ((gcc_struct));
687 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
692 struct Symbol * parent;
693 struct Symbol * left;
694 struct Symbol * right;
699 struct __ecereNameSpace__ecere__com__Method * method;
700 struct __ecereNameSpace__ecere__com__Property * _property;
701 struct __ecereNameSpace__ecere__com__Class * registered;
702 } __attribute__ ((gcc_struct));
709 struct External * pointerExternal;
710 struct External * structExternal;
711 } __attribute__ ((gcc_struct));
714 struct External * externalGet;
715 struct External * externalSet;
716 struct External * externalPtr;
717 struct External * externalIsSet;
718 } __attribute__ ((gcc_struct));
721 struct External * methodExternal;
722 struct External * methodCodeExternal;
723 } __attribute__ ((gcc_struct));
724 } __attribute__ ((gcc_struct));
725 unsigned int imported;
726 unsigned int declaredStructSym;
727 struct __ecereNameSpace__ecere__com__Class * _class;
728 unsigned int declaredStruct;
729 unsigned int needConstructor;
730 unsigned int needDestructor;
731 char * constructorName;
734 char * destructorName;
735 struct ModuleImport * module;
736 struct ClassImport * _import;
737 struct Location nameLoc;
738 unsigned int isParam;
739 unsigned int isRemote;
740 unsigned int isStruct;
741 unsigned int fireWatchersDone;
743 unsigned int classData;
744 unsigned int isStatic;
746 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
747 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
748 struct Context * ctx;
750 struct Expression * propCategory;
751 } __attribute__ ((gcc_struct));
753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
762 struct Symbol * _class;
765 struct __ecereNameSpace__ecere__sys__OldList members;
767 } __attribute__ ((gcc_struct));
770 struct Type * returnType;
771 struct __ecereNameSpace__ecere__sys__OldList params;
772 struct Symbol * thisClass;
773 unsigned int staticMethod;
774 struct TemplateParameter * thisClassTemplate;
775 } __attribute__ ((gcc_struct));
778 struct __ecereNameSpace__ecere__com__Method * method;
779 struct __ecereNameSpace__ecere__com__Class * methodClass;
780 struct __ecereNameSpace__ecere__com__Class * usedClass;
781 } __attribute__ ((gcc_struct));
784 struct Type * arrayType;
786 struct Expression * arraySizeExp;
787 unsigned int freeExp;
788 struct Symbol * enumClass;
789 } __attribute__ ((gcc_struct));
791 struct TemplateParameter * templateParameter;
792 } __attribute__ ((gcc_struct));
802 unsigned int isSigned : 1;
803 unsigned int constant : 1;
804 unsigned int truth : 1;
805 unsigned int byReference : 1;
806 unsigned int extraParam : 1;
807 unsigned int directClassAccess : 1;
808 unsigned int computing : 1;
809 unsigned int keepCast : 1;
810 unsigned int passAsTemplate : 1;
811 unsigned int dllExport : 1;
812 unsigned int attrStdcall : 1;
813 unsigned int declaredWithStruct : 1;
814 unsigned int typedByReference : 1;
815 } __attribute__ ((gcc_struct));
817 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
819 struct __ecereNameSpace__ecere__com__Class
821 struct __ecereNameSpace__ecere__com__Class * prev;
822 struct __ecereNameSpace__ecere__com__Class * next;
828 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
829 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
832 struct __ecereNameSpace__ecere__com__Class * base;
833 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
834 struct __ecereNameSpace__ecere__sys__BinaryTree members;
835 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
836 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
837 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
838 struct __ecereNameSpace__ecere__sys__OldList derivatives;
842 struct __ecereNameSpace__ecere__com__Instance * module;
843 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
844 char * dataTypeString;
845 struct Type * dataType;
847 int defaultAlignment;
848 void (* Initialize)();
850 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
851 char * designerClass;
852 unsigned int noExpansion;
853 char * defaultProperty;
854 unsigned int comRedefinition;
857 unsigned int internalDecl;
859 unsigned int computeSize;
861 int destructionWatchOffset;
863 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
864 int inheritanceAccess;
867 struct __ecereNameSpace__ecere__sys__OldList conversions;
868 struct __ecereNameSpace__ecere__sys__OldList templateParams;
869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
870 struct __ecereNameSpace__ecere__com__Class * templateClass;
871 struct __ecereNameSpace__ecere__sys__OldList templatized;
873 unsigned int isInstanceClass;
874 unsigned int byValueSystemClass;
875 } __attribute__ ((gcc_struct));
877 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
879 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, long long value);
881 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
883 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, char * name, void * function);
885 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
887 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);
889 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
891 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
893 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
895 struct __ecereNameSpace__ecere__com__Instance
898 struct __ecereNameSpace__ecere__com__Class * _class;
900 } __attribute__ ((gcc_struct));
902 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
904 struct __ecereNameSpace__ecere__com__DataMember
906 struct __ecereNameSpace__ecere__com__DataMember * prev;
907 struct __ecereNameSpace__ecere__com__DataMember * next;
909 unsigned int isProperty;
912 struct __ecereNameSpace__ecere__com__Class * _class;
913 char * dataTypeString;
914 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
915 struct Type * dataType;
919 struct __ecereNameSpace__ecere__sys__OldList members;
920 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
923 } __attribute__ ((gcc_struct));
925 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
927 struct __ecereNameSpace__ecere__com__SerialBuffer
929 unsigned char * _buffer;
933 } __attribute__ ((gcc_struct));
935 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
937 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
943 char * dataTypeString;
944 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
945 } __attribute__ ((gcc_struct));
946 struct __ecereNameSpace__ecere__com__DataValue expression;
952 struct __ecereNameSpace__ecere__com__DataMember * member;
953 struct __ecereNameSpace__ecere__com__Property * prop;
954 struct __ecereNameSpace__ecere__com__Method * method;
955 } __attribute__ ((gcc_struct));
956 } __attribute__ ((gcc_struct));
957 } __attribute__ ((gcc_struct));
958 } __attribute__ ((gcc_struct));
960 void exit(int status);
962 void * calloc(size_t nmemb, size_t size);
964 void free(void * ptr);
966 void * malloc(size_t size);
968 void * realloc(void * ptr, size_t size);
970 long int strtol(const char * nptr, char ** endptr, int base);
972 long long int strtoll(const char * nptr, char ** endptr, int base);
974 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
978 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
981 typedef union YYSTYPE
986 struct Identifier * id;
987 struct Expression * exp;
988 struct Specifier * specifier;
989 struct __ecereNameSpace__ecere__sys__OldList * list;
990 struct Enumerator * enumerator;
991 struct Declarator * declarator;
992 struct Pointer * pointer;
993 struct Initializer * initializer;
994 struct InitDeclarator * initDeclarator;
995 struct TypeName * typeName;
996 struct Declaration * declaration;
997 struct Statement * stmt;
998 struct FunctionDefinition * function;
999 struct External * external;
1000 struct Context * context;
1001 struct AsmField * asmField;
1002 struct Attrib * attrib;
1003 struct ExtDecl * extDecl;
1004 struct Attribute * attribute;
1005 struct Instantiation * instance;
1006 struct MembersInit * membersInit;
1007 struct MemberInit * memberInit;
1008 struct ClassFunction * classFunction;
1009 struct ClassDefinition * _class;
1010 struct ClassDef * classDef;
1011 struct PropertyDef * prop;
1013 struct Symbol * symbol;
1014 struct PropertyWatch * propertyWatch;
1015 struct TemplateParameter * templateParameter;
1016 struct TemplateArgument * templateArgument;
1017 struct TemplateDatatype * templateDatatype;
1018 struct DBTableEntry * dbtableEntry;
1019 struct DBIndexItem * dbindexItem;
1020 struct DBTableDef * dbtableDef;
1021 } __attribute__ ((gcc_struct)) YYSTYPE;
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1027 struct Enumerator * prev;
1028 struct Enumerator * next;
1029 struct Location loc;
1030 struct Identifier * id;
1031 struct Expression * exp;
1032 } __attribute__ ((gcc_struct));
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1036 struct InitDeclarator
1038 struct InitDeclarator * prev;
1039 struct InitDeclarator * next;
1040 struct Location loc;
1041 struct Declarator * declarator;
1042 struct Initializer * initializer;
1043 } __attribute__ ((gcc_struct));
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1049 struct AsmField * prev;
1050 struct AsmField * next;
1051 struct Location loc;
1053 struct Expression * expression;
1054 struct Identifier * symbolic;
1055 } __attribute__ ((gcc_struct));
1057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1061 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1063 struct ClassFunction
1065 struct ClassFunction * prev;
1066 struct ClassFunction * next;
1067 struct Location loc;
1068 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1069 struct Declarator * declarator;
1070 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1071 struct Statement * body;
1072 struct __ecereNameSpace__ecere__com__Class * _class;
1073 struct __ecereNameSpace__ecere__sys__OldList attached;
1076 struct Symbol * propSet;
1077 unsigned int isVirtual;
1078 unsigned int isConstructor;
1079 unsigned int isDestructor;
1080 unsigned int dontMangle;
1083 } __attribute__ ((gcc_struct));
1085 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1089 struct MembersInit * prev;
1090 struct MembersInit * next;
1091 struct Location loc;
1095 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1096 struct ClassFunction * function;
1097 } __attribute__ ((gcc_struct));
1098 } __attribute__ ((gcc_struct));
1100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1104 struct MemberInit * prev;
1105 struct MemberInit * next;
1106 struct Location loc;
1107 struct Location realLoc;
1108 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1109 struct Initializer * initializer;
1111 unsigned int variable;
1112 unsigned int takeOutExp;
1113 } __attribute__ ((gcc_struct));
1115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1119 struct PropertyDef * prev;
1120 struct PropertyDef * next;
1121 struct Location loc;
1122 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1123 struct Declarator * declarator;
1124 struct Identifier * id;
1125 struct Statement * getStmt;
1126 struct Statement * setStmt;
1127 struct Statement * issetStmt;
1128 struct Symbol * symbol;
1129 struct Expression * category;
1132 unsigned int conversion : 1;
1133 unsigned int isWatchable : 1;
1134 unsigned int isDBProp : 1;
1135 } __attribute__ ((gcc_struct));
1136 } __attribute__ ((gcc_struct));
1138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1140 struct PropertyWatch
1142 struct PropertyWatch * prev;
1143 struct PropertyWatch * next;
1144 struct Location loc;
1145 struct Statement * compound;
1146 struct __ecereNameSpace__ecere__sys__OldList * properties;
1147 unsigned int deleteWatch;
1148 } __attribute__ ((gcc_struct));
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1154 struct ClassDef * prev;
1155 struct ClassDef * next;
1156 struct Location loc;
1160 struct Declaration * decl;
1161 struct ClassFunction * function;
1162 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1163 struct PropertyDef * propertyDef;
1164 struct PropertyWatch * propertyWatch;
1166 struct Identifier * defaultProperty;
1169 struct Identifier * id;
1170 struct Initializer * initializer;
1171 } __attribute__ ((gcc_struct));
1172 } __attribute__ ((gcc_struct));
1175 } __attribute__ ((gcc_struct));
1177 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1179 struct DBTableEntry;
1181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1185 extern YYSTYPE yylval;
1187 extern struct Location yylloc;
1189 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1191 extern int returnCode;
1193 extern struct Expression * parsedExpression;
1195 extern unsigned int yydebug;
1197 void SetYydebug(unsigned int b)
1202 extern unsigned int echoOn;
1204 void resetScanner();
1208 int expression_yyparse();
1210 static struct Statement * curCompound;
1212 struct External * curExternal, * afterExternal;
1214 static struct Type * curSwitchType;
1216 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1218 struct __ecereNameSpace__ecere__com__Class * thisClass;
1220 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1225 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1230 static char * thisNameSpace;
1232 struct __ecereNameSpace__ecere__com__Class * containerClass;
1234 unsigned int thisClassParams = 0x1;
1236 unsigned int internalValueCounter;
1238 extern unsigned int outputLineNumbers;
1240 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1242 extern size_t strlen(const char * );
1244 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1246 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1248 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1250 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1252 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1254 void PrintExpression(struct Expression * exp, char * string)
1257 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1259 unsigned int backOutputLineNumbers = outputLineNumbers;
1261 outputLineNumbers = 0x0;
1263 OutputExpression(exp, f);
1264 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1265 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1267 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1268 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1269 count = strlen(string);
1270 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1271 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1273 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1274 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1275 string[count] = '\0';
1276 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1277 outputLineNumbers = backOutputLineNumbers;
1281 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1283 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1285 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1287 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1289 if(!param->baseType)
1291 if(param->dataTypeString)
1292 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1294 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1296 return param->baseType;
1298 return (((void *)0));
1301 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1303 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1305 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1309 if(type1->kind == type2->kind)
1320 if(type1->passAsTemplate && !type2->passAsTemplate)
1322 return type1->isSigned != type2->isSigned;
1324 return type1->_class != type2->_class;
1326 return NeedCast(type1->type, type2->type);
1334 extern int strcmp(const char * , const char * );
1336 extern struct Context * curContext;
1338 extern struct Context * topContext;
1340 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1342 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1344 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1346 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1348 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1352 struct __ecereNameSpace__ecere__com__ClassProperty
1355 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1356 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1357 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1359 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1360 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1361 char * dataTypeString;
1362 struct Type * dataType;
1363 unsigned int constant;
1364 } __attribute__ ((gcc_struct));
1366 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1368 extern struct Expression * QMkExpId(char * id);
1370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1372 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1374 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1375 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1380 char * dataTypeString;
1382 } __attribute__ ((gcc_struct));
1383 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1385 } __attribute__ ((gcc_struct));
1387 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1389 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1391 extern void FreeIdentifier(struct Identifier * id);
1393 void ProcessExpressionType(struct Expression * exp);
1395 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1397 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1399 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1401 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1403 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1405 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1407 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1409 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1411 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1413 if(exp->type == 0 && exp->identifier)
1415 struct Identifier * id = exp->identifier;
1416 struct Context * ctx;
1417 struct Symbol * symbol = (((void *)0));
1419 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1421 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1423 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1428 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1430 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1431 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1432 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1433 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1437 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1439 if(!prop && !method)
1440 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1441 if(!prop && !method && !member)
1443 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1445 if(prop || method || member || classProp)
1448 exp->member.member = id;
1449 exp->member.memberType = 0;
1450 exp->member.exp = QMkExpId("this");
1451 exp->addedThis = 0x1;
1453 else if(_class && _class->templateParams.first)
1455 struct __ecereNameSpace__ecere__com__Class * sClass;
1457 for(sClass = _class; sClass; sClass = sClass->base)
1459 if(sClass->templateParams.first)
1461 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1463 for(param = sClass->templateParams.first; param; param = param->next)
1465 if(param->type == 2 && !strcmp(param->name, id->string))
1467 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1471 struct Declarator * decl;
1472 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1474 FreeIdentifier(exp->member.member);
1475 ProcessExpressionType(argExp);
1476 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1477 exp->expType = ProcessType(specs, decl);
1479 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1490 extern int sprintf(char * , char * , ...);
1492 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1494 extern char * strcat(char * , const char * );
1496 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1498 char * PrintInt(long long result)
1502 if(result > (((int)0x7fffffff)))
1503 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1506 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1508 return __ecereNameSpace__ecere__sys__CopyString(temp);
1511 char * PrintUInt(uint64 result)
1515 if(result > (0xffffffff))
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1517 else if(result > (((int)0x7fffffff)))
1518 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1520 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1521 return __ecereNameSpace__ecere__sys__CopyString(temp);
1524 char * PrintInt64(long long result)
1528 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1529 return __ecereNameSpace__ecere__sys__CopyString(temp);
1532 char * PrintUInt64(uint64 result)
1536 if(result > (((long long)0x7fffffffffffffffLL)))
1537 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1539 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1540 return __ecereNameSpace__ecere__sys__CopyString(temp);
1543 char * PrintHexUInt(uint64 result)
1547 if(result > (0xffffffff))
1548 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1550 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1551 if(result > (0xffffffff))
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 char * PrintHexUInt64(uint64 result)
1560 if(result > (0xffffffff))
1561 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 char * PrintShort(short result)
1571 sprintf(temp, "%d", (unsigned short)result);
1572 return __ecereNameSpace__ecere__sys__CopyString(temp);
1575 char * PrintUShort(unsigned short result)
1579 if(result > (unsigned short)32767)
1580 sprintf(temp, "0x%X", (int)result);
1582 sprintf(temp, "%d", (int)result);
1583 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 extern int isprint(int c);
1588 char * PrintChar(char result)
1592 if(result > (char)0 && isprint(result))
1593 sprintf(temp, "'%c'", result);
1594 else if(result < (char)0)
1595 sprintf(temp, "%d", (int)result);
1597 sprintf(temp, "0x%X", (unsigned char)result);
1598 return __ecereNameSpace__ecere__sys__CopyString(temp);
1601 char * PrintUChar(unsigned char result)
1605 sprintf(temp, "0x%X", result);
1606 return __ecereNameSpace__ecere__sys__CopyString(temp);
1609 extern char * strcpy(char * , const char * );
1611 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1613 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1615 extern int (* __ecereProp_float_Get_signBit)(float this);
1617 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1619 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1621 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1623 char * PrintFloat(float result)
1627 if(__ecereProp_float_Get_isInf(result))
1629 if(__ecereProp_float_Get_signBit(result))
1630 strcpy(temp, "-inf");
1632 strcpy(temp, "inf");
1634 else if(__ecereProp_float_Get_isNan(result))
1636 if(__ecereProp_float_Get_signBit(result))
1637 strcpy(temp, "-nan");
1639 strcpy(temp, "nan");
1642 sprintf(temp, "%.16ff", result);
1643 return __ecereNameSpace__ecere__sys__CopyString(temp);
1646 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1648 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1650 extern int (* __ecereProp_double_Get_signBit)(double this);
1652 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1654 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1656 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1658 char * PrintDouble(double result)
1662 if(__ecereProp_double_Get_isInf(result))
1664 if(__ecereProp_double_Get_signBit(result))
1665 strcpy(temp, "-inf");
1667 strcpy(temp, "inf");
1669 else if(__ecereProp_double_Get_isNan(result))
1671 if(__ecereProp_double_Get_signBit(result))
1672 strcpy(temp, "-nan");
1674 strcpy(temp, "nan");
1677 sprintf(temp, "%.16f", result);
1678 return __ecereNameSpace__ecere__sys__CopyString(temp);
1681 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1685 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* Neg)(struct Expression *, struct Operand *);
1691 unsigned int (* Inc)(struct Expression *, struct Operand *);
1692 unsigned int (* Dec)(struct Expression *, struct Operand *);
1693 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1698 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1705 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* Not)(struct Expression *, struct Operand *);
1711 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1720 } __attribute__ ((gcc_struct));
1722 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1728 unsigned int ptrSize;
1741 } __attribute__ ((gcc_struct));
1743 } __attribute__ ((gcc_struct));
1745 unsigned int GetOpInt(struct Operand * op2, int * value2)
1747 if(op2->kind == 3 && op2->type->isSigned)
1749 else if(op2->kind == 3)
1750 *value2 = (int)op2->ui;
1751 else if(op2->kind == 4 && op2->type->isSigned)
1752 *value2 = (int)op2->i64;
1753 else if(op2->kind == 4)
1754 *value2 = (int)op2->ui64;
1755 else if(op2->kind == 23 && op2->type->isSigned)
1756 *value2 = (int)op2->i64;
1757 else if(op2->kind == 23)
1758 *value2 = (int)op2->ui64;
1759 else if(op2->kind == 22 && op2->type->isSigned)
1760 *value2 = (int)op2->i64;
1761 else if(op2->kind == 22)
1762 *value2 = (int)op2->ui64;
1763 else if(op2->kind == 2 && op2->type->isSigned)
1764 *value2 = (int)op2->s;
1765 else if(op2->kind == 2)
1766 *value2 = (int)op2->us;
1767 else if(op2->kind == 1 && op2->type->isSigned)
1768 *value2 = (int)op2->c;
1769 else if(op2->kind == 24 || op2->kind == 1)
1770 *value2 = (int)op2->uc;
1771 else if(op2->kind == 6)
1772 *value2 = (int)op2->f;
1773 else if(op2->kind == 7)
1774 *value2 = (int)op2->d;
1775 else if(op2->kind == 13)
1776 *value2 = (int)op2->ui64;
1782 struct Operand GetOperand(struct Expression * exp);
1784 unsigned int GetInt(struct Expression * exp, int * value2)
1786 struct Operand op2 = GetOperand(exp);
1788 return GetOpInt(&op2, value2);
1791 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1793 if(op2->kind == 3 && op2->type->isSigned)
1794 *value2 = (unsigned int)op2->i;
1795 else if(op2->kind == 3)
1797 else if(op2->kind == 4 && op2->type->isSigned)
1798 *value2 = (unsigned int)op2->i64;
1799 else if(op2->kind == 4)
1800 *value2 = (unsigned int)op2->ui64;
1801 else if(op2->kind == 23 && op2->type->isSigned)
1802 *value2 = (unsigned int)op2->i64;
1803 else if(op2->kind == 23)
1804 *value2 = (unsigned int)op2->ui64;
1805 else if(op2->kind == 22 && op2->type->isSigned)
1806 *value2 = (unsigned int)op2->i64;
1807 else if(op2->kind == 22)
1808 *value2 = (unsigned int)op2->ui64;
1809 else if(op2->kind == 2 && op2->type->isSigned)
1810 *value2 = (unsigned int)op2->s;
1811 else if(op2->kind == 2)
1812 *value2 = (unsigned int)op2->us;
1813 else if(op2->kind == 1 && op2->type->isSigned)
1814 *value2 = (unsigned int)op2->c;
1815 else if(op2->kind == 24 || op2->kind == 1)
1816 *value2 = (unsigned int)op2->uc;
1817 else if(op2->kind == 6)
1818 *value2 = (unsigned int)op2->f;
1819 else if(op2->kind == 7)
1820 *value2 = (unsigned int)op2->d;
1821 else if(op2->kind == 13)
1822 *value2 = (unsigned int)op2->ui64;
1828 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1830 struct Operand op2 = GetOperand(exp);
1832 return GetOpUInt(&op2, value2);
1835 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1837 if(op2->kind == 3 && op2->type->isSigned)
1838 *value2 = (long long)op2->i;
1839 else if(op2->kind == 3)
1840 *value2 = (long long)op2->ui;
1841 else if(op2->kind == 4 && op2->type->isSigned)
1843 else if(op2->kind == 4)
1844 *value2 = (long long)op2->ui64;
1845 else if(op2->kind == 23 && op2->type->isSigned)
1847 else if(op2->kind == 23)
1848 *value2 = (long long)op2->ui64;
1849 else if(op2->kind == 22 && op2->type->isSigned)
1851 else if(op2->kind == 22)
1852 *value2 = (long long)op2->ui64;
1853 else if(op2->kind == 2 && op2->type->isSigned)
1854 *value2 = (long long)op2->s;
1855 else if(op2->kind == 2)
1856 *value2 = (long long)op2->us;
1857 else if(op2->kind == 1 && op2->type->isSigned)
1858 *value2 = (long long)op2->c;
1859 else if(op2->kind == 24 || op2->kind == 1)
1860 *value2 = (long long)op2->uc;
1861 else if(op2->kind == 6)
1862 *value2 = (long long)op2->f;
1863 else if(op2->kind == 7)
1864 *value2 = (long long)op2->d;
1865 else if(op2->kind == 13)
1866 *value2 = (long long)op2->ui64;
1872 unsigned int GetInt64(struct Expression * exp, long long * value2)
1874 struct Operand op2 = GetOperand(exp);
1876 return GetOpInt64(&op2, value2);
1879 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1881 if(op2->kind == 3 && op2->type->isSigned)
1882 *value2 = (uint64)op2->i;
1883 else if(op2->kind == 3)
1884 *value2 = (uint64)op2->ui;
1885 else if(op2->kind == 4 && op2->type->isSigned)
1886 *value2 = (uint64)op2->i64;
1887 else if(op2->kind == 4)
1888 *value2 = op2->ui64;
1889 else if(op2->kind == 23 && op2->type->isSigned)
1890 *value2 = (uint64)op2->i64;
1891 else if(op2->kind == 23)
1892 *value2 = op2->ui64;
1893 else if(op2->kind == 22 && op2->type->isSigned)
1894 *value2 = (uint64)op2->i64;
1895 else if(op2->kind == 22)
1896 *value2 = op2->ui64;
1897 else if(op2->kind == 2 && op2->type->isSigned)
1898 *value2 = (uint64)op2->s;
1899 else if(op2->kind == 2)
1900 *value2 = (uint64)op2->us;
1901 else if(op2->kind == 1 && op2->type->isSigned)
1902 *value2 = (uint64)op2->c;
1903 else if(op2->kind == 24 || op2->kind == 1)
1904 *value2 = (uint64)op2->uc;
1905 else if(op2->kind == 6)
1906 *value2 = (uint64)op2->f;
1907 else if(op2->kind == 7)
1908 *value2 = (uint64)op2->d;
1909 else if(op2->kind == 13)
1910 *value2 = op2->ui64;
1916 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1918 struct Operand op2 = GetOperand(exp);
1920 return GetOpUInt64(&op2, value2);
1923 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1925 if(op2->kind == 3 && op2->type->isSigned)
1926 *value2 = (intptr_t)op2->i;
1927 else if(op2->kind == 3)
1928 *value2 = (intptr_t)op2->ui;
1929 else if(op2->kind == 4 && op2->type->isSigned)
1930 *value2 = (intptr_t)op2->i64;
1931 else if(op2->kind == 4)
1932 *value2 = (intptr_t)op2->ui64;
1933 else if(op2->kind == 23 && op2->type->isSigned)
1934 *value2 = (intptr_t)op2->i64;
1935 else if(op2->kind == 23)
1936 *value2 = (intptr_t)op2->ui64;
1937 else if(op2->kind == 22 && op2->type->isSigned)
1938 *value2 = (intptr_t)op2->i64;
1939 else if(op2->kind == 22)
1940 *value2 = (intptr_t)op2->ui64;
1941 else if(op2->kind == 2 && op2->type->isSigned)
1942 *value2 = (intptr_t)op2->s;
1943 else if(op2->kind == 2)
1944 *value2 = (intptr_t)op2->us;
1945 else if(op2->kind == 1 && op2->type->isSigned)
1946 *value2 = (intptr_t)op2->c;
1947 else if(op2->kind == 24 || op2->kind == 1)
1948 *value2 = (intptr_t)op2->uc;
1949 else if(op2->kind == 6)
1950 *value2 = (intptr_t)op2->f;
1951 else if(op2->kind == 7)
1952 *value2 = (intptr_t)op2->d;
1953 else if(op2->kind == 13)
1954 *value2 = (intptr_t)op2->ui64;
1960 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1962 struct Operand op2 = GetOperand(exp);
1964 return GetOpIntPtr(&op2, value2);
1967 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1969 if(op2->kind == 3 && op2->type->isSigned)
1970 *value2 = (uintptr_t)op2->i;
1971 else if(op2->kind == 3)
1972 *value2 = (uintptr_t)op2->ui;
1973 else if(op2->kind == 4 && op2->type->isSigned)
1974 *value2 = (uintptr_t)op2->i64;
1975 else if(op2->kind == 4)
1976 *value2 = (uintptr_t)op2->ui64;
1977 else if(op2->kind == 23 && op2->type->isSigned)
1978 *value2 = (uintptr_t)op2->i64;
1979 else if(op2->kind == 23)
1980 *value2 = (uintptr_t)op2->ui64;
1981 else if(op2->kind == 22 && op2->type->isSigned)
1982 *value2 = (uintptr_t)op2->i64;
1983 else if(op2->kind == 22)
1984 *value2 = (uintptr_t)op2->ui64;
1985 else if(op2->kind == 2 && op2->type->isSigned)
1986 *value2 = (uintptr_t)op2->s;
1987 else if(op2->kind == 2)
1988 *value2 = (uintptr_t)op2->us;
1989 else if(op2->kind == 1 && op2->type->isSigned)
1990 *value2 = (uintptr_t)op2->c;
1991 else if(op2->kind == 24 || op2->kind == 1)
1992 *value2 = (uintptr_t)op2->uc;
1993 else if(op2->kind == 6)
1994 *value2 = (uintptr_t)op2->f;
1995 else if(op2->kind == 7)
1996 *value2 = (uintptr_t)op2->d;
1997 else if(op2->kind == 13)
1998 *value2 = (uintptr_t)op2->ui64;
2004 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
2006 struct Operand op2 = GetOperand(exp);
2008 return GetOpUIntPtr(&op2, value2);
2011 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2013 if(op2->kind == 3 && op2->type->isSigned)
2014 *value2 = (ssize_t)op2->i;
2015 else if(op2->kind == 3)
2016 *value2 = (ssize_t)op2->ui;
2017 else if(op2->kind == 4 && op2->type->isSigned)
2018 *value2 = (ssize_t)op2->i64;
2019 else if(op2->kind == 4)
2020 *value2 = (ssize_t)op2->ui64;
2021 else if(op2->kind == 23 && op2->type->isSigned)
2022 *value2 = (ssize_t)op2->i64;
2023 else if(op2->kind == 23)
2024 *value2 = (ssize_t)op2->ui64;
2025 else if(op2->kind == 22 && op2->type->isSigned)
2026 *value2 = (ssize_t)op2->i64;
2027 else if(op2->kind == 22)
2028 *value2 = (ssize_t)op2->ui64;
2029 else if(op2->kind == 2 && op2->type->isSigned)
2030 *value2 = (ssize_t)op2->s;
2031 else if(op2->kind == 2)
2032 *value2 = (ssize_t)op2->us;
2033 else if(op2->kind == 1 && op2->type->isSigned)
2034 *value2 = (ssize_t)op2->c;
2035 else if(op2->kind == 24 || op2->kind == 1)
2036 *value2 = (ssize_t)op2->uc;
2037 else if(op2->kind == 6)
2038 *value2 = (ssize_t)op2->f;
2039 else if(op2->kind == 7)
2040 *value2 = (ssize_t)op2->d;
2041 else if(op2->kind == 13)
2042 *value2 = (ssize_t)op2->ui64;
2048 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2050 struct Operand op2 = GetOperand(exp);
2052 return GetOpIntSize(&op2, value2);
2055 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2057 if(op2->kind == 3 && op2->type->isSigned)
2058 *value2 = (size_t)op2->i;
2059 else if(op2->kind == 3)
2060 *value2 = (size_t)op2->ui;
2061 else if(op2->kind == 4 && op2->type->isSigned)
2062 *value2 = (size_t)op2->i64;
2063 else if(op2->kind == 4)
2064 *value2 = (size_t)op2->ui64;
2065 else if(op2->kind == 23 && op2->type->isSigned)
2066 *value2 = (size_t)op2->i64;
2067 else if(op2->kind == 23)
2068 *value2 = (size_t)op2->ui64;
2069 else if(op2->kind == 22 && op2->type->isSigned)
2070 *value2 = (size_t)op2->i64;
2071 else if(op2->kind == 22)
2072 *value2 = (size_t)op2->ui64;
2073 else if(op2->kind == 2 && op2->type->isSigned)
2074 *value2 = (size_t)op2->s;
2075 else if(op2->kind == 2)
2076 *value2 = (size_t)op2->us;
2077 else if(op2->kind == 1 && op2->type->isSigned)
2078 *value2 = (size_t)op2->c;
2079 else if(op2->kind == 24 || op2->kind == 1)
2080 *value2 = (size_t)op2->uc;
2081 else if(op2->kind == 6)
2082 *value2 = (size_t)op2->f;
2083 else if(op2->kind == 7)
2084 *value2 = (size_t)op2->d;
2085 else if(op2->kind == 13)
2086 *value2 = (size_t)op2->ui64;
2092 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2094 struct Operand op2 = GetOperand(exp);
2096 return GetOpUIntSize(&op2, value2);
2099 unsigned int GetOpShort(struct Operand * op2, short * value2)
2101 if(op2->kind == 3 && op2->type->isSigned)
2102 *value2 = (short)op2->i;
2103 else if(op2->kind == 3)
2104 *value2 = (short)op2->ui;
2105 else if(op2->kind == 4 && op2->type->isSigned)
2106 *value2 = (short)op2->i64;
2107 else if(op2->kind == 4)
2108 *value2 = (short)op2->ui64;
2109 else if(op2->kind == 23 && op2->type->isSigned)
2110 *value2 = (short)op2->i64;
2111 else if(op2->kind == 23)
2112 *value2 = (short)op2->ui64;
2113 else if(op2->kind == 22 && op2->type->isSigned)
2114 *value2 = (short)op2->i64;
2115 else if(op2->kind == 22)
2116 *value2 = (short)op2->ui64;
2117 else if(op2->kind == 2 && op2->type->isSigned)
2119 else if(op2->kind == 2)
2120 *value2 = (short)op2->us;
2121 else if(op2->kind == 1 && op2->type->isSigned)
2122 *value2 = (short)op2->c;
2123 else if(op2->kind == 24 || op2->kind == 1)
2124 *value2 = (short)op2->uc;
2125 else if(op2->kind == 6)
2126 *value2 = (short)op2->f;
2127 else if(op2->kind == 7)
2128 *value2 = (short)op2->d;
2129 else if(op2->kind == 13)
2130 *value2 = (short)op2->ui64;
2136 unsigned int GetShort(struct Expression * exp, short * value2)
2138 struct Operand op2 = GetOperand(exp);
2140 return GetOpShort(&op2, value2);
2143 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2145 if(op2->kind == 3 && op2->type->isSigned)
2146 *value2 = (unsigned short)op2->i;
2147 else if(op2->kind == 3)
2148 *value2 = (unsigned short)op2->ui;
2149 else if(op2->kind == 4 && op2->type->isSigned)
2150 *value2 = (unsigned short)op2->i64;
2151 else if(op2->kind == 4)
2152 *value2 = (unsigned short)op2->ui64;
2153 else if(op2->kind == 23 && op2->type->isSigned)
2154 *value2 = (unsigned short)op2->i64;
2155 else if(op2->kind == 23)
2156 *value2 = (unsigned short)op2->ui64;
2157 else if(op2->kind == 22 && op2->type->isSigned)
2158 *value2 = (unsigned short)op2->i64;
2159 else if(op2->kind == 22)
2160 *value2 = (unsigned short)op2->ui64;
2161 else if(op2->kind == 2 && op2->type->isSigned)
2162 *value2 = (unsigned short)op2->s;
2163 else if(op2->kind == 2)
2165 else if(op2->kind == 1 && op2->type->isSigned)
2166 *value2 = (unsigned short)op2->c;
2167 else if(op2->kind == 24 || op2->kind == 1)
2168 *value2 = (unsigned short)op2->uc;
2169 else if(op2->kind == 6)
2170 *value2 = (unsigned short)op2->f;
2171 else if(op2->kind == 7)
2172 *value2 = (unsigned short)op2->d;
2173 else if(op2->kind == 13)
2174 *value2 = (unsigned short)op2->ui64;
2180 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2182 struct Operand op2 = GetOperand(exp);
2184 return GetOpUShort(&op2, value2);
2187 unsigned int GetOpChar(struct Operand * op2, char * value2)
2189 if(op2->kind == 3 && op2->type->isSigned)
2190 *value2 = (char)op2->i;
2191 else if(op2->kind == 3)
2192 *value2 = (char)op2->ui;
2193 else if(op2->kind == 4 && op2->type->isSigned)
2194 *value2 = (char)op2->i64;
2195 else if(op2->kind == 4)
2196 *value2 = (char)op2->ui64;
2197 else if(op2->kind == 23 && op2->type->isSigned)
2198 *value2 = (char)op2->i64;
2199 else if(op2->kind == 23)
2200 *value2 = (char)op2->ui64;
2201 else if(op2->kind == 22 && op2->type->isSigned)
2202 *value2 = (char)op2->i64;
2203 else if(op2->kind == 22)
2204 *value2 = (char)op2->ui64;
2205 else if(op2->kind == 2 && op2->type->isSigned)
2206 *value2 = (char)op2->s;
2207 else if(op2->kind == 2)
2208 *value2 = (char)op2->us;
2209 else if(op2->kind == 1 && op2->type->isSigned)
2211 else if(op2->kind == 24 || op2->kind == 1)
2212 *value2 = (char)op2->uc;
2213 else if(op2->kind == 6)
2214 *value2 = (char)op2->f;
2215 else if(op2->kind == 7)
2216 *value2 = (char)op2->d;
2217 else if(op2->kind == 13)
2218 *value2 = (char)op2->ui64;
2224 unsigned int GetChar(struct Expression * exp, char * value2)
2226 struct Operand op2 = GetOperand(exp);
2228 return GetOpChar(&op2, value2);
2231 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2233 if(op2->kind == 3 && op2->type->isSigned)
2234 *value2 = (unsigned char)op2->i;
2235 else if(op2->kind == 3)
2236 *value2 = (unsigned char)op2->ui;
2237 else if(op2->kind == 4 && op2->type->isSigned)
2238 *value2 = (unsigned char)op2->i64;
2239 else if(op2->kind == 4)
2240 *value2 = (unsigned char)op2->ui64;
2241 else if(op2->kind == 23 && op2->type->isSigned)
2242 *value2 = (unsigned char)op2->i64;
2243 else if(op2->kind == 23)
2244 *value2 = (unsigned char)op2->ui64;
2245 else if(op2->kind == 22 && op2->type->isSigned)
2246 *value2 = (unsigned char)op2->i64;
2247 else if(op2->kind == 22)
2248 *value2 = (unsigned char)op2->ui64;
2249 else if(op2->kind == 2 && op2->type->isSigned)
2250 *value2 = (unsigned char)op2->s;
2251 else if(op2->kind == 2)
2252 *value2 = (unsigned char)op2->us;
2253 else if(op2->kind == 1 && op2->type->isSigned)
2254 *value2 = (unsigned char)op2->c;
2255 else if(op2->kind == 24 || op2->kind == 1)
2257 else if(op2->kind == 6)
2258 *value2 = (unsigned char)op2->f;
2259 else if(op2->kind == 7)
2260 *value2 = (unsigned char)op2->d;
2261 else if(op2->kind == 13)
2262 *value2 = (unsigned char)op2->ui64;
2268 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2270 struct Operand op2 = GetOperand(exp);
2272 return GetOpUChar(&op2, value2);
2275 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2277 if(op2->kind == 3 && op2->type->isSigned)
2278 *value2 = (float)(float)op2->i;
2279 else if(op2->kind == 3)
2280 *value2 = (float)(float)op2->ui;
2281 else if(op2->kind == 4 && op2->type->isSigned)
2282 *value2 = (float)(float)op2->i64;
2283 else if(op2->kind == 4)
2284 *value2 = (float)(float)op2->ui64;
2285 else if(op2->kind == 23 && op2->type->isSigned)
2286 *value2 = (float)(float)op2->i64;
2287 else if(op2->kind == 23)
2288 *value2 = (float)(float)op2->ui64;
2289 else if(op2->kind == 22 && op2->type->isSigned)
2290 *value2 = (float)(float)op2->i64;
2291 else if(op2->kind == 22)
2292 *value2 = (float)(float)op2->ui64;
2293 else if(op2->kind == 2 && op2->type->isSigned)
2294 *value2 = (float)(float)op2->s;
2295 else if(op2->kind == 2)
2296 *value2 = (float)(float)op2->us;
2297 else if(op2->kind == 1 && op2->type->isSigned)
2298 *value2 = (float)(float)op2->c;
2299 else if(op2->kind == 24 || op2->kind == 1)
2300 *value2 = (float)(float)op2->uc;
2301 else if(op2->kind == 6)
2302 *value2 = (float)op2->f;
2303 else if(op2->kind == 7)
2304 *value2 = (float)op2->d;
2305 else if(op2->kind == 13)
2306 *value2 = (float)(float)op2->ui64;
2312 unsigned int GetFloat(struct Expression * exp, float * value2)
2314 struct Operand op2 = GetOperand(exp);
2316 return GetOpFloat(&op2, value2);
2319 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2321 if(op2->kind == 3 && op2->type->isSigned)
2322 *value2 = (double)(double)op2->i;
2323 else if(op2->kind == 3)
2324 *value2 = (double)(double)op2->ui;
2325 else if(op2->kind == 4 && op2->type->isSigned)
2326 *value2 = (double)(double)op2->i64;
2327 else if(op2->kind == 4)
2328 *value2 = (double)(double)op2->ui64;
2329 else if(op2->kind == 23 && op2->type->isSigned)
2330 *value2 = (double)(double)op2->i64;
2331 else if(op2->kind == 23)
2332 *value2 = (double)(double)op2->ui64;
2333 else if(op2->kind == 22 && op2->type->isSigned)
2334 *value2 = (double)(double)op2->i64;
2335 else if(op2->kind == 22)
2336 *value2 = (double)(double)op2->ui64;
2337 else if(op2->kind == 2 && op2->type->isSigned)
2338 *value2 = (double)(double)op2->s;
2339 else if(op2->kind == 2)
2340 *value2 = (double)(double)op2->us;
2341 else if(op2->kind == 1 && op2->type->isSigned)
2342 *value2 = (double)(double)op2->c;
2343 else if(op2->kind == 24 || op2->kind == 1)
2344 *value2 = (double)(double)op2->uc;
2345 else if(op2->kind == 6)
2346 *value2 = (double)op2->f;
2347 else if(op2->kind == 7)
2348 *value2 = (double)op2->d;
2349 else if(op2->kind == 13)
2350 *value2 = (double)(double)op2->ui64;
2356 unsigned int GetDouble(struct Expression * exp, double * value2)
2358 struct Operand op2 = GetOperand(exp);
2360 return GetOpDouble(&op2, value2);
2363 void ComputeExpression(struct Expression * exp);
2365 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2367 extern int targetBits;
2369 int ComputeTypeSize(struct Type * type);
2371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2373 struct __ecereNameSpace__ecere__com__BitMember
2375 struct __ecereNameSpace__ecere__com__BitMember * prev;
2376 struct __ecereNameSpace__ecere__com__BitMember * next;
2378 unsigned int isProperty;
2381 struct __ecereNameSpace__ecere__com__Class * _class;
2382 char * dataTypeString;
2383 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2384 struct Type * dataType;
2389 } __attribute__ ((gcc_struct));
2391 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2393 struct __ecereNameSpace__ecere__sys__OldLink
2395 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2396 struct __ecereNameSpace__ecere__sys__OldLink * next;
2398 } __attribute__ ((gcc_struct));
2400 void FinishTemplatesContext(struct Context * context);
2402 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2404 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2405 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2407 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))
2409 int unionMemberOffset = 0;
2414 member->memberOffset = 0;
2415 if(targetBits < sizeof(void *) * 8)
2416 member->structAlignment = 0;
2418 else if(targetBits < sizeof(void *) * 8)
2419 _class->structAlignment = 0;
2420 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2421 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2422 if(!member && _class->destructionWatchOffset)
2423 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2425 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2427 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2429 if(!dataMember->isProperty)
2431 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2433 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2439 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2441 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2443 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2445 if(!isMember && _class->type == 2 && dataMember->dataType)
2447 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2451 ComputeTypeSize(dataMember->dataType);
2452 if(bitMember->pos == -1)
2453 bitMember->pos = _class->memberOffset;
2454 if(!bitMember->size)
2455 bitMember->size = dataMember->dataType->size * 8;
2456 _class->memberOffset = bitMember->pos + bitMember->size;
2457 for(d = 0; d < bitMember->size; d++)
2463 bitMember->mask = mask << bitMember->pos;
2465 else if(dataMember->type == 0 && dataMember->dataType)
2470 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2471 ComputeTypeSize(dataMember->dataType);
2472 if(dataMember->dataType->bitFieldCount)
2474 bitFields += dataMember->dataType->bitFieldCount;
2481 int size = (bitFields + 7) / 8;
2485 int __simpleStruct0;
2489 int __simpleStruct0;
2491 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2492 if(member->memberOffset % alignment)
2493 member->memberOffset += alignment - (member->memberOffset % alignment);
2495 dataMember->offset = member->memberOffset;
2496 if(member->type == 1)
2497 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2500 member->memberOffset += size;
2507 int __simpleStruct0;
2509 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2510 if(_class->memberOffset % alignment)
2511 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2513 dataMember->offset = _class->memberOffset;
2514 _class->memberOffset += size;
2518 size = dataMember->dataType->size;
2519 alignment = dataMember->dataType->alignment;
2523 int __simpleStruct0;
2527 int __simpleStruct0;
2529 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2530 if(member->memberOffset % alignment)
2531 member->memberOffset += alignment - (member->memberOffset % alignment);
2533 dataMember->offset = member->memberOffset;
2534 if(member->type == 1)
2535 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2538 member->memberOffset += size;
2545 int __simpleStruct0;
2547 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2548 if(_class->memberOffset % alignment)
2549 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2551 dataMember->offset = _class->memberOffset;
2552 _class->memberOffset += size;
2559 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2560 alignment = dataMember->structAlignment;
2563 int __simpleStruct0;
2567 int __simpleStruct0;
2569 if(member->memberOffset % alignment)
2570 member->memberOffset += alignment - (member->memberOffset % alignment);
2571 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2573 dataMember->offset = member->memberOffset;
2574 if(member->type == 1)
2575 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2577 member->memberOffset += dataMember->memberOffset;
2583 int __simpleStruct0;
2585 if(_class->memberOffset % alignment)
2586 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2587 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2589 dataMember->offset = _class->memberOffset;
2590 _class->memberOffset += dataMember->memberOffset;
2598 int size = (bitFields + 7) / 8;
2602 int __simpleStruct0;
2606 int __simpleStruct0;
2608 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2609 if(member->memberOffset % alignment)
2610 member->memberOffset += alignment - (member->memberOffset % alignment);
2612 if(member->type == 1)
2613 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2616 member->memberOffset += size;
2623 int __simpleStruct0;
2625 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2626 if(_class->memberOffset % alignment)
2627 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2629 _class->memberOffset += size;
2634 if(member && member->type == 1)
2636 member->memberOffset = unionMemberOffset;
2640 if(_class->type != 2)
2644 if(_class->structAlignment)
2646 if(_class->memberOffset % _class->structAlignment)
2647 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2649 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2652 struct __ecereNameSpace__ecere__com__Property * prop;
2654 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2656 if(prop->isProperty && prop->isWatchable)
2658 prop->watcherOffset = _class->structSize;
2659 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2664 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2666 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2668 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2670 if(deriv->computeSize)
2672 deriv->offset = _class->structSize;
2673 deriv->memberOffset = 0;
2674 deriv->structSize = deriv->offset;
2675 ComputeClassMembers(deriv, 0x0);
2683 FinishTemplatesContext(context);
2686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2688 struct __ecereNameSpace__ecere__com__NameSpace
2691 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2692 struct __ecereNameSpace__ecere__com__NameSpace * left;
2693 struct __ecereNameSpace__ecere__com__NameSpace * right;
2695 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2696 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2697 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2698 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2699 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2700 } __attribute__ ((gcc_struct));
2702 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2704 struct __ecereNameSpace__ecere__com__Module
2706 struct __ecereNameSpace__ecere__com__Instance * application;
2707 struct __ecereNameSpace__ecere__sys__OldList classes;
2708 struct __ecereNameSpace__ecere__sys__OldList defines;
2709 struct __ecereNameSpace__ecere__sys__OldList functions;
2710 struct __ecereNameSpace__ecere__sys__OldList modules;
2711 struct __ecereNameSpace__ecere__com__Instance * prev;
2712 struct __ecereNameSpace__ecere__com__Instance * next;
2718 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2719 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2720 } __attribute__ ((gcc_struct));
2722 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2724 struct __ecereNameSpace__ecere__com__Class * _class;
2725 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2727 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2728 ComputeModuleClasses(subModule->data);
2729 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2730 ComputeClassMembers(_class, 0x0);
2733 extern unsigned int inCompiler;
2735 extern void Compiler_Error(char * format, ...);
2737 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2739 int ComputeTypeSize(struct Type * type)
2741 unsigned int size = type ? type->size : 0;
2743 if(!size && type && !type->computing)
2745 type->computing = 0x1;
2749 type->alignment = size = sizeof(char);
2752 type->alignment = size = sizeof(char);
2755 type->alignment = size = sizeof(int);
2758 type->alignment = size = sizeof(long long);
2761 type->alignment = size = targetBits / 8;
2764 type->alignment = size = targetBits / 8;
2767 type->alignment = size = sizeof(long);
2770 type->alignment = size = sizeof(short);
2773 type->alignment = size = sizeof(float);
2776 type->alignment = size = sizeof(double);
2780 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2782 if(_class && _class->type == 1)
2784 ComputeClassMembers(_class, 0x0);
2785 type->alignment = _class->structAlignment;
2786 size = _class->structSize;
2787 if(type->alignment && size % type->alignment)
2788 size += type->alignment - (size % type->alignment);
2790 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2792 if(!_class->dataType)
2793 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2794 size = type->alignment = ComputeTypeSize(_class->dataType);
2797 size = type->alignment = targetBits / 8;
2802 size = type->alignment = targetBits / 8;
2805 if(type->arraySizeExp)
2807 ProcessExpressionType(type->arraySizeExp);
2808 ComputeExpression(type->arraySizeExp);
2809 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)))
2811 struct Location oldLoc = yylloc;
2812 char expression[10240];
2814 expression[0] = '\0';
2815 type->arraySizeExp->expType = (((void *)0));
2816 yylloc = type->arraySizeExp->loc;
2818 PrintExpression(type->arraySizeExp, expression);
2819 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2822 GetInt(type->arraySizeExp, &type->arraySize);
2824 else if(type->enumClass)
2826 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2828 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2831 type->arraySize = 0;
2835 type->arraySize = 0;
2837 size = ComputeTypeSize(type->type) * type->arraySize;
2839 type->alignment = type->type->alignment;
2843 struct Type * member;
2845 for(member = type->members.first; member; member = member->next)
2847 int __simpleStruct0, __simpleStruct1;
2848 unsigned int addSize = ComputeTypeSize(member);
2850 member->offset = size;
2851 if(member->alignment && size % member->alignment)
2852 member->offset += member->alignment - (size % member->alignment);
2853 size = member->offset;
2854 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2857 if(type->alignment && size % type->alignment)
2858 size += type->alignment - (size % type->alignment);
2863 struct Type * member;
2865 for(member = type->members.first; member; member = member->next)
2867 int __simpleStruct0, __simpleStruct1;
2868 unsigned int addSize = ComputeTypeSize(member);
2870 member->offset = size;
2871 if(member->alignment && size % member->alignment)
2872 member->offset += member->alignment - (size % member->alignment);
2873 size = member->offset;
2874 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2875 size = ((size > addSize) ? size : addSize);
2877 if(type->alignment && size % type->alignment)
2878 size += type->alignment - (size % type->alignment);
2883 struct TemplateParameter * param = type->templateParameter;
2884 struct Type * baseType = ProcessTemplateParameterType(param);
2888 size = ComputeTypeSize(baseType);
2889 type->alignment = baseType->alignment;
2892 type->alignment = size = sizeof(uint64);
2897 type->alignment = size = sizeof(enum
2905 type->alignment = size = targetBits / 8;
2910 type->computing = 0x0;
2915 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2917 extern struct Identifier * MkIdentifier(char * string);
2919 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2921 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2923 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2925 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2927 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2929 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2931 extern void FreeType(struct Type * type);
2933 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2935 extern struct Specifier * MkSpecifier(int specifier);
2937 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2939 extern struct Expression * MkExpConstant(char * string);
2941 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)
2943 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2944 unsigned int totalSize = 0;
2945 unsigned int maxSize = 0;
2948 struct __ecereNameSpace__ecere__com__DataMember * member;
2949 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2952 *addedPadding = 0x0;
2953 if(!isMember && _class->base)
2955 maxSize = _class->structSize;
2957 if(_class->type == 1 || _class->type == 5)
2958 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2961 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2963 if(maxSize > baseSize)
2964 maxSize -= baseSize;
2970 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2972 if(!member->isProperty)
2974 switch(member->type)
2978 if(member->dataTypeString)
2980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2981 struct Declarator * decl;
2983 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2984 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2985 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2986 if(!member->dataType)
2987 member->dataType = ProcessType(specs, decl);
2988 ReplaceThisClassSpecifiers(specs, topClass);
2990 struct Type * type = ProcessType(specs, decl);
2992 DeclareType(member->dataType, 0x0, 0x0);
2995 ComputeTypeSize(member->dataType);
2996 size = member->dataType->size;
2997 alignment = member->dataType->alignment;
3000 if(totalSize % alignment)
3001 totalSize += alignment - (totalSize % alignment);
3010 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3013 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3014 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3015 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
3016 alignment = member->structAlignment;
3019 if(totalSize % alignment)
3020 totalSize += alignment - (totalSize % alignment);
3030 unsigned int __simpleStruct0;
3032 if(topMember && topMember->type == 1)
3033 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3035 *retSize += totalSize;
3037 else if(totalSize < maxSize && _class->type != 1000)
3039 int autoPadding = 0;
3041 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3042 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3043 if(totalSize + autoPadding < maxSize)
3045 char sizeString[50];
3047 sprintf(sizeString, "%d", maxSize - totalSize);
3048 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3050 *addedPadding = 0x1;
3054 FinishTemplatesContext(context);
3055 return topMember ? topMember->memberID : _class->memberID;
3058 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3060 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3061 struct __ecereNameSpace__ecere__com__DataMember * member;
3062 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3064 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3065 DeclareMembers(_class->base, 0x0);
3066 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3068 if(!member->isProperty)
3070 switch(member->type)
3074 if(!member->dataType && member->dataTypeString)
3075 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3076 if(member->dataType)
3077 DeclareType(member->dataType, 0x0, 0x0);
3083 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3090 FinishTemplatesContext(context);
3091 return topMember ? topMember->memberID : _class->memberID;
3094 extern struct Symbol * FindClass(char * name);
3096 extern char * strchr(const char * , int);
3098 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3100 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3102 extern void FreeClassDef(struct ClassDef * def);
3104 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3106 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3108 extern void MangleClassName(char * className);
3110 extern void DeclareClass(struct Symbol * classSym, char * className);
3112 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3114 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3116 void DeclareStruct(char * name, unsigned int skipNoHead)
3118 struct External * external = (((void *)0));
3119 struct Symbol * classSym = FindClass(name);
3121 if(!inCompiler || !classSym)
3123 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3125 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3127 struct Declaration * decl;
3128 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3129 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3130 char structName[1024];
3131 struct Specifier * spec = (((void *)0));
3133 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3134 classSym->declaring++;
3135 if(strchr(classSym->string, '<'))
3137 if(classSym->registered->templateClass)
3139 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3140 classSym->declaring--;
3144 DeclareMembers(classSym->registered, 0x0);
3145 structName[0] = (char)0;
3146 FullClassNameCat(structName, name, 0x0);
3147 if(external && external->declaration && external->declaration->specifiers)
3149 for(spec = (*external->declaration->specifiers).first; spec; spec = spec->next)
3151 if(spec->type == 3 || spec->type == 4)
3155 if(!skipNoHead && (!spec || !spec->definitions))
3157 unsigned int addedPadding = 0x0;
3159 classSym->declaredStructSym = 0x1;
3160 declarations = MkList();
3161 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3162 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3164 FreeList(declarations, FreeClassDef);
3165 declarations = (((void *)0));
3168 if(skipNoHead || declarations)
3173 spec->definitions = declarations;
3174 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3176 if(classSym->structExternal)
3177 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3179 classSym->id = curExternal->symbol->idCode;
3180 classSym->idCode = curExternal->symbol->idCode;
3186 external = MkExternalDeclaration((((void *)0)));
3187 specifiers = MkList();
3188 declarators = MkList();
3189 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3190 external->declaration = decl = MkDeclaration(specifiers, declarators);
3191 if(decl->symbol && !decl->symbol->pointerExternal)
3192 decl->symbol->pointerExternal = external;
3193 if(classSym->registered && classSym->registered->type == 1)
3195 char className[1024];
3197 strcpy(className, "__ecereClass_");
3198 FullClassNameCat(className, classSym->string, 0x1);
3199 MangleClassName(className);
3200 DeclareClass(classSym, className);
3201 external->symbol = classSym;
3202 classSym->pointerExternal = external;
3203 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3204 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3208 char className[1024];
3210 strcpy(className, "__ecereClass_");
3211 FullClassNameCat(className, classSym->string, 0x1);
3212 MangleClassName(className);
3213 classSym->structExternal = external;
3214 DeclareClass(classSym, className);
3215 external->symbol = classSym;
3217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3220 classSym->declaring--;
3222 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3224 classSym->declaring++;
3226 if(classSym->registered)
3227 DeclareMembers(classSym->registered, 0x0);
3229 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3231 if(classSym->structExternal)
3232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3234 classSym->id = curExternal->symbol->idCode;
3235 classSym->idCode = curExternal->symbol->idCode;
3237 classSym->declaring--;
3241 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3243 extern struct ModuleImport * mainModule;
3245 extern struct Specifier * MkSpecifierName(char * name);
3247 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3249 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3251 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3253 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3255 extern void FreeDeclarator(struct Declarator * decl);
3257 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3259 struct PropertyImport
3261 struct PropertyImport * prev;
3262 struct PropertyImport * next;
3264 unsigned int isVirtual;
3265 unsigned int hasSet;
3266 unsigned int hasGet;
3267 } __attribute__ ((gcc_struct));
3269 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3271 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3273 struct Symbol * symbol = prop->symbol;
3274 char propName[1024];
3276 strcpy(setName, "__ecereProp_");
3277 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3278 strcat(setName, "_Set_");
3279 FullClassNameCat(setName, prop->name, 0x1);
3280 strcpy(getName, "__ecereProp_");
3281 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3282 strcat(getName, "_Get_");
3283 FullClassNameCat(getName, prop->name, 0x1);
3284 strcpy(propName, "__ecereProp_");
3285 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3286 strcat(propName, "_");
3287 FullClassNameCat(propName, prop->name, 0x1);
3288 MangleClassName(getName);
3289 MangleClassName(setName);
3290 MangleClassName(propName);
3291 if(prop->_class->type == 1)
3292 DeclareStruct(prop->_class->fullName, 0x0);
3293 if(!symbol || curExternal->symbol->idCode < symbol->id)
3295 unsigned int imported = 0x0;
3296 unsigned int dllImport = 0x0;
3298 if(!symbol || symbol->_import)
3302 struct Symbol * classSym;
3304 if(!prop->_class->symbol)
3305 prop->_class->symbol = FindClass(prop->_class->fullName);
3306 classSym = prop->_class->symbol;
3307 if(classSym && !classSym->_import)
3309 struct ModuleImport * module;
3311 if(prop->_class->module)
3312 module = FindModule(prop->_class->module);
3314 module = mainModule;
3315 classSym->_import = __extension__ ({
3316 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3318 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3322 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3323 symbol->_import = (struct ClassImport *)__extension__ ({
3324 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3326 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3329 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3332 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)
3337 struct Context * context = SetupTemplatesContext(prop->_class);
3339 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3340 FinishTemplatesContext(context);
3344 if(!symbol->externalGet || symbol->externalGet->type == 0)
3346 struct Declaration * decl;
3347 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3348 struct Declarator * d;
3349 struct __ecereNameSpace__ecere__sys__OldList * params;
3350 struct Specifier * spec;
3351 struct External * external;
3352 struct Declarator * typeDecl;
3353 unsigned int simple = 0x0;
3355 specifiers = MkList();
3356 declarators = MkList();
3358 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3359 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3361 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3363 struct Context * context = SetupTemplatesContext(prop->_class);
3365 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3366 FinishTemplatesContext(context);
3368 for(spec = (*specifiers).first; spec; spec = spec->next)
3372 if((!typeDecl || typeDecl->type == 1))
3374 struct Symbol * classSym = spec->symbol;
3376 symbol->_class = classSym->registered;
3377 if(classSym->registered && classSym->registered->type == 1)
3379 DeclareStruct(spec->name, 0x0);
3386 d = PlugDeclarator(typeDecl, d);
3389 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3390 specifiers = MkList();
3392 d = MkDeclaratorFunction(d, params);
3394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3395 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3398 ListAdd(specifiers, MkSpecifier(VOID));
3399 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3400 decl = MkDeclaration(specifiers, declarators);
3401 external = MkExternalDeclaration(decl);
3402 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3403 external->symbol = symbol;
3404 symbol->externalGet = external;
3405 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3407 FreeDeclarator(typeDecl);
3411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3416 if(!symbol->externalSet || symbol->externalSet->type == 0)
3418 struct Declaration * decl;
3419 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3420 struct Declarator * d;
3421 struct __ecereNameSpace__ecere__sys__OldList * params;
3422 struct Specifier * spec;
3423 struct External * external;
3424 struct Declarator * typeDecl;
3426 declarators = MkList();
3428 if(!prop->conversion || prop->_class->type == 1)
3430 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3432 specifiers = MkList();
3434 struct Context * context = SetupTemplatesContext(prop->_class);
3436 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3437 FinishTemplatesContext(context);
3439 ListAdd(params, MkTypeName(specifiers, d));
3440 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3442 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3443 d = MkDeclaratorFunction(d, params);
3444 for(spec = (*specifiers).first; spec; spec = spec->next)
3448 if((!typeDecl || typeDecl->type == 1))
3450 struct Symbol * classSym = spec->symbol;
3452 symbol->_class = classSym->registered;
3453 if(classSym->registered && classSym->registered->type == 1)
3454 DeclareStruct(spec->name, 0x0);
3458 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3459 specifiers = MkList();
3461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3462 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3464 if(!prop->conversion || prop->_class->type == 1)
3465 ListAdd(specifiers, MkSpecifier(VOID));
3467 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3468 decl = MkDeclaration(specifiers, declarators);
3469 external = MkExternalDeclaration(decl);
3470 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3471 external->symbol = symbol;
3472 symbol->externalSet = external;
3473 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3480 if(!symbol->externalPtr)
3482 struct Declaration * decl;
3483 struct External * external;
3484 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3490 ListAdd(specifiers, MkSpecifierName("Property"));
3492 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3494 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3497 strcpy(propName, "__ecerePropM_");
3498 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3499 strcat(propName, "_");
3500 FullClassNameCat(propName, prop->name, 0x1);
3501 MangleClassName(propName);
3502 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3504 decl = MkDeclaration(specifiers, list);
3506 external = MkExternalDeclaration(decl);
3507 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3508 external->symbol = symbol;
3509 symbol->externalPtr = external;
3513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3515 symbol->id = curExternal->symbol->idCode;
3519 struct Type * Dereference(struct Type * source)
3521 struct Type * type = (((void *)0));
3525 if(source->kind == 13 || source->kind == 12)
3527 type = source->type;
3528 source->type->refCount++;
3530 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3532 type = __extension__ ({
3533 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3535 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3538 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3544 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3549 static struct Type * Reference(struct Type * source)
3551 struct Type * type = (((void *)0));
3555 type = __extension__ ({
3556 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3558 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3565 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);
3567 extern void * memcpy(void * , const void * , size_t size);
3569 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3571 extern void FreeExpression(struct Expression * exp);
3573 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3575 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);
3577 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3579 extern struct Type * MkClassType(char * name);
3581 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, unsigned int size, unsigned int alignment, int declMode);
3583 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)
3585 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3586 unsigned int found = 0x0;
3587 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3588 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3589 unsigned int freeType = 0x0;
3591 yylloc = member->loc;
3596 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3600 dataMember = *curMember;
3606 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3607 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3608 int _subMemberStackPos = 0;
3611 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3614 dataMember = thisMember;
3615 if(curMember && thisMember->memberAccess == 1)
3617 *curMember = thisMember;
3618 *curClass = thisMember->_class;
3619 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3620 *subMemberStackPos = _subMemberStackPos;
3626 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3627 if(method && method->type == 1)
3630 method = (((void *)0));
3635 struct Type * type = (((void *)0));
3639 if(!dataMember->dataType && dataMember->dataTypeString)
3641 struct Context * context = SetupTemplatesContext(_class);
3643 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3644 FinishTemplatesContext(context);
3646 type = dataMember->dataType;
3650 if(!method->dataType)
3651 ProcessMethodType(method);
3652 type = method->dataType;
3654 if(ident && ident->next)
3656 for(ident = ident->next; ident && type; ident = ident->next)
3660 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3662 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3664 type = dataMember->dataType;
3666 else if(type->kind == 9 || type->kind == 10)
3668 struct Type * memberType;
3670 for(memberType = type->members.first; memberType; memberType = memberType->next)
3672 if(!strcmp(memberType->name, ident->string))
3681 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3684 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3685 struct __ecereNameSpace__ecere__com__Class * sClass;
3687 for(sClass = _class; sClass; sClass = sClass->base)
3690 if(sClass->templateClass)
3691 sClass = sClass->templateClass;
3692 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3694 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3696 for(sClass = sClass->base; sClass; sClass = sClass->base)
3698 if(sClass->templateClass)
3699 sClass = sClass->templateClass;
3700 id += sClass->templateParams.count;
3711 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3713 if(arg.dataTypeString)
3715 type = ProcessTypeString(arg.dataTypeString, 0x0);
3717 if(type && _class->templateClass)
3718 type->passAsTemplate = 0x1;
3725 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3727 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3728 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3732 char templateString[1024];
3733 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3735 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3736 for(cClass = expClass; cClass; cClass = cClass->base)
3740 if(cClass->templateClass)
3741 cClass = cClass->templateClass;
3742 for(param = cClass->templateParams.first; param; param = param->next)
3745 struct __ecereNameSpace__ecere__com__Class * sClass;
3746 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3748 for(sClass = cClass->base; sClass; sClass = sClass->base)
3750 if(sClass->templateClass)
3751 sClass = sClass->templateClass;
3752 id += sClass->templateParams.count;
3754 arg = expClass->templateArgs[id];
3755 for(sClass = _class; sClass; sClass = sClass->base)
3757 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3759 struct __ecereNameSpace__ecere__com__Class * nextClass;
3761 if(sClass->templateClass)
3762 sClass = sClass->templateClass;
3763 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3765 if(nextClass->templateClass)
3766 nextClass = nextClass->templateClass;
3767 p += nextClass->templateParams.count;
3769 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3771 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3773 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3775 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3776 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3790 char expString[1024];
3791 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3792 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3793 struct Expression * exp;
3794 char * string = PrintHexUInt64(arg.expression.ui64);
3796 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3797 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3798 ProcessExpressionType(exp);
3799 ComputeExpression(exp);
3800 expString[0] = '\0';
3801 PrintExpression(exp, expString);
3802 strcat(argument, expString);
3803 FreeExpression(exp);
3808 strcat(argument, arg.member->name);
3813 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3814 strcat(argument, arg.dataTypeString);
3821 strcat(templateString, ", ");
3822 if(lastParam != p - 1)
3824 strcat(templateString, param->name);
3825 strcat(templateString, " = ");
3827 strcat(templateString, argument);
3836 int len = strlen(templateString);
3838 if(templateString[len - 1] == '<')
3842 if(templateString[len - 1] == '>')
3843 templateString[len++] = ' ';
3844 templateString[len++] = '>';
3846 templateString[len++] = '\0';
3849 struct Context * context = SetupTemplatesContext(_class);
3853 type = ProcessTypeString(templateString, 0x0);
3855 FinishTemplatesContext(context);
3858 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3860 ProcessExpressionType(member->initializer->exp);
3861 if(!member->initializer->exp->expType)
3865 char expString[10240];
3867 expString[0] = '\0';
3868 PrintExpression(member->initializer->exp, expString);
3869 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3870 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3873 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3878 else if(member->initializer)
3880 ProcessInitializer(member->initializer, type);
3887 if(_class && _class->type == 3)
3889 if(member->initializer)
3891 struct Type * type = MkClassType(_class->fullName);
3893 ProcessInitializer(member->initializer, type);
3899 if(member->initializer)
3901 ProcessInitializer(member->initializer, (((void *)0)));
3907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3911 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3913 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3922 extern struct Identifier * GetDeclId(struct Declarator * decl);
3924 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);
3926 extern void FreeSpecifier(struct Specifier * spec);
3928 static void ProcessFunction(struct FunctionDefinition * function);
3930 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3932 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3934 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3936 extern void FreeClassFunction(struct ClassFunction * func);
3938 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3940 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3942 void ProcessInstantiationType(struct Instantiation * inst)
3947 struct MembersInit * members;
3948 struct Symbol * classSym;
3949 struct __ecereNameSpace__ecere__com__Class * _class;
3951 classSym = inst->_class->symbol;
3952 _class = classSym ? classSym->registered : (((void *)0));
3953 if(!_class || _class->type != 5)
3954 DeclareStruct(inst->_class->name, 0x0);
3955 afterExternal = afterExternal ? afterExternal : curExternal;
3957 ProcessExpressionType(inst->exp);
3958 inst->isConstant = 0x1;
3961 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3962 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3963 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3964 int subMemberStackPos = 0;
3966 for(members = (*inst->members).first; members; members = members->next)
3968 switch(members->type)
3973 static unsigned int instMethodID = 0;
3974 struct External * external = curExternal;
3975 struct Context * context = curContext;
3976 struct Declarator * declarator = members->function->declarator;
3977 struct Identifier * nameID = GetDeclId(declarator);
3978 char * unmangled = nameID ? nameID->string : (((void *)0));
3979 struct Expression * exp;
3980 struct External * createdExternal = (((void *)0));
3986 strcpy(name, "__ecereInstMeth_");
3987 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3989 strcat(name, nameID->string);
3991 sprintf(number, "_%08d", instMethodID++);
3992 strcat(name, number);
3993 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3997 struct Symbol * symbol = declarator->symbol;
3998 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
4000 if(method && method->type == 1)
4002 symbol->method = method;
4003 ProcessMethodType(method);
4004 if(!symbol->type->thisClass)
4006 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
4008 if(!currentClass->symbol)
4009 currentClass->symbol = FindClass(currentClass->fullName);
4010 symbol->type->thisClass = currentClass->symbol;
4015 _class->symbol = FindClass(_class->fullName);
4016 symbol->type->thisClass = _class->symbol;
4019 DeclareType(symbol->type, 0x1, 0x1);
4023 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4026 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4029 FreeSpecifier(nameID->_class);
4030 nameID->_class = (((void *)0));
4034 struct External * oldExternal = curExternal;
4036 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4038 struct External * externalDecl;
4040 externalDecl = MkExternalDeclaration((((void *)0)));
4041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4042 if(createdExternal->function)
4044 ProcessFunction(createdExternal->function);
4046 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4048 externalDecl->declaration = decl;
4049 if(decl->symbol && !decl->symbol->pointerExternal)
4050 decl->symbol->pointerExternal = externalDecl;
4051 declarator->symbol->pointerExternal = externalDecl;
4058 curExternal = declarator->symbol->pointerExternal;
4059 ProcessFunction((struct FunctionDefinition *)members->function);
4061 curExternal = external;
4062 curContext = context;
4065 FreeClassFunction(members->function);
4066 exp = QMkExpId(name);
4068 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4069 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4075 if(members->dataMembers && classSym)
4077 struct MemberInit * member;
4078 struct Location oldyyloc = yylloc;
4080 for(member = (*members->dataMembers).first; member; member = member->next)
4082 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4083 if(member->initializer && !member->initializer->isConstant)
4084 inst->isConstant = 0x0;
4096 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4100 if(type->kind == 11)
4102 struct Type * param;
4106 for(param = type->params.first; param; param = param->next)
4107 DeclareType(param, declarePointers, 0x1);
4109 DeclareType(type->returnType, declarePointers, 0x1);
4111 else if(type->kind == 13 && declarePointers)
4112 DeclareType(type->type, declarePointers, 0x0);
4113 else if(type->kind == 8)
4115 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4116 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4118 else if(type->kind == 9 || type->kind == 10)
4120 struct Type * member;
4122 for(member = type->members.first; member; member = member->next)
4123 DeclareType(member, 0x0, 0x0);
4125 else if(type->kind == 12)
4126 DeclareType(type->arrayType, declarePointers, 0x0);
4130 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4132 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4134 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4136 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4137 struct __ecereNameSpace__ecere__com__Class * sClass;
4139 for(sClass = _class; sClass; sClass = sClass->base)
4142 if(sClass->templateClass)
4143 sClass = sClass->templateClass;
4144 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4146 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4148 for(sClass = sClass->base; sClass; sClass = sClass->base)
4150 if(sClass->templateClass)
4151 sClass = sClass->templateClass;
4152 id += sClass->templateParams.count;
4163 arg = &_class->templateArgs[id];
4164 if(arg && param->type == 0)
4165 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4170 extern struct Context * PushContext(void);
4172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4174 struct TemplatedType
4177 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4178 struct __ecereNameSpace__ecere__sys__BTNode * left;
4179 struct __ecereNameSpace__ecere__sys__BTNode * right;
4181 struct TemplateParameter * param;
4182 } __attribute__ ((gcc_struct));
4184 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4186 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4188 struct Context * context = PushContext();
4190 context->templateTypesOnly = 0x1;
4191 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4193 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4195 for(; param; param = param->next)
4197 if(param->type == 0 && param->identifier)
4199 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4201 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4207 struct __ecereNameSpace__ecere__com__Class * sClass;
4209 for(sClass = _class; sClass; sClass = sClass->base)
4211 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4213 for(p = sClass->templateParams.first; p; p = p->next)
4217 struct TemplateParameter * param = p->param;
4218 struct TemplatedType * type;
4222 p->param = param = __extension__ ({
4223 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4225 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4228 type = __extension__ ({
4229 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4231 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4233 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4241 extern void PopContext(struct Context * ctx);
4243 extern void FreeContext(struct Context * context);
4245 void FinishTemplatesContext(struct Context * context)
4247 PopContext(context);
4248 FreeContext(context);
4249 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4252 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4254 if(!method->dataType)
4256 struct Context * context = SetupTemplatesContext(method->_class);
4258 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4259 FinishTemplatesContext(context);
4260 if(method->type != 1 && method->dataType)
4262 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4264 if(!method->_class->symbol)
4265 method->_class->symbol = FindClass(method->_class->fullName);
4266 method->dataType->thisClass = method->_class->symbol;
4272 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4276 struct Context * context = SetupTemplatesContext(prop->_class);
4278 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4279 FinishTemplatesContext(context);
4283 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4285 extern void FreeTypeName(struct TypeName * typeName);
4287 static void ProcessDeclarator(struct Declarator * decl);
4289 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4291 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4295 struct MethodImport * prev;
4296 struct MethodImport * next;
4298 unsigned int isVirtual;
4299 } __attribute__ ((gcc_struct));
4301 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4303 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4305 struct Symbol * symbol = method->symbol;
4307 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4309 unsigned int imported = 0x0;
4310 unsigned int dllImport = 0x0;
4312 if(!method->dataType)
4313 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4314 if(!symbol || symbol->_import || method->type == 1)
4316 if(!symbol || method->type == 1)
4318 struct Symbol * classSym;
4320 if(!method->_class->symbol)
4321 method->_class->symbol = FindClass(method->_class->fullName);
4322 classSym = method->_class->symbol;
4323 if(!classSym->_import)
4325 struct ModuleImport * module;
4327 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4328 module = FindModule(method->_class->module);
4330 module = mainModule;
4331 classSym->_import = __extension__ ({
4332 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4334 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4340 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4342 if(!symbol->_import)
4344 symbol->_import = (struct ClassImport *)__extension__ ({
4345 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4347 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4349 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4353 symbol->type = method->dataType;
4355 symbol->type->refCount++;
4358 if(!method->dataType->dllExport)
4361 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)
4365 if(method->type != 1 && method->dataType)
4366 DeclareType(method->dataType, 0x1, 0x1);
4367 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4369 struct Declaration * decl;
4370 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4371 struct Declarator * d;
4372 struct Declarator * funcDecl;
4373 struct External * external;
4375 specifiers = MkList();
4376 declarators = MkList();
4378 ListAdd(specifiers, MkSpecifier(EXTERN));
4379 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4380 ListAdd(specifiers, MkSpecifier(STATIC));
4381 if(method->type == 1)
4383 ListAdd(specifiers, MkSpecifier(INT));
4384 d = MkDeclaratorIdentifier(MkIdentifier(name));
4388 d = MkDeclaratorIdentifier(MkIdentifier(name));
4390 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4392 struct Context * context = SetupTemplatesContext(method->_class);
4394 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4395 FinishTemplatesContext(context);
4397 funcDecl = GetFuncDecl(d);
4400 struct Specifier * spec, * next;
4402 for(spec = (*specifiers).first; spec; spec = next)
4407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4408 FreeSpecifier(spec);
4412 if(method->dataType && !method->dataType->staticMethod)
4414 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4416 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4417 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")));
4418 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4419 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4421 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4423 struct TypeName * param = (*funcDecl->function.parameters).first;
4425 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4426 FreeTypeName(param);
4428 if(!funcDecl->function.parameters)
4429 funcDecl->function.parameters = MkList();
4430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4434 ProcessDeclarator(d);
4435 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4436 decl = MkDeclaration(specifiers, declarators);
4437 ReplaceThisClassSpecifiers(specifiers, method->_class);
4438 if(symbol->pointerExternal)
4440 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4443 *functionSymbol = *symbol;
4444 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4445 if(functionSymbol->type)
4446 functionSymbol->type->refCount++;
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4449 symbol->pointerExternal->symbol = functionSymbol;
4451 external = MkExternalDeclaration(decl);
4453 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4454 external->symbol = symbol;
4455 symbol->pointerExternal = external;
4459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4461 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4465 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4467 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4469 unsigned int first = 0x1;
4471 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4473 char className[1024];
4475 strcpy(className, _class->fullName);
4476 for(param = _class->templateParams.first; param; param = param->next)
4480 strcat(className, "<");
4482 strcat(className, ", ");
4483 if(lastParam + 1 != p)
4485 strcat(className, param->name);
4486 strcat(className, " = ");
4488 strcat(className, param->name);
4496 int len = strlen(className);
4498 if(className[len - 1] == '>')
4499 className[len++] = ' ';
4500 className[len++] = '>';
4501 className[len++] = '\0';
4503 return __ecereNameSpace__ecere__sys__CopyString(className);
4506 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4509 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4511 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4513 unsigned int first = 0x1;
4515 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4517 char className[1024];
4519 strcpy(className, _class->fullName);
4520 for(param = _class->templateParams.first; param; param = param->next)
4524 strcat(className, "<");
4526 strcat(className, ", ");
4527 if(lastParam + 1 != p)
4529 strcat(className, param->name);
4530 strcat(className, " = ");
4532 strcat(className, param->name);
4540 int len = strlen(className);
4542 if(className[len - 1] == '>')
4543 className[len++] = ' ';
4544 className[len++] = '>';
4545 className[len++] = '\0';
4547 return MkClassType(className);
4551 return MkClassType(_class->fullName);
4555 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4557 if(specs != (((void *)0)) && _class)
4559 struct Specifier * spec;
4561 for(spec = specs->first; spec; spec = spec->next)
4563 if(spec->type == 0 && spec->specifier == THISCLASS)
4566 spec->name = ReplaceThisClass(_class);
4567 spec->symbol = FindClass(spec->name);
4573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4575 struct __ecereNameSpace__ecere__com__GlobalFunction
4577 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4578 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4581 struct __ecereNameSpace__ecere__com__Instance * module;
4582 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4583 char * dataTypeString;
4584 struct Type * dataType;
4586 } __attribute__ ((gcc_struct));
4588 extern struct Context * globalContext;
4590 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4592 struct FunctionImport
4594 struct FunctionImport * prev;
4595 struct FunctionImport * next;
4597 } __attribute__ ((gcc_struct));
4599 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4601 struct Symbol * symbol = function->symbol;
4603 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4605 unsigned int imported = 0x0;
4606 unsigned int dllImport = 0x0;
4608 if(!function->dataType)
4610 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4611 if(!function->dataType->thisClass)
4612 function->dataType->staticMethod = 0x1;
4618 struct ModuleImport * module = FindModule(function->module);
4620 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4623 if(!function->dataType->dllExport)
4625 symbol->_import = (struct ClassImport *)__extension__ ({
4626 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4628 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4634 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4635 if(!symbol->type->thisClass)
4636 symbol->type->staticMethod = 0x1;
4639 imported = symbol->_import ? 0x1 : 0x0;
4640 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4643 DeclareType(function->dataType, 0x1, 0x1);
4646 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4648 struct Declaration * decl;
4649 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4650 struct Declarator * d;
4651 struct Declarator * funcDecl;
4652 struct External * external;
4654 specifiers = MkList();
4655 declarators = MkList();
4656 ListAdd(specifiers, MkSpecifier(EXTERN));
4657 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4659 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4660 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4661 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4663 struct Specifier * spec;
4665 for(spec = (*specifiers).first; spec; spec = spec->next)
4666 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4668 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4669 FreeSpecifier(spec);
4673 funcDecl = GetFuncDecl(d);
4674 if(funcDecl && !funcDecl->function.parameters)
4676 funcDecl->function.parameters = MkList();
4677 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4679 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4681 struct Context * oldCtx = curContext;
4683 curContext = globalContext;
4684 decl = MkDeclaration(specifiers, declarators);
4685 curContext = oldCtx;
4687 if(symbol->pointerExternal)
4689 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4692 *functionSymbol = *symbol;
4693 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4694 if(functionSymbol->type)
4695 functionSymbol->type->refCount++;
4697 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4698 symbol->pointerExternal->symbol = functionSymbol;
4700 external = MkExternalDeclaration(decl);
4702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4703 external->symbol = symbol;
4704 symbol->pointerExternal = external;
4708 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4711 symbol->id = curExternal->symbol->idCode;
4714 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4722 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4723 struct __ecereNameSpace__ecere__sys__BTNode * left;
4724 struct __ecereNameSpace__ecere__sys__BTNode * right;
4726 struct __ecereNameSpace__ecere__com__Instance * module;
4727 char * dataTypeString;
4728 struct Type * dataType;
4731 } __attribute__ ((gcc_struct));
4733 void DeclareGlobalData(struct GlobalData * data)
4735 struct Symbol * symbol = data->symbol;
4737 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4742 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4745 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4746 DeclareType(data->dataType, 0x1, 0x1);
4749 if(!symbol->pointerExternal)
4751 struct Declaration * decl;
4752 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4753 struct Declarator * d;
4754 struct External * external;
4756 specifiers = MkList();
4757 declarators = MkList();
4758 ListAdd(specifiers, MkSpecifier(EXTERN));
4759 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4760 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4761 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4762 decl = MkDeclaration(specifiers, declarators);
4763 external = MkExternalDeclaration(decl);
4765 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4766 external->symbol = symbol;
4767 symbol->pointerExternal = external;
4771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4774 symbol->id = curExternal->symbol->idCode;
4781 struct Conversion * prev, * next;
4782 struct __ecereNameSpace__ecere__com__Property * convert;
4784 struct Type * resultType;
4785 } __attribute__ ((gcc_struct));
4787 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4789 extern void Compiler_Warning(char * format, ...);
4791 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4793 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)
4797 if(source->kind == 20 && dest->kind != 20)
4799 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4804 if(dest->kind == 20 && source->kind != 20)
4806 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4811 if(dest->classObjectType == 2)
4813 if(source->classObjectType != 3)
4817 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4825 if(source->classObjectType == 3)
4827 if(dest->classObjectType == 3 && source->classObjectType != 2)
4830 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4832 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4835 if(dest->kind == 14 && source->kind != 0)
4837 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))
4839 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))
4841 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4843 if(source->_class->registered && source->_class->registered->type == 3)
4845 if(conversions != (((void *)0)))
4847 if(source->_class->registered == dest->_class->registered)
4852 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4854 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4856 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4858 if(sourceBase == destBase)
4862 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))
4866 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))
4868 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4875 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4879 if(source->kind == 8)
4881 struct __ecereNameSpace__ecere__com__Class * _class;
4883 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4885 struct __ecereNameSpace__ecere__com__Property * convert;
4887 for(convert = _class->conversions.first; convert; convert = convert->next)
4889 if(convert->memberAccess == 1 || _class->module == privateModule)
4891 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4893 if(!convert->dataType)
4894 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4895 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))
4897 if(!conversions && !convert->Get)
4899 else if(conversions != (((void *)0)))
4901 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))
4905 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4918 struct __ecereNameSpace__ecere__com__Class * _class;
4920 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4922 struct __ecereNameSpace__ecere__com__Property * convert;
4924 for(convert = _class->conversions.first; convert; convert = convert->next)
4926 if(convert->memberAccess == 1 || _class->module == privateModule)
4928 if(!convert->dataType)
4929 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4930 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4932 if(!conversions && !convert->Set)
4934 else if(conversions != (((void *)0)))
4936 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))
4940 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4942 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4950 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4952 if(!dest->_class->registered->dataType)
4953 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4954 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4956 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0))
4963 if(source->kind == 8)
4965 struct __ecereNameSpace__ecere__com__Class * _class;
4967 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4969 struct __ecereNameSpace__ecere__com__Property * convert;
4971 for(convert = _class->conversions.first; convert; convert = convert->next)
4973 if(convert->memberAccess == 1 || _class->module == privateModule)
4975 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4977 if(!convert->dataType)
4978 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4979 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))
4981 if(!conversions && !convert->Get)
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 && (dest->kind != 8 || dest->_class->registered != _class->base))
4989 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4999 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
5001 if(!source->_class->registered->dataType)
5002 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5003 if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
5005 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))
5007 else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
5013 if(source->kind == 8 || source->kind == 19)
5015 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5017 else if(dest->kind == 7 && source->kind == 6)
5019 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5021 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5023 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5025 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5027 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5029 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))
5031 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))
5033 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)))
5035 struct Type * paramSource, * paramDest;
5037 if(dest->kind == 16)
5038 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5039 if(source->kind == 16)
5040 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5041 if(dest->kind == 13 && dest->type->kind == 11)
5043 if(source->kind == 13 && source->type->kind == 11)
5044 source = source->type;
5045 if(dest->kind == 16)
5046 dest = dest->method->dataType;
5047 if(source->kind == 16)
5048 source = source->method->dataType;
5049 paramSource = source->params.first;
5050 if(paramSource && paramSource->kind == 0)
5051 paramSource = (((void *)0));
5052 paramDest = dest->params.first;
5053 if(paramDest && paramDest->kind == 0)
5054 paramDest = (((void *)0));
5055 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5057 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))))
5059 if(paramDest && paramDest->kind == 8)
5060 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5062 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5065 paramDest = paramDest->next;
5067 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5069 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5073 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5075 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5081 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5086 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5090 paramSource = paramSource->next;
5096 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5098 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5104 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5106 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5112 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5114 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5117 for(; paramDest; paramDest = paramDest->next)
5121 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5125 struct Type * paramDestType = paramDest;
5126 struct Type * paramSourceType = paramSource;
5127 struct Type * type = paramDestType;
5129 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5132 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5133 struct __ecereNameSpace__ecere__com__Class * sClass;
5135 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5138 if(sClass->templateClass)
5139 sClass = sClass->templateClass;
5140 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5142 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5144 for(sClass = sClass->base; sClass; sClass = sClass->base)
5146 if(sClass->templateClass)
5147 sClass = sClass->templateClass;
5148 id += sClass->templateParams.count;
5159 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5161 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5164 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
5169 PrintType(paramDest, type, 0x0, 0x1);
5170 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5171 if(paramDestType != paramDest)
5172 FreeType(paramDestType);
5175 if(paramDestType != paramDest)
5176 FreeType(paramDestType);
5178 paramSource = paramSource->next;
5182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5187 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5191 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5193 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5200 static void FreeConvert(struct Conversion * convert)
5202 if(convert->resultType)
5203 FreeType(convert->resultType);
5206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5208 struct __ecereNameSpace__ecere__com__BTNamedLink
5211 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5212 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5213 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5216 } __attribute__ ((gcc_struct));
5218 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5220 struct __ecereNameSpace__ecere__com__EnumClassData
5222 struct __ecereNameSpace__ecere__sys__OldList values;
5224 } __attribute__ ((gcc_struct));
5226 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5228 struct __ecereNameSpace__ecere__sys__NamedLink
5230 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5231 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5234 } __attribute__ ((gcc_struct));
5236 extern void FreeExpContents(struct Expression * exp);
5238 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5240 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5242 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5244 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5246 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5248 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5250 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5252 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)))
5254 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5256 if(_class->type == 4)
5258 struct __ecereNameSpace__ecere__sys__OldList converts =
5262 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5266 _class->symbol = FindClass(_class->fullName);
5267 type->_class = _class->symbol;
5268 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5270 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5271 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5275 struct __ecereNameSpace__ecere__com__Class * baseClass;
5277 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5279 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5281 for(value = e->values.first; value; value = value->next)
5283 if(!strcmp(value->name, string))
5288 FreeExpContents(sourceExp);
5289 FreeType(sourceExp->expType);
5290 sourceExp->isConstant = 0x1;
5291 sourceExp->expType = MkClassType(baseClass->fullName);
5295 sourceExp->type = 2;
5296 if(!strcmp(baseClass->dataTypeString, "int"))
5297 sprintf(constant, "%d", (int)value->data);
5299 sprintf(constant, "0x%X", (int)value->data);
5300 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5302 while(converts.first)
5304 struct Conversion * convert = converts.first;
5306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5309 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5317 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5320 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)))
5321 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5328 struct __ecereNameSpace__ecere__com__SubModule
5330 struct __ecereNameSpace__ecere__com__SubModule * prev;
5331 struct __ecereNameSpace__ecere__com__SubModule * next;
5332 struct __ecereNameSpace__ecere__com__Instance * module;
5334 } __attribute__ ((gcc_struct));
5336 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5338 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5340 if(searchFor == searchIn)
5342 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5344 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5346 if(ModuleVisibility(subModule->module, searchFor))
5353 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5355 struct __ecereNameSpace__ecere__com__Application
5360 unsigned int isGUIApp;
5361 struct __ecereNameSpace__ecere__sys__OldList allModules;
5362 char * parsedCommand;
5363 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5364 } __attribute__ ((gcc_struct));
5366 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5368 struct __ecereNameSpace__ecere__com__Instance * module;
5370 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))
5372 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))
5374 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))
5376 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)
5378 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5384 extern struct Expression * CopyExpression(struct Expression * exp);
5386 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5388 void ReadString(char * output, char * string);
5390 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5392 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5394 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5396 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5398 struct Type * source;
5399 struct Type * realDest = dest;
5400 struct Type * backupSourceExpType = (((void *)0));
5401 struct Expression * computedExp = sourceExp;
5404 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)
5406 computedExp = CopyExpression(sourceExp);
5407 ComputeExpression(computedExp);
5409 source = sourceExp->expType;
5410 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5412 if(computedExp != sourceExp)
5414 FreeExpression(computedExp);
5415 computedExp = sourceExp;
5420 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5422 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5424 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5426 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5428 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5430 if(sourceBase == destBase)
5432 if(computedExp != sourceExp)
5434 FreeExpression(computedExp);
5435 computedExp = sourceExp;
5444 struct __ecereNameSpace__ecere__sys__OldList * specs;
5445 unsigned int flag = 0x0;
5446 long long value = (((int)0x7fffffff));
5449 if(computedExp->type == 2)
5451 if(source->isSigned)
5452 value = strtoll(computedExp->constant, (((void *)0)), 0);
5454 value = strtoull(computedExp->constant, (((void *)0)), 0);
5456 else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
5458 if(source->isSigned)
5459 value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
5461 value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
5463 if(computedExp != sourceExp)
5465 FreeExpression(computedExp);
5466 computedExp = sourceExp;
5468 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5471 source = __extension__ ({
5472 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5474 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5479 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5481 if(_class && _class->type == 3)
5483 if(source->kind != 8)
5485 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5486 struct Type * tempDest, * tempSource;
5488 for(; _class->base->type != 1000; _class = _class->base)
5491 tempDest = tempType;
5494 _class->symbol = FindClass(_class->fullName);
5495 tempType->_class = _class->symbol;
5496 tempType->truth = dest->truth;
5497 if(tempType->_class)
5498 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5499 backupSourceExpType = sourceExp->expType;
5500 sourceExp->expType = dest;
5503 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5506 if(_class && _class->type == 2 && source->kind != 8)
5508 if(!dest->_class->registered->dataType)
5509 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5510 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5513 FreeType(sourceExp->expType);
5514 source = sourceExp->expType = MkClassType(dest->_class->string);
5518 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5520 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5521 struct Declarator * decl;
5524 ReadString(string, sourceExp->string);
5525 decl = SpecDeclFromString(string, specs, (((void *)0)));
5526 FreeExpContents(sourceExp);
5527 FreeType(sourceExp->expType);
5528 sourceExp->type = 24;
5529 sourceExp->_classExp.specifiers = specs;
5530 sourceExp->_classExp.decl = decl;
5531 sourceExp->expType = dest;
5535 if(backupSourceExpType)
5536 FreeType(backupSourceExpType);
5540 else if(source->kind == 8)
5542 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5544 if(_class && (_class->type == 3 || _class->type == 2))
5548 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5549 struct Type * tempDest, * tempSource;
5551 if(!source->_class->registered->dataType)
5552 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5553 for(; _class->base->type != 1000; _class = _class->base)
5556 tempSource = tempType;
5558 tempType->_class = FindClass(_class->fullName);
5559 tempType->truth = source->truth;
5560 tempType->classObjectType = source->classObjectType;
5561 if(tempType->_class)
5562 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5563 if(conversions->last)
5565 ((struct Conversion *)conversions->last)->resultType = dest;
5568 FreeType(sourceExp->expType);
5569 sourceExp->expType = MkClassType(_class->fullName);
5570 sourceExp->expType->truth = source->truth;
5571 sourceExp->expType->classObjectType = source->classObjectType;
5572 if(!sourceExp->destType)
5574 FreeType(sourceExp->destType);
5575 sourceExp->destType = sourceExp->expType;
5576 if(sourceExp->expType)
5577 sourceExp->expType->refCount++;
5579 if(!_class->dataType)
5580 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5582 dest = MkClassType(source->_class->string);
5583 dest->truth = source->truth;
5584 dest->classObjectType = source->classObjectType;
5586 source = _class->dataType;
5588 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor((void *)tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5594 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5603 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5604 unsigned int fittingValue = 0x0;
5606 if(_class && _class->type == 4)
5608 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5609 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5611 if(c && value >= 0 && value <= c->largest)
5614 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5616 if(_class->type == 0 || _class->type == 5)
5618 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5620 *newExp = *sourceExp;
5621 if(sourceExp->destType)
5622 sourceExp->destType->refCount++;
5623 if(sourceExp->expType)
5624 sourceExp->expType->refCount++;
5625 sourceExp->type = 11;
5626 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5627 sourceExp->cast.exp = newExp;
5628 FreeType(sourceExp->expType);
5629 sourceExp->expType = (((void *)0));
5630 ProcessExpressionType(sourceExp);
5633 FreeType(sourceExp->expType);
5634 sourceExp->expType = dest;
5639 if(backupSourceExpType)
5640 FreeType(backupSourceExpType);
5643 if(!_class->dataType)
5644 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5646 dest = _class->dataType;
5649 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))
5651 specs = MkListOne(MkSpecifier(DOUBLE));
5653 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))
5655 specs = MkListOne(MkSpecifier(FLOAT));
5657 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))
5661 ListAdd(specs, MkSpecifier(UNSIGNED));
5662 ListAdd(specs, MkSpecifier(INT64));
5664 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5668 ListAdd(specs, MkSpecifier(UNSIGNED));
5669 ListAdd(specs, MkSpecifier(INT));
5671 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5675 ListAdd(specs, MkSpecifier(UNSIGNED));
5676 ListAdd(specs, MkSpecifier(SHORT));
5678 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5682 ListAdd(specs, MkSpecifier(UNSIGNED));
5683 ListAdd(specs, MkSpecifier(CHAR));
5689 if(backupSourceExpType)
5691 if(sourceExp->expType)
5692 FreeType(sourceExp->expType);
5693 sourceExp->expType = backupSourceExpType;
5698 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))
5700 specs = MkListOne(MkSpecifier(DOUBLE));
5702 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))
5704 specs = MkListOne(MkSpecifier(FLOAT));
5706 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5709 ListAdd(specs, MkSpecifier(BOOL));
5711 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)))
5715 ListAdd(specs, MkSpecifier(UNSIGNED));
5716 ListAdd(specs, MkSpecifier(CHAR));
5718 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)))))
5722 ListAdd(specs, MkSpecifier(UNSIGNED));
5723 ListAdd(specs, MkSpecifier(SHORT));
5725 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5729 ListAdd(specs, MkSpecifier(UNSIGNED));
5730 ListAdd(specs, MkSpecifier(INT));
5732 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5736 ListAdd(specs, MkSpecifier(UNSIGNED));
5737 ListAdd(specs, MkSpecifier(INT64));
5739 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5741 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5747 if(backupSourceExpType)
5749 if(sourceExp->expType)
5750 FreeType(sourceExp->expType);
5751 sourceExp->expType = backupSourceExpType;
5755 if(!flag && !sourceExp->opDestType)
5757 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5759 *newExp = *sourceExp;
5760 newExp->prev = (((void *)0));
5761 newExp->next = (((void *)0));
5762 if(sourceExp->destType)
5763 sourceExp->destType->refCount++;
5764 if(sourceExp->expType)
5765 sourceExp->expType->refCount++;
5766 sourceExp->type = 11;
5767 if(realDest->kind == 8)
5769 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5770 FreeList(specs, FreeSpecifier);
5773 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5774 if(newExp->type == 4)
5776 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5779 sourceExp->cast.exp = newExp;
5780 FreeType(sourceExp->expType);
5781 sourceExp->expType = (((void *)0));
5782 ProcessExpressionType(sourceExp);
5785 FreeList(specs, FreeSpecifier);
5788 if(backupSourceExpType)
5789 FreeType(backupSourceExpType);
5794 if(computedExp != sourceExp)
5796 FreeExpression(computedExp);
5797 computedExp = sourceExp;
5799 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5800 sourceExp = (*sourceExp->list).last;
5801 if(sourceExp->type == 0)
5803 struct Identifier * id = sourceExp->identifier;
5807 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5809 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5810 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5814 for(; _class && _class->type == 4; _class = _class->base)
5816 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5817 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5819 for(value = e->values.first; value; value = value->next)
5821 if(!strcmp(value->name, id->string))
5826 FreeExpContents(sourceExp);
5827 FreeType(sourceExp->expType);
5828 sourceExp->isConstant = 0x1;
5829 sourceExp->expType = MkClassType(_class->fullName);
5833 sourceExp->type = 2;
5834 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5835 sprintf(constant, "%d", (int)value->data);
5837 sprintf(constant, "0x%X", (int)value->data);
5838 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5847 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5858 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5860 int value2 = op2->i;
5863 exp->string = PrintInt((op1->i + value2));
5866 exp->expType = op1->type;
5868 op1->type->refCount++;
5873 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5875 unsigned int value2 = op2->ui;
5878 exp->string = PrintUInt((op1->ui + value2));
5881 exp->expType = op1->type;
5883 op1->type->refCount++;
5888 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5890 long long value2 = op2->i64;
5893 exp->string = PrintInt64((op1->i64 + value2));
5896 exp->expType = op1->type;
5898 op1->type->refCount++;
5903 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5905 uint64 value2 = op2->ui64;
5908 exp->string = PrintUInt64((op1->ui64 + value2));
5911 exp->expType = op1->type;
5913 op1->type->refCount++;
5918 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5920 short value2 = op2->s;
5923 exp->string = PrintShort((op1->s + value2));
5926 exp->expType = op1->type;
5928 op1->type->refCount++;
5933 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5935 unsigned short value2 = op2->us;
5938 exp->string = PrintUShort((op1->us + value2));
5941 exp->expType = op1->type;
5943 op1->type->refCount++;
5948 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5950 char value2 = op2->c;
5953 exp->string = PrintChar((op1->c + value2));
5956 exp->expType = op1->type;
5958 op1->type->refCount++;
5963 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5965 unsigned char value2 = op2->uc;
5968 exp->string = PrintUChar((op1->uc + value2));
5971 exp->expType = op1->type;
5973 op1->type->refCount++;
5978 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5980 float value2 = op2->f;
5983 exp->string = PrintFloat((float)(op1->f + value2));
5986 exp->expType = op1->type;
5988 op1->type->refCount++;
5993 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5995 double value2 = op2->d;
5998 exp->string = PrintDouble((double)(op1->d + value2));
6001 exp->expType = op1->type;
6003 op1->type->refCount++;
6008 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6010 int value2 = op2->i;
6013 exp->string = PrintInt((op1->i - value2));
6016 exp->expType = op1->type;
6018 op1->type->refCount++;
6023 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6025 unsigned int value2 = op2->ui;
6028 exp->string = PrintUInt((op1->ui - value2));
6031 exp->expType = op1->type;
6033 op1->type->refCount++;
6038 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6040 long long value2 = op2->i64;
6043 exp->string = PrintInt64((op1->i64 - value2));
6046 exp->expType = op1->type;
6048 op1->type->refCount++;
6053 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6055 uint64 value2 = op2->ui64;
6058 exp->string = PrintUInt64((op1->ui64 - value2));
6061 exp->expType = op1->type;
6063 op1->type->refCount++;
6068 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6070 short value2 = op2->s;
6073 exp->string = PrintShort((op1->s - value2));
6076 exp->expType = op1->type;
6078 op1->type->refCount++;
6083 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6085 unsigned short value2 = op2->us;
6088 exp->string = PrintUShort((op1->us - value2));
6091 exp->expType = op1->type;
6093 op1->type->refCount++;
6098 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6100 char value2 = op2->c;
6103 exp->string = PrintChar((op1->c - value2));
6106 exp->expType = op1->type;
6108 op1->type->refCount++;
6113 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6115 unsigned char value2 = op2->uc;
6118 exp->string = PrintUChar((op1->uc - value2));
6121 exp->expType = op1->type;
6123 op1->type->refCount++;
6128 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6130 float value2 = op2->f;
6133 exp->string = PrintFloat((float)(op1->f - value2));
6136 exp->expType = op1->type;
6138 op1->type->refCount++;
6143 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6145 double value2 = op2->d;
6148 exp->string = PrintDouble((double)(op1->d - value2));
6151 exp->expType = op1->type;
6153 op1->type->refCount++;
6158 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6160 int value2 = op2->i;
6163 exp->string = PrintInt((op1->i * value2));
6166 exp->expType = op1->type;
6168 op1->type->refCount++;
6173 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6175 unsigned int value2 = op2->ui;
6178 exp->string = PrintUInt((op1->ui * value2));
6181 exp->expType = op1->type;
6183 op1->type->refCount++;
6188 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6190 long long value2 = op2->i64;
6193 exp->string = PrintInt64((op1->i64 * value2));
6196 exp->expType = op1->type;
6198 op1->type->refCount++;
6203 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6205 uint64 value2 = op2->ui64;
6208 exp->string = PrintUInt64((op1->ui64 * value2));
6211 exp->expType = op1->type;
6213 op1->type->refCount++;
6218 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6220 short value2 = op2->s;
6223 exp->string = PrintShort((op1->s * value2));
6226 exp->expType = op1->type;
6228 op1->type->refCount++;
6233 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6235 unsigned short value2 = op2->us;
6238 exp->string = PrintUShort((op1->us * value2));
6241 exp->expType = op1->type;
6243 op1->type->refCount++;
6248 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6250 char value2 = op2->c;
6253 exp->string = PrintChar((op1->c * value2));
6256 exp->expType = op1->type;
6258 op1->type->refCount++;
6263 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6265 unsigned char value2 = op2->uc;
6268 exp->string = PrintUChar((op1->uc * value2));
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6280 float value2 = op2->f;
6283 exp->string = PrintFloat((float)(op1->f * value2));
6286 exp->expType = op1->type;
6288 op1->type->refCount++;
6293 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6295 double value2 = op2->d;
6298 exp->string = PrintDouble((double)(op1->d * value2));
6301 exp->expType = op1->type;
6303 op1->type->refCount++;
6308 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6310 int value2 = op2->i;
6313 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6316 exp->expType = op1->type;
6318 op1->type->refCount++;
6323 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6325 unsigned int value2 = op2->ui;
6328 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6331 exp->expType = op1->type;
6333 op1->type->refCount++;
6338 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6340 long long value2 = op2->i64;
6343 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6346 exp->expType = op1->type;
6348 op1->type->refCount++;
6353 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6355 uint64 value2 = op2->ui64;
6358 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6361 exp->expType = op1->type;
6363 op1->type->refCount++;
6368 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6370 short value2 = op2->s;
6373 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6376 exp->expType = op1->type;
6378 op1->type->refCount++;
6383 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6385 unsigned short value2 = op2->us;
6388 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6391 exp->expType = op1->type;
6393 op1->type->refCount++;
6398 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6400 char value2 = op2->c;
6403 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6406 exp->expType = op1->type;
6408 op1->type->refCount++;
6413 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6415 unsigned char value2 = op2->uc;
6418 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6421 exp->expType = op1->type;
6423 op1->type->refCount++;
6428 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6430 float value2 = op2->f;
6433 exp->string = PrintFloat(op1->f / value2);
6436 exp->expType = op1->type;
6438 op1->type->refCount++;
6443 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6445 double value2 = op2->d;
6448 exp->string = PrintDouble(op1->d / value2);
6451 exp->expType = op1->type;
6453 op1->type->refCount++;
6458 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6460 int value2 = op2->i;
6463 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6466 exp->expType = op1->type;
6468 op1->type->refCount++;
6473 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6475 unsigned int value2 = op2->ui;
6478 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6481 exp->expType = op1->type;
6483 op1->type->refCount++;
6488 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6490 long long value2 = op2->i64;
6493 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6496 exp->expType = op1->type;
6498 op1->type->refCount++;
6503 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6505 uint64 value2 = op2->ui64;
6508 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6511 exp->expType = op1->type;
6513 op1->type->refCount++;
6518 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6520 short value2 = op2->s;
6523 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6526 exp->expType = op1->type;
6528 op1->type->refCount++;
6533 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6535 unsigned short value2 = op2->us;
6538 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6541 exp->expType = op1->type;
6543 op1->type->refCount++;
6548 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6550 char value2 = op2->c;
6553 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6556 exp->expType = op1->type;
6558 op1->type->refCount++;
6563 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6565 unsigned char value2 = op2->uc;
6568 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6571 exp->expType = op1->type;
6573 op1->type->refCount++;
6578 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6581 exp->string = PrintInt((-op1->i));
6584 exp->expType = op1->type;
6586 op1->type->refCount++;
6591 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6594 exp->string = PrintUInt((unsigned int)(-op1->ui));
6597 exp->expType = op1->type;
6599 op1->type->refCount++;
6604 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6607 exp->string = PrintInt64((-op1->i64));
6610 exp->expType = op1->type;
6612 op1->type->refCount++;
6617 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6620 exp->string = PrintUInt64((uint64)(-op1->ui64));
6623 exp->expType = op1->type;
6625 op1->type->refCount++;
6630 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6633 exp->string = PrintShort((-op1->s));
6636 exp->expType = op1->type;
6638 op1->type->refCount++;
6643 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6646 exp->string = PrintUShort((unsigned short)(-op1->us));
6649 exp->expType = op1->type;
6651 op1->type->refCount++;
6656 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6659 exp->string = PrintChar((-op1->c));
6662 exp->expType = op1->type;
6664 op1->type->refCount++;
6669 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6672 exp->string = PrintUChar((unsigned char)(-op1->uc));
6675 exp->expType = op1->type;
6677 op1->type->refCount++;
6682 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6685 exp->string = PrintFloat((float)(-op1->f));
6688 exp->expType = op1->type;
6690 op1->type->refCount++;
6695 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6698 exp->string = PrintDouble((double)(-op1->d));
6701 exp->expType = op1->type;
6703 op1->type->refCount++;
6708 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6711 exp->string = PrintInt((++op1->i));
6714 exp->expType = op1->type;
6716 op1->type->refCount++;
6721 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6724 exp->string = PrintUInt((++op1->ui));
6727 exp->expType = op1->type;
6729 op1->type->refCount++;
6734 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6737 exp->string = PrintInt64((++op1->i64));
6740 exp->expType = op1->type;
6742 op1->type->refCount++;
6747 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6750 exp->string = PrintUInt64((++op1->ui64));
6753 exp->expType = op1->type;
6755 op1->type->refCount++;
6760 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6763 exp->string = PrintShort((++op1->s));
6766 exp->expType = op1->type;
6768 op1->type->refCount++;
6773 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6776 exp->string = PrintUShort((++op1->us));
6779 exp->expType = op1->type;
6781 op1->type->refCount++;
6786 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6789 exp->string = PrintChar((++op1->c));
6792 exp->expType = op1->type;
6794 op1->type->refCount++;
6799 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6802 exp->string = PrintUChar((++op1->uc));
6805 exp->expType = op1->type;
6807 op1->type->refCount++;
6812 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6815 exp->string = PrintFloat((float)(++op1->f));
6818 exp->expType = op1->type;
6820 op1->type->refCount++;
6825 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6828 exp->string = PrintDouble((double)(++op1->d));
6831 exp->expType = op1->type;
6833 op1->type->refCount++;
6838 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6841 exp->string = PrintInt((--op1->i));
6844 exp->expType = op1->type;
6846 op1->type->refCount++;
6851 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6854 exp->string = PrintUInt((--op1->ui));
6857 exp->expType = op1->type;
6859 op1->type->refCount++;
6864 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6867 exp->string = PrintInt64((--op1->i64));
6870 exp->expType = op1->type;
6872 op1->type->refCount++;
6877 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6880 exp->string = PrintUInt64((--op1->ui64));
6883 exp->expType = op1->type;
6885 op1->type->refCount++;
6890 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6893 exp->string = PrintShort((--op1->s));
6896 exp->expType = op1->type;
6898 op1->type->refCount++;
6903 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6906 exp->string = PrintUShort((--op1->us));
6909 exp->expType = op1->type;
6911 op1->type->refCount++;
6916 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6919 exp->string = PrintChar((--op1->c));
6922 exp->expType = op1->type;
6924 op1->type->refCount++;
6929 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6932 exp->string = PrintUChar((--op1->uc));
6935 exp->expType = op1->type;
6937 op1->type->refCount++;
6942 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6945 exp->string = PrintFloat((float)(--op1->f));
6948 exp->expType = op1->type;
6950 op1->type->refCount++;
6955 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6958 exp->string = PrintDouble((double)(--op1->d));
6961 exp->expType = op1->type;
6963 op1->type->refCount++;
6968 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6970 int value2 = op2->i;
6973 exp->string = PrintInt((op1->i = value2));
6976 exp->expType = op1->type;
6978 op1->type->refCount++;
6983 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6985 unsigned int value2 = op2->ui;
6988 exp->string = PrintUInt((op1->ui = value2));
6991 exp->expType = op1->type;
6993 op1->type->refCount++;
6998 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7000 long long value2 = op2->i64;
7003 exp->string = PrintInt64((op1->i64 = value2));
7006 exp->expType = op1->type;
7008 op1->type->refCount++;
7013 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7015 uint64 value2 = op2->ui64;
7018 exp->string = PrintUInt64((op1->ui64 = value2));
7021 exp->expType = op1->type;
7023 op1->type->refCount++;
7028 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7030 short value2 = op2->s;
7033 exp->string = PrintShort((op1->s = value2));
7036 exp->expType = op1->type;
7038 op1->type->refCount++;
7043 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7045 unsigned short value2 = op2->us;
7048 exp->string = PrintUShort((op1->us = value2));
7051 exp->expType = op1->type;
7053 op1->type->refCount++;
7058 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7060 char value2 = op2->c;
7063 exp->string = PrintChar((op1->c = value2));
7066 exp->expType = op1->type;
7068 op1->type->refCount++;
7073 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7075 unsigned char value2 = op2->uc;
7078 exp->string = PrintUChar((op1->uc = value2));
7081 exp->expType = op1->type;
7083 op1->type->refCount++;
7088 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7090 float value2 = op2->f;
7093 exp->string = PrintFloat((float)(op1->f = value2));
7096 exp->expType = op1->type;
7098 op1->type->refCount++;
7103 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7105 double value2 = op2->d;
7108 exp->string = PrintDouble((double)(op1->d = value2));
7111 exp->expType = op1->type;
7113 op1->type->refCount++;
7118 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7120 int value2 = op2->i;
7123 exp->string = PrintInt((op1->i += value2));
7126 exp->expType = op1->type;
7128 op1->type->refCount++;
7133 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7135 unsigned int value2 = op2->ui;
7138 exp->string = PrintUInt((op1->ui += value2));
7141 exp->expType = op1->type;
7143 op1->type->refCount++;
7148 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7150 long long value2 = op2->i64;
7153 exp->string = PrintInt64((op1->i64 += value2));
7156 exp->expType = op1->type;
7158 op1->type->refCount++;
7163 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7165 uint64 value2 = op2->ui64;
7168 exp->string = PrintUInt64((op1->ui64 += value2));
7171 exp->expType = op1->type;
7173 op1->type->refCount++;
7178 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7180 short value2 = op2->s;
7183 exp->string = PrintShort((op1->s += value2));
7186 exp->expType = op1->type;
7188 op1->type->refCount++;
7193 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7195 unsigned short value2 = op2->us;
7198 exp->string = PrintUShort((op1->us += value2));
7201 exp->expType = op1->type;
7203 op1->type->refCount++;
7208 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7210 char value2 = op2->c;
7213 exp->string = PrintChar((op1->c += value2));
7216 exp->expType = op1->type;
7218 op1->type->refCount++;
7223 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7225 unsigned char value2 = op2->uc;
7228 exp->string = PrintUChar((op1->uc += value2));
7231 exp->expType = op1->type;
7233 op1->type->refCount++;
7238 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7240 float value2 = op2->f;
7243 exp->string = PrintFloat((float)(op1->f += value2));
7246 exp->expType = op1->type;
7248 op1->type->refCount++;
7253 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7255 double value2 = op2->d;
7258 exp->string = PrintDouble((double)(op1->d += value2));
7261 exp->expType = op1->type;
7263 op1->type->refCount++;
7268 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7270 int value2 = op2->i;
7273 exp->string = PrintInt((op1->i -= value2));
7276 exp->expType = op1->type;
7278 op1->type->refCount++;
7283 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7285 unsigned int value2 = op2->ui;
7288 exp->string = PrintUInt((op1->ui -= value2));
7291 exp->expType = op1->type;
7293 op1->type->refCount++;
7298 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7300 long long value2 = op2->i64;
7303 exp->string = PrintInt64((op1->i64 -= value2));
7306 exp->expType = op1->type;
7308 op1->type->refCount++;
7313 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7315 uint64 value2 = op2->ui64;
7318 exp->string = PrintUInt64((op1->ui64 -= value2));
7321 exp->expType = op1->type;
7323 op1->type->refCount++;
7328 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7330 short value2 = op2->s;
7333 exp->string = PrintShort((op1->s -= value2));
7336 exp->expType = op1->type;
7338 op1->type->refCount++;
7343 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7345 unsigned short value2 = op2->us;
7348 exp->string = PrintUShort((op1->us -= value2));
7351 exp->expType = op1->type;
7353 op1->type->refCount++;
7358 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7360 char value2 = op2->c;
7363 exp->string = PrintChar((op1->c -= value2));
7366 exp->expType = op1->type;
7368 op1->type->refCount++;
7373 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7375 unsigned char value2 = op2->uc;
7378 exp->string = PrintUChar((op1->uc -= value2));
7381 exp->expType = op1->type;
7383 op1->type->refCount++;
7388 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7390 float value2 = op2->f;
7393 exp->string = PrintFloat((float)(op1->f -= value2));
7396 exp->expType = op1->type;
7398 op1->type->refCount++;
7403 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7405 double value2 = op2->d;
7408 exp->string = PrintDouble((double)(op1->d -= value2));
7411 exp->expType = op1->type;
7413 op1->type->refCount++;
7418 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7420 int value2 = op2->i;
7423 exp->string = PrintInt((op1->i *= value2));
7426 exp->expType = op1->type;
7428 op1->type->refCount++;
7433 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7435 unsigned int value2 = op2->ui;
7438 exp->string = PrintUInt((op1->ui *= value2));
7441 exp->expType = op1->type;
7443 op1->type->refCount++;
7448 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7450 long long value2 = op2->i64;
7453 exp->string = PrintInt64((op1->i64 *= value2));
7456 exp->expType = op1->type;
7458 op1->type->refCount++;
7463 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7465 uint64 value2 = op2->ui64;
7468 exp->string = PrintUInt64((op1->ui64 *= value2));
7471 exp->expType = op1->type;
7473 op1->type->refCount++;
7478 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7480 short value2 = op2->s;
7483 exp->string = PrintShort((op1->s *= value2));
7486 exp->expType = op1->type;
7488 op1->type->refCount++;
7493 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7495 unsigned short value2 = op2->us;
7498 exp->string = PrintUShort((op1->us *= value2));
7501 exp->expType = op1->type;
7503 op1->type->refCount++;
7508 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7510 char value2 = op2->c;
7513 exp->string = PrintChar((op1->c *= value2));
7516 exp->expType = op1->type;
7518 op1->type->refCount++;
7523 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7525 unsigned char value2 = op2->uc;
7528 exp->string = PrintUChar((op1->uc *= value2));
7531 exp->expType = op1->type;
7533 op1->type->refCount++;
7538 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7540 float value2 = op2->f;
7543 exp->string = PrintFloat((float)(op1->f *= value2));
7546 exp->expType = op1->type;
7548 op1->type->refCount++;
7553 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7555 double value2 = op2->d;
7558 exp->string = PrintDouble((double)(op1->d *= value2));
7561 exp->expType = op1->type;
7563 op1->type->refCount++;
7568 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7570 int value2 = op2->i;
7573 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7576 exp->expType = op1->type;
7578 op1->type->refCount++;
7583 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7585 unsigned int value2 = op2->ui;
7588 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7591 exp->expType = op1->type;
7593 op1->type->refCount++;
7598 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7600 long long value2 = op2->i64;
7603 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7606 exp->expType = op1->type;
7608 op1->type->refCount++;
7613 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7615 uint64 value2 = op2->ui64;
7618 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7621 exp->expType = op1->type;
7623 op1->type->refCount++;
7628 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7630 short value2 = op2->s;
7633 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7636 exp->expType = op1->type;
7638 op1->type->refCount++;
7643 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7645 unsigned short value2 = op2->us;
7648 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7651 exp->expType = op1->type;
7653 op1->type->refCount++;
7658 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7660 char value2 = op2->c;
7663 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7666 exp->expType = op1->type;
7668 op1->type->refCount++;
7673 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7675 unsigned char value2 = op2->uc;
7678 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7681 exp->expType = op1->type;
7683 op1->type->refCount++;
7688 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7690 float value2 = op2->f;
7693 exp->string = PrintFloat(op1->f /= value2);
7696 exp->expType = op1->type;
7698 op1->type->refCount++;
7703 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7705 double value2 = op2->d;
7708 exp->string = PrintDouble(op1->d /= value2);
7711 exp->expType = op1->type;
7713 op1->type->refCount++;
7718 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7720 int value2 = op2->i;
7723 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7726 exp->expType = op1->type;
7728 op1->type->refCount++;
7733 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7735 unsigned int value2 = op2->ui;
7738 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7741 exp->expType = op1->type;
7743 op1->type->refCount++;
7748 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7750 long long value2 = op2->i64;
7753 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7756 exp->expType = op1->type;
7758 op1->type->refCount++;
7763 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7765 uint64 value2 = op2->ui64;
7768 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7771 exp->expType = op1->type;
7773 op1->type->refCount++;
7778 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7780 short value2 = op2->s;
7783 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7786 exp->expType = op1->type;
7788 op1->type->refCount++;
7793 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7795 unsigned short value2 = op2->us;
7798 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7801 exp->expType = op1->type;
7803 op1->type->refCount++;
7808 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7810 char value2 = op2->c;
7813 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7816 exp->expType = op1->type;
7818 op1->type->refCount++;
7823 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7825 unsigned char value2 = op2->uc;
7828 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7831 exp->expType = op1->type;
7833 op1->type->refCount++;
7838 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7840 int value2 = op2->i;
7843 exp->string = PrintInt((op1->i & value2));
7846 exp->expType = op1->type;
7848 op1->type->refCount++;
7853 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7855 unsigned int value2 = op2->ui;
7858 exp->string = PrintUInt((op1->ui & value2));
7861 exp->expType = op1->type;
7863 op1->type->refCount++;
7868 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7870 long long value2 = op2->i64;
7873 exp->string = PrintInt64((op1->i64 & value2));
7876 exp->expType = op1->type;
7878 op1->type->refCount++;
7883 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7885 uint64 value2 = op2->ui64;
7888 exp->string = PrintUInt64((op1->ui64 & value2));
7891 exp->expType = op1->type;
7893 op1->type->refCount++;
7898 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7900 short value2 = op2->s;
7903 exp->string = PrintShort((op1->s & value2));
7906 exp->expType = op1->type;
7908 op1->type->refCount++;
7913 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7915 unsigned short value2 = op2->us;
7918 exp->string = PrintUShort((op1->us & value2));
7921 exp->expType = op1->type;
7923 op1->type->refCount++;
7928 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7930 char value2 = op2->c;
7933 exp->string = PrintChar((op1->c & value2));
7936 exp->expType = op1->type;
7938 op1->type->refCount++;
7943 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7945 unsigned char value2 = op2->uc;
7948 exp->string = PrintUChar((op1->uc & value2));
7951 exp->expType = op1->type;
7953 op1->type->refCount++;
7958 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7960 int value2 = op2->i;
7963 exp->string = PrintInt((op1->i | value2));
7966 exp->expType = op1->type;
7968 op1->type->refCount++;
7973 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7975 unsigned int value2 = op2->ui;
7978 exp->string = PrintUInt((op1->ui | value2));
7981 exp->expType = op1->type;
7983 op1->type->refCount++;
7988 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7990 long long value2 = op2->i64;
7993 exp->string = PrintInt64((op1->i64 | value2));
7996 exp->expType = op1->type;
7998 op1->type->refCount++;
8003 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8005 uint64 value2 = op2->ui64;
8008 exp->string = PrintUInt64((op1->ui64 | value2));
8011 exp->expType = op1->type;
8013 op1->type->refCount++;
8018 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8020 short value2 = op2->s;
8023 exp->string = PrintShort((op1->s | value2));
8026 exp->expType = op1->type;
8028 op1->type->refCount++;
8033 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8035 unsigned short value2 = op2->us;
8038 exp->string = PrintUShort((op1->us | value2));
8041 exp->expType = op1->type;
8043 op1->type->refCount++;
8048 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8050 char value2 = op2->c;
8053 exp->string = PrintChar((op1->c | value2));
8056 exp->expType = op1->type;
8058 op1->type->refCount++;
8063 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8065 unsigned char value2 = op2->uc;
8068 exp->string = PrintUChar((op1->uc | value2));
8071 exp->expType = op1->type;
8073 op1->type->refCount++;
8078 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8080 int value2 = op2->i;
8083 exp->string = PrintInt((op1->i ^ value2));
8086 exp->expType = op1->type;
8088 op1->type->refCount++;
8093 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8095 unsigned int value2 = op2->ui;
8098 exp->string = PrintUInt((op1->ui ^ value2));
8101 exp->expType = op1->type;
8103 op1->type->refCount++;
8108 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8110 long long value2 = op2->i64;
8113 exp->string = PrintInt64((op1->i64 ^ value2));
8116 exp->expType = op1->type;
8118 op1->type->refCount++;
8123 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8125 uint64 value2 = op2->ui64;
8128 exp->string = PrintUInt64((op1->ui64 ^ value2));
8131 exp->expType = op1->type;
8133 op1->type->refCount++;
8138 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8140 short value2 = op2->s;
8143 exp->string = PrintShort((op1->s ^ value2));
8146 exp->expType = op1->type;
8148 op1->type->refCount++;
8153 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8155 unsigned short value2 = op2->us;
8158 exp->string = PrintUShort((op1->us ^ value2));
8161 exp->expType = op1->type;
8163 op1->type->refCount++;
8168 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8170 char value2 = op2->c;
8173 exp->string = PrintChar((op1->c ^ value2));
8176 exp->expType = op1->type;
8178 op1->type->refCount++;
8183 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8185 unsigned char value2 = op2->uc;
8188 exp->string = PrintUChar((op1->uc ^ value2));
8191 exp->expType = op1->type;
8193 op1->type->refCount++;
8198 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8200 int value2 = op2->i;
8203 exp->string = PrintInt((op1->i << value2));
8206 exp->expType = op1->type;
8208 op1->type->refCount++;
8213 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8215 unsigned int value2 = op2->ui;
8218 exp->string = PrintUInt((op1->ui << value2));
8221 exp->expType = op1->type;
8223 op1->type->refCount++;
8228 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8230 long long value2 = op2->i64;
8233 exp->string = PrintInt64((op1->i64 << value2));
8236 exp->expType = op1->type;
8238 op1->type->refCount++;
8243 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8245 uint64 value2 = op2->ui64;
8248 exp->string = PrintUInt64((op1->ui64 << value2));
8251 exp->expType = op1->type;
8253 op1->type->refCount++;
8258 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8260 short value2 = op2->s;
8263 exp->string = PrintShort((op1->s << value2));
8266 exp->expType = op1->type;
8268 op1->type->refCount++;
8273 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8275 unsigned short value2 = op2->us;
8278 exp->string = PrintUShort((op1->us << value2));
8281 exp->expType = op1->type;
8283 op1->type->refCount++;
8288 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8290 char value2 = op2->c;
8293 exp->string = PrintChar((op1->c << value2));
8296 exp->expType = op1->type;
8298 op1->type->refCount++;
8303 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8305 unsigned char value2 = op2->uc;
8308 exp->string = PrintUChar((op1->uc << value2));
8311 exp->expType = op1->type;
8313 op1->type->refCount++;
8318 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8320 int value2 = op2->i;
8323 exp->string = PrintInt((op1->i >> value2));
8326 exp->expType = op1->type;
8328 op1->type->refCount++;
8333 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8335 unsigned int value2 = op2->ui;
8338 exp->string = PrintUInt((op1->ui >> value2));
8341 exp->expType = op1->type;
8343 op1->type->refCount++;
8348 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8350 long long value2 = op2->i64;
8353 exp->string = PrintInt64((op1->i64 >> value2));
8356 exp->expType = op1->type;
8358 op1->type->refCount++;
8363 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8365 uint64 value2 = op2->ui64;
8368 exp->string = PrintUInt64((op1->ui64 >> value2));
8371 exp->expType = op1->type;
8373 op1->type->refCount++;
8378 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8380 short value2 = op2->s;
8383 exp->string = PrintShort((op1->s >> value2));
8386 exp->expType = op1->type;
8388 op1->type->refCount++;
8393 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8395 unsigned short value2 = op2->us;
8398 exp->string = PrintUShort((op1->us >> value2));
8401 exp->expType = op1->type;
8403 op1->type->refCount++;
8408 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8410 char value2 = op2->c;
8413 exp->string = PrintChar((op1->c >> value2));
8416 exp->expType = op1->type;
8418 op1->type->refCount++;
8423 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8425 unsigned char value2 = op2->uc;
8428 exp->string = PrintUChar((op1->uc >> value2));
8431 exp->expType = op1->type;
8433 op1->type->refCount++;
8438 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8441 exp->string = PrintInt((~op1->i));
8444 exp->expType = op1->type;
8446 op1->type->refCount++;
8451 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8454 exp->string = PrintUInt((unsigned int)(~op1->ui));
8457 exp->expType = op1->type;
8459 op1->type->refCount++;
8464 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8467 exp->string = PrintInt64((long long)(~op1->i64));
8470 exp->expType = op1->type;
8472 op1->type->refCount++;
8477 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8480 exp->string = PrintUInt64((uint64)(~op1->ui64));
8483 exp->expType = op1->type;
8485 op1->type->refCount++;
8490 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8493 exp->string = PrintShort((short)(~op1->s));
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8506 exp->string = PrintUShort((unsigned short)(~op1->us));
8509 exp->expType = op1->type;
8511 op1->type->refCount++;
8516 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8519 exp->string = PrintChar((char)(~op1->c));
8522 exp->expType = op1->type;
8524 op1->type->refCount++;
8529 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8532 exp->string = PrintUChar((unsigned char)(~op1->uc));
8535 exp->expType = op1->type;
8537 op1->type->refCount++;
8542 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8544 int value2 = op2->i;
8547 exp->string = PrintInt((op1->i &= value2));
8550 exp->expType = op1->type;
8552 op1->type->refCount++;
8557 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8559 unsigned int value2 = op2->ui;
8562 exp->string = PrintUInt((op1->ui &= value2));
8565 exp->expType = op1->type;
8567 op1->type->refCount++;
8572 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8574 long long value2 = op2->i64;
8577 exp->string = PrintInt64((op1->i64 &= value2));
8580 exp->expType = op1->type;
8582 op1->type->refCount++;
8587 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8589 uint64 value2 = op2->ui64;
8592 exp->string = PrintUInt64((op1->ui64 &= value2));
8595 exp->expType = op1->type;
8597 op1->type->refCount++;
8602 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8604 short value2 = op2->s;
8607 exp->string = PrintShort((op1->s &= value2));
8610 exp->expType = op1->type;
8612 op1->type->refCount++;
8617 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8619 unsigned short value2 = op2->us;
8622 exp->string = PrintUShort((op1->us &= value2));
8625 exp->expType = op1->type;
8627 op1->type->refCount++;
8632 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8634 char value2 = op2->c;
8637 exp->string = PrintChar((op1->c &= value2));
8640 exp->expType = op1->type;
8642 op1->type->refCount++;
8647 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8649 unsigned char value2 = op2->uc;
8652 exp->string = PrintUChar((op1->uc &= value2));
8655 exp->expType = op1->type;
8657 op1->type->refCount++;
8662 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8664 int value2 = op2->i;
8667 exp->string = PrintInt((op1->i |= value2));
8670 exp->expType = op1->type;
8672 op1->type->refCount++;
8677 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8679 unsigned int value2 = op2->ui;
8682 exp->string = PrintUInt((op1->ui |= value2));
8685 exp->expType = op1->type;
8687 op1->type->refCount++;
8692 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8694 long long value2 = op2->i64;
8697 exp->string = PrintInt64((op1->i64 |= value2));
8700 exp->expType = op1->type;
8702 op1->type->refCount++;
8707 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8709 uint64 value2 = op2->ui64;
8712 exp->string = PrintUInt64((op1->ui64 |= value2));
8715 exp->expType = op1->type;
8717 op1->type->refCount++;
8722 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8724 short value2 = op2->s;
8727 exp->string = PrintShort((op1->s |= value2));
8730 exp->expType = op1->type;
8732 op1->type->refCount++;
8737 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8739 unsigned short value2 = op2->us;
8742 exp->string = PrintUShort((op1->us |= value2));
8745 exp->expType = op1->type;
8747 op1->type->refCount++;
8752 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8754 char value2 = op2->c;
8757 exp->string = PrintChar((op1->c |= value2));
8760 exp->expType = op1->type;
8762 op1->type->refCount++;
8767 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8769 unsigned char value2 = op2->uc;
8772 exp->string = PrintUChar((op1->uc |= value2));
8775 exp->expType = op1->type;
8777 op1->type->refCount++;
8782 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8784 int value2 = op2->i;
8787 exp->string = PrintInt((op1->i ^= value2));
8790 exp->expType = op1->type;
8792 op1->type->refCount++;
8797 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8799 unsigned int value2 = op2->ui;
8802 exp->string = PrintUInt((op1->ui ^= value2));
8805 exp->expType = op1->type;
8807 op1->type->refCount++;
8812 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8814 long long value2 = op2->i64;
8817 exp->string = PrintInt64((op1->i64 ^= value2));
8820 exp->expType = op1->type;
8822 op1->type->refCount++;
8827 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8829 uint64 value2 = op2->ui64;
8832 exp->string = PrintUInt64((op1->ui64 ^= value2));
8835 exp->expType = op1->type;
8837 op1->type->refCount++;
8842 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8844 short value2 = op2->s;
8847 exp->string = PrintShort((op1->s ^= value2));
8850 exp->expType = op1->type;
8852 op1->type->refCount++;
8857 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8859 unsigned short value2 = op2->us;
8862 exp->string = PrintUShort((op1->us ^= value2));
8865 exp->expType = op1->type;
8867 op1->type->refCount++;
8872 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8874 char value2 = op2->c;
8877 exp->string = PrintChar((op1->c ^= value2));
8880 exp->expType = op1->type;
8882 op1->type->refCount++;
8887 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8889 unsigned char value2 = op2->uc;
8892 exp->string = PrintUChar((op1->uc ^= value2));
8895 exp->expType = op1->type;
8897 op1->type->refCount++;
8902 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8904 int value2 = op2->i;
8907 exp->string = PrintInt((op1->i <<= value2));
8910 exp->expType = op1->type;
8912 op1->type->refCount++;
8917 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8919 unsigned int value2 = op2->ui;
8922 exp->string = PrintUInt((op1->ui <<= value2));
8925 exp->expType = op1->type;
8927 op1->type->refCount++;
8932 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8934 long long value2 = op2->i64;
8937 exp->string = PrintInt64((op1->i64 <<= value2));
8940 exp->expType = op1->type;
8942 op1->type->refCount++;
8947 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8949 uint64 value2 = op2->ui64;
8952 exp->string = PrintUInt64((op1->ui64 <<= value2));
8955 exp->expType = op1->type;
8957 op1->type->refCount++;
8962 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8964 short value2 = op2->s;
8967 exp->string = PrintShort((op1->s <<= value2));
8970 exp->expType = op1->type;
8972 op1->type->refCount++;
8977 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8979 unsigned short value2 = op2->us;
8982 exp->string = PrintUShort((op1->us <<= value2));
8985 exp->expType = op1->type;
8987 op1->type->refCount++;
8992 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8994 char value2 = op2->c;
8997 exp->string = PrintChar((op1->c <<= value2));
9000 exp->expType = op1->type;
9002 op1->type->refCount++;
9007 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9009 unsigned char value2 = op2->uc;
9012 exp->string = PrintUChar((op1->uc <<= value2));
9015 exp->expType = op1->type;
9017 op1->type->refCount++;
9022 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9024 int value2 = op2->i;
9027 exp->string = PrintInt((op1->i >>= value2));
9030 exp->expType = op1->type;
9032 op1->type->refCount++;
9037 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9039 unsigned int value2 = op2->ui;
9042 exp->string = PrintUInt((op1->ui >>= value2));
9045 exp->expType = op1->type;
9047 op1->type->refCount++;
9052 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9054 long long value2 = op2->i64;
9057 exp->string = PrintInt64((op1->i64 >>= value2));
9060 exp->expType = op1->type;
9062 op1->type->refCount++;
9067 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9069 uint64 value2 = op2->ui64;
9072 exp->string = PrintUInt64((op1->ui64 >>= value2));
9075 exp->expType = op1->type;
9077 op1->type->refCount++;
9082 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9084 short value2 = op2->s;
9087 exp->string = PrintShort((op1->s >>= value2));
9090 exp->expType = op1->type;
9092 op1->type->refCount++;
9097 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9099 unsigned short value2 = op2->us;
9102 exp->string = PrintUShort((op1->us >>= value2));
9105 exp->expType = op1->type;
9107 op1->type->refCount++;
9112 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9114 char value2 = op2->c;
9117 exp->string = PrintChar((op1->c >>= value2));
9120 exp->expType = op1->type;
9122 op1->type->refCount++;
9127 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9129 unsigned char value2 = op2->uc;
9132 exp->string = PrintUChar((op1->uc >>= value2));
9135 exp->expType = op1->type;
9137 op1->type->refCount++;
9142 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9145 exp->string = PrintInt((int)(!op1->i));
9148 exp->expType = op1->type;
9150 op1->type->refCount++;
9155 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9158 exp->string = PrintUInt((unsigned int)(!op1->ui));
9161 exp->expType = op1->type;
9163 op1->type->refCount++;
9168 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9171 exp->string = PrintInt64((long long)(!op1->i64));
9174 exp->expType = op1->type;
9176 op1->type->refCount++;
9181 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9184 exp->string = PrintUInt64((uint64)(!op1->ui64));
9187 exp->expType = op1->type;
9189 op1->type->refCount++;
9194 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9197 exp->string = PrintShort((short)(!op1->s));
9200 exp->expType = op1->type;
9202 op1->type->refCount++;
9207 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9210 exp->string = PrintUShort((unsigned short)(!op1->us));
9213 exp->expType = op1->type;
9215 op1->type->refCount++;
9220 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9223 exp->string = PrintChar((char)(!op1->c));
9226 exp->expType = op1->type;
9228 op1->type->refCount++;
9233 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9236 exp->string = PrintUChar((unsigned char)(!op1->uc));
9239 exp->expType = op1->type;
9241 op1->type->refCount++;
9246 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9248 int value2 = op2->i;
9251 exp->string = PrintInt((int)(op1->i == value2));
9254 exp->expType = op1->type;
9256 op1->type->refCount++;
9261 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9263 unsigned int value2 = op2->ui;
9266 exp->string = PrintUInt((unsigned int)(op1->ui == value2));
9269 exp->expType = op1->type;
9271 op1->type->refCount++;
9276 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9278 long long value2 = op2->i64;
9281 exp->string = PrintInt64((long long)(op1->i64 == value2));
9284 exp->expType = op1->type;
9286 op1->type->refCount++;
9291 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9293 uint64 value2 = op2->ui64;
9296 exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
9299 exp->expType = op1->type;
9301 op1->type->refCount++;
9306 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9308 short value2 = op2->s;
9311 exp->string = PrintShort((short)(op1->s == value2));
9314 exp->expType = op1->type;
9316 op1->type->refCount++;
9321 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9323 unsigned short value2 = op2->us;
9326 exp->string = PrintUShort((unsigned short)(op1->us == value2));
9329 exp->expType = op1->type;
9331 op1->type->refCount++;
9336 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9338 char value2 = op2->c;
9341 exp->string = PrintChar((char)(op1->c == value2));
9344 exp->expType = op1->type;
9346 op1->type->refCount++;
9351 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9353 unsigned char value2 = op2->uc;
9356 exp->string = PrintUChar((unsigned char)(op1->uc == value2));
9359 exp->expType = op1->type;
9361 op1->type->refCount++;
9366 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9368 float value2 = op2->f;
9371 exp->string = PrintFloat((float)(op1->f == value2));
9374 exp->expType = op1->type;
9376 op1->type->refCount++;
9381 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9383 double value2 = op2->d;
9386 exp->string = PrintDouble((double)(op1->d == value2));
9389 exp->expType = op1->type;
9391 op1->type->refCount++;
9396 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9398 int value2 = op2->i;
9401 exp->string = PrintInt((int)(op1->i != value2));
9404 exp->expType = op1->type;
9406 op1->type->refCount++;
9411 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9413 unsigned int value2 = op2->ui;
9416 exp->string = PrintUInt((unsigned int)(op1->ui != value2));
9419 exp->expType = op1->type;
9421 op1->type->refCount++;
9426 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9428 long long value2 = op2->i64;
9431 exp->string = PrintInt64((long long)(op1->i64 != value2));
9434 exp->expType = op1->type;
9436 op1->type->refCount++;
9441 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9443 uint64 value2 = op2->ui64;
9446 exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
9449 exp->expType = op1->type;
9451 op1->type->refCount++;
9456 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9458 short value2 = op2->s;
9461 exp->string = PrintShort((short)(op1->s != value2));
9464 exp->expType = op1->type;
9466 op1->type->refCount++;
9471 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9473 unsigned short value2 = op2->us;
9476 exp->string = PrintUShort((unsigned short)(op1->us != value2));
9479 exp->expType = op1->type;
9481 op1->type->refCount++;
9486 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9488 char value2 = op2->c;
9491 exp->string = PrintChar((char)(op1->c != value2));
9494 exp->expType = op1->type;
9496 op1->type->refCount++;
9501 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9503 unsigned char value2 = op2->uc;
9506 exp->string = PrintUChar((unsigned char)(op1->uc != value2));
9509 exp->expType = op1->type;
9511 op1->type->refCount++;
9516 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9518 float value2 = op2->f;
9521 exp->string = PrintFloat((float)(op1->f != value2));
9524 exp->expType = op1->type;
9526 op1->type->refCount++;
9531 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9533 double value2 = op2->d;
9536 exp->string = PrintDouble((double)(op1->d != value2));
9539 exp->expType = op1->type;
9541 op1->type->refCount++;
9546 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9548 int value2 = op2->i;
9551 exp->string = PrintInt((int)(op1->i && value2));
9554 exp->expType = op1->type;
9556 op1->type->refCount++;
9561 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9563 unsigned int value2 = op2->ui;
9566 exp->string = PrintUInt((unsigned int)(op1->ui && value2));
9569 exp->expType = op1->type;
9571 op1->type->refCount++;
9576 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9578 long long value2 = op2->i64;
9581 exp->string = PrintInt64((long long)(op1->i64 && value2));
9584 exp->expType = op1->type;
9586 op1->type->refCount++;
9591 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9593 uint64 value2 = op2->ui64;
9596 exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
9599 exp->expType = op1->type;
9601 op1->type->refCount++;
9606 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9608 short value2 = op2->s;
9611 exp->string = PrintShort((short)(op1->s && value2));
9614 exp->expType = op1->type;
9616 op1->type->refCount++;
9621 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9623 unsigned short value2 = op2->us;
9626 exp->string = PrintUShort((unsigned short)(op1->us && value2));
9629 exp->expType = op1->type;
9631 op1->type->refCount++;
9636 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9638 char value2 = op2->c;
9641 exp->string = PrintChar((char)(op1->c && value2));
9644 exp->expType = op1->type;
9646 op1->type->refCount++;
9651 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9653 unsigned char value2 = op2->uc;
9656 exp->string = PrintUChar((unsigned char)(op1->uc && value2));
9659 exp->expType = op1->type;
9661 op1->type->refCount++;
9666 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9668 float value2 = op2->f;
9671 exp->string = PrintFloat((float)(op1->f && value2));
9674 exp->expType = op1->type;
9676 op1->type->refCount++;
9681 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9683 double value2 = op2->d;
9686 exp->string = PrintDouble((double)(op1->d && value2));
9689 exp->expType = op1->type;
9691 op1->type->refCount++;
9696 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9698 int value2 = op2->i;
9701 exp->string = PrintInt((int)(op1->i || value2));
9704 exp->expType = op1->type;
9706 op1->type->refCount++;
9711 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9713 unsigned int value2 = op2->ui;
9716 exp->string = PrintUInt((unsigned int)(op1->ui || value2));
9719 exp->expType = op1->type;
9721 op1->type->refCount++;
9726 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9728 long long value2 = op2->i64;
9731 exp->string = PrintInt64((long long)(op1->i64 || value2));
9734 exp->expType = op1->type;
9736 op1->type->refCount++;
9741 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9743 uint64 value2 = op2->ui64;
9746 exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
9749 exp->expType = op1->type;
9751 op1->type->refCount++;
9756 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9758 short value2 = op2->s;
9761 exp->string = PrintShort((short)(op1->s || value2));
9764 exp->expType = op1->type;
9766 op1->type->refCount++;
9771 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9773 unsigned short value2 = op2->us;
9776 exp->string = PrintUShort((unsigned short)(op1->us || value2));
9779 exp->expType = op1->type;
9781 op1->type->refCount++;
9786 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9788 char value2 = op2->c;
9791 exp->string = PrintChar((char)(op1->c || value2));
9794 exp->expType = op1->type;
9796 op1->type->refCount++;
9801 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9803 unsigned char value2 = op2->uc;
9806 exp->string = PrintUChar((unsigned char)(op1->uc || value2));
9809 exp->expType = op1->type;
9811 op1->type->refCount++;
9816 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9818 float value2 = op2->f;
9821 exp->string = PrintFloat((float)(op1->f || value2));
9824 exp->expType = op1->type;
9826 op1->type->refCount++;
9831 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9833 double value2 = op2->d;
9836 exp->string = PrintDouble((double)(op1->d || value2));
9839 exp->expType = op1->type;
9841 op1->type->refCount++;
9846 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9848 int value2 = op2->i;
9851 exp->string = PrintInt((int)(op1->i > value2));
9854 exp->expType = op1->type;
9856 op1->type->refCount++;
9861 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9863 unsigned int value2 = op2->ui;
9866 exp->string = PrintUInt((unsigned int)(op1->ui > value2));
9869 exp->expType = op1->type;
9871 op1->type->refCount++;
9876 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9878 long long value2 = op2->i64;
9881 exp->string = PrintInt64((long long)(op1->i64 > value2));
9884 exp->expType = op1->type;
9886 op1->type->refCount++;
9891 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9893 uint64 value2 = op2->ui64;
9896 exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
9899 exp->expType = op1->type;
9901 op1->type->refCount++;
9906 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9908 short value2 = op2->s;
9911 exp->string = PrintShort((short)(op1->s > value2));
9914 exp->expType = op1->type;
9916 op1->type->refCount++;
9921 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9923 unsigned short value2 = op2->us;
9926 exp->string = PrintUShort((unsigned short)(op1->us > value2));
9929 exp->expType = op1->type;
9931 op1->type->refCount++;
9936 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9938 char value2 = op2->c;
9941 exp->string = PrintChar((char)(op1->c > value2));
9944 exp->expType = op1->type;
9946 op1->type->refCount++;
9951 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9953 unsigned char value2 = op2->uc;
9956 exp->string = PrintUChar((unsigned char)(op1->uc > value2));
9959 exp->expType = op1->type;
9961 op1->type->refCount++;
9966 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9968 float value2 = op2->f;
9971 exp->string = PrintFloat((float)(op1->f > value2));
9974 exp->expType = op1->type;
9976 op1->type->refCount++;
9981 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9983 double value2 = op2->d;
9986 exp->string = PrintDouble((double)(op1->d > value2));
9989 exp->expType = op1->type;
9991 op1->type->refCount++;
9996 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9998 int value2 = op2->i;
10001 exp->string = PrintInt((int)(op1->i < value2));
10004 exp->expType = op1->type;
10006 op1->type->refCount++;
10011 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10013 unsigned int value2 = op2->ui;
10016 exp->string = PrintUInt((unsigned int)(op1->ui < value2));
10019 exp->expType = op1->type;
10021 op1->type->refCount++;
10026 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10028 long long value2 = op2->i64;
10031 exp->string = PrintInt64((long long)(op1->i64 < value2));
10034 exp->expType = op1->type;
10036 op1->type->refCount++;
10041 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10043 uint64 value2 = op2->ui64;
10046 exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
10049 exp->expType = op1->type;
10051 op1->type->refCount++;
10056 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10058 short value2 = op2->s;
10061 exp->string = PrintShort((short)(op1->s < value2));
10064 exp->expType = op1->type;
10066 op1->type->refCount++;
10071 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10073 unsigned short value2 = op2->us;
10076 exp->string = PrintUShort((unsigned short)(op1->us < value2));
10079 exp->expType = op1->type;
10081 op1->type->refCount++;
10086 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10088 char value2 = op2->c;
10091 exp->string = PrintChar((char)(op1->c < value2));
10094 exp->expType = op1->type;
10096 op1->type->refCount++;
10101 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10103 unsigned char value2 = op2->uc;
10106 exp->string = PrintUChar((unsigned char)(op1->uc < value2));
10109 exp->expType = op1->type;
10111 op1->type->refCount++;
10116 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10118 float value2 = op2->f;
10121 exp->string = PrintFloat((float)(op1->f < value2));
10124 exp->expType = op1->type;
10126 op1->type->refCount++;
10131 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10133 double value2 = op2->d;
10136 exp->string = PrintDouble((double)(op1->d < value2));
10139 exp->expType = op1->type;
10141 op1->type->refCount++;
10146 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10148 int value2 = op2->i;
10151 exp->string = PrintInt((int)(op1->i >= value2));
10154 exp->expType = op1->type;
10156 op1->type->refCount++;
10161 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10163 unsigned int value2 = op2->ui;
10166 exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
10169 exp->expType = op1->type;
10171 op1->type->refCount++;
10176 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10178 long long value2 = op2->i64;
10181 exp->string = PrintInt64((long long)(op1->i64 >= value2));
10184 exp->expType = op1->type;
10186 op1->type->refCount++;
10191 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10193 uint64 value2 = op2->ui64;
10196 exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
10199 exp->expType = op1->type;
10201 op1->type->refCount++;
10206 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10208 short value2 = op2->s;
10211 exp->string = PrintShort((short)(op1->s >= value2));
10214 exp->expType = op1->type;
10216 op1->type->refCount++;
10221 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10223 unsigned short value2 = op2->us;
10226 exp->string = PrintUShort((unsigned short)(op1->us >= value2));
10229 exp->expType = op1->type;
10231 op1->type->refCount++;
10236 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10238 char value2 = op2->c;
10241 exp->string = PrintChar((char)(op1->c >= value2));
10244 exp->expType = op1->type;
10246 op1->type->refCount++;
10251 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10253 unsigned char value2 = op2->uc;
10256 exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
10259 exp->expType = op1->type;
10261 op1->type->refCount++;
10266 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10268 float value2 = op2->f;
10271 exp->string = PrintFloat((float)(op1->f >= value2));
10274 exp->expType = op1->type;
10276 op1->type->refCount++;
10281 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10283 double value2 = op2->d;
10286 exp->string = PrintDouble((double)(op1->d >= value2));
10289 exp->expType = op1->type;
10291 op1->type->refCount++;
10296 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10298 int value2 = op2->i;
10301 exp->string = PrintInt((int)(op1->i <= value2));
10304 exp->expType = op1->type;
10306 op1->type->refCount++;
10311 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10313 unsigned int value2 = op2->ui;
10316 exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
10319 exp->expType = op1->type;
10321 op1->type->refCount++;
10326 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10328 long long value2 = op2->i64;
10331 exp->string = PrintInt64((long long)(op1->i64 <= value2));
10334 exp->expType = op1->type;
10336 op1->type->refCount++;
10341 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10343 uint64 value2 = op2->ui64;
10346 exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
10349 exp->expType = op1->type;
10351 op1->type->refCount++;
10356 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10358 short value2 = op2->s;
10361 exp->string = PrintShort((short)(op1->s <= value2));
10364 exp->expType = op1->type;
10366 op1->type->refCount++;
10371 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10373 unsigned short value2 = op2->us;
10376 exp->string = PrintUShort((unsigned short)(op1->us <= value2));
10379 exp->expType = op1->type;
10381 op1->type->refCount++;
10386 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10388 char value2 = op2->c;
10391 exp->string = PrintChar((char)(op1->c <= value2));
10394 exp->expType = op1->type;
10396 op1->type->refCount++;
10401 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10403 unsigned char value2 = op2->uc;
10406 exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
10409 exp->expType = op1->type;
10411 op1->type->refCount++;
10416 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10418 float value2 = op2->f;
10421 exp->string = PrintFloat((float)(op1->f <= value2));
10424 exp->expType = op1->type;
10426 op1->type->refCount++;
10431 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10433 double value2 = op2->d;
10436 exp->string = PrintDouble((double)(op1->d <= value2));
10439 exp->expType = op1->type;
10441 op1->type->refCount++;
10446 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10449 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10452 exp->expType = op1->type;
10454 op1->type->refCount++;
10459 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10462 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10465 exp->expType = op1->type;
10467 op1->type->refCount++;
10472 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10475 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10478 exp->expType = op1->type;
10480 op1->type->refCount++;
10485 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10488 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10491 exp->expType = op1->type;
10493 op1->type->refCount++;
10498 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10501 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10504 exp->expType = op1->type;
10506 op1->type->refCount++;
10511 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10514 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10517 exp->expType = op1->type;
10519 op1->type->refCount++;
10524 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10527 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10530 exp->expType = op1->type;
10532 op1->type->refCount++;
10537 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10540 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10543 exp->expType = op1->type;
10545 op1->type->refCount++;
10550 struct OpTable intOps =
10552 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
10555 struct OpTable uintOps =
10557 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
10560 struct OpTable int64Ops =
10562 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
10565 struct OpTable uint64Ops =
10567 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
10570 struct OpTable shortOps =
10572 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
10575 struct OpTable ushortOps =
10577 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
10580 struct OpTable floatOps =
10582 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
10585 struct OpTable doubleOps =
10587 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
10590 struct OpTable charOps =
10592 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
10595 struct OpTable ucharOps =
10597 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
10600 void ReadString(char * output, char * string)
10602 int len = strlen(string);
10604 unsigned int quoted = 0x0, escaped = 0x0;
10606 for(c = 0; c < len; c++)
10608 char ch = string[c];
10666 int UnescapeString(char * d, char * s, int len)
10671 while(j < len && (ch = s[j]))
10676 switch((ch = s[++j]))
10722 char * OffsetEscapedString(char * s, int len, int offset)
10727 while(j < len && k < offset && (ch = s[j]))
10733 return (k == offset) ? s + j : (((void *)0));
10736 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10738 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10740 extern double strtod(char * , char * * );
10742 extern float (* __ecereMethod_float_inf)(void);
10744 extern float (* __ecereMethod_float_nan)(void);
10746 extern double (* __ecereMethod_double_inf)(void);
10748 extern double (* __ecereMethod_double_nan)(void);
10750 struct Operand GetOperand(struct Expression * exp)
10752 struct Operand op =
10756 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10759 struct Type * type = exp->expType;
10763 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10765 if(!type->_class->registered->dataType)
10766 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10767 type = type->_class->registered->dataType;
10769 if(exp->type == 3 && op.kind == 13)
10771 op.ui64 = (uint64)exp->string;
10773 op.ops = uint64Ops;
10775 else if(exp->isConstant && exp->type == 2)
10777 op.kind = type->kind;
10778 op.type = exp->expType;
10784 if(exp->constant[0] == '\'')
10786 op.c = exp->constant[1];
10789 else if(type->isSigned)
10791 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10796 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10804 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10809 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10810 op.ops = ushortOps;
10817 op.i = strtol(exp->constant, (((void *)0)), 0);
10822 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10830 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10835 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10836 op.ops = uint64Ops;
10843 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10848 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10849 op.ops = uint64Ops;
10856 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10861 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10862 op.ops = uint64Ops;
10867 if(!strcmp(exp->constant, "inf"))
10868 op.f = __ecereMethod_float_inf();
10869 else if(!strcmp(exp->constant, "-inf"))
10870 op.f = -__ecereMethod_float_inf();
10871 else if(!strcmp(exp->constant, "nan"))
10872 op.f = __ecereMethod_float_nan();
10873 else if(!strcmp(exp->constant, "-nan"))
10874 op.f = -__ecereMethod_float_nan();
10876 op.f = (float)strtod(exp->constant, (((void *)0)));
10880 if(!strcmp(exp->constant, "inf"))
10881 op.d = __ecereMethod_double_inf();
10882 else if(!strcmp(exp->constant, "-inf"))
10883 op.d = -__ecereMethod_double_inf();
10884 else if(!strcmp(exp->constant, "nan"))
10885 op.d = __ecereMethod_double_nan();
10886 else if(!strcmp(exp->constant, "-nan"))
10887 op.d = -__ecereMethod_double_nan();
10889 op.d = (double)strtod(exp->constant, (((void *)0)));
10890 op.ops = doubleOps;
10895 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10897 op.ops = uint64Ops;
10905 int __ecereVMethodID_class_OnGetString;
10907 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10909 static __attribute__((unused)) void UnusedFunction()
10913 ((char * (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char * tempString, void * fieldData, unsigned int * needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
10916 extern int __ecereVMethodID_class_OnGetString;
10918 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10920 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10922 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10924 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10925 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10928 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10929 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10930 struct Type * type;
10931 void * ptr = inst->data + dataMember->offset + offset;
10932 char * result = (((void *)0));
10934 exp->loc = member->loc = inst->loc;
10935 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10936 if(!dataMember->dataType)
10937 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10938 type = dataMember->dataType;
10939 if(type->kind == 8)
10941 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10943 if(_class->type == 4)
10945 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10949 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10950 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10952 for(item = e->values.first; item; item = item->next)
10954 if((int)item->data == *(int *)ptr)
10956 result = item->name;
10962 exp->identifier = MkIdentifier(result);
10964 exp->destType = MkClassType(_class->fullName);
10965 ProcessExpressionType(exp);
10969 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10971 if(!_class->dataType)
10972 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10973 type = _class->dataType;
10982 FreeExpContents(exp);
10983 exp->constant = PrintFloat(*(float *)ptr);
10989 FreeExpContents(exp);
10990 exp->constant = PrintDouble(*(double *)ptr);
10996 FreeExpContents(exp);
10997 exp->constant = PrintInt(*(int *)ptr);
11003 FreeExpContents(exp);
11004 exp->constant = PrintInt64(*(long long *)ptr);
11010 FreeExpContents(exp);
11011 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11017 FreeExpContents(exp);
11018 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11023 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11026 ListAdd(memberList, member);
11028 if(parentDataMember->type == 1)
11033 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11035 void PopulateInstance(struct Instantiation * inst)
11037 struct Symbol * classSym = inst->_class->symbol;
11038 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
11039 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11040 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11043 inst->members = MkListOne(MkMembersInitList(memberList));
11045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11046 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11048 if(!dataMember->isProperty)
11050 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11051 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11054 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11055 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11056 struct Type * type;
11057 void * ptr = inst->data + dataMember->offset;
11058 char * result = (((void *)0));
11060 exp->loc = member->loc = inst->loc;
11061 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11062 if(!dataMember->dataType)
11063 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11064 type = dataMember->dataType;
11065 if(type->kind == 8)
11067 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11069 if(_class->type == 4)
11071 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11075 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11076 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11078 for(item = e->values.first; item; item = item->next)
11080 if((int)item->data == *(int *)ptr)
11082 result = item->name;
11089 exp->identifier = MkIdentifier(result);
11091 exp->destType = MkClassType(_class->fullName);
11092 ProcessExpressionType(exp);
11095 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11097 if(!_class->dataType)
11098 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11099 type = _class->dataType;
11108 exp->constant = PrintFloat(*(float *)ptr);
11114 exp->constant = PrintDouble(*(double *)ptr);
11120 exp->constant = PrintInt(*(int *)ptr);
11126 exp->constant = PrintInt64(*(long long *)ptr);
11132 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11137 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11140 ListAdd(memberList, member);
11146 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, char * name, unsigned int * offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
11148 extern void FreeInstance(struct Instantiation * inst);
11150 void ComputeInstantiation(struct Expression * exp)
11152 struct Instantiation * inst = exp->instance;
11153 struct MembersInit * members;
11154 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11155 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11156 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11157 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11158 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11159 int subMemberStackPos = 0;
11162 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11166 if(_class->type == 0 || _class->type == 5)
11168 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11169 if(_class->type == 0)
11170 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11173 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11177 for(members = (*inst->members).first; members; members = members->next)
11179 switch(members->type)
11183 if(members->dataMembers)
11185 struct MemberInit * member;
11187 for(member = (*members->dataMembers).first; member; member = member->next)
11189 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11190 unsigned int found = 0x0;
11191 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11192 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11193 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11194 unsigned int dataMemberOffset;
11198 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11201 if(curMember->isProperty)
11202 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11205 dataMember = curMember;
11206 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11207 if(_class->type == 0)
11208 dataMemberOffset += _class->base->structSize;
11215 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11219 if(prop->memberAccess == 1)
11221 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11222 curClass = prop->_class;
11227 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11228 int _subMemberStackPos = 0;
11230 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11234 if(dataMember->memberAccess == 1)
11236 curMember = dataMember;
11237 curClass = dataMember->_class;
11238 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11239 subMemberStackPos = _subMemberStackPos;
11244 if(found && member->initializer && member->initializer->type == 0)
11246 struct Expression * value = member->initializer->exp;
11247 struct Type * type = (((void *)0));
11248 unsigned int deepMember = 0x0;
11252 type = prop->dataType;
11254 else if(dataMember)
11256 if(!dataMember->dataType)
11257 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11258 type = dataMember->dataType;
11260 if(ident && ident->next)
11263 for(ident = ident->next; ident && type; ident = ident->next)
11265 if(type->kind == 8)
11267 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11269 type = prop->dataType;
11272 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11274 type = dataMember->dataType;
11277 else if(type->kind == 9 || type->kind == 10)
11279 struct Type * memberType;
11281 for(memberType = type->members.first; memberType; memberType = memberType->next)
11283 if(!strcmp(memberType->name, ident->string))
11294 FreeType(value->destType);
11295 value->destType = type;
11298 ComputeExpression(value);
11300 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11302 if(type->kind == 8)
11304 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11306 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11308 if(!_class->dataType)
11309 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11310 type = _class->dataType;
11315 void * ptr = inst->data + dataMemberOffset;
11317 if(value->type == 2)
11323 GetInt(value, (int *)ptr);
11328 GetInt64(value, (long long *)ptr);
11333 GetIntPtr(value, (intptr_t *)ptr);
11338 GetIntSize(value, (ssize_t *)ptr);
11343 GetFloat(value, (float *)ptr);
11348 GetDouble(value, (double *)ptr);
11353 else if(value->type == 1)
11355 if(type->kind == 8)
11357 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11359 if(_class->type == 1)
11361 ComputeTypeSize(type);
11362 if(value->instance->data)
11363 memcpy(ptr, value->instance->data, type->size);
11370 if(value->type == 1 && value->instance->data)
11372 if(type->kind == 8)
11374 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11376 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)))
11378 void (* Set)(void *, void *) = (void *)prop->Set;
11380 Set(inst->data, value->instance->data);
11381 PopulateInstance(inst);
11385 else if(value->type == 2)
11391 void (* Set)(void *, double) = (void *)prop->Set;
11393 Set(inst->data, strtod(value->constant, (((void *)0))));
11398 void (* Set)(void *, float) = (void *)prop->Set;
11400 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11405 void (* Set)(void *, int) = (void *)prop->Set;
11407 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11412 void (* Set)(void *, long long) = (void *)prop->Set;
11414 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11419 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11421 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11426 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11428 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11433 else if(value->type == 3)
11437 ReadString(temp, value->string);
11438 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11442 else if(!deepMember && type && _class->type == 3)
11446 if(value->type == 2)
11448 if(type->kind == 8)
11450 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11452 if(_class->type == 3)
11454 if(!_class->dataType)
11455 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11456 type = _class->dataType;
11464 float (* Set)(float) = (void *)prop->Set;
11466 GetFloat(member->initializer->exp, &fValue);
11467 exp->constant = PrintFloat(Set(fValue));
11474 double (* Set)(double) = (void *)prop->Set;
11476 GetDouble(member->initializer->exp, &dValue);
11477 exp->constant = PrintDouble(Set(dValue));
11485 else if(!deepMember && type && _class->type == 2)
11489 if(value->type == 1 && value->instance->data)
11491 unsigned int (* Set)(void *) = (void *)prop->Set;
11493 bits = Set(value->instance->data);
11495 else if(value->type == 2)
11499 else if(dataMember)
11501 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11502 struct Type * type;
11505 bits = (bits & ~bitMember->mask);
11506 if(!bitMember->dataType)
11507 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11508 type = bitMember->dataType;
11509 if(type->kind == 8 && type->_class && type->_class->registered)
11511 if(!type->_class->registered->dataType)
11512 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11513 type = type->_class->registered->dataType;
11522 type->isSigned ? GetChar(value, (char *)&v) : GetUChar(value, &v);
11530 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11539 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11547 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11555 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11563 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11568 bits |= part << bitMember->pos;
11574 if(_class && _class->type == 3)
11576 ComputeExpression(member->initializer->exp);
11577 exp->constant = member->initializer->exp->constant;
11579 member->initializer->exp->constant = (((void *)0));
11589 if(_class && _class->type == 2)
11591 exp->constant = PrintHexUInt(bits);
11596 FreeInstance(inst);
11600 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11602 unsigned int result = 0x0;
11607 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11608 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11612 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11613 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11616 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)
11617 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11620 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)
11621 result = GetOpFloat(op, &op->f);
11624 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)
11625 result = GetOpDouble(op, &op->d);
11628 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)
11629 result = GetOpUIntPtr(op, &op->ui64);
11632 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)
11633 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11636 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11637 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11640 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11641 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11647 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11649 if(exp->op.op == SIZEOF)
11651 FreeExpContents(exp);
11653 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11663 struct Expression * exp2 = exp->op.exp2;
11665 exp->op.exp2 = (((void *)0));
11666 FreeExpContents(exp);
11667 FreeType(exp->expType);
11668 FreeType(exp->destType);
11670 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11676 FreeExpContents(exp);
11677 op1->ops.Neg(exp, op1);
11681 if(op1->ops.BitNot)
11683 FreeExpContents(exp);
11684 op1->ops.BitNot(exp, op1);
11690 FreeExpContents(exp);
11691 op1->ops.Not(exp, op1);
11698 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11700 if(Promote(op2, op1->kind, op1->type->isSigned))
11701 op2->kind = op1->kind, op2->ops = op1->ops;
11702 else if(Promote(op1, op2->kind, op2->type->isSigned))
11703 op1->kind = op2->kind, op1->ops = op2->ops;
11710 FreeExpContents(exp);
11711 op1->ops.Add(exp, op1, op2);
11717 FreeExpContents(exp);
11718 op1->ops.Sub(exp, op1, op2);
11724 FreeExpContents(exp);
11725 op1->ops.Mul(exp, op1, op2);
11731 FreeExpContents(exp);
11732 op1->ops.Div(exp, op1, op2);
11738 FreeExpContents(exp);
11739 op1->ops.Mod(exp, op1, op2);
11745 if(op1->ops.BitAnd)
11747 FreeExpContents(exp);
11748 op1->ops.BitAnd(exp, op1, op2);
11755 FreeExpContents(exp);
11756 op1->ops.BitOr(exp, op1, op2);
11760 if(op1->ops.BitXor)
11762 FreeExpContents(exp);
11763 op1->ops.BitXor(exp, op1, op2);
11767 if(op1->ops.LShift)
11769 FreeExpContents(exp);
11770 op1->ops.LShift(exp, op1, op2);
11774 if(op1->ops.RShift)
11776 FreeExpContents(exp);
11777 op1->ops.RShift(exp, op1, op2);
11783 FreeExpContents(exp);
11784 op1->ops.Equ(exp, op1, op2);
11790 FreeExpContents(exp);
11791 op1->ops.Nqu(exp, op1, op2);
11797 FreeExpContents(exp);
11798 op1->ops.And(exp, op1, op2);
11804 FreeExpContents(exp);
11805 op1->ops.Or(exp, op1, op2);
11811 FreeExpContents(exp);
11812 op1->ops.Grt(exp, op1, op2);
11818 FreeExpContents(exp);
11819 op1->ops.Sma(exp, op1, op2);
11823 if(op1->ops.GrtEqu)
11825 FreeExpContents(exp);
11826 op1->ops.GrtEqu(exp, op1, op2);
11830 if(op1->ops.SmaEqu)
11832 FreeExpContents(exp);
11833 op1->ops.SmaEqu(exp, op1, op2);
11841 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11843 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11845 void ComputeExpression(struct Expression * exp)
11847 char expString[10240];
11849 expString[0] = '\0';
11854 ComputeInstantiation(exp);
11859 struct Expression * exp1, * exp2 = (((void *)0));
11860 struct Operand op1 =
11864 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11867 struct Operand op2 =
11871 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11877 struct Expression * e = exp->op.exp2;
11879 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11881 if(e->type == 5 || e->type == 32 || e->type == 23)
11884 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11886 e = (*e->list).last;
11889 if(exp->op.op == 261 && e && e->expType)
11891 if(e->type == 3 && e->string)
11893 char * string = e->string;
11894 int len = strlen(string);
11895 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11897 len = UnescapeString(tmp, string + 1, len - 2);
11898 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11899 FreeExpContents(exp);
11901 exp->constant = PrintUInt(len + 1);
11905 struct Type * type = e->expType;
11908 FreeExpContents(exp);
11910 exp->constant = PrintUInt(ComputeTypeSize(type));
11916 ComputeExpression(exp->op.exp2);
11920 ComputeExpression(exp->op.exp1);
11921 exp1 = exp->op.exp1;
11922 exp2 = exp->op.exp2;
11923 op1 = GetOperand(exp1);
11925 op1.type->refCount++;
11928 op2 = GetOperand(exp2);
11930 op2.type->refCount++;
11935 exp1 = exp->op.exp2;
11936 op1 = GetOperand(exp1);
11938 op1.type->refCount++;
11940 CallOperator(exp, exp1, exp2, &op1, &op2);
11942 FreeType(op1.type);
11944 FreeType(op2.type);
11950 struct Expression * e, * n;
11952 for(e = (*exp->list).first; e; e = n)
11957 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11958 struct Expression * prev = exp->prev;
11959 struct Expression * next = exp->next;
11961 ComputeExpression(e);
11962 FreeType(exp->expType);
11963 FreeType(exp->destType);
11967 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11968 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11979 struct Expression * memberExp = exp->member.exp;
11980 struct Identifier * memberID = exp->member.member;
11981 struct Type * type;
11983 ComputeExpression(exp->member.exp);
11984 type = exp->member.exp->expType;
11987 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)));
11988 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11989 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11990 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11992 if(type->kind == 19 && exp->member.exp->type == 24)
11993 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11997 struct Symbol * classSym;
12000 PrintTypeNoConst(type, string, 0x0, 0x1);
12001 classSym = FindClass(string);
12002 _class = classSym ? classSym->registered : (((void *)0));
12004 if(exp->member.member)
12006 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
12008 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
12010 if(!prop && !member && _class && exp->member.member)
12012 struct Symbol * classSym = FindClass(exp->member.member->string);
12014 convertTo = _class;
12015 _class = classSym ? classSym->registered : (((void *)0));
12016 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12022 struct Type * type = prop->dataType;
12024 if(_class->type == 3)
12026 if(type->kind == 8)
12028 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12030 if(_class->type == 3)
12032 if(!_class->dataType)
12033 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12034 type = _class->dataType;
12042 float (* Get)(float) = (void *)prop->Get;
12044 GetFloat(exp->member.exp, &value);
12045 exp->constant = PrintFloat(Get ? Get(value) : value);
12052 double (* Get)(double);
12054 GetDouble(exp->member.exp, &value);
12056 Get = (void *)prop->Set;
12058 Get = (void *)prop->Get;
12059 exp->constant = PrintDouble(Get ? Get(value) : value);
12069 struct Expression * value = exp->member.exp;
12070 struct Type * type;
12072 if(!prop->dataType)
12073 ProcessPropertyType(prop);
12074 type = prop->dataType;
12078 else if(_class->type == 1)
12084 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12086 if(propertyClass->type == 1 && value->type == 1)
12088 void (* Set)(void *, void *) = (void *)prop->Set;
12090 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12091 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12092 exp->instance->_class = MkSpecifierName(_class->fullName);
12093 exp->instance->loc = exp->loc;
12095 Set(exp->instance->data, value->instance->data);
12096 PopulateInstance(exp->instance);
12103 void (* Set)(void *, int) = (void *)prop->Set;
12105 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12106 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12107 exp->instance->_class = MkSpecifierName(_class->fullName);
12108 exp->instance->loc = exp->loc;
12110 GetInt(value, &intValue);
12111 Set(exp->instance->data, intValue);
12112 PopulateInstance(exp->instance);
12117 long long intValue;
12118 void (* Set)(void *, long long) = (void *)prop->Set;
12120 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12121 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12122 exp->instance->_class = MkSpecifierName(_class->fullName);
12123 exp->instance->loc = exp->loc;
12125 GetInt64(value, &intValue);
12126 Set(exp->instance->data, intValue);
12127 PopulateInstance(exp->instance);
12133 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12135 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12136 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12137 exp->instance->_class = MkSpecifierName(_class->fullName);
12138 exp->instance->loc = exp->loc;
12140 GetIntPtr(value, &intValue);
12141 Set(exp->instance->data, intValue);
12142 PopulateInstance(exp->instance);
12148 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12150 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12151 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12152 exp->instance->_class = MkSpecifierName(_class->fullName);
12153 exp->instance->loc = exp->loc;
12155 GetIntSize(value, &intValue);
12156 Set(exp->instance->data, intValue);
12157 PopulateInstance(exp->instance);
12163 void (* Set)(void *, float) = (void *)prop->Set;
12165 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12166 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12167 exp->instance->_class = MkSpecifierName(_class->fullName);
12168 exp->instance->loc = exp->loc;
12170 GetFloat(value, &floatValue);
12171 Set(exp->instance->data, floatValue);
12172 PopulateInstance(exp->instance);
12177 double doubleValue;
12178 void (* Set)(void *, double) = (void *)prop->Set;
12180 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12181 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12182 exp->instance->_class = MkSpecifierName(_class->fullName);
12183 exp->instance->loc = exp->loc;
12185 GetDouble(value, &doubleValue);
12186 Set(exp->instance->data, doubleValue);
12187 PopulateInstance(exp->instance);
12192 else if(_class->type == 2)
12198 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12200 if(propertyClass->type == 1 && value->instance->data)
12202 unsigned int (* Set)(void *) = (void *)prop->Set;
12203 unsigned int bits = Set(value->instance->data);
12205 exp->constant = PrintHexUInt(bits);
12209 else if(_class->type == 2)
12211 unsigned int value;
12212 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12215 GetUInt(exp->member.exp, &value);
12217 exp->constant = PrintHexUInt(bits);
12226 if(_class->type == 2)
12228 unsigned int value;
12230 GetUInt(exp->member.exp, &value);
12235 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12237 if(_class->type == 1)
12239 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12241 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12242 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12243 exp->instance->_class = MkSpecifierName(_class->fullName);
12244 exp->instance->loc = exp->loc;
12246 Get(value, exp->instance->data);
12247 PopulateInstance(exp->instance);
12249 else if(_class->type == 2)
12251 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12252 uint64 bits = Get(value);
12254 exp->constant = PrintHexUInt64(bits);
12261 else if(_class->type == 1)
12263 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12269 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12271 if(_class->type == 1 && value)
12273 void (* Get)(void *, void *) = (void *)prop->Get;
12275 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12276 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12277 exp->instance->_class = MkSpecifierName(_class->fullName);
12278 exp->instance->loc = exp->loc;
12280 Get(value, exp->instance->data);
12281 PopulateInstance(exp->instance);
12292 exp->isConstant = 0x0;
12301 FreeExpression(memberExp);
12302 FreeIdentifier(memberID);
12308 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12310 FreeExpContents(exp);
12311 exp->constant = PrintUInt(ComputeTypeSize(type));
12318 struct Symbol * classSym = exp->_class->symbol;
12320 if(classSym && classSym->registered)
12322 if(classSym->registered->fixed)
12324 FreeSpecifier(exp->_class);
12325 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12330 char className[1024];
12332 strcpy(className, "__ecereClass_");
12333 FullClassNameCat(className, classSym->string, 0x1);
12334 MangleClassName(className);
12335 DeclareClass(classSym, className);
12336 FreeExpContents(exp);
12338 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12339 exp->member.member = MkIdentifier("structSize");
12346 struct Type * type;
12347 struct Expression * e = exp;
12349 if(exp->type == 11)
12352 ComputeExpression(exp->cast.exp);
12355 if(e && exp->expType)
12357 type = exp->expType;
12358 if(type->kind == 8)
12360 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12362 if(_class && (_class->type == 3 || _class->type == 2))
12364 if(!_class->dataType)
12365 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12366 type = _class->dataType;
12375 char value = (char)0;
12377 if(GetChar(e, &value))
12379 FreeExpContents(exp);
12380 exp->constant = PrintChar(value);
12386 unsigned char value = (unsigned char)0;
12388 if(GetUChar(e, &value))
12390 FreeExpContents(exp);
12391 exp->constant = PrintUChar(value);
12399 short value = (short)0;
12401 if(GetShort(e, &value))
12403 FreeExpContents(exp);
12404 exp->constant = PrintShort(value);
12410 unsigned short value = (unsigned short)0;
12412 if(GetUShort(e, &value))
12414 FreeExpContents(exp);
12415 exp->constant = PrintUShort(value);
12425 if(GetInt(e, &value))
12427 FreeExpContents(exp);
12428 exp->constant = PrintInt(value);
12434 unsigned int value = 0;
12436 if(GetUInt(e, &value))
12438 FreeExpContents(exp);
12439 exp->constant = PrintUInt(value);
12447 long long value = 0;
12449 if(GetInt64(e, &value))
12451 FreeExpContents(exp);
12452 exp->constant = PrintInt64(value);
12460 if(GetUInt64(e, &value))
12462 FreeExpContents(exp);
12463 exp->constant = PrintUInt64(value);
12471 intptr_t value = 0;
12473 if(GetIntPtr(e, &value))
12475 FreeExpContents(exp);
12476 exp->constant = PrintInt64((long long)value);
12482 uintptr_t value = 0;
12484 if(GetUIntPtr(e, &value))
12486 FreeExpContents(exp);
12487 exp->constant = PrintUInt64((uint64)value);
12497 if(GetIntSize(e, &value))
12499 FreeExpContents(exp);
12500 exp->constant = PrintInt64((long long)value);
12508 if(GetUIntSize(e, &value))
12510 FreeExpContents(exp);
12511 exp->constant = PrintUInt64((uint64)value);
12520 if(GetFloat(e, &value))
12522 FreeExpContents(exp);
12523 exp->constant = PrintFloat(value);
12532 if(GetDouble(e, &value))
12534 FreeExpContents(exp);
12535 exp->constant = PrintDouble(value);
12546 struct Operand op1 =
12550 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12553 struct Operand op2 =
12557 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12560 struct Operand op3 =
12564 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12569 ComputeExpression((*exp->cond.exp).last);
12570 if(exp->cond.elseExp)
12571 ComputeExpression(exp->cond.elseExp);
12573 ComputeExpression(exp->cond.cond);
12574 op1 = GetOperand(exp->cond.cond);
12576 op1.type->refCount++;
12577 op2 = GetOperand((*exp->cond.exp).last);
12579 op2.type->refCount++;
12580 op3 = GetOperand(exp->cond.elseExp);
12582 op3.type->refCount++;
12585 FreeExpContents(exp);
12586 op1.ops.Cond(exp, &op1, &op2, &op3);
12589 FreeType(op1.type);
12591 FreeType(op2.type);
12593 FreeType(op3.type);
12599 void ApplyAnyObjectLogic(struct Expression * e);
12601 extern void CopyTypeInto(struct Type * type, struct Type * src);
12603 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12605 unsigned int result = 0x1;
12609 struct __ecereNameSpace__ecere__sys__OldList converts =
12613 struct Conversion * convert;
12615 if(destType->kind == 0)
12617 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12621 for(convert = converts.first; convert; convert = convert->next)
12623 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12627 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12628 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12631 newExp->prev = (((void *)0));
12632 newExp->next = (((void *)0));
12633 newExp->destType = (((void *)0));
12637 exp->addedThis = 0x1;
12638 exp->member.exp = newExp;
12639 FreeType(exp->member.exp->expType);
12640 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12641 exp->member.exp->expType->classObjectType = objectType;
12642 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12643 exp->member.memberType = 1;
12644 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12645 exp->needCast = 0x1;
12647 exp->expType->refCount++;
12648 ApplyAnyObjectLogic(exp->member.exp);
12654 exp->addedThis = 0x1;
12655 exp->member.exp = newExp;
12656 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12658 newExp->byReference = 0x1;
12660 FreeType(exp->member.exp->expType);
12661 exp->member.exp->expType = (((void *)0));
12662 if(convert->convert->dataType)
12664 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12665 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12666 exp->member.exp->expType->refCount = 1;
12667 exp->member.exp->expType->classObjectType = objectType;
12668 ApplyAnyObjectLogic(exp->member.exp);
12670 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12671 exp->member.memberType = 4;
12672 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12673 exp->needCast = 0x1;
12674 if(convert->resultType)
12675 convert->resultType->refCount++;
12681 FreeType(exp->expType);
12684 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12685 exp->needCast = 0x1;
12687 exp->expType->refCount++;
12691 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12692 exp->needCast = 0x1;
12693 if(convert->resultType)
12694 convert->resultType->refCount++;
12698 if(exp->isConstant && inCompiler)
12699 ComputeExpression(exp);
12700 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12702 if(!result && exp->expType && converts.count)
12704 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12706 if(!result && exp->expType && exp->destType)
12708 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))
12715 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12717 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12719 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12721 void CheckTemplateTypes(struct Expression * exp)
12723 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12725 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12726 struct Context * context;
12730 exp->destType->refCount++;
12732 exp->expType->refCount++;
12733 newExp->prev = (((void *)0));
12734 newExp->next = (((void *)0));
12735 switch(exp->expType->kind)
12738 if(exp->destType->classObjectType)
12741 exp->destType->refCount--;
12743 exp->expType->refCount--;
12744 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12748 struct __ecereNameSpace__ecere__sys__OldList * specs;
12749 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12750 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12752 context = PushContext();
12753 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12754 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12755 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12757 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12758 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12759 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12760 exp->compound->compound.context = context;
12761 PopContext(context);
12766 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12767 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12771 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12773 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12774 struct Statement * compound;
12775 struct Context * context;
12779 exp->destType->refCount++;
12781 exp->expType->refCount++;
12782 newExp->prev = (((void *)0));
12783 newExp->next = (((void *)0));
12784 switch(exp->expType->kind)
12787 if(exp->destType->classObjectType)
12790 exp->destType->refCount--;
12792 exp->expType->refCount--;
12793 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12797 struct __ecereNameSpace__ecere__sys__OldList * specs;
12798 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12799 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12801 context = PushContext();
12802 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12803 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12804 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12806 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12807 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12808 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12809 exp->compound->compound.context = context;
12810 PopContext(context);
12815 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12818 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12819 ProcessExpressionType((*exp->list).first);
12825 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12826 newExp->needCast = 0x1;
12827 ProcessExpressionType((*exp->list).first);
12833 if(exp->expType->kind == 20)
12835 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12839 FreeType(exp->destType);
12840 FreeType(exp->expType);
12841 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12845 if(newExp->type == 8 && newExp->member.memberType == 3)
12849 exp->op.exp1 = (((void *)0));
12850 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12854 char typeString[1024];
12855 struct Declarator * decl;
12856 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12858 typeString[0] = '\0';
12859 PrintType(exp->expType, typeString, 0x0, 0x0);
12860 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12862 exp->cast.typeName = MkTypeName(specs, decl);
12863 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12864 exp->cast.exp->needCast = 0x1;
12872 extern int strncmp(const char * , const char * , size_t n);
12874 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12876 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12878 int nsLen = strlen(nameSpace);
12879 struct Symbol * symbol;
12881 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)))
12883 char * s = symbol->string;
12885 if(!strncmp(s, nameSpace, nsLen))
12890 for(c = strlen(s) - 1; c >= 0; c--)
12893 namePart = s + c + 1;
12894 if(!strcmp(namePart, name))
12902 return (((void *)0));
12905 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12908 char nameSpace[1024];
12910 unsigned int gotColon = 0x0;
12912 nameSpace[0] = '\0';
12913 for(c = strlen(name) - 1; c >= 0; c--)
12919 namePart = name + c + 1;
12920 while(c >= 0 && name[c] == ':')
12924 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12928 memcpy(nameSpace, name, c + 1);
12929 nameSpace[c + 1] = (char)0;
12930 return ScanWithNameSpace(tree, nameSpace, namePart);
12934 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12940 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12944 return ScanWithNameSpace(tree, "", namePart);
12946 return (((void *)0));
12949 static void ProcessDeclaration(struct Declaration * decl);
12951 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12953 struct Context * ctx;
12954 struct Symbol * symbol = (((void *)0));
12956 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12958 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12960 symbol = (((void *)0));
12963 char curName[1024];
12965 strcpy(curName, thisNameSpace);
12966 strcat(curName, "::");
12967 strcat(curName, name);
12968 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12971 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12974 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12975 if(symbol || ctx == endContext)
12978 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12980 if(symbol->pointerExternal->type == 0)
12982 struct FunctionDefinition * function = symbol->pointerExternal->function;
12983 struct Context * tmpContext = curContext;
12985 curContext = (((void *)0));
12986 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12987 curContext = tmpContext;
12988 symbol->pointerExternal->symbol = symbol;
12989 DeclareType(symbol->type, 0x1, 0x1);
12990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12991 symbol->id = curExternal->symbol->idCode;
12993 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12996 symbol->id = curExternal->symbol->idCode;
13002 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
13004 if(!type->isSigned && type->kind != 22 && type->kind != 23)
13005 ListAdd(specs, MkSpecifier(UNSIGNED));
13010 if(type->_class->registered)
13012 if(!type->_class->registered->dataType)
13013 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
13014 GetTypeSpecs(type->_class->registered->dataType, specs);
13019 ListAdd(specs, MkSpecifier(DOUBLE));
13022 ListAdd(specs, MkSpecifier(FLOAT));
13025 ListAdd(specs, MkSpecifier(CHAR));
13028 ListAdd(specs, MkSpecifier(_BOOL));
13031 ListAdd(specs, MkSpecifier(SHORT));
13034 ListAdd(specs, MkSpecifier(INT64));
13037 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13040 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13044 ListAdd(specs, MkSpecifier(INT));
13049 static void PrintArraySize(struct Type * arrayType, char * string)
13055 if(arrayType->enumClass)
13056 strcat(size, arrayType->enumClass->string);
13057 else if(arrayType->arraySizeExp)
13058 PrintExpression(arrayType->arraySizeExp, size);
13060 strcat(string, size);
13063 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13067 if(printConst && type->constant)
13068 strcat(string, "const ");
13073 struct Symbol * c = type->_class;
13075 if(type->classObjectType == 2)
13076 strcat(string, "typed_object");
13077 else if(type->classObjectType == 3)
13078 strcat(string, "any_object");
13082 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13084 if(type->byReference)
13085 strcat(string, " &");
13089 strcat(string, "void");
13092 strcat(string, type->isSigned ? "int" : "uint");
13095 strcat(string, type->isSigned ? "int64" : "uint64");
13098 strcat(string, type->isSigned ? "intptr" : "uintptr");
13101 strcat(string, type->isSigned ? "intsize" : "uintsize");
13104 strcat(string, type->isSigned ? "char" : "byte");
13107 strcat(string, "_Bool");
13110 strcat(string, type->isSigned ? "short" : "uint16");
13113 strcat(string, "float");
13116 strcat(string, "double");
13121 strcat(string, "struct ");
13122 strcat(string, type->enumName);
13124 else if(type->typeName)
13125 strcat(string, type->typeName);
13128 struct Type * member;
13130 strcat(string, "struct { ");
13131 for(member = type->members.first; member; member = member->next)
13133 PrintType(member, string, 0x1, fullName);
13134 strcat(string, "; ");
13136 strcat(string, "}");
13142 strcat(string, "union ");
13143 strcat(string, type->enumName);
13145 else if(type->typeName)
13146 strcat(string, type->typeName);
13149 strcat(string, "union ");
13150 strcat(string, "(unnamed)");
13156 strcat(string, "enum ");
13157 strcat(string, type->enumName);
13159 else if(type->typeName)
13160 strcat(string, type->typeName);
13162 strcat(string, "int");
13165 strcat(string, "...");
13168 strcat(string, "subclass(");
13169 strcat(string, type->_class ? type->_class->string : "int");
13170 strcat(string, ")");
13173 strcat(string, type->templateParameter->identifier->string);
13176 strcat(string, "thisclass");
13179 strcat(string, "__builtin_va_list");
13185 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13187 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13189 if(type->name && type->name[0])
13192 strcat(string, type->name);
13195 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13201 strcat(string, name);
13206 static void PrintAttribs(struct Type * type, char * string)
13210 if(type->dllExport)
13211 strcat(string, "dllexport ");
13212 if(type->attrStdcall)
13213 strcat(string, "stdcall ");
13217 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13219 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13221 struct Type * attrType = (((void *)0));
13223 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13224 PrintAttribs(type, string);
13225 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13226 strcat(string, " const");
13227 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13228 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13229 strcat(string, " (");
13230 if(type->kind == 13)
13232 if(type->type->kind == 11 || type->type->kind == 16)
13233 PrintAttribs(type->type, string);
13235 if(type->kind == 13)
13237 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13238 strcat(string, "*");
13240 strcat(string, " *");
13242 if(printConst && type->constant && type->kind == 13)
13243 strcat(string, " const");
13246 PrintTypeSpecs(type, string, fullName, printConst);
13249 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13251 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13252 strcat(string, ")");
13253 if(type->kind == 12)
13254 PrintArraySize(type, string);
13255 else if(type->kind == 11)
13257 struct Type * param;
13259 strcat(string, "(");
13260 for(param = type->params.first; param; param = param->next)
13262 PrintType(param, string, 0x1, fullName);
13264 strcat(string, ", ");
13266 strcat(string, ")");
13268 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13269 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13272 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13274 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13275 if(type->thisClass || (printName && type->name && type->name[0]))
13276 strcat(string, " ");
13277 if((type->thisClass || type->staticMethod))
13279 struct Symbol * _class = type->thisClass;
13281 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13283 if(type->classObjectType == 1)
13284 strcat(string, "class");
13286 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13288 else if(_class && _class->string)
13290 char * s = _class->string;
13296 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13302 strcat(string, name);
13305 strcat(string, "::");
13307 if(printName && type->name)
13308 PrintName(type, string, fullName);
13309 PostPrintType(type, string, fullName);
13310 if(type->bitFieldCount)
13314 sprintf(count, ":%d", type->bitFieldCount);
13315 strcat(string, count);
13319 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13321 _PrintType(type, string, printName, fullName, 0x1);
13324 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13326 _PrintType(type, string, printName, fullName, 0x0);
13329 static struct Type * FindMember(struct Type * type, char * string)
13331 struct Type * memberType;
13333 for(memberType = type->members.first; memberType; memberType = memberType->next)
13335 if(!memberType->name)
13337 struct Type * subType = FindMember(memberType, string);
13342 else if(!strcmp(memberType->name, string))
13345 return (((void *)0));
13348 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13350 struct Type * memberType;
13352 for(memberType = type->members.first; memberType; memberType = memberType->next)
13354 if(!memberType->name)
13356 struct Type * subType = FindMember(memberType, string);
13360 *offset += memberType->offset;
13364 else if(!strcmp(memberType->name, string))
13366 *offset += memberType->offset;
13370 return (((void *)0));
13373 extern unsigned int parseError;
13375 unsigned int GetParseError()
13380 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13382 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13384 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13386 struct Expression * ParseExpressionString(char * expression)
13389 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13390 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13391 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13393 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13394 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13395 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13396 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13398 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13399 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13401 parsedExpression = (((void *)0));
13403 expression_yyparse();
13404 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13405 return parsedExpression;
13408 extern char * QMkString(char * source);
13410 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13412 struct Identifier * id = exp->identifier;
13413 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13414 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13415 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13416 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13418 if(_class && _class->type == 4)
13420 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13421 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13425 struct __ecereNameSpace__ecere__com__Class * baseClass;
13427 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13429 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13431 for(value = e->values.first; value; value = value->next)
13433 if(!strcmp(value->name, id->string))
13438 char constant[256];
13440 FreeExpContents(exp);
13442 exp->isConstant = 0x1;
13443 if(!strcmp(baseClass->dataTypeString, "int"))
13444 sprintf(constant, "%d", (int)value->data);
13446 sprintf(constant, "0x%X", (int)value->data);
13447 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13448 exp->expType = MkClassType(baseClass->fullName);
13456 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13458 ProcessMethodType(method);
13459 exp->expType = __extension__ ({
13460 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13462 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13466 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13468 if(!prop->dataType)
13469 ProcessPropertyType(prop);
13470 exp->expType = prop->dataType;
13472 prop->dataType->refCount++;
13475 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13477 if(!member->dataType)
13478 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13479 exp->expType = member->dataType;
13480 if(member->dataType)
13481 member->dataType->refCount++;
13484 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13486 if(!classProp->dataType)
13487 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13488 if(classProp->constant)
13490 FreeExpContents(exp);
13491 exp->isConstant = 0x1;
13492 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13495 exp->constant = QMkString((char *)classProp->Get(_class));
13499 char constant[256];
13502 sprintf(constant, "%d", (int)classProp->Get(_class));
13503 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13509 exp->expType = classProp->dataType;
13510 if(classProp->dataType)
13511 classProp->dataType->refCount++;
13517 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13519 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13520 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13521 struct __ecereNameSpace__ecere__com__NameSpace * child;
13525 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)))
13527 data = ScanGlobalData(child, name);
13535 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13537 extern char * strncpy(char * , const char * , size_t n);
13539 static struct GlobalData * FindGlobalData(char * name)
13542 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13544 nameSpace = globalData;
13545 for(c = 0; name[c]; c++)
13547 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13549 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13550 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13552 strncpy(spaceName, name + start, c - start);
13553 spaceName[c - start] = '\0';
13554 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13555 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13557 return (((void *)0));
13558 nameSpace = newSpace;
13566 return ScanGlobalData(nameSpace, name + start);
13568 return (((void *)0));
13571 static int definedExpStackPos;
13573 static void * definedExpStack[512];
13575 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13577 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13579 FreeExpContents(checkedExp);
13580 FreeType(checkedExp->expType);
13581 FreeType(checkedExp->destType);
13582 *checkedExp = *newExp;
13583 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13584 checkedExp->prev = prev;
13585 checkedExp->next = next;
13588 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13590 extern int printf(char * , ...);
13592 void __ecereMethod_Expression_Clear();
13594 void ApplyAnyObjectLogic(struct Expression * e)
13596 struct Type * destType = e->destType;
13598 if(destType && (destType->classObjectType == 3))
13600 if(e && e->expType)
13602 struct Type * type = e->expType;
13603 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13605 if(type->kind == 8 && type->_class && type->_class->registered)
13607 _class = type->_class->registered;
13609 else if(type->kind == 19)
13611 _class = FindClass("ecere::com::Class")->registered;
13615 char string[1024] = "";
13616 struct Symbol * classSym;
13618 PrintTypeNoConst(type, string, 0x0, 0x1);
13619 classSym = FindClass(string);
13621 _class = classSym->registered;
13623 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)))
13625 if(!_class || strcmp(_class->fullName, "char *"))
13627 struct Expression * checkedExp = e, * newExp;
13629 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13631 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13633 if(checkedExp->type == 23)
13635 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13638 checkedExp = (*checkedExp->list).last;
13640 else if(checkedExp->type == 11)
13641 checkedExp = checkedExp->cast.exp;
13643 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13645 newExp = checkedExp->op.exp2;
13646 checkedExp->op.exp2 = (((void *)0));
13647 FreeExpContents(checkedExp);
13648 if(e->expType && e->expType->passAsTemplate)
13652 ComputeTypeSize(e->expType);
13653 sprintf(size, "%d", e->expType->size);
13654 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))))));
13656 ReplaceExpContents(checkedExp, newExp);
13657 e->byReference = 0x1;
13659 else if(!e->byReference || (_class && _class->type == 5))
13661 struct Expression * checkedExp;
13664 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;
13666 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13668 struct Context * context = PushContext();
13669 struct Declarator * decl;
13670 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13671 char typeString[1024];
13672 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13674 typeString[0] = '\0';
13676 newExp->prev = (((void *)0));
13677 newExp->next = (((void *)0));
13678 newExp->expType = (((void *)0));
13679 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13680 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13681 newExp->destType = ProcessType(specs, decl);
13682 curContext = context;
13686 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13689 sprintf(name, "__internalValue%03X", internalValueCounter++);
13690 if(!curCompound->compound.declarations)
13691 curCompound->compound.declarations = MkList();
13692 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13693 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13694 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13695 e->compound = MkCompoundStmt((((void *)0)), stmts);
13698 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13700 struct Type * type = e->destType;
13702 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13703 CopyTypeInto(e->destType, type);
13704 e->destType->refCount = 1;
13705 e->destType->classObjectType = 0;
13708 e->compound->compound.context = context;
13709 PopContext(context);
13710 curContext = context->parent;
13714 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13716 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13718 if(checkedExp->type == 23)
13720 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13723 checkedExp = (*checkedExp->list).last;
13725 else if(checkedExp->type == 11)
13726 checkedExp = checkedExp->cast.exp;
13729 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13731 *operand = *checkedExp;
13732 checkedExp->destType = (((void *)0));
13733 checkedExp->expType = (((void *)0));
13734 __ecereMethod_Expression_Clear(checkedExp);
13735 checkedExp->type = 4;
13736 checkedExp->op.op = '&';
13737 checkedExp->op.exp1 = (((void *)0));
13738 checkedExp->op.exp2 = operand;
13747 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))))
13749 if(e->expType->classObjectType && destType && destType->classObjectType)
13755 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13758 thisExp->prev = (((void *)0));
13759 thisExp->next = (((void *)0));
13760 __ecereMethod_Expression_Clear(e);
13762 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13763 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13764 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13766 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13767 CopyTypeInto(e->expType, thisExp->expType);
13768 e->expType->byReference = 0x0;
13769 e->expType->refCount = 1;
13770 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))
13772 e->expType->classObjectType = 0;
13777 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13779 if(destType->kind == 14)
13781 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13783 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13785 unsigned int byReference = e->expType->byReference;
13786 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13787 struct Declarator * decl;
13788 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13789 char typeString[1024];
13790 struct Type * type;
13791 int backupClassObjectType;
13792 unsigned int backupByReference;
13794 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13798 backupClassObjectType = type->classObjectType;
13799 backupByReference = type->byReference;
13800 type->classObjectType = 0;
13801 type->byReference = 0x0;
13802 typeString[0] = '\0';
13803 PrintType(type, typeString, 0x0, 0x1);
13804 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13805 type->classObjectType = backupClassObjectType;
13806 type->byReference = backupByReference;
13808 thisExp->prev = (((void *)0));
13809 thisExp->next = (((void *)0));
13810 __ecereMethod_Expression_Clear(e);
13811 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)))
13815 e->op.exp1 = (((void *)0));
13816 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13817 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13818 CopyTypeInto(e->expType, type);
13819 e->expType->byReference = 0x0;
13820 e->expType->refCount = 1;
13825 e->cast.typeName = MkTypeName(specs, decl);
13826 e->cast.exp = thisExp;
13827 e->byReference = 0x1;
13831 e->destType = destType;
13832 destType->refCount++;
13837 extern char * strstr(const char * , const char * );
13839 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13841 struct __ecereNameSpace__ecere__com__DefinedExpression
13843 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13844 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13847 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13848 } __attribute__ ((gcc_struct));
13850 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13852 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13854 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13856 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13858 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13860 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13862 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13864 static void ProcessStatement(struct Statement * stmt);
13866 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13868 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13870 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13872 extern char * sourceFile;
13874 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13876 void ProcessExpressionType(struct Expression * exp)
13878 unsigned int unresolved = 0x0;
13879 struct Location oldyylloc = yylloc;
13880 unsigned int notByReference = 0x0;
13882 if(!exp || exp->expType)
13889 struct Identifier * id = exp->identifier;
13891 if(!id || !topContext)
13893 if(id->_class && id->_class->name)
13895 id->classSym = id->_class->symbol;
13897 if(strstr(id->string, "__ecereClass") == id->string)
13899 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13902 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13904 ReplaceClassMembers(exp, thisClass);
13907 ProcessExpressionType(exp);
13910 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13915 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13919 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13925 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13928 ProcessExpressionType(exp);
13932 else if(currentClass && !id->_class)
13934 if(ResolveIdWithClass(exp, currentClass, 0x1))
13937 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13942 struct Type * type = symbol->type;
13943 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13945 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13947 struct Context * context = SetupTemplatesContext(_class);
13949 type = ReplaceThisClassType(_class);
13950 FinishTemplatesContext(context);
13952 type->refCount = 0;
13954 FreeSpecifier(id->_class);
13955 id->_class = (((void *)0));
13956 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13957 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13958 id->classSym = (((void *)0));
13959 exp->expType = type;
13962 if(type && (type->kind == 15))
13963 exp->isConstant = 0x1;
13964 if(symbol->isParam || !strcmp(id->string, "this"))
13966 if(_class && _class->type == 1 && !type->declaredWithStruct)
13967 exp->byReference = 0x1;
13969 if(symbol->isIterator)
13971 if(symbol->isIterator == 3)
13974 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13975 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13976 exp->expType = (((void *)0));
13977 ProcessExpressionType(exp);
13979 else if(symbol->isIterator != 4)
13982 exp->member.exp = MkExpIdentifier(exp->identifier);
13983 exp->member.exp->expType = exp->expType;
13984 exp->member.member = MkIdentifier("data");
13985 exp->expType = (((void *)0));
13986 ProcessExpressionType(exp);
13993 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13995 if(thisNameSpace && !(id->_class && !id->_class->name))
13999 strcpy(name, thisNameSpace);
14000 strcat(name, "::");
14001 strcat(name, id->string);
14002 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
14005 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14010 for(c = 0; c < definedExpStackPos; c++)
14011 if(definedExpStack[c] == definedExp)
14013 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14015 struct Location backupYylloc = yylloc;
14016 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14018 definedExpStack[definedExpStackPos++] = definedExp;
14019 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14020 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
14021 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14023 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14024 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14025 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14026 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14028 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14029 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14031 parsedExpression = (((void *)0));
14033 expression_yyparse();
14034 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14036 fileInput = backInput;
14037 yylloc = backupYylloc;
14038 if(parsedExpression)
14040 FreeIdentifier(id);
14042 exp->list = MkListOne(parsedExpression);
14043 parsedExpression->loc = yylloc;
14044 ProcessExpressionType(exp);
14045 definedExpStackPos--;
14048 definedExpStackPos--;
14054 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14060 struct GlobalData * data = (((void *)0));
14062 if(thisNameSpace && !(id->_class && !id->_class->name))
14066 strcpy(name, thisNameSpace);
14067 strcat(name, "::");
14068 strcat(name, id->string);
14069 data = FindGlobalData(name);
14072 data = FindGlobalData(id->string);
14075 DeclareGlobalData(data);
14076 exp->expType = data->dataType;
14078 data->dataType->refCount++;
14079 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14080 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14081 FreeSpecifier(id->_class);
14082 id->_class = (((void *)0));
14087 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14089 if(thisNameSpace && !(id->_class && !id->_class->name))
14093 strcpy(name, thisNameSpace);
14094 strcat(name, "::");
14095 strcat(name, id->string);
14096 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14099 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14104 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14105 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14107 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14108 strcpy(name, "__ecereFunction_");
14109 FullClassNameCat(name, id->string, 0x0);
14110 if(DeclareFunction(function, name))
14112 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14113 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14115 exp->expType = function->dataType;
14116 if(function->dataType)
14117 function->dataType->refCount++;
14118 FreeSpecifier(id->_class);
14119 id->_class = (((void *)0));
14131 struct __ecereNameSpace__ecere__com__Class * _class;
14133 if(!exp->instance->_class)
14135 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14137 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14140 ProcessInstantiationType(exp->instance);
14141 exp->isConstant = exp->instance->isConstant;
14142 if(exp->instance->_class)
14144 exp->expType = MkClassType(exp->instance->_class->name);
14152 char * constant = exp->constant;
14153 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14155 exp->expType = type;
14156 if(constant[0] == '\'')
14158 if((int)((unsigned char *)constant)[1] > 127)
14161 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14165 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14166 exp->constant = PrintUInt(ch);
14168 type->_class = FindClass("unichar");
14169 type->isSigned = 0x0;
14174 type->isSigned = 0x1;
14179 char * dot = strchr(constant, '.');
14180 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14185 exponent = strchr(constant, 'p');
14187 exponent = strchr(constant, 'P');
14191 exponent = strchr(constant, 'e');
14193 exponent = strchr(constant, 'E');
14195 if(dot || exponent)
14197 if(strchr(constant, 'f') || strchr(constant, 'F'))
14201 type->isSigned = 0x1;
14205 unsigned int isSigned = constant[0] == '-';
14206 char * endP = (((void *)0));
14207 long long i64 = strtoll(constant, &endP, 0);
14208 uint64 ui64 = strtoull(constant, &endP, 0);
14209 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14213 if(i64 < (((int)0x80000000)))
14218 if(ui64 > (((int)0x7fffffff)))
14220 if(ui64 > (0xffffffff))
14223 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14227 else if(constant[0] != '0' || !constant[1])
14230 type->kind = is64Bit ? 4 : 3;
14231 type->isSigned = isSigned;
14234 exp->isConstant = 0x1;
14235 if(exp->destType && exp->destType->kind == 7)
14237 else if(exp->destType && exp->destType->kind == 6)
14239 else if(exp->destType && exp->destType->kind == 4)
14246 exp->isConstant = 0x1;
14247 exp->expType = __extension__ ({
14248 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14250 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14251 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14253 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14254 }), __ecereInstance2;
14260 ProcessExpressionType(exp->_new.size);
14261 exp->expType = __extension__ ({
14262 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14264 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14266 DeclareType(exp->expType->type, 0x0, 0x0);
14270 ProcessExpressionType(exp->_renew.size);
14271 ProcessExpressionType(exp->_renew.exp);
14272 exp->expType = __extension__ ({
14273 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14275 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14277 DeclareType(exp->expType->type, 0x0, 0x0);
14281 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14282 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14283 unsigned int useDestType = 0x0, useSideType = 0x0;
14284 struct Location oldyylloc = yylloc;
14285 unsigned int useSideUnit = 0x0;
14286 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
14287 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14350 if(exp->op.op == '&')
14352 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14354 struct Identifier * id = exp->op.exp2->identifier;
14355 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14357 if(symbol && symbol->isIterator == 2)
14360 exp->member.exp = exp->op.exp2;
14361 exp->member.member = MkIdentifier("key");
14362 exp->expType = (((void *)0));
14363 exp->op.exp2->expType = symbol->type;
14364 symbol->type->refCount++;
14365 ProcessExpressionType(exp);
14373 if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14375 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14377 if(exp->op.exp1->destType)
14378 FreeType(exp->op.exp1->destType);
14379 exp->op.exp1->destType = exp->destType;
14380 exp->op.exp1->opDestType = 0x1;
14382 exp->destType->refCount++;
14386 if(exp->op.exp1->destType)
14387 FreeType(exp->op.exp1->destType);
14388 exp->op.exp1->destType = dummy;
14391 if(exp->op.exp1->destType && exp->op.op != '=')
14392 exp->op.exp1->destType->count++;
14393 ProcessExpressionType(exp->op.exp1);
14394 if(exp->op.exp1->destType && exp->op.op != '=')
14395 exp->op.exp1->destType->count--;
14396 exp->op.exp1->opDestType = 0x0;
14397 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)
14399 exp->op.exp2 = MkExpConstant("1");
14400 exp->op.op = exp->op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14403 if(exp->op.exp1->destType == dummy)
14406 exp->op.exp1->destType = (((void *)0));
14408 type1 = exp->op.exp1->expType;
14412 char expString[10240];
14414 expString[0] = '\0';
14415 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14419 exp->op.exp2->destType = exp->op.exp1->expType;
14420 if(exp->op.exp1->expType)
14421 exp->op.exp1->expType->refCount++;
14425 exp->op.exp2->destType = exp->destType;
14426 if(!exp->op.exp1 || exp->op.op != '&')
14427 exp->op.exp2->opDestType = 0x1;
14429 exp->destType->refCount++;
14433 exp->expType = type1;
14438 PrintExpression(exp->op.exp2, expString);
14439 if(type1 && type1->kind == 13)
14441 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)
14442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14443 else if(exp->op.op == '=')
14445 if(exp->op.exp2->destType)
14446 FreeType(exp->op.exp2->destType);
14447 exp->op.exp2->destType = type1;
14454 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)
14458 if(exp->op.exp2->destType)
14459 FreeType(exp->op.exp2->destType);
14460 exp->op.exp2->destType = type1;
14467 exp->expType = type1;
14469 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14471 if(exp->op.exp2->destType)
14472 FreeType(exp->op.exp2->destType);
14473 exp->op.exp2->destType = exp->destType;
14474 if(exp->op.op != '&')
14475 exp->op.exp2->opDestType = 0x1;
14477 exp->destType->refCount++;
14481 if(exp->op.exp2->destType)
14482 FreeType(exp->op.exp2->destType);
14483 exp->op.exp2->destType = dummy;
14486 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14488 FreeType(exp->op.exp2->destType);
14489 exp->op.exp2->destType = type1;
14492 if(exp->op.exp2->destType && exp->op.op != '=')
14493 exp->op.exp2->destType->count++;
14494 if(exp->op.op == SIZEOF)
14496 struct Expression * e = exp->op.exp2;
14498 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14500 if(e->type == 5 || e->type == 32 || e->type == 23)
14503 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14505 e = (*e->list).last;
14508 if(e->type == 11 && e->cast.exp)
14509 e->cast.exp->needCast = 0x1;
14511 ProcessExpressionType(exp->op.exp2);
14512 exp->op.exp2->opDestType = 0x0;
14513 if(exp->op.exp2->destType && exp->op.op != '=')
14514 exp->op.exp2->destType->count--;
14515 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14517 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)
14519 if(exp->op.op != '=' && type1->type->kind == 0)
14520 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14522 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)))
14524 if(exp->op.op == ADD_ASSIGN)
14525 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14527 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))
14529 if(exp->op.op == ADD_ASSIGN)
14530 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14532 else if(inCompiler)
14534 char type1String[1024];
14535 char type2String[1024];
14537 type1String[0] = '\0';
14538 type2String[0] = '\0';
14539 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14540 PrintType(type1, type2String, 0x0, 0x1);
14541 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14542 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14545 if(exp->op.exp2->destType == dummy)
14548 exp->op.exp2->destType = (((void *)0));
14550 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14552 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14553 type2->refCount = 1;
14554 CopyTypeInto(type2, exp->op.exp2->expType);
14555 type2->isSigned = 0x1;
14557 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14559 type2 = __extension__ ({
14560 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14562 __ecereInstance1->kind = 3, __ecereInstance1;
14564 type2->refCount = 1;
14565 type2->isSigned = 0x1;
14569 type2 = exp->op.exp2->expType;
14575 if(exp->op.op == SIZEOF)
14577 exp->expType = __extension__ ({
14578 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14580 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
14582 exp->isConstant = 0x1;
14584 else if(exp->op.op == '*' && !exp->op.exp1)
14586 exp->expType = Dereference(type2);
14587 if(type2 && type2->kind == 8)
14588 notByReference = 0x1;
14590 else if(exp->op.op == '&' && !exp->op.exp1)
14591 exp->expType = Reference(type2);
14598 if(exp->op.exp1->destType)
14599 FreeType(exp->op.exp1->destType);
14600 exp->op.exp1->destType = MkClassType("bool");
14601 exp->op.exp1->destType->truth = 0x1;
14602 if(!exp->op.exp1->expType)
14603 ProcessExpressionType(exp->op.exp1);
14605 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14606 FreeType(exp->op.exp1->expType);
14607 exp->op.exp1->expType = MkClassType("bool");
14608 exp->op.exp1->expType->truth = 0x1;
14612 if(exp->op.exp2->destType)
14613 FreeType(exp->op.exp2->destType);
14614 exp->op.exp2->destType = MkClassType("bool");
14615 exp->op.exp2->destType->truth = 0x1;
14616 if(!exp->op.exp2->expType)
14617 ProcessExpressionType(exp->op.exp2);
14619 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14620 FreeType(exp->op.exp2->expType);
14621 exp->op.exp2->expType = MkClassType("bool");
14622 exp->op.exp2->expType->truth = 0x1;
14625 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")))))
14627 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14629 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)))
14631 struct Type * intType;
14633 if(!type1->_class->registered->dataType)
14634 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14635 if(!type2->_class->registered->dataType)
14636 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14637 intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14638 if(exp->op.exp1->destType)
14639 FreeType(exp->op.exp1->destType);
14640 if(exp->op.exp2->destType)
14641 FreeType(exp->op.exp2->destType);
14642 exp->op.exp1->destType = intType;
14643 exp->op.exp2->destType = intType;
14644 intType->refCount++;
14648 if(exp->op.exp2->destType)
14649 FreeType(exp->op.exp2->destType);
14650 exp->op.exp2->destType = type1;
14652 if(exp->op.exp1->destType)
14653 FreeType(exp->op.exp1->destType);
14654 exp->op.exp1->destType = type2;
14657 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)
14658 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);
14659 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14661 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14665 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14667 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14668 ProcessExpressionType(exp->op.exp1);
14669 if(type2->kind != 13)
14671 ProcessExpressionType(classExp);
14672 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"))))))));
14673 if(!exp->op.exp2->expType)
14677 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14680 ProcessExpressionType(exp->op.exp2);
14684 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)))
14686 if(type1->kind != 8 && type1->type->kind == 0)
14687 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14688 exp->expType = type1;
14692 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)))
14694 if(type2->kind != 8 && type2->type->kind == 0)
14695 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14696 exp->expType = type2;
14700 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))
14702 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14706 unsigned int success = 0x0;
14708 if(type1->kind == 13 && type2->kind == 13)
14710 if(exp->op.op == '+')
14711 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14712 else if(exp->op.op == '-')
14714 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14716 exp->expType = __extension__ ({
14717 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14719 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14722 if(type1->type->kind == 20)
14724 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14728 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14730 ProcessExpressionType(classExp);
14732 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")))))));
14733 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14741 if(!success && exp->op.exp1->type == 2)
14743 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14746 FreeType(exp->expType);
14747 exp->expType = exp->op.exp1->destType;
14748 if(exp->op.exp1->destType)
14749 exp->op.exp1->destType->refCount++;
14752 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14755 FreeType(exp->expType);
14756 exp->expType = exp->op.exp2->destType;
14757 if(exp->op.exp2->destType)
14758 exp->op.exp2->destType->refCount++;
14764 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14767 FreeType(exp->expType);
14768 exp->expType = exp->op.exp2->destType;
14769 if(exp->op.exp2->destType)
14770 exp->op.exp2->destType->refCount++;
14773 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14776 FreeType(exp->expType);
14777 exp->expType = exp->op.exp1->destType;
14778 if(exp->op.exp1->destType)
14779 exp->op.exp1->destType->refCount++;
14785 char expString1[10240];
14786 char expString2[10240];
14790 expString1[0] = '\0';
14791 expString2[0] = '\0';
14796 PrintExpression(exp->op.exp1, expString1);
14797 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14798 PrintExpression(exp->op.exp2, expString2);
14799 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14800 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14801 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14803 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14807 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14809 if(exp->op.exp1->destType)
14810 FreeType(exp->op.exp1->destType);
14811 exp->op.exp1->destType = type2->_class->registered->dataType;
14812 if(type2->_class->registered->dataType)
14813 type2->_class->registered->dataType->refCount++;
14814 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14815 exp->expType = type2;
14819 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14821 if(exp->op.exp2->destType)
14822 FreeType(exp->op.exp2->destType);
14823 exp->op.exp2->destType = type1->_class->registered->dataType;
14824 if(type1->_class->registered->dataType)
14825 type1->_class->registered->dataType->refCount++;
14826 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14827 exp->expType = type1;
14833 unsigned int valid = 0x0;
14835 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14837 if(exp->op.exp2->destType)
14838 FreeType(exp->op.exp2->destType);
14839 if(!type1->_class->registered->dataType)
14840 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14841 exp->op.exp2->destType = type1->_class->registered->dataType;
14842 exp->op.exp2->destType->refCount++;
14843 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14846 type2 = exp->op.exp2->destType;
14849 exp->expType = type2;
14852 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14854 if(exp->op.exp1->destType)
14855 FreeType(exp->op.exp1->destType);
14856 if(!type2->_class->registered->dataType)
14857 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14858 exp->op.exp1->destType = type2->_class->registered->dataType;
14859 exp->op.exp1->destType->refCount++;
14860 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14861 type1 = exp->op.exp1->destType;
14862 exp->expType = type1;
14865 if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
14867 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
14868 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
14870 if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
14872 if(op1IsEnum && exp->op.exp2->expType)
14874 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14877 FreeType(exp->expType);
14878 exp->expType = exp->op.exp2->expType;
14879 if(exp->op.exp2->expType)
14880 exp->op.exp2->expType->refCount++;
14884 else if(op2IsEnum && exp->op.exp1->expType)
14886 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14889 FreeType(exp->expType);
14890 exp->expType = exp->op.exp1->expType;
14891 if(exp->op.exp1->expType)
14892 exp->op.exp1->expType->refCount++;
14899 if(op1IsEnum && exp->op.exp2->expType)
14901 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14904 FreeType(exp->expType);
14905 exp->expType = exp->op.exp1->expType;
14906 if(exp->op.exp1->expType)
14907 exp->op.exp1->expType->refCount++;
14911 else if(op2IsEnum && exp->op.exp1->expType)
14913 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14916 FreeType(exp->expType);
14917 exp->expType = exp->op.exp2->expType;
14918 if(exp->op.exp2->expType)
14919 exp->op.exp2->expType->refCount++;
14927 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))
14929 if(exp->op.exp1->destType)
14930 FreeType(exp->op.exp1->destType);
14931 exp->op.exp1->destType = type2;
14933 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14936 FreeType(exp->expType);
14937 exp->expType = exp->op.exp1->destType;
14938 if(exp->op.exp1->destType)
14939 exp->op.exp1->destType->refCount++;
14944 if(exp->op.exp2->destType)
14945 FreeType(exp->op.exp2->destType);
14946 exp->op.exp2->destType = type1;
14948 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14951 FreeType(exp->expType);
14952 exp->expType = exp->op.exp2->destType;
14953 if(exp->op.exp2->destType)
14954 exp->op.exp2->destType->refCount++;
14956 else if(type1 && type2)
14958 char expString1[10240];
14959 char expString2[10240];
14960 char type1String[1024];
14961 char type2String[1024];
14963 expString1[0] = '\0';
14964 expString2[0] = '\0';
14965 type1String[0] = '\0';
14966 type2String[0] = '\0';
14969 PrintExpression(exp->op.exp1, expString1);
14970 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14971 PrintExpression(exp->op.exp2, expString2);
14972 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14973 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14974 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14976 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14977 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14979 exp->expType = exp->op.exp1->expType;
14980 if(exp->op.exp1->expType)
14981 exp->op.exp1->expType->refCount++;
14983 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14985 exp->expType = exp->op.exp2->expType;
14986 if(exp->op.exp2->expType)
14987 exp->op.exp2->expType->refCount++;
14995 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14997 struct Type * oldType = exp->op.exp1->expType;
14999 exp->op.exp1->expType = (((void *)0));
15000 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
15003 exp->op.exp1->expType = oldType;
15005 if(exp->op.exp1->destType)
15006 FreeType(exp->op.exp1->destType);
15007 exp->op.exp1->destType = type2;
15009 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
15012 FreeType(exp->expType);
15013 exp->expType = exp->op.exp1->destType;
15014 if(exp->op.exp1->destType)
15015 exp->op.exp1->destType->refCount++;
15019 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15021 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
15023 if(exp->op.exp1->destType)
15024 FreeType(exp->op.exp1->destType);
15025 exp->op.exp1->destType = type2->_class->registered->dataType;
15026 if(type2->_class->registered->dataType)
15027 type2->_class->registered->dataType->refCount++;
15028 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
15030 if(exp->op.op == '!')
15032 exp->expType = MkClassType("bool");
15033 exp->expType->truth = 0x1;
15037 exp->expType = type2;
15042 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15044 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
15046 if(exp->op.exp2->destType)
15047 FreeType(exp->op.exp2->destType);
15048 exp->op.exp2->destType = type1->_class->registered->dataType;
15049 if(type1->_class->registered->dataType)
15050 type1->_class->registered->dataType->refCount++;
15051 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
15053 exp->expType = type1;
15059 if(exp->op.exp1 && !exp->op.exp1->expType)
15061 char expString[10000];
15063 expString[0] = '\0';
15066 PrintExpression(exp->op.exp1, expString);
15067 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15070 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15072 if(exp->op.exp2 && !exp->op.exp2->expType)
15074 char expString[10240];
15076 expString[0] = '\0';
15079 PrintExpression(exp->op.exp2, expString);
15080 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15083 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15087 FreeType(exp->expType);
15088 exp->expType = MkClassType("bool");
15089 exp->expType->truth = 0x1;
15091 if(exp->op.op != SIZEOF)
15092 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
15093 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
15095 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
15097 yylloc = oldyylloc;
15106 struct Expression * e;
15108 exp->isConstant = 0x1;
15109 for(e = (*exp->list).first; e; e = e->next)
15111 unsigned int inced = 0x0;
15115 FreeType(e->destType);
15116 e->opDestType = exp->opDestType;
15117 e->destType = exp->destType;
15120 exp->destType->refCount++;
15121 e->destType->count++;
15125 ProcessExpressionType(e);
15127 exp->destType->count--;
15128 if(!exp->expType && !e->next)
15130 exp->expType = e->expType;
15132 e->expType->refCount++;
15135 exp->isConstant = 0x0;
15137 e = (*exp->list).first;
15138 if(!e->next && e->type == 8)
15140 struct Expression * next = exp->next, * prev = exp->prev;
15142 FreeType(exp->expType);
15143 FreeType(exp->destType);
15144 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
15148 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15149 ProcessExpressionType(exp);
15155 struct Expression * e;
15157 exp->isConstant = 0x1;
15158 ProcessExpressionType(exp->index.exp);
15159 if(!exp->index.exp->isConstant)
15160 exp->isConstant = 0x0;
15161 if(exp->index.exp->expType)
15163 struct Type * source = exp->index.exp->expType;
15165 if(source->kind == 8 && source->_class && source->_class->registered)
15167 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15168 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15170 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15172 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15173 if(exp->index.index && (*exp->index.index).last)
15175 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15180 for(e = (*exp->index.index).first; e; e = e->next)
15182 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15185 FreeType(e->destType);
15186 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15188 ProcessExpressionType(e);
15193 exp->isConstant = 0x0;
15196 exp->expType = Dereference(exp->index.exp->expType);
15198 DeclareType(exp->expType, 0x0, 0x0);
15203 struct Expression * e;
15204 struct Type * functionType;
15205 struct Type * methodType = (((void *)0));
15211 PrintExpression(exp->call.exp, name);
15212 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15214 PrintExpression(exp->call.exp, name);
15217 if(exp->call.exp->type == 0)
15219 struct Expression * idExp = exp->call.exp;
15220 struct Identifier * id = idExp->identifier;
15222 if(!strcmp(id->string, "__builtin_frame_address"))
15224 exp->expType = ProcessTypeString("void *", 0x1);
15225 if(exp->call.arguments && (*exp->call.arguments).first)
15226 ProcessExpressionType((*exp->call.arguments).first);
15229 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15231 exp->expType = ProcessTypeString("int", 0x1);
15232 if(exp->call.arguments && (*exp->call.arguments).first)
15233 ProcessExpressionType((*exp->call.arguments).first);
15236 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15238 struct Expression * a = (((void *)0));
15239 struct Expression * b = (((void *)0));
15240 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15242 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15244 a = (*exp->call.arguments).first;
15245 b = (*exp->call.arguments).last;
15249 else if((*exp->call.arguments).count == 1)
15251 a = (*exp->call.arguments).first;
15256 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15257 idExp->identifier = (((void *)0));
15258 FreeExpContents(exp);
15259 ProcessExpressionType(a);
15261 ProcessExpressionType(b);
15263 exp->list = MkList();
15264 if(a->expType && (!b || b->expType))
15266 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15270 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15271 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15272 struct Declaration * decl;
15273 char temp1[1024], temp2[1024];
15275 GetTypeSpecs(a->expType, specs);
15276 if(a && !a->isConstant && a->type != 0)
15278 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15279 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15280 tempExp1 = QMkExpId(temp1);
15281 tempExp1->expType = a->expType;
15283 a->expType->refCount++;
15284 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15286 if(b && !b->isConstant && b->type != 0)
15288 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15289 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15290 tempExp2 = QMkExpId(temp2);
15291 tempExp2->expType = b->expType;
15293 b->expType->refCount++;
15294 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15296 decl = MkDeclaration(specs, decls);
15297 if(!curCompound->compound.declarations)
15298 curCompound->compound.declarations = MkList();
15299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15303 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15305 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15307 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15308 exp->expType = a->expType;
15310 a->expType->refCount++;
15312 else if(!strcmp(id->string, "Abs"))
15314 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15315 exp->expType = a->expType;
15317 a->expType->refCount++;
15319 else if(!strcmp(id->string, "Sgn"))
15321 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"))))));
15322 exp->expType = ProcessTypeString("int", 0x0);
15324 FreeExpression(tempExp1);
15326 FreeExpression(tempExp2);
15327 FreeIdentifier(id);
15333 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15335 if(!exp->call.exp->destType)
15337 exp->call.exp->destType = dummy;
15340 ProcessExpressionType(exp->call.exp);
15341 if(exp->call.exp->destType == dummy)
15344 exp->call.exp->destType = (((void *)0));
15348 functionType = exp->call.exp->expType;
15349 if(functionType && functionType->kind == 16)
15351 methodType = functionType;
15352 functionType = methodType->method->dataType;
15353 if(exp->call.exp->expType->usedClass)
15355 char typeString[1024];
15357 typeString[0] = '\0';
15359 struct Symbol * back = functionType->thisClass;
15361 functionType->thisClass = (((void *)0));
15362 PrintType(functionType, typeString, 0x1, 0x1);
15363 functionType->thisClass = back;
15365 if(strstr(typeString, "thisclass"))
15367 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15368 struct Declarator * decl;
15371 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15373 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15374 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15375 thisClassParams = 0x0;
15376 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15378 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15380 thisClass = exp->call.exp->expType->usedClass;
15381 ProcessDeclarator(decl);
15382 thisClass = backupThisClass;
15384 thisClassParams = 0x1;
15385 functionType = ProcessType(specs, decl);
15386 functionType->refCount = 0;
15387 FinishTemplatesContext(context);
15389 FreeList(specs, FreeSpecifier);
15390 FreeDeclarator(decl);
15394 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15396 struct Type * type = functionType->type;
15398 if(!functionType->refCount)
15400 functionType->type = (((void *)0));
15401 FreeType(functionType);
15403 functionType = type;
15405 if(functionType && functionType->kind != 11)
15407 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15409 else if(functionType)
15411 unsigned int emptyParams = 0x0, noParams = 0x0;
15412 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15413 struct Type * type = functionType->params.first;
15414 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15416 struct Location oldyylloc = yylloc;
15420 if(functionType->extraParam && e && functionType->thisClass)
15422 e->destType = MkClassType(functionType->thisClass->string);
15425 if(!functionType->staticMethod && !functionType->extraParam)
15427 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15429 type = MkClassType(memberExp->member.exp->expType->_class->string);
15432 e->destType = type;
15434 type = functionType->params.first;
15437 type->refCount = 0;
15439 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15441 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15442 type->byReference = functionType->byReference;
15443 type->typedByReference = functionType->typedByReference;
15446 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15448 e->destType = type;
15450 type = functionType->params.first;
15453 type->refCount = 0;
15456 if(type && type->kind == 0)
15459 if(!type->refCount)
15461 type = (((void *)0));
15463 for(; e; e = e->next)
15465 if(!type && !emptyParams)
15468 if(methodType && methodType->methodClass)
15469 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);
15471 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);
15474 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15476 struct Type * templatedType = (((void *)0));
15477 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15478 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15481 if(_class && _class->templateArgs)
15483 struct __ecereNameSpace__ecere__com__Class * sClass;
15485 for(sClass = _class; sClass; sClass = sClass->base)
15487 if(sClass->templateClass)
15488 sClass = sClass->templateClass;
15490 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15492 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15494 struct __ecereNameSpace__ecere__com__Class * nextClass;
15496 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15498 if(nextClass->templateClass)
15499 nextClass = nextClass->templateClass;
15500 id += nextClass->templateParams.count;
15510 if(curParam && _class->templateArgs[id].dataTypeString)
15512 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15515 struct Context * context = SetupTemplatesContext(_class);
15517 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15518 FinishTemplatesContext(context);
15520 e->destType = templatedType;
15523 templatedType->passAsTemplate = 0x1;
15528 e->destType = type;
15535 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15537 e->destType = type->prev;
15538 e->destType->refCount++;
15542 e->destType = type;
15547 if(type && type->kind != 14)
15549 struct Type * next = type->next;
15551 if(!type->refCount)
15556 if(type && type->kind != 14)
15558 if(methodType && methodType->methodClass)
15559 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);
15561 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);
15563 yylloc = oldyylloc;
15564 if(type && !type->refCount)
15569 functionType = __extension__ ({
15570 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15572 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15574 if(exp->call.exp->type == 0)
15576 char * string = exp->call.exp->identifier->string;
15580 struct Symbol * symbol;
15581 struct Location oldyylloc = yylloc;
15583 yylloc = exp->call.exp->identifier->loc;
15584 if(strstr(string, "__builtin_") == string)
15588 functionType->returnType = exp->destType;
15589 exp->destType->refCount++;
15593 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15594 symbol = __extension__ ({
15595 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15597 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15599 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15600 if(strstr(symbol->string, "::"))
15601 globalContext->hasNameSpace = 0x1;
15602 yylloc = oldyylloc;
15605 else if(exp->call.exp->type == 8)
15609 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15610 if(!functionType->returnType)
15612 functionType->returnType = __extension__ ({
15613 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15615 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15619 if(functionType && functionType->kind == 11)
15621 exp->expType = functionType->returnType;
15622 if(functionType->returnType)
15623 functionType->returnType->refCount++;
15624 if(!functionType->refCount)
15625 FreeType(functionType);
15627 if(exp->call.arguments)
15629 for(e = (*exp->call.arguments).first; e; e = e->next)
15631 struct Type * destType = e->destType;
15633 ProcessExpressionType(e);
15640 struct Type * type;
15641 struct Location oldyylloc = yylloc;
15642 unsigned int thisPtr;
15643 struct Expression * checkExp = exp->member.exp;
15647 if(checkExp->type == 11)
15648 checkExp = checkExp->cast.exp;
15649 else if(checkExp->type == 5)
15650 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15654 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15655 exp->thisPtr = thisPtr;
15656 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15658 exp->member.member->classSym = exp->member.member->_class->symbol;
15660 ProcessExpressionType(exp->member.exp);
15661 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)
15663 exp->isConstant = 0x0;
15666 exp->isConstant = exp->member.exp->isConstant;
15667 type = exp->member.exp->expType;
15669 if(type && (type->kind == 20))
15671 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15672 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15676 for(param = _class->templateParams.first; param; param = param->next)
15678 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15682 if(param && param->defaultArg.member)
15684 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15688 struct Expression * expMember = exp->member.exp;
15689 struct Declarator * decl;
15690 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15691 char thisClassTypeString[1024];
15693 FreeIdentifier(exp->member.member);
15694 ProcessExpressionType(argExp);
15696 char * colon = strstr(param->defaultArg.memberString, "::");
15700 char className[1024];
15701 struct __ecereNameSpace__ecere__com__Class * sClass;
15703 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15704 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15707 strcpy(thisClassTypeString, _class->fullName);
15709 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15710 exp->expType = ProcessType(specs, decl);
15711 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15713 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15714 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15716 int paramCount = 0;
15717 int lastParam = -1;
15718 char templateString[1024];
15719 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15721 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15722 for(cClass = expClass; cClass; cClass = cClass->base)
15726 for(param = cClass->templateParams.first; param; param = param->next)
15729 struct __ecereNameSpace__ecere__com__Class * sClass;
15730 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15732 for(sClass = cClass->base; sClass; sClass = sClass->base)
15733 id += sClass->templateParams.count;
15734 arg = expClass->templateArgs[id];
15735 for(sClass = _class; sClass; sClass = sClass->base)
15737 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15739 struct __ecereNameSpace__ecere__com__Class * nextClass;
15741 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15742 p += nextClass->templateParams.count;
15743 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15745 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15747 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15749 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15750 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15757 char argument[256];
15759 argument[0] = '\0';
15760 switch(param->type)
15764 char expString[1024];
15765 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15766 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15767 struct Expression * exp;
15768 char * string = PrintHexUInt64(arg.expression.ui64);
15770 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15771 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15772 ProcessExpressionType(exp);
15773 ComputeExpression(exp);
15774 expString[0] = '\0';
15775 PrintExpression(exp, expString);
15776 strcat(argument, expString);
15777 FreeExpression(exp);
15782 strcat(argument, arg.member->name);
15787 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15789 if(!strcmp(arg.dataTypeString, "thisclass"))
15790 strcat(argument, thisClassTypeString);
15792 strcat(argument, arg.dataTypeString);
15800 strcat(templateString, ", ");
15801 if(lastParam != p - 1)
15803 strcat(templateString, param->name);
15804 strcat(templateString, " = ");
15806 strcat(templateString, argument);
15815 int len = strlen(templateString);
15817 if(templateString[len - 1] == '>')
15818 templateString[len++] = ' ';
15819 templateString[len++] = '>';
15820 templateString[len++] = '\0';
15823 struct Context * context = SetupTemplatesContext(_class);
15825 FreeType(exp->expType);
15826 exp->expType = ProcessTypeString(templateString, 0x0);
15827 FinishTemplatesContext(context);
15831 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")))))))));
15834 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15836 type = ProcessTemplateParameterType(type->templateParameter);
15839 if(type && (type->kind == 20))
15841 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)))
15843 struct Identifier * id = exp->member.member;
15844 int typeKind = type->kind;
15845 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));
15847 if(typeKind == 19 && exp->member.exp->type == 24)
15849 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15854 if(typeKind == 3 || typeKind == 15)
15855 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15858 if(type->kind == 8 && type->_class && type->_class->registered)
15860 _class = type->_class->registered;
15862 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15864 _class = FindClass("char *")->registered;
15866 else if(type->kind == 13)
15868 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15869 FreeType(exp->expType);
15870 exp->expType = ProcessTypeString("uintptr", 0x0);
15871 exp->byReference = 0x1;
15875 char string[1024] = "";
15876 struct Symbol * classSym;
15878 PrintTypeNoConst(type, string, 0x0, 0x1);
15879 classSym = FindClass(string);
15881 _class = classSym->registered;
15887 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15888 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15889 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15890 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15891 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15893 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15894 exp->member.memberType = 1;
15895 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15896 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15899 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15901 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15902 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15904 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15906 member = (((void *)0));
15908 if(!member && !prop)
15909 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15910 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15911 exp->member.thisPtr = 0x1;
15917 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15918 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15919 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15921 if(!prop && !member)
15923 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15926 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15927 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15928 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15933 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15934 prop = (((void *)0));
15936 member = (((void *)0));
15940 if(!prop && !member && !method)
15941 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15942 if(!prop && !member && !method)
15946 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15949 exp->member.memberType = 5;
15950 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15954 char structName[1024];
15955 struct Identifier * id = exp->member.member;
15956 struct Expression * classExp = exp->member.exp;
15959 FreeType(classExp->expType);
15960 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15961 strcpy(structName, "__ecereClassData_");
15962 FullClassNameCat(structName, type->_class->string, 0x0);
15964 exp->member.member = id;
15965 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"))))))));
15967 ProcessExpressionType(exp);
15973 struct Symbol * classSym = FindClass(id->string);
15977 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15980 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15986 exp->member.memberType = 1;
15987 if(!prop->dataType)
15988 ProcessPropertyType(prop);
15989 exp->expType = prop->dataType;
15991 prop->dataType->refCount++;
15995 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15997 FreeExpContents(exp);
15999 exp->identifier = MkIdentifier("class");
16000 ProcessExpressionType(exp);
16003 exp->member.memberType = 3;
16004 DeclareStruct(_class->fullName, 0x0);
16005 if(!member->dataType)
16007 struct Context * context = SetupTemplatesContext(_class);
16009 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16010 FinishTemplatesContext(context);
16012 exp->expType = member->dataType;
16013 if(member->dataType)
16014 member->dataType->refCount++;
16016 else if(revConvert)
16018 exp->member.memberType = 4;
16019 exp->expType = MkClassType(revConvert->_class->fullName);
16024 exp->member.memberType = 2;
16026 if(!method->dataType)
16027 ProcessMethodType(method);
16028 exp->expType = __extension__ ({
16029 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16031 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
16033 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
16034 exp->expType->usedClass = _class;
16036 else if(!classProp)
16038 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16040 FreeExpContents(exp);
16042 exp->identifier = MkIdentifier("class");
16043 FreeType(exp->expType);
16044 exp->expType = MkClassType("ecere::com::Class");
16047 yylloc = exp->member.member->loc;
16048 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16050 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16052 if(_class && exp->expType)
16054 struct __ecereNameSpace__ecere__com__Class * tClass;
16057 while(tClass && !tClass->templateClass)
16058 tClass = tClass->base;
16059 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
16062 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16063 struct __ecereNameSpace__ecere__com__Class * sClass;
16065 for(sClass = tClass; sClass; sClass = sClass->base)
16068 if(sClass->templateClass)
16069 sClass = sClass->templateClass;
16070 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16072 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
16074 for(sClass = sClass->base; sClass; sClass = sClass->base)
16075 id += sClass->templateParams.count;
16083 if(curParam && tClass->templateArgs[id].dataTypeString)
16085 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16086 struct Context * context = SetupTemplatesContext(tClass);
16088 FreeType(exp->expType);
16089 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
16092 if(exp->expType->kind == 21)
16094 FreeType(exp->expType);
16095 exp->expType = ReplaceThisClassType(_class);
16097 if(tClass->templateClass)
16098 exp->expType->passAsTemplate = 0x1;
16101 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
16102 if(exp->destType->kind == 21)
16104 FreeType(exp->destType);
16105 exp->destType = ReplaceThisClassType(_class);
16109 FinishTemplatesContext(context);
16112 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
16115 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16116 struct __ecereNameSpace__ecere__com__Class * sClass;
16118 for(sClass = tClass; sClass; sClass = sClass->base)
16121 if(sClass->templateClass)
16122 sClass = sClass->templateClass;
16123 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16125 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
16127 for(sClass = sClass->base; sClass; sClass = sClass->base)
16128 id += sClass->templateParams.count;
16138 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16139 struct Context * context = SetupTemplatesContext(tClass);
16140 struct Type * basicType;
16142 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
16145 if(basicType->kind == 21)
16147 FreeType(basicType);
16148 basicType = ReplaceThisClassType(_class);
16150 FreeType(exp->expType);
16151 exp->expType = __extension__ ({
16152 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16154 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
16158 exp->destType = exp->expType;
16159 exp->destType->refCount++;
16162 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16163 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16164 struct Declarator * decl;
16166 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16169 exp->destType->refCount++;
16171 exp->expType->refCount++;
16173 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16174 exp->cast.exp = newExp;
16177 FinishTemplatesContext(context);
16180 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16182 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16186 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16189 int paramCount = 0;
16190 int lastParam = -1;
16191 char templateString[1024];
16192 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16194 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16195 while(cClass != expClass)
16197 struct __ecereNameSpace__ecere__com__Class * sClass;
16199 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16202 for(param = cClass->templateParams.first; param; param = param->next)
16204 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16207 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16208 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16210 while(cClassCur != tClass && !paramCur)
16212 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16214 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16216 cClassCur = sClassCur;
16217 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16219 if(!strcmp(paramCur->name, param->name))
16226 if(paramCur && paramCur->type == 0)
16227 arg = tClass->templateArgs[cp];
16229 arg = expClass->templateArgs[p];
16231 char argument[256];
16233 argument[0] = '\0';
16234 switch(param->type)
16238 char expString[1024];
16239 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16240 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16241 struct Expression * exp;
16242 char * string = PrintHexUInt64(arg.expression.ui64);
16244 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16245 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16246 ProcessExpressionType(exp);
16247 ComputeExpression(exp);
16248 expString[0] = '\0';
16249 PrintExpression(exp, expString);
16250 strcat(argument, expString);
16251 FreeExpression(exp);
16256 strcat(argument, arg.member->name);
16261 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16262 strcat(argument, arg.dataTypeString);
16269 strcat(templateString, ", ");
16270 if(lastParam != p - 1)
16272 strcat(templateString, param->name);
16273 strcat(templateString, " = ");
16275 strcat(templateString, argument);
16284 int len = strlen(templateString);
16286 if(templateString[len - 1] == '>')
16287 templateString[len++] = ' ';
16288 templateString[len++] = '>';
16289 templateString[len++] = '\0';
16291 FreeType(exp->expType);
16293 struct Context * context = SetupTemplatesContext(tClass);
16295 exp->expType = ProcessTypeString(templateString, 0x0);
16296 FinishTemplatesContext(context);
16303 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)");
16305 else if(type && (type->kind == 9 || type->kind == 10))
16307 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16311 exp->expType = memberType;
16313 memberType->refCount++;
16318 char expString[10240];
16320 expString[0] = '\0';
16323 PrintExpression(exp, expString);
16324 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16328 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16330 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16332 struct Identifier * id = exp->member.member;
16333 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));
16337 FreeType(exp->expType);
16338 exp->expType = ReplaceThisClassType(_class);
16342 yylloc = oldyylloc;
16347 struct Type * destType = exp->destType;
16349 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16351 exp->member.member->classSym = exp->member.member->_class->symbol;
16353 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16357 ProcessExpressionType(exp);
16364 struct Symbol * classSym = exp->_class->symbol;
16366 if(classSym && classSym->registered)
16368 if(classSym->registered->type == 5)
16373 DeclareStruct(classSym->string, 0x0);
16374 FreeSpecifier(exp->_class);
16376 FullClassNameCat(name, classSym->string, 0x0);
16377 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16381 if(classSym->registered->fixed)
16383 FreeSpecifier(exp->_class);
16384 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16389 char className[1024];
16391 strcpy(className, "__ecereClass_");
16392 FullClassNameCat(className, classSym->string, 0x1);
16393 MangleClassName(className);
16394 DeclareClass(classSym, className);
16395 FreeExpContents(exp);
16397 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16398 exp->member.member = MkIdentifier("structSize");
16402 exp->expType = __extension__ ({
16403 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16405 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16411 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16413 exp->expType = __extension__ ({
16414 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16416 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 23, __ecereInstance1;
16418 exp->isConstant = 0x1;
16419 DeclareType(type, 0x0, 0x0);
16425 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16428 FreeType(exp->cast.exp->destType);
16429 exp->cast.exp->destType = type;
16431 ProcessExpressionType(exp->cast.exp);
16433 exp->expType = type;
16434 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16436 void * prev = exp->prev, * next = exp->next;
16437 struct Type * expType = exp->cast.exp->destType;
16438 struct Expression * castExp = exp->cast.exp;
16439 struct Type * destType = exp->destType;
16442 expType->refCount++;
16443 FreeType(exp->expType);
16444 FreeTypeName(exp->cast.typeName);
16446 FreeType(exp->expType);
16447 FreeType(exp->destType);
16448 exp->expType = expType;
16449 exp->destType = destType;
16450 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16456 exp->isConstant = exp->cast.exp->isConstant;
16462 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16464 exp->expType = type;
16469 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16471 ProcessExpressionType(exp->vaArg.exp);
16472 exp->expType = type;
16477 struct Expression * e;
16479 exp->isConstant = 0x1;
16480 FreeType(exp->cond.cond->destType);
16481 exp->cond.cond->destType = MkClassType("bool");
16482 exp->cond.cond->destType->truth = 0x1;
16483 ProcessExpressionType(exp->cond.cond);
16484 if(!exp->cond.cond->isConstant)
16485 exp->isConstant = 0x0;
16486 for(e = (*exp->cond.exp).first; e; e = e->next)
16490 FreeType(e->destType);
16491 e->destType = exp->destType;
16493 e->destType->refCount++;
16495 ProcessExpressionType(e);
16498 exp->expType = e->expType;
16500 e->expType->refCount++;
16503 exp->isConstant = 0x0;
16505 FreeType(exp->cond.elseExp->destType);
16506 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16507 if(exp->cond.elseExp->destType)
16508 exp->cond.elseExp->destType->refCount++;
16509 ProcessExpressionType(exp->cond.elseExp);
16510 if(!exp->cond.elseExp->isConstant)
16511 exp->isConstant = 0x0;
16516 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16518 struct Statement * last = (*exp->compound->compound.statements).last;
16520 if(last->type == 3 && last->expressions && (*last->expressions).last)
16522 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16524 exp->destType->refCount++;
16526 ProcessStatement(exp->compound);
16527 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16529 exp->expType->refCount++;
16535 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16537 if(spec && spec->type == 1)
16539 exp->expType = MkClassType(spec->name);
16540 exp->expType->kind = 19;
16541 exp->byReference = 0x1;
16545 exp->expType = MkClassType("ecere::com::Class");
16546 exp->byReference = 0x1;
16552 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16556 struct Identifier * id = exp->classData.id;
16557 char structName[1024];
16558 struct Expression * classExp;
16560 strcpy(structName, "__ecereClassData_");
16561 FullClassNameCat(structName, _class->fullName, 0x0);
16563 exp->member.member = id;
16564 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16565 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16567 classExp = MkExpIdentifier(MkIdentifier("class"));
16568 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"))))))));
16569 ProcessExpressionType(exp);
16576 struct Type * type = (((void *)0));
16577 char * typeString = (((void *)0));
16578 char typeStringBuf[1024];
16580 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))
16582 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16584 typeString = templateClass->templateArgs[2].dataTypeString;
16588 struct Expression * e;
16590 for(e = (*exp->list).first; e; e = e->next)
16592 ProcessExpressionType(e);
16602 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16606 e->expType = (((void *)0));
16607 e = (*exp->list).first;
16608 ProcessExpressionType(e);
16611 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16613 FreeType(e->expType);
16614 e->expType = (((void *)0));
16616 type = (((void *)0));
16624 FreeType(e->expType);
16625 e->expType = (((void *)0));
16631 typeStringBuf[0] = '\0';
16632 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16633 typeString = typeStringBuf;
16635 type = (((void *)0));
16640 char templateString[1024];
16641 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16642 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16643 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16644 struct Expression * expExt;
16645 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16647 sprintf(templateString, "Container<%s>", typeString);
16650 struct Expression * e;
16652 type = ProcessTypeString(typeString, 0x0);
16653 while(e = (*exp->list).first)
16655 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16656 e->destType = type;
16658 ProcessExpressionType(e);
16659 ListAdd(initializers, MkInitializerAssignment(e));
16662 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16664 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16665 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16666 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16667 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16668 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16669 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16670 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16671 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16672 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16673 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16674 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16676 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16678 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16679 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16680 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16681 exp->expType = ProcessTypeString(templateString, 0x0);
16683 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16684 ProcessExpressionType(expExt);
16688 exp->expType = ProcessTypeString("Container", 0x0);
16689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16694 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16696 FreeType(exp->expType);
16697 exp->expType = ReplaceThisClassType(thisClass);
16699 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16701 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16705 if(exp->expType->kind != 15)
16707 struct Type * member;
16708 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16710 FreeType(exp->expType);
16711 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16712 exp->expType->kind = symbol->type->kind;
16713 exp->expType->refCount++;
16714 exp->expType->enumName = enumName;
16715 exp->expType->members = symbol->type->members;
16716 for(member = symbol->type->members.first; member; member = member->next)
16717 member->refCount++;
16721 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16723 for(member = symbol->type->members.first; member; member = member->next)
16725 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16727 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16733 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16735 else if(exp->destType && !exp->destType->keepCast)
16737 if(!CheckExpressionType(exp, exp->destType, 0x0))
16739 if(!exp->destType->count || unresolved)
16744 if(exp->destType->kind != 14)
16751 char expString[10240];
16753 expString[0] = '\0';
16754 PrintType(exp->destType, type2, 0x0, 0x1);
16757 PrintExpression(exp, expString);
16758 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16761 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16762 else if(exp->type != 16)
16763 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16768 char expString[10240];
16770 expString[0] = '\0';
16773 PrintExpression(exp, expString);
16774 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16777 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16778 else if(exp->type != 16)
16779 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16791 PrintType(exp->expType, type1, 0x0, 0x1);
16792 PrintType(exp->destType, type2, 0x0, 0x1);
16794 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)))
16798 char expString[10240];
16800 expString[0] = '\0';
16803 PrintExpression(exp, expString);
16804 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16806 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16807 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16808 FreeType(exp->expType);
16809 exp->destType->refCount++;
16810 exp->expType = exp->destType;
16815 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16817 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16818 char typeString[1024];
16819 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16820 struct Declarator * decl;
16822 typeString[0] = '\0';
16825 exp->expType->refCount++;
16827 exp->expType->refCount++;
16829 newExp->destType = exp->expType;
16830 PrintType(exp->expType, typeString, 0x0, 0x0);
16831 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16832 exp->cast.typeName = MkTypeName(specs, decl);
16833 exp->cast.exp = newExp;
16836 else if(unresolved)
16838 if(exp->identifier->_class && exp->identifier->_class->name)
16839 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16840 else if(exp->identifier->string && exp->identifier->string[0])
16841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16843 else if(!exp->expType && exp->type != 16)
16845 char expString[10240];
16847 expString[0] = '\0';
16850 PrintExpression(exp, expString);
16851 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16853 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16856 ApplyAnyObjectLogic(exp);
16857 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)))
16859 exp->byReference = 0x1;
16861 yylloc = oldyylloc;
16864 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)
16868 *curMember = (*curMember)->next;
16869 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16871 *curMember = subMemberStack[--(*subMemberStackPos)];
16872 *curMember = (*curMember)->next;
16874 while((*curMember) && (*curMember)->isProperty)
16875 *curMember = (*curMember)->next;
16876 if(subMemberStackPos)
16878 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16880 subMemberStack[(*subMemberStackPos)++] = *curMember;
16881 *curMember = (*curMember)->members.first;
16882 while(*curMember && (*curMember)->isProperty)
16883 *curMember = (*curMember)->next;
16891 if(subMemberStackPos && *subMemberStackPos)
16893 *curMember = subMemberStack[--(*subMemberStackPos)];
16894 *curMember = (*curMember)->next;
16898 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16900 if(*curClass == _class)
16902 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16904 *curMember = (*curClass)->membersAndProperties.first;
16906 while((*curMember) && (*curMember)->isProperty)
16907 *curMember = (*curMember)->next;
16908 if(subMemberStackPos)
16910 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16912 subMemberStack[(*subMemberStackPos)++] = *curMember;
16913 *curMember = (*curMember)->members.first;
16914 while(*curMember && (*curMember)->isProperty)
16915 *curMember = (*curMember)->next;
16922 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16927 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16929 if(init->exp && !init->exp->destType)
16931 FreeType(init->exp->destType);
16932 init->exp->destType = type;
16938 ProcessExpressionType(init->exp);
16939 init->isConstant = init->exp->isConstant;
16945 struct Expression * exp = init->exp;
16946 struct Instantiation * inst = exp->instance;
16947 struct MembersInit * members;
16950 init->list = MkList();
16953 for(members = (*inst->members).first; members; members = members->next)
16955 if(members->type == 0)
16957 struct MemberInit * member;
16959 for(member = (*members->dataMembers).first; member; member = member->next)
16961 ListAdd(init->list, member->initializer);
16962 member->initializer = (((void *)0));
16967 FreeExpression(exp);
16971 struct Initializer * i;
16972 struct Type * initializerType = (((void *)0));
16973 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16974 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16975 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16976 int subMemberStackPos = 0;
16978 if(type && type->kind == 12)
16979 initializerType = Dereference(type);
16980 else if(type && (type->kind == 9 || type->kind == 10))
16981 initializerType = type->members.first;
16982 for(i = (*init->list).first; i; i = i->next)
16984 if(type && type->kind == 8 && type->_class && type->_class->registered)
16986 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16989 if(!curMember->dataType)
16990 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16991 initializerType = curMember->dataType;
16994 ProcessInitializer(i, initializerType);
16995 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16996 initializerType = initializerType->next;
16998 init->isConstant = 0x0;
17000 if(type && type->kind == 12)
17001 FreeType(initializerType);
17002 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
17004 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17011 extern struct Symbol * FindType(struct Context * ctx, char * name);
17013 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17015 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17021 if(spec->specifier == THISCLASS)
17026 spec->name = ReplaceThisClass(thisClass);
17027 spec->symbol = FindClass(spec->name);
17028 ProcessSpecifier(spec, declareStruct);
17035 struct Symbol * symbol = FindType(curContext, spec->name);
17038 DeclareType(symbol->type, 0x1, 0x1);
17039 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
17040 DeclareStruct(spec->name, 0x0);
17045 struct Enumerator * e;
17049 for(e = (*spec->list).first; e; e = e->next)
17052 ProcessExpressionType(e->exp);
17060 if(spec->definitions)
17062 struct ClassDef * def;
17063 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
17065 ProcessClass(spec->definitions, symbol);
17072 static void ProcessDeclarator(struct Declarator * decl)
17077 if(decl->identifier->classSym)
17079 FreeSpecifier(decl->identifier->_class);
17080 decl->identifier->_class = (((void *)0));
17084 if(decl->array.exp)
17085 ProcessExpressionType(decl->array.exp);
17092 if(decl->declarator)
17093 ProcessDeclarator(decl->declarator);
17094 if(decl->type == 4)
17096 struct Identifier * id = GetDeclId(decl);
17098 if(id && id->_class)
17100 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17102 if(!decl->function.parameters)
17103 decl->function.parameters = MkList();
17104 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
17105 id->_class = (((void *)0));
17107 if(decl->function.parameters)
17109 struct TypeName * param;
17111 for(param = (*decl->function.parameters).first; param; param = param->next)
17113 if(param->qualifiers && (*param->qualifiers).first)
17115 struct Specifier * spec = (*param->qualifiers).first;
17117 if(spec && spec->specifier == TYPED_OBJECT)
17119 struct Declarator * d = param->declarator;
17120 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);
17122 FreeList(param->qualifiers, FreeSpecifier);
17123 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17124 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
17128 else if(spec && spec->specifier == ANY_OBJECT)
17130 struct Declarator * d = param->declarator;
17132 FreeList(param->qualifiers, FreeSpecifier);
17133 param->qualifiers = MkListOne(MkSpecifier(VOID));
17134 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17136 else if(spec->specifier == THISCLASS)
17141 spec->name = ReplaceThisClass(thisClass);
17142 spec->symbol = FindClass(spec->name);
17143 ProcessSpecifier(spec, 0x0);
17147 if(param->declarator)
17148 ProcessDeclarator(param->declarator);
17156 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17158 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17160 static void ProcessDeclaration(struct Declaration * decl)
17162 yylloc = decl->loc;
17167 unsigned int declareStruct = 0x0;
17169 if(decl->declarators)
17171 struct InitDeclarator * d;
17173 for(d = (*decl->declarators).first; d; d = d->next)
17175 struct Type * type, * subType;
17177 ProcessDeclarator(d->declarator);
17178 type = ProcessType(decl->specifiers, d->declarator);
17181 ProcessInitializer(d->initializer, type);
17182 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17184 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17186 struct Instantiation * inst = d->initializer->exp->instance;
17188 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17189 d->initializer->exp->instance = (((void *)0));
17190 if(decl->specifiers)
17191 FreeList(decl->specifiers, FreeSpecifier);
17192 FreeList(decl->declarators, FreeInitDeclarator);
17199 for(subType = type; subType; )
17201 if(subType->kind == 8)
17203 declareStruct = 0x1;
17206 else if(subType->kind == 13)
17208 else if(subType->kind == 12)
17209 subType = subType->arrayType;
17218 if(decl->specifiers)
17220 struct Specifier * s;
17222 for(s = (*decl->specifiers).first; s; s = s->next)
17224 ProcessSpecifier(s, declareStruct);
17231 ProcessInstantiationType(decl->inst);
17236 struct Specifier * spec;
17237 struct Declarator * d;
17238 unsigned int declareStruct = 0x0;
17240 if(decl->declarators)
17242 for(d = (*decl->declarators).first; d; d = d->next)
17244 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17245 struct Type * subType;
17247 ProcessDeclarator(d);
17248 for(subType = type; subType; )
17250 if(subType->kind == 8)
17252 declareStruct = 0x1;
17255 else if(subType->kind == 13)
17257 else if(subType->kind == 12)
17258 subType = subType->arrayType;
17265 if(decl->specifiers)
17267 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17268 ProcessSpecifier(spec, declareStruct);
17275 static struct FunctionDefinition * curFunction;
17277 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17279 char propName[1024], propNameM[1024];
17280 char getName[1024], setName[1024];
17281 struct __ecereNameSpace__ecere__sys__OldList * args;
17283 DeclareProperty(prop, setName, getName);
17284 strcpy(propName, "__ecereProp_");
17285 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17286 strcat(propName, "_");
17287 FullClassNameCat(propName, prop->name, 0x1);
17288 MangleClassName(propName);
17289 strcpy(propNameM, "__ecerePropM_");
17290 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17291 strcat(propNameM, "_");
17292 FullClassNameCat(propNameM, prop->name, 0x1);
17293 MangleClassName(propNameM);
17294 if(prop->isWatchable)
17297 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17298 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17299 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17301 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17302 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17303 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17307 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17308 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17309 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17311 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17312 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17313 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17315 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17316 curFunction->propSet->fireWatchersDone = 0x1;
17319 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17321 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17323 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17325 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17327 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17329 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17331 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17333 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17335 static void ProcessStatement(struct Statement * stmt)
17337 yylloc = stmt->loc;
17341 ProcessStatement(stmt->labeled.stmt);
17344 if(stmt->caseStmt.exp)
17346 FreeType(stmt->caseStmt.exp->destType);
17347 stmt->caseStmt.exp->destType = curSwitchType;
17349 curSwitchType->refCount++;
17350 ProcessExpressionType(stmt->caseStmt.exp);
17351 ComputeExpression(stmt->caseStmt.exp);
17353 if(stmt->caseStmt.stmt)
17354 ProcessStatement(stmt->caseStmt.stmt);
17358 if(stmt->compound.context)
17360 struct Declaration * decl;
17361 struct Statement * s;
17362 struct Statement * prevCompound = curCompound;
17363 struct Context * prevContext = curContext;
17365 if(!stmt->compound.isSwitch)
17366 curCompound = stmt;
17367 curContext = stmt->compound.context;
17368 if(stmt->compound.declarations)
17370 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17371 ProcessDeclaration(decl);
17373 if(stmt->compound.statements)
17375 for(s = (*stmt->compound.statements).first; s; s = s->next)
17376 ProcessStatement(s);
17378 curContext = prevContext;
17379 curCompound = prevCompound;
17385 struct Expression * exp;
17387 if(stmt->expressions)
17389 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17390 ProcessExpressionType(exp);
17396 struct Expression * exp;
17398 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17399 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17400 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17401 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17403 ProcessExpressionType(exp);
17405 if(stmt->ifStmt.stmt)
17406 ProcessStatement(stmt->ifStmt.stmt);
17407 if(stmt->ifStmt.elseStmt)
17408 ProcessStatement(stmt->ifStmt.elseStmt);
17413 struct Type * oldSwitchType = curSwitchType;
17415 if(stmt->switchStmt.exp)
17417 struct Expression * exp;
17419 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17423 ProcessExpressionType(exp);
17426 curSwitchType = exp->expType;
17429 ProcessStatement(stmt->switchStmt.stmt);
17430 curSwitchType = oldSwitchType;
17435 if(stmt->whileStmt.exp)
17437 struct Expression * exp;
17439 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17440 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17441 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17442 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17444 ProcessExpressionType(exp);
17447 if(stmt->whileStmt.stmt)
17448 ProcessStatement(stmt->whileStmt.stmt);
17453 if(stmt->doWhile.exp)
17455 struct Expression * exp;
17457 if((*stmt->doWhile.exp).last)
17459 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17460 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17461 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17463 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17465 ProcessExpressionType(exp);
17468 if(stmt->doWhile.stmt)
17469 ProcessStatement(stmt->doWhile.stmt);
17474 struct Expression * exp;
17476 if(stmt->forStmt.init)
17477 ProcessStatement(stmt->forStmt.init);
17478 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17480 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17481 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17482 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17484 if(stmt->forStmt.check)
17485 ProcessStatement(stmt->forStmt.check);
17486 if(stmt->forStmt.increment)
17488 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17489 ProcessExpressionType(exp);
17491 if(stmt->forStmt.stmt)
17492 ProcessStatement(stmt->forStmt.stmt);
17497 struct Identifier * id = stmt->forEachStmt.id;
17498 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17499 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17500 struct Statement * block = stmt->forEachStmt.stmt;
17501 char iteratorType[1024];
17502 struct Type * source;
17503 struct Expression * e;
17504 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));
17505 struct Expression * arrayExp;
17506 char * typeString = (((void *)0));
17507 int builtinCount = 0;
17509 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17513 FreeType(e->destType);
17514 e->destType = ProcessTypeString("Container", 0x0);
17516 if(!isBuiltin || e->next)
17517 ProcessExpressionType(e);
17519 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17520 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17522 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17523 struct Symbol * symbol;
17524 struct Expression * expIt = (((void *)0));
17525 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0;
17526 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17527 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17528 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17531 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17532 stmt->compound.context->parent = curContext;
17533 curContext = stmt->compound.context;
17534 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17536 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17538 isCustomAVLTree = 0x1;
17539 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17542 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17544 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17546 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17549 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17553 struct Declarator * decl;
17554 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17556 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17557 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17558 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17562 struct Type * type = (((void *)0));
17563 char typeStringBuf[1024];
17565 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17566 if(((struct Expression *)(*exp).last)->type == 11)
17568 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17571 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17573 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)
17575 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17577 typeString = templateClass->templateArgs[2].dataTypeString;
17579 else if(arrayExp->list)
17581 struct Expression * e;
17583 for(e = (*arrayExp->list).first; e; e = e->next)
17585 ProcessExpressionType(e);
17595 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17599 e->expType = (((void *)0));
17600 e = (*arrayExp->list).first;
17601 ProcessExpressionType(e);
17604 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17606 FreeType(e->expType);
17607 e->expType = (((void *)0));
17609 type = (((void *)0));
17617 FreeType(e->expType);
17618 e->expType = (((void *)0));
17624 typeStringBuf[0] = '\0';
17625 PrintType(type, typeStringBuf, 0x0, 0x1);
17626 typeString = typeStringBuf;
17632 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17633 struct Declarator * decl;
17634 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17638 struct Expression * e;
17640 builtinCount = (*arrayExp->list).count;
17641 type = ProcessTypeString(typeString, 0x0);
17642 while(e = (*arrayExp->list).first)
17644 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17645 e->destType = type;
17647 ProcessExpressionType(e);
17648 ListAdd(initializers, MkInitializerAssignment(e));
17651 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17653 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17654 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17655 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17656 FreeList(exp, FreeExpression);
17660 arrayExp->expType = ProcessTypeString("Container", 0x0);
17661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17664 else if(isLinkList && !isList)
17666 struct Declarator * decl;
17667 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17669 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17670 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17671 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17673 else if(_class->templateArgs)
17676 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17678 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17679 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17681 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17684 switch(block->type)
17687 if(block->compound.context)
17688 block->compound.context->parent = stmt->compound.context;
17691 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17692 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17693 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17694 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17697 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17698 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17701 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17702 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17705 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17706 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17709 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17710 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17713 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17714 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17720 block = MkIfStmt(filter, block, (((void *)0)));
17724 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));
17725 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17726 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17727 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17733 sprintf(count, "%d", builtinCount);
17734 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));
17735 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17736 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17737 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17739 else if(isLinkList && !isList)
17741 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17742 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17744 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17746 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));
17750 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17751 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17753 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));
17755 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17756 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17757 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17761 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17763 ProcessExpressionType(expIt);
17764 if((*stmt->compound.declarations).first)
17765 ProcessDeclaration((*stmt->compound.declarations).first);
17767 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17768 ProcessStatement(stmt);
17769 curContext = stmt->compound.context->parent;
17774 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17786 struct Expression * exp;
17788 if(stmt->expressions)
17790 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17794 if(curFunction && !curFunction->type)
17795 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17796 FreeType(exp->destType);
17797 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17799 exp->destType->refCount++;
17801 ProcessExpressionType(exp);
17808 ProcessDeclaration(stmt->decl);
17813 struct AsmField * field;
17815 if(stmt->asmStmt.inputFields)
17817 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17818 if(field->expression)
17819 ProcessExpressionType(field->expression);
17821 if(stmt->asmStmt.outputFields)
17823 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17824 if(field->expression)
17825 ProcessExpressionType(field->expression);
17827 if(stmt->asmStmt.clobberedFields)
17829 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17831 if(field->expression)
17832 ProcessExpressionType(field->expression);
17839 struct PropertyWatch * propWatch;
17840 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17841 struct Expression * object = stmt->_watch.object;
17842 struct Expression * watcher = stmt->_watch.watcher;
17845 ProcessExpressionType(watcher);
17847 ProcessExpressionType(object);
17850 if(watcher || thisClass)
17852 struct External * external = curExternal;
17853 struct Context * context = curContext;
17856 stmt->expressions = MkList();
17857 curExternal = external->prev;
17858 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17860 struct ClassFunction * func;
17861 char watcherName[1024];
17862 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17863 struct External * createdExternal;
17864 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17867 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17868 if(propWatch->deleteWatch)
17869 strcat(watcherName, "_delete");
17872 struct Identifier * propID;
17874 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17876 strcat(watcherName, "_");
17877 strcat(watcherName, propID->string);
17880 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17882 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17883 ProcessClassFunctionBody(func, propWatch->compound);
17884 propWatch->compound = (((void *)0));
17885 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17886 createdExternal->symbol->idCode = external->symbol->idCode;
17887 curExternal = createdExternal;
17888 ProcessFunction(createdExternal->function);
17890 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17892 externalDecl->declaration = decl;
17893 if(decl->symbol && !decl->symbol->pointerExternal)
17894 decl->symbol->pointerExternal = externalDecl;
17896 if(propWatch->deleteWatch)
17898 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17900 ListAdd(args, CopyExpression(object));
17901 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17902 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17903 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17907 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17908 struct Identifier * propID;
17910 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17912 char propName[1024];
17913 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17917 char getName[1024], setName[1024];
17918 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17920 DeclareProperty(prop, setName, getName);
17921 strcpy(propName, "__ecereProp_");
17922 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17923 strcat(propName, "_");
17924 FullClassNameCat(propName, prop->name, 0x1);
17925 ListAdd(args, CopyExpression(object));
17926 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17927 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17928 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17929 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17939 curExternal = external;
17940 curContext = context;
17942 FreeExpression(watcher);
17944 FreeExpression(object);
17945 FreeList(watches, FreePropertyWatch);
17948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17952 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17954 ProcessStatement(propWatch->compound);
17961 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17962 struct Expression * object = stmt->_watch.object;
17963 struct __ecereNameSpace__ecere__com__Class * _class;
17966 ProcessExpressionType(object);
17969 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17972 struct Identifier * propID;
17975 stmt->expressions = MkList();
17976 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17978 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17985 for(propID = (*watches).first; propID; propID = propID->next)
17987 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17991 CreateFireWatcher(prop, object, stmt);
17994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17999 struct __ecereNameSpace__ecere__com__Property * prop;
18000 struct __ecereNameSpace__ecere__com__Class * base;
18002 for(base = _class; base; base = base->base)
18004 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
18006 if(prop->isProperty && prop->isWatchable)
18008 CreateFireWatcher(prop, object, stmt);
18014 FreeExpression(object);
18015 FreeList(watches, FreeIdentifier);
18018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18024 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18025 struct Expression * object = stmt->_watch.object;
18026 struct Expression * watcher = stmt->_watch.watcher;
18027 struct __ecereNameSpace__ecere__com__Class * _class;
18030 ProcessExpressionType(object);
18032 ProcessExpressionType(watcher);
18035 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
18036 if(watcher || thisClass)
18040 struct Identifier * propID;
18043 stmt->expressions = MkList();
18046 struct __ecereNameSpace__ecere__sys__OldList * args;
18049 ListAdd(args, CopyExpression(object));
18050 ListAdd(args, MkExpConstant("0"));
18051 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18052 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18056 for(propID = (*watches).first; propID; propID = propID->next)
18058 char propName[1024];
18059 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18063 char getName[1024], setName[1024];
18064 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18066 DeclareProperty(prop, setName, getName);
18067 strcpy(propName, "__ecereProp_");
18068 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18069 strcat(propName, "_");
18070 FullClassNameCat(propName, prop->name, 0x1);
18071 MangleClassName(propName);
18072 ListAdd(args, CopyExpression(object));
18073 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18074 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18075 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18078 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18082 FreeExpression(object);
18084 FreeExpression(watcher);
18085 FreeList(watches, FreeIdentifier);
18088 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18098 extern struct Expression * QBrackets(struct Expression * exp);
18100 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
18102 extern struct Declarator * QMkPtrDecl(char * id);
18104 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18106 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18108 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18110 static void ProcessFunction(struct FunctionDefinition * function)
18112 struct Identifier * id = GetDeclId(function->declarator);
18113 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18114 struct Type * type = symbol ? symbol->type : (((void *)0));
18115 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18116 struct Context * oldTopContext = topContext;
18118 yylloc = function->loc;
18119 if(type && type->thisClass)
18121 struct Symbol * classSym = type->thisClass;
18122 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
18123 char className[1024];
18124 char structName[1024];
18125 struct Declarator * funcDecl;
18126 struct Symbol * thisSymbol;
18127 unsigned int typedObject = 0x0;
18129 if(_class && !_class->base)
18131 _class = currentClass;
18132 if(_class && !_class->symbol)
18133 _class->symbol = FindClass(_class->fullName);
18134 classSym = _class ? _class->symbol : (((void *)0));
18137 thisClass = _class;
18138 if(inCompiler && _class)
18140 if(type->kind == 11)
18142 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
18144 struct Type * param = symbol->type->params.first;
18146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
18149 if(type->classObjectType != 1)
18151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
18152 symbol->type->staticMethod = 0x1;
18153 symbol->type->thisClass = (((void *)0));
18154 symbol->type->extraParam = 0x0;
18157 strcpy(className, "__ecereClass_");
18158 FullClassNameCat(className, _class->fullName, 0x1);
18159 MangleClassName(className);
18160 structName[0] = (char)0;
18161 FullClassNameCat(structName, _class->fullName, 0x0);
18162 funcDecl = GetFuncDecl(function->declarator);
18165 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18167 struct TypeName * param = (*funcDecl->function.parameters).first;
18169 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18171 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18172 FreeTypeName(param);
18175 if(!function->propertyNoThis)
18177 struct TypeName * thisParam;
18179 if(type->classObjectType != 1)
18181 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18182 if(!funcDecl->function.parameters)
18183 funcDecl->function.parameters = MkList();
18184 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18188 if(type->classObjectType != 1)
18190 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18191 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18193 thisParam = __extension__ ({
18194 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18196 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18202 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18204 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18206 funcDecl = GetFuncDecl(initDecl->declarator);
18209 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18211 struct TypeName * param = (*funcDecl->function.parameters).first;
18213 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18215 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18216 FreeTypeName(param);
18219 if(type->classObjectType != 1)
18221 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18223 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18225 if(!funcDecl->function.parameters)
18226 funcDecl->function.parameters = MkList();
18227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18235 if(type->classObjectType != 1)
18237 thisSymbol = __extension__ ({
18238 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18240 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18242 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18243 if(typedObject && thisSymbol->type)
18245 thisSymbol->type->classObjectType = 2;
18246 thisSymbol->type->byReference = type->byReference;
18247 thisSymbol->type->typedByReference = type->byReference;
18251 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18253 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18256 struct __ecereNameSpace__ecere__com__Class * base;
18258 for(base = _class; base && base->type != 1000; base = base->next)
18260 for(member = base->membersAndProperties.first; member; member = member->next)
18261 if(!member->isProperty)
18267 for(member = _class->membersAndProperties.first; member; member = member->next)
18268 if(!member->isProperty)
18272 char pointerName[1024];
18273 struct Declaration * decl;
18274 struct Initializer * initializer;
18275 struct Expression * exp, * bytePtr;
18277 strcpy(pointerName, "__ecerePointer_");
18278 FullClassNameCat(pointerName, _class->fullName, 0x0);
18280 char className[1024];
18282 strcpy(className, "__ecereClass_");
18283 FullClassNameCat(className, classSym->string, 0x1);
18284 MangleClassName(className);
18285 DeclareClass(classSym, className);
18287 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18292 sprintf(string, "%d", _class->offset);
18293 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18297 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18299 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18300 exp->expType = __extension__ ({
18301 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18303 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18304 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18306 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18307 }), __ecereInstance2;
18311 yylloc = function->body->loc;
18312 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18314 struct Context * prevContext = curContext;
18316 curContext = function->body->compound.context;
18317 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18318 curContext = prevContext;
18320 decl->symbol = (((void *)0));
18321 if(!function->body->compound.declarations)
18322 function->body->compound.declarations = MkList();
18323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18329 thisClass = (((void *)0));
18332 FreeSpecifier(id->_class);
18333 id->_class = (((void *)0));
18334 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18336 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18338 id = GetDeclId(initDecl->declarator);
18339 FreeSpecifier(id->_class);
18340 id->_class = (((void *)0));
18344 topContext = function->body->compound.context;
18346 struct FunctionDefinition * oldFunction = curFunction;
18348 curFunction = function;
18350 ProcessStatement(function->body);
18351 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18353 struct Statement * prevCompound = curCompound;
18354 struct Context * prevContext = curContext;
18355 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18357 if(!function->body->compound.statements)
18358 function->body->compound.statements = MkList();
18359 ListAdd(function->body->compound.statements, fireWatchers);
18360 curCompound = function->body;
18361 curContext = function->body->compound.context;
18362 ProcessStatement(fireWatchers);
18363 curContext = prevContext;
18364 curCompound = prevCompound;
18366 curFunction = oldFunction;
18368 if(function->declarator)
18370 ProcessDeclarator(function->declarator);
18372 topContext = oldTopContext;
18373 thisClass = oldThisClass;
18376 extern void FreeSymbol(struct Symbol * symbol);
18378 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18380 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18382 struct ClassDef * def;
18383 struct External * external = curExternal;
18384 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18386 for(def = definitions->first; def; def = def->next)
18390 if(def->function->declarator)
18391 curExternal = def->function->declarator->symbol->pointerExternal;
18393 curExternal = external;
18394 ProcessFunction((struct FunctionDefinition *)def->function);
18396 else if(def->type == 2)
18398 if(def->decl->type == 2)
18400 thisClass = regClass;
18401 ProcessInstantiationType(def->decl->inst);
18402 thisClass = (((void *)0));
18406 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18409 thisClass = regClass;
18410 ProcessDeclaration(def->decl);
18411 thisClass = backThisClass;
18414 else if(def->type == 1 && def->defProperties)
18416 struct MemberInit * defProperty;
18417 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);
18419 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18420 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18422 thisClass = regClass;
18423 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18424 thisClass = (((void *)0));
18426 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18427 FreeSymbol(thisSymbol);
18429 else if(def->type == 3 && def->propertyDef)
18431 struct PropertyDef * prop = def->propertyDef;
18433 thisClass = regClass;
18438 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18440 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18442 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18443 ProcessStatement(prop->setStmt);
18449 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18451 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18453 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18454 ProcessStatement(prop->getStmt);
18456 if(prop->issetStmt)
18460 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18462 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18464 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18465 ProcessStatement(prop->issetStmt);
18467 thisClass = (((void *)0));
18469 else if(def->type == 4 && def->propertyWatch)
18471 struct PropertyWatch * propertyWatch = def->propertyWatch;
18473 thisClass = regClass;
18474 if(propertyWatch->compound)
18476 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);
18478 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18479 curExternal = (((void *)0));
18480 ProcessStatement(propertyWatch->compound);
18482 thisClass = (((void *)0));
18487 void DeclareFunctionUtil(char * s)
18489 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18496 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18497 strcpy(name, "__ecereFunction_");
18498 FullClassNameCat(name, s, 0x0);
18499 DeclareFunction(function, name);
18503 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18505 void ComputeDataTypes()
18507 struct External * external;
18508 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18509 struct External * after = (((void *)0));
18511 currentClass = (((void *)0));
18512 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18513 for(external = (*ast).first; external; external = external->next)
18515 if(external->type == 1)
18517 struct Declaration * decl = external->declaration;
18521 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18525 struct InitDeclarator * initDecl = (*decls).first;
18529 struct Declarator * declarator = initDecl->declarator;
18531 if(declarator && declarator->type == 1)
18533 struct Identifier * id = declarator->identifier;
18535 if(id && id->string)
18537 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18539 external->symbol->id = -1001, external->symbol->idCode = -1001;
18549 temp->symbol = __extension__ ({
18550 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18552 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18554 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18555 curExternal = temp;
18556 DeclareFunctionUtil("eSystem_New");
18557 DeclareFunctionUtil("eSystem_New0");
18558 DeclareFunctionUtil("eSystem_Renew");
18559 DeclareFunctionUtil("eSystem_Renew0");
18560 DeclareFunctionUtil("eSystem_Delete");
18561 DeclareFunctionUtil("eClass_GetProperty");
18562 DeclareFunctionUtil("eClass_SetProperty");
18563 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18564 DeclareFunctionUtil("eInstance_SetMethod");
18565 DeclareFunctionUtil("eInstance_IncRef");
18566 DeclareFunctionUtil("eInstance_StopWatching");
18567 DeclareFunctionUtil("eInstance_Watch");
18568 DeclareFunctionUtil("eInstance_FireWatchers");
18569 DeclareStruct("ecere::com::Class", 0x0);
18570 DeclareStruct("ecere::com::Instance", 0x0);
18571 DeclareStruct("ecere::com::Property", 0x0);
18572 DeclareStruct("ecere::com::DataMember", 0x0);
18573 DeclareStruct("ecere::com::Method", 0x0);
18574 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18575 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18576 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18577 for(external = (*ast).first; external; external = external->next)
18579 afterExternal = curExternal = external;
18580 if(external->type == 0)
18582 currentClass = external->function->_class;
18583 ProcessFunction(external->function);
18585 else if(external->type == 1)
18587 currentClass = (((void *)0));
18588 if(external->declaration)
18589 ProcessDeclaration(external->declaration);
18591 else if(external->type == 2)
18593 struct ClassDefinition * _class = external->_class;
18595 currentClass = external->symbol->registered;
18596 if(_class->definitions)
18598 ProcessClass(_class->definitions, _class->symbol);
18602 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18603 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18606 else if(external->type == 4)
18608 thisNameSpace = external->id->string;
18611 currentClass = (((void *)0));
18612 thisNameSpace = (((void *)0));
18613 curExternal = (((void *)0));
18614 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor((void *)temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18615 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor((void *)temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18618 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char * name, char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
18620 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
18622 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18624 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18626 struct __ecereNameSpace__ecere__com__Class * class;
18628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18640 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18650 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18651 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18652 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18653 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18654 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18656 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18657 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18658 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18659 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18660 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18661 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18663 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18664 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18665 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18669 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18677 __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);
18678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18681 __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);
18682 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18683 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18684 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18685 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18686 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18687 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18688 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18694 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18695 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18696 __ecereClass_Conversion = class;
18697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypes", "bool MatchTypes(Type source, Type dest, ecere::sys::OldList conversions, ecere::com::Class owningClassSource, ecere::com::Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams, bool isConversionExploration)", MatchTypes, module, 1);
18698 __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);
18699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18700 __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);
18701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18709 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18710 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18711 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18712 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18713 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18714 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18715 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18716 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18717 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18718 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18719 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18720 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18721 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18724 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)