1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
55 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
57 struct __ecereNameSpace__ecere__sys__BTNode;
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
61 struct __ecereNameSpace__ecere__sys__BinaryTree
63 struct __ecereNameSpace__ecere__sys__BTNode * root;
65 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
66 void (* FreeKey)(void * key);
67 } __attribute__ ((gcc_struct));
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
71 struct __ecereNameSpace__ecere__sys__OldList
78 } __attribute__ ((gcc_struct));
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
82 struct __ecereNameSpace__ecere__com__Method
85 struct __ecereNameSpace__ecere__com__Method * parent;
86 struct __ecereNameSpace__ecere__com__Method * left;
87 struct __ecereNameSpace__ecere__com__Method * right;
92 struct __ecereNameSpace__ecere__com__Class * _class;
94 char * dataTypeString;
95 struct Type * dataType;
97 } __attribute__ ((gcc_struct));
99 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
101 struct __ecereNameSpace__ecere__com__Property
103 struct __ecereNameSpace__ecere__com__Property * prev;
104 struct __ecereNameSpace__ecere__com__Property * next;
106 unsigned int isProperty;
109 struct __ecereNameSpace__ecere__com__Class * _class;
110 char * dataTypeString;
111 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
112 struct Type * dataType;
113 void (* Set)(void * , int);
114 int (* Get)(void * );
115 unsigned int (* IsSet)(void * );
119 unsigned int conversion;
120 unsigned int watcherOffset;
122 unsigned int compiled;
123 unsigned int selfWatchable;
124 unsigned int isWatchable;
125 } __attribute__ ((gcc_struct));
127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
135 } __attribute__ ((gcc_struct));
137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
141 struct CodePosition start;
142 struct CodePosition end;
143 } __attribute__ ((gcc_struct));
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
158 struct Attrib * attr;
159 } __attribute__ ((gcc_struct));
160 } __attribute__ ((gcc_struct));
162 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
164 struct ClassDefinition
166 struct ClassDefinition * prev;
167 struct ClassDefinition * next;
169 struct Specifier * _class;
170 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
171 struct __ecereNameSpace__ecere__sys__OldList * definitions;
172 struct Symbol * symbol;
173 struct Location blockStart;
174 struct Location nameLoc;
177 unsigned int deleteWatchable;
178 } __attribute__ ((gcc_struct));
180 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
184 struct Context * parent;
185 struct __ecereNameSpace__ecere__sys__BinaryTree types;
186 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
187 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
191 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
192 struct ClassDefinition * classDef;
193 unsigned int templateTypesOnly;
194 unsigned int hasNameSpace;
195 } __attribute__ ((gcc_struct));
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
201 struct Instantiation * prev;
202 struct Instantiation * next;
204 struct Specifier * _class;
205 struct Expression * exp;
206 struct __ecereNameSpace__ecere__sys__OldList * members;
207 struct Symbol * symbol;
208 unsigned int fullSet;
209 unsigned int isConstant;
210 unsigned char * data;
211 struct Location nameLoc;
212 struct Location insideLoc;
214 } __attribute__ ((gcc_struct));
216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
220 struct Declaration * prev;
221 struct Declaration * next;
228 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
229 struct __ecereNameSpace__ecere__sys__OldList * declarators;
230 } __attribute__ ((gcc_struct));
231 struct Instantiation * inst;
234 struct Identifier * id;
235 struct Expression * exp;
236 } __attribute__ ((gcc_struct));
237 } __attribute__ ((gcc_struct));
238 struct Specifier * extStorage;
239 struct Symbol * symbol;
241 } __attribute__ ((gcc_struct));
243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
247 struct Statement * prev;
248 struct Statement * next;
253 struct __ecereNameSpace__ecere__sys__OldList * expressions;
256 struct Identifier * id;
257 struct Statement * stmt;
258 } __attribute__ ((gcc_struct)) labeled;
261 struct Expression * exp;
262 struct Statement * stmt;
263 } __attribute__ ((gcc_struct)) caseStmt;
266 struct __ecereNameSpace__ecere__sys__OldList * declarations;
267 struct __ecereNameSpace__ecere__sys__OldList * statements;
268 struct Context * context;
269 unsigned int isSwitch;
270 } __attribute__ ((gcc_struct)) compound;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 struct Statement * elseStmt;
276 } __attribute__ ((gcc_struct)) ifStmt;
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) switchStmt;
284 struct __ecereNameSpace__ecere__sys__OldList * exp;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) whileStmt;
289 struct __ecereNameSpace__ecere__sys__OldList * exp;
290 struct Statement * stmt;
291 } __attribute__ ((gcc_struct)) doWhile;
294 struct Statement * init;
295 struct Statement * check;
296 struct __ecereNameSpace__ecere__sys__OldList * increment;
297 struct Statement * stmt;
298 } __attribute__ ((gcc_struct)) forStmt;
301 struct Identifier * id;
302 } __attribute__ ((gcc_struct)) gotoStmt;
305 struct Specifier * spec;
307 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
308 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
309 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
310 } __attribute__ ((gcc_struct)) asmStmt;
313 struct Expression * watcher;
314 struct Expression * object;
315 struct __ecereNameSpace__ecere__sys__OldList * watches;
316 } __attribute__ ((gcc_struct)) _watch;
319 struct Identifier * id;
320 struct __ecereNameSpace__ecere__sys__OldList * exp;
321 struct __ecereNameSpace__ecere__sys__OldList * filter;
322 struct Statement * stmt;
323 } __attribute__ ((gcc_struct)) forEachStmt;
324 struct Declaration * decl;
325 } __attribute__ ((gcc_struct));
326 } __attribute__ ((gcc_struct));
328 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
332 struct TypeName * prev;
333 struct TypeName * next;
335 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
336 struct Declarator * declarator;
338 struct Expression * bitCount;
339 } __attribute__ ((gcc_struct));
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
345 struct Initializer * prev;
346 struct Initializer * next;
351 struct Expression * exp;
352 struct __ecereNameSpace__ecere__sys__OldList * list;
353 } __attribute__ ((gcc_struct));
354 unsigned int isConstant;
355 } __attribute__ ((gcc_struct));
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
359 struct __ecereNameSpace__ecere__com__DataValue
374 } __attribute__ ((gcc_struct));
375 } __attribute__ ((gcc_struct));
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
381 struct Expression * prev;
382 struct Expression * next;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct));
392 struct Statement * compound;
393 struct Instantiation * instance;
397 unsigned int intlString;
398 } __attribute__ ((gcc_struct));
399 struct __ecereNameSpace__ecere__sys__OldList * list;
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
422 struct Expression * exp;
423 struct Identifier * member;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct));
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 } __attribute__ ((gcc_struct));
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
495 struct TemplateDatatype
497 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
498 struct Declarator * decl;
499 } __attribute__ ((gcc_struct));
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
503 struct TemplateArgument;
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
507 struct TemplateParameter
509 struct TemplateParameter * prev;
510 struct TemplateParameter * next;
513 struct Identifier * identifier;
516 struct TemplateDatatype * dataType;
518 } __attribute__ ((gcc_struct));
519 struct TemplateArgument * defaultArgument;
520 char * dataTypeString;
521 struct Type * baseType;
522 } __attribute__ ((gcc_struct));
524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
528 struct Specifier * prev;
529 struct Specifier * next;
537 struct ExtDecl * extDecl;
539 struct Symbol * symbol;
540 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
541 } __attribute__ ((gcc_struct));
544 struct Identifier * id;
545 struct __ecereNameSpace__ecere__sys__OldList * list;
546 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
547 struct __ecereNameSpace__ecere__sys__OldList * definitions;
548 unsigned int addNameSpace;
549 struct Context * ctx;
550 struct ExtDecl * extDeclStruct;
551 } __attribute__ ((gcc_struct));
552 struct Expression * expression;
553 struct Specifier * _class;
554 struct TemplateParameter * templateParameter;
555 } __attribute__ ((gcc_struct));
556 } __attribute__ ((gcc_struct));
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
562 struct Identifier * prev;
563 struct Identifier * next;
565 struct Symbol * classSym;
566 struct Specifier * _class;
568 struct Identifier * badID;
569 } __attribute__ ((gcc_struct));
571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
575 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
579 struct Declarator * prev;
580 struct Declarator * next;
583 struct Symbol * symbol;
584 struct Declarator * declarator;
587 struct Identifier * identifier;
590 struct Expression * exp;
591 struct Expression * posExp;
592 struct Attrib * attrib;
593 } __attribute__ ((gcc_struct)) structDecl;
596 struct Expression * exp;
597 struct Specifier * enumClass;
598 } __attribute__ ((gcc_struct)) array;
601 struct __ecereNameSpace__ecere__sys__OldList * parameters;
602 } __attribute__ ((gcc_struct)) function;
605 struct Pointer * pointer;
606 } __attribute__ ((gcc_struct)) pointer;
609 struct ExtDecl * extended;
610 } __attribute__ ((gcc_struct)) extended;
611 } __attribute__ ((gcc_struct));
612 } __attribute__ ((gcc_struct));
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
616 struct FunctionDefinition
618 struct FunctionDefinition * prev;
619 struct FunctionDefinition * next;
621 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
622 struct Declarator * declarator;
623 struct __ecereNameSpace__ecere__sys__OldList * declarations;
624 struct Statement * body;
625 struct __ecereNameSpace__ecere__com__Class * _class;
626 struct __ecereNameSpace__ecere__sys__OldList attached;
629 struct Symbol * propSet;
631 unsigned int propertyNoThis;
632 } __attribute__ ((gcc_struct));
634 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
638 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
642 struct External * prev;
643 struct External * next;
646 struct Symbol * symbol;
649 struct FunctionDefinition * function;
650 struct ClassDefinition * _class;
651 struct Declaration * declaration;
653 struct Identifier * id;
654 struct DBTableDef * table;
655 } __attribute__ ((gcc_struct));
657 } __attribute__ ((gcc_struct));
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
663 struct ModuleImport * prev;
664 struct ModuleImport * next;
666 struct __ecereNameSpace__ecere__sys__OldList classes;
667 struct __ecereNameSpace__ecere__sys__OldList functions;
670 } __attribute__ ((gcc_struct));
672 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
676 struct ClassImport * prev;
677 struct ClassImport * next;
679 struct __ecereNameSpace__ecere__sys__OldList methods;
680 struct __ecereNameSpace__ecere__sys__OldList properties;
682 unsigned int isRemote;
683 } __attribute__ ((gcc_struct));
685 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
690 struct Symbol * parent;
691 struct Symbol * left;
692 struct Symbol * right;
697 struct __ecereNameSpace__ecere__com__Method * method;
698 struct __ecereNameSpace__ecere__com__Property * _property;
699 struct __ecereNameSpace__ecere__com__Class * registered;
700 } __attribute__ ((gcc_struct));
707 struct External * pointerExternal;
708 struct External * structExternal;
709 } __attribute__ ((gcc_struct));
712 struct External * externalGet;
713 struct External * externalSet;
714 struct External * externalPtr;
715 struct External * externalIsSet;
716 } __attribute__ ((gcc_struct));
719 struct External * methodExternal;
720 struct External * methodCodeExternal;
721 } __attribute__ ((gcc_struct));
722 } __attribute__ ((gcc_struct));
723 unsigned int imported;
724 unsigned int declaredStructSym;
725 struct __ecereNameSpace__ecere__com__Class * _class;
726 unsigned int declaredStruct;
727 unsigned int needConstructor;
728 unsigned int needDestructor;
729 char * constructorName;
732 char * destructorName;
733 struct ModuleImport * module;
734 struct ClassImport * _import;
735 struct Location nameLoc;
736 unsigned int isParam;
737 unsigned int isRemote;
738 unsigned int isStruct;
739 unsigned int fireWatchersDone;
741 unsigned int classData;
742 unsigned int isStatic;
744 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
745 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
746 struct Context * ctx;
748 struct Expression * propCategory;
749 } __attribute__ ((gcc_struct));
751 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
760 struct Symbol * _class;
763 struct __ecereNameSpace__ecere__sys__OldList members;
765 } __attribute__ ((gcc_struct));
768 struct Type * returnType;
769 struct __ecereNameSpace__ecere__sys__OldList params;
770 struct Symbol * thisClass;
771 unsigned int staticMethod;
772 struct TemplateParameter * thisClassTemplate;
773 } __attribute__ ((gcc_struct));
776 struct __ecereNameSpace__ecere__com__Method * method;
777 struct __ecereNameSpace__ecere__com__Class * methodClass;
778 struct __ecereNameSpace__ecere__com__Class * usedClass;
779 } __attribute__ ((gcc_struct));
782 struct Type * arrayType;
784 struct Expression * arraySizeExp;
785 unsigned int freeExp;
786 struct Symbol * enumClass;
787 } __attribute__ ((gcc_struct));
789 struct TemplateParameter * templateParameter;
790 } __attribute__ ((gcc_struct));
800 unsigned int isSigned : 1;
801 unsigned int constant : 1;
802 unsigned int truth : 1;
803 unsigned int byReference : 1;
804 unsigned int extraParam : 1;
805 unsigned int directClassAccess : 1;
806 unsigned int computing : 1;
807 unsigned int keepCast : 1;
808 unsigned int passAsTemplate : 1;
809 unsigned int dllExport : 1;
810 unsigned int attrStdcall : 1;
811 unsigned int declaredWithStruct : 1;
812 unsigned int typedByReference : 1;
813 } __attribute__ ((gcc_struct));
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
817 struct __ecereNameSpace__ecere__com__Class
819 struct __ecereNameSpace__ecere__com__Class * prev;
820 struct __ecereNameSpace__ecere__com__Class * next;
826 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
827 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
830 struct __ecereNameSpace__ecere__com__Class * base;
831 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
832 struct __ecereNameSpace__ecere__sys__BinaryTree members;
833 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
834 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
835 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
836 struct __ecereNameSpace__ecere__sys__OldList derivatives;
840 struct __ecereNameSpace__ecere__com__Instance * module;
841 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
842 char * dataTypeString;
843 struct Type * dataType;
845 int defaultAlignment;
846 void (* Initialize)();
848 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
849 char * designerClass;
850 unsigned int noExpansion;
851 char * defaultProperty;
852 unsigned int comRedefinition;
854 unsigned int isRemote;
855 unsigned int internalDecl;
857 unsigned int computeSize;
859 int destructionWatchOffset;
861 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
862 int inheritanceAccess;
865 struct __ecereNameSpace__ecere__sys__OldList conversions;
866 struct __ecereNameSpace__ecere__sys__OldList templateParams;
867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
868 struct __ecereNameSpace__ecere__com__Class * templateClass;
869 struct __ecereNameSpace__ecere__sys__OldList templatized;
871 unsigned int isInstanceClass;
872 unsigned int byValueSystemClass;
873 } __attribute__ ((gcc_struct));
875 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
877 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
879 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
881 struct __ecereNameSpace__ecere__com__Instance
884 struct __ecereNameSpace__ecere__com__Class * _class;
886 } __attribute__ ((gcc_struct));
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
890 struct __ecereNameSpace__ecere__com__DataMember
892 struct __ecereNameSpace__ecere__com__DataMember * prev;
893 struct __ecereNameSpace__ecere__com__DataMember * next;
895 unsigned int isProperty;
898 struct __ecereNameSpace__ecere__com__Class * _class;
899 char * dataTypeString;
900 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
901 struct Type * dataType;
905 struct __ecereNameSpace__ecere__sys__OldList members;
906 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
909 } __attribute__ ((gcc_struct));
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
913 struct __ecereNameSpace__ecere__com__SerialBuffer
915 unsigned char * _buffer;
919 } __attribute__ ((gcc_struct));
921 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
923 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
929 char * dataTypeString;
930 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
931 } __attribute__ ((gcc_struct));
932 struct __ecereNameSpace__ecere__com__DataValue expression;
938 struct __ecereNameSpace__ecere__com__DataMember * member;
939 struct __ecereNameSpace__ecere__com__Property * prop;
940 struct __ecereNameSpace__ecere__com__Method * method;
941 } __attribute__ ((gcc_struct));
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
946 void exit(int status);
948 void * calloc(size_t nmemb, size_t size);
950 void free(void * ptr);
952 void * malloc(size_t size);
954 void * realloc(void * ptr, size_t size);
956 long int strtol(const char * nptr, char ** endptr, int base);
958 long long int strtoll(const char * nptr, char ** endptr, int base);
960 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
964 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
967 typedef union YYSTYPE
972 struct Identifier * id;
973 struct Expression * exp;
974 struct Specifier * specifier;
975 struct __ecereNameSpace__ecere__sys__OldList * list;
976 struct Enumerator * enumerator;
977 struct Declarator * declarator;
978 struct Pointer * pointer;
979 struct Initializer * initializer;
980 struct InitDeclarator * initDeclarator;
981 struct TypeName * typeName;
982 struct Declaration * declaration;
983 struct Statement * stmt;
984 struct FunctionDefinition * function;
985 struct External * external;
986 struct Context * context;
987 struct AsmField * asmField;
988 struct Attrib * attrib;
989 struct ExtDecl * extDecl;
990 struct Attribute * attribute;
991 struct Instantiation * instance;
992 struct MembersInit * membersInit;
993 struct MemberInit * memberInit;
994 struct ClassFunction * classFunction;
995 struct ClassDefinition * _class;
996 struct ClassDef * classDef;
997 struct PropertyDef * prop;
999 struct Symbol * symbol;
1000 struct PropertyWatch * propertyWatch;
1001 struct TemplateParameter * templateParameter;
1002 struct TemplateArgument * templateArgument;
1003 struct TemplateDatatype * templateDatatype;
1004 struct DBTableEntry * dbtableEntry;
1005 struct DBIndexItem * dbindexItem;
1006 struct DBTableDef * dbtableDef;
1007 } __attribute__ ((gcc_struct)) YYSTYPE;
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1013 struct Enumerator * prev;
1014 struct Enumerator * next;
1015 struct Location loc;
1016 struct Identifier * id;
1017 struct Expression * exp;
1018 } __attribute__ ((gcc_struct));
1020 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1022 struct InitDeclarator
1024 struct InitDeclarator * prev;
1025 struct InitDeclarator * next;
1026 struct Location loc;
1027 struct Declarator * declarator;
1028 struct Initializer * initializer;
1029 } __attribute__ ((gcc_struct));
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1035 struct AsmField * prev;
1036 struct AsmField * next;
1037 struct Location loc;
1039 struct Expression * expression;
1040 struct Identifier * symbolic;
1041 } __attribute__ ((gcc_struct));
1043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1049 struct ClassFunction
1051 struct ClassFunction * prev;
1052 struct ClassFunction * next;
1053 struct Location loc;
1054 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1055 struct Declarator * declarator;
1056 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1057 struct Statement * body;
1058 struct __ecereNameSpace__ecere__com__Class * _class;
1059 struct __ecereNameSpace__ecere__sys__OldList attached;
1062 struct Symbol * propSet;
1063 unsigned int isVirtual;
1064 unsigned int isConstructor;
1065 unsigned int isDestructor;
1066 unsigned int dontMangle;
1069 } __attribute__ ((gcc_struct));
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1075 struct MembersInit * prev;
1076 struct MembersInit * next;
1077 struct Location loc;
1081 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1082 struct ClassFunction * function;
1083 } __attribute__ ((gcc_struct));
1084 } __attribute__ ((gcc_struct));
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1090 struct MemberInit * prev;
1091 struct MemberInit * next;
1092 struct Location loc;
1093 struct Location realLoc;
1094 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1095 struct Initializer * initializer;
1097 unsigned int variable;
1098 unsigned int takeOutExp;
1099 } __attribute__ ((gcc_struct));
1101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1105 struct PropertyDef * prev;
1106 struct PropertyDef * next;
1107 struct Location loc;
1108 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1109 struct Declarator * declarator;
1110 struct Identifier * id;
1111 struct Statement * getStmt;
1112 struct Statement * setStmt;
1113 struct Statement * issetStmt;
1114 struct Symbol * symbol;
1115 struct Expression * category;
1118 unsigned int conversion : 1;
1119 unsigned int isWatchable : 1;
1120 unsigned int isDBProp : 1;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1126 struct PropertyWatch
1128 struct PropertyWatch * prev;
1129 struct PropertyWatch * next;
1130 struct Location loc;
1131 struct Statement * compound;
1132 struct __ecereNameSpace__ecere__sys__OldList * properties;
1133 unsigned int deleteWatch;
1134 } __attribute__ ((gcc_struct));
1136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1140 struct ClassDef * prev;
1141 struct ClassDef * next;
1142 struct Location loc;
1146 struct Declaration * decl;
1147 struct ClassFunction * function;
1148 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1149 struct PropertyDef * propertyDef;
1150 struct PropertyWatch * propertyWatch;
1152 struct Identifier * defaultProperty;
1155 struct Identifier * id;
1156 struct Initializer * initializer;
1157 } __attribute__ ((gcc_struct));
1158 } __attribute__ ((gcc_struct));
1161 } __attribute__ ((gcc_struct));
1163 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1165 struct DBTableEntry;
1167 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1171 extern YYSTYPE yylval;
1173 extern struct Location yylloc;
1175 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1177 extern int returnCode;
1179 extern struct Expression * parsedExpression;
1181 extern unsigned int yydebug;
1183 void SetYydebug(unsigned int b)
1188 extern unsigned int echoOn;
1190 void resetScanner();
1194 int expression_yyparse();
1196 static struct Statement * curCompound;
1198 struct External * curExternal, * afterExternal;
1200 static struct Type * curSwitchType;
1202 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1204 struct __ecereNameSpace__ecere__com__Class * thisClass;
1206 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1211 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1216 static char * thisNameSpace;
1218 struct __ecereNameSpace__ecere__com__Class * containerClass;
1220 unsigned int thisClassParams = 0x1;
1222 unsigned int internalValueCounter;
1224 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1226 extern size_t strlen(const char * );
1228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1230 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1232 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1234 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1236 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1238 void PrintExpression(struct Expression * exp, char * string)
1241 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1245 OutputExpression(exp, f);
1246 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1247 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1249 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1250 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1251 count = strlen(string);
1252 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1253 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1255 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1256 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1257 string[count] = '\0';
1258 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1262 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1264 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1266 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1268 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1270 if(!param->baseType)
1272 if(param->dataTypeString)
1273 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1275 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1277 return param->baseType;
1279 return (((void *)0));
1282 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1284 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1286 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1290 if(type1->kind == type2->kind)
1301 if(type1->passAsTemplate && !type2->passAsTemplate)
1303 return type1->isSigned != type2->isSigned;
1305 return type1->_class != type2->_class;
1307 return NeedCast(type1->type, type2->type);
1315 extern int strcmp(const char * , const char * );
1317 extern struct Context * curContext;
1319 extern struct Context * topContext;
1321 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1323 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1325 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1327 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1329 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1333 struct __ecereNameSpace__ecere__com__ClassProperty
1336 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1337 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1338 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1340 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1341 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1342 char * dataTypeString;
1343 struct Type * dataType;
1344 unsigned int constant;
1345 } __attribute__ ((gcc_struct));
1347 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1349 extern struct Expression * QMkExpId(char * id);
1351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1353 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1355 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1356 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1361 char * dataTypeString;
1363 } __attribute__ ((gcc_struct));
1364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1366 } __attribute__ ((gcc_struct));
1368 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1370 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1372 extern void FreeIdentifier(struct Identifier * id);
1374 void ProcessExpressionType(struct Expression * exp);
1376 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1378 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1380 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1382 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1384 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1386 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1388 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1390 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1392 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1394 if(exp->type == 0 && exp->identifier)
1396 struct Identifier * id = exp->identifier;
1397 struct Context * ctx;
1398 struct Symbol * symbol = (((void *)0));
1400 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1402 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1404 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1409 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1411 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1412 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1413 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1418 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1420 if(!prop && !method)
1421 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1422 if(!prop && !method && !member)
1424 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1426 if(prop || method || member || classProp)
1429 exp->member.member = id;
1430 exp->member.memberType = 0;
1431 exp->member.exp = QMkExpId("this");
1432 exp->addedThis = 0x1;
1434 else if(_class && _class->templateParams.first)
1436 struct __ecereNameSpace__ecere__com__Class * sClass;
1438 for(sClass = _class; sClass; sClass = sClass->base)
1440 if(sClass->templateParams.first)
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1444 for(param = sClass->templateParams.first; param; param = param->next)
1446 if(param->type == 2 && !strcmp(param->name, id->string))
1448 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1452 struct Declarator * decl;
1453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1455 FreeIdentifier(exp->member.member);
1456 ProcessExpressionType(argExp);
1457 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1458 exp->expType = ProcessType(specs, decl);
1460 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1471 extern int sprintf(char * , char * , ...);
1473 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1475 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1477 char * PrintInt(long long result)
1481 if(result > (((long long)0x7fffffffffffffffLL)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1488 char * PrintUInt(uint64 result)
1492 if(result > (0xffffffff))
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1494 else if(result > (((int)0x7fffffff)))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1501 char * PrintInt64(long long result)
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1506 return __ecereNameSpace__ecere__sys__CopyString(temp);
1509 char * PrintUInt64(uint64 result)
1513 if(result > (((long long)0x7fffffffffffffffLL)))
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1516 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1520 char * PrintHexUInt(uint64 result)
1524 if(result > (0xffffffff))
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1527 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 char * PrintHexUInt64(uint64 result)
1535 if(result > (0xffffffff))
1536 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1538 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1539 return __ecereNameSpace__ecere__sys__CopyString(temp);
1542 char * PrintShort(short result)
1546 sprintf(temp, "%d", (unsigned short)result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1550 char * PrintUShort(unsigned short result)
1554 if(result > (unsigned short)32767)
1555 sprintf(temp, "0x%X", (int)result);
1557 sprintf(temp, "%d", (int)result);
1558 return __ecereNameSpace__ecere__sys__CopyString(temp);
1561 extern int isprint(int c);
1563 char * PrintChar(char result)
1567 if(result > (char)0 && isprint(result))
1568 sprintf(temp, "'%c'", result);
1569 else if(result < (char)0)
1570 sprintf(temp, "%d", (int)result);
1572 sprintf(temp, "0x%X", (unsigned char)result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 char * PrintUChar(unsigned char result)
1580 sprintf(temp, "0x%X", result);
1581 return __ecereNameSpace__ecere__sys__CopyString(temp);
1584 char * PrintFloat(float result)
1588 sprintf(temp, "%.16ff", result);
1589 return __ecereNameSpace__ecere__sys__CopyString(temp);
1592 char * PrintDouble(double result)
1596 sprintf(temp, "%.16f", result);
1597 return __ecereNameSpace__ecere__sys__CopyString(temp);
1600 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1604 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* Neg)(struct Expression *, struct Operand *);
1610 unsigned int (* Inc)(struct Expression *, struct Operand *);
1611 unsigned int (* Dec)(struct Expression *, struct Operand *);
1612 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1624 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1627 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1628 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1629 unsigned int (* Not)(struct Expression *, struct Operand *);
1630 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1631 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1632 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1633 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1634 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1635 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1636 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1637 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1638 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1639 } __attribute__ ((gcc_struct));
1641 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1647 unsigned int ptrSize;
1660 } __attribute__ ((gcc_struct));
1662 } __attribute__ ((gcc_struct));
1664 struct Operand GetOperand(struct Expression * exp);
1666 unsigned int GetInt(struct Expression * exp, int * value2)
1668 struct Operand op2 = GetOperand(exp);
1670 if(op2.kind == 3 && op2.type->isSigned)
1672 else if(op2.kind == 3)
1673 *value2 = (int)op2.ui;
1674 else if(op2.kind == 4 && op2.type->isSigned)
1675 *value2 = (int)op2.i64;
1676 else if(op2.kind == 4)
1677 *value2 = (int)op2.ui64;
1678 else if(op2.kind == 23 && op2.type->isSigned)
1679 *value2 = (int)op2.i64;
1680 else if(op2.kind == 23)
1681 *value2 = (int)op2.ui64;
1682 else if(op2.kind == 22 && op2.type->isSigned)
1683 *value2 = (int)op2.i64;
1684 else if(op2.kind == 22)
1685 *value2 = (int)op2.ui64;
1686 else if(op2.kind == 2 && op2.type->isSigned)
1687 *value2 = (int)op2.s;
1688 else if(op2.kind == 2)
1689 *value2 = (int)op2.us;
1690 else if(op2.kind == 1 && op2.type->isSigned)
1691 *value2 = (int)op2.c;
1692 else if(op2.kind == 24 || op2.kind == 1)
1693 *value2 = (int)op2.uc;
1694 else if(op2.kind == 6)
1695 *value2 = (int)op2.f;
1696 else if(op2.kind == 7)
1697 *value2 = (int)op2.d;
1698 else if(op2.kind == 13)
1699 *value2 = (int)op2.ui64;
1705 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1707 struct Operand op2 = GetOperand(exp);
1709 if(op2.kind == 3 && op2.type->isSigned)
1710 *value2 = (unsigned int)op2.i;
1711 else if(op2.kind == 3)
1713 else if(op2.kind == 4 && op2.type->isSigned)
1714 *value2 = (unsigned int)op2.i64;
1715 else if(op2.kind == 4)
1716 *value2 = (unsigned int)op2.ui64;
1717 else if(op2.kind == 23 && op2.type->isSigned)
1718 *value2 = (unsigned int)op2.i64;
1719 else if(op2.kind == 23)
1720 *value2 = (unsigned int)op2.ui64;
1721 else if(op2.kind == 22 && op2.type->isSigned)
1722 *value2 = (unsigned int)op2.i64;
1723 else if(op2.kind == 22)
1724 *value2 = (unsigned int)op2.ui64;
1725 else if(op2.kind == 2 && op2.type->isSigned)
1726 *value2 = (unsigned int)op2.s;
1727 else if(op2.kind == 2)
1728 *value2 = (unsigned int)op2.us;
1729 else if(op2.kind == 1 && op2.type->isSigned)
1730 *value2 = (unsigned int)op2.c;
1731 else if(op2.kind == 24 || op2.kind == 1)
1732 *value2 = (unsigned int)op2.uc;
1733 else if(op2.kind == 6)
1734 *value2 = (unsigned int)op2.f;
1735 else if(op2.kind == 7)
1736 *value2 = (unsigned int)op2.d;
1737 else if(op2.kind == 13)
1738 *value2 = (unsigned int)op2.ui64;
1744 unsigned int GetInt64(struct Expression * exp, long long * value2)
1746 struct Operand op2 = GetOperand(exp);
1748 if(op2.kind == 3 && op2.type->isSigned)
1749 *value2 = (long long)op2.i;
1750 else if(op2.kind == 3)
1751 *value2 = (long long)op2.ui;
1752 else if(op2.kind == 4 && op2.type->isSigned)
1754 else if(op2.kind == 4)
1755 *value2 = (long long)op2.ui64;
1756 else if(op2.kind == 23 && op2.type->isSigned)
1758 else if(op2.kind == 23)
1759 *value2 = (long long)op2.ui64;
1760 else if(op2.kind == 22 && op2.type->isSigned)
1762 else if(op2.kind == 22)
1763 *value2 = (long long)op2.ui64;
1764 else if(op2.kind == 2 && op2.type->isSigned)
1765 *value2 = (long long)op2.s;
1766 else if(op2.kind == 2)
1767 *value2 = (long long)op2.us;
1768 else if(op2.kind == 1 && op2.type->isSigned)
1769 *value2 = (long long)op2.c;
1770 else if(op2.kind == 24 || op2.kind == 1)
1771 *value2 = (long long)op2.uc;
1772 else if(op2.kind == 6)
1773 *value2 = (long long)op2.f;
1774 else if(op2.kind == 7)
1775 *value2 = (long long)op2.d;
1776 else if(op2.kind == 13)
1777 *value2 = (long long)op2.ui64;
1783 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1785 struct Operand op2 = GetOperand(exp);
1787 if(op2.kind == 3 && op2.type->isSigned)
1788 *value2 = (uint64)op2.i;
1789 else if(op2.kind == 3)
1790 *value2 = (uint64)op2.ui;
1791 else if(op2.kind == 4 && op2.type->isSigned)
1792 *value2 = (uint64)op2.i64;
1793 else if(op2.kind == 4)
1795 else if(op2.kind == 23 && op2.type->isSigned)
1796 *value2 = (uint64)op2.i64;
1797 else if(op2.kind == 23)
1799 else if(op2.kind == 22 && op2.type->isSigned)
1800 *value2 = (uint64)op2.i64;
1801 else if(op2.kind == 22)
1803 else if(op2.kind == 2 && op2.type->isSigned)
1804 *value2 = (uint64)op2.s;
1805 else if(op2.kind == 2)
1806 *value2 = (uint64)op2.us;
1807 else if(op2.kind == 1 && op2.type->isSigned)
1808 *value2 = (uint64)op2.c;
1809 else if(op2.kind == 24 || op2.kind == 1)
1810 *value2 = (uint64)op2.uc;
1811 else if(op2.kind == 6)
1812 *value2 = (uint64)op2.f;
1813 else if(op2.kind == 7)
1814 *value2 = (uint64)op2.d;
1815 else if(op2.kind == 13)
1822 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1824 struct Operand op2 = GetOperand(exp);
1826 if(op2.kind == 3 && op2.type->isSigned)
1827 *value2 = (intptr_t)op2.i;
1828 else if(op2.kind == 3)
1829 *value2 = (intptr_t)op2.ui;
1830 else if(op2.kind == 4 && op2.type->isSigned)
1831 *value2 = (intptr_t)op2.i64;
1832 else if(op2.kind == 4)
1833 *value2 = (intptr_t)op2.ui64;
1834 else if(op2.kind == 23 && op2.type->isSigned)
1835 *value2 = (intptr_t)op2.i64;
1836 else if(op2.kind == 23)
1837 *value2 = (intptr_t)op2.ui64;
1838 else if(op2.kind == 22 && op2.type->isSigned)
1839 *value2 = (intptr_t)op2.i64;
1840 else if(op2.kind == 22)
1841 *value2 = (intptr_t)op2.ui64;
1842 else if(op2.kind == 2 && op2.type->isSigned)
1843 *value2 = (intptr_t)op2.s;
1844 else if(op2.kind == 2)
1845 *value2 = (intptr_t)op2.us;
1846 else if(op2.kind == 1 && op2.type->isSigned)
1847 *value2 = (intptr_t)op2.c;
1848 else if(op2.kind == 24 || op2.kind == 1)
1849 *value2 = (intptr_t)op2.uc;
1850 else if(op2.kind == 6)
1851 *value2 = (intptr_t)op2.f;
1852 else if(op2.kind == 7)
1853 *value2 = (intptr_t)op2.d;
1854 else if(op2.kind == 13)
1855 *value2 = (intptr_t)op2.ui64;
1861 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1863 struct Operand op2 = GetOperand(exp);
1865 if(op2.kind == 3 && op2.type->isSigned)
1866 *value2 = (uintptr_t)op2.i;
1867 else if(op2.kind == 3)
1868 *value2 = (uintptr_t)op2.ui;
1869 else if(op2.kind == 4 && op2.type->isSigned)
1870 *value2 = (uintptr_t)op2.i64;
1871 else if(op2.kind == 4)
1872 *value2 = (uintptr_t)op2.ui64;
1873 else if(op2.kind == 23 && op2.type->isSigned)
1874 *value2 = (uintptr_t)op2.i64;
1875 else if(op2.kind == 23)
1876 *value2 = (uintptr_t)op2.ui64;
1877 else if(op2.kind == 22 && op2.type->isSigned)
1878 *value2 = (uintptr_t)op2.i64;
1879 else if(op2.kind == 22)
1880 *value2 = (uintptr_t)op2.ui64;
1881 else if(op2.kind == 2 && op2.type->isSigned)
1882 *value2 = (uintptr_t)op2.s;
1883 else if(op2.kind == 2)
1884 *value2 = (uintptr_t)op2.us;
1885 else if(op2.kind == 1 && op2.type->isSigned)
1886 *value2 = (uintptr_t)op2.c;
1887 else if(op2.kind == 24 || op2.kind == 1)
1888 *value2 = (uintptr_t)op2.uc;
1889 else if(op2.kind == 6)
1890 *value2 = (uintptr_t)op2.f;
1891 else if(op2.kind == 7)
1892 *value2 = (uintptr_t)op2.d;
1893 else if(op2.kind == 13)
1894 *value2 = (uintptr_t)op2.ui64;
1900 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1902 struct Operand op2 = GetOperand(exp);
1904 if(op2.kind == 3 && op2.type->isSigned)
1905 *value2 = (ssize_t)op2.i;
1906 else if(op2.kind == 3)
1907 *value2 = (ssize_t)op2.ui;
1908 else if(op2.kind == 4 && op2.type->isSigned)
1909 *value2 = (ssize_t)op2.i64;
1910 else if(op2.kind == 4)
1911 *value2 = (ssize_t)op2.ui64;
1912 else if(op2.kind == 23 && op2.type->isSigned)
1913 *value2 = (ssize_t)op2.i64;
1914 else if(op2.kind == 23)
1915 *value2 = (ssize_t)op2.ui64;
1916 else if(op2.kind == 22 && op2.type->isSigned)
1917 *value2 = (ssize_t)op2.i64;
1918 else if(op2.kind == 22)
1919 *value2 = (ssize_t)op2.ui64;
1920 else if(op2.kind == 2 && op2.type->isSigned)
1921 *value2 = (ssize_t)op2.s;
1922 else if(op2.kind == 2)
1923 *value2 = (ssize_t)op2.us;
1924 else if(op2.kind == 1 && op2.type->isSigned)
1925 *value2 = (ssize_t)op2.c;
1926 else if(op2.kind == 24 || op2.kind == 1)
1927 *value2 = (ssize_t)op2.uc;
1928 else if(op2.kind == 6)
1929 *value2 = (ssize_t)op2.f;
1930 else if(op2.kind == 7)
1931 *value2 = (ssize_t)op2.d;
1932 else if(op2.kind == 13)
1933 *value2 = (ssize_t)op2.ui64;
1939 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1941 struct Operand op2 = GetOperand(exp);
1943 if(op2.kind == 3 && op2.type->isSigned)
1944 *value2 = (size_t)op2.i;
1945 else if(op2.kind == 3)
1946 *value2 = (size_t)op2.ui;
1947 else if(op2.kind == 4 && op2.type->isSigned)
1948 *value2 = (size_t)op2.i64;
1949 else if(op2.kind == 4)
1950 *value2 = (size_t)op2.ui64;
1951 else if(op2.kind == 23 && op2.type->isSigned)
1952 *value2 = (size_t)op2.i64;
1953 else if(op2.kind == 23)
1954 *value2 = (size_t)op2.ui64;
1955 else if(op2.kind == 22 && op2.type->isSigned)
1956 *value2 = (size_t)op2.i64;
1957 else if(op2.kind == 22)
1958 *value2 = (size_t)op2.ui64;
1959 else if(op2.kind == 2 && op2.type->isSigned)
1960 *value2 = (size_t)op2.s;
1961 else if(op2.kind == 2)
1962 *value2 = (size_t)op2.us;
1963 else if(op2.kind == 1 && op2.type->isSigned)
1964 *value2 = (size_t)op2.c;
1965 else if(op2.kind == 24 || op2.kind == 1)
1966 *value2 = (size_t)op2.uc;
1967 else if(op2.kind == 6)
1968 *value2 = (size_t)op2.f;
1969 else if(op2.kind == 7)
1970 *value2 = (size_t)op2.d;
1971 else if(op2.kind == 13)
1972 *value2 = (size_t)op2.ui64;
1978 unsigned int GetShort(struct Expression * exp, short * value2)
1980 struct Operand op2 = GetOperand(exp);
1982 if(op2.kind == 3 && op2.type->isSigned)
1983 *value2 = (short)op2.i;
1984 else if(op2.kind == 3)
1985 *value2 = (short)op2.ui;
1986 else if(op2.kind == 4 && op2.type->isSigned)
1987 *value2 = (short)op2.i64;
1988 else if(op2.kind == 4)
1989 *value2 = (short)op2.ui64;
1990 else if(op2.kind == 23 && op2.type->isSigned)
1991 *value2 = (short)op2.i64;
1992 else if(op2.kind == 23)
1993 *value2 = (short)op2.ui64;
1994 else if(op2.kind == 22 && op2.type->isSigned)
1995 *value2 = (short)op2.i64;
1996 else if(op2.kind == 22)
1997 *value2 = (short)op2.ui64;
1998 else if(op2.kind == 2 && op2.type->isSigned)
2000 else if(op2.kind == 2)
2001 *value2 = (short)op2.us;
2002 else if(op2.kind == 1 && op2.type->isSigned)
2003 *value2 = (short)op2.c;
2004 else if(op2.kind == 24 || op2.kind == 1)
2005 *value2 = (short)op2.uc;
2006 else if(op2.kind == 6)
2007 *value2 = (short)op2.f;
2008 else if(op2.kind == 7)
2009 *value2 = (short)op2.d;
2010 else if(op2.kind == 13)
2011 *value2 = (short)op2.ui64;
2017 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2019 struct Operand op2 = GetOperand(exp);
2021 if(op2.kind == 3 && op2.type->isSigned)
2022 *value2 = (unsigned short)op2.i;
2023 else if(op2.kind == 3)
2024 *value2 = (unsigned short)op2.ui;
2025 else if(op2.kind == 4 && op2.type->isSigned)
2026 *value2 = (unsigned short)op2.i64;
2027 else if(op2.kind == 4)
2028 *value2 = (unsigned short)op2.ui64;
2029 else if(op2.kind == 23 && op2.type->isSigned)
2030 *value2 = (unsigned short)op2.i64;
2031 else if(op2.kind == 23)
2032 *value2 = (unsigned short)op2.ui64;
2033 else if(op2.kind == 22 && op2.type->isSigned)
2034 *value2 = (unsigned short)op2.i64;
2035 else if(op2.kind == 22)
2036 *value2 = (unsigned short)op2.ui64;
2037 else if(op2.kind == 2 && op2.type->isSigned)
2038 *value2 = (unsigned short)op2.s;
2039 else if(op2.kind == 2)
2041 else if(op2.kind == 1 && op2.type->isSigned)
2042 *value2 = (unsigned short)op2.c;
2043 else if(op2.kind == 24 || op2.kind == 1)
2044 *value2 = (unsigned short)op2.uc;
2045 else if(op2.kind == 6)
2046 *value2 = (unsigned short)op2.f;
2047 else if(op2.kind == 7)
2048 *value2 = (unsigned short)op2.d;
2049 else if(op2.kind == 13)
2050 *value2 = (unsigned short)op2.ui64;
2056 unsigned int GetChar(struct Expression * exp, char * value2)
2058 struct Operand op2 = GetOperand(exp);
2060 if(op2.kind == 3 && op2.type->isSigned)
2061 *value2 = (char)op2.i;
2062 else if(op2.kind == 3)
2063 *value2 = (char)op2.ui;
2064 else if(op2.kind == 4 && op2.type->isSigned)
2065 *value2 = (char)op2.i64;
2066 else if(op2.kind == 4)
2067 *value2 = (char)op2.ui64;
2068 else if(op2.kind == 23 && op2.type->isSigned)
2069 *value2 = (char)op2.i64;
2070 else if(op2.kind == 23)
2071 *value2 = (char)op2.ui64;
2072 else if(op2.kind == 22 && op2.type->isSigned)
2073 *value2 = (char)op2.i64;
2074 else if(op2.kind == 22)
2075 *value2 = (char)op2.ui64;
2076 else if(op2.kind == 2 && op2.type->isSigned)
2077 *value2 = (char)op2.s;
2078 else if(op2.kind == 2)
2079 *value2 = (char)op2.us;
2080 else if(op2.kind == 1 && op2.type->isSigned)
2082 else if(op2.kind == 24 || op2.kind == 1)
2083 *value2 = (char)op2.uc;
2084 else if(op2.kind == 6)
2085 *value2 = (char)op2.f;
2086 else if(op2.kind == 7)
2087 *value2 = (char)op2.d;
2088 else if(op2.kind == 13)
2089 *value2 = (char)op2.ui64;
2095 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2097 struct Operand op2 = GetOperand(exp);
2099 if(op2.kind == 3 && op2.type->isSigned)
2100 *value2 = (unsigned char)op2.i;
2101 else if(op2.kind == 3)
2102 *value2 = (unsigned char)op2.ui;
2103 else if(op2.kind == 4 && op2.type->isSigned)
2104 *value2 = (unsigned char)op2.i64;
2105 else if(op2.kind == 4)
2106 *value2 = (unsigned char)op2.ui64;
2107 else if(op2.kind == 23 && op2.type->isSigned)
2108 *value2 = (unsigned char)op2.i64;
2109 else if(op2.kind == 23)
2110 *value2 = (unsigned char)op2.ui64;
2111 else if(op2.kind == 22 && op2.type->isSigned)
2112 *value2 = (unsigned char)op2.i64;
2113 else if(op2.kind == 22)
2114 *value2 = (unsigned char)op2.ui64;
2115 else if(op2.kind == 2 && op2.type->isSigned)
2116 *value2 = (unsigned char)op2.s;
2117 else if(op2.kind == 2)
2118 *value2 = (unsigned char)op2.us;
2119 else if(op2.kind == 1 && op2.type->isSigned)
2120 *value2 = (unsigned char)op2.c;
2121 else if(op2.kind == 24 || op2.kind == 1)
2123 else if(op2.kind == 6)
2124 *value2 = (unsigned char)op2.f;
2125 else if(op2.kind == 7)
2126 *value2 = (unsigned char)op2.d;
2127 else if(op2.kind == 13)
2128 *value2 = (unsigned char)op2.ui64;
2134 unsigned int GetFloat(struct Expression * exp, float * value2)
2136 struct Operand op2 = GetOperand(exp);
2138 if(op2.kind == 3 && op2.type->isSigned)
2139 *value2 = (float)(float)op2.i;
2140 else if(op2.kind == 3)
2141 *value2 = (float)(float)op2.ui;
2142 else if(op2.kind == 4 && op2.type->isSigned)
2143 *value2 = (float)(float)op2.i64;
2144 else if(op2.kind == 4)
2145 *value2 = (float)(float)op2.ui64;
2146 else if(op2.kind == 23 && op2.type->isSigned)
2147 *value2 = (float)(float)op2.i64;
2148 else if(op2.kind == 23)
2149 *value2 = (float)(float)op2.ui64;
2150 else if(op2.kind == 22 && op2.type->isSigned)
2151 *value2 = (float)(float)op2.i64;
2152 else if(op2.kind == 22)
2153 *value2 = (float)(float)op2.ui64;
2154 else if(op2.kind == 2 && op2.type->isSigned)
2155 *value2 = (float)(float)op2.s;
2156 else if(op2.kind == 2)
2157 *value2 = (float)(float)op2.us;
2158 else if(op2.kind == 1 && op2.type->isSigned)
2159 *value2 = (float)(float)op2.c;
2160 else if(op2.kind == 24 || op2.kind == 1)
2161 *value2 = (float)(float)op2.uc;
2162 else if(op2.kind == 6)
2163 *value2 = (float)op2.f;
2164 else if(op2.kind == 7)
2165 *value2 = (float)op2.d;
2166 else if(op2.kind == 13)
2167 *value2 = (float)(float)op2.ui64;
2173 unsigned int GetDouble(struct Expression * exp, double * value2)
2175 struct Operand op2 = GetOperand(exp);
2177 if(op2.kind == 3 && op2.type->isSigned)
2178 *value2 = (double)(double)op2.i;
2179 else if(op2.kind == 3)
2180 *value2 = (double)(double)op2.ui;
2181 else if(op2.kind == 4 && op2.type->isSigned)
2182 *value2 = (double)(double)op2.i64;
2183 else if(op2.kind == 4)
2184 *value2 = (double)(double)op2.ui64;
2185 else if(op2.kind == 23 && op2.type->isSigned)
2186 *value2 = (double)(double)op2.i64;
2187 else if(op2.kind == 23)
2188 *value2 = (double)(double)op2.ui64;
2189 else if(op2.kind == 22 && op2.type->isSigned)
2190 *value2 = (double)(double)op2.i64;
2191 else if(op2.kind == 22)
2192 *value2 = (double)(double)op2.ui64;
2193 else if(op2.kind == 2 && op2.type->isSigned)
2194 *value2 = (double)(double)op2.s;
2195 else if(op2.kind == 2)
2196 *value2 = (double)(double)op2.us;
2197 else if(op2.kind == 1 && op2.type->isSigned)
2198 *value2 = (double)(double)op2.c;
2199 else if(op2.kind == 24 || op2.kind == 1)
2200 *value2 = (double)(double)op2.uc;
2201 else if(op2.kind == 6)
2202 *value2 = (double)op2.f;
2203 else if(op2.kind == 7)
2204 *value2 = (double)op2.d;
2205 else if(op2.kind == 13)
2206 *value2 = (double)(double)op2.ui64;
2212 void ComputeExpression(struct Expression * exp);
2214 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2216 extern int targetBits;
2218 int ComputeTypeSize(struct Type * type);
2220 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2222 struct __ecereNameSpace__ecere__com__BitMember
2224 struct __ecereNameSpace__ecere__com__BitMember * prev;
2225 struct __ecereNameSpace__ecere__com__BitMember * next;
2227 unsigned int isProperty;
2230 struct __ecereNameSpace__ecere__com__Class * _class;
2231 char * dataTypeString;
2232 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2233 struct Type * dataType;
2238 } __attribute__ ((gcc_struct));
2240 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2242 struct __ecereNameSpace__ecere__sys__OldLink
2244 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2245 struct __ecereNameSpace__ecere__sys__OldLink * next;
2247 } __attribute__ ((gcc_struct));
2249 void FinishTemplatesContext(struct Context * context);
2251 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2253 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2254 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2256 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))
2259 int unionMemberOffset = 0;
2264 member->memberOffset = 0;
2265 if(targetBits < sizeof(void *) * 8)
2266 member->structAlignment = 0;
2268 else if(targetBits < sizeof(void *) * 8)
2269 _class->structAlignment = 0;
2270 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2271 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2272 if(!member && _class->destructionWatchOffset)
2273 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2275 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2277 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2279 if(!dataMember->isProperty)
2281 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2283 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2289 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2291 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2293 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2295 if(!isMember && _class->type == 2 && dataMember->dataType)
2297 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2301 ComputeTypeSize(dataMember->dataType);
2302 if(bitMember->pos == -1)
2303 bitMember->pos = _class->memberOffset;
2304 if(!bitMember->size)
2305 bitMember->size = dataMember->dataType->size * 8;
2306 _class->memberOffset = bitMember->pos + bitMember->size;
2307 for(d = 0; d < bitMember->size; d++)
2313 bitMember->mask = mask << bitMember->pos;
2315 else if(dataMember->type == 0 && dataMember->dataType)
2320 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2321 ComputeTypeSize(dataMember->dataType);
2322 if(dataMember->dataType->bitFieldCount)
2324 bitFields += dataMember->dataType->bitFieldCount;
2331 int size = (bitFields + 7) / 8;
2335 int __simpleStruct0;
2339 int __simpleStruct0;
2341 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2342 if(member->memberOffset % alignment)
2343 member->memberOffset += alignment - (member->memberOffset % alignment);
2345 dataMember->offset = member->memberOffset;
2346 if(member->type == 1)
2347 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2350 member->memberOffset += size;
2357 int __simpleStruct0;
2359 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2360 if(_class->memberOffset % alignment)
2361 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2363 dataMember->offset = _class->memberOffset;
2364 _class->memberOffset += size;
2368 size = dataMember->dataType->size;
2369 alignment = dataMember->dataType->alignment;
2373 int __simpleStruct0;
2377 int __simpleStruct0;
2379 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2380 if(member->memberOffset % alignment)
2381 member->memberOffset += alignment - (member->memberOffset % alignment);
2383 dataMember->offset = member->memberOffset;
2384 if(member->type == 1)
2385 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2388 member->memberOffset += size;
2395 int __simpleStruct0;
2397 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2398 if(_class->memberOffset % alignment)
2399 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2401 dataMember->offset = _class->memberOffset;
2402 _class->memberOffset += size;
2409 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2410 alignment = dataMember->structAlignment;
2413 int __simpleStruct0;
2417 int __simpleStruct0;
2419 if(member->memberOffset % alignment)
2420 member->memberOffset += alignment - (member->memberOffset % alignment);
2421 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2423 dataMember->offset = member->memberOffset;
2424 if(member->type == 1)
2425 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2427 member->memberOffset += dataMember->memberOffset;
2433 int __simpleStruct0;
2435 if(_class->memberOffset % alignment)
2436 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2437 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2439 dataMember->offset = _class->memberOffset;
2440 _class->memberOffset += dataMember->memberOffset;
2448 int size = (bitFields + 7) / 8;
2452 int __simpleStruct0;
2456 int __simpleStruct0;
2458 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2459 if(member->memberOffset % alignment)
2460 member->memberOffset += alignment - (member->memberOffset % alignment);
2462 if(member->type == 1)
2463 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2466 member->memberOffset += size;
2473 int __simpleStruct0;
2475 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2476 if(_class->memberOffset % alignment)
2477 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2479 _class->memberOffset += size;
2484 if(member && member->type == 1)
2486 member->memberOffset = unionMemberOffset;
2490 if(_class->type != 2)
2494 if(_class->structAlignment)
2496 if(_class->memberOffset % _class->structAlignment)
2497 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2499 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2502 struct __ecereNameSpace__ecere__com__Property * prop;
2504 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2506 if(prop->isProperty && prop->isWatchable)
2508 prop->watcherOffset = _class->structSize;
2509 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2514 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2516 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2518 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2520 if(deriv->computeSize)
2522 deriv->offset = _class->structSize;
2523 deriv->memberOffset = 0;
2524 deriv->structSize = deriv->offset;
2525 ComputeClassMembers(deriv, 0x0);
2533 FinishTemplatesContext(context);
2536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2538 struct __ecereNameSpace__ecere__com__NameSpace
2541 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2542 struct __ecereNameSpace__ecere__com__NameSpace * left;
2543 struct __ecereNameSpace__ecere__com__NameSpace * right;
2545 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2546 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2547 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2548 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2549 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2550 } __attribute__ ((gcc_struct));
2552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2554 struct __ecereNameSpace__ecere__com__Module
2556 struct __ecereNameSpace__ecere__com__Instance * application;
2557 struct __ecereNameSpace__ecere__sys__OldList classes;
2558 struct __ecereNameSpace__ecere__sys__OldList defines;
2559 struct __ecereNameSpace__ecere__sys__OldList functions;
2560 struct __ecereNameSpace__ecere__sys__OldList modules;
2561 struct __ecereNameSpace__ecere__com__Instance * prev;
2562 struct __ecereNameSpace__ecere__com__Instance * next;
2568 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2569 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2570 } __attribute__ ((gcc_struct));
2572 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2574 struct __ecereNameSpace__ecere__com__Class * _class;
2575 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2577 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2578 ComputeModuleClasses(subModule->data);
2579 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2580 ComputeClassMembers(_class, 0x0);
2583 extern unsigned int inCompiler;
2585 extern void Compiler_Error(char * format, ...);
2587 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2589 int ComputeTypeSize(struct Type * type)
2591 unsigned int size = type ? type->size : 0;
2593 if(!size && type && !type->computing)
2595 type->computing = 0x1;
2599 type->alignment = size = sizeof(char);
2602 type->alignment = size = sizeof(char);
2605 type->alignment = size = sizeof(int);
2608 type->alignment = size = sizeof(long long);
2611 type->alignment = size = targetBits / 8;
2614 type->alignment = size = targetBits / 8;
2617 type->alignment = size = sizeof(long);
2620 type->alignment = size = sizeof(short);
2623 type->alignment = size = sizeof(float);
2626 type->alignment = size = sizeof(double);
2630 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2632 if(_class && _class->type == 1)
2634 ComputeClassMembers(_class, 0x0);
2635 type->alignment = _class->structAlignment;
2636 size = _class->structSize;
2637 if(type->alignment && size % type->alignment)
2638 size += type->alignment - (size % type->alignment);
2640 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2642 if(!_class->dataType)
2643 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2644 size = type->alignment = ComputeTypeSize(_class->dataType);
2647 size = type->alignment = targetBits / 8;
2652 size = type->alignment = targetBits / 8;
2655 if(type->arraySizeExp)
2657 ProcessExpressionType(type->arraySizeExp);
2658 ComputeExpression(type->arraySizeExp);
2659 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2661 struct Location oldLoc = yylloc;
2662 char expression[10240];
2664 expression[0] = '\0';
2665 type->arraySizeExp->expType = (((void *)0));
2666 yylloc = type->arraySizeExp->loc;
2668 PrintExpression(type->arraySizeExp, expression);
2669 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2672 GetInt(type->arraySizeExp, &type->arraySize);
2674 else if(type->enumClass)
2676 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2678 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2681 type->arraySize = 0;
2685 type->arraySize = 0;
2687 size = ComputeTypeSize(type->type) * type->arraySize;
2689 type->alignment = type->type->alignment;
2693 struct Type * member;
2695 for(member = type->members.first; member; member = member->next)
2697 int __simpleStruct0, __simpleStruct1;
2698 unsigned int addSize = ComputeTypeSize(member);
2700 member->offset = size;
2701 if(member->alignment && size % member->alignment)
2702 member->offset += member->alignment - (size % member->alignment);
2703 size = member->offset;
2704 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2707 if(type->alignment && size % type->alignment)
2708 size += type->alignment - (size % type->alignment);
2713 struct Type * member;
2715 for(member = type->members.first; member; member = member->next)
2717 int __simpleStruct0, __simpleStruct1;
2718 unsigned int addSize = ComputeTypeSize(member);
2720 member->offset = size;
2721 if(member->alignment && size % member->alignment)
2722 member->offset += member->alignment - (size % member->alignment);
2723 size = member->offset;
2724 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2725 size = ((size > addSize) ? size : addSize);
2727 if(type->alignment && size % type->alignment)
2728 size += type->alignment - (size % type->alignment);
2733 struct TemplateParameter * param = type->templateParameter;
2734 struct Type * baseType = ProcessTemplateParameterType(param);
2738 size = ComputeTypeSize(baseType);
2739 type->alignment = baseType->alignment;
2742 type->alignment = size = sizeof(uint64);
2747 type->alignment = size = sizeof(enum
2755 type->alignment = size = targetBits / 8;
2760 type->computing = 0x0;
2765 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2767 extern struct Identifier * MkIdentifier(char * string);
2769 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2771 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2773 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2775 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2777 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2779 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2781 extern void FreeType(struct Type * type);
2783 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2785 extern struct Specifier * MkSpecifier(int specifier);
2787 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2789 extern struct Expression * MkExpConstant(char * string);
2791 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)
2793 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2794 unsigned int totalSize = 0;
2795 unsigned int maxSize = 0;
2796 int alignment, size;
2797 struct __ecereNameSpace__ecere__com__DataMember * member;
2798 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2801 *addedPadding = 0x0;
2802 if(!isMember && _class->base)
2804 maxSize = _class->structSize;
2806 if(_class->type == 1 || _class->type == 5)
2807 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2810 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2812 if(maxSize > baseSize)
2813 maxSize -= baseSize;
2819 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2821 if(!member->isProperty)
2823 switch(member->type)
2827 if(member->dataTypeString)
2829 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2830 struct Declarator * decl;
2832 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2833 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2834 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2835 if(!member->dataType)
2836 member->dataType = ProcessType(specs, decl);
2837 ReplaceThisClassSpecifiers(specs, topClass);
2839 struct Type * type = ProcessType(specs, decl);
2841 DeclareType(member->dataType, 0x0, 0x0);
2844 ComputeTypeSize(member->dataType);
2845 size = member->dataType->size;
2846 alignment = member->dataType->alignment;
2849 if(totalSize % alignment)
2850 totalSize += alignment - (totalSize % alignment);
2859 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2862 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2863 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2864 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2865 alignment = member->structAlignment;
2868 if(totalSize % alignment)
2869 totalSize += alignment - (totalSize % alignment);
2879 unsigned int __simpleStruct0;
2881 if(topMember && topMember->type == 1)
2882 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2884 *retSize += totalSize;
2886 else if(totalSize < maxSize && _class->type != 1000)
2888 int autoPadding = 0;
2890 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2891 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2892 if(totalSize + autoPadding < maxSize)
2894 char sizeString[50];
2896 sprintf(sizeString, "%d", maxSize - totalSize);
2897 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2899 *addedPadding = 0x1;
2903 FinishTemplatesContext(context);
2904 return topMember ? topMember->memberID : _class->memberID;
2907 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2909 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2910 unsigned int totalSize = 0;
2911 struct __ecereNameSpace__ecere__com__DataMember * member;
2912 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2914 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2915 DeclareMembers(_class->base, 0x0);
2916 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2918 if(!member->isProperty)
2920 switch(member->type)
2924 if(!member->dataType && member->dataTypeString)
2925 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2926 if(member->dataType)
2927 DeclareType(member->dataType, 0x0, 0x0);
2933 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2940 FinishTemplatesContext(context);
2941 return topMember ? topMember->memberID : _class->memberID;
2944 extern struct Symbol * FindClass(char * name);
2946 extern char * strchr(const char * , int);
2948 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2950 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2952 extern void FreeClassDef(struct ClassDef * def);
2954 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2956 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2958 extern char * strcpy(char * , const char * );
2960 extern void MangleClassName(char * className);
2962 extern void DeclareClass(struct Symbol * classSym, char * className);
2964 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2966 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2968 void DeclareStruct(char * name, unsigned int skipNoHead)
2970 struct External * external = (((void *)0));
2971 struct Symbol * classSym = FindClass(name);
2973 if(!inCompiler || !classSym)
2975 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2977 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2979 struct Declaration * decl;
2980 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2981 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2982 char structName[1024];
2984 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2985 classSym->declaring++;
2986 if(strchr(classSym->string, '<'))
2988 if(classSym->registered->templateClass)
2990 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2991 classSym->declaring--;
2995 DeclareMembers(classSym->registered, 0x0);
2996 structName[0] = (char)0;
2997 FullClassNameCat(structName, name, 0x0);
3000 unsigned int addedPadding = 0x0;
3002 classSym->declaredStructSym = 0x1;
3003 declarations = MkList();
3004 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3005 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3007 FreeList(declarations, FreeClassDef);
3008 declarations = (((void *)0));
3011 if(skipNoHead || declarations)
3013 if(external && external->declaration)
3015 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3016 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3018 if(classSym->structExternal)
3019 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3021 classSym->id = curExternal->symbol->idCode;
3022 classSym->idCode = curExternal->symbol->idCode;
3028 external = MkExternalDeclaration((((void *)0)));
3029 specifiers = MkList();
3030 declarators = MkList();
3031 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3032 external->declaration = decl = MkDeclaration(specifiers, declarators);
3033 if(decl->symbol && !decl->symbol->pointerExternal)
3034 decl->symbol->pointerExternal = external;
3035 if(classSym->registered && classSym->registered->type == 1)
3037 char className[1024];
3039 strcpy(className, "__ecereClass_");
3040 FullClassNameCat(className, classSym->string, 0x1);
3041 MangleClassName(className);
3042 DeclareClass(classSym, className);
3043 external->symbol = classSym;
3044 classSym->pointerExternal = external;
3045 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3046 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3050 char className[1024];
3052 strcpy(className, "__ecereClass_");
3053 FullClassNameCat(className, classSym->string, 0x1);
3054 MangleClassName(className);
3055 classSym->structExternal = external;
3056 DeclareClass(classSym, className);
3057 external->symbol = classSym;
3059 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3062 classSym->declaring--;
3064 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3066 classSym->declaring++;
3068 if(classSym->registered)
3069 DeclareMembers(classSym->registered, 0x0);
3071 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3073 if(classSym->structExternal)
3074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3075 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3076 classSym->id = curExternal->symbol->idCode;
3077 classSym->idCode = curExternal->symbol->idCode;
3079 classSym->declaring--;
3083 extern char * strcat(char * , const char * );
3085 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3087 extern struct ModuleImport * mainModule;
3089 extern struct Specifier * MkSpecifierName(char * name);
3091 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3093 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3095 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3097 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3099 extern void FreeDeclarator(struct Declarator * decl);
3101 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3103 struct PropertyImport
3105 struct PropertyImport * prev;
3106 struct PropertyImport * next;
3108 unsigned int isVirtual;
3109 unsigned int hasSet;
3110 unsigned int hasGet;
3111 } __attribute__ ((gcc_struct));
3113 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3115 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3117 struct Symbol * symbol = prop->symbol;
3118 char propName[1024];
3120 strcpy(setName, "__ecereProp_");
3121 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3122 strcat(setName, "_Set_");
3123 FullClassNameCat(setName, prop->name, 0x1);
3124 strcpy(getName, "__ecereProp_");
3125 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3126 strcat(getName, "_Get_");
3127 FullClassNameCat(getName, prop->name, 0x1);
3128 strcpy(propName, "__ecereProp_");
3129 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3130 strcat(propName, "_");
3131 FullClassNameCat(propName, prop->name, 0x1);
3132 MangleClassName(getName);
3133 MangleClassName(setName);
3134 MangleClassName(propName);
3135 if(prop->_class->type == 1)
3136 DeclareStruct(prop->_class->fullName, 0x0);
3137 if(!symbol || curExternal->symbol->idCode < symbol->id)
3139 unsigned int imported = 0x0;
3140 unsigned int dllImport = 0x0;
3142 if(!symbol || symbol->_import)
3146 struct Symbol * classSym;
3148 if(!prop->_class->symbol)
3149 prop->_class->symbol = FindClass(prop->_class->fullName);
3150 classSym = prop->_class->symbol;
3151 if(classSym && !classSym->_import)
3153 struct ModuleImport * module;
3155 if(prop->_class->module)
3156 module = FindModule(prop->_class->module);
3158 module = mainModule;
3159 classSym->_import = __extension__ ({
3160 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3162 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3166 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3167 symbol->_import = (struct ClassImport *)__extension__ ({
3168 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3170 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3173 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3176 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3181 struct Context * context = SetupTemplatesContext(prop->_class);
3183 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3184 FinishTemplatesContext(context);
3188 if(!symbol->externalGet || symbol->externalGet->type == 0)
3190 struct Declaration * decl;
3191 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3192 struct Declarator * d;
3193 struct __ecereNameSpace__ecere__sys__OldList * params;
3194 struct Specifier * spec;
3195 struct External * external;
3196 struct Declarator * typeDecl;
3197 unsigned int simple = 0x0;
3199 specifiers = MkList();
3200 declarators = MkList();
3202 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3203 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3205 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3207 struct Context * context = SetupTemplatesContext(prop->_class);
3209 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3210 FinishTemplatesContext(context);
3212 for(spec = (*specifiers).first; spec; spec = spec->next)
3216 if((!typeDecl || typeDecl->type == 1))
3218 struct Symbol * classSym = spec->symbol;
3220 symbol->_class = classSym->registered;
3221 if(classSym->registered && classSym->registered->type == 1)
3223 DeclareStruct(spec->name, 0x0);
3230 d = PlugDeclarator(typeDecl, d);
3233 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3234 specifiers = MkList();
3236 d = MkDeclaratorFunction(d, params);
3238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3239 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3242 ListAdd(specifiers, MkSpecifier(VOID));
3243 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3244 decl = MkDeclaration(specifiers, declarators);
3245 external = MkExternalDeclaration(decl);
3246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3247 external->symbol = symbol;
3248 symbol->externalGet = external;
3249 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3251 FreeDeclarator(typeDecl);
3255 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3260 if(!symbol->externalSet || symbol->externalSet->type == 0)
3262 struct Declaration * decl;
3263 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3264 struct Declarator * d;
3265 struct __ecereNameSpace__ecere__sys__OldList * params;
3266 struct Specifier * spec;
3267 struct External * external;
3268 struct Declarator * typeDecl;
3270 declarators = MkList();
3272 if(!prop->conversion || prop->_class->type == 1)
3274 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3276 specifiers = MkList();
3278 struct Context * context = SetupTemplatesContext(prop->_class);
3280 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3281 FinishTemplatesContext(context);
3283 ListAdd(params, MkTypeName(specifiers, d));
3284 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3286 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3287 d = MkDeclaratorFunction(d, params);
3288 for(spec = (*specifiers).first; spec; spec = spec->next)
3292 if((!typeDecl || typeDecl->type == 1))
3294 struct Symbol * classSym = spec->symbol;
3296 symbol->_class = classSym->registered;
3297 if(classSym->registered && classSym->registered->type == 1)
3298 DeclareStruct(spec->name, 0x0);
3302 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3303 specifiers = MkList();
3305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3306 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3308 if(!prop->conversion || prop->_class->type == 1)
3309 ListAdd(specifiers, MkSpecifier(VOID));
3311 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3312 decl = MkDeclaration(specifiers, declarators);
3313 external = MkExternalDeclaration(decl);
3314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3315 external->symbol = symbol;
3316 symbol->externalSet = external;
3317 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3324 if(!symbol->externalPtr)
3326 struct Declaration * decl;
3327 struct External * external;
3328 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3333 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3334 ListAdd(specifiers, MkSpecifierName("Property"));
3336 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3338 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3341 strcpy(propName, "__ecerePropM_");
3342 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3343 strcat(propName, "_");
3344 FullClassNameCat(propName, prop->name, 0x1);
3345 MangleClassName(propName);
3346 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3348 decl = MkDeclaration(specifiers, list);
3350 external = MkExternalDeclaration(decl);
3351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3352 external->symbol = symbol;
3353 symbol->externalPtr = external;
3357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3359 symbol->id = curExternal->symbol->idCode;
3363 struct Type * Dereference(struct Type * source)
3365 struct Type * type = (((void *)0));
3369 if(source->kind == 13 || source->kind == 12)
3371 type = source->type;
3372 source->type->refCount++;
3374 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3376 type = __extension__ ({
3377 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3379 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3382 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3388 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3393 static struct Type * Reference(struct Type * source)
3395 struct Type * type = (((void *)0));
3399 type = __extension__ ({
3400 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3402 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3409 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);
3411 extern void * memcpy(void * , const void * , size_t size);
3413 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3415 extern void FreeExpression(struct Expression * exp);
3417 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3419 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);
3421 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3423 extern struct Type * MkClassType(char * name);
3425 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);
3427 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)
3429 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3430 unsigned int found = 0x0;
3431 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3432 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3433 unsigned int freeType = 0x0;
3435 yylloc = member->loc;
3440 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3444 dataMember = *curMember;
3450 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3451 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3452 int _subMemberStackPos = 0;
3455 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3458 dataMember = thisMember;
3459 if(curMember && thisMember->memberAccess == 1)
3461 *curMember = thisMember;
3462 *curClass = thisMember->_class;
3463 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3464 *subMemberStackPos = _subMemberStackPos;
3470 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3471 if(method && method->type == 1)
3474 method = (((void *)0));
3479 struct Type * type = (((void *)0));
3483 if(!dataMember->dataType && dataMember->dataTypeString)
3485 struct Context * context = SetupTemplatesContext(_class);
3487 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3488 FinishTemplatesContext(context);
3490 type = dataMember->dataType;
3494 if(!method->dataType)
3495 ProcessMethodType(method);
3496 type = method->dataType;
3498 if(ident && ident->next)
3500 for(ident = ident->next; ident && type; ident = ident->next)
3504 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3506 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3508 type = dataMember->dataType;
3510 else if(type->kind == 9 || type->kind == 10)
3512 struct Type * memberType;
3514 for(memberType = type->members.first; memberType; memberType = memberType->next)
3516 if(!strcmp(memberType->name, ident->string))
3525 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3529 struct __ecereNameSpace__ecere__com__Class * sClass;
3531 for(sClass = _class; sClass; sClass = sClass->base)
3534 if(sClass->templateClass)
3535 sClass = sClass->templateClass;
3536 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3538 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3540 for(sClass = sClass->base; sClass; sClass = sClass->base)
3542 if(sClass->templateClass)
3543 sClass = sClass->templateClass;
3544 id += sClass->templateParams.count;
3555 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3557 if(arg.dataTypeString)
3559 type = ProcessTypeString(arg.dataTypeString, 0x0);
3561 if(type && _class->templateClass)
3562 type->passAsTemplate = 0x1;
3569 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3571 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3572 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3576 char templateString[1024];
3577 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3579 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3580 for(cClass = expClass; cClass; cClass = cClass->base)
3584 if(cClass->templateClass)
3585 cClass = cClass->templateClass;
3586 for(param = cClass->templateParams.first; param; param = param->next)
3589 struct __ecereNameSpace__ecere__com__Class * sClass;
3590 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3592 for(sClass = cClass->base; sClass; sClass = sClass->base)
3594 if(sClass->templateClass)
3595 sClass = sClass->templateClass;
3596 id += sClass->templateParams.count;
3598 arg = expClass->templateArgs[id];
3599 for(sClass = _class; sClass; sClass = sClass->base)
3601 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3603 struct __ecereNameSpace__ecere__com__Class * nextClass;
3605 if(sClass->templateClass)
3606 sClass = sClass->templateClass;
3607 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3609 if(nextClass->templateClass)
3610 nextClass = nextClass->templateClass;
3611 p += nextClass->templateParams.count;
3613 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3615 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3617 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3619 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3620 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3634 char expString[1024];
3635 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3636 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3637 struct Expression * exp;
3638 char * string = PrintHexUInt64(arg.expression.ui64);
3640 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3641 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3642 ProcessExpressionType(exp);
3643 ComputeExpression(exp);
3644 expString[0] = '\0';
3645 PrintExpression(exp, expString);
3646 strcat(argument, expString);
3647 FreeExpression(exp);
3652 strcat(argument, arg.member->name);
3657 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3658 strcat(argument, arg.dataTypeString);
3665 strcat(templateString, ", ");
3666 if(lastParam != p - 1)
3668 strcat(templateString, param->name);
3669 strcat(templateString, " = ");
3671 strcat(templateString, argument);
3680 int len = strlen(templateString);
3682 if(templateString[len - 1] == '<')
3686 if(templateString[len - 1] == '>')
3687 templateString[len++] = ' ';
3688 templateString[len++] = '>';
3690 templateString[len++] = '\0';
3693 struct Context * context = SetupTemplatesContext(_class);
3697 type = ProcessTypeString(templateString, 0x0);
3699 FinishTemplatesContext(context);
3702 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3704 ProcessExpressionType(member->initializer->exp);
3705 if(!member->initializer->exp->expType)
3709 char expString[10240];
3711 expString[0] = '\0';
3712 PrintExpression(member->initializer->exp, expString);
3713 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3717 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3719 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3722 else if(member->initializer)
3724 ProcessInitializer(member->initializer, type);
3731 if(_class && _class->type == 3)
3733 if(member->initializer)
3735 struct Type * type = MkClassType(_class->fullName);
3737 ProcessInitializer(member->initializer, type);
3743 if(member->initializer)
3745 ProcessInitializer(member->initializer, (((void *)0)));
3751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3757 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3761 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3766 extern struct Identifier * GetDeclId(struct Declarator * decl);
3768 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);
3770 extern void FreeSpecifier(struct Specifier * spec);
3772 static void ProcessFunction(struct FunctionDefinition * function);
3774 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3776 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3778 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3780 extern void FreeClassFunction(struct ClassFunction * func);
3782 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3784 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3786 void ProcessInstantiationType(struct Instantiation * inst)
3791 struct MembersInit * members;
3792 struct Symbol * classSym;
3793 struct __ecereNameSpace__ecere__com__Class * _class;
3795 classSym = inst->_class->symbol;
3796 _class = classSym ? classSym->registered : (((void *)0));
3797 if(!_class || _class->type != 5)
3798 DeclareStruct(inst->_class->name, 0x0);
3799 afterExternal = afterExternal ? afterExternal : curExternal;
3801 ProcessExpressionType(inst->exp);
3802 inst->isConstant = 0x1;
3805 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3806 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3807 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3808 int subMemberStackPos = 0;
3810 for(members = (*inst->members).first; members; members = members->next)
3812 switch(members->type)
3817 static unsigned int instMethodID = 0;
3818 struct External * external = curExternal;
3819 struct Context * context = curContext;
3820 struct Declarator * declarator = members->function->declarator;
3821 struct Identifier * nameID = GetDeclId(declarator);
3822 char * unmangled = nameID ? nameID->string : (((void *)0));
3823 struct Expression * exp;
3824 struct External * createdExternal = (((void *)0));
3830 strcpy(name, "__ecereInstMeth_");
3831 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3833 strcat(name, nameID->string);
3835 sprintf(number, "_%08d", instMethodID++);
3836 strcat(name, number);
3837 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3841 struct Symbol * symbol = declarator->symbol;
3842 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3844 if(method && method->type == 1)
3846 symbol->method = method;
3847 ProcessMethodType(method);
3848 if(!symbol->type->thisClass)
3850 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3852 if(!currentClass->symbol)
3853 currentClass->symbol = FindClass(currentClass->fullName);
3854 symbol->type->thisClass = currentClass->symbol;
3859 _class->symbol = FindClass(_class->fullName);
3860 symbol->type->thisClass = _class->symbol;
3863 DeclareType(symbol->type, 0x1, 0x1);
3867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3870 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3873 FreeSpecifier(nameID->_class);
3874 nameID->_class = (((void *)0));
3878 struct Type * type = declarator->symbol->type;
3879 struct External * oldExternal = curExternal;
3881 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3883 struct External * externalDecl;
3885 externalDecl = MkExternalDeclaration((((void *)0)));
3886 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3887 if(createdExternal->function)
3889 ProcessFunction(createdExternal->function);
3891 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3893 externalDecl->declaration = decl;
3894 if(decl->symbol && !decl->symbol->pointerExternal)
3895 decl->symbol->pointerExternal = externalDecl;
3896 declarator->symbol->pointerExternal = externalDecl;
3903 curExternal = declarator->symbol->pointerExternal;
3904 ProcessFunction((struct FunctionDefinition *)members->function);
3906 curExternal = external;
3907 curContext = context;
3910 FreeClassFunction(members->function);
3911 exp = QMkExpId(name);
3913 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3914 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3920 if(members->dataMembers && classSym)
3922 struct MemberInit * member;
3923 struct Location oldyyloc = yylloc;
3925 for(member = (*members->dataMembers).first; member; member = member->next)
3927 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3928 if(member->initializer && !member->initializer->isConstant)
3929 inst->isConstant = 0x0;
3941 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3945 if(type->kind == 11)
3947 struct Type * param;
3951 for(param = type->params.first; param; param = param->next)
3952 DeclareType(param, declarePointers, 0x1);
3954 DeclareType(type->returnType, declarePointers, 0x1);
3956 else if(type->kind == 13 && declarePointers)
3957 DeclareType(type->type, declarePointers, 0x0);
3958 else if(type->kind == 8)
3960 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3961 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3963 else if(type->kind == 9 || type->kind == 10)
3965 struct Type * member;
3967 for(member = type->members.first; member; member = member->next)
3968 DeclareType(member, 0x0, 0x0);
3970 else if(type->kind == 12)
3971 DeclareType(type->arrayType, declarePointers, 0x0);
3975 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3977 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3979 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3981 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3982 struct __ecereNameSpace__ecere__com__Class * sClass;
3984 for(sClass = _class; sClass; sClass = sClass->base)
3987 if(sClass->templateClass)
3988 sClass = sClass->templateClass;
3989 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3991 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3993 for(sClass = sClass->base; sClass; sClass = sClass->base)
3995 if(sClass->templateClass)
3996 sClass = sClass->templateClass;
3997 id += sClass->templateParams.count;
4008 arg = &_class->templateArgs[id];
4009 if(arg && param->type == 0)
4010 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4015 extern struct Context * PushContext(void);
4017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4019 struct TemplatedType
4022 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4023 struct __ecereNameSpace__ecere__sys__BTNode * left;
4024 struct __ecereNameSpace__ecere__sys__BTNode * right;
4026 struct TemplateParameter * param;
4027 } __attribute__ ((gcc_struct));
4029 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4031 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4033 struct Context * context = PushContext();
4035 context->templateTypesOnly = 0x1;
4036 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4038 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4040 for(; param; param = param->next)
4042 if(param->type == 0 && param->identifier)
4044 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4046 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4052 struct __ecereNameSpace__ecere__com__Class * sClass;
4054 for(sClass = _class; sClass; sClass = sClass->base)
4056 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4058 for(p = sClass->templateParams.first; p; p = p->next)
4062 struct TemplateParameter * param = p->param;
4063 struct TemplatedType * type;
4067 p->param = param = __extension__ ({
4068 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4070 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4073 type = __extension__ ({
4074 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4076 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4078 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4086 extern void PopContext(struct Context * ctx);
4088 extern void FreeContext(struct Context * context);
4090 void FinishTemplatesContext(struct Context * context)
4092 PopContext(context);
4093 FreeContext(context);
4094 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4097 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4099 if(!method->dataType)
4101 struct Context * context = SetupTemplatesContext(method->_class);
4103 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4104 FinishTemplatesContext(context);
4105 if(method->type != 1 && method->dataType)
4107 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4109 if(!method->_class->symbol)
4110 method->_class->symbol = FindClass(method->_class->fullName);
4111 method->dataType->thisClass = method->_class->symbol;
4117 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4121 struct Context * context = SetupTemplatesContext(prop->_class);
4123 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4124 FinishTemplatesContext(context);
4128 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4130 extern void FreeTypeName(struct TypeName * typeName);
4132 static void ProcessDeclarator(struct Declarator * decl);
4134 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4140 struct MethodImport * prev;
4141 struct MethodImport * next;
4143 unsigned int isVirtual;
4144 } __attribute__ ((gcc_struct));
4146 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4148 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4150 struct Symbol * symbol = method->symbol;
4152 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4154 unsigned int imported = 0x0;
4155 unsigned int dllImport = 0x0;
4157 if(!method->dataType)
4158 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4159 if(!symbol || symbol->_import || method->type == 1)
4161 if(!symbol || method->type == 1)
4163 struct Symbol * classSym;
4165 if(!method->_class->symbol)
4166 method->_class->symbol = FindClass(method->_class->fullName);
4167 classSym = method->_class->symbol;
4168 if(!classSym->_import)
4170 struct ModuleImport * module;
4172 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4173 module = FindModule(method->_class->module);
4175 module = mainModule;
4176 classSym->_import = __extension__ ({
4177 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4179 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4181 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4185 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4187 if(!symbol->_import)
4189 symbol->_import = (struct ClassImport *)__extension__ ({
4190 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4192 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4198 symbol->type = method->dataType;
4200 symbol->type->refCount++;
4203 if(!method->dataType->dllExport)
4206 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4210 if(method->type != 1 && method->dataType)
4211 DeclareType(method->dataType, 0x1, 0x1);
4212 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4214 struct Declaration * decl;
4215 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4216 struct Declarator * d;
4217 struct Declarator * funcDecl;
4218 struct External * external;
4220 specifiers = MkList();
4221 declarators = MkList();
4223 ListAdd(specifiers, MkSpecifier(EXTERN));
4224 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4225 ListAdd(specifiers, MkSpecifier(STATIC));
4226 if(method->type == 1)
4228 ListAdd(specifiers, MkSpecifier(INT));
4229 d = MkDeclaratorIdentifier(MkIdentifier(name));
4233 d = MkDeclaratorIdentifier(MkIdentifier(name));
4235 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4237 struct Context * context = SetupTemplatesContext(method->_class);
4239 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4240 FinishTemplatesContext(context);
4242 funcDecl = GetFuncDecl(d);
4245 struct Specifier * spec, * next;
4247 for(spec = (*specifiers).first; spec; spec = next)
4252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4253 FreeSpecifier(spec);
4257 if(method->dataType && !method->dataType->staticMethod)
4259 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4261 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4262 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")));
4263 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4264 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4266 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4268 struct TypeName * param = (*funcDecl->function.parameters).first;
4270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4271 FreeTypeName(param);
4273 if(!funcDecl->function.parameters)
4274 funcDecl->function.parameters = MkList();
4275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4279 ProcessDeclarator(d);
4280 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4281 decl = MkDeclaration(specifiers, declarators);
4282 ReplaceThisClassSpecifiers(specifiers, method->_class);
4283 if(symbol->pointerExternal)
4285 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4288 *functionSymbol = *symbol;
4289 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4290 if(functionSymbol->type)
4291 functionSymbol->type->refCount++;
4293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4294 symbol->pointerExternal->symbol = functionSymbol;
4296 external = MkExternalDeclaration(decl);
4298 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4299 external->symbol = symbol;
4300 symbol->pointerExternal = external;
4304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4306 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4310 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4312 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4314 unsigned int first = 0x1;
4316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4318 char className[1024];
4320 strcpy(className, _class->fullName);
4321 for(param = _class->templateParams.first; param; param = param->next)
4325 strcat(className, "<");
4327 strcat(className, ", ");
4328 if(lastParam + 1 != p)
4330 strcat(className, param->name);
4331 strcat(className, " = ");
4333 strcat(className, param->name);
4341 int len = strlen(className);
4343 if(className[len - 1] == '>')
4344 className[len++] = ' ';
4345 className[len++] = '>';
4346 className[len++] = '\0';
4348 return __ecereNameSpace__ecere__sys__CopyString(className);
4351 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4354 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4356 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4358 unsigned int first = 0x1;
4360 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4362 char className[1024];
4364 strcpy(className, _class->fullName);
4365 for(param = _class->templateParams.first; param; param = param->next)
4369 strcat(className, "<");
4371 strcat(className, ", ");
4372 if(lastParam + 1 != p)
4374 strcat(className, param->name);
4375 strcat(className, " = ");
4377 strcat(className, param->name);
4385 int len = strlen(className);
4387 if(className[len - 1] == '>')
4388 className[len++] = ' ';
4389 className[len++] = '>';
4390 className[len++] = '\0';
4392 return MkClassType(className);
4396 return MkClassType(_class->fullName);
4400 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4402 if(specs != (((void *)0)) && _class)
4404 struct Specifier * spec;
4406 for(spec = specs->first; spec; spec = spec->next)
4408 if(spec->type == 0 && spec->specifier == THISCLASS)
4411 spec->name = ReplaceThisClass(_class);
4412 spec->symbol = FindClass(spec->name);
4418 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4420 struct __ecereNameSpace__ecere__com__GlobalFunction
4422 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4423 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4426 struct __ecereNameSpace__ecere__com__Instance * module;
4427 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4428 char * dataTypeString;
4429 struct Type * dataType;
4431 } __attribute__ ((gcc_struct));
4433 extern struct Context * globalContext;
4435 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4437 struct FunctionImport
4439 struct FunctionImport * prev;
4440 struct FunctionImport * next;
4442 } __attribute__ ((gcc_struct));
4444 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4446 struct Symbol * symbol = function->symbol;
4448 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4450 unsigned int imported = 0x0;
4451 unsigned int dllImport = 0x0;
4453 if(!function->dataType)
4455 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4456 if(!function->dataType->thisClass)
4457 function->dataType->staticMethod = 0x1;
4463 struct ModuleImport * module = FindModule(function->module);
4465 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4468 if(!function->dataType->dllExport)
4470 symbol->_import = (struct ClassImport *)__extension__ ({
4471 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4473 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4479 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4480 if(!symbol->type->thisClass)
4481 symbol->type->staticMethod = 0x1;
4484 imported = symbol->_import ? 0x1 : 0x0;
4485 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4488 DeclareType(function->dataType, 0x1, 0x1);
4491 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4493 struct Declaration * decl;
4494 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4495 struct Declarator * d;
4496 struct Declarator * funcDecl;
4497 struct External * external;
4499 specifiers = MkList();
4500 declarators = MkList();
4501 ListAdd(specifiers, MkSpecifier(EXTERN));
4502 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4504 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4505 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4506 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4508 struct Specifier * spec;
4510 for(spec = (*specifiers).first; spec; spec = spec->next)
4511 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4514 FreeSpecifier(spec);
4518 funcDecl = GetFuncDecl(d);
4519 if(funcDecl && !funcDecl->function.parameters)
4521 funcDecl->function.parameters = MkList();
4522 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4524 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4526 struct Context * oldCtx = curContext;
4528 curContext = globalContext;
4529 decl = MkDeclaration(specifiers, declarators);
4530 curContext = oldCtx;
4532 if(symbol->pointerExternal)
4534 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4537 *functionSymbol = *symbol;
4538 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4539 if(functionSymbol->type)
4540 functionSymbol->type->refCount++;
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4543 symbol->pointerExternal->symbol = functionSymbol;
4545 external = MkExternalDeclaration(decl);
4547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4548 external->symbol = symbol;
4549 symbol->pointerExternal = external;
4553 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4556 symbol->id = curExternal->symbol->idCode;
4559 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4562 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4567 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4568 struct __ecereNameSpace__ecere__sys__BTNode * left;
4569 struct __ecereNameSpace__ecere__sys__BTNode * right;
4571 struct __ecereNameSpace__ecere__com__Instance * module;
4572 char * dataTypeString;
4573 struct Type * dataType;
4576 } __attribute__ ((gcc_struct));
4578 void DeclareGlobalData(struct GlobalData * data)
4580 struct Symbol * symbol = data->symbol;
4582 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4587 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4590 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4591 DeclareType(data->dataType, 0x1, 0x1);
4594 if(!symbol->pointerExternal)
4596 struct Declaration * decl;
4597 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4598 struct Declarator * d;
4599 struct External * external;
4601 specifiers = MkList();
4602 declarators = MkList();
4603 ListAdd(specifiers, MkSpecifier(EXTERN));
4604 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4605 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4606 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4607 decl = MkDeclaration(specifiers, declarators);
4608 external = MkExternalDeclaration(decl);
4610 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4611 external->symbol = symbol;
4612 symbol->pointerExternal = external;
4616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4619 symbol->id = curExternal->symbol->idCode;
4626 struct Conversion * prev, * next;
4627 struct __ecereNameSpace__ecere__com__Property * convert;
4629 struct Type * resultType;
4630 } __attribute__ ((gcc_struct));
4632 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4634 extern void Compiler_Warning(char * format, ...);
4636 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4638 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)
4642 if(source->kind == 20 && dest->kind != 20)
4644 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4649 if(dest->kind == 20 && source->kind != 20)
4651 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4656 if(dest->classObjectType == 2)
4658 if(source->classObjectType != 3)
4662 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4670 if(source->classObjectType == 3)
4672 if(dest->classObjectType == 3 && source->classObjectType != 2)
4675 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4677 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4680 if(dest->kind == 14 && source->kind != 0)
4682 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))
4684 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))
4686 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4688 if(source->_class->registered && source->_class->registered->type == 3)
4690 if(conversions != (((void *)0)))
4692 if(source->_class->registered == dest->_class->registered)
4697 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4699 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4701 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4703 if(sourceBase == destBase)
4707 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))
4711 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))
4713 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4720 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4724 if(source->kind == 8)
4726 struct __ecereNameSpace__ecere__com__Class * _class;
4728 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4730 struct __ecereNameSpace__ecere__com__Property * convert;
4732 for(convert = _class->conversions.first; convert; convert = convert->next)
4734 if(convert->memberAccess == 1 || _class->module == privateModule)
4736 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4738 if(!convert->dataType)
4739 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4740 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4742 if(!conversions && !convert->Get)
4744 else if(conversions != (((void *)0)))
4746 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))
4750 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4752 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4763 struct __ecereNameSpace__ecere__com__Class * _class;
4765 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4767 struct __ecereNameSpace__ecere__com__Property * convert;
4769 for(convert = _class->conversions.first; convert; convert = convert->next)
4771 if(convert->memberAccess == 1 || _class->module == privateModule)
4773 if(!convert->dataType)
4774 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4775 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4777 if(!conversions && !convert->Set)
4779 else if(conversions != (((void *)0)))
4781 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))
4785 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4787 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4795 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4797 if(!dest->_class->registered->dataType)
4798 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4799 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4801 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4808 if(source->kind == 8)
4810 struct __ecereNameSpace__ecere__com__Class * _class;
4812 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4814 struct __ecereNameSpace__ecere__com__Property * convert;
4816 for(convert = _class->conversions.first; convert; convert = convert->next)
4818 if(convert->memberAccess == 1 || _class->module == privateModule)
4820 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4822 if(!convert->dataType)
4823 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4824 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4826 if(!conversions && !convert->Get)
4828 else if(conversions != (((void *)0)))
4830 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))
4834 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4836 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4844 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4846 if(!source->_class->registered->dataType)
4847 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4848 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4855 if(source->kind == 8 || source->kind == 19)
4857 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4859 else if(dest->kind == 7 && source->kind == 6)
4861 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4863 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4865 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4867 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4869 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4871 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))
4873 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4875 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)))
4877 struct Type * paramSource, * paramDest;
4879 if(dest->kind == 16)
4880 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4881 if(source->kind == 16)
4882 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4883 if(dest->kind == 13 && dest->type->kind == 11)
4885 if(source->kind == 13 && source->type->kind == 11)
4886 source = source->type;
4887 if(dest->kind == 16)
4888 dest = dest->method->dataType;
4889 if(source->kind == 16)
4890 source = source->method->dataType;
4891 paramSource = source->params.first;
4892 if(paramSource && paramSource->kind == 0)
4893 paramSource = (((void *)0));
4894 paramDest = dest->params.first;
4895 if(paramDest && paramDest->kind == 0)
4896 paramDest = (((void *)0));
4897 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4899 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))))
4901 if(paramDest && paramDest->kind == 8)
4902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4907 paramDest = paramDest->next;
4909 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4911 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4915 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4923 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4926 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
4932 paramSource = paramSource->next;
4938 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4946 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4954 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4956 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
4959 for(; paramDest; paramDest = paramDest->next)
4963 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
4967 struct Type * paramDestType = paramDest;
4968 struct Type * paramSourceType = paramSource;
4969 struct Type * type = paramDestType;
4971 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4975 struct __ecereNameSpace__ecere__com__Class * sClass;
4977 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4980 if(sClass->templateClass)
4981 sClass = sClass->templateClass;
4982 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4984 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4986 for(sClass = sClass->base; sClass; sClass = sClass->base)
4988 if(sClass->templateClass)
4989 sClass = sClass->templateClass;
4990 id += sClass->templateParams.count;
5001 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5003 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5006 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)))
5011 PrintType(paramDest, type, 0x0, 0x1);
5012 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5013 if(paramDestType != paramDest)
5014 FreeType(paramDestType);
5017 if(paramDestType != paramDest)
5018 FreeType(paramDestType);
5020 paramSource = paramSource->next;
5024 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5029 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5033 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5035 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5042 static void FreeConvert(struct Conversion * convert)
5044 if(convert->resultType)
5045 FreeType(convert->resultType);
5048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5050 struct __ecereNameSpace__ecere__com__BTNamedLink
5053 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5054 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5055 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5058 } __attribute__ ((gcc_struct));
5060 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5062 struct __ecereNameSpace__ecere__com__EnumClassData
5064 struct __ecereNameSpace__ecere__sys__OldList values;
5066 } __attribute__ ((gcc_struct));
5068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5070 struct __ecereNameSpace__ecere__sys__NamedLink
5072 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5073 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5076 } __attribute__ ((gcc_struct));
5078 extern void FreeExpContents(struct Expression * exp);
5080 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5082 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5084 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5086 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5090 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5092 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5094 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)))
5096 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5098 if(_class->type == 4)
5100 struct __ecereNameSpace__ecere__sys__OldList converts =
5104 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5108 _class->symbol = FindClass(_class->fullName);
5109 type->_class = _class->symbol;
5110 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5112 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5113 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5117 struct __ecereNameSpace__ecere__com__Class * baseClass;
5119 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5121 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5123 for(value = e->values.first; value; value = value->next)
5125 if(!strcmp(value->name, string))
5130 FreeExpContents(sourceExp);
5131 FreeType(sourceExp->expType);
5132 sourceExp->isConstant = 0x1;
5133 sourceExp->expType = MkClassType(baseClass->fullName);
5137 sourceExp->type = 2;
5138 if(!strcmp(baseClass->dataTypeString, "int"))
5139 sprintf(constant, "%d", (int)value->data);
5141 sprintf(constant, "0x%X", (int)value->data);
5142 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5144 while(converts.first)
5146 struct Conversion * convert = converts.first;
5148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5151 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5159 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5162 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)))
5163 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5170 struct __ecereNameSpace__ecere__com__SubModule
5172 struct __ecereNameSpace__ecere__com__SubModule * prev;
5173 struct __ecereNameSpace__ecere__com__SubModule * next;
5174 struct __ecereNameSpace__ecere__com__Instance * module;
5176 } __attribute__ ((gcc_struct));
5178 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5180 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5182 if(searchFor == searchIn)
5184 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5186 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5188 if(ModuleVisibility(subModule->module, searchFor))
5195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5197 struct __ecereNameSpace__ecere__com__Application
5202 unsigned int isGUIApp;
5203 struct __ecereNameSpace__ecere__sys__OldList allModules;
5204 char * parsedCommand;
5205 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5206 } __attribute__ ((gcc_struct));
5208 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5210 struct __ecereNameSpace__ecere__com__Instance * module;
5212 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))
5214 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))
5216 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))
5218 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)
5220 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5226 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5228 void ReadString(char * output, char * string);
5230 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5232 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5234 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5236 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5238 struct Type * source = sourceExp->expType;
5239 struct Type * realDest = dest;
5240 struct Type * backupSourceExpType = (((void *)0));
5242 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5244 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5246 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5248 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5250 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5252 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5254 if(sourceBase == destBase)
5260 struct __ecereNameSpace__ecere__sys__OldList * specs;
5261 unsigned int flag = 0x0;
5262 long long value = (((int)0x7fffffff));
5266 if(sourceExp->type == 2)
5268 if(source->isSigned)
5269 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5271 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5273 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5275 if(source->isSigned)
5276 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5278 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5280 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5283 source = __extension__ ({
5284 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5286 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5291 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5293 if(_class && _class->type == 3)
5295 if(source->kind != 8)
5297 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5298 struct Type * tempDest, * tempSource;
5300 for(; _class->base->type != 1000; _class = _class->base)
5303 tempDest = tempType;
5306 _class->symbol = FindClass(_class->fullName);
5307 tempType->_class = _class->symbol;
5308 tempType->truth = dest->truth;
5309 if(tempType->_class)
5310 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5311 backupSourceExpType = sourceExp->expType;
5312 sourceExp->expType = dest;
5315 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5318 if(_class && _class->type == 2 && source->kind != 8)
5320 if(!dest->_class->registered->dataType)
5321 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5322 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5325 FreeType(sourceExp->expType);
5326 source = sourceExp->expType = MkClassType(dest->_class->string);
5330 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5332 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5333 struct Declarator * decl;
5336 ReadString(string, sourceExp->string);
5337 decl = SpecDeclFromString(string, specs, (((void *)0)));
5338 FreeExpContents(sourceExp);
5339 FreeType(sourceExp->expType);
5340 sourceExp->type = 24;
5341 sourceExp->_classExp.specifiers = specs;
5342 sourceExp->_classExp.decl = decl;
5343 sourceExp->expType = dest;
5347 if(backupSourceExpType)
5348 FreeType(backupSourceExpType);
5352 else if(source->kind == 8)
5354 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5356 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5360 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5361 struct Type * tempDest, * tempSource;
5363 if(!source->_class->registered->dataType)
5364 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5365 for(; _class->base->type != 1000; _class = _class->base)
5368 tempSource = tempType;
5370 tempType->_class = FindClass(_class->fullName);
5371 tempType->truth = source->truth;
5372 tempType->classObjectType = source->classObjectType;
5373 if(tempType->_class)
5374 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5375 if(conversions->last)
5377 ((struct Conversion *)conversions->last)->resultType = dest;
5380 FreeType(sourceExp->expType);
5381 sourceExp->expType = MkClassType(_class->fullName);
5382 sourceExp->expType->truth = source->truth;
5383 sourceExp->expType->classObjectType = source->classObjectType;
5384 if(!sourceExp->destType)
5386 FreeType(sourceExp->destType);
5387 sourceExp->destType = sourceExp->expType;
5388 if(sourceExp->expType)
5389 sourceExp->expType->refCount++;
5391 if(!_class->dataType)
5392 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5394 dest = MkClassType(source->_class->string);
5395 dest->truth = source->truth;
5396 dest->classObjectType = source->classObjectType;
5398 source = _class->dataType;
5400 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5406 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5415 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5417 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5419 if(_class->type == 0 || _class->type == 5)
5421 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5423 *newExp = *sourceExp;
5424 if(sourceExp->destType)
5425 sourceExp->destType->refCount++;
5426 if(sourceExp->expType)
5427 sourceExp->expType->refCount++;
5428 sourceExp->type = 11;
5429 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5430 sourceExp->cast.exp = newExp;
5431 FreeType(sourceExp->expType);
5432 sourceExp->expType = (((void *)0));
5433 ProcessExpressionType(sourceExp);
5436 FreeType(sourceExp->expType);
5437 sourceExp->expType = dest;
5442 if(backupSourceExpType)
5443 FreeType(backupSourceExpType);
5446 if(!_class->dataType)
5447 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5449 dest = _class->dataType;
5452 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))
5454 specs = MkListOne(MkSpecifier(DOUBLE));
5456 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))
5458 specs = MkListOne(MkSpecifier(FLOAT));
5460 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))
5464 ListAdd(specs, MkSpecifier(UNSIGNED));
5465 ListAdd(specs, MkSpecifier(INT64));
5467 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5471 ListAdd(specs, MkSpecifier(UNSIGNED));
5472 ListAdd(specs, MkSpecifier(INT));
5474 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5478 ListAdd(specs, MkSpecifier(UNSIGNED));
5479 ListAdd(specs, MkSpecifier(SHORT));
5481 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5485 ListAdd(specs, MkSpecifier(UNSIGNED));
5486 ListAdd(specs, MkSpecifier(CHAR));
5492 if(backupSourceExpType)
5494 if(sourceExp->expType)
5495 FreeType(sourceExp->expType);
5496 sourceExp->expType = backupSourceExpType;
5501 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))
5503 specs = MkListOne(MkSpecifier(DOUBLE));
5505 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))
5507 specs = MkListOne(MkSpecifier(FLOAT));
5509 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5512 ListAdd(specs, MkSpecifier(BOOL));
5514 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)))
5518 ListAdd(specs, MkSpecifier(UNSIGNED));
5519 ListAdd(specs, MkSpecifier(CHAR));
5521 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)))))
5525 ListAdd(specs, MkSpecifier(UNSIGNED));
5526 ListAdd(specs, MkSpecifier(SHORT));
5528 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5532 ListAdd(specs, MkSpecifier(UNSIGNED));
5533 ListAdd(specs, MkSpecifier(INT));
5535 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5539 ListAdd(specs, MkSpecifier(UNSIGNED));
5540 ListAdd(specs, MkSpecifier(INT64));
5542 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5544 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5550 if(backupSourceExpType)
5552 if(sourceExp->expType)
5553 FreeType(sourceExp->expType);
5554 sourceExp->expType = backupSourceExpType;
5560 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5562 *newExp = *sourceExp;
5563 newExp->prev = (((void *)0));
5564 newExp->next = (((void *)0));
5565 if(sourceExp->destType)
5566 sourceExp->destType->refCount++;
5567 if(sourceExp->expType)
5568 sourceExp->expType->refCount++;
5569 sourceExp->type = 11;
5570 if(realDest->kind == 8)
5572 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5573 FreeList(specs, FreeSpecifier);
5576 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5577 if(newExp->type == 4)
5579 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5582 sourceExp->cast.exp = newExp;
5583 FreeType(sourceExp->expType);
5584 sourceExp->expType = (((void *)0));
5585 ProcessExpressionType(sourceExp);
5588 FreeList(specs, FreeSpecifier);
5591 if(backupSourceExpType)
5592 FreeType(backupSourceExpType);
5597 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5598 sourceExp = (*sourceExp->list).last;
5599 if(sourceExp->type == 0)
5601 struct Identifier * id = sourceExp->identifier;
5605 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5607 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5608 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5612 for(; _class && _class->type == 4; _class = _class->base)
5614 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5615 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5617 for(value = e->values.first; value; value = value->next)
5619 if(!strcmp(value->name, id->string))
5624 FreeExpContents(sourceExp);
5625 FreeType(sourceExp->expType);
5626 sourceExp->isConstant = 0x1;
5627 sourceExp->expType = MkClassType(_class->fullName);
5631 sourceExp->type = 2;
5632 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5633 sprintf(constant, "%d", (int)value->data);
5635 sprintf(constant, "0x%X", (int)value->data);
5636 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5644 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5651 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5653 int value2 = op2->i;
5656 exp->string = PrintInt(op1->i + value2);
5659 exp->expType = op1->type;
5661 op1->type->refCount++;
5666 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5668 unsigned int value2 = op2->ui;
5671 exp->string = PrintUInt(op1->ui + value2);
5674 exp->expType = op1->type;
5676 op1->type->refCount++;
5681 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5683 long long value2 = op2->i64;
5686 exp->string = PrintInt64(op1->i64 + value2);
5689 exp->expType = op1->type;
5691 op1->type->refCount++;
5696 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5698 uint64 value2 = op2->ui64;
5701 exp->string = PrintUInt64(op1->ui64 + value2);
5704 exp->expType = op1->type;
5706 op1->type->refCount++;
5711 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5713 short value2 = op2->s;
5716 exp->string = PrintShort(op1->s + value2);
5719 exp->expType = op1->type;
5721 op1->type->refCount++;
5726 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5728 unsigned short value2 = op2->us;
5731 exp->string = PrintUShort(op1->us + value2);
5734 exp->expType = op1->type;
5736 op1->type->refCount++;
5741 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5743 char value2 = op2->c;
5746 exp->string = PrintChar(op1->c + value2);
5749 exp->expType = op1->type;
5751 op1->type->refCount++;
5756 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5758 unsigned char value2 = op2->uc;
5761 exp->string = PrintUChar(op1->uc + value2);
5764 exp->expType = op1->type;
5766 op1->type->refCount++;
5771 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5773 float value2 = op2->f;
5776 exp->string = PrintFloat(op1->f + value2);
5779 exp->expType = op1->type;
5781 op1->type->refCount++;
5786 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5788 double value2 = op2->d;
5791 exp->string = PrintDouble(op1->d + value2);
5794 exp->expType = op1->type;
5796 op1->type->refCount++;
5801 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5803 int value2 = op2->i;
5806 exp->string = PrintInt(op1->i - value2);
5809 exp->expType = op1->type;
5811 op1->type->refCount++;
5816 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5818 unsigned int value2 = op2->ui;
5821 exp->string = PrintUInt(op1->ui - value2);
5824 exp->expType = op1->type;
5826 op1->type->refCount++;
5831 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5833 long long value2 = op2->i64;
5836 exp->string = PrintInt64(op1->i64 - value2);
5839 exp->expType = op1->type;
5841 op1->type->refCount++;
5846 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5848 uint64 value2 = op2->ui64;
5851 exp->string = PrintUInt64(op1->ui64 - value2);
5854 exp->expType = op1->type;
5856 op1->type->refCount++;
5861 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5863 short value2 = op2->s;
5866 exp->string = PrintShort(op1->s - value2);
5869 exp->expType = op1->type;
5871 op1->type->refCount++;
5876 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5878 unsigned short value2 = op2->us;
5881 exp->string = PrintUShort(op1->us - value2);
5884 exp->expType = op1->type;
5886 op1->type->refCount++;
5891 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5893 char value2 = op2->c;
5896 exp->string = PrintChar(op1->c - value2);
5899 exp->expType = op1->type;
5901 op1->type->refCount++;
5906 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5908 unsigned char value2 = op2->uc;
5911 exp->string = PrintUChar(op1->uc - value2);
5914 exp->expType = op1->type;
5916 op1->type->refCount++;
5921 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5923 float value2 = op2->f;
5926 exp->string = PrintFloat(op1->f - value2);
5929 exp->expType = op1->type;
5931 op1->type->refCount++;
5936 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5938 double value2 = op2->d;
5941 exp->string = PrintDouble(op1->d - value2);
5944 exp->expType = op1->type;
5946 op1->type->refCount++;
5951 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5953 int value2 = op2->i;
5956 exp->string = PrintInt(op1->i * value2);
5959 exp->expType = op1->type;
5961 op1->type->refCount++;
5966 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5968 unsigned int value2 = op2->ui;
5971 exp->string = PrintUInt(op1->ui * value2);
5974 exp->expType = op1->type;
5976 op1->type->refCount++;
5981 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5983 long long value2 = op2->i64;
5986 exp->string = PrintInt64(op1->i64 * value2);
5989 exp->expType = op1->type;
5991 op1->type->refCount++;
5996 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5998 uint64 value2 = op2->ui64;
6001 exp->string = PrintUInt64(op1->ui64 * value2);
6004 exp->expType = op1->type;
6006 op1->type->refCount++;
6011 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6013 short value2 = op2->s;
6016 exp->string = PrintShort(op1->s * value2);
6019 exp->expType = op1->type;
6021 op1->type->refCount++;
6026 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6028 unsigned short value2 = op2->us;
6031 exp->string = PrintUShort(op1->us * value2);
6034 exp->expType = op1->type;
6036 op1->type->refCount++;
6041 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6043 char value2 = op2->c;
6046 exp->string = PrintChar(op1->c * value2);
6049 exp->expType = op1->type;
6051 op1->type->refCount++;
6056 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6058 unsigned char value2 = op2->uc;
6061 exp->string = PrintUChar(op1->uc * value2);
6064 exp->expType = op1->type;
6066 op1->type->refCount++;
6071 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6073 float value2 = op2->f;
6076 exp->string = PrintFloat(op1->f * value2);
6079 exp->expType = op1->type;
6081 op1->type->refCount++;
6086 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6088 double value2 = op2->d;
6091 exp->string = PrintDouble(op1->d * value2);
6094 exp->expType = op1->type;
6096 op1->type->refCount++;
6101 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6103 int value2 = op2->i;
6106 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6109 exp->expType = op1->type;
6111 op1->type->refCount++;
6116 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6118 unsigned int value2 = op2->ui;
6121 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6124 exp->expType = op1->type;
6126 op1->type->refCount++;
6131 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6133 long long value2 = op2->i64;
6136 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6139 exp->expType = op1->type;
6141 op1->type->refCount++;
6146 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6148 uint64 value2 = op2->ui64;
6151 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6154 exp->expType = op1->type;
6156 op1->type->refCount++;
6161 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6163 short value2 = op2->s;
6166 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6169 exp->expType = op1->type;
6171 op1->type->refCount++;
6176 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6178 unsigned short value2 = op2->us;
6181 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6184 exp->expType = op1->type;
6186 op1->type->refCount++;
6191 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6193 char value2 = op2->c;
6196 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6199 exp->expType = op1->type;
6201 op1->type->refCount++;
6206 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6208 unsigned char value2 = op2->uc;
6211 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6214 exp->expType = op1->type;
6216 op1->type->refCount++;
6221 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6223 float value2 = op2->f;
6226 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6229 exp->expType = op1->type;
6231 op1->type->refCount++;
6236 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6238 double value2 = op2->d;
6241 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6244 exp->expType = op1->type;
6246 op1->type->refCount++;
6251 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6253 int value2 = op2->i;
6256 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6259 exp->expType = op1->type;
6261 op1->type->refCount++;
6266 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6268 unsigned int value2 = op2->ui;
6271 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6274 exp->expType = op1->type;
6276 op1->type->refCount++;
6281 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6283 long long value2 = op2->i64;
6286 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6289 exp->expType = op1->type;
6291 op1->type->refCount++;
6296 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6298 uint64 value2 = op2->ui64;
6301 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6304 exp->expType = op1->type;
6306 op1->type->refCount++;
6311 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6313 short value2 = op2->s;
6316 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6319 exp->expType = op1->type;
6321 op1->type->refCount++;
6326 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6328 unsigned short value2 = op2->us;
6331 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6334 exp->expType = op1->type;
6336 op1->type->refCount++;
6341 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6343 char value2 = op2->c;
6346 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6358 unsigned char value2 = op2->uc;
6361 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6364 exp->expType = op1->type;
6366 op1->type->refCount++;
6371 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6374 exp->string = PrintInt((-op1->i));
6377 exp->expType = op1->type;
6379 op1->type->refCount++;
6384 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6387 exp->string = PrintUInt((unsigned int)(-op1->ui));
6390 exp->expType = op1->type;
6392 op1->type->refCount++;
6397 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6400 exp->string = PrintInt64((-op1->i64));
6403 exp->expType = op1->type;
6405 op1->type->refCount++;
6410 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6413 exp->string = PrintUInt64((uint64)(-op1->ui64));
6416 exp->expType = op1->type;
6418 op1->type->refCount++;
6423 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6426 exp->string = PrintShort((-op1->s));
6429 exp->expType = op1->type;
6431 op1->type->refCount++;
6436 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6439 exp->string = PrintUShort((unsigned short)(-op1->us));
6442 exp->expType = op1->type;
6444 op1->type->refCount++;
6449 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6452 exp->string = PrintChar((-op1->c));
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6465 exp->string = PrintUChar((unsigned char)(-op1->uc));
6468 exp->expType = op1->type;
6470 op1->type->refCount++;
6475 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6478 exp->string = PrintFloat((float)(-op1->f));
6481 exp->expType = op1->type;
6483 op1->type->refCount++;
6488 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6491 exp->string = PrintDouble((double)(-op1->d));
6494 exp->expType = op1->type;
6496 op1->type->refCount++;
6501 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6504 exp->string = PrintInt((++op1->i));
6507 exp->expType = op1->type;
6509 op1->type->refCount++;
6514 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6517 exp->string = PrintUInt((++op1->ui));
6520 exp->expType = op1->type;
6522 op1->type->refCount++;
6527 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6530 exp->string = PrintInt64((++op1->i64));
6533 exp->expType = op1->type;
6535 op1->type->refCount++;
6540 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6543 exp->string = PrintUInt64((++op1->ui64));
6546 exp->expType = op1->type;
6548 op1->type->refCount++;
6553 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6556 exp->string = PrintShort((++op1->s));
6559 exp->expType = op1->type;
6561 op1->type->refCount++;
6566 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6569 exp->string = PrintUShort((++op1->us));
6572 exp->expType = op1->type;
6574 op1->type->refCount++;
6579 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6582 exp->string = PrintChar((++op1->c));
6585 exp->expType = op1->type;
6587 op1->type->refCount++;
6592 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6595 exp->string = PrintUChar((++op1->uc));
6598 exp->expType = op1->type;
6600 op1->type->refCount++;
6605 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6608 exp->string = PrintFloat((float)(++op1->f));
6611 exp->expType = op1->type;
6613 op1->type->refCount++;
6618 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6621 exp->string = PrintDouble((double)(++op1->d));
6624 exp->expType = op1->type;
6626 op1->type->refCount++;
6631 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6634 exp->string = PrintInt((--op1->i));
6637 exp->expType = op1->type;
6639 op1->type->refCount++;
6644 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6647 exp->string = PrintUInt((--op1->ui));
6650 exp->expType = op1->type;
6652 op1->type->refCount++;
6657 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6660 exp->string = PrintInt64((--op1->i64));
6663 exp->expType = op1->type;
6665 op1->type->refCount++;
6670 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6673 exp->string = PrintUInt64((--op1->ui64));
6676 exp->expType = op1->type;
6678 op1->type->refCount++;
6683 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6686 exp->string = PrintShort((--op1->s));
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6699 exp->string = PrintUShort((--op1->us));
6702 exp->expType = op1->type;
6704 op1->type->refCount++;
6709 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6712 exp->string = PrintChar((--op1->c));
6715 exp->expType = op1->type;
6717 op1->type->refCount++;
6722 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6725 exp->string = PrintUChar((--op1->uc));
6728 exp->expType = op1->type;
6730 op1->type->refCount++;
6735 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6738 exp->string = PrintFloat((float)(--op1->f));
6741 exp->expType = op1->type;
6743 op1->type->refCount++;
6748 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6751 exp->string = PrintDouble((double)(--op1->d));
6754 exp->expType = op1->type;
6756 op1->type->refCount++;
6761 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6763 int value2 = op2->i;
6766 exp->string = PrintInt(op1->i = value2);
6769 exp->expType = op1->type;
6771 op1->type->refCount++;
6776 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6778 unsigned int value2 = op2->ui;
6781 exp->string = PrintUInt(op1->ui = value2);
6784 exp->expType = op1->type;
6786 op1->type->refCount++;
6791 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6793 long long value2 = op2->i64;
6796 exp->string = PrintInt64(op1->i64 = value2);
6799 exp->expType = op1->type;
6801 op1->type->refCount++;
6806 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6808 uint64 value2 = op2->ui64;
6811 exp->string = PrintUInt64(op1->ui64 = value2);
6814 exp->expType = op1->type;
6816 op1->type->refCount++;
6821 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6823 short value2 = op2->s;
6826 exp->string = PrintShort(op1->s = value2);
6829 exp->expType = op1->type;
6831 op1->type->refCount++;
6836 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6838 unsigned short value2 = op2->us;
6841 exp->string = PrintUShort(op1->us = value2);
6844 exp->expType = op1->type;
6846 op1->type->refCount++;
6851 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6853 char value2 = op2->c;
6856 exp->string = PrintChar(op1->c = value2);
6859 exp->expType = op1->type;
6861 op1->type->refCount++;
6866 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6868 unsigned char value2 = op2->uc;
6871 exp->string = PrintUChar(op1->uc = value2);
6874 exp->expType = op1->type;
6876 op1->type->refCount++;
6881 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6883 float value2 = op2->f;
6886 exp->string = PrintFloat(op1->f = value2);
6889 exp->expType = op1->type;
6891 op1->type->refCount++;
6896 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6898 double value2 = op2->d;
6901 exp->string = PrintDouble(op1->d = value2);
6904 exp->expType = op1->type;
6906 op1->type->refCount++;
6911 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6913 int value2 = op2->i;
6916 exp->string = PrintInt(op1->i += value2);
6919 exp->expType = op1->type;
6921 op1->type->refCount++;
6926 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6928 unsigned int value2 = op2->ui;
6931 exp->string = PrintUInt(op1->ui += value2);
6934 exp->expType = op1->type;
6936 op1->type->refCount++;
6941 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6943 long long value2 = op2->i64;
6946 exp->string = PrintInt64(op1->i64 += value2);
6949 exp->expType = op1->type;
6951 op1->type->refCount++;
6956 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6958 uint64 value2 = op2->ui64;
6961 exp->string = PrintUInt64(op1->ui64 += value2);
6964 exp->expType = op1->type;
6966 op1->type->refCount++;
6971 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6973 short value2 = op2->s;
6976 exp->string = PrintShort(op1->s += value2);
6979 exp->expType = op1->type;
6981 op1->type->refCount++;
6986 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6988 unsigned short value2 = op2->us;
6991 exp->string = PrintUShort(op1->us += value2);
6994 exp->expType = op1->type;
6996 op1->type->refCount++;
7001 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7003 char value2 = op2->c;
7006 exp->string = PrintChar(op1->c += value2);
7009 exp->expType = op1->type;
7011 op1->type->refCount++;
7016 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7018 unsigned char value2 = op2->uc;
7021 exp->string = PrintUChar(op1->uc += value2);
7024 exp->expType = op1->type;
7026 op1->type->refCount++;
7031 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7033 float value2 = op2->f;
7036 exp->string = PrintFloat(op1->f += value2);
7039 exp->expType = op1->type;
7041 op1->type->refCount++;
7046 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7048 double value2 = op2->d;
7051 exp->string = PrintDouble(op1->d += value2);
7054 exp->expType = op1->type;
7056 op1->type->refCount++;
7061 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7063 int value2 = op2->i;
7066 exp->string = PrintInt(op1->i -= value2);
7069 exp->expType = op1->type;
7071 op1->type->refCount++;
7076 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7078 unsigned int value2 = op2->ui;
7081 exp->string = PrintUInt(op1->ui -= value2);
7084 exp->expType = op1->type;
7086 op1->type->refCount++;
7091 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7093 long long value2 = op2->i64;
7096 exp->string = PrintInt64(op1->i64 -= value2);
7099 exp->expType = op1->type;
7101 op1->type->refCount++;
7106 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 uint64 value2 = op2->ui64;
7111 exp->string = PrintUInt64(op1->ui64 -= value2);
7114 exp->expType = op1->type;
7116 op1->type->refCount++;
7121 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 short value2 = op2->s;
7126 exp->string = PrintShort(op1->s -= value2);
7129 exp->expType = op1->type;
7131 op1->type->refCount++;
7136 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 unsigned short value2 = op2->us;
7141 exp->string = PrintUShort(op1->us -= value2);
7144 exp->expType = op1->type;
7146 op1->type->refCount++;
7151 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 char value2 = op2->c;
7156 exp->string = PrintChar(op1->c -= value2);
7159 exp->expType = op1->type;
7161 op1->type->refCount++;
7166 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 unsigned char value2 = op2->uc;
7171 exp->string = PrintUChar(op1->uc -= value2);
7174 exp->expType = op1->type;
7176 op1->type->refCount++;
7181 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 float value2 = op2->f;
7186 exp->string = PrintFloat(op1->f -= value2);
7189 exp->expType = op1->type;
7191 op1->type->refCount++;
7196 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 double value2 = op2->d;
7201 exp->string = PrintDouble(op1->d -= value2);
7204 exp->expType = op1->type;
7206 op1->type->refCount++;
7211 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 int value2 = op2->i;
7216 exp->string = PrintInt(op1->i *= value2);
7219 exp->expType = op1->type;
7221 op1->type->refCount++;
7226 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 unsigned int value2 = op2->ui;
7231 exp->string = PrintUInt(op1->ui *= value2);
7234 exp->expType = op1->type;
7236 op1->type->refCount++;
7241 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 long long value2 = op2->i64;
7246 exp->string = PrintInt64(op1->i64 *= value2);
7249 exp->expType = op1->type;
7251 op1->type->refCount++;
7256 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 uint64 value2 = op2->ui64;
7261 exp->string = PrintUInt64(op1->ui64 *= value2);
7264 exp->expType = op1->type;
7266 op1->type->refCount++;
7271 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 short value2 = op2->s;
7276 exp->string = PrintShort(op1->s *= value2);
7279 exp->expType = op1->type;
7281 op1->type->refCount++;
7286 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 unsigned short value2 = op2->us;
7291 exp->string = PrintUShort(op1->us *= value2);
7294 exp->expType = op1->type;
7296 op1->type->refCount++;
7301 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 char value2 = op2->c;
7306 exp->string = PrintChar(op1->c *= value2);
7309 exp->expType = op1->type;
7311 op1->type->refCount++;
7316 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 unsigned char value2 = op2->uc;
7321 exp->string = PrintUChar(op1->uc *= value2);
7324 exp->expType = op1->type;
7326 op1->type->refCount++;
7331 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 float value2 = op2->f;
7336 exp->string = PrintFloat(op1->f *= value2);
7339 exp->expType = op1->type;
7341 op1->type->refCount++;
7346 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7348 double value2 = op2->d;
7351 exp->string = PrintDouble(op1->d *= value2);
7354 exp->expType = op1->type;
7356 op1->type->refCount++;
7361 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7363 int value2 = op2->i;
7366 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7369 exp->expType = op1->type;
7371 op1->type->refCount++;
7376 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7378 unsigned int value2 = op2->ui;
7381 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7384 exp->expType = op1->type;
7386 op1->type->refCount++;
7391 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7393 long long value2 = op2->i64;
7396 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7399 exp->expType = op1->type;
7401 op1->type->refCount++;
7406 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7408 uint64 value2 = op2->ui64;
7411 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7414 exp->expType = op1->type;
7416 op1->type->refCount++;
7421 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7423 short value2 = op2->s;
7426 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7429 exp->expType = op1->type;
7431 op1->type->refCount++;
7436 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7438 unsigned short value2 = op2->us;
7441 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7444 exp->expType = op1->type;
7446 op1->type->refCount++;
7451 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7453 char value2 = op2->c;
7456 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7459 exp->expType = op1->type;
7461 op1->type->refCount++;
7466 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7468 unsigned char value2 = op2->uc;
7471 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7474 exp->expType = op1->type;
7476 op1->type->refCount++;
7481 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7483 float value2 = op2->f;
7486 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7489 exp->expType = op1->type;
7491 op1->type->refCount++;
7496 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7498 double value2 = op2->d;
7501 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7504 exp->expType = op1->type;
7506 op1->type->refCount++;
7511 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7513 int value2 = op2->i;
7516 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7519 exp->expType = op1->type;
7521 op1->type->refCount++;
7526 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7528 unsigned int value2 = op2->ui;
7531 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7534 exp->expType = op1->type;
7536 op1->type->refCount++;
7541 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7543 long long value2 = op2->i64;
7546 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7549 exp->expType = op1->type;
7551 op1->type->refCount++;
7556 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7558 uint64 value2 = op2->ui64;
7561 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7564 exp->expType = op1->type;
7566 op1->type->refCount++;
7571 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7573 short value2 = op2->s;
7576 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7579 exp->expType = op1->type;
7581 op1->type->refCount++;
7586 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7588 unsigned short value2 = op2->us;
7591 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7594 exp->expType = op1->type;
7596 op1->type->refCount++;
7601 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7603 char value2 = op2->c;
7606 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7609 exp->expType = op1->type;
7611 op1->type->refCount++;
7616 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7618 unsigned char value2 = op2->uc;
7621 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7624 exp->expType = op1->type;
7626 op1->type->refCount++;
7631 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7633 int value2 = op2->i;
7636 exp->string = PrintInt(op1->i & value2);
7639 exp->expType = op1->type;
7641 op1->type->refCount++;
7646 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7648 unsigned int value2 = op2->ui;
7651 exp->string = PrintUInt(op1->ui & value2);
7654 exp->expType = op1->type;
7656 op1->type->refCount++;
7661 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7663 long long value2 = op2->i64;
7666 exp->string = PrintInt64(op1->i64 & value2);
7669 exp->expType = op1->type;
7671 op1->type->refCount++;
7676 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7678 uint64 value2 = op2->ui64;
7681 exp->string = PrintUInt64(op1->ui64 & value2);
7684 exp->expType = op1->type;
7686 op1->type->refCount++;
7691 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7693 short value2 = op2->s;
7696 exp->string = PrintShort(op1->s & value2);
7699 exp->expType = op1->type;
7701 op1->type->refCount++;
7706 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7708 unsigned short value2 = op2->us;
7711 exp->string = PrintUShort(op1->us & value2);
7714 exp->expType = op1->type;
7716 op1->type->refCount++;
7721 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7723 char value2 = op2->c;
7726 exp->string = PrintChar(op1->c & value2);
7729 exp->expType = op1->type;
7731 op1->type->refCount++;
7736 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7738 unsigned char value2 = op2->uc;
7741 exp->string = PrintUChar(op1->uc & value2);
7744 exp->expType = op1->type;
7746 op1->type->refCount++;
7751 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7753 int value2 = op2->i;
7756 exp->string = PrintInt(op1->i | value2);
7759 exp->expType = op1->type;
7761 op1->type->refCount++;
7766 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7768 unsigned int value2 = op2->ui;
7771 exp->string = PrintUInt(op1->ui | value2);
7774 exp->expType = op1->type;
7776 op1->type->refCount++;
7781 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7783 long long value2 = op2->i64;
7786 exp->string = PrintInt64(op1->i64 | value2);
7789 exp->expType = op1->type;
7791 op1->type->refCount++;
7796 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7798 uint64 value2 = op2->ui64;
7801 exp->string = PrintUInt64(op1->ui64 | value2);
7804 exp->expType = op1->type;
7806 op1->type->refCount++;
7811 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7813 short value2 = op2->s;
7816 exp->string = PrintShort(op1->s | value2);
7819 exp->expType = op1->type;
7821 op1->type->refCount++;
7826 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7828 unsigned short value2 = op2->us;
7831 exp->string = PrintUShort(op1->us | value2);
7834 exp->expType = op1->type;
7836 op1->type->refCount++;
7841 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7843 char value2 = op2->c;
7846 exp->string = PrintChar(op1->c | value2);
7849 exp->expType = op1->type;
7851 op1->type->refCount++;
7856 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7858 unsigned char value2 = op2->uc;
7861 exp->string = PrintUChar(op1->uc | value2);
7864 exp->expType = op1->type;
7866 op1->type->refCount++;
7871 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7873 int value2 = op2->i;
7876 exp->string = PrintInt(op1->i ^ value2);
7879 exp->expType = op1->type;
7881 op1->type->refCount++;
7886 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7888 unsigned int value2 = op2->ui;
7891 exp->string = PrintUInt(op1->ui ^ value2);
7894 exp->expType = op1->type;
7896 op1->type->refCount++;
7901 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7903 long long value2 = op2->i64;
7906 exp->string = PrintInt64(op1->i64 ^ value2);
7909 exp->expType = op1->type;
7911 op1->type->refCount++;
7916 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7918 uint64 value2 = op2->ui64;
7921 exp->string = PrintUInt64(op1->ui64 ^ value2);
7924 exp->expType = op1->type;
7926 op1->type->refCount++;
7931 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7933 short value2 = op2->s;
7936 exp->string = PrintShort(op1->s ^ value2);
7939 exp->expType = op1->type;
7941 op1->type->refCount++;
7946 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7948 unsigned short value2 = op2->us;
7951 exp->string = PrintUShort(op1->us ^ value2);
7954 exp->expType = op1->type;
7956 op1->type->refCount++;
7961 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7963 char value2 = op2->c;
7966 exp->string = PrintChar(op1->c ^ value2);
7969 exp->expType = op1->type;
7971 op1->type->refCount++;
7976 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7978 unsigned char value2 = op2->uc;
7981 exp->string = PrintUChar(op1->uc ^ value2);
7984 exp->expType = op1->type;
7986 op1->type->refCount++;
7991 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7993 int value2 = op2->i;
7996 exp->string = PrintInt(op1->i << value2);
7999 exp->expType = op1->type;
8001 op1->type->refCount++;
8006 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8008 unsigned int value2 = op2->ui;
8011 exp->string = PrintUInt(op1->ui << value2);
8014 exp->expType = op1->type;
8016 op1->type->refCount++;
8021 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8023 long long value2 = op2->i64;
8026 exp->string = PrintInt64(op1->i64 << value2);
8029 exp->expType = op1->type;
8031 op1->type->refCount++;
8036 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8038 uint64 value2 = op2->ui64;
8041 exp->string = PrintUInt64(op1->ui64 << value2);
8044 exp->expType = op1->type;
8046 op1->type->refCount++;
8051 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8053 short value2 = op2->s;
8056 exp->string = PrintShort(op1->s << value2);
8059 exp->expType = op1->type;
8061 op1->type->refCount++;
8066 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8068 unsigned short value2 = op2->us;
8071 exp->string = PrintUShort(op1->us << value2);
8074 exp->expType = op1->type;
8076 op1->type->refCount++;
8081 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8083 char value2 = op2->c;
8086 exp->string = PrintChar(op1->c << value2);
8089 exp->expType = op1->type;
8091 op1->type->refCount++;
8096 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8098 unsigned char value2 = op2->uc;
8101 exp->string = PrintUChar(op1->uc << value2);
8104 exp->expType = op1->type;
8106 op1->type->refCount++;
8111 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8113 int value2 = op2->i;
8116 exp->string = PrintInt(op1->i >> value2);
8119 exp->expType = op1->type;
8121 op1->type->refCount++;
8126 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8128 unsigned int value2 = op2->ui;
8131 exp->string = PrintUInt(op1->ui >> value2);
8134 exp->expType = op1->type;
8136 op1->type->refCount++;
8141 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8143 long long value2 = op2->i64;
8146 exp->string = PrintInt64(op1->i64 >> value2);
8149 exp->expType = op1->type;
8151 op1->type->refCount++;
8156 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8158 uint64 value2 = op2->ui64;
8161 exp->string = PrintUInt64(op1->ui64 >> value2);
8164 exp->expType = op1->type;
8166 op1->type->refCount++;
8171 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8173 short value2 = op2->s;
8176 exp->string = PrintShort(op1->s >> value2);
8179 exp->expType = op1->type;
8181 op1->type->refCount++;
8186 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8188 unsigned short value2 = op2->us;
8191 exp->string = PrintUShort(op1->us >> value2);
8194 exp->expType = op1->type;
8196 op1->type->refCount++;
8201 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8203 char value2 = op2->c;
8206 exp->string = PrintChar(op1->c >> value2);
8209 exp->expType = op1->type;
8211 op1->type->refCount++;
8216 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8218 unsigned char value2 = op2->uc;
8221 exp->string = PrintUChar(op1->uc >> value2);
8224 exp->expType = op1->type;
8226 op1->type->refCount++;
8231 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8234 exp->string = PrintInt((~op1->i));
8237 exp->expType = op1->type;
8239 op1->type->refCount++;
8244 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8247 exp->string = PrintUInt((unsigned int)(~op1->ui));
8250 exp->expType = op1->type;
8252 op1->type->refCount++;
8257 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8260 exp->string = PrintInt64((long long)(~op1->i64));
8263 exp->expType = op1->type;
8265 op1->type->refCount++;
8270 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8273 exp->string = PrintUInt64((uint64)(~op1->ui64));
8276 exp->expType = op1->type;
8278 op1->type->refCount++;
8283 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8286 exp->string = PrintShort((short)(~op1->s));
8289 exp->expType = op1->type;
8291 op1->type->refCount++;
8296 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8299 exp->string = PrintUShort((unsigned short)(~op1->us));
8302 exp->expType = op1->type;
8304 op1->type->refCount++;
8309 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8312 exp->string = PrintChar((char)(~op1->c));
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8325 exp->string = PrintUChar((unsigned char)(~op1->uc));
8328 exp->expType = op1->type;
8330 op1->type->refCount++;
8335 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8337 int value2 = op2->i;
8340 exp->string = PrintInt(op1->i &= value2);
8343 exp->expType = op1->type;
8345 op1->type->refCount++;
8350 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8352 unsigned int value2 = op2->ui;
8355 exp->string = PrintUInt(op1->ui &= value2);
8358 exp->expType = op1->type;
8360 op1->type->refCount++;
8365 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8367 long long value2 = op2->i64;
8370 exp->string = PrintInt64(op1->i64 &= value2);
8373 exp->expType = op1->type;
8375 op1->type->refCount++;
8380 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8382 uint64 value2 = op2->ui64;
8385 exp->string = PrintUInt64(op1->ui64 &= value2);
8388 exp->expType = op1->type;
8390 op1->type->refCount++;
8395 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8397 short value2 = op2->s;
8400 exp->string = PrintShort(op1->s &= value2);
8403 exp->expType = op1->type;
8405 op1->type->refCount++;
8410 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8412 unsigned short value2 = op2->us;
8415 exp->string = PrintUShort(op1->us &= value2);
8418 exp->expType = op1->type;
8420 op1->type->refCount++;
8425 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8427 char value2 = op2->c;
8430 exp->string = PrintChar(op1->c &= value2);
8433 exp->expType = op1->type;
8435 op1->type->refCount++;
8440 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8442 unsigned char value2 = op2->uc;
8445 exp->string = PrintUChar(op1->uc &= value2);
8448 exp->expType = op1->type;
8450 op1->type->refCount++;
8455 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8457 int value2 = op2->i;
8460 exp->string = PrintInt(op1->i |= value2);
8463 exp->expType = op1->type;
8465 op1->type->refCount++;
8470 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8472 unsigned int value2 = op2->ui;
8475 exp->string = PrintUInt(op1->ui |= value2);
8478 exp->expType = op1->type;
8480 op1->type->refCount++;
8485 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8487 long long value2 = op2->i64;
8490 exp->string = PrintInt64(op1->i64 |= value2);
8493 exp->expType = op1->type;
8495 op1->type->refCount++;
8500 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8502 uint64 value2 = op2->ui64;
8505 exp->string = PrintUInt64(op1->ui64 |= value2);
8508 exp->expType = op1->type;
8510 op1->type->refCount++;
8515 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8517 short value2 = op2->s;
8520 exp->string = PrintShort(op1->s |= value2);
8523 exp->expType = op1->type;
8525 op1->type->refCount++;
8530 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8532 unsigned short value2 = op2->us;
8535 exp->string = PrintUShort(op1->us |= value2);
8538 exp->expType = op1->type;
8540 op1->type->refCount++;
8545 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8547 char value2 = op2->c;
8550 exp->string = PrintChar(op1->c |= value2);
8553 exp->expType = op1->type;
8555 op1->type->refCount++;
8560 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8562 unsigned char value2 = op2->uc;
8565 exp->string = PrintUChar(op1->uc |= value2);
8568 exp->expType = op1->type;
8570 op1->type->refCount++;
8575 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8577 int value2 = op2->i;
8580 exp->string = PrintInt(op1->i ^= value2);
8583 exp->expType = op1->type;
8585 op1->type->refCount++;
8590 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8592 unsigned int value2 = op2->ui;
8595 exp->string = PrintUInt(op1->ui ^= value2);
8598 exp->expType = op1->type;
8600 op1->type->refCount++;
8605 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8607 long long value2 = op2->i64;
8610 exp->string = PrintInt64(op1->i64 ^= value2);
8613 exp->expType = op1->type;
8615 op1->type->refCount++;
8620 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8622 uint64 value2 = op2->ui64;
8625 exp->string = PrintUInt64(op1->ui64 ^= value2);
8628 exp->expType = op1->type;
8630 op1->type->refCount++;
8635 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8637 short value2 = op2->s;
8640 exp->string = PrintShort(op1->s ^= value2);
8643 exp->expType = op1->type;
8645 op1->type->refCount++;
8650 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8652 unsigned short value2 = op2->us;
8655 exp->string = PrintUShort(op1->us ^= value2);
8658 exp->expType = op1->type;
8660 op1->type->refCount++;
8665 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8667 char value2 = op2->c;
8670 exp->string = PrintChar(op1->c ^= value2);
8673 exp->expType = op1->type;
8675 op1->type->refCount++;
8680 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8682 unsigned char value2 = op2->uc;
8685 exp->string = PrintUChar(op1->uc ^= value2);
8688 exp->expType = op1->type;
8690 op1->type->refCount++;
8695 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8697 int value2 = op2->i;
8700 exp->string = PrintInt(op1->i <<= value2);
8703 exp->expType = op1->type;
8705 op1->type->refCount++;
8710 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8712 unsigned int value2 = op2->ui;
8715 exp->string = PrintUInt(op1->ui <<= value2);
8718 exp->expType = op1->type;
8720 op1->type->refCount++;
8725 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8727 long long value2 = op2->i64;
8730 exp->string = PrintInt64(op1->i64 <<= value2);
8733 exp->expType = op1->type;
8735 op1->type->refCount++;
8740 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8742 uint64 value2 = op2->ui64;
8745 exp->string = PrintUInt64(op1->ui64 <<= value2);
8748 exp->expType = op1->type;
8750 op1->type->refCount++;
8755 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8757 short value2 = op2->s;
8760 exp->string = PrintShort(op1->s <<= value2);
8763 exp->expType = op1->type;
8765 op1->type->refCount++;
8770 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8772 unsigned short value2 = op2->us;
8775 exp->string = PrintUShort(op1->us <<= value2);
8778 exp->expType = op1->type;
8780 op1->type->refCount++;
8785 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8787 char value2 = op2->c;
8790 exp->string = PrintChar(op1->c <<= value2);
8793 exp->expType = op1->type;
8795 op1->type->refCount++;
8800 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8802 unsigned char value2 = op2->uc;
8805 exp->string = PrintUChar(op1->uc <<= value2);
8808 exp->expType = op1->type;
8810 op1->type->refCount++;
8815 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8817 int value2 = op2->i;
8820 exp->string = PrintInt(op1->i >>= value2);
8823 exp->expType = op1->type;
8825 op1->type->refCount++;
8830 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8832 unsigned int value2 = op2->ui;
8835 exp->string = PrintUInt(op1->ui >>= value2);
8838 exp->expType = op1->type;
8840 op1->type->refCount++;
8845 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8847 long long value2 = op2->i64;
8850 exp->string = PrintInt64(op1->i64 >>= value2);
8853 exp->expType = op1->type;
8855 op1->type->refCount++;
8860 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8862 uint64 value2 = op2->ui64;
8865 exp->string = PrintUInt64(op1->ui64 >>= value2);
8868 exp->expType = op1->type;
8870 op1->type->refCount++;
8875 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8877 short value2 = op2->s;
8880 exp->string = PrintShort(op1->s >>= value2);
8883 exp->expType = op1->type;
8885 op1->type->refCount++;
8890 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8892 unsigned short value2 = op2->us;
8895 exp->string = PrintUShort(op1->us >>= value2);
8898 exp->expType = op1->type;
8900 op1->type->refCount++;
8905 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8907 char value2 = op2->c;
8910 exp->string = PrintChar(op1->c >>= value2);
8913 exp->expType = op1->type;
8915 op1->type->refCount++;
8920 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8922 unsigned char value2 = op2->uc;
8925 exp->string = PrintUChar(op1->uc >>= value2);
8928 exp->expType = op1->type;
8930 op1->type->refCount++;
8935 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8938 exp->string = PrintInt((int)(!op1->i));
8941 exp->expType = op1->type;
8943 op1->type->refCount++;
8948 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8951 exp->string = PrintUInt((unsigned int)(!op1->ui));
8954 exp->expType = op1->type;
8956 op1->type->refCount++;
8961 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8964 exp->string = PrintInt64((long long)(!op1->i64));
8967 exp->expType = op1->type;
8969 op1->type->refCount++;
8974 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8977 exp->string = PrintUInt64((uint64)(!op1->ui64));
8980 exp->expType = op1->type;
8982 op1->type->refCount++;
8987 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8990 exp->string = PrintShort((short)(!op1->s));
8993 exp->expType = op1->type;
8995 op1->type->refCount++;
9000 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9003 exp->string = PrintUShort((unsigned short)(!op1->us));
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9016 exp->string = PrintChar((char)(!op1->c));
9019 exp->expType = op1->type;
9021 op1->type->refCount++;
9026 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9029 exp->string = PrintUChar((unsigned char)(!op1->uc));
9032 exp->expType = op1->type;
9034 op1->type->refCount++;
9039 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9041 int value2 = op2->i;
9044 exp->string = PrintInt(op1->i == value2);
9047 exp->expType = op1->type;
9049 op1->type->refCount++;
9054 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9056 unsigned int value2 = op2->ui;
9059 exp->string = PrintUInt(op1->ui == value2);
9062 exp->expType = op1->type;
9064 op1->type->refCount++;
9069 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9071 long long value2 = op2->i64;
9074 exp->string = PrintInt64(op1->i64 == value2);
9077 exp->expType = op1->type;
9079 op1->type->refCount++;
9084 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9086 uint64 value2 = op2->ui64;
9089 exp->string = PrintUInt64(op1->ui64 == value2);
9092 exp->expType = op1->type;
9094 op1->type->refCount++;
9099 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9101 short value2 = op2->s;
9104 exp->string = PrintShort(op1->s == value2);
9107 exp->expType = op1->type;
9109 op1->type->refCount++;
9114 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9116 unsigned short value2 = op2->us;
9119 exp->string = PrintUShort(op1->us == value2);
9122 exp->expType = op1->type;
9124 op1->type->refCount++;
9129 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9131 char value2 = op2->c;
9134 exp->string = PrintChar(op1->c == value2);
9137 exp->expType = op1->type;
9139 op1->type->refCount++;
9144 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9146 unsigned char value2 = op2->uc;
9149 exp->string = PrintUChar(op1->uc == value2);
9152 exp->expType = op1->type;
9154 op1->type->refCount++;
9159 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9161 float value2 = op2->f;
9164 exp->string = PrintFloat(op1->f == value2);
9167 exp->expType = op1->type;
9169 op1->type->refCount++;
9174 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9176 double value2 = op2->d;
9179 exp->string = PrintDouble(op1->d == value2);
9182 exp->expType = op1->type;
9184 op1->type->refCount++;
9189 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9191 int value2 = op2->i;
9194 exp->string = PrintInt(op1->i != value2);
9197 exp->expType = op1->type;
9199 op1->type->refCount++;
9204 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9206 unsigned int value2 = op2->ui;
9209 exp->string = PrintUInt(op1->ui != value2);
9212 exp->expType = op1->type;
9214 op1->type->refCount++;
9219 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9221 long long value2 = op2->i64;
9224 exp->string = PrintInt64(op1->i64 != value2);
9227 exp->expType = op1->type;
9229 op1->type->refCount++;
9234 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9236 uint64 value2 = op2->ui64;
9239 exp->string = PrintUInt64(op1->ui64 != value2);
9242 exp->expType = op1->type;
9244 op1->type->refCount++;
9249 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9251 short value2 = op2->s;
9254 exp->string = PrintShort(op1->s != value2);
9257 exp->expType = op1->type;
9259 op1->type->refCount++;
9264 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9266 unsigned short value2 = op2->us;
9269 exp->string = PrintUShort(op1->us != value2);
9272 exp->expType = op1->type;
9274 op1->type->refCount++;
9279 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9281 char value2 = op2->c;
9284 exp->string = PrintChar(op1->c != value2);
9287 exp->expType = op1->type;
9289 op1->type->refCount++;
9294 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9296 unsigned char value2 = op2->uc;
9299 exp->string = PrintUChar(op1->uc != value2);
9302 exp->expType = op1->type;
9304 op1->type->refCount++;
9309 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9311 float value2 = op2->f;
9314 exp->string = PrintFloat(op1->f != value2);
9317 exp->expType = op1->type;
9319 op1->type->refCount++;
9324 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9326 double value2 = op2->d;
9329 exp->string = PrintDouble(op1->d != value2);
9332 exp->expType = op1->type;
9334 op1->type->refCount++;
9339 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9341 int value2 = op2->i;
9344 exp->string = PrintInt(op1->i && value2);
9347 exp->expType = op1->type;
9349 op1->type->refCount++;
9354 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9356 unsigned int value2 = op2->ui;
9359 exp->string = PrintUInt(op1->ui && value2);
9362 exp->expType = op1->type;
9364 op1->type->refCount++;
9369 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9371 long long value2 = op2->i64;
9374 exp->string = PrintInt64(op1->i64 && value2);
9377 exp->expType = op1->type;
9379 op1->type->refCount++;
9384 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9386 uint64 value2 = op2->ui64;
9389 exp->string = PrintUInt64(op1->ui64 && value2);
9392 exp->expType = op1->type;
9394 op1->type->refCount++;
9399 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9401 short value2 = op2->s;
9404 exp->string = PrintShort(op1->s && value2);
9407 exp->expType = op1->type;
9409 op1->type->refCount++;
9414 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9416 unsigned short value2 = op2->us;
9419 exp->string = PrintUShort(op1->us && value2);
9422 exp->expType = op1->type;
9424 op1->type->refCount++;
9429 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9431 char value2 = op2->c;
9434 exp->string = PrintChar(op1->c && value2);
9437 exp->expType = op1->type;
9439 op1->type->refCount++;
9444 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9446 unsigned char value2 = op2->uc;
9449 exp->string = PrintUChar(op1->uc && value2);
9452 exp->expType = op1->type;
9454 op1->type->refCount++;
9459 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9461 float value2 = op2->f;
9464 exp->string = PrintFloat(op1->f && value2);
9467 exp->expType = op1->type;
9469 op1->type->refCount++;
9474 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9476 double value2 = op2->d;
9479 exp->string = PrintDouble(op1->d && value2);
9482 exp->expType = op1->type;
9484 op1->type->refCount++;
9489 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9491 int value2 = op2->i;
9494 exp->string = PrintInt(op1->i || value2);
9497 exp->expType = op1->type;
9499 op1->type->refCount++;
9504 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9506 unsigned int value2 = op2->ui;
9509 exp->string = PrintUInt(op1->ui || value2);
9512 exp->expType = op1->type;
9514 op1->type->refCount++;
9519 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9521 long long value2 = op2->i64;
9524 exp->string = PrintInt64(op1->i64 || value2);
9527 exp->expType = op1->type;
9529 op1->type->refCount++;
9534 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9536 uint64 value2 = op2->ui64;
9539 exp->string = PrintUInt64(op1->ui64 || value2);
9542 exp->expType = op1->type;
9544 op1->type->refCount++;
9549 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9551 short value2 = op2->s;
9554 exp->string = PrintShort(op1->s || value2);
9557 exp->expType = op1->type;
9559 op1->type->refCount++;
9564 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9566 unsigned short value2 = op2->us;
9569 exp->string = PrintUShort(op1->us || value2);
9572 exp->expType = op1->type;
9574 op1->type->refCount++;
9579 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9581 char value2 = op2->c;
9584 exp->string = PrintChar(op1->c || value2);
9587 exp->expType = op1->type;
9589 op1->type->refCount++;
9594 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9596 unsigned char value2 = op2->uc;
9599 exp->string = PrintUChar(op1->uc || value2);
9602 exp->expType = op1->type;
9604 op1->type->refCount++;
9609 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9611 float value2 = op2->f;
9614 exp->string = PrintFloat(op1->f || value2);
9617 exp->expType = op1->type;
9619 op1->type->refCount++;
9624 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9626 double value2 = op2->d;
9629 exp->string = PrintDouble(op1->d || value2);
9632 exp->expType = op1->type;
9634 op1->type->refCount++;
9639 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9641 int value2 = op2->i;
9644 exp->string = PrintInt(op1->i > value2);
9647 exp->expType = op1->type;
9649 op1->type->refCount++;
9654 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9656 unsigned int value2 = op2->ui;
9659 exp->string = PrintUInt(op1->ui > value2);
9662 exp->expType = op1->type;
9664 op1->type->refCount++;
9669 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9671 long long value2 = op2->i64;
9674 exp->string = PrintInt64(op1->i64 > value2);
9677 exp->expType = op1->type;
9679 op1->type->refCount++;
9684 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9686 uint64 value2 = op2->ui64;
9689 exp->string = PrintUInt64(op1->ui64 > value2);
9692 exp->expType = op1->type;
9694 op1->type->refCount++;
9699 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9701 short value2 = op2->s;
9704 exp->string = PrintShort(op1->s > value2);
9707 exp->expType = op1->type;
9709 op1->type->refCount++;
9714 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9716 unsigned short value2 = op2->us;
9719 exp->string = PrintUShort(op1->us > value2);
9722 exp->expType = op1->type;
9724 op1->type->refCount++;
9729 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9731 char value2 = op2->c;
9734 exp->string = PrintChar(op1->c > value2);
9737 exp->expType = op1->type;
9739 op1->type->refCount++;
9744 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9746 unsigned char value2 = op2->uc;
9749 exp->string = PrintUChar(op1->uc > value2);
9752 exp->expType = op1->type;
9754 op1->type->refCount++;
9759 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9761 float value2 = op2->f;
9764 exp->string = PrintFloat(op1->f > value2);
9767 exp->expType = op1->type;
9769 op1->type->refCount++;
9774 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9776 double value2 = op2->d;
9779 exp->string = PrintDouble(op1->d > value2);
9782 exp->expType = op1->type;
9784 op1->type->refCount++;
9789 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9791 int value2 = op2->i;
9794 exp->string = PrintInt(op1->i < value2);
9797 exp->expType = op1->type;
9799 op1->type->refCount++;
9804 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9806 unsigned int value2 = op2->ui;
9809 exp->string = PrintUInt(op1->ui < value2);
9812 exp->expType = op1->type;
9814 op1->type->refCount++;
9819 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9821 long long value2 = op2->i64;
9824 exp->string = PrintInt64(op1->i64 < value2);
9827 exp->expType = op1->type;
9829 op1->type->refCount++;
9834 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9836 uint64 value2 = op2->ui64;
9839 exp->string = PrintUInt64(op1->ui64 < value2);
9842 exp->expType = op1->type;
9844 op1->type->refCount++;
9849 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9851 short value2 = op2->s;
9854 exp->string = PrintShort(op1->s < value2);
9857 exp->expType = op1->type;
9859 op1->type->refCount++;
9864 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9866 unsigned short value2 = op2->us;
9869 exp->string = PrintUShort(op1->us < value2);
9872 exp->expType = op1->type;
9874 op1->type->refCount++;
9879 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9881 char value2 = op2->c;
9884 exp->string = PrintChar(op1->c < value2);
9887 exp->expType = op1->type;
9889 op1->type->refCount++;
9894 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9896 unsigned char value2 = op2->uc;
9899 exp->string = PrintUChar(op1->uc < value2);
9902 exp->expType = op1->type;
9904 op1->type->refCount++;
9909 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9911 float value2 = op2->f;
9914 exp->string = PrintFloat(op1->f < value2);
9917 exp->expType = op1->type;
9919 op1->type->refCount++;
9924 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9926 double value2 = op2->d;
9929 exp->string = PrintDouble(op1->d < value2);
9932 exp->expType = op1->type;
9934 op1->type->refCount++;
9939 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9941 int value2 = op2->i;
9944 exp->string = PrintInt(op1->i >= value2);
9947 exp->expType = op1->type;
9949 op1->type->refCount++;
9954 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9956 unsigned int value2 = op2->ui;
9959 exp->string = PrintUInt(op1->ui >= value2);
9962 exp->expType = op1->type;
9964 op1->type->refCount++;
9969 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9971 long long value2 = op2->i64;
9974 exp->string = PrintInt64(op1->i64 >= value2);
9977 exp->expType = op1->type;
9979 op1->type->refCount++;
9984 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9986 uint64 value2 = op2->ui64;
9989 exp->string = PrintUInt64(op1->ui64 >= value2);
9992 exp->expType = op1->type;
9994 op1->type->refCount++;
9999 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10001 short value2 = op2->s;
10004 exp->string = PrintShort(op1->s >= value2);
10007 exp->expType = op1->type;
10009 op1->type->refCount++;
10014 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10016 unsigned short value2 = op2->us;
10019 exp->string = PrintUShort(op1->us >= value2);
10022 exp->expType = op1->type;
10024 op1->type->refCount++;
10029 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10031 char value2 = op2->c;
10034 exp->string = PrintChar(op1->c >= value2);
10037 exp->expType = op1->type;
10039 op1->type->refCount++;
10044 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10046 unsigned char value2 = op2->uc;
10049 exp->string = PrintUChar(op1->uc >= value2);
10052 exp->expType = op1->type;
10054 op1->type->refCount++;
10059 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10061 float value2 = op2->f;
10064 exp->string = PrintFloat(op1->f >= value2);
10067 exp->expType = op1->type;
10069 op1->type->refCount++;
10074 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10076 double value2 = op2->d;
10079 exp->string = PrintDouble(op1->d >= value2);
10082 exp->expType = op1->type;
10084 op1->type->refCount++;
10089 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10091 int value2 = op2->i;
10094 exp->string = PrintInt(op1->i <= value2);
10097 exp->expType = op1->type;
10099 op1->type->refCount++;
10104 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10106 unsigned int value2 = op2->ui;
10109 exp->string = PrintUInt(op1->ui <= value2);
10112 exp->expType = op1->type;
10114 op1->type->refCount++;
10119 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10121 long long value2 = op2->i64;
10124 exp->string = PrintInt64(op1->i64 <= value2);
10127 exp->expType = op1->type;
10129 op1->type->refCount++;
10134 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10136 uint64 value2 = op2->ui64;
10139 exp->string = PrintUInt64(op1->ui64 <= value2);
10142 exp->expType = op1->type;
10144 op1->type->refCount++;
10149 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10151 short value2 = op2->s;
10154 exp->string = PrintShort(op1->s <= value2);
10157 exp->expType = op1->type;
10159 op1->type->refCount++;
10164 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10166 unsigned short value2 = op2->us;
10169 exp->string = PrintUShort(op1->us <= value2);
10172 exp->expType = op1->type;
10174 op1->type->refCount++;
10179 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10181 char value2 = op2->c;
10184 exp->string = PrintChar(op1->c <= value2);
10187 exp->expType = op1->type;
10189 op1->type->refCount++;
10194 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10196 unsigned char value2 = op2->uc;
10199 exp->string = PrintUChar(op1->uc <= value2);
10202 exp->expType = op1->type;
10204 op1->type->refCount++;
10209 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10211 float value2 = op2->f;
10214 exp->string = PrintFloat(op1->f <= value2);
10217 exp->expType = op1->type;
10219 op1->type->refCount++;
10224 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10226 double value2 = op2->d;
10229 exp->string = PrintDouble(op1->d <= value2);
10232 exp->expType = op1->type;
10234 op1->type->refCount++;
10239 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10242 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10245 exp->expType = op1->type;
10247 op1->type->refCount++;
10252 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10255 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10258 exp->expType = op1->type;
10260 op1->type->refCount++;
10265 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10268 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10271 exp->expType = op1->type;
10273 op1->type->refCount++;
10278 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10281 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10284 exp->expType = op1->type;
10286 op1->type->refCount++;
10291 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10294 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10297 exp->expType = op1->type;
10299 op1->type->refCount++;
10304 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10307 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10310 exp->expType = op1->type;
10312 op1->type->refCount++;
10317 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10320 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10323 exp->expType = op1->type;
10325 op1->type->refCount++;
10330 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10333 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10336 exp->expType = op1->type;
10338 op1->type->refCount++;
10343 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10346 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10349 exp->expType = op1->type;
10351 op1->type->refCount++;
10356 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10359 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10362 exp->expType = op1->type;
10364 op1->type->refCount++;
10369 struct OpTable intOps =
10371 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
10374 struct OpTable uintOps =
10376 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
10379 struct OpTable int64Ops =
10381 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
10384 struct OpTable uint64Ops =
10386 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
10389 struct OpTable shortOps =
10391 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
10394 struct OpTable ushortOps =
10396 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
10399 struct OpTable floatOps =
10401 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
10404 struct OpTable doubleOps =
10406 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
10409 struct OpTable charOps =
10411 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
10414 struct OpTable ucharOps =
10416 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
10419 void ReadString(char * output, char * string)
10421 int len = strlen(string);
10423 unsigned int quoted = 0x0, escaped = 0x0;
10425 for(c = 0; c < len; c++)
10427 char ch = string[c];
10485 int UnescapeString(char * d, char * s, int len)
10490 while(j < len && (ch = s[j]))
10495 switch((ch = s[++j]))
10541 char * OffsetEscapedString(char * s, int len, int offset)
10546 while(j < len && k < offset && (ch = s[j]))
10552 return (k == offset) ? s + j : (((void *)0));
10555 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10557 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10559 extern double strtod(char * , char * * );
10561 struct Operand GetOperand(struct Expression * exp)
10563 struct Operand op =
10567 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10570 struct Type * type = exp->expType;
10574 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10576 if(!type->_class->registered->dataType)
10577 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10578 type = type->_class->registered->dataType;
10580 op.kind = type->kind;
10581 op.type = exp->expType;
10582 if(exp->type == 3 && op.kind == 13)
10584 op.ui64 = (uint64)exp->string;
10586 op.ops = uint64Ops;
10588 else if(exp->isConstant && exp->type == 2)
10595 if(exp->constant[0] == '\'')
10596 op.c = exp->constant[1];
10597 else if(type->isSigned)
10599 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10604 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10612 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10617 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10618 op.ops = ushortOps;
10625 op.i = strtol(exp->constant, (((void *)0)), 0);
10630 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10638 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10643 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10651 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10656 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10657 op.ops = uint64Ops;
10664 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10669 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10670 op.ops = uint64Ops;
10675 op.f = (float)strtod(exp->constant, (((void *)0)));
10679 op.d = (double)strtod(exp->constant, (((void *)0)));
10680 op.ops = doubleOps;
10685 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10687 op.ops = uint64Ops;
10695 int __ecereVMethodID_class_OnGetString;
10697 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10699 static void UnusedFunction()
10703 ((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);
10706 extern int __ecereVMethodID_class_OnGetString;
10708 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10710 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10712 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10714 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10715 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10718 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10719 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10720 struct Type * type;
10721 void * ptr = inst->data + dataMember->offset + offset;
10722 char * result = (((void *)0));
10724 exp->loc = member->loc = inst->loc;
10725 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10726 if(!dataMember->dataType)
10727 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10728 type = dataMember->dataType;
10729 if(type->kind == 8)
10731 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10733 if(_class->type == 4)
10735 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10739 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10740 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10742 for(item = e->values.first; item; item = item->next)
10744 if((int)item->data == *(int *)ptr)
10746 result = item->name;
10752 exp->identifier = MkIdentifier(result);
10754 exp->destType = MkClassType(_class->fullName);
10755 ProcessExpressionType(exp);
10759 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10761 if(!_class->dataType)
10762 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10763 type = _class->dataType;
10772 FreeExpContents(exp);
10773 exp->constant = PrintFloat(*(float *)ptr);
10779 FreeExpContents(exp);
10780 exp->constant = PrintDouble(*(double *)ptr);
10786 FreeExpContents(exp);
10787 exp->constant = PrintInt(*(int *)ptr);
10793 FreeExpContents(exp);
10794 exp->constant = PrintInt64(*(long long *)ptr);
10800 FreeExpContents(exp);
10801 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10807 FreeExpContents(exp);
10808 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10813 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10816 ListAdd(memberList, member);
10818 if(parentDataMember->type == 1)
10823 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10825 void PopulateInstance(struct Instantiation * inst)
10827 struct Symbol * classSym = inst->_class->symbol;
10828 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10829 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10830 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10833 inst->members = MkListOne(MkMembersInitList(memberList));
10835 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10836 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10838 if(!dataMember->isProperty)
10840 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10841 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10844 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10845 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10846 struct Type * type;
10847 void * ptr = inst->data + dataMember->offset;
10848 char * result = (((void *)0));
10850 exp->loc = member->loc = inst->loc;
10851 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10852 if(!dataMember->dataType)
10853 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10854 type = dataMember->dataType;
10855 if(type->kind == 8)
10857 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10859 if(_class->type == 4)
10861 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10865 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10866 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10868 for(item = e->values.first; item; item = item->next)
10870 if((int)item->data == *(int *)ptr)
10872 result = item->name;
10879 exp->identifier = MkIdentifier(result);
10881 exp->destType = MkClassType(_class->fullName);
10882 ProcessExpressionType(exp);
10885 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10887 if(!_class->dataType)
10888 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10889 type = _class->dataType;
10898 exp->constant = PrintFloat(*(float *)ptr);
10904 exp->constant = PrintDouble(*(double *)ptr);
10910 exp->constant = PrintInt(*(int *)ptr);
10916 exp->constant = PrintInt64(*(long long *)ptr);
10922 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10930 ListAdd(memberList, member);
10936 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);
10938 extern void FreeInstance(struct Instantiation * inst);
10940 void ComputeInstantiation(struct Expression * exp)
10942 struct Instantiation * inst = exp->instance;
10943 struct MembersInit * members;
10944 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10945 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10946 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10947 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10948 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10949 int subMemberStackPos = 0;
10952 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10956 if(_class->type == 0 || _class->type == 5)
10958 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10959 if(_class->type == 0)
10960 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10963 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10967 for(members = (*inst->members).first; members; members = members->next)
10969 switch(members->type)
10973 if(members->dataMembers)
10975 struct MemberInit * member;
10977 for(member = (*members->dataMembers).first; member; member = member->next)
10979 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10980 unsigned int found = 0x0;
10981 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10982 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10983 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10984 unsigned int dataMemberOffset;
10988 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10991 if(curMember->isProperty)
10992 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10995 dataMember = curMember;
10996 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10997 if(_class->type == 0)
10998 dataMemberOffset += _class->base->structSize;
11005 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11009 if(prop->memberAccess == 1)
11011 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11012 curClass = prop->_class;
11017 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11018 int _subMemberStackPos = 0;
11020 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11024 if(dataMember->memberAccess == 1)
11026 curMember = dataMember;
11027 curClass = dataMember->_class;
11028 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11029 subMemberStackPos = _subMemberStackPos;
11034 if(found && member->initializer && member->initializer->type == 0)
11036 struct Expression * value = member->initializer->exp;
11037 struct Type * type = (((void *)0));
11038 unsigned int deepMember = 0x0;
11042 type = prop->dataType;
11044 else if(dataMember)
11046 if(!dataMember->dataType)
11047 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11048 type = dataMember->dataType;
11050 if(ident && ident->next)
11053 for(ident = ident->next; ident && type; ident = ident->next)
11055 if(type->kind == 8)
11057 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11059 type = prop->dataType;
11062 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11064 type = dataMember->dataType;
11067 else if(type->kind == 9 || type->kind == 10)
11069 struct Type * memberType;
11071 for(memberType = type->members.first; memberType; memberType = memberType->next)
11073 if(!strcmp(memberType->name, ident->string))
11084 FreeType(value->destType);
11085 value->destType = type;
11088 ComputeExpression(value);
11090 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11092 if(type->kind == 8)
11094 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11096 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11098 if(!_class->dataType)
11099 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11100 type = _class->dataType;
11105 void * ptr = inst->data + dataMemberOffset;
11107 if(value->type == 2)
11113 GetInt(value, (int *)ptr);
11118 GetInt64(value, (long long *)ptr);
11123 GetIntPtr(value, (intptr_t *)ptr);
11128 GetIntSize(value, (ssize_t *)ptr);
11133 GetFloat(value, (float *)ptr);
11138 GetDouble(value, (double *)ptr);
11143 else if(value->type == 1)
11145 if(type->kind == 8)
11147 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11149 if(_class->type == 1)
11151 ComputeTypeSize(type);
11152 if(value->instance->data)
11153 memcpy(ptr, value->instance->data, type->size);
11160 if(value->type == 1 && value->instance->data)
11162 if(type->kind == 8)
11164 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11166 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)))
11168 void (* Set)(void *, void *) = (void *)prop->Set;
11170 Set(inst->data, value->instance->data);
11171 PopulateInstance(inst);
11175 else if(value->type == 2)
11181 void (* Set)(void *, double) = (void *)prop->Set;
11183 Set(inst->data, strtod(value->constant, (((void *)0))));
11188 void (* Set)(void *, float) = (void *)prop->Set;
11190 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11195 void (* Set)(void *, int) = (void *)prop->Set;
11197 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11202 void (* Set)(void *, long long) = (void *)prop->Set;
11204 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11209 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11211 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11216 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11218 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11223 else if(value->type == 3)
11227 ReadString(temp, value->string);
11228 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11232 else if(!deepMember && type && _class->type == 3)
11236 if(value->type == 2)
11238 if(type->kind == 8)
11240 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11242 if(_class->type == 3)
11244 if(!_class->dataType)
11245 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11246 type = _class->dataType;
11254 float (* Set)(float) = (void *)prop->Set;
11256 GetFloat(member->initializer->exp, &fValue);
11257 exp->constant = PrintFloat(Set(fValue));
11264 double (* Set)(double) = (void *)prop->Set;
11266 GetDouble(member->initializer->exp, &dValue);
11267 exp->constant = PrintDouble(Set(dValue));
11275 else if(!deepMember && type && _class->type == 2)
11279 if(value->type == 1 && value->instance->data)
11281 unsigned int (* Set)(void *) = (void *)prop->Set;
11283 bits = Set(value->instance->data);
11285 else if(value->type == 2)
11289 else if(dataMember)
11291 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11292 struct Type * type;
11295 GetInt(value, &part);
11296 bits = (bits & ~bitMember->mask);
11297 if(!bitMember->dataType)
11298 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11299 type = bitMember->dataType;
11300 if(type->kind == 8 && type->_class && type->_class->registered)
11302 if(!type->_class->registered->dataType)
11303 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11304 type = type->_class->registered->dataType;
11311 bits |= ((char)part << bitMember->pos);
11313 bits |= ((unsigned char)part << bitMember->pos);
11317 bits |= ((short)part << bitMember->pos);
11319 bits |= ((unsigned short)part << bitMember->pos);
11324 bits |= (part << bitMember->pos);
11326 bits |= ((unsigned int)part << bitMember->pos);
11330 bits |= ((long long)part << bitMember->pos);
11332 bits |= ((uint64)part << bitMember->pos);
11337 bits |= ((intptr_t)part << bitMember->pos);
11341 bits |= ((uintptr_t)part << bitMember->pos);
11347 bits |= ((ssize_t)part << bitMember->pos);
11351 bits |= ((size_t)part << bitMember->pos);
11360 if(_class && _class->type == 3)
11362 ComputeExpression(member->initializer->exp);
11363 exp->constant = member->initializer->exp->constant;
11365 member->initializer->exp->constant = (((void *)0));
11375 if(_class && _class->type == 2)
11377 exp->constant = PrintHexUInt(bits);
11382 FreeInstance(inst);
11386 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11388 if(exp->op.op == SIZEOF)
11390 FreeExpContents(exp);
11392 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11402 struct Expression * exp2 = exp->op.exp2;
11404 exp->op.exp2 = (((void *)0));
11405 FreeExpContents(exp);
11406 FreeType(exp->expType);
11407 FreeType(exp->destType);
11409 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11415 FreeExpContents(exp);
11416 op1->ops.Neg(exp, op1);
11420 if(op1->ops.BitNot)
11422 FreeExpContents(exp);
11423 op1->ops.BitNot(exp, op1);
11429 FreeExpContents(exp);
11430 op1->ops.Not(exp, op1);
11442 FreeExpContents(exp);
11443 op1->ops.Add(exp, op1, op2);
11449 FreeExpContents(exp);
11450 op1->ops.Sub(exp, op1, op2);
11456 FreeExpContents(exp);
11457 op1->ops.Mul(exp, op1, op2);
11463 FreeExpContents(exp);
11464 op1->ops.Div(exp, op1, op2);
11470 FreeExpContents(exp);
11471 op1->ops.Mod(exp, op1, op2);
11477 if(op1->ops.BitAnd)
11479 FreeExpContents(exp);
11480 op1->ops.BitAnd(exp, op1, op2);
11487 FreeExpContents(exp);
11488 op1->ops.BitOr(exp, op1, op2);
11492 if(op1->ops.BitXor)
11494 FreeExpContents(exp);
11495 op1->ops.BitXor(exp, op1, op2);
11499 if(op1->ops.LShift)
11501 FreeExpContents(exp);
11502 op1->ops.LShift(exp, op1, op2);
11506 if(op1->ops.RShift)
11508 FreeExpContents(exp);
11509 op1->ops.RShift(exp, op1, op2);
11515 FreeExpContents(exp);
11516 op1->ops.Equ(exp, op1, op2);
11522 FreeExpContents(exp);
11523 op1->ops.Nqu(exp, op1, op2);
11529 FreeExpContents(exp);
11530 op1->ops.And(exp, op1, op2);
11536 FreeExpContents(exp);
11537 op1->ops.Or(exp, op1, op2);
11543 FreeExpContents(exp);
11544 op1->ops.Grt(exp, op1, op2);
11550 FreeExpContents(exp);
11551 op1->ops.Sma(exp, op1, op2);
11555 if(op1->ops.GrtEqu)
11557 FreeExpContents(exp);
11558 op1->ops.GrtEqu(exp, op1, op2);
11562 if(op1->ops.SmaEqu)
11564 FreeExpContents(exp);
11565 op1->ops.SmaEqu(exp, op1, op2);
11573 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11575 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11577 void ComputeExpression(struct Expression * exp)
11579 char expString[10240];
11581 expString[0] = '\0';
11586 ComputeInstantiation(exp);
11591 struct Expression * exp1, * exp2 = (((void *)0));
11592 struct Operand op1 =
11596 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11599 struct Operand op2 =
11603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11609 struct Expression * e = exp->op.exp2;
11611 while(((e->type == 5 || e->type == 32 || e->type == 23) && e->list) || e->type == 11)
11613 if(e->type == 5 || e->type == 32 || e->type == 23)
11616 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11618 e = (*e->list).last;
11620 else if(e->type == 11)
11623 if(exp->op.op == 261 && e && e->expType)
11625 if(e->type == 3 && e->string)
11627 char * string = e->string;
11628 int len = strlen(string);
11629 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11631 len = UnescapeString(tmp, string + 1, len - 2);
11632 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11633 FreeExpContents(exp);
11635 exp->constant = PrintUInt(len + 1);
11639 struct Type * type = e->expType;
11642 FreeExpContents(exp);
11644 exp->constant = PrintUInt(ComputeTypeSize(type));
11650 ComputeExpression(exp->op.exp2);
11654 ComputeExpression(exp->op.exp1);
11655 exp1 = exp->op.exp1;
11656 exp2 = exp->op.exp2;
11657 op1 = GetOperand(exp1);
11659 op1.type->refCount++;
11662 op2 = GetOperand(exp2);
11664 op2.type->refCount++;
11669 exp1 = exp->op.exp2;
11670 op1 = GetOperand(exp1);
11672 op1.type->refCount++;
11674 CallOperator(exp, exp1, exp2, &op1, &op2);
11676 FreeType(op1.type);
11678 FreeType(op2.type);
11684 struct Expression * e, * n;
11686 for(e = (*exp->list).first; e; e = n)
11691 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11693 ComputeExpression(e);
11694 FreeType(exp->expType);
11695 FreeType(exp->destType);
11697 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11698 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11709 struct Expression * memberExp = exp->member.exp;
11710 struct Identifier * memberID = exp->member.member;
11711 struct Type * type;
11713 ComputeExpression(exp->member.exp);
11714 type = exp->member.exp->expType;
11717 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)));
11718 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11719 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11720 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11722 if(type->kind == 19 && exp->member.exp->type == 24)
11723 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11727 struct Symbol * classSym;
11730 PrintTypeNoConst(type, string, 0x0, 0x1);
11731 classSym = FindClass(string);
11732 _class = classSym ? classSym->registered : (((void *)0));
11734 if(exp->member.member)
11736 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11738 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11740 if(!prop && !member && _class && exp->member.member)
11742 struct Symbol * classSym = FindClass(exp->member.member->string);
11744 convertTo = _class;
11745 _class = classSym ? classSym->registered : (((void *)0));
11746 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11752 struct Type * type = prop->dataType;
11754 if(_class->type == 3)
11756 if(type->kind == 8)
11758 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11760 if(_class->type == 3)
11762 if(!_class->dataType)
11763 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11764 type = _class->dataType;
11772 float (* Get)(float) = (void *)prop->Get;
11774 GetFloat(exp->member.exp, &value);
11775 exp->constant = PrintFloat(Get ? Get(value) : value);
11782 double (* Get)(double);
11784 GetDouble(exp->member.exp, &value);
11786 Get = (void *)prop->Set;
11788 Get = (void *)prop->Get;
11789 exp->constant = PrintDouble(Get ? Get(value) : value);
11799 struct Expression * value = exp->member.exp;
11800 struct Type * type;
11802 if(!prop->dataType)
11803 ProcessPropertyType(prop);
11804 type = prop->dataType;
11808 else if(_class->type == 1)
11814 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11816 if(propertyClass->type == 1 && value->type == 1)
11818 void (* Set)(void *, void *) = (void *)prop->Set;
11820 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11821 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11822 exp->instance->_class = MkSpecifierName(_class->fullName);
11823 exp->instance->loc = exp->loc;
11825 Set(exp->instance->data, value->instance->data);
11826 PopulateInstance(exp->instance);
11833 void (* Set)(void *, int) = (void *)prop->Set;
11835 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11836 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11837 exp->instance->_class = MkSpecifierName(_class->fullName);
11838 exp->instance->loc = exp->loc;
11840 GetInt(value, &intValue);
11841 Set(exp->instance->data, intValue);
11842 PopulateInstance(exp->instance);
11847 long long intValue;
11848 void (* Set)(void *, long long) = (void *)prop->Set;
11850 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11851 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11852 exp->instance->_class = MkSpecifierName(_class->fullName);
11853 exp->instance->loc = exp->loc;
11855 GetInt64(value, &intValue);
11856 Set(exp->instance->data, intValue);
11857 PopulateInstance(exp->instance);
11863 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11865 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11866 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11867 exp->instance->_class = MkSpecifierName(_class->fullName);
11868 exp->instance->loc = exp->loc;
11870 GetIntPtr(value, &intValue);
11871 Set(exp->instance->data, intValue);
11872 PopulateInstance(exp->instance);
11878 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11880 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11881 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11882 exp->instance->_class = MkSpecifierName(_class->fullName);
11883 exp->instance->loc = exp->loc;
11885 GetIntSize(value, &intValue);
11886 Set(exp->instance->data, intValue);
11887 PopulateInstance(exp->instance);
11892 double doubleValue;
11893 void (* Set)(void *, double) = (void *)prop->Set;
11895 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11896 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11897 exp->instance->_class = MkSpecifierName(_class->fullName);
11898 exp->instance->loc = exp->loc;
11900 GetDouble(value, &doubleValue);
11901 Set(exp->instance->data, doubleValue);
11902 PopulateInstance(exp->instance);
11907 else if(_class->type == 2)
11913 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11915 if(propertyClass->type == 1 && value->instance->data)
11917 unsigned int (* Set)(void *) = (void *)prop->Set;
11918 unsigned int bits = Set(value->instance->data);
11920 exp->constant = PrintHexUInt(bits);
11924 else if(_class->type == 2)
11926 unsigned int value;
11927 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11930 GetUInt(exp->member.exp, &value);
11932 exp->constant = PrintHexUInt(bits);
11941 if(_class->type == 2)
11943 unsigned int value;
11945 GetUInt(exp->member.exp, &value);
11950 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11952 if(_class->type == 1)
11954 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11956 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11957 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11958 exp->instance->_class = MkSpecifierName(_class->fullName);
11959 exp->instance->loc = exp->loc;
11961 Get(value, exp->instance->data);
11962 PopulateInstance(exp->instance);
11964 else if(_class->type == 2)
11966 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11967 uint64 bits = Get(value);
11969 exp->constant = PrintHexUInt64(bits);
11976 else if(_class->type == 1)
11978 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11984 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11986 if(_class->type == 1 && value)
11988 void (* Get)(void *, void *) = (void *)prop->Get;
11990 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11991 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11992 exp->instance->_class = MkSpecifierName(_class->fullName);
11993 exp->instance->loc = exp->loc;
11995 Get(value, exp->instance->data);
11996 PopulateInstance(exp->instance);
12007 exp->isConstant = 0x0;
12016 FreeExpression(memberExp);
12017 FreeIdentifier(memberID);
12023 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12025 FreeExpContents(exp);
12026 exp->constant = PrintUInt(ComputeTypeSize(type));
12033 struct Symbol * classSym = exp->_class->symbol;
12035 if(classSym && classSym->registered)
12037 if(classSym->registered->fixed)
12039 FreeSpecifier(exp->_class);
12040 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12045 char className[1024];
12047 strcpy(className, "__ecereClass_");
12048 FullClassNameCat(className, classSym->string, 0x1);
12049 MangleClassName(className);
12050 DeclareClass(classSym, className);
12051 FreeExpContents(exp);
12053 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12054 exp->member.member = MkIdentifier("structSize");
12061 struct Type * type;
12062 struct Expression * e = exp;
12064 if(exp->type == 11)
12067 ComputeExpression(exp->cast.exp);
12070 if(e && exp->expType)
12072 type = exp->expType;
12073 if(type->kind == 8)
12075 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12077 if(_class && (_class->type == 3 || _class->type == 2))
12079 if(!_class->dataType)
12080 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12081 type = _class->dataType;
12092 GetChar(e, &value);
12093 FreeExpContents(exp);
12094 exp->constant = PrintChar(value);
12099 unsigned char value;
12101 GetUChar(e, &value);
12102 FreeExpContents(exp);
12103 exp->constant = PrintUChar(value);
12112 GetShort(e, &value);
12113 FreeExpContents(exp);
12114 exp->constant = PrintShort(value);
12119 unsigned short value;
12121 GetUShort(e, &value);
12122 FreeExpContents(exp);
12123 exp->constant = PrintUShort(value);
12133 FreeExpContents(exp);
12134 exp->constant = PrintInt(value);
12139 unsigned int value;
12141 GetUInt(e, &value);
12142 FreeExpContents(exp);
12143 exp->constant = PrintUInt(value);
12152 GetInt64(e, &value);
12153 FreeExpContents(exp);
12154 exp->constant = PrintInt64(value);
12161 GetUInt64(e, &value);
12162 FreeExpContents(exp);
12163 exp->constant = PrintUInt64(value);
12172 GetIntPtr(e, &value);
12173 FreeExpContents(exp);
12174 exp->constant = PrintInt64((long long)value);
12181 GetUIntPtr(e, &value);
12182 FreeExpContents(exp);
12183 exp->constant = PrintUInt64((uint64)value);
12192 GetIntSize(e, &value);
12193 FreeExpContents(exp);
12194 exp->constant = PrintInt64((long long)value);
12201 GetUIntSize(e, &value);
12202 FreeExpContents(exp);
12203 exp->constant = PrintUInt64((uint64)value);
12211 GetFloat(e, &value);
12212 FreeExpContents(exp);
12213 exp->constant = PrintFloat(value);
12221 GetDouble(e, &value);
12222 FreeExpContents(exp);
12223 exp->constant = PrintDouble(value);
12233 struct Operand op1 =
12237 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12240 struct Operand op2 =
12244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12247 struct Operand op3 =
12251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12256 ComputeExpression((*exp->cond.exp).last);
12257 if(exp->cond.elseExp)
12258 ComputeExpression(exp->cond.elseExp);
12260 ComputeExpression(exp->cond.cond);
12261 op1 = GetOperand(exp->cond.cond);
12263 op1.type->refCount++;
12264 op2 = GetOperand((*exp->cond.exp).last);
12266 op2.type->refCount++;
12267 op3 = GetOperand(exp->cond.elseExp);
12269 op3.type->refCount++;
12272 FreeExpContents(exp);
12273 op1.ops.Cond(exp, &op1, &op2, &op3);
12276 FreeType(op1.type);
12278 FreeType(op2.type);
12280 FreeType(op3.type);
12286 void ApplyAnyObjectLogic(struct Expression * e);
12288 extern void CopyTypeInto(struct Type * type, struct Type * src);
12290 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12292 unsigned int result = 0x1;
12296 struct __ecereNameSpace__ecere__sys__OldList converts =
12300 struct Conversion * convert;
12302 if(destType->kind == 0)
12304 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12308 for(convert = converts.first; convert; convert = convert->next)
12310 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12314 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12315 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12318 newExp->destType = (((void *)0));
12322 exp->addedThis = 0x1;
12323 exp->member.exp = newExp;
12324 FreeType(exp->member.exp->expType);
12325 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12326 exp->member.exp->expType->classObjectType = objectType;
12327 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12328 exp->member.memberType = 1;
12329 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12330 exp->needCast = 0x1;
12332 exp->expType->refCount++;
12333 ApplyAnyObjectLogic(exp->member.exp);
12339 exp->addedThis = 0x1;
12340 exp->member.exp = newExp;
12341 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12343 newExp->byReference = 0x1;
12345 FreeType(exp->member.exp->expType);
12346 exp->member.exp->expType = (((void *)0));
12347 if(convert->convert->dataType)
12349 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12350 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12351 exp->member.exp->expType->refCount = 1;
12352 exp->member.exp->expType->classObjectType = objectType;
12353 ApplyAnyObjectLogic(exp->member.exp);
12355 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12356 exp->member.memberType = 4;
12357 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12358 exp->needCast = 0x1;
12359 if(convert->resultType)
12360 convert->resultType->refCount++;
12366 FreeType(exp->expType);
12369 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12370 exp->needCast = 0x1;
12372 exp->expType->refCount++;
12376 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12377 exp->needCast = 0x1;
12378 if(convert->resultType)
12379 convert->resultType->refCount++;
12383 if(exp->isConstant && inCompiler)
12384 ComputeExpression(exp);
12385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12387 if(!result && exp->expType && converts.count)
12389 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12391 if(!result && exp->expType && exp->destType)
12393 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))
12400 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12402 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12404 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12406 void CheckTemplateTypes(struct Expression * exp)
12408 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12410 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12411 struct Statement * compound;
12412 struct Context * context;
12416 exp->destType->refCount++;
12418 exp->expType->refCount++;
12419 newExp->prev = (((void *)0));
12420 newExp->next = (((void *)0));
12421 switch(exp->expType->kind)
12424 if(exp->destType->classObjectType)
12427 exp->destType->refCount--;
12429 exp->expType->refCount--;
12430 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12434 struct __ecereNameSpace__ecere__sys__OldList * specs;
12435 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12436 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12438 context = PushContext();
12439 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12440 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12441 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12443 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12444 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12445 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12446 exp->compound->compound.context = context;
12447 PopContext(context);
12452 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12453 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12457 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12459 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12460 struct Statement * compound;
12461 struct Context * context;
12465 exp->destType->refCount++;
12467 exp->expType->refCount++;
12468 newExp->prev = (((void *)0));
12469 newExp->next = (((void *)0));
12470 switch(exp->expType->kind)
12473 if(exp->destType->classObjectType)
12476 exp->destType->refCount--;
12478 exp->expType->refCount--;
12479 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12483 struct __ecereNameSpace__ecere__sys__OldList * specs;
12484 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12485 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12487 context = PushContext();
12488 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12489 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12490 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12492 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12493 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12494 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12495 exp->compound->compound.context = context;
12496 PopContext(context);
12501 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12504 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12505 ProcessExpressionType((*exp->list).first);
12511 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12512 newExp->needCast = 0x1;
12513 ProcessExpressionType((*exp->list).first);
12519 if(exp->expType->kind == 20)
12521 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12525 FreeType(exp->destType);
12526 FreeType(exp->expType);
12527 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12531 if(newExp->type == 8 && newExp->member.memberType == 3)
12535 exp->op.exp1 = (((void *)0));
12536 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12540 char typeString[1024];
12541 struct Declarator * decl;
12542 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12544 typeString[0] = '\0';
12545 PrintType(exp->expType, typeString, 0x0, 0x0);
12546 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12548 exp->cast.typeName = MkTypeName(specs, decl);
12549 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12550 exp->cast.exp->needCast = 0x1;
12558 extern int strncmp(const char * , const char * , size_t n);
12560 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12562 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12564 int nsLen = strlen(nameSpace);
12565 struct Symbol * symbol;
12567 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)))
12569 char * s = symbol->string;
12571 if(!strncmp(s, nameSpace, nsLen))
12576 for(c = strlen(s) - 1; c >= 0; c--)
12579 namePart = s + c + 1;
12580 if(!strcmp(namePart, name))
12588 return (((void *)0));
12591 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12594 char nameSpace[1024];
12596 unsigned int gotColon = 0x0;
12598 nameSpace[0] = '\0';
12599 for(c = strlen(name) - 1; c >= 0; c--)
12605 namePart = name + c + 1;
12606 while(c >= 0 && name[c] == ':')
12610 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12614 memcpy(nameSpace, name, c + 1);
12615 nameSpace[c + 1] = (char)0;
12616 return ScanWithNameSpace(tree, nameSpace, namePart);
12620 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12626 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12630 return ScanWithNameSpace(tree, "", namePart);
12632 return (((void *)0));
12635 static void ProcessDeclaration(struct Declaration * decl);
12637 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12639 struct Context * ctx;
12640 struct Symbol * symbol = (((void *)0));
12642 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12644 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12646 symbol = (((void *)0));
12649 char curName[1024];
12651 strcpy(curName, thisNameSpace);
12652 strcat(curName, "::");
12653 strcat(curName, name);
12654 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12657 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12660 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12661 if(symbol || ctx == endContext)
12664 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12666 if(symbol->pointerExternal->type == 0)
12668 struct FunctionDefinition * function = symbol->pointerExternal->function;
12669 struct Context * tmpContext = curContext;
12671 curContext = (((void *)0));
12672 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12673 curContext = tmpContext;
12674 symbol->pointerExternal->symbol = symbol;
12675 DeclareType(symbol->type, 0x1, 0x1);
12676 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12677 symbol->id = curExternal->symbol->idCode;
12679 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12681 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12682 symbol->id = curExternal->symbol->idCode;
12688 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12690 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12691 ListAdd(specs, MkSpecifier(UNSIGNED));
12696 if(type->_class->registered)
12698 if(!type->_class->registered->dataType)
12699 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12700 GetTypeSpecs(type->_class->registered->dataType, specs);
12705 ListAdd(specs, MkSpecifier(DOUBLE));
12708 ListAdd(specs, MkSpecifier(FLOAT));
12711 ListAdd(specs, MkSpecifier(CHAR));
12714 ListAdd(specs, MkSpecifier(_BOOL));
12717 ListAdd(specs, MkSpecifier(SHORT));
12720 ListAdd(specs, MkSpecifier(INT64));
12723 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12726 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12730 ListAdd(specs, MkSpecifier(INT));
12735 static void PrintArraySize(struct Type * arrayType, char * string)
12741 if(arrayType->enumClass)
12742 strcat(size, arrayType->enumClass->string);
12743 else if(arrayType->arraySizeExp)
12744 PrintExpression(arrayType->arraySizeExp, size);
12746 strcat(string, size);
12749 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12753 if(printConst && type->constant)
12754 strcat(string, "const ");
12759 struct Symbol * c = type->_class;
12761 if(type->classObjectType == 2)
12762 strcat(string, "typed_object");
12763 else if(type->classObjectType == 3)
12764 strcat(string, "any_object");
12768 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12770 if(type->byReference)
12771 strcat(string, " &");
12775 strcat(string, "void");
12778 strcat(string, type->isSigned ? "int" : "uint");
12781 strcat(string, type->isSigned ? "int64" : "uint64");
12784 strcat(string, type->isSigned ? "intptr" : "uintptr");
12787 strcat(string, type->isSigned ? "intsize" : "uintsize");
12790 strcat(string, type->isSigned ? "char" : "byte");
12793 strcat(string, "_Bool");
12796 strcat(string, type->isSigned ? "short" : "uint16");
12799 strcat(string, "float");
12802 strcat(string, "double");
12807 strcat(string, "struct ");
12808 strcat(string, type->enumName);
12810 else if(type->typeName)
12811 strcat(string, type->typeName);
12814 struct Type * member;
12816 strcat(string, "struct { ");
12817 for(member = type->members.first; member; member = member->next)
12819 PrintType(member, string, 0x1, fullName);
12820 strcat(string, "; ");
12822 strcat(string, "}");
12828 strcat(string, "union ");
12829 strcat(string, type->enumName);
12831 else if(type->typeName)
12832 strcat(string, type->typeName);
12835 strcat(string, "union ");
12836 strcat(string, "(unnamed)");
12842 strcat(string, "enum ");
12843 strcat(string, type->enumName);
12845 else if(type->typeName)
12846 strcat(string, type->typeName);
12848 strcat(string, "int");
12851 strcat(string, "...");
12854 strcat(string, "subclass(");
12855 strcat(string, type->_class ? type->_class->string : "int");
12856 strcat(string, ")");
12859 strcat(string, type->templateParameter->identifier->string);
12862 strcat(string, "thisclass");
12865 strcat(string, "__builtin_va_list");
12871 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12873 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12875 if(type->name && type->name[0])
12878 strcat(string, type->name);
12881 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12887 strcat(string, name);
12892 static void PrintAttribs(struct Type * type, char * string)
12896 if(type->dllExport)
12897 strcat(string, "dllexport ");
12898 if(type->attrStdcall)
12899 strcat(string, "stdcall ");
12903 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12905 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12907 struct Type * attrType = (((void *)0));
12909 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12910 PrintAttribs(type, string);
12911 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12912 strcat(string, " const");
12913 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12914 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12915 strcat(string, " (");
12916 if(type->kind == 13)
12918 if(type->type->kind == 11 || type->type->kind == 16)
12919 PrintAttribs(type->type, string);
12921 if(type->kind == 13)
12923 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12924 strcat(string, "*");
12926 strcat(string, " *");
12928 if(printConst && type->constant && type->kind == 13)
12929 strcat(string, " const");
12932 PrintTypeSpecs(type, string, fullName, printConst);
12935 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12937 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12938 strcat(string, ")");
12939 if(type->kind == 12)
12940 PrintArraySize(type, string);
12941 else if(type->kind == 11)
12943 struct Type * param;
12945 strcat(string, "(");
12946 for(param = type->params.first; param; param = param->next)
12948 PrintType(param, string, 0x1, fullName);
12950 strcat(string, ", ");
12952 strcat(string, ")");
12954 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12955 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12958 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12960 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12961 if(type->thisClass || (printName && type->name && type->name[0]))
12962 strcat(string, " ");
12963 if((type->thisClass || type->staticMethod))
12965 struct Symbol * _class = type->thisClass;
12967 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12969 if(type->classObjectType == 1)
12970 strcat(string, "class");
12972 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12974 else if(_class && _class->string)
12976 char * s = _class->string;
12982 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12988 strcat(string, name);
12991 strcat(string, "::");
12993 if(printName && type->name)
12994 PrintName(type, string, fullName);
12995 PostPrintType(type, string, fullName);
12996 if(type->bitFieldCount)
13000 sprintf(count, ":%d", type->bitFieldCount);
13001 strcat(string, count);
13005 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13007 _PrintType(type, string, printName, fullName, 0x1);
13010 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13012 _PrintType(type, string, printName, fullName, 0x0);
13015 static struct Type * FindMember(struct Type * type, char * string)
13017 struct Type * memberType;
13019 for(memberType = type->members.first; memberType; memberType = memberType->next)
13021 if(!memberType->name)
13023 struct Type * subType = FindMember(memberType, string);
13028 else if(!strcmp(memberType->name, string))
13031 return (((void *)0));
13034 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13036 struct Type * memberType;
13038 for(memberType = type->members.first; memberType; memberType = memberType->next)
13040 if(!memberType->name)
13042 struct Type * subType = FindMember(memberType, string);
13046 *offset += memberType->offset;
13050 else if(!strcmp(memberType->name, string))
13052 *offset += memberType->offset;
13056 return (((void *)0));
13059 extern unsigned int parseError;
13061 unsigned int GetParseError()
13066 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13068 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13070 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13072 struct Expression * ParseExpressionString(char * expression)
13075 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13076 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13077 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13079 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13080 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13081 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13082 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13084 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13085 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13087 parsedExpression = (((void *)0));
13089 expression_yyparse();
13090 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13091 return parsedExpression;
13094 extern char * QMkString(char * source);
13096 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13098 struct Identifier * id = exp->identifier;
13099 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13100 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13101 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13102 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13104 if(_class && _class->type == 4)
13106 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13107 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13111 struct __ecereNameSpace__ecere__com__Class * baseClass;
13113 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13115 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13117 for(value = e->values.first; value; value = value->next)
13119 if(!strcmp(value->name, id->string))
13124 char constant[256];
13126 FreeExpContents(exp);
13128 exp->isConstant = 0x1;
13129 if(!strcmp(baseClass->dataTypeString, "int"))
13130 sprintf(constant, "%d", (int)value->data);
13132 sprintf(constant, "0x%X", (int)value->data);
13133 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13134 exp->expType = MkClassType(baseClass->fullName);
13142 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13144 ProcessMethodType(method);
13145 exp->expType = __extension__ ({
13146 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13148 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13152 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13154 if(!prop->dataType)
13155 ProcessPropertyType(prop);
13156 exp->expType = prop->dataType;
13158 prop->dataType->refCount++;
13161 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13163 if(!member->dataType)
13164 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13165 exp->expType = member->dataType;
13166 if(member->dataType)
13167 member->dataType->refCount++;
13170 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13172 if(!classProp->dataType)
13173 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13174 if(classProp->constant)
13176 FreeExpContents(exp);
13177 exp->isConstant = 0x1;
13178 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13181 exp->constant = QMkString((char *)classProp->Get(_class));
13185 char constant[256];
13188 sprintf(constant, "%d", (int)classProp->Get(_class));
13189 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13195 exp->expType = classProp->dataType;
13196 if(classProp->dataType)
13197 classProp->dataType->refCount++;
13203 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13205 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13206 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13207 struct __ecereNameSpace__ecere__com__NameSpace * child;
13211 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)))
13213 data = ScanGlobalData(child, name);
13221 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13223 extern char * strncpy(char * , const char * , size_t n);
13225 static struct GlobalData * FindGlobalData(char * name)
13228 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13230 nameSpace = globalData;
13231 for(c = 0; name[c]; c++)
13233 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13235 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13236 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13238 strncpy(spaceName, name + start, c - start);
13239 spaceName[c - start] = '\0';
13240 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13241 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13243 return (((void *)0));
13244 nameSpace = newSpace;
13252 return ScanGlobalData(nameSpace, name + start);
13254 return (((void *)0));
13257 static int definedExpStackPos;
13259 static void * definedExpStack[512];
13261 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13263 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13265 FreeExpContents(checkedExp);
13266 FreeType(checkedExp->expType);
13267 FreeType(checkedExp->destType);
13268 *checkedExp = *newExp;
13269 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13270 checkedExp->prev = prev;
13271 checkedExp->next = next;
13274 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13276 extern int printf(char * , ...);
13278 void __ecereMethod_Expression_Clear();
13280 void ApplyAnyObjectLogic(struct Expression * e)
13282 struct Type * destType = e->destType;
13284 if(destType && (destType->classObjectType == 3))
13286 if(e && e->expType)
13288 struct Type * type = e->expType;
13289 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13291 if(type->kind == 8 && type->_class && type->_class->registered)
13293 _class = type->_class->registered;
13295 else if(type->kind == 19)
13297 _class = FindClass("ecere::com::Class")->registered;
13301 char string[1024] = "";
13302 struct Symbol * classSym;
13304 PrintTypeNoConst(type, string, 0x0, 0x1);
13305 classSym = FindClass(string);
13307 _class = classSym->registered;
13309 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)))
13311 if(!_class || strcmp(_class->fullName, "char *"))
13313 struct Expression * checkedExp = e, * newExp;
13315 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13317 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13319 if(checkedExp->type == 23)
13321 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13324 checkedExp = (*checkedExp->list).last;
13326 else if(checkedExp->type == 11)
13327 checkedExp = checkedExp->cast.exp;
13329 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13331 newExp = checkedExp->op.exp2;
13332 checkedExp->op.exp2 = (((void *)0));
13333 FreeExpContents(checkedExp);
13334 if(e->expType && e->expType->passAsTemplate)
13338 ComputeTypeSize(e->expType);
13339 sprintf(size, "%d", e->expType->size);
13340 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))))));
13342 ReplaceExpContents(checkedExp, newExp);
13343 e->byReference = 0x1;
13345 else if(!e->byReference || (_class && _class->type == 5))
13347 struct Expression * checkedExp, * newExp;
13350 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;
13352 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13354 struct Context * context = PushContext();
13355 struct Declarator * decl;
13356 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13357 char typeString[1024];
13358 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13360 typeString[0] = '\0';
13362 newExp->prev = (((void *)0));
13363 newExp->next = (((void *)0));
13364 newExp->expType = (((void *)0));
13365 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13366 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13367 newExp->destType = ProcessType(specs, decl);
13368 curContext = context;
13372 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13375 sprintf(name, "__internalValue%03X", internalValueCounter++);
13376 if(!curCompound->compound.declarations)
13377 curCompound->compound.declarations = MkList();
13378 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13379 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13380 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13381 e->compound = MkCompoundStmt((((void *)0)), stmts);
13384 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13386 struct Type * type = e->destType;
13388 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13389 CopyTypeInto(e->destType, type);
13390 e->destType->refCount = 1;
13391 e->destType->classObjectType = 0;
13394 e->compound->compound.context = context;
13395 PopContext(context);
13396 curContext = context->parent;
13400 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13402 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13404 if(checkedExp->type == 23)
13406 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13409 checkedExp = (*checkedExp->list).last;
13411 else if(checkedExp->type == 11)
13412 checkedExp = checkedExp->cast.exp;
13415 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13417 *operand = *checkedExp;
13418 checkedExp->destType = (((void *)0));
13419 checkedExp->expType = (((void *)0));
13420 __ecereMethod_Expression_Clear(checkedExp);
13421 checkedExp->type = 4;
13422 checkedExp->op.op = '&';
13423 checkedExp->op.exp1 = (((void *)0));
13424 checkedExp->op.exp2 = operand;
13433 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))))
13435 if(e->expType->classObjectType && destType && destType->classObjectType)
13441 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13444 thisExp->prev = (((void *)0));
13445 thisExp->next = (((void *)0));
13446 __ecereMethod_Expression_Clear(e);
13448 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13449 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13450 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13452 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13453 CopyTypeInto(e->expType, thisExp->expType);
13454 e->expType->byReference = 0x0;
13455 e->expType->refCount = 1;
13456 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))
13458 e->expType->classObjectType = 0;
13463 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13465 if(destType->kind == 14)
13467 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13469 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13471 unsigned int byReference = e->expType->byReference;
13472 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13473 struct Declarator * decl;
13474 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13475 char typeString[1024];
13476 struct Type * type;
13477 int backupClassObjectType;
13478 unsigned int backupByReference;
13480 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13484 backupClassObjectType = type->classObjectType;
13485 backupByReference = type->byReference;
13486 type->classObjectType = 0;
13487 type->byReference = 0x0;
13488 typeString[0] = '\0';
13489 PrintType(type, typeString, 0x0, 0x1);
13490 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13491 type->classObjectType = backupClassObjectType;
13492 type->byReference = backupByReference;
13494 thisExp->prev = (((void *)0));
13495 thisExp->next = (((void *)0));
13496 __ecereMethod_Expression_Clear(e);
13497 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)))
13501 e->op.exp1 = (((void *)0));
13502 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13503 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13504 CopyTypeInto(e->expType, type);
13505 e->expType->byReference = 0x0;
13506 e->expType->refCount = 1;
13511 e->cast.typeName = MkTypeName(specs, decl);
13512 e->cast.exp = thisExp;
13513 e->byReference = 0x1;
13517 e->destType = destType;
13518 destType->refCount++;
13523 extern char * strstr(const char * , const char * );
13525 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13527 struct __ecereNameSpace__ecere__com__DefinedExpression
13529 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13530 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13533 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13534 } __attribute__ ((gcc_struct));
13536 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13538 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13540 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13542 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13544 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13546 extern struct Expression * CopyExpression(struct Expression * exp);
13548 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13550 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13552 static void ProcessStatement(struct Statement * stmt);
13554 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13556 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13558 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13560 extern char * sourceFile;
13562 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13564 void ProcessExpressionType(struct Expression * exp)
13566 unsigned int unresolved = 0x0;
13567 struct Location oldyylloc = yylloc;
13568 unsigned int notByReference = 0x0;
13570 if(!exp || exp->expType)
13577 struct Identifier * id = exp->identifier;
13579 if(!id || !topContext)
13581 if(id->_class && id->_class->name)
13583 id->classSym = id->_class->symbol;
13585 if(strstr(id->string, "__ecereClass") == id->string)
13587 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13590 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13592 ReplaceClassMembers(exp, thisClass);
13595 ProcessExpressionType(exp);
13598 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13603 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13607 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13613 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13616 ProcessExpressionType(exp);
13620 else if(currentClass && !id->_class)
13622 if(ResolveIdWithClass(exp, currentClass, 0x1))
13625 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13630 struct Type * type = symbol->type;
13631 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13633 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13635 struct Context * context = SetupTemplatesContext(_class);
13637 type = ReplaceThisClassType(_class);
13638 FinishTemplatesContext(context);
13640 type->refCount = 0;
13642 FreeSpecifier(id->_class);
13643 id->_class = (((void *)0));
13644 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13645 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13646 id->classSym = (((void *)0));
13647 exp->expType = type;
13650 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13651 exp->isConstant = 0x1;
13652 if(symbol->isParam || !strcmp(id->string, "this"))
13654 if(_class && _class->type == 1 && !type->declaredWithStruct)
13655 exp->byReference = 0x1;
13657 if(symbol->isIterator)
13659 if(symbol->isIterator == 3)
13662 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13663 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13664 exp->expType = (((void *)0));
13665 ProcessExpressionType(exp);
13667 else if(symbol->isIterator != 4)
13670 exp->member.exp = MkExpIdentifier(exp->identifier);
13671 exp->member.exp->expType = exp->expType;
13672 exp->member.member = MkIdentifier("data");
13673 exp->expType = (((void *)0));
13674 ProcessExpressionType(exp);
13681 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13683 if(thisNameSpace && !(id->_class && !id->_class->name))
13687 strcpy(name, thisNameSpace);
13688 strcat(name, "::");
13689 strcat(name, id->string);
13690 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13693 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13698 for(c = 0; c < definedExpStackPos; c++)
13699 if(definedExpStack[c] == definedExp)
13701 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13703 struct Location backupYylloc = yylloc;
13704 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13706 definedExpStack[definedExpStackPos++] = definedExp;
13707 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13708 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13709 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13711 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13712 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13713 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13714 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13716 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13717 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13719 parsedExpression = (((void *)0));
13721 expression_yyparse();
13722 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13724 fileInput = backInput;
13725 yylloc = backupYylloc;
13726 if(parsedExpression)
13728 FreeIdentifier(id);
13730 exp->list = MkListOne(parsedExpression);
13731 parsedExpression->loc = yylloc;
13732 ProcessExpressionType(exp);
13733 definedExpStackPos--;
13736 definedExpStackPos--;
13742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13748 struct GlobalData * data = (((void *)0));
13750 if(thisNameSpace && !(id->_class && !id->_class->name))
13754 strcpy(name, thisNameSpace);
13755 strcat(name, "::");
13756 strcat(name, id->string);
13757 data = FindGlobalData(name);
13760 data = FindGlobalData(id->string);
13763 DeclareGlobalData(data);
13764 exp->expType = data->dataType;
13766 data->dataType->refCount++;
13767 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13768 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13769 FreeSpecifier(id->_class);
13770 id->_class = (((void *)0));
13775 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13777 if(thisNameSpace && !(id->_class && !id->_class->name))
13781 strcpy(name, thisNameSpace);
13782 strcat(name, "::");
13783 strcat(name, id->string);
13784 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13787 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13792 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13793 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13795 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13796 strcpy(name, "__ecereFunction_");
13797 FullClassNameCat(name, id->string, 0x0);
13798 if(DeclareFunction(function, name))
13800 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13801 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13803 exp->expType = function->dataType;
13804 if(function->dataType)
13805 function->dataType->refCount++;
13806 FreeSpecifier(id->_class);
13807 id->_class = (((void *)0));
13819 struct __ecereNameSpace__ecere__com__Class * _class;
13821 if(!exp->instance->_class)
13823 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13825 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13828 ProcessInstantiationType(exp->instance);
13829 exp->isConstant = exp->instance->isConstant;
13830 if(exp->instance->_class)
13832 exp->expType = MkClassType(exp->instance->_class->name);
13840 char * constant = exp->constant;
13841 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13843 exp->expType = type;
13844 if(constant[0] == '\'')
13846 if((int)((unsigned char *)constant)[1] > 127)
13849 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13853 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13854 exp->constant = PrintUInt(ch);
13856 type->_class = FindClass("unichar");
13857 type->isSigned = 0x0;
13862 type->isSigned = 0x1;
13867 char * dot = strchr(constant, '.');
13868 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13873 exponent = strchr(constant, 'p');
13875 exponent = strchr(constant, 'P');
13879 exponent = strchr(constant, 'e');
13881 exponent = strchr(constant, 'E');
13883 if(dot || exponent)
13885 if(strchr(constant, 'f') || strchr(constant, 'F'))
13889 type->isSigned = 0x1;
13893 unsigned int isSigned = constant[0] == '-';
13894 long long i64 = strtoll(constant, (((void *)0)), 0);
13895 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13896 unsigned int is64Bit = 0x0;
13900 if(i64 < (((int)0x80000000)))
13905 if(ui64 > (((int)0x7fffffff)))
13907 if(ui64 > (0xffffffff))
13910 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13914 else if(constant[0] != '0' || !constant[1])
13917 type->kind = is64Bit ? 4 : 3;
13918 type->isSigned = isSigned;
13921 exp->isConstant = 0x1;
13922 if(exp->destType && exp->destType->kind == 7)
13924 else if(exp->destType && exp->destType->kind == 6)
13926 else if(exp->destType && exp->destType->kind == 4)
13933 exp->isConstant = 0x1;
13934 exp->expType = __extension__ ({
13935 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13937 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13938 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13940 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13941 }), __ecereInstance2;
13947 ProcessExpressionType(exp->_new.size);
13948 exp->expType = __extension__ ({
13949 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13951 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13953 DeclareType(exp->expType->type, 0x0, 0x0);
13957 ProcessExpressionType(exp->_renew.size);
13958 ProcessExpressionType(exp->_renew.exp);
13959 exp->expType = __extension__ ({
13960 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13962 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13964 DeclareType(exp->expType->type, 0x0, 0x0);
13968 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13969 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13970 unsigned int useDestType = 0x0, useSideType = 0x0;
13971 struct Location oldyylloc = yylloc;
13972 unsigned int useSideUnit = 0x0;
13973 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14015 if(exp->op.op != '*' || exp->op.exp1)
14022 if(exp->op.op == '&')
14024 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14026 struct Identifier * id = exp->op.exp2->identifier;
14027 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14029 if(symbol && symbol->isIterator == 2)
14032 exp->member.exp = exp->op.exp2;
14033 exp->member.member = MkIdentifier("key");
14034 exp->expType = (((void *)0));
14035 exp->op.exp2->expType = symbol->type;
14036 symbol->type->refCount++;
14037 ProcessExpressionType(exp);
14045 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
14047 if(exp->op.exp1->destType)
14048 FreeType(exp->op.exp1->destType);
14049 exp->op.exp1->destType = exp->destType;
14051 exp->destType->refCount++;
14055 if(exp->op.exp1->destType)
14056 FreeType(exp->op.exp1->destType);
14057 exp->op.exp1->destType = dummy;
14060 if(exp->op.exp1->destType && exp->op.op != '=')
14061 exp->op.exp1->destType->count++;
14062 ProcessExpressionType(exp->op.exp1);
14063 if(exp->op.exp1->destType && exp->op.op != '=')
14064 exp->op.exp1->destType->count--;
14065 if(exp->op.exp1->destType == dummy)
14068 exp->op.exp1->destType = (((void *)0));
14070 type1 = exp->op.exp1->expType;
14074 char expString[10240];
14076 expString[0] = '\0';
14077 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14081 exp->op.exp2->destType = exp->op.exp1->expType;
14082 if(exp->op.exp1->expType)
14083 exp->op.exp1->expType->refCount++;
14087 exp->op.exp2->destType = exp->destType;
14089 exp->destType->refCount++;
14093 exp->expType = type1;
14098 PrintExpression(exp->op.exp2, expString);
14099 if(type1 && type1->kind == 13)
14101 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)
14102 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14103 else if(exp->op.op == '=')
14105 if(exp->op.exp2->destType)
14106 FreeType(exp->op.exp2->destType);
14107 exp->op.exp2->destType = type1;
14114 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)
14118 if(exp->op.exp2->destType)
14119 FreeType(exp->op.exp2->destType);
14120 exp->op.exp2->destType = type1;
14127 exp->expType = type1;
14129 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
14131 if(exp->op.exp2->destType)
14132 FreeType(exp->op.exp2->destType);
14133 exp->op.exp2->destType = exp->destType;
14135 exp->destType->refCount++;
14139 if(exp->op.exp2->destType)
14140 FreeType(exp->op.exp2->destType);
14141 exp->op.exp2->destType = dummy;
14144 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14146 FreeType(exp->op.exp2->destType);
14147 exp->op.exp2->destType = type1;
14150 if(exp->op.exp2->destType && exp->op.op != '=')
14151 exp->op.exp2->destType->count++;
14152 ProcessExpressionType(exp->op.exp2);
14153 if(exp->op.exp2->destType && exp->op.op != '=')
14154 exp->op.exp2->destType->count--;
14155 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14157 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)
14159 if(exp->op.op != '=' && type1->type->kind == 0)
14160 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14162 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)))
14164 if(exp->op.op == ADD_ASSIGN)
14165 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14167 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))
14169 if(exp->op.op == ADD_ASSIGN)
14170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14172 else if(inCompiler)
14174 char type1String[1024];
14175 char type2String[1024];
14177 type1String[0] = '\0';
14178 type2String[0] = '\0';
14179 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14180 PrintType(type1, type2String, 0x0, 0x1);
14181 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14182 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14185 if(exp->op.exp2->destType == dummy)
14188 exp->op.exp2->destType = (((void *)0));
14190 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14192 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14193 type2->refCount = 1;
14194 CopyTypeInto(type2, exp->op.exp2->expType);
14195 type2->isSigned = 0x1;
14197 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14199 type2 = __extension__ ({
14200 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14202 __ecereInstance1->kind = 3, __ecereInstance1;
14204 type2->refCount = 1;
14205 type2->isSigned = 0x1;
14209 type2 = exp->op.exp2->expType;
14215 if(exp->op.op == SIZEOF)
14217 exp->expType = __extension__ ({
14218 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14220 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14222 exp->isConstant = 0x1;
14224 else if(exp->op.op == '*' && !exp->op.exp1)
14226 exp->expType = Dereference(type2);
14227 if(type2 && type2->kind == 8)
14228 notByReference = 0x1;
14230 else if(exp->op.op == '&' && !exp->op.exp1)
14231 exp->expType = Reference(type2);
14238 if(exp->op.exp1->destType)
14239 FreeType(exp->op.exp1->destType);
14240 exp->op.exp1->destType = MkClassType("bool");
14241 exp->op.exp1->destType->truth = 0x1;
14242 if(!exp->op.exp1->expType)
14243 ProcessExpressionType(exp->op.exp1);
14245 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14246 FreeType(exp->op.exp1->expType);
14247 exp->op.exp1->expType = MkClassType("bool");
14248 exp->op.exp1->expType->truth = 0x1;
14252 if(exp->op.exp2->destType)
14253 FreeType(exp->op.exp2->destType);
14254 exp->op.exp2->destType = MkClassType("bool");
14255 exp->op.exp2->destType->truth = 0x1;
14256 if(!exp->op.exp2->expType)
14257 ProcessExpressionType(exp->op.exp2);
14259 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14260 FreeType(exp->op.exp2->expType);
14261 exp->op.exp2->expType = MkClassType("bool");
14262 exp->op.exp2->expType->truth = 0x1;
14265 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")))))
14267 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14269 if(exp->op.exp2->destType)
14270 FreeType(exp->op.exp2->destType);
14271 exp->op.exp2->destType = type1;
14273 if(exp->op.exp1->destType)
14274 FreeType(exp->op.exp1->destType);
14275 exp->op.exp1->destType = type2;
14277 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)
14278 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);
14279 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14281 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14285 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14287 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14288 ProcessExpressionType(exp->op.exp1);
14289 if(type2->kind != 13)
14291 ProcessExpressionType(classExp);
14292 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"))))))));
14293 if(!exp->op.exp2->expType)
14297 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14300 ProcessExpressionType(exp->op.exp2);
14304 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)))
14306 if(type1->kind != 8 && type1->type->kind == 0)
14307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14308 exp->expType = type1;
14312 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)))
14314 if(type2->kind != 8 && type2->type->kind == 0)
14315 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14316 exp->expType = type2;
14320 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))
14322 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14326 unsigned int success = 0x0;
14328 if(type1->kind == 13 && type2->kind == 13)
14330 if(exp->op.op == '+')
14331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14332 else if(exp->op.op == '-')
14334 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14336 exp->expType = __extension__ ({
14337 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14339 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14342 if(type1->type->kind == 20)
14344 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14348 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14350 ProcessExpressionType(classExp);
14352 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")))))));
14353 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14361 if(!success && exp->op.exp1->type == 2)
14363 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14366 FreeType(exp->expType);
14367 exp->expType = exp->op.exp1->destType;
14368 if(exp->op.exp1->destType)
14369 exp->op.exp1->destType->refCount++;
14372 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14375 FreeType(exp->expType);
14376 exp->expType = exp->op.exp2->destType;
14377 if(exp->op.exp2->destType)
14378 exp->op.exp2->destType->refCount++;
14384 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14387 FreeType(exp->expType);
14388 exp->expType = exp->op.exp2->destType;
14389 if(exp->op.exp2->destType)
14390 exp->op.exp2->destType->refCount++;
14393 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14396 FreeType(exp->expType);
14397 exp->expType = exp->op.exp1->destType;
14398 if(exp->op.exp1->destType)
14399 exp->op.exp1->destType->refCount++;
14405 char expString1[10240];
14406 char expString2[10240];
14410 expString1[0] = '\0';
14411 expString2[0] = '\0';
14416 PrintExpression(exp->op.exp1, expString1);
14417 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14418 PrintExpression(exp->op.exp2, expString2);
14419 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14420 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14421 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14423 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14427 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14429 if(exp->op.exp1->destType)
14430 FreeType(exp->op.exp1->destType);
14431 exp->op.exp1->destType = type2->_class->registered->dataType;
14432 if(type2->_class->registered->dataType)
14433 type2->_class->registered->dataType->refCount++;
14434 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14435 exp->expType = type2;
14439 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14441 if(exp->op.exp2->destType)
14442 FreeType(exp->op.exp2->destType);
14443 exp->op.exp2->destType = type1->_class->registered->dataType;
14444 if(type1->_class->registered->dataType)
14445 type1->_class->registered->dataType->refCount++;
14446 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14447 exp->expType = type1;
14453 unsigned int valid = 0x0;
14455 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14457 if(exp->op.exp2->destType)
14458 FreeType(exp->op.exp2->destType);
14459 if(!type1->_class->registered->dataType)
14460 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14461 exp->op.exp2->destType = type1->_class->registered->dataType;
14462 exp->op.exp2->destType->refCount++;
14463 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14466 type2 = exp->op.exp2->destType;
14469 exp->expType = type2;
14472 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14474 if(exp->op.exp1->destType)
14475 FreeType(exp->op.exp1->destType);
14476 if(!type2->_class->registered->dataType)
14477 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14478 exp->op.exp1->destType = type2->_class->registered->dataType;
14479 exp->op.exp1->destType->refCount++;
14480 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14481 type1 = exp->op.exp1->destType;
14482 exp->expType = type1;
14485 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14487 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14489 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14492 FreeType(exp->expType);
14493 exp->expType = exp->op.exp1->expType;
14494 if(exp->op.exp2->expType)
14495 exp->op.exp1->expType->refCount++;
14499 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14501 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14504 FreeType(exp->expType);
14505 exp->expType = exp->op.exp2->expType;
14506 if(exp->op.exp2->expType)
14507 exp->op.exp2->expType->refCount++;
14514 if(exp->op.exp2->destType)
14515 FreeType(exp->op.exp2->destType);
14516 exp->op.exp2->destType = type1;
14518 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14521 FreeType(exp->expType);
14522 exp->expType = exp->op.exp2->destType;
14523 if(exp->op.exp2->destType)
14524 exp->op.exp2->destType->refCount++;
14526 else if(type1 && type2)
14528 char expString1[10240];
14529 char expString2[10240];
14530 char type1String[1024];
14531 char type2String[1024];
14533 expString1[0] = '\0';
14534 expString2[0] = '\0';
14535 type1String[0] = '\0';
14536 type2String[0] = '\0';
14539 PrintExpression(exp->op.exp1, expString1);
14540 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14541 PrintExpression(exp->op.exp2, expString2);
14542 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14543 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14544 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14546 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14547 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14549 exp->expType = exp->op.exp1->expType;
14550 if(exp->op.exp1->expType)
14551 exp->op.exp1->expType->refCount++;
14553 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14555 exp->expType = exp->op.exp2->expType;
14556 if(exp->op.exp2->expType)
14557 exp->op.exp2->expType->refCount++;
14564 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14566 struct Type * oldType = exp->op.exp1->expType;
14568 exp->op.exp1->expType = (((void *)0));
14569 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14572 exp->op.exp1->expType = oldType;
14574 if(exp->op.exp1->destType)
14575 FreeType(exp->op.exp1->destType);
14576 exp->op.exp1->destType = type2;
14578 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14581 FreeType(exp->expType);
14582 exp->expType = exp->op.exp1->destType;
14583 if(exp->op.exp1->destType)
14584 exp->op.exp1->destType->refCount++;
14588 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14590 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14592 if(exp->op.exp1->destType)
14593 FreeType(exp->op.exp1->destType);
14594 exp->op.exp1->destType = type2->_class->registered->dataType;
14595 if(type2->_class->registered->dataType)
14596 type2->_class->registered->dataType->refCount++;
14597 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14599 if(exp->op.op == '!')
14601 exp->expType = MkClassType("bool");
14602 exp->expType->truth = 0x1;
14606 exp->expType = type2;
14611 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14613 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14615 if(exp->op.exp2->destType)
14616 FreeType(exp->op.exp2->destType);
14617 exp->op.exp2->destType = type1->_class->registered->dataType;
14618 if(type1->_class->registered->dataType)
14619 type1->_class->registered->dataType->refCount++;
14620 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14622 exp->expType = type1;
14628 if(exp->op.exp1 && !exp->op.exp1->expType)
14630 char expString[10000];
14632 expString[0] = '\0';
14635 PrintExpression(exp->op.exp1, expString);
14636 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14639 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14641 if(exp->op.exp2 && !exp->op.exp2->expType)
14643 char expString[10240];
14645 expString[0] = '\0';
14648 PrintExpression(exp->op.exp2, expString);
14649 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14652 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14656 FreeType(exp->expType);
14657 exp->expType = MkClassType("bool");
14658 exp->expType->truth = 0x1;
14660 if(exp->op.op != SIZEOF)
14661 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14662 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14664 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14666 yylloc = oldyylloc;
14675 struct Expression * e;
14677 exp->isConstant = 0x1;
14678 for(e = (*exp->list).first; e; e = e->next)
14680 unsigned int inced = 0x0;
14684 FreeType(e->destType);
14685 e->destType = exp->destType;
14688 exp->destType->refCount++;
14689 e->destType->count++;
14693 ProcessExpressionType(e);
14695 exp->destType->count--;
14696 if(!exp->expType && !e->next)
14698 exp->expType = e->expType;
14700 e->expType->refCount++;
14703 exp->isConstant = 0x0;
14705 e = (*exp->list).first;
14706 if(!e->next && e->type == 8)
14708 struct Expression * next = exp->next, * prev = exp->prev;
14710 FreeType(exp->expType);
14711 FreeType(exp->destType);
14712 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14716 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14717 ProcessExpressionType(exp);
14723 struct Expression * e;
14725 exp->isConstant = 0x1;
14726 ProcessExpressionType(exp->index.exp);
14727 if(!exp->index.exp->isConstant)
14728 exp->isConstant = 0x0;
14729 if(exp->index.exp->expType)
14731 struct Type * source = exp->index.exp->expType;
14733 if(source->kind == 8 && source->_class && source->_class->registered)
14735 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14736 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14738 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14740 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14741 if(exp->index.index && (*exp->index.index).last)
14743 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14748 for(e = (*exp->index.index).first; e; e = e->next)
14750 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14753 FreeType(e->destType);
14754 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14756 ProcessExpressionType(e);
14761 exp->isConstant = 0x0;
14764 exp->expType = Dereference(exp->index.exp->expType);
14766 DeclareType(exp->expType, 0x0, 0x0);
14771 struct Expression * e;
14772 struct Type * functionType;
14773 struct Type * methodType = (((void *)0));
14779 PrintExpression(exp->call.exp, name);
14780 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14782 PrintExpression(exp->call.exp, name);
14785 if(exp->call.exp->type == 0)
14787 struct Expression * idExp = exp->call.exp;
14788 struct Identifier * id = idExp->identifier;
14790 if(!strcmp(id->string, "__builtin_frame_address"))
14792 exp->expType = ProcessTypeString("void *", 0x1);
14793 if(exp->call.arguments && (*exp->call.arguments).first)
14794 ProcessExpressionType((*exp->call.arguments).first);
14797 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14799 exp->expType = ProcessTypeString("int", 0x1);
14800 if(exp->call.arguments && (*exp->call.arguments).first)
14801 ProcessExpressionType((*exp->call.arguments).first);
14804 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14806 struct Expression * a = (((void *)0));
14807 struct Expression * b = (((void *)0));
14808 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14810 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14812 a = (*exp->call.arguments).first;
14813 b = (*exp->call.arguments).last;
14817 else if((*exp->call.arguments).count == 1)
14819 a = (*exp->call.arguments).first;
14824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14825 idExp->identifier = (((void *)0));
14826 FreeExpContents(exp);
14827 ProcessExpressionType(a);
14829 ProcessExpressionType(b);
14831 exp->list = MkList();
14832 if(a->expType && (!b || b->expType))
14834 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14838 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14839 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14840 struct Declaration * decl;
14841 char temp1[1024], temp2[1024];
14843 GetTypeSpecs(a->expType, specs);
14844 if(a && !a->isConstant && a->type != 0)
14846 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14847 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14848 tempExp1 = QMkExpId(temp1);
14849 tempExp1->expType = a->expType;
14851 a->expType->refCount++;
14852 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14854 if(b && !b->isConstant && b->type != 0)
14856 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14857 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14858 tempExp2 = QMkExpId(temp2);
14859 tempExp2->expType = b->expType;
14861 b->expType->refCount++;
14862 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14864 decl = MkDeclaration(specs, decls);
14865 if(!curCompound->compound.declarations)
14866 curCompound->compound.declarations = MkList();
14867 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14871 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14873 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14875 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14876 exp->expType = a->expType;
14878 a->expType->refCount++;
14880 else if(!strcmp(id->string, "Abs"))
14882 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14883 exp->expType = a->expType;
14885 a->expType->refCount++;
14887 else if(!strcmp(id->string, "Sgn"))
14889 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"))))));
14890 exp->expType = ProcessTypeString("int", 0x0);
14892 FreeExpression(tempExp1);
14894 FreeExpression(tempExp2);
14895 FreeIdentifier(id);
14901 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14903 if(!exp->call.exp->destType)
14905 exp->call.exp->destType = dummy;
14908 ProcessExpressionType(exp->call.exp);
14909 if(exp->call.exp->destType == dummy)
14912 exp->call.exp->destType = (((void *)0));
14916 functionType = exp->call.exp->expType;
14917 if(functionType && functionType->kind == 16)
14919 methodType = functionType;
14920 functionType = methodType->method->dataType;
14921 if(exp->call.exp->expType->usedClass)
14923 char typeString[1024];
14925 typeString[0] = '\0';
14927 struct Symbol * back = functionType->thisClass;
14929 functionType->thisClass = (((void *)0));
14930 PrintType(functionType, typeString, 0x1, 0x1);
14931 functionType->thisClass = back;
14933 if(strstr(typeString, "thisclass"))
14935 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14936 struct Declarator * decl;
14939 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14941 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14942 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14943 thisClassParams = 0x0;
14944 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14946 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14948 thisClass = exp->call.exp->expType->usedClass;
14949 ProcessDeclarator(decl);
14950 thisClass = backupThisClass;
14952 thisClassParams = 0x1;
14953 functionType = ProcessType(specs, decl);
14954 functionType->refCount = 0;
14955 FinishTemplatesContext(context);
14957 FreeList(specs, FreeSpecifier);
14958 FreeDeclarator(decl);
14962 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14964 struct Type * type = functionType->type;
14966 if(!functionType->refCount)
14968 functionType->type = (((void *)0));
14969 FreeType(functionType);
14971 functionType = type;
14973 if(functionType && functionType->kind != 11)
14975 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
14977 else if(functionType)
14979 unsigned int emptyParams = 0x0, noParams = 0x0;
14980 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14981 struct Type * type = functionType->params.first;
14982 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14984 struct Location oldyylloc = yylloc;
14988 if(functionType->extraParam && e && functionType->thisClass)
14990 e->destType = MkClassType(functionType->thisClass->string);
14993 if(!functionType->staticMethod && !functionType->extraParam)
14995 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14997 type = MkClassType(memberExp->member.exp->expType->_class->string);
15000 e->destType = type;
15002 type = functionType->params.first;
15005 type->refCount = 0;
15007 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15009 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15010 type->byReference = functionType->byReference;
15011 type->typedByReference = functionType->typedByReference;
15014 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15016 e->destType = type;
15018 type = functionType->params.first;
15021 type->refCount = 0;
15024 if(type && type->kind == 0)
15027 if(!type->refCount)
15029 type = (((void *)0));
15031 for(; e; e = e->next)
15033 if(!type && !emptyParams)
15036 if(methodType && methodType->methodClass)
15037 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);
15039 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);
15042 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15044 struct Type * templatedType = (((void *)0));
15045 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15046 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15049 if(_class && _class->templateArgs)
15051 struct __ecereNameSpace__ecere__com__Class * sClass;
15053 for(sClass = _class; sClass; sClass = sClass->base)
15055 if(sClass->templateClass)
15056 sClass = sClass->templateClass;
15058 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15060 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15062 struct __ecereNameSpace__ecere__com__Class * nextClass;
15064 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15066 if(nextClass->templateClass)
15067 nextClass = nextClass->templateClass;
15068 id += nextClass->templateParams.count;
15078 if(curParam && _class->templateArgs[id].dataTypeString)
15080 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15083 struct Context * context = SetupTemplatesContext(_class);
15085 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15086 FinishTemplatesContext(context);
15088 e->destType = templatedType;
15091 templatedType->passAsTemplate = 0x1;
15096 e->destType = type;
15103 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15105 e->destType = type->prev;
15106 e->destType->refCount++;
15110 e->destType = type;
15115 if(type && type->kind != 14)
15117 struct Type * next = type->next;
15119 if(!type->refCount)
15124 if(type && type->kind != 14)
15126 if(methodType && methodType->methodClass)
15127 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);
15129 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);
15131 yylloc = oldyylloc;
15132 if(type && !type->refCount)
15137 functionType = __extension__ ({
15138 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15140 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15142 if(exp->call.exp->type == 0)
15144 char * string = exp->call.exp->identifier->string;
15148 struct Symbol * symbol;
15149 struct Location oldyylloc = yylloc;
15151 yylloc = exp->call.exp->identifier->loc;
15152 if(strstr(string, "__builtin_") == string)
15156 functionType->returnType = exp->destType;
15157 exp->destType->refCount++;
15161 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15162 symbol = __extension__ ({
15163 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15165 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15167 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15168 if(strstr(symbol->string, "::"))
15169 globalContext->hasNameSpace = 0x1;
15170 yylloc = oldyylloc;
15173 else if(exp->call.exp->type == 8)
15177 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15178 if(!functionType->returnType)
15180 functionType->returnType = __extension__ ({
15181 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15183 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15187 if(functionType && functionType->kind == 11)
15189 exp->expType = functionType->returnType;
15190 if(functionType->returnType)
15191 functionType->returnType->refCount++;
15192 if(!functionType->refCount)
15193 FreeType(functionType);
15195 if(exp->call.arguments)
15197 for(e = (*exp->call.arguments).first; e; e = e->next)
15199 struct Type * destType = e->destType;
15201 ProcessExpressionType(e);
15208 struct Type * type;
15209 struct Location oldyylloc = yylloc;
15210 unsigned int thisPtr;
15211 struct Expression * checkExp = exp->member.exp;
15215 if(checkExp->type == 11)
15216 checkExp = checkExp->cast.exp;
15217 else if(checkExp->type == 5)
15218 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15222 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15223 exp->thisPtr = thisPtr;
15224 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15226 exp->member.member->classSym = exp->member.member->_class->symbol;
15228 ProcessExpressionType(exp->member.exp);
15229 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)
15231 exp->isConstant = 0x0;
15234 exp->isConstant = exp->member.exp->isConstant;
15235 type = exp->member.exp->expType;
15237 if(type && (type->kind == 20))
15239 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15240 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15244 for(param = _class->templateParams.first; param; param = param->next)
15246 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15250 if(param && param->defaultArg.member)
15252 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15256 struct Expression * expMember = exp->member.exp;
15257 struct Declarator * decl;
15258 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15259 char thisClassTypeString[1024];
15261 FreeIdentifier(exp->member.member);
15262 ProcessExpressionType(argExp);
15264 char * colon = strstr(param->defaultArg.memberString, "::");
15268 char className[1024];
15269 struct __ecereNameSpace__ecere__com__Class * sClass;
15271 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15272 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15275 strcpy(thisClassTypeString, _class->fullName);
15277 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15278 exp->expType = ProcessType(specs, decl);
15279 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15281 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15282 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15284 int paramCount = 0;
15285 int lastParam = -1;
15286 char templateString[1024];
15287 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15289 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15290 for(cClass = expClass; cClass; cClass = cClass->base)
15294 for(param = cClass->templateParams.first; param; param = param->next)
15297 struct __ecereNameSpace__ecere__com__Class * sClass;
15298 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15300 for(sClass = cClass->base; sClass; sClass = sClass->base)
15301 id += sClass->templateParams.count;
15302 arg = expClass->templateArgs[id];
15303 for(sClass = _class; sClass; sClass = sClass->base)
15305 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15307 struct __ecereNameSpace__ecere__com__Class * nextClass;
15309 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15310 p += nextClass->templateParams.count;
15311 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15313 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15315 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15317 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15318 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15325 char argument[256];
15327 argument[0] = '\0';
15328 switch(param->type)
15332 char expString[1024];
15333 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15334 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15335 struct Expression * exp;
15336 char * string = PrintHexUInt64(arg.expression.ui64);
15338 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15339 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15340 ProcessExpressionType(exp);
15341 ComputeExpression(exp);
15342 expString[0] = '\0';
15343 PrintExpression(exp, expString);
15344 strcat(argument, expString);
15345 FreeExpression(exp);
15350 strcat(argument, arg.member->name);
15355 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15357 if(!strcmp(arg.dataTypeString, "thisclass"))
15358 strcat(argument, thisClassTypeString);
15360 strcat(argument, arg.dataTypeString);
15368 strcat(templateString, ", ");
15369 if(lastParam != p - 1)
15371 strcat(templateString, param->name);
15372 strcat(templateString, " = ");
15374 strcat(templateString, argument);
15383 int len = strlen(templateString);
15385 if(templateString[len - 1] == '>')
15386 templateString[len++] = ' ';
15387 templateString[len++] = '>';
15388 templateString[len++] = '\0';
15391 struct Context * context = SetupTemplatesContext(_class);
15393 FreeType(exp->expType);
15394 exp->expType = ProcessTypeString(templateString, 0x0);
15395 FinishTemplatesContext(context);
15399 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")))))))));
15402 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15404 type = ProcessTemplateParameterType(type->templateParameter);
15407 if(type && (type->kind == 20))
15409 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)))
15411 struct Identifier * id = exp->member.member;
15412 int typeKind = type->kind;
15413 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));
15415 if(typeKind == 19 && exp->member.exp->type == 24)
15417 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15422 if(typeKind == 3 || typeKind == 15)
15423 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15426 if(type->kind == 8 && type->_class && type->_class->registered)
15428 _class = type->_class->registered;
15430 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15432 _class = FindClass("char *")->registered;
15434 else if(type->kind == 13)
15436 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15437 FreeType(exp->expType);
15438 exp->expType = ProcessTypeString("uintptr", 0x0);
15439 exp->byReference = 0x1;
15443 char string[1024] = "";
15444 struct Symbol * classSym;
15446 PrintTypeNoConst(type, string, 0x0, 0x1);
15447 classSym = FindClass(string);
15449 _class = classSym->registered;
15455 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15456 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15457 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15458 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15459 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15461 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15462 exp->member.memberType = 1;
15463 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15464 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15467 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15469 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15470 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15472 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15474 member = (((void *)0));
15476 if(!member && !prop)
15477 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15478 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15479 exp->member.thisPtr = 0x1;
15485 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15486 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15487 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15489 if(!prop && !member)
15491 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15494 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15495 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15496 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15501 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15502 prop = (((void *)0));
15504 member = (((void *)0));
15508 if(!prop && !member && !method)
15509 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15510 if(!prop && !member && !method)
15514 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15517 exp->member.memberType = 5;
15518 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15522 char structName[1024];
15523 struct Identifier * id = exp->member.member;
15524 struct Expression * classExp = exp->member.exp;
15527 FreeType(classExp->expType);
15528 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15529 strcpy(structName, "__ecereClassData_");
15530 FullClassNameCat(structName, type->_class->string, 0x0);
15532 exp->member.member = id;
15533 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"))))))));
15535 ProcessExpressionType(exp);
15541 struct Symbol * classSym = FindClass(id->string);
15545 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15548 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15554 exp->member.memberType = 1;
15555 if(!prop->dataType)
15556 ProcessPropertyType(prop);
15557 exp->expType = prop->dataType;
15559 prop->dataType->refCount++;
15563 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15565 FreeExpContents(exp);
15567 exp->identifier = MkIdentifier("class");
15568 ProcessExpressionType(exp);
15571 exp->member.memberType = 3;
15572 DeclareStruct(_class->fullName, 0x0);
15573 if(!member->dataType)
15575 struct Context * context = SetupTemplatesContext(_class);
15577 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15578 FinishTemplatesContext(context);
15580 exp->expType = member->dataType;
15581 if(member->dataType)
15582 member->dataType->refCount++;
15584 else if(revConvert)
15586 exp->member.memberType = 4;
15587 exp->expType = MkClassType(revConvert->_class->fullName);
15592 exp->member.memberType = 2;
15594 if(!method->dataType)
15595 ProcessMethodType(method);
15596 exp->expType = __extension__ ({
15597 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15599 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15601 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15602 exp->expType->usedClass = _class;
15604 else if(!classProp)
15606 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15608 FreeExpContents(exp);
15610 exp->identifier = MkIdentifier("class");
15611 FreeType(exp->expType);
15612 exp->expType = MkClassType("ecere::com::Class");
15615 yylloc = exp->member.member->loc;
15616 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15618 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15620 if(_class && exp->expType)
15622 struct __ecereNameSpace__ecere__com__Class * tClass;
15625 while(tClass && !tClass->templateClass)
15626 tClass = tClass->base;
15627 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15630 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15631 struct __ecereNameSpace__ecere__com__Class * sClass;
15633 for(sClass = tClass; sClass; sClass = sClass->base)
15636 if(sClass->templateClass)
15637 sClass = sClass->templateClass;
15638 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15640 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15642 for(sClass = sClass->base; sClass; sClass = sClass->base)
15643 id += sClass->templateParams.count;
15651 if(curParam && tClass->templateArgs[id].dataTypeString)
15653 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15654 struct Context * context = SetupTemplatesContext(tClass);
15656 FreeType(exp->expType);
15657 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15660 if(exp->expType->kind == 21)
15662 FreeType(exp->expType);
15663 exp->expType = ReplaceThisClassType(_class);
15665 if(tClass->templateClass)
15666 exp->expType->passAsTemplate = 0x1;
15669 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15670 if(exp->destType->kind == 21)
15672 FreeType(exp->destType);
15673 exp->destType = ReplaceThisClassType(_class);
15677 FinishTemplatesContext(context);
15680 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15683 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15684 struct __ecereNameSpace__ecere__com__Class * sClass;
15686 for(sClass = tClass; sClass; sClass = sClass->base)
15689 if(sClass->templateClass)
15690 sClass = sClass->templateClass;
15691 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15693 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15695 for(sClass = sClass->base; sClass; sClass = sClass->base)
15696 id += sClass->templateParams.count;
15706 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15707 struct Context * context = SetupTemplatesContext(tClass);
15708 struct Type * basicType;
15710 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15713 if(basicType->kind == 21)
15715 FreeType(basicType);
15716 basicType = ReplaceThisClassType(_class);
15718 FreeType(exp->expType);
15719 exp->expType = __extension__ ({
15720 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15722 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15726 exp->destType = exp->expType;
15727 exp->destType->refCount++;
15730 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15731 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15732 struct Declarator * decl;
15734 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15737 exp->destType->refCount++;
15739 exp->expType->refCount++;
15741 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15742 exp->cast.exp = newExp;
15745 FinishTemplatesContext(context);
15748 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15750 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15754 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15757 int paramCount = 0;
15758 int lastParam = -1;
15759 char templateString[1024];
15760 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15762 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15763 while(cClass != expClass)
15765 struct __ecereNameSpace__ecere__com__Class * sClass;
15767 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15770 for(param = cClass->templateParams.first; param; param = param->next)
15772 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15775 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15776 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15778 while(cClassCur != tClass && !paramCur)
15780 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15782 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15784 cClassCur = sClassCur;
15785 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15787 if(!strcmp(paramCur->name, param->name))
15794 if(paramCur && paramCur->type == 0)
15795 arg = tClass->templateArgs[cp];
15797 arg = expClass->templateArgs[p];
15799 char argument[256];
15801 argument[0] = '\0';
15802 switch(param->type)
15806 char expString[1024];
15807 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15808 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15809 struct Expression * exp;
15810 char * string = PrintHexUInt64(arg.expression.ui64);
15812 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15813 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15814 ProcessExpressionType(exp);
15815 ComputeExpression(exp);
15816 expString[0] = '\0';
15817 PrintExpression(exp, expString);
15818 strcat(argument, expString);
15819 FreeExpression(exp);
15824 strcat(argument, arg.member->name);
15829 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15830 strcat(argument, arg.dataTypeString);
15837 strcat(templateString, ", ");
15838 if(lastParam != p - 1)
15840 strcat(templateString, param->name);
15841 strcat(templateString, " = ");
15843 strcat(templateString, argument);
15852 int len = strlen(templateString);
15854 if(templateString[len - 1] == '>')
15855 templateString[len++] = ' ';
15856 templateString[len++] = '>';
15857 templateString[len++] = '\0';
15859 FreeType(exp->expType);
15861 struct Context * context = SetupTemplatesContext(tClass);
15863 exp->expType = ProcessTypeString(templateString, 0x0);
15864 FinishTemplatesContext(context);
15871 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)");
15873 else if(type && (type->kind == 9 || type->kind == 10))
15875 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15879 exp->expType = memberType;
15881 memberType->refCount++;
15886 char expString[10240];
15888 expString[0] = '\0';
15891 PrintExpression(exp, expString);
15892 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15896 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15898 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15900 struct Identifier * id = exp->member.member;
15901 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));
15905 FreeType(exp->expType);
15906 exp->expType = ReplaceThisClassType(_class);
15910 yylloc = oldyylloc;
15915 struct Type * destType = exp->destType;
15917 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15919 exp->member.member->classSym = exp->member.member->_class->symbol;
15921 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15925 ProcessExpressionType(exp);
15932 struct Symbol * classSym = exp->_class->symbol;
15934 if(classSym && classSym->registered)
15936 if(classSym->registered->type == 5)
15941 DeclareStruct(classSym->string, 0x0);
15942 FreeSpecifier(exp->_class);
15944 FullClassNameCat(name, classSym->string, 0x0);
15945 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15949 if(classSym->registered->fixed)
15951 FreeSpecifier(exp->_class);
15952 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15957 char className[1024];
15959 strcpy(className, "__ecereClass_");
15960 FullClassNameCat(className, classSym->string, 0x1);
15961 MangleClassName(className);
15962 DeclareClass(classSym, className);
15963 FreeExpContents(exp);
15965 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15966 exp->member.member = MkIdentifier("structSize");
15970 exp->expType = __extension__ ({
15971 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15973 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15979 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15981 exp->expType = __extension__ ({
15982 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15984 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15986 exp->isConstant = 0x1;
15987 DeclareType(type, 0x0, 0x0);
15993 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15996 FreeType(exp->cast.exp->destType);
15997 exp->cast.exp->destType = type;
15999 ProcessExpressionType(exp->cast.exp);
16001 exp->expType = type;
16002 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16004 void * prev = exp->prev, * next = exp->next;
16005 struct Type * expType = exp->cast.exp->destType;
16006 struct Expression * castExp = exp->cast.exp;
16007 struct Type * destType = exp->destType;
16010 expType->refCount++;
16011 FreeType(exp->expType);
16012 FreeTypeName(exp->cast.typeName);
16014 FreeType(exp->expType);
16015 FreeType(exp->destType);
16016 exp->expType = expType;
16017 exp->destType = destType;
16018 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16024 exp->isConstant = exp->cast.exp->isConstant;
16030 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16032 exp->expType = type;
16037 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16039 ProcessExpressionType(exp->vaArg.exp);
16040 exp->expType = type;
16045 struct Expression * e;
16047 exp->isConstant = 0x1;
16048 FreeType(exp->cond.cond->destType);
16049 exp->cond.cond->destType = MkClassType("bool");
16050 exp->cond.cond->destType->truth = 0x1;
16051 ProcessExpressionType(exp->cond.cond);
16052 if(!exp->cond.cond->isConstant)
16053 exp->isConstant = 0x0;
16054 for(e = (*exp->cond.exp).first; e; e = e->next)
16058 FreeType(e->destType);
16059 e->destType = exp->destType;
16061 e->destType->refCount++;
16063 ProcessExpressionType(e);
16066 exp->expType = e->expType;
16068 e->expType->refCount++;
16071 exp->isConstant = 0x0;
16073 FreeType(exp->cond.elseExp->destType);
16074 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16075 if(exp->cond.elseExp->destType)
16076 exp->cond.elseExp->destType->refCount++;
16077 ProcessExpressionType(exp->cond.elseExp);
16078 if(!exp->cond.elseExp->isConstant)
16079 exp->isConstant = 0x0;
16084 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16086 struct Statement * last = (*exp->compound->compound.statements).last;
16088 if(last->type == 3 && last->expressions && (*last->expressions).last)
16090 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16092 exp->destType->refCount++;
16094 ProcessStatement(exp->compound);
16095 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16097 exp->expType->refCount++;
16103 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16105 if(spec && spec->type == 1)
16107 exp->expType = MkClassType(spec->name);
16108 exp->expType->kind = 19;
16109 exp->byReference = 0x1;
16113 exp->expType = MkClassType("ecere::com::Class");
16114 exp->byReference = 0x1;
16120 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16124 struct Identifier * id = exp->classData.id;
16125 char structName[1024];
16126 struct Expression * classExp;
16128 strcpy(structName, "__ecereClassData_");
16129 FullClassNameCat(structName, _class->fullName, 0x0);
16131 exp->member.member = id;
16132 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16133 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16135 classExp = MkExpIdentifier(MkIdentifier("class"));
16136 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"))))))));
16137 ProcessExpressionType(exp);
16144 struct Type * type = (((void *)0));
16145 char * typeString = (((void *)0));
16146 char typeStringBuf[1024];
16148 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))
16150 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16152 typeString = templateClass->templateArgs[2].dataTypeString;
16156 struct Expression * e;
16158 for(e = (*exp->list).first; e; e = e->next)
16160 ProcessExpressionType(e);
16170 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16174 e->expType = (((void *)0));
16175 e = (*exp->list).first;
16176 ProcessExpressionType(e);
16179 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16181 FreeType(e->expType);
16182 e->expType = (((void *)0));
16184 type = (((void *)0));
16192 FreeType(e->expType);
16193 e->expType = (((void *)0));
16199 typeStringBuf[0] = '\0';
16200 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16201 typeString = typeStringBuf;
16203 type = (((void *)0));
16208 char templateString[1024];
16209 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16210 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16211 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16212 struct Expression * expExt;
16213 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16215 sprintf(templateString, "Container<%s>", typeString);
16218 struct Expression * e;
16220 type = ProcessTypeString(typeString, 0x0);
16221 while(e = (*exp->list).first)
16223 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16224 e->destType = type;
16226 ProcessExpressionType(e);
16227 ListAdd(initializers, MkInitializerAssignment(e));
16230 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16232 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16233 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16234 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16235 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16236 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16237 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16238 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16239 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16240 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16241 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16242 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16244 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16246 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16247 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16248 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16249 exp->expType = ProcessTypeString(templateString, 0x0);
16251 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16252 ProcessExpressionType(expExt);
16256 exp->expType = ProcessTypeString("Container", 0x0);
16257 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16262 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16264 FreeType(exp->expType);
16265 exp->expType = ReplaceThisClassType(thisClass);
16267 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16269 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16273 if(exp->expType->kind != 15)
16275 struct Type * member;
16276 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16278 FreeType(exp->expType);
16279 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16280 exp->expType->kind = symbol->type->kind;
16281 exp->expType->refCount++;
16282 exp->expType->enumName = enumName;
16283 exp->expType->members = symbol->type->members;
16284 for(member = symbol->type->members.first; member; member = member->next)
16285 member->refCount++;
16289 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16291 for(member = symbol->type->members.first; member; member = member->next)
16293 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16301 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16303 else if(exp->destType && !exp->destType->keepCast)
16305 if(!CheckExpressionType(exp, exp->destType, 0x0))
16307 if(!exp->destType->count || unresolved)
16312 if(exp->destType->kind != 14)
16319 char expString[10240];
16321 expString[0] = '\0';
16322 PrintType(exp->destType, type2, 0x0, 0x1);
16325 PrintExpression(exp, expString);
16326 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16329 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16330 else if(exp->type != 16)
16331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16336 char expString[10240];
16338 expString[0] = '\0';
16341 PrintExpression(exp, expString);
16342 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16346 else if(exp->type != 16)
16347 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16359 PrintType(exp->expType, type1, 0x0, 0x1);
16360 PrintType(exp->destType, type2, 0x0, 0x1);
16362 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)))
16366 char expString[10240];
16368 expString[0] = '\0';
16371 PrintExpression(exp, expString);
16372 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16374 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16375 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16376 FreeType(exp->expType);
16377 exp->destType->refCount++;
16378 exp->expType = exp->destType;
16383 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16385 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16386 char typeString[1024];
16387 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16388 struct Declarator * decl;
16390 typeString[0] = '\0';
16393 exp->expType->refCount++;
16395 exp->expType->refCount++;
16397 newExp->destType = exp->expType;
16398 PrintType(exp->expType, typeString, 0x0, 0x0);
16399 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16400 exp->cast.typeName = MkTypeName(specs, decl);
16401 exp->cast.exp = newExp;
16404 else if(unresolved)
16406 if(exp->identifier->_class && exp->identifier->_class->name)
16407 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16408 else if(exp->identifier->string && exp->identifier->string[0])
16409 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16411 else if(!exp->expType && exp->type != 16)
16413 char expString[10240];
16415 expString[0] = '\0';
16418 PrintExpression(exp, expString);
16419 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16421 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16424 ApplyAnyObjectLogic(exp);
16425 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)))
16427 exp->byReference = 0x1;
16429 yylloc = oldyylloc;
16432 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)
16436 *curMember = (*curMember)->next;
16437 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16439 *curMember = subMemberStack[--(*subMemberStackPos)];
16440 *curMember = (*curMember)->next;
16442 while((*curMember) && (*curMember)->isProperty)
16443 *curMember = (*curMember)->next;
16444 if(subMemberStackPos)
16446 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16448 subMemberStack[(*subMemberStackPos)++] = *curMember;
16449 *curMember = (*curMember)->members.first;
16450 while(*curMember && (*curMember)->isProperty)
16451 *curMember = (*curMember)->next;
16459 if(subMemberStackPos && *subMemberStackPos)
16461 *curMember = subMemberStack[--(*subMemberStackPos)];
16462 *curMember = (*curMember)->next;
16466 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16468 if(*curClass == _class)
16470 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16472 *curMember = (*curClass)->membersAndProperties.first;
16474 while((*curMember) && (*curMember)->isProperty)
16475 *curMember = (*curMember)->next;
16476 if(subMemberStackPos)
16478 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16480 subMemberStack[(*subMemberStackPos)++] = *curMember;
16481 *curMember = (*curMember)->members.first;
16482 while(*curMember && (*curMember)->isProperty)
16483 *curMember = (*curMember)->next;
16490 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16495 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16497 if(init->exp && !init->exp->destType)
16499 FreeType(init->exp->destType);
16500 init->exp->destType = type;
16506 ProcessExpressionType(init->exp);
16507 init->isConstant = init->exp->isConstant;
16513 struct Expression * exp = init->exp;
16514 struct Instantiation * inst = exp->instance;
16515 struct MembersInit * members;
16518 init->list = MkList();
16521 for(members = (*inst->members).first; members; members = members->next)
16523 if(members->type == 0)
16525 struct MemberInit * member;
16527 for(member = (*members->dataMembers).first; member; member = member->next)
16529 ListAdd(init->list, member->initializer);
16530 member->initializer = (((void *)0));
16535 FreeExpression(exp);
16539 struct Initializer * i;
16540 struct Type * initializerType = (((void *)0));
16541 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16542 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16543 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16544 int subMemberStackPos = 0;
16546 if(type && type->kind == 12)
16547 initializerType = Dereference(type);
16548 else if(type && (type->kind == 9 || type->kind == 10))
16549 initializerType = type->members.first;
16550 for(i = (*init->list).first; i; i = i->next)
16552 if(type && type->kind == 8 && type->_class && type->_class->registered)
16554 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16557 if(!curMember->dataType)
16558 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16559 initializerType = curMember->dataType;
16562 ProcessInitializer(i, initializerType);
16563 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16564 initializerType = initializerType->next;
16566 init->isConstant = 0x0;
16568 if(type && type->kind == 12)
16569 FreeType(initializerType);
16570 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16572 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16579 extern struct Symbol * FindType(struct Context * ctx, char * name);
16581 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16583 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16589 if(spec->specifier == THISCLASS)
16594 spec->name = ReplaceThisClass(thisClass);
16595 spec->symbol = FindClass(spec->name);
16596 ProcessSpecifier(spec, declareStruct);
16603 struct Symbol * symbol = FindType(curContext, spec->name);
16606 DeclareType(symbol->type, 0x1, 0x1);
16607 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16608 DeclareStruct(spec->name, 0x0);
16613 struct Enumerator * e;
16617 for(e = (*spec->list).first; e; e = e->next)
16620 ProcessExpressionType(e->exp);
16628 if(spec->definitions)
16630 struct ClassDef * def;
16631 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16633 ProcessClass(spec->definitions, symbol);
16640 static void ProcessDeclarator(struct Declarator * decl)
16645 if(decl->identifier->classSym)
16647 FreeSpecifier(decl->identifier->_class);
16648 decl->identifier->_class = (((void *)0));
16652 if(decl->array.exp)
16653 ProcessExpressionType(decl->array.exp);
16660 if(decl->declarator)
16661 ProcessDeclarator(decl->declarator);
16662 if(decl->type == 4)
16664 struct Identifier * id = GetDeclId(decl);
16666 if(id && id->_class)
16668 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16670 if(!decl->function.parameters)
16671 decl->function.parameters = MkList();
16672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16673 id->_class = (((void *)0));
16675 if(decl->function.parameters)
16677 struct TypeName * param;
16679 for(param = (*decl->function.parameters).first; param; param = param->next)
16681 if(param->qualifiers && (*param->qualifiers).first)
16683 struct Specifier * spec = (*param->qualifiers).first;
16685 if(spec && spec->specifier == TYPED_OBJECT)
16687 struct Declarator * d = param->declarator;
16688 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);
16690 FreeList(param->qualifiers, FreeSpecifier);
16691 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16692 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16693 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16696 else if(spec && spec->specifier == ANY_OBJECT)
16698 struct Declarator * d = param->declarator;
16700 FreeList(param->qualifiers, FreeSpecifier);
16701 param->qualifiers = MkListOne(MkSpecifier(VOID));
16702 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16704 else if(spec->specifier == THISCLASS)
16709 spec->name = ReplaceThisClass(thisClass);
16710 spec->symbol = FindClass(spec->name);
16711 ProcessSpecifier(spec, 0x0);
16715 if(param->declarator)
16716 ProcessDeclarator(param->declarator);
16724 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16726 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16728 static void ProcessDeclaration(struct Declaration * decl)
16730 yylloc = decl->loc;
16735 unsigned int declareStruct = 0x0;
16737 if(decl->declarators)
16739 struct InitDeclarator * d;
16741 for(d = (*decl->declarators).first; d; d = d->next)
16743 struct Type * type, * subType;
16745 ProcessDeclarator(d->declarator);
16746 type = ProcessType(decl->specifiers, d->declarator);
16749 ProcessInitializer(d->initializer, type);
16750 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16752 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16754 struct Instantiation * inst = d->initializer->exp->instance;
16756 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16757 d->initializer->exp->instance = (((void *)0));
16758 if(decl->specifiers)
16759 FreeList(decl->specifiers, FreeSpecifier);
16760 FreeList(decl->declarators, FreeInitDeclarator);
16767 for(subType = type; subType; )
16769 if(subType->kind == 8)
16771 declareStruct = 0x1;
16774 else if(subType->kind == 13)
16776 else if(subType->kind == 12)
16777 subType = subType->arrayType;
16786 if(decl->specifiers)
16788 struct Specifier * s;
16790 for(s = (*decl->specifiers).first; s; s = s->next)
16792 ProcessSpecifier(s, declareStruct);
16799 ProcessInstantiationType(decl->inst);
16804 struct Specifier * spec;
16805 struct Declarator * d;
16806 unsigned int declareStruct = 0x0;
16808 if(decl->declarators)
16810 for(d = (*decl->declarators).first; d; d = d->next)
16812 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16813 struct Type * subType;
16815 ProcessDeclarator(d);
16816 for(subType = type; subType; )
16818 if(subType->kind == 8)
16820 declareStruct = 0x1;
16823 else if(subType->kind == 13)
16825 else if(subType->kind == 12)
16826 subType = subType->arrayType;
16833 if(decl->specifiers)
16835 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16836 ProcessSpecifier(spec, declareStruct);
16843 static struct FunctionDefinition * curFunction;
16845 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16847 char propName[1024], propNameM[1024];
16848 char getName[1024], setName[1024];
16849 struct __ecereNameSpace__ecere__sys__OldList * args;
16851 DeclareProperty(prop, setName, getName);
16852 strcpy(propName, "__ecereProp_");
16853 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16854 strcat(propName, "_");
16855 FullClassNameCat(propName, prop->name, 0x1);
16856 MangleClassName(propName);
16857 strcpy(propNameM, "__ecerePropM_");
16858 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16859 strcat(propNameM, "_");
16860 FullClassNameCat(propNameM, prop->name, 0x1);
16861 MangleClassName(propNameM);
16862 if(prop->isWatchable)
16865 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16866 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16867 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16869 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16870 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16871 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16875 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16876 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16877 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16879 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16880 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16881 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16883 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16884 curFunction->propSet->fireWatchersDone = 0x1;
16887 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16889 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16891 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16893 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16895 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16897 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16899 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16901 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16903 static void ProcessStatement(struct Statement * stmt)
16905 yylloc = stmt->loc;
16909 ProcessStatement(stmt->labeled.stmt);
16912 if(stmt->caseStmt.exp)
16914 FreeType(stmt->caseStmt.exp->destType);
16915 stmt->caseStmt.exp->destType = curSwitchType;
16917 curSwitchType->refCount++;
16918 ProcessExpressionType(stmt->caseStmt.exp);
16919 ComputeExpression(stmt->caseStmt.exp);
16921 if(stmt->caseStmt.stmt)
16922 ProcessStatement(stmt->caseStmt.stmt);
16926 if(stmt->compound.context)
16928 struct Declaration * decl;
16929 struct Statement * s;
16930 struct Statement * prevCompound = curCompound;
16931 struct Context * prevContext = curContext;
16933 if(!stmt->compound.isSwitch)
16934 curCompound = stmt;
16935 curContext = stmt->compound.context;
16936 if(stmt->compound.declarations)
16938 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16939 ProcessDeclaration(decl);
16941 if(stmt->compound.statements)
16943 for(s = (*stmt->compound.statements).first; s; s = s->next)
16944 ProcessStatement(s);
16946 curContext = prevContext;
16947 curCompound = prevCompound;
16953 struct Expression * exp;
16955 if(stmt->expressions)
16957 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16958 ProcessExpressionType(exp);
16964 struct Expression * exp;
16966 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16967 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16968 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16969 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16971 ProcessExpressionType(exp);
16973 if(stmt->ifStmt.stmt)
16974 ProcessStatement(stmt->ifStmt.stmt);
16975 if(stmt->ifStmt.elseStmt)
16976 ProcessStatement(stmt->ifStmt.elseStmt);
16981 struct Type * oldSwitchType = curSwitchType;
16983 if(stmt->switchStmt.exp)
16985 struct Expression * exp;
16987 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16991 ProcessExpressionType(exp);
16994 curSwitchType = exp->expType;
16997 ProcessStatement(stmt->switchStmt.stmt);
16998 curSwitchType = oldSwitchType;
17003 if(stmt->whileStmt.exp)
17005 struct Expression * exp;
17007 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17008 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17009 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17010 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17012 ProcessExpressionType(exp);
17015 if(stmt->whileStmt.stmt)
17016 ProcessStatement(stmt->whileStmt.stmt);
17021 if(stmt->doWhile.exp)
17023 struct Expression * exp;
17025 if((*stmt->doWhile.exp).last)
17027 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17028 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17029 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17031 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17033 ProcessExpressionType(exp);
17036 if(stmt->doWhile.stmt)
17037 ProcessStatement(stmt->doWhile.stmt);
17042 struct Expression * exp;
17044 if(stmt->forStmt.init)
17045 ProcessStatement(stmt->forStmt.init);
17046 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17048 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17049 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17050 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17052 if(stmt->forStmt.check)
17053 ProcessStatement(stmt->forStmt.check);
17054 if(stmt->forStmt.increment)
17056 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17057 ProcessExpressionType(exp);
17059 if(stmt->forStmt.stmt)
17060 ProcessStatement(stmt->forStmt.stmt);
17065 struct Identifier * id = stmt->forEachStmt.id;
17066 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17067 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17068 struct Statement * block = stmt->forEachStmt.stmt;
17069 char iteratorType[1024];
17070 struct Type * source;
17071 struct Expression * e;
17072 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));
17073 struct Expression * arrayExp;
17074 char * typeString = (((void *)0));
17075 int builtinCount = 0;
17077 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17081 FreeType(e->destType);
17082 e->destType = ProcessTypeString("Container", 0x0);
17084 if(!isBuiltin || e->next)
17085 ProcessExpressionType(e);
17087 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17088 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17090 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17091 struct Symbol * symbol;
17092 struct Expression * expIt = (((void *)0));
17093 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17094 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17095 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17096 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17099 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17100 stmt->compound.context->parent = curContext;
17101 curContext = stmt->compound.context;
17102 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17104 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17105 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17107 isCustomAVLTree = 0x1;
17108 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17110 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17113 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17115 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17117 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17120 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17124 struct Declarator * decl;
17125 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17127 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17128 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17129 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17133 struct Type * type = (((void *)0));
17134 char typeStringBuf[1024];
17136 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17137 if(((struct Expression *)(*exp).last)->type == 11)
17139 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17142 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17144 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)
17146 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17148 typeString = templateClass->templateArgs[2].dataTypeString;
17150 else if(arrayExp->list)
17152 struct Expression * e;
17154 for(e = (*arrayExp->list).first; e; e = e->next)
17156 ProcessExpressionType(e);
17166 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17170 e->expType = (((void *)0));
17171 e = (*arrayExp->list).first;
17172 ProcessExpressionType(e);
17175 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17177 FreeType(e->expType);
17178 e->expType = (((void *)0));
17180 type = (((void *)0));
17188 FreeType(e->expType);
17189 e->expType = (((void *)0));
17195 typeStringBuf[0] = '\0';
17196 PrintType(type, typeStringBuf, 0x0, 0x1);
17197 typeString = typeStringBuf;
17203 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17204 struct Declarator * decl;
17205 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17209 struct Expression * e;
17211 builtinCount = (*arrayExp->list).count;
17212 type = ProcessTypeString(typeString, 0x0);
17213 while(e = (*arrayExp->list).first)
17215 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17216 e->destType = type;
17218 ProcessExpressionType(e);
17219 ListAdd(initializers, MkInitializerAssignment(e));
17222 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17224 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17225 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17226 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17227 FreeList(exp, FreeExpression);
17231 arrayExp->expType = ProcessTypeString("Container", 0x0);
17232 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17235 else if(isLinkList && !isList)
17237 struct Declarator * decl;
17238 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17240 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17241 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17242 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17244 else if(_class->templateArgs)
17247 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17249 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17250 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17252 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17255 switch(block->type)
17258 if(block->compound.context)
17259 block->compound.context->parent = stmt->compound.context;
17262 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17263 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17264 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17265 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17268 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17269 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17272 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17273 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17276 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17277 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17280 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17281 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17284 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17285 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17291 block = MkIfStmt(filter, block, (((void *)0)));
17295 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));
17296 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17297 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17298 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17304 sprintf(count, "%d", builtinCount);
17305 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));
17306 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17307 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17308 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17310 else if(isLinkList && !isList)
17312 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17313 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17315 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17317 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));
17321 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17322 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17324 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));
17326 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17327 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17328 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17332 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17334 ProcessExpressionType(expIt);
17335 if((*stmt->compound.declarations).first)
17336 ProcessDeclaration((*stmt->compound.declarations).first);
17338 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17339 ProcessStatement(stmt);
17340 curContext = stmt->compound.context->parent;
17345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17357 struct Expression * exp;
17359 if(stmt->expressions)
17361 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17365 if(curFunction && !curFunction->type)
17366 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17367 FreeType(exp->destType);
17368 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17370 exp->destType->refCount++;
17372 ProcessExpressionType(exp);
17379 ProcessDeclaration(stmt->decl);
17384 struct AsmField * field;
17386 if(stmt->asmStmt.inputFields)
17388 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17389 if(field->expression)
17390 ProcessExpressionType(field->expression);
17392 if(stmt->asmStmt.outputFields)
17394 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17395 if(field->expression)
17396 ProcessExpressionType(field->expression);
17398 if(stmt->asmStmt.clobberedFields)
17400 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17402 if(field->expression)
17403 ProcessExpressionType(field->expression);
17410 struct PropertyWatch * propWatch;
17411 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17412 struct Expression * object = stmt->_watch.object;
17413 struct Expression * watcher = stmt->_watch.watcher;
17416 ProcessExpressionType(watcher);
17418 ProcessExpressionType(object);
17421 if(watcher || thisClass)
17423 struct External * external = curExternal;
17424 struct Context * context = curContext;
17427 stmt->expressions = MkList();
17428 curExternal = external->prev;
17429 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17431 struct ClassFunction * func;
17432 char watcherName[1024];
17433 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17434 struct External * createdExternal;
17435 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17438 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17439 if(propWatch->deleteWatch)
17440 strcat(watcherName, "_delete");
17443 struct Identifier * propID;
17445 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17447 strcat(watcherName, "_");
17448 strcat(watcherName, propID->string);
17451 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17453 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17454 ProcessClassFunctionBody(func, propWatch->compound);
17455 propWatch->compound = (((void *)0));
17456 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17457 createdExternal->symbol->idCode = external->symbol->idCode;
17458 curExternal = createdExternal;
17459 ProcessFunction(createdExternal->function);
17461 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17463 externalDecl->declaration = decl;
17464 if(decl->symbol && !decl->symbol->pointerExternal)
17465 decl->symbol->pointerExternal = externalDecl;
17467 if(propWatch->deleteWatch)
17469 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17471 ListAdd(args, CopyExpression(object));
17472 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17473 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17474 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17478 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17479 struct Identifier * propID;
17481 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17483 char propName[1024];
17484 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17488 char getName[1024], setName[1024];
17489 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17491 DeclareProperty(prop, setName, getName);
17492 strcpy(propName, "__ecereProp_");
17493 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17494 strcat(propName, "_");
17495 FullClassNameCat(propName, prop->name, 0x1);
17496 ListAdd(args, CopyExpression(object));
17497 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17498 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17499 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17500 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17503 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17508 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17510 curExternal = external;
17511 curContext = context;
17513 FreeExpression(watcher);
17515 FreeExpression(object);
17516 FreeList(watches, FreePropertyWatch);
17519 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17523 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17525 ProcessStatement(propWatch->compound);
17532 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17533 struct Expression * object = stmt->_watch.object;
17534 struct __ecereNameSpace__ecere__com__Class * _class;
17537 ProcessExpressionType(object);
17540 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17543 struct Identifier * propID;
17546 stmt->expressions = MkList();
17547 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17549 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17556 for(propID = (*watches).first; propID; propID = propID->next)
17558 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17562 CreateFireWatcher(prop, object, stmt);
17565 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17570 struct __ecereNameSpace__ecere__com__Property * prop;
17571 struct __ecereNameSpace__ecere__com__Class * base;
17573 for(base = _class; base; base = base->base)
17575 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17577 if(prop->isProperty && prop->isWatchable)
17579 CreateFireWatcher(prop, object, stmt);
17585 FreeExpression(object);
17586 FreeList(watches, FreeIdentifier);
17589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17595 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17596 struct Expression * object = stmt->_watch.object;
17597 struct Expression * watcher = stmt->_watch.watcher;
17598 struct __ecereNameSpace__ecere__com__Class * _class;
17601 ProcessExpressionType(object);
17603 ProcessExpressionType(watcher);
17606 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17607 if(watcher || thisClass)
17611 struct Identifier * propID;
17614 stmt->expressions = MkList();
17617 struct __ecereNameSpace__ecere__sys__OldList * args;
17620 ListAdd(args, CopyExpression(object));
17621 ListAdd(args, MkExpConstant("0"));
17622 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17623 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17627 for(propID = (*watches).first; propID; propID = propID->next)
17629 char propName[1024];
17630 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17634 char getName[1024], setName[1024];
17635 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17637 DeclareProperty(prop, setName, getName);
17638 strcpy(propName, "__ecereProp_");
17639 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17640 strcat(propName, "_");
17641 FullClassNameCat(propName, prop->name, 0x1);
17642 MangleClassName(propName);
17643 ListAdd(args, CopyExpression(object));
17644 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17645 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17646 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17649 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17653 FreeExpression(object);
17655 FreeExpression(watcher);
17656 FreeList(watches, FreeIdentifier);
17659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17662 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17669 extern struct Expression * QBrackets(struct Expression * exp);
17671 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17673 extern struct Declarator * QMkPtrDecl(char * id);
17675 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17677 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17679 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17681 static void ProcessFunction(struct FunctionDefinition * function)
17683 struct Identifier * id = GetDeclId(function->declarator);
17684 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17685 struct Type * type = symbol ? symbol->type : (((void *)0));
17686 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17687 struct Context * oldTopContext = topContext;
17689 yylloc = function->loc;
17690 if(type && type->thisClass)
17692 struct Symbol * classSym = type->thisClass;
17693 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17694 char className[1024];
17695 char structName[1024];
17696 struct Declarator * funcDecl;
17697 struct Symbol * thisSymbol;
17698 unsigned int typedObject = 0x0;
17700 if(_class && !_class->base)
17702 _class = currentClass;
17703 if(_class && !_class->symbol)
17704 _class->symbol = FindClass(_class->fullName);
17705 classSym = _class ? _class->symbol : (((void *)0));
17708 thisClass = _class;
17709 if(inCompiler && _class)
17711 if(type->kind == 11)
17713 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17715 struct Type * param = symbol->type->params.first;
17717 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17720 if(type->classObjectType != 1)
17722 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17723 symbol->type->staticMethod = 0x1;
17724 symbol->type->thisClass = (((void *)0));
17725 symbol->type->extraParam = 0x0;
17728 strcpy(className, "__ecereClass_");
17729 FullClassNameCat(className, _class->fullName, 0x1);
17730 MangleClassName(className);
17731 structName[0] = (char)0;
17732 FullClassNameCat(structName, _class->fullName, 0x0);
17733 funcDecl = GetFuncDecl(function->declarator);
17736 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17738 struct TypeName * param = (*funcDecl->function.parameters).first;
17740 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17742 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17743 FreeTypeName(param);
17746 if(!function->propertyNoThis)
17748 struct TypeName * thisParam;
17750 if(type->classObjectType != 1)
17752 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17753 if(!funcDecl->function.parameters)
17754 funcDecl->function.parameters = MkList();
17755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17759 if(type->classObjectType != 1)
17761 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17762 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17764 thisParam = __extension__ ({
17765 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17767 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17773 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17775 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17777 funcDecl = GetFuncDecl(initDecl->declarator);
17780 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17782 struct TypeName * param = (*funcDecl->function.parameters).first;
17784 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17786 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17787 FreeTypeName(param);
17790 if(type->classObjectType != 1)
17792 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17794 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17796 if(!funcDecl->function.parameters)
17797 funcDecl->function.parameters = MkList();
17798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17806 if(type->classObjectType != 1)
17808 thisSymbol = __extension__ ({
17809 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17811 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17813 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17814 if(typedObject && thisSymbol->type)
17816 thisSymbol->type->classObjectType = 2;
17817 thisSymbol->type->byReference = type->byReference;
17818 thisSymbol->type->typedByReference = type->byReference;
17822 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17824 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17827 struct __ecereNameSpace__ecere__com__Class * base;
17829 for(base = _class; base && base->type != 1000; base = base->next)
17831 for(member = base->membersAndProperties.first; member; member = member->next)
17832 if(!member->isProperty)
17838 for(member = _class->membersAndProperties.first; member; member = member->next)
17839 if(!member->isProperty)
17843 char pointerName[1024];
17844 struct Declaration * decl;
17845 struct Initializer * initializer;
17846 struct Expression * exp, * bytePtr;
17848 strcpy(pointerName, "__ecerePointer_");
17849 FullClassNameCat(pointerName, _class->fullName, 0x0);
17851 char className[1024];
17853 strcpy(className, "__ecereClass_");
17854 FullClassNameCat(className, classSym->string, 0x1);
17855 MangleClassName(className);
17856 DeclareClass(classSym, className);
17858 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17863 sprintf(string, "%d", _class->offset);
17864 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17868 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17870 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17871 exp->expType = __extension__ ({
17872 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17874 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17875 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17877 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17878 }), __ecereInstance2;
17882 yylloc = function->body->loc;
17883 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17885 struct Context * prevContext = curContext;
17887 curContext = function->body->compound.context;
17888 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17889 curContext = prevContext;
17891 decl->symbol = (((void *)0));
17892 if(!function->body->compound.declarations)
17893 function->body->compound.declarations = MkList();
17894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17900 thisClass = (((void *)0));
17903 FreeSpecifier(id->_class);
17904 id->_class = (((void *)0));
17905 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17907 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17909 id = GetDeclId(initDecl->declarator);
17910 FreeSpecifier(id->_class);
17911 id->_class = (((void *)0));
17915 topContext = function->body->compound.context;
17917 struct FunctionDefinition * oldFunction = curFunction;
17919 curFunction = function;
17921 ProcessStatement(function->body);
17922 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17924 struct Statement * prevCompound = curCompound;
17925 struct Context * prevContext = curContext;
17926 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17928 if(!function->body->compound.statements)
17929 function->body->compound.statements = MkList();
17930 ListAdd(function->body->compound.statements, fireWatchers);
17931 curCompound = function->body;
17932 curContext = function->body->compound.context;
17933 ProcessStatement(fireWatchers);
17934 curContext = prevContext;
17935 curCompound = prevCompound;
17937 curFunction = oldFunction;
17939 if(function->declarator)
17941 ProcessDeclarator(function->declarator);
17943 topContext = oldTopContext;
17944 thisClass = oldThisClass;
17947 extern void FreeSymbol(struct Symbol * symbol);
17949 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17951 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17953 struct ClassDef * def;
17954 struct External * external = curExternal;
17955 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17957 for(def = definitions->first; def; def = def->next)
17961 if(def->function->declarator)
17962 curExternal = def->function->declarator->symbol->pointerExternal;
17964 curExternal = external;
17965 ProcessFunction((struct FunctionDefinition *)def->function);
17967 else if(def->type == 2)
17969 if(def->decl->type == 2)
17971 thisClass = regClass;
17972 ProcessInstantiationType(def->decl->inst);
17973 thisClass = (((void *)0));
17977 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17980 thisClass = regClass;
17981 ProcessDeclaration(def->decl);
17982 thisClass = backThisClass;
17985 else if(def->type == 1 && def->defProperties)
17987 struct MemberInit * defProperty;
17988 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);
17990 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17991 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17993 thisClass = regClass;
17994 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17995 thisClass = (((void *)0));
17997 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17998 FreeSymbol(thisSymbol);
18000 else if(def->type == 3 && def->propertyDef)
18002 struct PropertyDef * prop = def->propertyDef;
18004 thisClass = regClass;
18009 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18011 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18013 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18014 ProcessStatement(prop->setStmt);
18020 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18022 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18024 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18025 ProcessStatement(prop->getStmt);
18027 if(prop->issetStmt)
18031 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18033 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18035 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18036 ProcessStatement(prop->issetStmt);
18038 thisClass = (((void *)0));
18040 else if(def->type == 4 && def->propertyWatch)
18042 struct PropertyWatch * propertyWatch = def->propertyWatch;
18044 thisClass = regClass;
18045 if(propertyWatch->compound)
18047 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);
18049 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18050 curExternal = (((void *)0));
18051 ProcessStatement(propertyWatch->compound);
18053 thisClass = (((void *)0));
18058 void DeclareFunctionUtil(char * s)
18060 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18067 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18068 strcpy(name, "__ecereFunction_");
18069 FullClassNameCat(name, s, 0x0);
18070 DeclareFunction(function, name);
18074 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18076 void ComputeDataTypes()
18078 struct External * external;
18079 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18080 struct External * after = (((void *)0));
18082 currentClass = (((void *)0));
18083 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18084 for(external = (*ast).first; external; external = external->next)
18086 if(external->type == 1)
18088 struct Declaration * decl = external->declaration;
18092 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18096 struct InitDeclarator * initDecl = (*decls).first;
18100 struct Declarator * declarator = initDecl->declarator;
18102 if(declarator && declarator->type == 1)
18104 struct Identifier * id = declarator->identifier;
18106 if(id && id->string)
18108 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18110 external->symbol->id = -1001, external->symbol->idCode = -1001;
18120 temp->symbol = __extension__ ({
18121 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18123 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18126 curExternal = temp;
18127 DeclareFunctionUtil("eSystem_New");
18128 DeclareFunctionUtil("eSystem_New0");
18129 DeclareFunctionUtil("eSystem_Renew");
18130 DeclareFunctionUtil("eSystem_Renew0");
18131 DeclareFunctionUtil("eSystem_Delete");
18132 DeclareFunctionUtil("eClass_GetProperty");
18133 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18134 DeclareStruct("ecere::com::Class", 0x0);
18135 DeclareStruct("ecere::com::Instance", 0x0);
18136 DeclareStruct("ecere::com::Property", 0x0);
18137 DeclareStruct("ecere::com::DataMember", 0x0);
18138 DeclareStruct("ecere::com::Method", 0x0);
18139 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18140 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18141 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18142 for(external = (*ast).first; external; external = external->next)
18144 afterExternal = curExternal = external;
18145 if(external->type == 0)
18147 currentClass = external->function->_class;
18148 ProcessFunction(external->function);
18150 else if(external->type == 1)
18152 currentClass = (((void *)0));
18153 ProcessDeclaration(external->declaration);
18155 else if(external->type == 2)
18157 struct ClassDefinition * _class = external->_class;
18159 currentClass = external->symbol->registered;
18160 if(_class->definitions)
18162 ProcessClass(_class->definitions, _class->symbol);
18166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18167 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18170 else if(external->type == 4)
18172 thisNameSpace = external->id->string;
18175 currentClass = (((void *)0));
18176 thisNameSpace = (((void *)0));
18177 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18178 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18181 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);
18183 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);
18185 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18187 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18189 struct __ecereNameSpace__ecere__com__Class * class;
18191 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18192 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18193 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18194 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18195 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18196 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18197 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18198 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18199 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18200 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18201 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18202 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18203 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18204 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18205 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18206 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18207 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18208 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18209 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18210 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18211 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18212 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18213 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18214 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18215 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18216 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18217 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18218 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18219 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18220 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18221 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18222 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18223 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18224 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18225 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18226 __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);
18227 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18228 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18229 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18230 __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);
18231 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18232 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18233 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18234 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18235 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18236 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18237 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18238 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18239 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18240 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18241 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18242 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18243 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18244 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18245 __ecereClass_Conversion = class;
18246 __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);
18247 __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);
18248 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18249 __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);
18250 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18251 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18252 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18253 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18254 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18255 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18256 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18257 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18258 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18259 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18260 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18261 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18262 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18263 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18264 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18265 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18266 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18267 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18268 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18269 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18270 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18273 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)