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 unsigned int GetOpInt(struct Operand * op2, int * value2)
1666 if(op2->kind == 3 && op2->type->isSigned)
1668 else if(op2->kind == 3)
1669 *value2 = (int)op2->ui;
1670 else if(op2->kind == 4 && op2->type->isSigned)
1671 *value2 = (int)op2->i64;
1672 else if(op2->kind == 4)
1673 *value2 = (int)op2->ui64;
1674 else if(op2->kind == 23 && op2->type->isSigned)
1675 *value2 = (int)op2->i64;
1676 else if(op2->kind == 23)
1677 *value2 = (int)op2->ui64;
1678 else if(op2->kind == 22 && op2->type->isSigned)
1679 *value2 = (int)op2->i64;
1680 else if(op2->kind == 22)
1681 *value2 = (int)op2->ui64;
1682 else if(op2->kind == 2 && op2->type->isSigned)
1683 *value2 = (int)op2->s;
1684 else if(op2->kind == 2)
1685 *value2 = (int)op2->us;
1686 else if(op2->kind == 1 && op2->type->isSigned)
1687 *value2 = (int)op2->c;
1688 else if(op2->kind == 24 || op2->kind == 1)
1689 *value2 = (int)op2->uc;
1690 else if(op2->kind == 6)
1691 *value2 = (int)op2->f;
1692 else if(op2->kind == 7)
1693 *value2 = (int)op2->d;
1694 else if(op2->kind == 13)
1695 *value2 = (int)op2->ui64;
1701 struct Operand GetOperand(struct Expression * exp);
1703 unsigned int GetInt(struct Expression * exp, int * value2)
1705 struct Operand op2 = GetOperand(exp);
1707 return GetOpInt(&op2, value2);
1710 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1712 if(op2->kind == 3 && op2->type->isSigned)
1713 *value2 = (unsigned int)op2->i;
1714 else if(op2->kind == 3)
1716 else if(op2->kind == 4 && op2->type->isSigned)
1717 *value2 = (unsigned int)op2->i64;
1718 else if(op2->kind == 4)
1719 *value2 = (unsigned int)op2->ui64;
1720 else if(op2->kind == 23 && op2->type->isSigned)
1721 *value2 = (unsigned int)op2->i64;
1722 else if(op2->kind == 23)
1723 *value2 = (unsigned int)op2->ui64;
1724 else if(op2->kind == 22 && op2->type->isSigned)
1725 *value2 = (unsigned int)op2->i64;
1726 else if(op2->kind == 22)
1727 *value2 = (unsigned int)op2->ui64;
1728 else if(op2->kind == 2 && op2->type->isSigned)
1729 *value2 = (unsigned int)op2->s;
1730 else if(op2->kind == 2)
1731 *value2 = (unsigned int)op2->us;
1732 else if(op2->kind == 1 && op2->type->isSigned)
1733 *value2 = (unsigned int)op2->c;
1734 else if(op2->kind == 24 || op2->kind == 1)
1735 *value2 = (unsigned int)op2->uc;
1736 else if(op2->kind == 6)
1737 *value2 = (unsigned int)op2->f;
1738 else if(op2->kind == 7)
1739 *value2 = (unsigned int)op2->d;
1740 else if(op2->kind == 13)
1741 *value2 = (unsigned int)op2->ui64;
1747 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1749 struct Operand op2 = GetOperand(exp);
1751 return GetOpUInt(&op2, value2);
1754 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1756 if(op2->kind == 3 && op2->type->isSigned)
1757 *value2 = (long long)op2->i;
1758 else if(op2->kind == 3)
1759 *value2 = (long long)op2->ui;
1760 else if(op2->kind == 4 && op2->type->isSigned)
1762 else if(op2->kind == 4)
1763 *value2 = (long long)op2->ui64;
1764 else if(op2->kind == 23 && op2->type->isSigned)
1766 else if(op2->kind == 23)
1767 *value2 = (long long)op2->ui64;
1768 else if(op2->kind == 22 && op2->type->isSigned)
1770 else if(op2->kind == 22)
1771 *value2 = (long long)op2->ui64;
1772 else if(op2->kind == 2 && op2->type->isSigned)
1773 *value2 = (long long)op2->s;
1774 else if(op2->kind == 2)
1775 *value2 = (long long)op2->us;
1776 else if(op2->kind == 1 && op2->type->isSigned)
1777 *value2 = (long long)op2->c;
1778 else if(op2->kind == 24 || op2->kind == 1)
1779 *value2 = (long long)op2->uc;
1780 else if(op2->kind == 6)
1781 *value2 = (long long)op2->f;
1782 else if(op2->kind == 7)
1783 *value2 = (long long)op2->d;
1784 else if(op2->kind == 13)
1785 *value2 = (long long)op2->ui64;
1791 unsigned int GetInt64(struct Expression * exp, long long * value2)
1793 struct Operand op2 = GetOperand(exp);
1795 return GetOpInt64(&op2, value2);
1798 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1800 if(op2->kind == 3 && op2->type->isSigned)
1801 *value2 = (uint64)op2->i;
1802 else if(op2->kind == 3)
1803 *value2 = (uint64)op2->ui;
1804 else if(op2->kind == 4 && op2->type->isSigned)
1805 *value2 = (uint64)op2->i64;
1806 else if(op2->kind == 4)
1807 *value2 = op2->ui64;
1808 else if(op2->kind == 23 && op2->type->isSigned)
1809 *value2 = (uint64)op2->i64;
1810 else if(op2->kind == 23)
1811 *value2 = op2->ui64;
1812 else if(op2->kind == 22 && op2->type->isSigned)
1813 *value2 = (uint64)op2->i64;
1814 else if(op2->kind == 22)
1815 *value2 = op2->ui64;
1816 else if(op2->kind == 2 && op2->type->isSigned)
1817 *value2 = (uint64)op2->s;
1818 else if(op2->kind == 2)
1819 *value2 = (uint64)op2->us;
1820 else if(op2->kind == 1 && op2->type->isSigned)
1821 *value2 = (uint64)op2->c;
1822 else if(op2->kind == 24 || op2->kind == 1)
1823 *value2 = (uint64)op2->uc;
1824 else if(op2->kind == 6)
1825 *value2 = (uint64)op2->f;
1826 else if(op2->kind == 7)
1827 *value2 = (uint64)op2->d;
1828 else if(op2->kind == 13)
1829 *value2 = op2->ui64;
1835 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1837 struct Operand op2 = GetOperand(exp);
1839 return GetOpUInt64(&op2, value2);
1842 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1844 if(op2->kind == 3 && op2->type->isSigned)
1845 *value2 = (intptr_t)op2->i;
1846 else if(op2->kind == 3)
1847 *value2 = (intptr_t)op2->ui;
1848 else if(op2->kind == 4 && op2->type->isSigned)
1849 *value2 = (intptr_t)op2->i64;
1850 else if(op2->kind == 4)
1851 *value2 = (intptr_t)op2->ui64;
1852 else if(op2->kind == 23 && op2->type->isSigned)
1853 *value2 = (intptr_t)op2->i64;
1854 else if(op2->kind == 23)
1855 *value2 = (intptr_t)op2->ui64;
1856 else if(op2->kind == 22 && op2->type->isSigned)
1857 *value2 = (intptr_t)op2->i64;
1858 else if(op2->kind == 22)
1859 *value2 = (intptr_t)op2->ui64;
1860 else if(op2->kind == 2 && op2->type->isSigned)
1861 *value2 = (intptr_t)op2->s;
1862 else if(op2->kind == 2)
1863 *value2 = (intptr_t)op2->us;
1864 else if(op2->kind == 1 && op2->type->isSigned)
1865 *value2 = (intptr_t)op2->c;
1866 else if(op2->kind == 24 || op2->kind == 1)
1867 *value2 = (intptr_t)op2->uc;
1868 else if(op2->kind == 6)
1869 *value2 = (intptr_t)op2->f;
1870 else if(op2->kind == 7)
1871 *value2 = (intptr_t)op2->d;
1872 else if(op2->kind == 13)
1873 *value2 = (intptr_t)op2->ui64;
1879 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1881 struct Operand op2 = GetOperand(exp);
1883 return GetOpIntPtr(&op2, value2);
1886 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1888 if(op2->kind == 3 && op2->type->isSigned)
1889 *value2 = (uintptr_t)op2->i;
1890 else if(op2->kind == 3)
1891 *value2 = (uintptr_t)op2->ui;
1892 else if(op2->kind == 4 && op2->type->isSigned)
1893 *value2 = (uintptr_t)op2->i64;
1894 else if(op2->kind == 4)
1895 *value2 = (uintptr_t)op2->ui64;
1896 else if(op2->kind == 23 && op2->type->isSigned)
1897 *value2 = (uintptr_t)op2->i64;
1898 else if(op2->kind == 23)
1899 *value2 = (uintptr_t)op2->ui64;
1900 else if(op2->kind == 22 && op2->type->isSigned)
1901 *value2 = (uintptr_t)op2->i64;
1902 else if(op2->kind == 22)
1903 *value2 = (uintptr_t)op2->ui64;
1904 else if(op2->kind == 2 && op2->type->isSigned)
1905 *value2 = (uintptr_t)op2->s;
1906 else if(op2->kind == 2)
1907 *value2 = (uintptr_t)op2->us;
1908 else if(op2->kind == 1 && op2->type->isSigned)
1909 *value2 = (uintptr_t)op2->c;
1910 else if(op2->kind == 24 || op2->kind == 1)
1911 *value2 = (uintptr_t)op2->uc;
1912 else if(op2->kind == 6)
1913 *value2 = (uintptr_t)op2->f;
1914 else if(op2->kind == 7)
1915 *value2 = (uintptr_t)op2->d;
1916 else if(op2->kind == 13)
1917 *value2 = (uintptr_t)op2->ui64;
1923 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1925 struct Operand op2 = GetOperand(exp);
1927 return GetOpUIntPtr(&op2, value2);
1930 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
1932 if(op2->kind == 3 && op2->type->isSigned)
1933 *value2 = (ssize_t)op2->i;
1934 else if(op2->kind == 3)
1935 *value2 = (ssize_t)op2->ui;
1936 else if(op2->kind == 4 && op2->type->isSigned)
1937 *value2 = (ssize_t)op2->i64;
1938 else if(op2->kind == 4)
1939 *value2 = (ssize_t)op2->ui64;
1940 else if(op2->kind == 23 && op2->type->isSigned)
1941 *value2 = (ssize_t)op2->i64;
1942 else if(op2->kind == 23)
1943 *value2 = (ssize_t)op2->ui64;
1944 else if(op2->kind == 22 && op2->type->isSigned)
1945 *value2 = (ssize_t)op2->i64;
1946 else if(op2->kind == 22)
1947 *value2 = (ssize_t)op2->ui64;
1948 else if(op2->kind == 2 && op2->type->isSigned)
1949 *value2 = (ssize_t)op2->s;
1950 else if(op2->kind == 2)
1951 *value2 = (ssize_t)op2->us;
1952 else if(op2->kind == 1 && op2->type->isSigned)
1953 *value2 = (ssize_t)op2->c;
1954 else if(op2->kind == 24 || op2->kind == 1)
1955 *value2 = (ssize_t)op2->uc;
1956 else if(op2->kind == 6)
1957 *value2 = (ssize_t)op2->f;
1958 else if(op2->kind == 7)
1959 *value2 = (ssize_t)op2->d;
1960 else if(op2->kind == 13)
1961 *value2 = (ssize_t)op2->ui64;
1967 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1969 struct Operand op2 = GetOperand(exp);
1971 return GetOpIntSize(&op2, value2);
1974 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
1976 if(op2->kind == 3 && op2->type->isSigned)
1977 *value2 = (size_t)op2->i;
1978 else if(op2->kind == 3)
1979 *value2 = (size_t)op2->ui;
1980 else if(op2->kind == 4 && op2->type->isSigned)
1981 *value2 = (size_t)op2->i64;
1982 else if(op2->kind == 4)
1983 *value2 = (size_t)op2->ui64;
1984 else if(op2->kind == 23 && op2->type->isSigned)
1985 *value2 = (size_t)op2->i64;
1986 else if(op2->kind == 23)
1987 *value2 = (size_t)op2->ui64;
1988 else if(op2->kind == 22 && op2->type->isSigned)
1989 *value2 = (size_t)op2->i64;
1990 else if(op2->kind == 22)
1991 *value2 = (size_t)op2->ui64;
1992 else if(op2->kind == 2 && op2->type->isSigned)
1993 *value2 = (size_t)op2->s;
1994 else if(op2->kind == 2)
1995 *value2 = (size_t)op2->us;
1996 else if(op2->kind == 1 && op2->type->isSigned)
1997 *value2 = (size_t)op2->c;
1998 else if(op2->kind == 24 || op2->kind == 1)
1999 *value2 = (size_t)op2->uc;
2000 else if(op2->kind == 6)
2001 *value2 = (size_t)op2->f;
2002 else if(op2->kind == 7)
2003 *value2 = (size_t)op2->d;
2004 else if(op2->kind == 13)
2005 *value2 = (size_t)op2->ui64;
2011 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2013 struct Operand op2 = GetOperand(exp);
2015 return GetOpUIntSize(&op2, value2);
2018 unsigned int GetOpShort(struct Operand * op2, short * value2)
2020 if(op2->kind == 3 && op2->type->isSigned)
2021 *value2 = (short)op2->i;
2022 else if(op2->kind == 3)
2023 *value2 = (short)op2->ui;
2024 else if(op2->kind == 4 && op2->type->isSigned)
2025 *value2 = (short)op2->i64;
2026 else if(op2->kind == 4)
2027 *value2 = (short)op2->ui64;
2028 else if(op2->kind == 23 && op2->type->isSigned)
2029 *value2 = (short)op2->i64;
2030 else if(op2->kind == 23)
2031 *value2 = (short)op2->ui64;
2032 else if(op2->kind == 22 && op2->type->isSigned)
2033 *value2 = (short)op2->i64;
2034 else if(op2->kind == 22)
2035 *value2 = (short)op2->ui64;
2036 else if(op2->kind == 2 && op2->type->isSigned)
2038 else if(op2->kind == 2)
2039 *value2 = (short)op2->us;
2040 else if(op2->kind == 1 && op2->type->isSigned)
2041 *value2 = (short)op2->c;
2042 else if(op2->kind == 24 || op2->kind == 1)
2043 *value2 = (short)op2->uc;
2044 else if(op2->kind == 6)
2045 *value2 = (short)op2->f;
2046 else if(op2->kind == 7)
2047 *value2 = (short)op2->d;
2048 else if(op2->kind == 13)
2049 *value2 = (short)op2->ui64;
2055 unsigned int GetShort(struct Expression * exp, short * value2)
2057 struct Operand op2 = GetOperand(exp);
2059 return GetOpShort(&op2, value2);
2062 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2064 if(op2->kind == 3 && op2->type->isSigned)
2065 *value2 = (unsigned short)op2->i;
2066 else if(op2->kind == 3)
2067 *value2 = (unsigned short)op2->ui;
2068 else if(op2->kind == 4 && op2->type->isSigned)
2069 *value2 = (unsigned short)op2->i64;
2070 else if(op2->kind == 4)
2071 *value2 = (unsigned short)op2->ui64;
2072 else if(op2->kind == 23 && op2->type->isSigned)
2073 *value2 = (unsigned short)op2->i64;
2074 else if(op2->kind == 23)
2075 *value2 = (unsigned short)op2->ui64;
2076 else if(op2->kind == 22 && op2->type->isSigned)
2077 *value2 = (unsigned short)op2->i64;
2078 else if(op2->kind == 22)
2079 *value2 = (unsigned short)op2->ui64;
2080 else if(op2->kind == 2 && op2->type->isSigned)
2081 *value2 = (unsigned short)op2->s;
2082 else if(op2->kind == 2)
2084 else if(op2->kind == 1 && op2->type->isSigned)
2085 *value2 = (unsigned short)op2->c;
2086 else if(op2->kind == 24 || op2->kind == 1)
2087 *value2 = (unsigned short)op2->uc;
2088 else if(op2->kind == 6)
2089 *value2 = (unsigned short)op2->f;
2090 else if(op2->kind == 7)
2091 *value2 = (unsigned short)op2->d;
2092 else if(op2->kind == 13)
2093 *value2 = (unsigned short)op2->ui64;
2099 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2101 struct Operand op2 = GetOperand(exp);
2103 return GetOpUShort(&op2, value2);
2106 unsigned int GetOpChar(struct Operand * op2, char * value2)
2108 if(op2->kind == 3 && op2->type->isSigned)
2109 *value2 = (char)op2->i;
2110 else if(op2->kind == 3)
2111 *value2 = (char)op2->ui;
2112 else if(op2->kind == 4 && op2->type->isSigned)
2113 *value2 = (char)op2->i64;
2114 else if(op2->kind == 4)
2115 *value2 = (char)op2->ui64;
2116 else if(op2->kind == 23 && op2->type->isSigned)
2117 *value2 = (char)op2->i64;
2118 else if(op2->kind == 23)
2119 *value2 = (char)op2->ui64;
2120 else if(op2->kind == 22 && op2->type->isSigned)
2121 *value2 = (char)op2->i64;
2122 else if(op2->kind == 22)
2123 *value2 = (char)op2->ui64;
2124 else if(op2->kind == 2 && op2->type->isSigned)
2125 *value2 = (char)op2->s;
2126 else if(op2->kind == 2)
2127 *value2 = (char)op2->us;
2128 else if(op2->kind == 1 && op2->type->isSigned)
2130 else if(op2->kind == 24 || op2->kind == 1)
2131 *value2 = (char)op2->uc;
2132 else if(op2->kind == 6)
2133 *value2 = (char)op2->f;
2134 else if(op2->kind == 7)
2135 *value2 = (char)op2->d;
2136 else if(op2->kind == 13)
2137 *value2 = (char)op2->ui64;
2143 unsigned int GetChar(struct Expression * exp, char * value2)
2145 struct Operand op2 = GetOperand(exp);
2147 return GetOpChar(&op2, value2);
2150 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2152 if(op2->kind == 3 && op2->type->isSigned)
2153 *value2 = (unsigned char)op2->i;
2154 else if(op2->kind == 3)
2155 *value2 = (unsigned char)op2->ui;
2156 else if(op2->kind == 4 && op2->type->isSigned)
2157 *value2 = (unsigned char)op2->i64;
2158 else if(op2->kind == 4)
2159 *value2 = (unsigned char)op2->ui64;
2160 else if(op2->kind == 23 && op2->type->isSigned)
2161 *value2 = (unsigned char)op2->i64;
2162 else if(op2->kind == 23)
2163 *value2 = (unsigned char)op2->ui64;
2164 else if(op2->kind == 22 && op2->type->isSigned)
2165 *value2 = (unsigned char)op2->i64;
2166 else if(op2->kind == 22)
2167 *value2 = (unsigned char)op2->ui64;
2168 else if(op2->kind == 2 && op2->type->isSigned)
2169 *value2 = (unsigned char)op2->s;
2170 else if(op2->kind == 2)
2171 *value2 = (unsigned char)op2->us;
2172 else if(op2->kind == 1 && op2->type->isSigned)
2173 *value2 = (unsigned char)op2->c;
2174 else if(op2->kind == 24 || op2->kind == 1)
2176 else if(op2->kind == 6)
2177 *value2 = (unsigned char)op2->f;
2178 else if(op2->kind == 7)
2179 *value2 = (unsigned char)op2->d;
2180 else if(op2->kind == 13)
2181 *value2 = (unsigned char)op2->ui64;
2187 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2189 struct Operand op2 = GetOperand(exp);
2191 return GetOpUChar(&op2, value2);
2194 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2196 if(op2->kind == 3 && op2->type->isSigned)
2197 *value2 = (float)(float)op2->i;
2198 else if(op2->kind == 3)
2199 *value2 = (float)(float)op2->ui;
2200 else if(op2->kind == 4 && op2->type->isSigned)
2201 *value2 = (float)(float)op2->i64;
2202 else if(op2->kind == 4)
2203 *value2 = (float)(float)op2->ui64;
2204 else if(op2->kind == 23 && op2->type->isSigned)
2205 *value2 = (float)(float)op2->i64;
2206 else if(op2->kind == 23)
2207 *value2 = (float)(float)op2->ui64;
2208 else if(op2->kind == 22 && op2->type->isSigned)
2209 *value2 = (float)(float)op2->i64;
2210 else if(op2->kind == 22)
2211 *value2 = (float)(float)op2->ui64;
2212 else if(op2->kind == 2 && op2->type->isSigned)
2213 *value2 = (float)(float)op2->s;
2214 else if(op2->kind == 2)
2215 *value2 = (float)(float)op2->us;
2216 else if(op2->kind == 1 && op2->type->isSigned)
2217 *value2 = (float)(float)op2->c;
2218 else if(op2->kind == 24 || op2->kind == 1)
2219 *value2 = (float)(float)op2->uc;
2220 else if(op2->kind == 6)
2221 *value2 = (float)op2->f;
2222 else if(op2->kind == 7)
2223 *value2 = (float)op2->d;
2224 else if(op2->kind == 13)
2225 *value2 = (float)(float)op2->ui64;
2231 unsigned int GetFloat(struct Expression * exp, float * value2)
2233 struct Operand op2 = GetOperand(exp);
2235 return GetOpFloat(&op2, value2);
2238 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2240 if(op2->kind == 3 && op2->type->isSigned)
2241 *value2 = (double)(double)op2->i;
2242 else if(op2->kind == 3)
2243 *value2 = (double)(double)op2->ui;
2244 else if(op2->kind == 4 && op2->type->isSigned)
2245 *value2 = (double)(double)op2->i64;
2246 else if(op2->kind == 4)
2247 *value2 = (double)(double)op2->ui64;
2248 else if(op2->kind == 23 && op2->type->isSigned)
2249 *value2 = (double)(double)op2->i64;
2250 else if(op2->kind == 23)
2251 *value2 = (double)(double)op2->ui64;
2252 else if(op2->kind == 22 && op2->type->isSigned)
2253 *value2 = (double)(double)op2->i64;
2254 else if(op2->kind == 22)
2255 *value2 = (double)(double)op2->ui64;
2256 else if(op2->kind == 2 && op2->type->isSigned)
2257 *value2 = (double)(double)op2->s;
2258 else if(op2->kind == 2)
2259 *value2 = (double)(double)op2->us;
2260 else if(op2->kind == 1 && op2->type->isSigned)
2261 *value2 = (double)(double)op2->c;
2262 else if(op2->kind == 24 || op2->kind == 1)
2263 *value2 = (double)(double)op2->uc;
2264 else if(op2->kind == 6)
2265 *value2 = (double)op2->f;
2266 else if(op2->kind == 7)
2267 *value2 = (double)op2->d;
2268 else if(op2->kind == 13)
2269 *value2 = (double)(double)op2->ui64;
2275 unsigned int GetDouble(struct Expression * exp, double * value2)
2277 struct Operand op2 = GetOperand(exp);
2279 return GetOpDouble(&op2, value2);
2282 void ComputeExpression(struct Expression * exp);
2284 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2286 extern int targetBits;
2288 int ComputeTypeSize(struct Type * type);
2290 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2292 struct __ecereNameSpace__ecere__com__BitMember
2294 struct __ecereNameSpace__ecere__com__BitMember * prev;
2295 struct __ecereNameSpace__ecere__com__BitMember * next;
2297 unsigned int isProperty;
2300 struct __ecereNameSpace__ecere__com__Class * _class;
2301 char * dataTypeString;
2302 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2303 struct Type * dataType;
2308 } __attribute__ ((gcc_struct));
2310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2312 struct __ecereNameSpace__ecere__sys__OldLink
2314 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2315 struct __ecereNameSpace__ecere__sys__OldLink * next;
2317 } __attribute__ ((gcc_struct));
2319 void FinishTemplatesContext(struct Context * context);
2321 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2323 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2324 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2326 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))
2329 int unionMemberOffset = 0;
2334 member->memberOffset = 0;
2335 if(targetBits < sizeof(void *) * 8)
2336 member->structAlignment = 0;
2338 else if(targetBits < sizeof(void *) * 8)
2339 _class->structAlignment = 0;
2340 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2341 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2342 if(!member && _class->destructionWatchOffset)
2343 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2345 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2347 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2349 if(!dataMember->isProperty)
2351 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2353 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2359 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2361 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2363 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2365 if(!isMember && _class->type == 2 && dataMember->dataType)
2367 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2371 ComputeTypeSize(dataMember->dataType);
2372 if(bitMember->pos == -1)
2373 bitMember->pos = _class->memberOffset;
2374 if(!bitMember->size)
2375 bitMember->size = dataMember->dataType->size * 8;
2376 _class->memberOffset = bitMember->pos + bitMember->size;
2377 for(d = 0; d < bitMember->size; d++)
2383 bitMember->mask = mask << bitMember->pos;
2385 else if(dataMember->type == 0 && dataMember->dataType)
2390 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2391 ComputeTypeSize(dataMember->dataType);
2392 if(dataMember->dataType->bitFieldCount)
2394 bitFields += dataMember->dataType->bitFieldCount;
2401 int size = (bitFields + 7) / 8;
2405 int __simpleStruct0;
2409 int __simpleStruct0;
2411 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2412 if(member->memberOffset % alignment)
2413 member->memberOffset += alignment - (member->memberOffset % alignment);
2415 dataMember->offset = member->memberOffset;
2416 if(member->type == 1)
2417 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2420 member->memberOffset += size;
2427 int __simpleStruct0;
2429 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2430 if(_class->memberOffset % alignment)
2431 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2433 dataMember->offset = _class->memberOffset;
2434 _class->memberOffset += size;
2438 size = dataMember->dataType->size;
2439 alignment = dataMember->dataType->alignment;
2443 int __simpleStruct0;
2447 int __simpleStruct0;
2449 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2450 if(member->memberOffset % alignment)
2451 member->memberOffset += alignment - (member->memberOffset % alignment);
2453 dataMember->offset = member->memberOffset;
2454 if(member->type == 1)
2455 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2458 member->memberOffset += size;
2465 int __simpleStruct0;
2467 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2468 if(_class->memberOffset % alignment)
2469 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2471 dataMember->offset = _class->memberOffset;
2472 _class->memberOffset += size;
2479 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2480 alignment = dataMember->structAlignment;
2483 int __simpleStruct0;
2487 int __simpleStruct0;
2489 if(member->memberOffset % alignment)
2490 member->memberOffset += alignment - (member->memberOffset % alignment);
2491 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2493 dataMember->offset = member->memberOffset;
2494 if(member->type == 1)
2495 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2497 member->memberOffset += dataMember->memberOffset;
2503 int __simpleStruct0;
2505 if(_class->memberOffset % alignment)
2506 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2507 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2509 dataMember->offset = _class->memberOffset;
2510 _class->memberOffset += dataMember->memberOffset;
2518 int size = (bitFields + 7) / 8;
2522 int __simpleStruct0;
2526 int __simpleStruct0;
2528 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2529 if(member->memberOffset % alignment)
2530 member->memberOffset += alignment - (member->memberOffset % alignment);
2532 if(member->type == 1)
2533 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2536 member->memberOffset += size;
2543 int __simpleStruct0;
2545 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2546 if(_class->memberOffset % alignment)
2547 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2549 _class->memberOffset += size;
2554 if(member && member->type == 1)
2556 member->memberOffset = unionMemberOffset;
2560 if(_class->type != 2)
2564 if(_class->structAlignment)
2566 if(_class->memberOffset % _class->structAlignment)
2567 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2569 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2572 struct __ecereNameSpace__ecere__com__Property * prop;
2574 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2576 if(prop->isProperty && prop->isWatchable)
2578 prop->watcherOffset = _class->structSize;
2579 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2584 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2586 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2588 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2590 if(deriv->computeSize)
2592 deriv->offset = _class->structSize;
2593 deriv->memberOffset = 0;
2594 deriv->structSize = deriv->offset;
2595 ComputeClassMembers(deriv, 0x0);
2603 FinishTemplatesContext(context);
2606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2608 struct __ecereNameSpace__ecere__com__NameSpace
2611 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2612 struct __ecereNameSpace__ecere__com__NameSpace * left;
2613 struct __ecereNameSpace__ecere__com__NameSpace * right;
2615 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2616 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2617 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2618 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2619 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2620 } __attribute__ ((gcc_struct));
2622 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2624 struct __ecereNameSpace__ecere__com__Module
2626 struct __ecereNameSpace__ecere__com__Instance * application;
2627 struct __ecereNameSpace__ecere__sys__OldList classes;
2628 struct __ecereNameSpace__ecere__sys__OldList defines;
2629 struct __ecereNameSpace__ecere__sys__OldList functions;
2630 struct __ecereNameSpace__ecere__sys__OldList modules;
2631 struct __ecereNameSpace__ecere__com__Instance * prev;
2632 struct __ecereNameSpace__ecere__com__Instance * next;
2638 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2639 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2640 } __attribute__ ((gcc_struct));
2642 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2644 struct __ecereNameSpace__ecere__com__Class * _class;
2645 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2647 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2648 ComputeModuleClasses(subModule->data);
2649 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2650 ComputeClassMembers(_class, 0x0);
2653 extern unsigned int inCompiler;
2655 extern void Compiler_Error(char * format, ...);
2657 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2659 int ComputeTypeSize(struct Type * type)
2661 unsigned int size = type ? type->size : 0;
2663 if(!size && type && !type->computing)
2665 type->computing = 0x1;
2669 type->alignment = size = sizeof(char);
2672 type->alignment = size = sizeof(char);
2675 type->alignment = size = sizeof(int);
2678 type->alignment = size = sizeof(long long);
2681 type->alignment = size = targetBits / 8;
2684 type->alignment = size = targetBits / 8;
2687 type->alignment = size = sizeof(long);
2690 type->alignment = size = sizeof(short);
2693 type->alignment = size = sizeof(float);
2696 type->alignment = size = sizeof(double);
2700 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2702 if(_class && _class->type == 1)
2704 ComputeClassMembers(_class, 0x0);
2705 type->alignment = _class->structAlignment;
2706 size = _class->structSize;
2707 if(type->alignment && size % type->alignment)
2708 size += type->alignment - (size % type->alignment);
2710 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2712 if(!_class->dataType)
2713 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2714 size = type->alignment = ComputeTypeSize(_class->dataType);
2717 size = type->alignment = targetBits / 8;
2722 size = type->alignment = targetBits / 8;
2725 if(type->arraySizeExp)
2727 ProcessExpressionType(type->arraySizeExp);
2728 ComputeExpression(type->arraySizeExp);
2729 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)))
2731 struct Location oldLoc = yylloc;
2732 char expression[10240];
2734 expression[0] = '\0';
2735 type->arraySizeExp->expType = (((void *)0));
2736 yylloc = type->arraySizeExp->loc;
2738 PrintExpression(type->arraySizeExp, expression);
2739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2742 GetInt(type->arraySizeExp, &type->arraySize);
2744 else if(type->enumClass)
2746 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2748 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2751 type->arraySize = 0;
2755 type->arraySize = 0;
2757 size = ComputeTypeSize(type->type) * type->arraySize;
2759 type->alignment = type->type->alignment;
2763 struct Type * member;
2765 for(member = type->members.first; member; member = member->next)
2767 int __simpleStruct0, __simpleStruct1;
2768 unsigned int addSize = ComputeTypeSize(member);
2770 member->offset = size;
2771 if(member->alignment && size % member->alignment)
2772 member->offset += member->alignment - (size % member->alignment);
2773 size = member->offset;
2774 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2777 if(type->alignment && size % type->alignment)
2778 size += type->alignment - (size % type->alignment);
2783 struct Type * member;
2785 for(member = type->members.first; member; member = member->next)
2787 int __simpleStruct0, __simpleStruct1;
2788 unsigned int addSize = ComputeTypeSize(member);
2790 member->offset = size;
2791 if(member->alignment && size % member->alignment)
2792 member->offset += member->alignment - (size % member->alignment);
2793 size = member->offset;
2794 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2795 size = ((size > addSize) ? size : addSize);
2797 if(type->alignment && size % type->alignment)
2798 size += type->alignment - (size % type->alignment);
2803 struct TemplateParameter * param = type->templateParameter;
2804 struct Type * baseType = ProcessTemplateParameterType(param);
2808 size = ComputeTypeSize(baseType);
2809 type->alignment = baseType->alignment;
2812 type->alignment = size = sizeof(uint64);
2817 type->alignment = size = sizeof(enum
2825 type->alignment = size = targetBits / 8;
2830 type->computing = 0x0;
2835 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2837 extern struct Identifier * MkIdentifier(char * string);
2839 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2841 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2843 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2845 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2847 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2849 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2851 extern void FreeType(struct Type * type);
2853 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2855 extern struct Specifier * MkSpecifier(int specifier);
2857 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2859 extern struct Expression * MkExpConstant(char * string);
2861 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)
2863 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2864 unsigned int totalSize = 0;
2865 unsigned int maxSize = 0;
2866 int alignment, size;
2867 struct __ecereNameSpace__ecere__com__DataMember * member;
2868 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2871 *addedPadding = 0x0;
2872 if(!isMember && _class->base)
2874 maxSize = _class->structSize;
2876 if(_class->type == 1 || _class->type == 5)
2877 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2880 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2882 if(maxSize > baseSize)
2883 maxSize -= baseSize;
2889 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2891 if(!member->isProperty)
2893 switch(member->type)
2897 if(member->dataTypeString)
2899 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2900 struct Declarator * decl;
2902 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2903 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2904 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2905 if(!member->dataType)
2906 member->dataType = ProcessType(specs, decl);
2907 ReplaceThisClassSpecifiers(specs, topClass);
2909 struct Type * type = ProcessType(specs, decl);
2911 DeclareType(member->dataType, 0x0, 0x0);
2914 ComputeTypeSize(member->dataType);
2915 size = member->dataType->size;
2916 alignment = member->dataType->alignment;
2919 if(totalSize % alignment)
2920 totalSize += alignment - (totalSize % alignment);
2929 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2932 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2933 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2934 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2935 alignment = member->structAlignment;
2938 if(totalSize % alignment)
2939 totalSize += alignment - (totalSize % alignment);
2949 unsigned int __simpleStruct0;
2951 if(topMember && topMember->type == 1)
2952 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2954 *retSize += totalSize;
2956 else if(totalSize < maxSize && _class->type != 1000)
2958 int autoPadding = 0;
2960 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2961 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2962 if(totalSize + autoPadding < maxSize)
2964 char sizeString[50];
2966 sprintf(sizeString, "%d", maxSize - totalSize);
2967 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2969 *addedPadding = 0x1;
2973 FinishTemplatesContext(context);
2974 return topMember ? topMember->memberID : _class->memberID;
2977 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2979 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2980 unsigned int totalSize = 0;
2981 struct __ecereNameSpace__ecere__com__DataMember * member;
2982 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2984 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2985 DeclareMembers(_class->base, 0x0);
2986 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2988 if(!member->isProperty)
2990 switch(member->type)
2994 if(!member->dataType && member->dataTypeString)
2995 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2996 if(member->dataType)
2997 DeclareType(member->dataType, 0x0, 0x0);
3003 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3010 FinishTemplatesContext(context);
3011 return topMember ? topMember->memberID : _class->memberID;
3014 extern struct Symbol * FindClass(char * name);
3016 extern char * strchr(const char * , int);
3018 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3020 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3022 extern void FreeClassDef(struct ClassDef * def);
3024 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3026 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3028 extern char * strcpy(char * , const char * );
3030 extern void MangleClassName(char * className);
3032 extern void DeclareClass(struct Symbol * classSym, char * className);
3034 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3036 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3038 void DeclareStruct(char * name, unsigned int skipNoHead)
3040 struct External * external = (((void *)0));
3041 struct Symbol * classSym = FindClass(name);
3043 if(!inCompiler || !classSym)
3045 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3047 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3049 struct Declaration * decl;
3050 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3051 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3052 char structName[1024];
3054 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3055 classSym->declaring++;
3056 if(strchr(classSym->string, '<'))
3058 if(classSym->registered->templateClass)
3060 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3061 classSym->declaring--;
3065 DeclareMembers(classSym->registered, 0x0);
3066 structName[0] = (char)0;
3067 FullClassNameCat(structName, name, 0x0);
3070 unsigned int addedPadding = 0x0;
3072 classSym->declaredStructSym = 0x1;
3073 declarations = MkList();
3074 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3075 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3077 FreeList(declarations, FreeClassDef);
3078 declarations = (((void *)0));
3081 if(skipNoHead || declarations)
3083 if(external && external->declaration)
3085 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3086 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3088 if(classSym->structExternal)
3089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3091 classSym->id = curExternal->symbol->idCode;
3092 classSym->idCode = curExternal->symbol->idCode;
3098 external = MkExternalDeclaration((((void *)0)));
3099 specifiers = MkList();
3100 declarators = MkList();
3101 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3102 external->declaration = decl = MkDeclaration(specifiers, declarators);
3103 if(decl->symbol && !decl->symbol->pointerExternal)
3104 decl->symbol->pointerExternal = external;
3105 if(classSym->registered && classSym->registered->type == 1)
3107 char className[1024];
3109 strcpy(className, "__ecereClass_");
3110 FullClassNameCat(className, classSym->string, 0x1);
3111 MangleClassName(className);
3112 DeclareClass(classSym, className);
3113 external->symbol = classSym;
3114 classSym->pointerExternal = external;
3115 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3116 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3120 char className[1024];
3122 strcpy(className, "__ecereClass_");
3123 FullClassNameCat(className, classSym->string, 0x1);
3124 MangleClassName(className);
3125 classSym->structExternal = external;
3126 DeclareClass(classSym, className);
3127 external->symbol = classSym;
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3132 classSym->declaring--;
3134 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3136 classSym->declaring++;
3138 if(classSym->registered)
3139 DeclareMembers(classSym->registered, 0x0);
3141 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3143 if(classSym->structExternal)
3144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3146 classSym->id = curExternal->symbol->idCode;
3147 classSym->idCode = curExternal->symbol->idCode;
3149 classSym->declaring--;
3153 extern char * strcat(char * , const char * );
3155 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3157 extern struct ModuleImport * mainModule;
3159 extern struct Specifier * MkSpecifierName(char * name);
3161 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3163 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3165 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3167 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3169 extern void FreeDeclarator(struct Declarator * decl);
3171 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3173 struct PropertyImport
3175 struct PropertyImport * prev;
3176 struct PropertyImport * next;
3178 unsigned int isVirtual;
3179 unsigned int hasSet;
3180 unsigned int hasGet;
3181 } __attribute__ ((gcc_struct));
3183 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3185 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3187 struct Symbol * symbol = prop->symbol;
3188 char propName[1024];
3190 strcpy(setName, "__ecereProp_");
3191 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3192 strcat(setName, "_Set_");
3193 FullClassNameCat(setName, prop->name, 0x1);
3194 strcpy(getName, "__ecereProp_");
3195 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3196 strcat(getName, "_Get_");
3197 FullClassNameCat(getName, prop->name, 0x1);
3198 strcpy(propName, "__ecereProp_");
3199 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3200 strcat(propName, "_");
3201 FullClassNameCat(propName, prop->name, 0x1);
3202 MangleClassName(getName);
3203 MangleClassName(setName);
3204 MangleClassName(propName);
3205 if(prop->_class->type == 1)
3206 DeclareStruct(prop->_class->fullName, 0x0);
3207 if(!symbol || curExternal->symbol->idCode < symbol->id)
3209 unsigned int imported = 0x0;
3210 unsigned int dllImport = 0x0;
3212 if(!symbol || symbol->_import)
3216 struct Symbol * classSym;
3218 if(!prop->_class->symbol)
3219 prop->_class->symbol = FindClass(prop->_class->fullName);
3220 classSym = prop->_class->symbol;
3221 if(classSym && !classSym->_import)
3223 struct ModuleImport * module;
3225 if(prop->_class->module)
3226 module = FindModule(prop->_class->module);
3228 module = mainModule;
3229 classSym->_import = __extension__ ({
3230 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3232 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3236 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3237 symbol->_import = (struct ClassImport *)__extension__ ({
3238 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3240 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3246 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3251 struct Context * context = SetupTemplatesContext(prop->_class);
3253 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3254 FinishTemplatesContext(context);
3258 if(!symbol->externalGet || symbol->externalGet->type == 0)
3260 struct Declaration * decl;
3261 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3262 struct Declarator * d;
3263 struct __ecereNameSpace__ecere__sys__OldList * params;
3264 struct Specifier * spec;
3265 struct External * external;
3266 struct Declarator * typeDecl;
3267 unsigned int simple = 0x0;
3269 specifiers = MkList();
3270 declarators = MkList();
3272 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3273 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3275 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3277 struct Context * context = SetupTemplatesContext(prop->_class);
3279 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3280 FinishTemplatesContext(context);
3282 for(spec = (*specifiers).first; spec; spec = spec->next)
3286 if((!typeDecl || typeDecl->type == 1))
3288 struct Symbol * classSym = spec->symbol;
3290 symbol->_class = classSym->registered;
3291 if(classSym->registered && classSym->registered->type == 1)
3293 DeclareStruct(spec->name, 0x0);
3300 d = PlugDeclarator(typeDecl, d);
3303 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3304 specifiers = MkList();
3306 d = MkDeclaratorFunction(d, params);
3308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3309 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3310 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3312 ListAdd(specifiers, MkSpecifier(VOID));
3313 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3314 decl = MkDeclaration(specifiers, declarators);
3315 external = MkExternalDeclaration(decl);
3316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3317 external->symbol = symbol;
3318 symbol->externalGet = external;
3319 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3321 FreeDeclarator(typeDecl);
3325 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3330 if(!symbol->externalSet || symbol->externalSet->type == 0)
3332 struct Declaration * decl;
3333 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3334 struct Declarator * d;
3335 struct __ecereNameSpace__ecere__sys__OldList * params;
3336 struct Specifier * spec;
3337 struct External * external;
3338 struct Declarator * typeDecl;
3340 declarators = MkList();
3342 if(!prop->conversion || prop->_class->type == 1)
3344 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3346 specifiers = MkList();
3348 struct Context * context = SetupTemplatesContext(prop->_class);
3350 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3351 FinishTemplatesContext(context);
3353 ListAdd(params, MkTypeName(specifiers, d));
3354 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3356 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3357 d = MkDeclaratorFunction(d, params);
3358 for(spec = (*specifiers).first; spec; spec = spec->next)
3362 if((!typeDecl || typeDecl->type == 1))
3364 struct Symbol * classSym = spec->symbol;
3366 symbol->_class = classSym->registered;
3367 if(classSym->registered && classSym->registered->type == 1)
3368 DeclareStruct(spec->name, 0x0);
3372 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3373 specifiers = MkList();
3375 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3376 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3377 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3378 if(!prop->conversion || prop->_class->type == 1)
3379 ListAdd(specifiers, MkSpecifier(VOID));
3381 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3382 decl = MkDeclaration(specifiers, declarators);
3383 external = MkExternalDeclaration(decl);
3384 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3385 external->symbol = symbol;
3386 symbol->externalSet = external;
3387 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3391 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3394 if(!symbol->externalPtr)
3396 struct Declaration * decl;
3397 struct External * external;
3398 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3404 ListAdd(specifiers, MkSpecifierName("Property"));
3406 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3408 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3411 strcpy(propName, "__ecerePropM_");
3412 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3413 strcat(propName, "_");
3414 FullClassNameCat(propName, prop->name, 0x1);
3415 MangleClassName(propName);
3416 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3418 decl = MkDeclaration(specifiers, list);
3420 external = MkExternalDeclaration(decl);
3421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3422 external->symbol = symbol;
3423 symbol->externalPtr = external;
3427 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3429 symbol->id = curExternal->symbol->idCode;
3433 struct Type * Dereference(struct Type * source)
3435 struct Type * type = (((void *)0));
3439 if(source->kind == 13 || source->kind == 12)
3441 type = source->type;
3442 source->type->refCount++;
3444 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3446 type = __extension__ ({
3447 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3449 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3452 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3463 static struct Type * Reference(struct Type * source)
3465 struct Type * type = (((void *)0));
3469 type = __extension__ ({
3470 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3472 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3479 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);
3481 extern void * memcpy(void * , const void * , size_t size);
3483 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3485 extern void FreeExpression(struct Expression * exp);
3487 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3489 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);
3491 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3493 extern struct Type * MkClassType(char * name);
3495 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);
3497 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)
3499 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3500 unsigned int found = 0x0;
3501 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3502 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3503 unsigned int freeType = 0x0;
3505 yylloc = member->loc;
3510 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3514 dataMember = *curMember;
3520 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3521 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3522 int _subMemberStackPos = 0;
3525 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3528 dataMember = thisMember;
3529 if(curMember && thisMember->memberAccess == 1)
3531 *curMember = thisMember;
3532 *curClass = thisMember->_class;
3533 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3534 *subMemberStackPos = _subMemberStackPos;
3540 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3541 if(method && method->type == 1)
3544 method = (((void *)0));
3549 struct Type * type = (((void *)0));
3553 if(!dataMember->dataType && dataMember->dataTypeString)
3555 struct Context * context = SetupTemplatesContext(_class);
3557 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3558 FinishTemplatesContext(context);
3560 type = dataMember->dataType;
3564 if(!method->dataType)
3565 ProcessMethodType(method);
3566 type = method->dataType;
3568 if(ident && ident->next)
3570 for(ident = ident->next; ident && type; ident = ident->next)
3574 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3576 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3578 type = dataMember->dataType;
3580 else if(type->kind == 9 || type->kind == 10)
3582 struct Type * memberType;
3584 for(memberType = type->members.first; memberType; memberType = memberType->next)
3586 if(!strcmp(memberType->name, ident->string))
3595 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3599 struct __ecereNameSpace__ecere__com__Class * sClass;
3601 for(sClass = _class; sClass; sClass = sClass->base)
3604 if(sClass->templateClass)
3605 sClass = sClass->templateClass;
3606 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3608 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3610 for(sClass = sClass->base; sClass; sClass = sClass->base)
3612 if(sClass->templateClass)
3613 sClass = sClass->templateClass;
3614 id += sClass->templateParams.count;
3625 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3627 if(arg.dataTypeString)
3629 type = ProcessTypeString(arg.dataTypeString, 0x0);
3631 if(type && _class->templateClass)
3632 type->passAsTemplate = 0x1;
3639 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3641 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3642 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3646 char templateString[1024];
3647 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3649 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3650 for(cClass = expClass; cClass; cClass = cClass->base)
3654 if(cClass->templateClass)
3655 cClass = cClass->templateClass;
3656 for(param = cClass->templateParams.first; param; param = param->next)
3659 struct __ecereNameSpace__ecere__com__Class * sClass;
3660 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3662 for(sClass = cClass->base; sClass; sClass = sClass->base)
3664 if(sClass->templateClass)
3665 sClass = sClass->templateClass;
3666 id += sClass->templateParams.count;
3668 arg = expClass->templateArgs[id];
3669 for(sClass = _class; sClass; sClass = sClass->base)
3671 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3673 struct __ecereNameSpace__ecere__com__Class * nextClass;
3675 if(sClass->templateClass)
3676 sClass = sClass->templateClass;
3677 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3679 if(nextClass->templateClass)
3680 nextClass = nextClass->templateClass;
3681 p += nextClass->templateParams.count;
3683 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3685 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3687 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3689 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3690 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3704 char expString[1024];
3705 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3706 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3707 struct Expression * exp;
3708 char * string = PrintHexUInt64(arg.expression.ui64);
3710 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3711 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3712 ProcessExpressionType(exp);
3713 ComputeExpression(exp);
3714 expString[0] = '\0';
3715 PrintExpression(exp, expString);
3716 strcat(argument, expString);
3717 FreeExpression(exp);
3722 strcat(argument, arg.member->name);
3727 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3728 strcat(argument, arg.dataTypeString);
3735 strcat(templateString, ", ");
3736 if(lastParam != p - 1)
3738 strcat(templateString, param->name);
3739 strcat(templateString, " = ");
3741 strcat(templateString, argument);
3750 int len = strlen(templateString);
3752 if(templateString[len - 1] == '<')
3756 if(templateString[len - 1] == '>')
3757 templateString[len++] = ' ';
3758 templateString[len++] = '>';
3760 templateString[len++] = '\0';
3763 struct Context * context = SetupTemplatesContext(_class);
3767 type = ProcessTypeString(templateString, 0x0);
3769 FinishTemplatesContext(context);
3772 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3774 ProcessExpressionType(member->initializer->exp);
3775 if(!member->initializer->exp->expType)
3779 char expString[10240];
3781 expString[0] = '\0';
3782 PrintExpression(member->initializer->exp, expString);
3783 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3784 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3787 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3792 else if(member->initializer)
3794 ProcessInitializer(member->initializer, type);
3801 if(_class && _class->type == 3)
3803 if(member->initializer)
3805 struct Type * type = MkClassType(_class->fullName);
3807 ProcessInitializer(member->initializer, type);
3813 if(member->initializer)
3815 ProcessInitializer(member->initializer, (((void *)0)));
3821 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3825 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3827 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3836 extern struct Identifier * GetDeclId(struct Declarator * decl);
3838 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);
3840 extern void FreeSpecifier(struct Specifier * spec);
3842 static void ProcessFunction(struct FunctionDefinition * function);
3844 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3846 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3848 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3850 extern void FreeClassFunction(struct ClassFunction * func);
3852 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3854 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3856 void ProcessInstantiationType(struct Instantiation * inst)
3861 struct MembersInit * members;
3862 struct Symbol * classSym;
3863 struct __ecereNameSpace__ecere__com__Class * _class;
3865 classSym = inst->_class->symbol;
3866 _class = classSym ? classSym->registered : (((void *)0));
3867 if(!_class || _class->type != 5)
3868 DeclareStruct(inst->_class->name, 0x0);
3869 afterExternal = afterExternal ? afterExternal : curExternal;
3871 ProcessExpressionType(inst->exp);
3872 inst->isConstant = 0x1;
3875 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3876 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3877 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3878 int subMemberStackPos = 0;
3880 for(members = (*inst->members).first; members; members = members->next)
3882 switch(members->type)
3887 static unsigned int instMethodID = 0;
3888 struct External * external = curExternal;
3889 struct Context * context = curContext;
3890 struct Declarator * declarator = members->function->declarator;
3891 struct Identifier * nameID = GetDeclId(declarator);
3892 char * unmangled = nameID ? nameID->string : (((void *)0));
3893 struct Expression * exp;
3894 struct External * createdExternal = (((void *)0));
3900 strcpy(name, "__ecereInstMeth_");
3901 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3903 strcat(name, nameID->string);
3905 sprintf(number, "_%08d", instMethodID++);
3906 strcat(name, number);
3907 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3911 struct Symbol * symbol = declarator->symbol;
3912 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3914 if(method && method->type == 1)
3916 symbol->method = method;
3917 ProcessMethodType(method);
3918 if(!symbol->type->thisClass)
3920 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3922 if(!currentClass->symbol)
3923 currentClass->symbol = FindClass(currentClass->fullName);
3924 symbol->type->thisClass = currentClass->symbol;
3929 _class->symbol = FindClass(_class->fullName);
3930 symbol->type->thisClass = _class->symbol;
3933 DeclareType(symbol->type, 0x1, 0x1);
3937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3940 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3943 FreeSpecifier(nameID->_class);
3944 nameID->_class = (((void *)0));
3948 struct Type * type = declarator->symbol->type;
3949 struct External * oldExternal = curExternal;
3951 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3953 struct External * externalDecl;
3955 externalDecl = MkExternalDeclaration((((void *)0)));
3956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3957 if(createdExternal->function)
3959 ProcessFunction(createdExternal->function);
3961 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3963 externalDecl->declaration = decl;
3964 if(decl->symbol && !decl->symbol->pointerExternal)
3965 decl->symbol->pointerExternal = externalDecl;
3966 declarator->symbol->pointerExternal = externalDecl;
3973 curExternal = declarator->symbol->pointerExternal;
3974 ProcessFunction((struct FunctionDefinition *)members->function);
3976 curExternal = external;
3977 curContext = context;
3980 FreeClassFunction(members->function);
3981 exp = QMkExpId(name);
3983 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3984 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3990 if(members->dataMembers && classSym)
3992 struct MemberInit * member;
3993 struct Location oldyyloc = yylloc;
3995 for(member = (*members->dataMembers).first; member; member = member->next)
3997 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3998 if(member->initializer && !member->initializer->isConstant)
3999 inst->isConstant = 0x0;
4011 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4015 if(type->kind == 11)
4017 struct Type * param;
4021 for(param = type->params.first; param; param = param->next)
4022 DeclareType(param, declarePointers, 0x1);
4024 DeclareType(type->returnType, declarePointers, 0x1);
4026 else if(type->kind == 13 && declarePointers)
4027 DeclareType(type->type, declarePointers, 0x0);
4028 else if(type->kind == 8)
4030 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4031 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4033 else if(type->kind == 9 || type->kind == 10)
4035 struct Type * member;
4037 for(member = type->members.first; member; member = member->next)
4038 DeclareType(member, 0x0, 0x0);
4040 else if(type->kind == 12)
4041 DeclareType(type->arrayType, declarePointers, 0x0);
4045 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4047 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4049 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4051 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4052 struct __ecereNameSpace__ecere__com__Class * sClass;
4054 for(sClass = _class; sClass; sClass = sClass->base)
4057 if(sClass->templateClass)
4058 sClass = sClass->templateClass;
4059 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4061 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4063 for(sClass = sClass->base; sClass; sClass = sClass->base)
4065 if(sClass->templateClass)
4066 sClass = sClass->templateClass;
4067 id += sClass->templateParams.count;
4078 arg = &_class->templateArgs[id];
4079 if(arg && param->type == 0)
4080 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4085 extern struct Context * PushContext(void);
4087 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4089 struct TemplatedType
4092 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4093 struct __ecereNameSpace__ecere__sys__BTNode * left;
4094 struct __ecereNameSpace__ecere__sys__BTNode * right;
4096 struct TemplateParameter * param;
4097 } __attribute__ ((gcc_struct));
4099 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4101 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4103 struct Context * context = PushContext();
4105 context->templateTypesOnly = 0x1;
4106 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4108 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4110 for(; param; param = param->next)
4112 if(param->type == 0 && param->identifier)
4114 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4116 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4122 struct __ecereNameSpace__ecere__com__Class * sClass;
4124 for(sClass = _class; sClass; sClass = sClass->base)
4126 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4128 for(p = sClass->templateParams.first; p; p = p->next)
4132 struct TemplateParameter * param = p->param;
4133 struct TemplatedType * type;
4137 p->param = param = __extension__ ({
4138 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4140 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4143 type = __extension__ ({
4144 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4146 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4148 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4156 extern void PopContext(struct Context * ctx);
4158 extern void FreeContext(struct Context * context);
4160 void FinishTemplatesContext(struct Context * context)
4162 PopContext(context);
4163 FreeContext(context);
4164 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4167 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4169 if(!method->dataType)
4171 struct Context * context = SetupTemplatesContext(method->_class);
4173 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4174 FinishTemplatesContext(context);
4175 if(method->type != 1 && method->dataType)
4177 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4179 if(!method->_class->symbol)
4180 method->_class->symbol = FindClass(method->_class->fullName);
4181 method->dataType->thisClass = method->_class->symbol;
4187 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4191 struct Context * context = SetupTemplatesContext(prop->_class);
4193 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4194 FinishTemplatesContext(context);
4198 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4200 extern void FreeTypeName(struct TypeName * typeName);
4202 static void ProcessDeclarator(struct Declarator * decl);
4204 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4210 struct MethodImport * prev;
4211 struct MethodImport * next;
4213 unsigned int isVirtual;
4214 } __attribute__ ((gcc_struct));
4216 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4218 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4220 struct Symbol * symbol = method->symbol;
4222 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4224 unsigned int imported = 0x0;
4225 unsigned int dllImport = 0x0;
4227 if(!method->dataType)
4228 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4229 if(!symbol || symbol->_import || method->type == 1)
4231 if(!symbol || method->type == 1)
4233 struct Symbol * classSym;
4235 if(!method->_class->symbol)
4236 method->_class->symbol = FindClass(method->_class->fullName);
4237 classSym = method->_class->symbol;
4238 if(!classSym->_import)
4240 struct ModuleImport * module;
4242 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4243 module = FindModule(method->_class->module);
4245 module = mainModule;
4246 classSym->_import = __extension__ ({
4247 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4249 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4251 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4255 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4257 if(!symbol->_import)
4259 symbol->_import = (struct ClassImport *)__extension__ ({
4260 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4262 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4268 symbol->type = method->dataType;
4270 symbol->type->refCount++;
4273 if(!method->dataType->dllExport)
4276 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4280 if(method->type != 1 && method->dataType)
4281 DeclareType(method->dataType, 0x1, 0x1);
4282 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4284 struct Declaration * decl;
4285 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4286 struct Declarator * d;
4287 struct Declarator * funcDecl;
4288 struct External * external;
4290 specifiers = MkList();
4291 declarators = MkList();
4293 ListAdd(specifiers, MkSpecifier(EXTERN));
4294 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4295 ListAdd(specifiers, MkSpecifier(STATIC));
4296 if(method->type == 1)
4298 ListAdd(specifiers, MkSpecifier(INT));
4299 d = MkDeclaratorIdentifier(MkIdentifier(name));
4303 d = MkDeclaratorIdentifier(MkIdentifier(name));
4305 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4307 struct Context * context = SetupTemplatesContext(method->_class);
4309 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4310 FinishTemplatesContext(context);
4312 funcDecl = GetFuncDecl(d);
4315 struct Specifier * spec, * next;
4317 for(spec = (*specifiers).first; spec; spec = next)
4322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4323 FreeSpecifier(spec);
4327 if(method->dataType && !method->dataType->staticMethod)
4329 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4331 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4332 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")));
4333 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4334 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4336 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4338 struct TypeName * param = (*funcDecl->function.parameters).first;
4340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4341 FreeTypeName(param);
4343 if(!funcDecl->function.parameters)
4344 funcDecl->function.parameters = MkList();
4345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4349 ProcessDeclarator(d);
4350 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4351 decl = MkDeclaration(specifiers, declarators);
4352 ReplaceThisClassSpecifiers(specifiers, method->_class);
4353 if(symbol->pointerExternal)
4355 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4358 *functionSymbol = *symbol;
4359 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4360 if(functionSymbol->type)
4361 functionSymbol->type->refCount++;
4363 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4364 symbol->pointerExternal->symbol = functionSymbol;
4366 external = MkExternalDeclaration(decl);
4368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4369 external->symbol = symbol;
4370 symbol->pointerExternal = external;
4374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4376 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4380 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4382 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4384 unsigned int first = 0x1;
4386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4388 char className[1024];
4390 strcpy(className, _class->fullName);
4391 for(param = _class->templateParams.first; param; param = param->next)
4395 strcat(className, "<");
4397 strcat(className, ", ");
4398 if(lastParam + 1 != p)
4400 strcat(className, param->name);
4401 strcat(className, " = ");
4403 strcat(className, param->name);
4411 int len = strlen(className);
4413 if(className[len - 1] == '>')
4414 className[len++] = ' ';
4415 className[len++] = '>';
4416 className[len++] = '\0';
4418 return __ecereNameSpace__ecere__sys__CopyString(className);
4421 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4424 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4426 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4428 unsigned int first = 0x1;
4430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4432 char className[1024];
4434 strcpy(className, _class->fullName);
4435 for(param = _class->templateParams.first; param; param = param->next)
4439 strcat(className, "<");
4441 strcat(className, ", ");
4442 if(lastParam + 1 != p)
4444 strcat(className, param->name);
4445 strcat(className, " = ");
4447 strcat(className, param->name);
4455 int len = strlen(className);
4457 if(className[len - 1] == '>')
4458 className[len++] = ' ';
4459 className[len++] = '>';
4460 className[len++] = '\0';
4462 return MkClassType(className);
4466 return MkClassType(_class->fullName);
4470 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4472 if(specs != (((void *)0)) && _class)
4474 struct Specifier * spec;
4476 for(spec = specs->first; spec; spec = spec->next)
4478 if(spec->type == 0 && spec->specifier == THISCLASS)
4481 spec->name = ReplaceThisClass(_class);
4482 spec->symbol = FindClass(spec->name);
4488 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4490 struct __ecereNameSpace__ecere__com__GlobalFunction
4492 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4493 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4496 struct __ecereNameSpace__ecere__com__Instance * module;
4497 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4498 char * dataTypeString;
4499 struct Type * dataType;
4501 } __attribute__ ((gcc_struct));
4503 extern struct Context * globalContext;
4505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4507 struct FunctionImport
4509 struct FunctionImport * prev;
4510 struct FunctionImport * next;
4512 } __attribute__ ((gcc_struct));
4514 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4516 struct Symbol * symbol = function->symbol;
4518 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4520 unsigned int imported = 0x0;
4521 unsigned int dllImport = 0x0;
4523 if(!function->dataType)
4525 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4526 if(!function->dataType->thisClass)
4527 function->dataType->staticMethod = 0x1;
4533 struct ModuleImport * module = FindModule(function->module);
4535 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4538 if(!function->dataType->dllExport)
4540 symbol->_import = (struct ClassImport *)__extension__ ({
4541 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4543 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4545 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4549 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4550 if(!symbol->type->thisClass)
4551 symbol->type->staticMethod = 0x1;
4554 imported = symbol->_import ? 0x1 : 0x0;
4555 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4558 DeclareType(function->dataType, 0x1, 0x1);
4561 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4563 struct Declaration * decl;
4564 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4565 struct Declarator * d;
4566 struct Declarator * funcDecl;
4567 struct External * external;
4569 specifiers = MkList();
4570 declarators = MkList();
4571 ListAdd(specifiers, MkSpecifier(EXTERN));
4572 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4574 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4575 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4576 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4578 struct Specifier * spec;
4580 for(spec = (*specifiers).first; spec; spec = spec->next)
4581 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4583 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4584 FreeSpecifier(spec);
4588 funcDecl = GetFuncDecl(d);
4589 if(funcDecl && !funcDecl->function.parameters)
4591 funcDecl->function.parameters = MkList();
4592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4594 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4596 struct Context * oldCtx = curContext;
4598 curContext = globalContext;
4599 decl = MkDeclaration(specifiers, declarators);
4600 curContext = oldCtx;
4602 if(symbol->pointerExternal)
4604 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4607 *functionSymbol = *symbol;
4608 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4609 if(functionSymbol->type)
4610 functionSymbol->type->refCount++;
4612 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4613 symbol->pointerExternal->symbol = functionSymbol;
4615 external = MkExternalDeclaration(decl);
4617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4618 external->symbol = symbol;
4619 symbol->pointerExternal = external;
4623 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4626 symbol->id = curExternal->symbol->idCode;
4629 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4637 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4638 struct __ecereNameSpace__ecere__sys__BTNode * left;
4639 struct __ecereNameSpace__ecere__sys__BTNode * right;
4641 struct __ecereNameSpace__ecere__com__Instance * module;
4642 char * dataTypeString;
4643 struct Type * dataType;
4646 } __attribute__ ((gcc_struct));
4648 void DeclareGlobalData(struct GlobalData * data)
4650 struct Symbol * symbol = data->symbol;
4652 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4657 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4660 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4661 DeclareType(data->dataType, 0x1, 0x1);
4664 if(!symbol->pointerExternal)
4666 struct Declaration * decl;
4667 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4668 struct Declarator * d;
4669 struct External * external;
4671 specifiers = MkList();
4672 declarators = MkList();
4673 ListAdd(specifiers, MkSpecifier(EXTERN));
4674 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4675 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4676 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4677 decl = MkDeclaration(specifiers, declarators);
4678 external = MkExternalDeclaration(decl);
4680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4681 external->symbol = symbol;
4682 symbol->pointerExternal = external;
4686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4689 symbol->id = curExternal->symbol->idCode;
4696 struct Conversion * prev, * next;
4697 struct __ecereNameSpace__ecere__com__Property * convert;
4699 struct Type * resultType;
4700 } __attribute__ ((gcc_struct));
4702 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4704 extern void Compiler_Warning(char * format, ...);
4706 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4708 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)
4712 if(source->kind == 20 && dest->kind != 20)
4714 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4719 if(dest->kind == 20 && source->kind != 20)
4721 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4726 if(dest->classObjectType == 2)
4728 if(source->classObjectType != 3)
4732 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4740 if(source->classObjectType == 3)
4742 if(dest->classObjectType == 3 && source->classObjectType != 2)
4745 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4747 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4750 if(dest->kind == 14 && source->kind != 0)
4752 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))
4754 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))
4756 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4758 if(source->_class->registered && source->_class->registered->type == 3)
4760 if(conversions != (((void *)0)))
4762 if(source->_class->registered == dest->_class->registered)
4767 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4769 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4771 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4773 if(sourceBase == destBase)
4777 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))
4781 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))
4783 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4790 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4794 if(source->kind == 8)
4796 struct __ecereNameSpace__ecere__com__Class * _class;
4798 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4800 struct __ecereNameSpace__ecere__com__Property * convert;
4802 for(convert = _class->conversions.first; convert; convert = convert->next)
4804 if(convert->memberAccess == 1 || _class->module == privateModule)
4806 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4808 if(!convert->dataType)
4809 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4810 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4812 if(!conversions && !convert->Get)
4814 else if(conversions != (((void *)0)))
4816 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))
4820 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4822 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4833 struct __ecereNameSpace__ecere__com__Class * _class;
4835 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4837 struct __ecereNameSpace__ecere__com__Property * convert;
4839 for(convert = _class->conversions.first; convert; convert = convert->next)
4841 if(convert->memberAccess == 1 || _class->module == privateModule)
4843 if(!convert->dataType)
4844 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4845 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4847 if(!conversions && !convert->Set)
4849 else if(conversions != (((void *)0)))
4851 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))
4855 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4865 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4867 if(!dest->_class->registered->dataType)
4868 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4869 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4871 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4878 if(source->kind == 8)
4880 struct __ecereNameSpace__ecere__com__Class * _class;
4882 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4884 struct __ecereNameSpace__ecere__com__Property * convert;
4886 for(convert = _class->conversions.first; convert; convert = convert->next)
4888 if(convert->memberAccess == 1 || _class->module == privateModule)
4890 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4892 if(!convert->dataType)
4893 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4894 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4896 if(!conversions && !convert->Get)
4898 else if(conversions != (((void *)0)))
4900 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))
4904 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4914 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4916 if(!source->_class->registered->dataType)
4917 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4918 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4925 if(source->kind == 8 || source->kind == 19)
4927 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4929 else if(dest->kind == 7 && source->kind == 6)
4931 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4933 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4935 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4937 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4939 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4941 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))
4943 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))
4945 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)))
4947 struct Type * paramSource, * paramDest;
4949 if(dest->kind == 16)
4950 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4951 if(source->kind == 16)
4952 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4953 if(dest->kind == 13 && dest->type->kind == 11)
4955 if(source->kind == 13 && source->type->kind == 11)
4956 source = source->type;
4957 if(dest->kind == 16)
4958 dest = dest->method->dataType;
4959 if(source->kind == 16)
4960 source = source->method->dataType;
4961 paramSource = source->params.first;
4962 if(paramSource && paramSource->kind == 0)
4963 paramSource = (((void *)0));
4964 paramDest = dest->params.first;
4965 if(paramDest && paramDest->kind == 0)
4966 paramDest = (((void *)0));
4967 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4969 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))))
4971 if(paramDest && paramDest->kind == 8)
4972 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4974 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4977 paramDest = paramDest->next;
4979 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4981 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4985 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4987 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4993 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4996 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5002 paramSource = paramSource->next;
5008 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5010 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5016 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5024 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5026 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5029 for(; paramDest; paramDest = paramDest->next)
5033 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5037 struct Type * paramDestType = paramDest;
5038 struct Type * paramSourceType = paramSource;
5039 struct Type * type = paramDestType;
5041 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5044 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5045 struct __ecereNameSpace__ecere__com__Class * sClass;
5047 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5050 if(sClass->templateClass)
5051 sClass = sClass->templateClass;
5052 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5054 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5056 for(sClass = sClass->base; sClass; sClass = sClass->base)
5058 if(sClass->templateClass)
5059 sClass = sClass->templateClass;
5060 id += sClass->templateParams.count;
5071 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5073 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5076 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)))
5081 PrintType(paramDest, type, 0x0, 0x1);
5082 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5083 if(paramDestType != paramDest)
5084 FreeType(paramDestType);
5087 if(paramDestType != paramDest)
5088 FreeType(paramDestType);
5090 paramSource = paramSource->next;
5094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5099 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5103 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5105 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5112 static void FreeConvert(struct Conversion * convert)
5114 if(convert->resultType)
5115 FreeType(convert->resultType);
5118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5120 struct __ecereNameSpace__ecere__com__BTNamedLink
5123 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5124 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5125 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5128 } __attribute__ ((gcc_struct));
5130 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5132 struct __ecereNameSpace__ecere__com__EnumClassData
5134 struct __ecereNameSpace__ecere__sys__OldList values;
5136 } __attribute__ ((gcc_struct));
5138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5140 struct __ecereNameSpace__ecere__sys__NamedLink
5142 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5143 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5146 } __attribute__ ((gcc_struct));
5148 extern void FreeExpContents(struct Expression * exp);
5150 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5152 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5154 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5156 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5158 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5160 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5162 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5164 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)))
5166 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5168 if(_class->type == 4)
5170 struct __ecereNameSpace__ecere__sys__OldList converts =
5174 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5178 _class->symbol = FindClass(_class->fullName);
5179 type->_class = _class->symbol;
5180 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5182 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5183 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5187 struct __ecereNameSpace__ecere__com__Class * baseClass;
5189 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5191 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5193 for(value = e->values.first; value; value = value->next)
5195 if(!strcmp(value->name, string))
5200 FreeExpContents(sourceExp);
5201 FreeType(sourceExp->expType);
5202 sourceExp->isConstant = 0x1;
5203 sourceExp->expType = MkClassType(baseClass->fullName);
5207 sourceExp->type = 2;
5208 if(!strcmp(baseClass->dataTypeString, "int"))
5209 sprintf(constant, "%d", (int)value->data);
5211 sprintf(constant, "0x%X", (int)value->data);
5212 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5214 while(converts.first)
5216 struct Conversion * convert = converts.first;
5218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5219 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5221 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5229 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5232 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)))
5233 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5238 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5240 struct __ecereNameSpace__ecere__com__SubModule
5242 struct __ecereNameSpace__ecere__com__SubModule * prev;
5243 struct __ecereNameSpace__ecere__com__SubModule * next;
5244 struct __ecereNameSpace__ecere__com__Instance * module;
5246 } __attribute__ ((gcc_struct));
5248 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5250 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5252 if(searchFor == searchIn)
5254 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5256 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5258 if(ModuleVisibility(subModule->module, searchFor))
5265 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5267 struct __ecereNameSpace__ecere__com__Application
5272 unsigned int isGUIApp;
5273 struct __ecereNameSpace__ecere__sys__OldList allModules;
5274 char * parsedCommand;
5275 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5276 } __attribute__ ((gcc_struct));
5278 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5280 struct __ecereNameSpace__ecere__com__Instance * module;
5282 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))
5284 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))
5286 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))
5288 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)
5290 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5296 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5298 void ReadString(char * output, char * string);
5300 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5302 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5304 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5306 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5308 struct Type * source = sourceExp->expType;
5309 struct Type * realDest = dest;
5310 struct Type * backupSourceExpType = (((void *)0));
5312 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5314 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5316 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5318 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5320 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5322 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5324 if(sourceBase == destBase)
5330 struct __ecereNameSpace__ecere__sys__OldList * specs;
5331 unsigned int flag = 0x0;
5332 long long value = (((int)0x7fffffff));
5336 if(sourceExp->type == 2)
5338 if(source->isSigned)
5339 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5341 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5343 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5345 if(source->isSigned)
5346 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5348 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5350 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5353 source = __extension__ ({
5354 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5356 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5361 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5363 if(_class && _class->type == 3)
5365 if(source->kind != 8)
5367 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5368 struct Type * tempDest, * tempSource;
5370 for(; _class->base->type != 1000; _class = _class->base)
5373 tempDest = tempType;
5376 _class->symbol = FindClass(_class->fullName);
5377 tempType->_class = _class->symbol;
5378 tempType->truth = dest->truth;
5379 if(tempType->_class)
5380 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5381 backupSourceExpType = sourceExp->expType;
5382 sourceExp->expType = dest;
5385 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5388 if(_class && _class->type == 2 && source->kind != 8)
5390 if(!dest->_class->registered->dataType)
5391 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5392 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5395 FreeType(sourceExp->expType);
5396 source = sourceExp->expType = MkClassType(dest->_class->string);
5400 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5402 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5403 struct Declarator * decl;
5406 ReadString(string, sourceExp->string);
5407 decl = SpecDeclFromString(string, specs, (((void *)0)));
5408 FreeExpContents(sourceExp);
5409 FreeType(sourceExp->expType);
5410 sourceExp->type = 24;
5411 sourceExp->_classExp.specifiers = specs;
5412 sourceExp->_classExp.decl = decl;
5413 sourceExp->expType = dest;
5417 if(backupSourceExpType)
5418 FreeType(backupSourceExpType);
5422 else if(source->kind == 8)
5424 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5426 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5430 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5431 struct Type * tempDest, * tempSource;
5433 if(!source->_class->registered->dataType)
5434 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5435 for(; _class->base->type != 1000; _class = _class->base)
5438 tempSource = tempType;
5440 tempType->_class = FindClass(_class->fullName);
5441 tempType->truth = source->truth;
5442 tempType->classObjectType = source->classObjectType;
5443 if(tempType->_class)
5444 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5445 if(conversions->last)
5447 ((struct Conversion *)conversions->last)->resultType = dest;
5450 FreeType(sourceExp->expType);
5451 sourceExp->expType = MkClassType(_class->fullName);
5452 sourceExp->expType->truth = source->truth;
5453 sourceExp->expType->classObjectType = source->classObjectType;
5454 if(!sourceExp->destType)
5456 FreeType(sourceExp->destType);
5457 sourceExp->destType = sourceExp->expType;
5458 if(sourceExp->expType)
5459 sourceExp->expType->refCount++;
5461 if(!_class->dataType)
5462 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5464 dest = MkClassType(source->_class->string);
5465 dest->truth = source->truth;
5466 dest->classObjectType = source->classObjectType;
5468 source = _class->dataType;
5470 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5476 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5485 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5487 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5489 if(_class->type == 0 || _class->type == 5)
5491 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5493 *newExp = *sourceExp;
5494 if(sourceExp->destType)
5495 sourceExp->destType->refCount++;
5496 if(sourceExp->expType)
5497 sourceExp->expType->refCount++;
5498 sourceExp->type = 11;
5499 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5500 sourceExp->cast.exp = newExp;
5501 FreeType(sourceExp->expType);
5502 sourceExp->expType = (((void *)0));
5503 ProcessExpressionType(sourceExp);
5506 FreeType(sourceExp->expType);
5507 sourceExp->expType = dest;
5512 if(backupSourceExpType)
5513 FreeType(backupSourceExpType);
5516 if(!_class->dataType)
5517 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5519 dest = _class->dataType;
5522 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))
5524 specs = MkListOne(MkSpecifier(DOUBLE));
5526 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))
5528 specs = MkListOne(MkSpecifier(FLOAT));
5530 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))
5534 ListAdd(specs, MkSpecifier(UNSIGNED));
5535 ListAdd(specs, MkSpecifier(INT64));
5537 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5541 ListAdd(specs, MkSpecifier(UNSIGNED));
5542 ListAdd(specs, MkSpecifier(INT));
5544 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5548 ListAdd(specs, MkSpecifier(UNSIGNED));
5549 ListAdd(specs, MkSpecifier(SHORT));
5551 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5555 ListAdd(specs, MkSpecifier(UNSIGNED));
5556 ListAdd(specs, MkSpecifier(CHAR));
5562 if(backupSourceExpType)
5564 if(sourceExp->expType)
5565 FreeType(sourceExp->expType);
5566 sourceExp->expType = backupSourceExpType;
5571 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))
5573 specs = MkListOne(MkSpecifier(DOUBLE));
5575 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))
5577 specs = MkListOne(MkSpecifier(FLOAT));
5579 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5582 ListAdd(specs, MkSpecifier(BOOL));
5584 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)))
5588 ListAdd(specs, MkSpecifier(UNSIGNED));
5589 ListAdd(specs, MkSpecifier(CHAR));
5591 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)))))
5595 ListAdd(specs, MkSpecifier(UNSIGNED));
5596 ListAdd(specs, MkSpecifier(SHORT));
5598 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5602 ListAdd(specs, MkSpecifier(UNSIGNED));
5603 ListAdd(specs, MkSpecifier(INT));
5605 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5609 ListAdd(specs, MkSpecifier(UNSIGNED));
5610 ListAdd(specs, MkSpecifier(INT64));
5612 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5614 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5620 if(backupSourceExpType)
5622 if(sourceExp->expType)
5623 FreeType(sourceExp->expType);
5624 sourceExp->expType = backupSourceExpType;
5630 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5632 *newExp = *sourceExp;
5633 newExp->prev = (((void *)0));
5634 newExp->next = (((void *)0));
5635 if(sourceExp->destType)
5636 sourceExp->destType->refCount++;
5637 if(sourceExp->expType)
5638 sourceExp->expType->refCount++;
5639 sourceExp->type = 11;
5640 if(realDest->kind == 8)
5642 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5643 FreeList(specs, FreeSpecifier);
5646 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5647 if(newExp->type == 4)
5649 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5652 sourceExp->cast.exp = newExp;
5653 FreeType(sourceExp->expType);
5654 sourceExp->expType = (((void *)0));
5655 ProcessExpressionType(sourceExp);
5658 FreeList(specs, FreeSpecifier);
5661 if(backupSourceExpType)
5662 FreeType(backupSourceExpType);
5667 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5668 sourceExp = (*sourceExp->list).last;
5669 if(sourceExp->type == 0)
5671 struct Identifier * id = sourceExp->identifier;
5675 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5677 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5678 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5682 for(; _class && _class->type == 4; _class = _class->base)
5684 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5685 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5687 for(value = e->values.first; value; value = value->next)
5689 if(!strcmp(value->name, id->string))
5694 FreeExpContents(sourceExp);
5695 FreeType(sourceExp->expType);
5696 sourceExp->isConstant = 0x1;
5697 sourceExp->expType = MkClassType(_class->fullName);
5701 sourceExp->type = 2;
5702 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5703 sprintf(constant, "%d", (int)value->data);
5705 sprintf(constant, "0x%X", (int)value->data);
5706 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5714 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5721 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5723 int value2 = op2->i;
5726 exp->string = PrintInt(op1->i + value2);
5729 exp->expType = op1->type;
5731 op1->type->refCount++;
5736 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5738 unsigned int value2 = op2->ui;
5741 exp->string = PrintUInt(op1->ui + value2);
5744 exp->expType = op1->type;
5746 op1->type->refCount++;
5751 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5753 long long value2 = op2->i64;
5756 exp->string = PrintInt64(op1->i64 + value2);
5759 exp->expType = op1->type;
5761 op1->type->refCount++;
5766 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5768 uint64 value2 = op2->ui64;
5771 exp->string = PrintUInt64(op1->ui64 + value2);
5774 exp->expType = op1->type;
5776 op1->type->refCount++;
5781 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5783 short value2 = op2->s;
5786 exp->string = PrintShort(op1->s + value2);
5789 exp->expType = op1->type;
5791 op1->type->refCount++;
5796 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5798 unsigned short value2 = op2->us;
5801 exp->string = PrintUShort(op1->us + value2);
5804 exp->expType = op1->type;
5806 op1->type->refCount++;
5811 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5813 char value2 = op2->c;
5816 exp->string = PrintChar(op1->c + value2);
5819 exp->expType = op1->type;
5821 op1->type->refCount++;
5826 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5828 unsigned char value2 = op2->uc;
5831 exp->string = PrintUChar(op1->uc + value2);
5834 exp->expType = op1->type;
5836 op1->type->refCount++;
5841 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5843 float value2 = op2->f;
5846 exp->string = PrintFloat(op1->f + value2);
5849 exp->expType = op1->type;
5851 op1->type->refCount++;
5856 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5858 double value2 = op2->d;
5861 exp->string = PrintDouble(op1->d + value2);
5864 exp->expType = op1->type;
5866 op1->type->refCount++;
5871 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5873 int value2 = op2->i;
5876 exp->string = PrintInt(op1->i - value2);
5879 exp->expType = op1->type;
5881 op1->type->refCount++;
5886 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5888 unsigned int value2 = op2->ui;
5891 exp->string = PrintUInt(op1->ui - value2);
5894 exp->expType = op1->type;
5896 op1->type->refCount++;
5901 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5903 long long value2 = op2->i64;
5906 exp->string = PrintInt64(op1->i64 - value2);
5909 exp->expType = op1->type;
5911 op1->type->refCount++;
5916 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5918 uint64 value2 = op2->ui64;
5921 exp->string = PrintUInt64(op1->ui64 - value2);
5924 exp->expType = op1->type;
5926 op1->type->refCount++;
5931 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5933 short value2 = op2->s;
5936 exp->string = PrintShort(op1->s - value2);
5939 exp->expType = op1->type;
5941 op1->type->refCount++;
5946 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5948 unsigned short value2 = op2->us;
5951 exp->string = PrintUShort(op1->us - value2);
5954 exp->expType = op1->type;
5956 op1->type->refCount++;
5961 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5963 char value2 = op2->c;
5966 exp->string = PrintChar(op1->c - value2);
5969 exp->expType = op1->type;
5971 op1->type->refCount++;
5976 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5978 unsigned char value2 = op2->uc;
5981 exp->string = PrintUChar(op1->uc - value2);
5984 exp->expType = op1->type;
5986 op1->type->refCount++;
5991 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5993 float value2 = op2->f;
5996 exp->string = PrintFloat(op1->f - value2);
5999 exp->expType = op1->type;
6001 op1->type->refCount++;
6006 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6008 double value2 = op2->d;
6011 exp->string = PrintDouble(op1->d - value2);
6014 exp->expType = op1->type;
6016 op1->type->refCount++;
6021 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6023 int value2 = op2->i;
6026 exp->string = PrintInt(op1->i * value2);
6029 exp->expType = op1->type;
6031 op1->type->refCount++;
6036 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6038 unsigned int value2 = op2->ui;
6041 exp->string = PrintUInt(op1->ui * value2);
6044 exp->expType = op1->type;
6046 op1->type->refCount++;
6051 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6053 long long value2 = op2->i64;
6056 exp->string = PrintInt64(op1->i64 * value2);
6059 exp->expType = op1->type;
6061 op1->type->refCount++;
6066 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6068 uint64 value2 = op2->ui64;
6071 exp->string = PrintUInt64(op1->ui64 * value2);
6074 exp->expType = op1->type;
6076 op1->type->refCount++;
6081 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6083 short value2 = op2->s;
6086 exp->string = PrintShort(op1->s * value2);
6089 exp->expType = op1->type;
6091 op1->type->refCount++;
6096 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6098 unsigned short value2 = op2->us;
6101 exp->string = PrintUShort(op1->us * value2);
6104 exp->expType = op1->type;
6106 op1->type->refCount++;
6111 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6113 char value2 = op2->c;
6116 exp->string = PrintChar(op1->c * value2);
6119 exp->expType = op1->type;
6121 op1->type->refCount++;
6126 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6128 unsigned char value2 = op2->uc;
6131 exp->string = PrintUChar(op1->uc * value2);
6134 exp->expType = op1->type;
6136 op1->type->refCount++;
6141 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6143 float value2 = op2->f;
6146 exp->string = PrintFloat(op1->f * value2);
6149 exp->expType = op1->type;
6151 op1->type->refCount++;
6156 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6158 double value2 = op2->d;
6161 exp->string = PrintDouble(op1->d * value2);
6164 exp->expType = op1->type;
6166 op1->type->refCount++;
6171 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6173 int value2 = op2->i;
6176 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6179 exp->expType = op1->type;
6181 op1->type->refCount++;
6186 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6188 unsigned int value2 = op2->ui;
6191 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6194 exp->expType = op1->type;
6196 op1->type->refCount++;
6201 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6203 long long value2 = op2->i64;
6206 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6209 exp->expType = op1->type;
6211 op1->type->refCount++;
6216 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6218 uint64 value2 = op2->ui64;
6221 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6224 exp->expType = op1->type;
6226 op1->type->refCount++;
6231 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6233 short value2 = op2->s;
6236 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6239 exp->expType = op1->type;
6241 op1->type->refCount++;
6246 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6248 unsigned short value2 = op2->us;
6251 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6254 exp->expType = op1->type;
6256 op1->type->refCount++;
6261 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6263 char value2 = op2->c;
6266 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6269 exp->expType = op1->type;
6271 op1->type->refCount++;
6276 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6278 unsigned char value2 = op2->uc;
6281 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6293 float value2 = op2->f;
6296 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6299 exp->expType = op1->type;
6301 op1->type->refCount++;
6306 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6308 double value2 = op2->d;
6311 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6314 exp->expType = op1->type;
6316 op1->type->refCount++;
6321 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6323 int value2 = op2->i;
6326 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6329 exp->expType = op1->type;
6331 op1->type->refCount++;
6336 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6338 unsigned int value2 = op2->ui;
6341 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6344 exp->expType = op1->type;
6346 op1->type->refCount++;
6351 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6353 long long value2 = op2->i64;
6356 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6359 exp->expType = op1->type;
6361 op1->type->refCount++;
6366 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6368 uint64 value2 = op2->ui64;
6371 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6374 exp->expType = op1->type;
6376 op1->type->refCount++;
6381 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6383 short value2 = op2->s;
6386 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6389 exp->expType = op1->type;
6391 op1->type->refCount++;
6396 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6398 unsigned short value2 = op2->us;
6401 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6404 exp->expType = op1->type;
6406 op1->type->refCount++;
6411 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6413 char value2 = op2->c;
6416 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6419 exp->expType = op1->type;
6421 op1->type->refCount++;
6426 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6428 unsigned char value2 = op2->uc;
6431 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6434 exp->expType = op1->type;
6436 op1->type->refCount++;
6441 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6444 exp->string = PrintInt((-op1->i));
6447 exp->expType = op1->type;
6449 op1->type->refCount++;
6454 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6457 exp->string = PrintUInt((unsigned int)(-op1->ui));
6460 exp->expType = op1->type;
6462 op1->type->refCount++;
6467 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6470 exp->string = PrintInt64((-op1->i64));
6473 exp->expType = op1->type;
6475 op1->type->refCount++;
6480 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6483 exp->string = PrintUInt64((uint64)(-op1->ui64));
6486 exp->expType = op1->type;
6488 op1->type->refCount++;
6493 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6496 exp->string = PrintShort((-op1->s));
6499 exp->expType = op1->type;
6501 op1->type->refCount++;
6506 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6509 exp->string = PrintUShort((unsigned short)(-op1->us));
6512 exp->expType = op1->type;
6514 op1->type->refCount++;
6519 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6522 exp->string = PrintChar((-op1->c));
6525 exp->expType = op1->type;
6527 op1->type->refCount++;
6532 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6535 exp->string = PrintUChar((unsigned char)(-op1->uc));
6538 exp->expType = op1->type;
6540 op1->type->refCount++;
6545 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6548 exp->string = PrintFloat((float)(-op1->f));
6551 exp->expType = op1->type;
6553 op1->type->refCount++;
6558 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6561 exp->string = PrintDouble((double)(-op1->d));
6564 exp->expType = op1->type;
6566 op1->type->refCount++;
6571 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6574 exp->string = PrintInt((++op1->i));
6577 exp->expType = op1->type;
6579 op1->type->refCount++;
6584 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6587 exp->string = PrintUInt((++op1->ui));
6590 exp->expType = op1->type;
6592 op1->type->refCount++;
6597 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6600 exp->string = PrintInt64((++op1->i64));
6603 exp->expType = op1->type;
6605 op1->type->refCount++;
6610 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6613 exp->string = PrintUInt64((++op1->ui64));
6616 exp->expType = op1->type;
6618 op1->type->refCount++;
6623 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6626 exp->string = PrintShort((++op1->s));
6629 exp->expType = op1->type;
6631 op1->type->refCount++;
6636 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6639 exp->string = PrintUShort((++op1->us));
6642 exp->expType = op1->type;
6644 op1->type->refCount++;
6649 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6652 exp->string = PrintChar((++op1->c));
6655 exp->expType = op1->type;
6657 op1->type->refCount++;
6662 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6665 exp->string = PrintUChar((++op1->uc));
6668 exp->expType = op1->type;
6670 op1->type->refCount++;
6675 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6678 exp->string = PrintFloat((float)(++op1->f));
6681 exp->expType = op1->type;
6683 op1->type->refCount++;
6688 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6691 exp->string = PrintDouble((double)(++op1->d));
6694 exp->expType = op1->type;
6696 op1->type->refCount++;
6701 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6704 exp->string = PrintInt((--op1->i));
6707 exp->expType = op1->type;
6709 op1->type->refCount++;
6714 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6717 exp->string = PrintUInt((--op1->ui));
6720 exp->expType = op1->type;
6722 op1->type->refCount++;
6727 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6730 exp->string = PrintInt64((--op1->i64));
6733 exp->expType = op1->type;
6735 op1->type->refCount++;
6740 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6743 exp->string = PrintUInt64((--op1->ui64));
6746 exp->expType = op1->type;
6748 op1->type->refCount++;
6753 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6756 exp->string = PrintShort((--op1->s));
6759 exp->expType = op1->type;
6761 op1->type->refCount++;
6766 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6769 exp->string = PrintUShort((--op1->us));
6772 exp->expType = op1->type;
6774 op1->type->refCount++;
6779 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6782 exp->string = PrintChar((--op1->c));
6785 exp->expType = op1->type;
6787 op1->type->refCount++;
6792 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6795 exp->string = PrintUChar((--op1->uc));
6798 exp->expType = op1->type;
6800 op1->type->refCount++;
6805 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6808 exp->string = PrintFloat((float)(--op1->f));
6811 exp->expType = op1->type;
6813 op1->type->refCount++;
6818 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6821 exp->string = PrintDouble((double)(--op1->d));
6824 exp->expType = op1->type;
6826 op1->type->refCount++;
6831 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6833 int value2 = op2->i;
6836 exp->string = PrintInt(op1->i = value2);
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6848 unsigned int value2 = op2->ui;
6851 exp->string = PrintUInt(op1->ui = value2);
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6863 long long value2 = op2->i64;
6866 exp->string = PrintInt64(op1->i64 = value2);
6869 exp->expType = op1->type;
6871 op1->type->refCount++;
6876 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6878 uint64 value2 = op2->ui64;
6881 exp->string = PrintUInt64(op1->ui64 = value2);
6884 exp->expType = op1->type;
6886 op1->type->refCount++;
6891 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6893 short value2 = op2->s;
6896 exp->string = PrintShort(op1->s = value2);
6899 exp->expType = op1->type;
6901 op1->type->refCount++;
6906 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6908 unsigned short value2 = op2->us;
6911 exp->string = PrintUShort(op1->us = value2);
6914 exp->expType = op1->type;
6916 op1->type->refCount++;
6921 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6923 char value2 = op2->c;
6926 exp->string = PrintChar(op1->c = value2);
6929 exp->expType = op1->type;
6931 op1->type->refCount++;
6936 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6938 unsigned char value2 = op2->uc;
6941 exp->string = PrintUChar(op1->uc = value2);
6944 exp->expType = op1->type;
6946 op1->type->refCount++;
6951 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6953 float value2 = op2->f;
6956 exp->string = PrintFloat(op1->f = value2);
6959 exp->expType = op1->type;
6961 op1->type->refCount++;
6966 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6968 double value2 = op2->d;
6971 exp->string = PrintDouble(op1->d = value2);
6974 exp->expType = op1->type;
6976 op1->type->refCount++;
6981 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6983 int value2 = op2->i;
6986 exp->string = PrintInt(op1->i += value2);
6989 exp->expType = op1->type;
6991 op1->type->refCount++;
6996 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6998 unsigned int value2 = op2->ui;
7001 exp->string = PrintUInt(op1->ui += value2);
7004 exp->expType = op1->type;
7006 op1->type->refCount++;
7011 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7013 long long value2 = op2->i64;
7016 exp->string = PrintInt64(op1->i64 += value2);
7019 exp->expType = op1->type;
7021 op1->type->refCount++;
7026 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7028 uint64 value2 = op2->ui64;
7031 exp->string = PrintUInt64(op1->ui64 += value2);
7034 exp->expType = op1->type;
7036 op1->type->refCount++;
7041 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7043 short value2 = op2->s;
7046 exp->string = PrintShort(op1->s += value2);
7049 exp->expType = op1->type;
7051 op1->type->refCount++;
7056 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7058 unsigned short value2 = op2->us;
7061 exp->string = PrintUShort(op1->us += value2);
7064 exp->expType = op1->type;
7066 op1->type->refCount++;
7071 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7073 char value2 = op2->c;
7076 exp->string = PrintChar(op1->c += value2);
7079 exp->expType = op1->type;
7081 op1->type->refCount++;
7086 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7088 unsigned char value2 = op2->uc;
7091 exp->string = PrintUChar(op1->uc += value2);
7094 exp->expType = op1->type;
7096 op1->type->refCount++;
7101 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7103 float value2 = op2->f;
7106 exp->string = PrintFloat(op1->f += value2);
7109 exp->expType = op1->type;
7111 op1->type->refCount++;
7116 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7118 double value2 = op2->d;
7121 exp->string = PrintDouble(op1->d += value2);
7124 exp->expType = op1->type;
7126 op1->type->refCount++;
7131 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7133 int value2 = op2->i;
7136 exp->string = PrintInt(op1->i -= value2);
7139 exp->expType = op1->type;
7141 op1->type->refCount++;
7146 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7148 unsigned int value2 = op2->ui;
7151 exp->string = PrintUInt(op1->ui -= value2);
7154 exp->expType = op1->type;
7156 op1->type->refCount++;
7161 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7163 long long value2 = op2->i64;
7166 exp->string = PrintInt64(op1->i64 -= value2);
7169 exp->expType = op1->type;
7171 op1->type->refCount++;
7176 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7178 uint64 value2 = op2->ui64;
7181 exp->string = PrintUInt64(op1->ui64 -= value2);
7184 exp->expType = op1->type;
7186 op1->type->refCount++;
7191 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7193 short value2 = op2->s;
7196 exp->string = PrintShort(op1->s -= value2);
7199 exp->expType = op1->type;
7201 op1->type->refCount++;
7206 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7208 unsigned short value2 = op2->us;
7211 exp->string = PrintUShort(op1->us -= value2);
7214 exp->expType = op1->type;
7216 op1->type->refCount++;
7221 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7223 char value2 = op2->c;
7226 exp->string = PrintChar(op1->c -= value2);
7229 exp->expType = op1->type;
7231 op1->type->refCount++;
7236 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7238 unsigned char value2 = op2->uc;
7241 exp->string = PrintUChar(op1->uc -= value2);
7244 exp->expType = op1->type;
7246 op1->type->refCount++;
7251 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7253 float value2 = op2->f;
7256 exp->string = PrintFloat(op1->f -= value2);
7259 exp->expType = op1->type;
7261 op1->type->refCount++;
7266 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7268 double value2 = op2->d;
7271 exp->string = PrintDouble(op1->d -= value2);
7274 exp->expType = op1->type;
7276 op1->type->refCount++;
7281 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7283 int value2 = op2->i;
7286 exp->string = PrintInt(op1->i *= value2);
7289 exp->expType = op1->type;
7291 op1->type->refCount++;
7296 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7298 unsigned int value2 = op2->ui;
7301 exp->string = PrintUInt(op1->ui *= value2);
7304 exp->expType = op1->type;
7306 op1->type->refCount++;
7311 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7313 long long value2 = op2->i64;
7316 exp->string = PrintInt64(op1->i64 *= value2);
7319 exp->expType = op1->type;
7321 op1->type->refCount++;
7326 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7328 uint64 value2 = op2->ui64;
7331 exp->string = PrintUInt64(op1->ui64 *= value2);
7334 exp->expType = op1->type;
7336 op1->type->refCount++;
7341 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7343 short value2 = op2->s;
7346 exp->string = PrintShort(op1->s *= value2);
7349 exp->expType = op1->type;
7351 op1->type->refCount++;
7356 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7358 unsigned short value2 = op2->us;
7361 exp->string = PrintUShort(op1->us *= value2);
7364 exp->expType = op1->type;
7366 op1->type->refCount++;
7371 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7373 char value2 = op2->c;
7376 exp->string = PrintChar(op1->c *= value2);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7388 unsigned char value2 = op2->uc;
7391 exp->string = PrintUChar(op1->uc *= value2);
7394 exp->expType = op1->type;
7396 op1->type->refCount++;
7401 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7403 float value2 = op2->f;
7406 exp->string = PrintFloat(op1->f *= value2);
7409 exp->expType = op1->type;
7411 op1->type->refCount++;
7416 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7418 double value2 = op2->d;
7421 exp->string = PrintDouble(op1->d *= value2);
7424 exp->expType = op1->type;
7426 op1->type->refCount++;
7431 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7433 int value2 = op2->i;
7436 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7439 exp->expType = op1->type;
7441 op1->type->refCount++;
7446 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7448 unsigned int value2 = op2->ui;
7451 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7454 exp->expType = op1->type;
7456 op1->type->refCount++;
7461 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7463 long long value2 = op2->i64;
7466 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7469 exp->expType = op1->type;
7471 op1->type->refCount++;
7476 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7478 uint64 value2 = op2->ui64;
7481 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7484 exp->expType = op1->type;
7486 op1->type->refCount++;
7491 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7493 short value2 = op2->s;
7496 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7499 exp->expType = op1->type;
7501 op1->type->refCount++;
7506 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7508 unsigned short value2 = op2->us;
7511 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7514 exp->expType = op1->type;
7516 op1->type->refCount++;
7521 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7523 char value2 = op2->c;
7526 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7529 exp->expType = op1->type;
7531 op1->type->refCount++;
7536 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7538 unsigned char value2 = op2->uc;
7541 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7544 exp->expType = op1->type;
7546 op1->type->refCount++;
7551 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7553 float value2 = op2->f;
7556 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7559 exp->expType = op1->type;
7561 op1->type->refCount++;
7566 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7568 double value2 = op2->d;
7571 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7574 exp->expType = op1->type;
7576 op1->type->refCount++;
7581 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7583 int value2 = op2->i;
7586 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7589 exp->expType = op1->type;
7591 op1->type->refCount++;
7596 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7598 unsigned int value2 = op2->ui;
7601 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7604 exp->expType = op1->type;
7606 op1->type->refCount++;
7611 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7613 long long value2 = op2->i64;
7616 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7619 exp->expType = op1->type;
7621 op1->type->refCount++;
7626 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7628 uint64 value2 = op2->ui64;
7631 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7634 exp->expType = op1->type;
7636 op1->type->refCount++;
7641 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7643 short value2 = op2->s;
7646 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7649 exp->expType = op1->type;
7651 op1->type->refCount++;
7656 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7658 unsigned short value2 = op2->us;
7661 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7664 exp->expType = op1->type;
7666 op1->type->refCount++;
7671 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7673 char value2 = op2->c;
7676 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7679 exp->expType = op1->type;
7681 op1->type->refCount++;
7686 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7688 unsigned char value2 = op2->uc;
7691 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7694 exp->expType = op1->type;
7696 op1->type->refCount++;
7701 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7703 int value2 = op2->i;
7706 exp->string = PrintInt(op1->i & value2);
7709 exp->expType = op1->type;
7711 op1->type->refCount++;
7716 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7718 unsigned int value2 = op2->ui;
7721 exp->string = PrintUInt(op1->ui & value2);
7724 exp->expType = op1->type;
7726 op1->type->refCount++;
7731 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7733 long long value2 = op2->i64;
7736 exp->string = PrintInt64(op1->i64 & value2);
7739 exp->expType = op1->type;
7741 op1->type->refCount++;
7746 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7748 uint64 value2 = op2->ui64;
7751 exp->string = PrintUInt64(op1->ui64 & value2);
7754 exp->expType = op1->type;
7756 op1->type->refCount++;
7761 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7763 short value2 = op2->s;
7766 exp->string = PrintShort(op1->s & value2);
7769 exp->expType = op1->type;
7771 op1->type->refCount++;
7776 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7778 unsigned short value2 = op2->us;
7781 exp->string = PrintUShort(op1->us & value2);
7784 exp->expType = op1->type;
7786 op1->type->refCount++;
7791 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7793 char value2 = op2->c;
7796 exp->string = PrintChar(op1->c & value2);
7799 exp->expType = op1->type;
7801 op1->type->refCount++;
7806 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7808 unsigned char value2 = op2->uc;
7811 exp->string = PrintUChar(op1->uc & value2);
7814 exp->expType = op1->type;
7816 op1->type->refCount++;
7821 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7823 int value2 = op2->i;
7826 exp->string = PrintInt(op1->i | value2);
7829 exp->expType = op1->type;
7831 op1->type->refCount++;
7836 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7838 unsigned int value2 = op2->ui;
7841 exp->string = PrintUInt(op1->ui | value2);
7844 exp->expType = op1->type;
7846 op1->type->refCount++;
7851 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7853 long long value2 = op2->i64;
7856 exp->string = PrintInt64(op1->i64 | value2);
7859 exp->expType = op1->type;
7861 op1->type->refCount++;
7866 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7868 uint64 value2 = op2->ui64;
7871 exp->string = PrintUInt64(op1->ui64 | value2);
7874 exp->expType = op1->type;
7876 op1->type->refCount++;
7881 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7883 short value2 = op2->s;
7886 exp->string = PrintShort(op1->s | value2);
7889 exp->expType = op1->type;
7891 op1->type->refCount++;
7896 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7898 unsigned short value2 = op2->us;
7901 exp->string = PrintUShort(op1->us | value2);
7904 exp->expType = op1->type;
7906 op1->type->refCount++;
7911 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7913 char value2 = op2->c;
7916 exp->string = PrintChar(op1->c | value2);
7919 exp->expType = op1->type;
7921 op1->type->refCount++;
7926 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7928 unsigned char value2 = op2->uc;
7931 exp->string = PrintUChar(op1->uc | value2);
7934 exp->expType = op1->type;
7936 op1->type->refCount++;
7941 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7943 int value2 = op2->i;
7946 exp->string = PrintInt(op1->i ^ value2);
7949 exp->expType = op1->type;
7951 op1->type->refCount++;
7956 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7958 unsigned int value2 = op2->ui;
7961 exp->string = PrintUInt(op1->ui ^ value2);
7964 exp->expType = op1->type;
7966 op1->type->refCount++;
7971 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7973 long long value2 = op2->i64;
7976 exp->string = PrintInt64(op1->i64 ^ value2);
7979 exp->expType = op1->type;
7981 op1->type->refCount++;
7986 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7988 uint64 value2 = op2->ui64;
7991 exp->string = PrintUInt64(op1->ui64 ^ value2);
7994 exp->expType = op1->type;
7996 op1->type->refCount++;
8001 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8003 short value2 = op2->s;
8006 exp->string = PrintShort(op1->s ^ value2);
8009 exp->expType = op1->type;
8011 op1->type->refCount++;
8016 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8018 unsigned short value2 = op2->us;
8021 exp->string = PrintUShort(op1->us ^ value2);
8024 exp->expType = op1->type;
8026 op1->type->refCount++;
8031 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8033 char value2 = op2->c;
8036 exp->string = PrintChar(op1->c ^ value2);
8039 exp->expType = op1->type;
8041 op1->type->refCount++;
8046 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8048 unsigned char value2 = op2->uc;
8051 exp->string = PrintUChar(op1->uc ^ value2);
8054 exp->expType = op1->type;
8056 op1->type->refCount++;
8061 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8063 int value2 = op2->i;
8066 exp->string = PrintInt(op1->i << value2);
8069 exp->expType = op1->type;
8071 op1->type->refCount++;
8076 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8078 unsigned int value2 = op2->ui;
8081 exp->string = PrintUInt(op1->ui << value2);
8084 exp->expType = op1->type;
8086 op1->type->refCount++;
8091 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8093 long long value2 = op2->i64;
8096 exp->string = PrintInt64(op1->i64 << value2);
8099 exp->expType = op1->type;
8101 op1->type->refCount++;
8106 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8108 uint64 value2 = op2->ui64;
8111 exp->string = PrintUInt64(op1->ui64 << value2);
8114 exp->expType = op1->type;
8116 op1->type->refCount++;
8121 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8123 short value2 = op2->s;
8126 exp->string = PrintShort(op1->s << value2);
8129 exp->expType = op1->type;
8131 op1->type->refCount++;
8136 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8138 unsigned short value2 = op2->us;
8141 exp->string = PrintUShort(op1->us << value2);
8144 exp->expType = op1->type;
8146 op1->type->refCount++;
8151 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8153 char value2 = op2->c;
8156 exp->string = PrintChar(op1->c << value2);
8159 exp->expType = op1->type;
8161 op1->type->refCount++;
8166 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8168 unsigned char value2 = op2->uc;
8171 exp->string = PrintUChar(op1->uc << value2);
8174 exp->expType = op1->type;
8176 op1->type->refCount++;
8181 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8183 int value2 = op2->i;
8186 exp->string = PrintInt(op1->i >> value2);
8189 exp->expType = op1->type;
8191 op1->type->refCount++;
8196 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8198 unsigned int value2 = op2->ui;
8201 exp->string = PrintUInt(op1->ui >> value2);
8204 exp->expType = op1->type;
8206 op1->type->refCount++;
8211 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8213 long long value2 = op2->i64;
8216 exp->string = PrintInt64(op1->i64 >> value2);
8219 exp->expType = op1->type;
8221 op1->type->refCount++;
8226 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8228 uint64 value2 = op2->ui64;
8231 exp->string = PrintUInt64(op1->ui64 >> value2);
8234 exp->expType = op1->type;
8236 op1->type->refCount++;
8241 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8243 short value2 = op2->s;
8246 exp->string = PrintShort(op1->s >> value2);
8249 exp->expType = op1->type;
8251 op1->type->refCount++;
8256 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8258 unsigned short value2 = op2->us;
8261 exp->string = PrintUShort(op1->us >> value2);
8264 exp->expType = op1->type;
8266 op1->type->refCount++;
8271 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8273 char value2 = op2->c;
8276 exp->string = PrintChar(op1->c >> value2);
8279 exp->expType = op1->type;
8281 op1->type->refCount++;
8286 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8288 unsigned char value2 = op2->uc;
8291 exp->string = PrintUChar(op1->uc >> value2);
8294 exp->expType = op1->type;
8296 op1->type->refCount++;
8301 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8304 exp->string = PrintInt((~op1->i));
8307 exp->expType = op1->type;
8309 op1->type->refCount++;
8314 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8317 exp->string = PrintUInt((unsigned int)(~op1->ui));
8320 exp->expType = op1->type;
8322 op1->type->refCount++;
8327 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8330 exp->string = PrintInt64((long long)(~op1->i64));
8333 exp->expType = op1->type;
8335 op1->type->refCount++;
8340 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8343 exp->string = PrintUInt64((uint64)(~op1->ui64));
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8356 exp->string = PrintShort((short)(~op1->s));
8359 exp->expType = op1->type;
8361 op1->type->refCount++;
8366 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8369 exp->string = PrintUShort((unsigned short)(~op1->us));
8372 exp->expType = op1->type;
8374 op1->type->refCount++;
8379 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8382 exp->string = PrintChar((char)(~op1->c));
8385 exp->expType = op1->type;
8387 op1->type->refCount++;
8392 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8395 exp->string = PrintUChar((unsigned char)(~op1->uc));
8398 exp->expType = op1->type;
8400 op1->type->refCount++;
8405 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8407 int value2 = op2->i;
8410 exp->string = PrintInt(op1->i &= value2);
8413 exp->expType = op1->type;
8415 op1->type->refCount++;
8420 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8422 unsigned int value2 = op2->ui;
8425 exp->string = PrintUInt(op1->ui &= value2);
8428 exp->expType = op1->type;
8430 op1->type->refCount++;
8435 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8437 long long value2 = op2->i64;
8440 exp->string = PrintInt64(op1->i64 &= value2);
8443 exp->expType = op1->type;
8445 op1->type->refCount++;
8450 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8452 uint64 value2 = op2->ui64;
8455 exp->string = PrintUInt64(op1->ui64 &= value2);
8458 exp->expType = op1->type;
8460 op1->type->refCount++;
8465 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8467 short value2 = op2->s;
8470 exp->string = PrintShort(op1->s &= value2);
8473 exp->expType = op1->type;
8475 op1->type->refCount++;
8480 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8482 unsigned short value2 = op2->us;
8485 exp->string = PrintUShort(op1->us &= value2);
8488 exp->expType = op1->type;
8490 op1->type->refCount++;
8495 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8497 char value2 = op2->c;
8500 exp->string = PrintChar(op1->c &= value2);
8503 exp->expType = op1->type;
8505 op1->type->refCount++;
8510 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8512 unsigned char value2 = op2->uc;
8515 exp->string = PrintUChar(op1->uc &= value2);
8518 exp->expType = op1->type;
8520 op1->type->refCount++;
8525 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8527 int value2 = op2->i;
8530 exp->string = PrintInt(op1->i |= value2);
8533 exp->expType = op1->type;
8535 op1->type->refCount++;
8540 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8542 unsigned int value2 = op2->ui;
8545 exp->string = PrintUInt(op1->ui |= value2);
8548 exp->expType = op1->type;
8550 op1->type->refCount++;
8555 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8557 long long value2 = op2->i64;
8560 exp->string = PrintInt64(op1->i64 |= value2);
8563 exp->expType = op1->type;
8565 op1->type->refCount++;
8570 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8572 uint64 value2 = op2->ui64;
8575 exp->string = PrintUInt64(op1->ui64 |= value2);
8578 exp->expType = op1->type;
8580 op1->type->refCount++;
8585 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8587 short value2 = op2->s;
8590 exp->string = PrintShort(op1->s |= value2);
8593 exp->expType = op1->type;
8595 op1->type->refCount++;
8600 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8602 unsigned short value2 = op2->us;
8605 exp->string = PrintUShort(op1->us |= value2);
8608 exp->expType = op1->type;
8610 op1->type->refCount++;
8615 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8617 char value2 = op2->c;
8620 exp->string = PrintChar(op1->c |= value2);
8623 exp->expType = op1->type;
8625 op1->type->refCount++;
8630 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8632 unsigned char value2 = op2->uc;
8635 exp->string = PrintUChar(op1->uc |= value2);
8638 exp->expType = op1->type;
8640 op1->type->refCount++;
8645 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8647 int value2 = op2->i;
8650 exp->string = PrintInt(op1->i ^= value2);
8653 exp->expType = op1->type;
8655 op1->type->refCount++;
8660 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8662 unsigned int value2 = op2->ui;
8665 exp->string = PrintUInt(op1->ui ^= value2);
8668 exp->expType = op1->type;
8670 op1->type->refCount++;
8675 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8677 long long value2 = op2->i64;
8680 exp->string = PrintInt64(op1->i64 ^= value2);
8683 exp->expType = op1->type;
8685 op1->type->refCount++;
8690 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8692 uint64 value2 = op2->ui64;
8695 exp->string = PrintUInt64(op1->ui64 ^= value2);
8698 exp->expType = op1->type;
8700 op1->type->refCount++;
8705 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8707 short value2 = op2->s;
8710 exp->string = PrintShort(op1->s ^= value2);
8713 exp->expType = op1->type;
8715 op1->type->refCount++;
8720 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8722 unsigned short value2 = op2->us;
8725 exp->string = PrintUShort(op1->us ^= value2);
8728 exp->expType = op1->type;
8730 op1->type->refCount++;
8735 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8737 char value2 = op2->c;
8740 exp->string = PrintChar(op1->c ^= value2);
8743 exp->expType = op1->type;
8745 op1->type->refCount++;
8750 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8752 unsigned char value2 = op2->uc;
8755 exp->string = PrintUChar(op1->uc ^= value2);
8758 exp->expType = op1->type;
8760 op1->type->refCount++;
8765 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8767 int value2 = op2->i;
8770 exp->string = PrintInt(op1->i <<= value2);
8773 exp->expType = op1->type;
8775 op1->type->refCount++;
8780 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8782 unsigned int value2 = op2->ui;
8785 exp->string = PrintUInt(op1->ui <<= value2);
8788 exp->expType = op1->type;
8790 op1->type->refCount++;
8795 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8797 long long value2 = op2->i64;
8800 exp->string = PrintInt64(op1->i64 <<= value2);
8803 exp->expType = op1->type;
8805 op1->type->refCount++;
8810 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8812 uint64 value2 = op2->ui64;
8815 exp->string = PrintUInt64(op1->ui64 <<= value2);
8818 exp->expType = op1->type;
8820 op1->type->refCount++;
8825 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8827 short value2 = op2->s;
8830 exp->string = PrintShort(op1->s <<= value2);
8833 exp->expType = op1->type;
8835 op1->type->refCount++;
8840 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8842 unsigned short value2 = op2->us;
8845 exp->string = PrintUShort(op1->us <<= value2);
8848 exp->expType = op1->type;
8850 op1->type->refCount++;
8855 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8857 char value2 = op2->c;
8860 exp->string = PrintChar(op1->c <<= value2);
8863 exp->expType = op1->type;
8865 op1->type->refCount++;
8870 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8872 unsigned char value2 = op2->uc;
8875 exp->string = PrintUChar(op1->uc <<= value2);
8878 exp->expType = op1->type;
8880 op1->type->refCount++;
8885 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8887 int value2 = op2->i;
8890 exp->string = PrintInt(op1->i >>= value2);
8893 exp->expType = op1->type;
8895 op1->type->refCount++;
8900 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8902 unsigned int value2 = op2->ui;
8905 exp->string = PrintUInt(op1->ui >>= value2);
8908 exp->expType = op1->type;
8910 op1->type->refCount++;
8915 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8917 long long value2 = op2->i64;
8920 exp->string = PrintInt64(op1->i64 >>= value2);
8923 exp->expType = op1->type;
8925 op1->type->refCount++;
8930 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8932 uint64 value2 = op2->ui64;
8935 exp->string = PrintUInt64(op1->ui64 >>= value2);
8938 exp->expType = op1->type;
8940 op1->type->refCount++;
8945 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8947 short value2 = op2->s;
8950 exp->string = PrintShort(op1->s >>= value2);
8953 exp->expType = op1->type;
8955 op1->type->refCount++;
8960 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8962 unsigned short value2 = op2->us;
8965 exp->string = PrintUShort(op1->us >>= value2);
8968 exp->expType = op1->type;
8970 op1->type->refCount++;
8975 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8977 char value2 = op2->c;
8980 exp->string = PrintChar(op1->c >>= value2);
8983 exp->expType = op1->type;
8985 op1->type->refCount++;
8990 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8992 unsigned char value2 = op2->uc;
8995 exp->string = PrintUChar(op1->uc >>= value2);
8998 exp->expType = op1->type;
9000 op1->type->refCount++;
9005 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9008 exp->string = PrintInt((int)(!op1->i));
9011 exp->expType = op1->type;
9013 op1->type->refCount++;
9018 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9021 exp->string = PrintUInt((unsigned int)(!op1->ui));
9024 exp->expType = op1->type;
9026 op1->type->refCount++;
9031 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9034 exp->string = PrintInt64((long long)(!op1->i64));
9037 exp->expType = op1->type;
9039 op1->type->refCount++;
9044 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9047 exp->string = PrintUInt64((uint64)(!op1->ui64));
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9060 exp->string = PrintShort((short)(!op1->s));
9063 exp->expType = op1->type;
9065 op1->type->refCount++;
9070 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9073 exp->string = PrintUShort((unsigned short)(!op1->us));
9076 exp->expType = op1->type;
9078 op1->type->refCount++;
9083 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9086 exp->string = PrintChar((char)(!op1->c));
9089 exp->expType = op1->type;
9091 op1->type->refCount++;
9096 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9099 exp->string = PrintUChar((unsigned char)(!op1->uc));
9102 exp->expType = op1->type;
9104 op1->type->refCount++;
9109 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9111 int value2 = op2->i;
9114 exp->string = PrintInt(op1->i == value2);
9117 exp->expType = op1->type;
9119 op1->type->refCount++;
9124 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9126 unsigned int value2 = op2->ui;
9129 exp->string = PrintUInt(op1->ui == value2);
9132 exp->expType = op1->type;
9134 op1->type->refCount++;
9139 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9141 long long value2 = op2->i64;
9144 exp->string = PrintInt64(op1->i64 == value2);
9147 exp->expType = op1->type;
9149 op1->type->refCount++;
9154 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9156 uint64 value2 = op2->ui64;
9159 exp->string = PrintUInt64(op1->ui64 == value2);
9162 exp->expType = op1->type;
9164 op1->type->refCount++;
9169 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9171 short value2 = op2->s;
9174 exp->string = PrintShort(op1->s == value2);
9177 exp->expType = op1->type;
9179 op1->type->refCount++;
9184 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9186 unsigned short value2 = op2->us;
9189 exp->string = PrintUShort(op1->us == value2);
9192 exp->expType = op1->type;
9194 op1->type->refCount++;
9199 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9201 char value2 = op2->c;
9204 exp->string = PrintChar(op1->c == value2);
9207 exp->expType = op1->type;
9209 op1->type->refCount++;
9214 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9216 unsigned char value2 = op2->uc;
9219 exp->string = PrintUChar(op1->uc == value2);
9222 exp->expType = op1->type;
9224 op1->type->refCount++;
9229 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9231 float value2 = op2->f;
9234 exp->string = PrintFloat(op1->f == value2);
9237 exp->expType = op1->type;
9239 op1->type->refCount++;
9244 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9246 double value2 = op2->d;
9249 exp->string = PrintDouble(op1->d == value2);
9252 exp->expType = op1->type;
9254 op1->type->refCount++;
9259 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9261 int value2 = op2->i;
9264 exp->string = PrintInt(op1->i != value2);
9267 exp->expType = op1->type;
9269 op1->type->refCount++;
9274 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9276 unsigned int value2 = op2->ui;
9279 exp->string = PrintUInt(op1->ui != value2);
9282 exp->expType = op1->type;
9284 op1->type->refCount++;
9289 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9291 long long value2 = op2->i64;
9294 exp->string = PrintInt64(op1->i64 != value2);
9297 exp->expType = op1->type;
9299 op1->type->refCount++;
9304 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9306 uint64 value2 = op2->ui64;
9309 exp->string = PrintUInt64(op1->ui64 != value2);
9312 exp->expType = op1->type;
9314 op1->type->refCount++;
9319 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9321 short value2 = op2->s;
9324 exp->string = PrintShort(op1->s != value2);
9327 exp->expType = op1->type;
9329 op1->type->refCount++;
9334 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9336 unsigned short value2 = op2->us;
9339 exp->string = PrintUShort(op1->us != value2);
9342 exp->expType = op1->type;
9344 op1->type->refCount++;
9349 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9351 char value2 = op2->c;
9354 exp->string = PrintChar(op1->c != value2);
9357 exp->expType = op1->type;
9359 op1->type->refCount++;
9364 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9366 unsigned char value2 = op2->uc;
9369 exp->string = PrintUChar(op1->uc != value2);
9372 exp->expType = op1->type;
9374 op1->type->refCount++;
9379 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9381 float value2 = op2->f;
9384 exp->string = PrintFloat(op1->f != value2);
9387 exp->expType = op1->type;
9389 op1->type->refCount++;
9394 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9396 double value2 = op2->d;
9399 exp->string = PrintDouble(op1->d != value2);
9402 exp->expType = op1->type;
9404 op1->type->refCount++;
9409 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9411 int value2 = op2->i;
9414 exp->string = PrintInt(op1->i && value2);
9417 exp->expType = op1->type;
9419 op1->type->refCount++;
9424 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9426 unsigned int value2 = op2->ui;
9429 exp->string = PrintUInt(op1->ui && value2);
9432 exp->expType = op1->type;
9434 op1->type->refCount++;
9439 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9441 long long value2 = op2->i64;
9444 exp->string = PrintInt64(op1->i64 && value2);
9447 exp->expType = op1->type;
9449 op1->type->refCount++;
9454 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9456 uint64 value2 = op2->ui64;
9459 exp->string = PrintUInt64(op1->ui64 && value2);
9462 exp->expType = op1->type;
9464 op1->type->refCount++;
9469 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9471 short value2 = op2->s;
9474 exp->string = PrintShort(op1->s && value2);
9477 exp->expType = op1->type;
9479 op1->type->refCount++;
9484 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9486 unsigned short value2 = op2->us;
9489 exp->string = PrintUShort(op1->us && value2);
9492 exp->expType = op1->type;
9494 op1->type->refCount++;
9499 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9501 char value2 = op2->c;
9504 exp->string = PrintChar(op1->c && value2);
9507 exp->expType = op1->type;
9509 op1->type->refCount++;
9514 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9516 unsigned char value2 = op2->uc;
9519 exp->string = PrintUChar(op1->uc && value2);
9522 exp->expType = op1->type;
9524 op1->type->refCount++;
9529 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9531 float value2 = op2->f;
9534 exp->string = PrintFloat(op1->f && value2);
9537 exp->expType = op1->type;
9539 op1->type->refCount++;
9544 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9546 double value2 = op2->d;
9549 exp->string = PrintDouble(op1->d && value2);
9552 exp->expType = op1->type;
9554 op1->type->refCount++;
9559 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9561 int value2 = op2->i;
9564 exp->string = PrintInt(op1->i || value2);
9567 exp->expType = op1->type;
9569 op1->type->refCount++;
9574 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9576 unsigned int value2 = op2->ui;
9579 exp->string = PrintUInt(op1->ui || value2);
9582 exp->expType = op1->type;
9584 op1->type->refCount++;
9589 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9591 long long value2 = op2->i64;
9594 exp->string = PrintInt64(op1->i64 || value2);
9597 exp->expType = op1->type;
9599 op1->type->refCount++;
9604 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9606 uint64 value2 = op2->ui64;
9609 exp->string = PrintUInt64(op1->ui64 || value2);
9612 exp->expType = op1->type;
9614 op1->type->refCount++;
9619 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9621 short value2 = op2->s;
9624 exp->string = PrintShort(op1->s || value2);
9627 exp->expType = op1->type;
9629 op1->type->refCount++;
9634 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9636 unsigned short value2 = op2->us;
9639 exp->string = PrintUShort(op1->us || value2);
9642 exp->expType = op1->type;
9644 op1->type->refCount++;
9649 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9651 char value2 = op2->c;
9654 exp->string = PrintChar(op1->c || value2);
9657 exp->expType = op1->type;
9659 op1->type->refCount++;
9664 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9666 unsigned char value2 = op2->uc;
9669 exp->string = PrintUChar(op1->uc || value2);
9672 exp->expType = op1->type;
9674 op1->type->refCount++;
9679 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9681 float value2 = op2->f;
9684 exp->string = PrintFloat(op1->f || value2);
9687 exp->expType = op1->type;
9689 op1->type->refCount++;
9694 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9696 double value2 = op2->d;
9699 exp->string = PrintDouble(op1->d || value2);
9702 exp->expType = op1->type;
9704 op1->type->refCount++;
9709 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9711 int value2 = op2->i;
9714 exp->string = PrintInt(op1->i > value2);
9717 exp->expType = op1->type;
9719 op1->type->refCount++;
9724 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9726 unsigned int value2 = op2->ui;
9729 exp->string = PrintUInt(op1->ui > value2);
9732 exp->expType = op1->type;
9734 op1->type->refCount++;
9739 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9741 long long value2 = op2->i64;
9744 exp->string = PrintInt64(op1->i64 > value2);
9747 exp->expType = op1->type;
9749 op1->type->refCount++;
9754 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9756 uint64 value2 = op2->ui64;
9759 exp->string = PrintUInt64(op1->ui64 > value2);
9762 exp->expType = op1->type;
9764 op1->type->refCount++;
9769 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9771 short value2 = op2->s;
9774 exp->string = PrintShort(op1->s > value2);
9777 exp->expType = op1->type;
9779 op1->type->refCount++;
9784 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9786 unsigned short value2 = op2->us;
9789 exp->string = PrintUShort(op1->us > value2);
9792 exp->expType = op1->type;
9794 op1->type->refCount++;
9799 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9801 char value2 = op2->c;
9804 exp->string = PrintChar(op1->c > value2);
9807 exp->expType = op1->type;
9809 op1->type->refCount++;
9814 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9816 unsigned char value2 = op2->uc;
9819 exp->string = PrintUChar(op1->uc > value2);
9822 exp->expType = op1->type;
9824 op1->type->refCount++;
9829 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9831 float value2 = op2->f;
9834 exp->string = PrintFloat(op1->f > value2);
9837 exp->expType = op1->type;
9839 op1->type->refCount++;
9844 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9846 double value2 = op2->d;
9849 exp->string = PrintDouble(op1->d > value2);
9852 exp->expType = op1->type;
9854 op1->type->refCount++;
9859 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9861 int value2 = op2->i;
9864 exp->string = PrintInt(op1->i < value2);
9867 exp->expType = op1->type;
9869 op1->type->refCount++;
9874 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9876 unsigned int value2 = op2->ui;
9879 exp->string = PrintUInt(op1->ui < value2);
9882 exp->expType = op1->type;
9884 op1->type->refCount++;
9889 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9891 long long value2 = op2->i64;
9894 exp->string = PrintInt64(op1->i64 < value2);
9897 exp->expType = op1->type;
9899 op1->type->refCount++;
9904 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9906 uint64 value2 = op2->ui64;
9909 exp->string = PrintUInt64(op1->ui64 < value2);
9912 exp->expType = op1->type;
9914 op1->type->refCount++;
9919 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9921 short value2 = op2->s;
9924 exp->string = PrintShort(op1->s < value2);
9927 exp->expType = op1->type;
9929 op1->type->refCount++;
9934 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9936 unsigned short value2 = op2->us;
9939 exp->string = PrintUShort(op1->us < value2);
9942 exp->expType = op1->type;
9944 op1->type->refCount++;
9949 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9951 char value2 = op2->c;
9954 exp->string = PrintChar(op1->c < value2);
9957 exp->expType = op1->type;
9959 op1->type->refCount++;
9964 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9966 unsigned char value2 = op2->uc;
9969 exp->string = PrintUChar(op1->uc < value2);
9972 exp->expType = op1->type;
9974 op1->type->refCount++;
9979 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9981 float value2 = op2->f;
9984 exp->string = PrintFloat(op1->f < value2);
9987 exp->expType = op1->type;
9989 op1->type->refCount++;
9994 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9996 double value2 = op2->d;
9999 exp->string = PrintDouble(op1->d < value2);
10002 exp->expType = op1->type;
10004 op1->type->refCount++;
10009 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10011 int value2 = op2->i;
10014 exp->string = PrintInt(op1->i >= value2);
10017 exp->expType = op1->type;
10019 op1->type->refCount++;
10024 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10026 unsigned int value2 = op2->ui;
10029 exp->string = PrintUInt(op1->ui >= value2);
10032 exp->expType = op1->type;
10034 op1->type->refCount++;
10039 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10041 long long value2 = op2->i64;
10044 exp->string = PrintInt64(op1->i64 >= value2);
10047 exp->expType = op1->type;
10049 op1->type->refCount++;
10054 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10056 uint64 value2 = op2->ui64;
10059 exp->string = PrintUInt64(op1->ui64 >= value2);
10062 exp->expType = op1->type;
10064 op1->type->refCount++;
10069 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10071 short value2 = op2->s;
10074 exp->string = PrintShort(op1->s >= value2);
10077 exp->expType = op1->type;
10079 op1->type->refCount++;
10084 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10086 unsigned short value2 = op2->us;
10089 exp->string = PrintUShort(op1->us >= value2);
10092 exp->expType = op1->type;
10094 op1->type->refCount++;
10099 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10101 char value2 = op2->c;
10104 exp->string = PrintChar(op1->c >= value2);
10107 exp->expType = op1->type;
10109 op1->type->refCount++;
10114 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10116 unsigned char value2 = op2->uc;
10119 exp->string = PrintUChar(op1->uc >= value2);
10122 exp->expType = op1->type;
10124 op1->type->refCount++;
10129 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10131 float value2 = op2->f;
10134 exp->string = PrintFloat(op1->f >= value2);
10137 exp->expType = op1->type;
10139 op1->type->refCount++;
10144 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10146 double value2 = op2->d;
10149 exp->string = PrintDouble(op1->d >= value2);
10152 exp->expType = op1->type;
10154 op1->type->refCount++;
10159 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10161 int value2 = op2->i;
10164 exp->string = PrintInt(op1->i <= value2);
10167 exp->expType = op1->type;
10169 op1->type->refCount++;
10174 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10176 unsigned int value2 = op2->ui;
10179 exp->string = PrintUInt(op1->ui <= value2);
10182 exp->expType = op1->type;
10184 op1->type->refCount++;
10189 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10191 long long value2 = op2->i64;
10194 exp->string = PrintInt64(op1->i64 <= value2);
10197 exp->expType = op1->type;
10199 op1->type->refCount++;
10204 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10206 uint64 value2 = op2->ui64;
10209 exp->string = PrintUInt64(op1->ui64 <= value2);
10212 exp->expType = op1->type;
10214 op1->type->refCount++;
10219 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10221 short value2 = op2->s;
10224 exp->string = PrintShort(op1->s <= value2);
10227 exp->expType = op1->type;
10229 op1->type->refCount++;
10234 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10236 unsigned short value2 = op2->us;
10239 exp->string = PrintUShort(op1->us <= value2);
10242 exp->expType = op1->type;
10244 op1->type->refCount++;
10249 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10251 char value2 = op2->c;
10254 exp->string = PrintChar(op1->c <= value2);
10257 exp->expType = op1->type;
10259 op1->type->refCount++;
10264 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10266 unsigned char value2 = op2->uc;
10269 exp->string = PrintUChar(op1->uc <= value2);
10272 exp->expType = op1->type;
10274 op1->type->refCount++;
10279 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10281 float value2 = op2->f;
10284 exp->string = PrintFloat(op1->f <= value2);
10287 exp->expType = op1->type;
10289 op1->type->refCount++;
10294 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10296 double value2 = op2->d;
10299 exp->string = PrintDouble(op1->d <= value2);
10302 exp->expType = op1->type;
10304 op1->type->refCount++;
10309 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10312 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10315 exp->expType = op1->type;
10317 op1->type->refCount++;
10322 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10325 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10328 exp->expType = op1->type;
10330 op1->type->refCount++;
10335 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10338 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10341 exp->expType = op1->type;
10343 op1->type->refCount++;
10348 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10351 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10354 exp->expType = op1->type;
10356 op1->type->refCount++;
10361 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10364 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10367 exp->expType = op1->type;
10369 op1->type->refCount++;
10374 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10377 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10380 exp->expType = op1->type;
10382 op1->type->refCount++;
10387 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10390 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10393 exp->expType = op1->type;
10395 op1->type->refCount++;
10400 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10403 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10406 exp->expType = op1->type;
10408 op1->type->refCount++;
10413 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10416 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10419 exp->expType = op1->type;
10421 op1->type->refCount++;
10426 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10429 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10432 exp->expType = op1->type;
10434 op1->type->refCount++;
10439 struct OpTable intOps =
10441 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
10444 struct OpTable uintOps =
10446 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
10449 struct OpTable int64Ops =
10451 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
10454 struct OpTable uint64Ops =
10456 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
10459 struct OpTable shortOps =
10461 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
10464 struct OpTable ushortOps =
10466 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
10469 struct OpTable floatOps =
10471 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
10474 struct OpTable doubleOps =
10476 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
10479 struct OpTable charOps =
10481 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
10484 struct OpTable ucharOps =
10486 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
10489 void ReadString(char * output, char * string)
10491 int len = strlen(string);
10493 unsigned int quoted = 0x0, escaped = 0x0;
10495 for(c = 0; c < len; c++)
10497 char ch = string[c];
10555 int UnescapeString(char * d, char * s, int len)
10560 while(j < len && (ch = s[j]))
10565 switch((ch = s[++j]))
10611 char * OffsetEscapedString(char * s, int len, int offset)
10616 while(j < len && k < offset && (ch = s[j]))
10622 return (k == offset) ? s + j : (((void *)0));
10625 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10627 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10629 extern double strtod(char * , char * * );
10631 struct Operand GetOperand(struct Expression * exp)
10633 struct Operand op =
10637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10640 struct Type * type = exp->expType;
10644 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10646 if(!type->_class->registered->dataType)
10647 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10648 type = type->_class->registered->dataType;
10650 if(exp->type == 3 && op.kind == 13)
10652 op.ui64 = (uint64)exp->string;
10654 op.ops = uint64Ops;
10656 else if(exp->isConstant && exp->type == 2)
10658 op.kind = type->kind;
10659 op.type = exp->expType;
10665 if(exp->constant[0] == '\'')
10667 op.c = exp->constant[1];
10670 else if(type->isSigned)
10672 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10677 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10685 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10690 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10691 op.ops = ushortOps;
10698 op.i = strtol(exp->constant, (((void *)0)), 0);
10703 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10711 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10716 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10724 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10729 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10730 op.ops = uint64Ops;
10737 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10742 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10743 op.ops = uint64Ops;
10748 op.f = (float)strtod(exp->constant, (((void *)0)));
10752 op.d = (double)strtod(exp->constant, (((void *)0)));
10753 op.ops = doubleOps;
10758 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10760 op.ops = uint64Ops;
10768 int __ecereVMethodID_class_OnGetString;
10770 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10772 static void UnusedFunction()
10776 ((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);
10779 extern int __ecereVMethodID_class_OnGetString;
10781 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10783 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10785 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10787 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10788 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10791 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10792 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10793 struct Type * type;
10794 void * ptr = inst->data + dataMember->offset + offset;
10795 char * result = (((void *)0));
10797 exp->loc = member->loc = inst->loc;
10798 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10799 if(!dataMember->dataType)
10800 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10801 type = dataMember->dataType;
10802 if(type->kind == 8)
10804 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10806 if(_class->type == 4)
10808 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10812 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10813 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10815 for(item = e->values.first; item; item = item->next)
10817 if((int)item->data == *(int *)ptr)
10819 result = item->name;
10825 exp->identifier = MkIdentifier(result);
10827 exp->destType = MkClassType(_class->fullName);
10828 ProcessExpressionType(exp);
10832 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10834 if(!_class->dataType)
10835 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10836 type = _class->dataType;
10845 FreeExpContents(exp);
10846 exp->constant = PrintFloat(*(float *)ptr);
10852 FreeExpContents(exp);
10853 exp->constant = PrintDouble(*(double *)ptr);
10859 FreeExpContents(exp);
10860 exp->constant = PrintInt(*(int *)ptr);
10866 FreeExpContents(exp);
10867 exp->constant = PrintInt64(*(long long *)ptr);
10873 FreeExpContents(exp);
10874 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10880 FreeExpContents(exp);
10881 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10889 ListAdd(memberList, member);
10891 if(parentDataMember->type == 1)
10896 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10898 void PopulateInstance(struct Instantiation * inst)
10900 struct Symbol * classSym = inst->_class->symbol;
10901 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10902 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10903 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10906 inst->members = MkListOne(MkMembersInitList(memberList));
10908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10909 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10911 if(!dataMember->isProperty)
10913 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10914 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10917 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10918 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10919 struct Type * type;
10920 void * ptr = inst->data + dataMember->offset;
10921 char * result = (((void *)0));
10923 exp->loc = member->loc = inst->loc;
10924 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10925 if(!dataMember->dataType)
10926 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10927 type = dataMember->dataType;
10928 if(type->kind == 8)
10930 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10932 if(_class->type == 4)
10934 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10938 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10939 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10941 for(item = e->values.first; item; item = item->next)
10943 if((int)item->data == *(int *)ptr)
10945 result = item->name;
10952 exp->identifier = MkIdentifier(result);
10954 exp->destType = MkClassType(_class->fullName);
10955 ProcessExpressionType(exp);
10958 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10960 if(!_class->dataType)
10961 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10962 type = _class->dataType;
10971 exp->constant = PrintFloat(*(float *)ptr);
10977 exp->constant = PrintDouble(*(double *)ptr);
10983 exp->constant = PrintInt(*(int *)ptr);
10989 exp->constant = PrintInt64(*(long long *)ptr);
10995 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11000 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11003 ListAdd(memberList, member);
11009 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);
11011 extern void FreeInstance(struct Instantiation * inst);
11013 void ComputeInstantiation(struct Expression * exp)
11015 struct Instantiation * inst = exp->instance;
11016 struct MembersInit * members;
11017 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11018 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11019 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11020 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11021 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11022 int subMemberStackPos = 0;
11025 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11029 if(_class->type == 0 || _class->type == 5)
11031 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11032 if(_class->type == 0)
11033 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11036 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11040 for(members = (*inst->members).first; members; members = members->next)
11042 switch(members->type)
11046 if(members->dataMembers)
11048 struct MemberInit * member;
11050 for(member = (*members->dataMembers).first; member; member = member->next)
11052 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11053 unsigned int found = 0x0;
11054 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11055 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11056 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11057 unsigned int dataMemberOffset;
11061 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11064 if(curMember->isProperty)
11065 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11068 dataMember = curMember;
11069 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11070 if(_class->type == 0)
11071 dataMemberOffset += _class->base->structSize;
11078 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11082 if(prop->memberAccess == 1)
11084 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11085 curClass = prop->_class;
11090 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11091 int _subMemberStackPos = 0;
11093 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11097 if(dataMember->memberAccess == 1)
11099 curMember = dataMember;
11100 curClass = dataMember->_class;
11101 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11102 subMemberStackPos = _subMemberStackPos;
11107 if(found && member->initializer && member->initializer->type == 0)
11109 struct Expression * value = member->initializer->exp;
11110 struct Type * type = (((void *)0));
11111 unsigned int deepMember = 0x0;
11115 type = prop->dataType;
11117 else if(dataMember)
11119 if(!dataMember->dataType)
11120 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11121 type = dataMember->dataType;
11123 if(ident && ident->next)
11126 for(ident = ident->next; ident && type; ident = ident->next)
11128 if(type->kind == 8)
11130 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11132 type = prop->dataType;
11135 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11137 type = dataMember->dataType;
11140 else if(type->kind == 9 || type->kind == 10)
11142 struct Type * memberType;
11144 for(memberType = type->members.first; memberType; memberType = memberType->next)
11146 if(!strcmp(memberType->name, ident->string))
11157 FreeType(value->destType);
11158 value->destType = type;
11161 ComputeExpression(value);
11163 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11165 if(type->kind == 8)
11167 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11169 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11171 if(!_class->dataType)
11172 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11173 type = _class->dataType;
11178 void * ptr = inst->data + dataMemberOffset;
11180 if(value->type == 2)
11186 GetInt(value, (int *)ptr);
11191 GetInt64(value, (long long *)ptr);
11196 GetIntPtr(value, (intptr_t *)ptr);
11201 GetIntSize(value, (ssize_t *)ptr);
11206 GetFloat(value, (float *)ptr);
11211 GetDouble(value, (double *)ptr);
11216 else if(value->type == 1)
11218 if(type->kind == 8)
11220 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11222 if(_class->type == 1)
11224 ComputeTypeSize(type);
11225 if(value->instance->data)
11226 memcpy(ptr, value->instance->data, type->size);
11233 if(value->type == 1 && value->instance->data)
11235 if(type->kind == 8)
11237 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11239 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)))
11241 void (* Set)(void *, void *) = (void *)prop->Set;
11243 Set(inst->data, value->instance->data);
11244 PopulateInstance(inst);
11248 else if(value->type == 2)
11254 void (* Set)(void *, double) = (void *)prop->Set;
11256 Set(inst->data, strtod(value->constant, (((void *)0))));
11261 void (* Set)(void *, float) = (void *)prop->Set;
11263 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11268 void (* Set)(void *, int) = (void *)prop->Set;
11270 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11275 void (* Set)(void *, long long) = (void *)prop->Set;
11277 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11282 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11284 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11289 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11291 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11296 else if(value->type == 3)
11300 ReadString(temp, value->string);
11301 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11305 else if(!deepMember && type && _class->type == 3)
11309 if(value->type == 2)
11311 if(type->kind == 8)
11313 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11315 if(_class->type == 3)
11317 if(!_class->dataType)
11318 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11319 type = _class->dataType;
11327 float (* Set)(float) = (void *)prop->Set;
11329 GetFloat(member->initializer->exp, &fValue);
11330 exp->constant = PrintFloat(Set(fValue));
11337 double (* Set)(double) = (void *)prop->Set;
11339 GetDouble(member->initializer->exp, &dValue);
11340 exp->constant = PrintDouble(Set(dValue));
11348 else if(!deepMember && type && _class->type == 2)
11352 if(value->type == 1 && value->instance->data)
11354 unsigned int (* Set)(void *) = (void *)prop->Set;
11356 bits = Set(value->instance->data);
11358 else if(value->type == 2)
11362 else if(dataMember)
11364 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11365 struct Type * type;
11368 GetInt(value, &part);
11369 bits = (bits & ~bitMember->mask);
11370 if(!bitMember->dataType)
11371 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11372 type = bitMember->dataType;
11373 if(type->kind == 8 && type->_class && type->_class->registered)
11375 if(!type->_class->registered->dataType)
11376 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11377 type = type->_class->registered->dataType;
11384 bits |= ((char)part << bitMember->pos);
11386 bits |= ((unsigned char)part << bitMember->pos);
11390 bits |= ((short)part << bitMember->pos);
11392 bits |= ((unsigned short)part << bitMember->pos);
11397 bits |= (part << bitMember->pos);
11399 bits |= ((unsigned int)part << bitMember->pos);
11403 bits |= ((long long)part << bitMember->pos);
11405 bits |= ((uint64)part << bitMember->pos);
11410 bits |= ((intptr_t)part << bitMember->pos);
11414 bits |= ((uintptr_t)part << bitMember->pos);
11420 bits |= ((ssize_t)part << bitMember->pos);
11424 bits |= ((size_t)part << bitMember->pos);
11433 if(_class && _class->type == 3)
11435 ComputeExpression(member->initializer->exp);
11436 exp->constant = member->initializer->exp->constant;
11438 member->initializer->exp->constant = (((void *)0));
11448 if(_class && _class->type == 2)
11450 exp->constant = PrintHexUInt(bits);
11455 FreeInstance(inst);
11459 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11461 unsigned int result = 0x0;
11466 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11467 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11471 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11472 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11475 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11476 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11479 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11480 result = GetOpFloat(op, &op->f);
11483 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11484 result = GetOpDouble(op, &op->d);
11487 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11488 result = GetOpUIntPtr(op, &op->ui64);
11491 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
11492 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11495 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11496 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11499 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11500 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11506 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11508 if(exp->op.op == SIZEOF)
11510 FreeExpContents(exp);
11512 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11522 struct Expression * exp2 = exp->op.exp2;
11524 exp->op.exp2 = (((void *)0));
11525 FreeExpContents(exp);
11526 FreeType(exp->expType);
11527 FreeType(exp->destType);
11529 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11535 FreeExpContents(exp);
11536 op1->ops.Neg(exp, op1);
11540 if(op1->ops.BitNot)
11542 FreeExpContents(exp);
11543 op1->ops.BitNot(exp, op1);
11549 FreeExpContents(exp);
11550 op1->ops.Not(exp, op1);
11557 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11559 if(Promote(op2, op1->kind, op1->type->isSigned))
11560 op2->kind = op1->kind, op2->ops = op1->ops;
11561 else if(Promote(op1, op2->kind, op2->type->isSigned))
11562 op1->kind = op2->kind, op1->ops = op2->ops;
11569 FreeExpContents(exp);
11570 op1->ops.Add(exp, op1, op2);
11576 FreeExpContents(exp);
11577 op1->ops.Sub(exp, op1, op2);
11583 FreeExpContents(exp);
11584 op1->ops.Mul(exp, op1, op2);
11590 FreeExpContents(exp);
11591 op1->ops.Div(exp, op1, op2);
11597 FreeExpContents(exp);
11598 op1->ops.Mod(exp, op1, op2);
11604 if(op1->ops.BitAnd)
11606 FreeExpContents(exp);
11607 op1->ops.BitAnd(exp, op1, op2);
11614 FreeExpContents(exp);
11615 op1->ops.BitOr(exp, op1, op2);
11619 if(op1->ops.BitXor)
11621 FreeExpContents(exp);
11622 op1->ops.BitXor(exp, op1, op2);
11626 if(op1->ops.LShift)
11628 FreeExpContents(exp);
11629 op1->ops.LShift(exp, op1, op2);
11633 if(op1->ops.RShift)
11635 FreeExpContents(exp);
11636 op1->ops.RShift(exp, op1, op2);
11642 FreeExpContents(exp);
11643 op1->ops.Equ(exp, op1, op2);
11649 FreeExpContents(exp);
11650 op1->ops.Nqu(exp, op1, op2);
11656 FreeExpContents(exp);
11657 op1->ops.And(exp, op1, op2);
11663 FreeExpContents(exp);
11664 op1->ops.Or(exp, op1, op2);
11670 FreeExpContents(exp);
11671 op1->ops.Grt(exp, op1, op2);
11677 FreeExpContents(exp);
11678 op1->ops.Sma(exp, op1, op2);
11682 if(op1->ops.GrtEqu)
11684 FreeExpContents(exp);
11685 op1->ops.GrtEqu(exp, op1, op2);
11689 if(op1->ops.SmaEqu)
11691 FreeExpContents(exp);
11692 op1->ops.SmaEqu(exp, op1, op2);
11700 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11702 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11704 void ComputeExpression(struct Expression * exp)
11706 char expString[10240];
11708 expString[0] = '\0';
11713 ComputeInstantiation(exp);
11718 struct Expression * exp1, * exp2 = (((void *)0));
11719 struct Operand op1 =
11723 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11726 struct Operand op2 =
11730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11736 struct Expression * e = exp->op.exp2;
11738 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11740 if(e->type == 5 || e->type == 32 || e->type == 23)
11743 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11745 e = (*e->list).last;
11748 if(exp->op.op == 261 && e && e->expType)
11750 if(e->type == 3 && e->string)
11752 char * string = e->string;
11753 int len = strlen(string);
11754 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11756 len = UnescapeString(tmp, string + 1, len - 2);
11757 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11758 FreeExpContents(exp);
11760 exp->constant = PrintUInt(len + 1);
11764 struct Type * type = e->expType;
11767 FreeExpContents(exp);
11769 exp->constant = PrintUInt(ComputeTypeSize(type));
11775 ComputeExpression(exp->op.exp2);
11779 ComputeExpression(exp->op.exp1);
11780 exp1 = exp->op.exp1;
11781 exp2 = exp->op.exp2;
11782 op1 = GetOperand(exp1);
11784 op1.type->refCount++;
11787 op2 = GetOperand(exp2);
11789 op2.type->refCount++;
11794 exp1 = exp->op.exp2;
11795 op1 = GetOperand(exp1);
11797 op1.type->refCount++;
11799 CallOperator(exp, exp1, exp2, &op1, &op2);
11801 FreeType(op1.type);
11803 FreeType(op2.type);
11809 struct Expression * e, * n;
11811 for(e = (*exp->list).first; e; e = n)
11816 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11818 ComputeExpression(e);
11819 FreeType(exp->expType);
11820 FreeType(exp->destType);
11822 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11823 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11834 struct Expression * memberExp = exp->member.exp;
11835 struct Identifier * memberID = exp->member.member;
11836 struct Type * type;
11838 ComputeExpression(exp->member.exp);
11839 type = exp->member.exp->expType;
11842 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)));
11843 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11844 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11845 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11847 if(type->kind == 19 && exp->member.exp->type == 24)
11848 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11852 struct Symbol * classSym;
11855 PrintTypeNoConst(type, string, 0x0, 0x1);
11856 classSym = FindClass(string);
11857 _class = classSym ? classSym->registered : (((void *)0));
11859 if(exp->member.member)
11861 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11863 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11865 if(!prop && !member && _class && exp->member.member)
11867 struct Symbol * classSym = FindClass(exp->member.member->string);
11869 convertTo = _class;
11870 _class = classSym ? classSym->registered : (((void *)0));
11871 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11877 struct Type * type = prop->dataType;
11879 if(_class->type == 3)
11881 if(type->kind == 8)
11883 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11885 if(_class->type == 3)
11887 if(!_class->dataType)
11888 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11889 type = _class->dataType;
11897 float (* Get)(float) = (void *)prop->Get;
11899 GetFloat(exp->member.exp, &value);
11900 exp->constant = PrintFloat(Get ? Get(value) : value);
11907 double (* Get)(double);
11909 GetDouble(exp->member.exp, &value);
11911 Get = (void *)prop->Set;
11913 Get = (void *)prop->Get;
11914 exp->constant = PrintDouble(Get ? Get(value) : value);
11924 struct Expression * value = exp->member.exp;
11925 struct Type * type;
11927 if(!prop->dataType)
11928 ProcessPropertyType(prop);
11929 type = prop->dataType;
11933 else if(_class->type == 1)
11939 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11941 if(propertyClass->type == 1 && value->type == 1)
11943 void (* Set)(void *, void *) = (void *)prop->Set;
11945 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11946 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11947 exp->instance->_class = MkSpecifierName(_class->fullName);
11948 exp->instance->loc = exp->loc;
11950 Set(exp->instance->data, value->instance->data);
11951 PopulateInstance(exp->instance);
11958 void (* Set)(void *, int) = (void *)prop->Set;
11960 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11961 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11962 exp->instance->_class = MkSpecifierName(_class->fullName);
11963 exp->instance->loc = exp->loc;
11965 GetInt(value, &intValue);
11966 Set(exp->instance->data, intValue);
11967 PopulateInstance(exp->instance);
11972 long long intValue;
11973 void (* Set)(void *, long long) = (void *)prop->Set;
11975 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11976 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11977 exp->instance->_class = MkSpecifierName(_class->fullName);
11978 exp->instance->loc = exp->loc;
11980 GetInt64(value, &intValue);
11981 Set(exp->instance->data, intValue);
11982 PopulateInstance(exp->instance);
11988 void (* Set)(void *, intptr_t) = (void *)prop->Set;
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 GetIntPtr(value, &intValue);
11996 Set(exp->instance->data, intValue);
11997 PopulateInstance(exp->instance);
12003 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12005 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12006 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12007 exp->instance->_class = MkSpecifierName(_class->fullName);
12008 exp->instance->loc = exp->loc;
12010 GetIntSize(value, &intValue);
12011 Set(exp->instance->data, intValue);
12012 PopulateInstance(exp->instance);
12017 double doubleValue;
12018 void (* Set)(void *, double) = (void *)prop->Set;
12020 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12021 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12022 exp->instance->_class = MkSpecifierName(_class->fullName);
12023 exp->instance->loc = exp->loc;
12025 GetDouble(value, &doubleValue);
12026 Set(exp->instance->data, doubleValue);
12027 PopulateInstance(exp->instance);
12032 else if(_class->type == 2)
12038 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12040 if(propertyClass->type == 1 && value->instance->data)
12042 unsigned int (* Set)(void *) = (void *)prop->Set;
12043 unsigned int bits = Set(value->instance->data);
12045 exp->constant = PrintHexUInt(bits);
12049 else if(_class->type == 2)
12051 unsigned int value;
12052 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12055 GetUInt(exp->member.exp, &value);
12057 exp->constant = PrintHexUInt(bits);
12066 if(_class->type == 2)
12068 unsigned int value;
12070 GetUInt(exp->member.exp, &value);
12075 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12077 if(_class->type == 1)
12079 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12081 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12082 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12083 exp->instance->_class = MkSpecifierName(_class->fullName);
12084 exp->instance->loc = exp->loc;
12086 Get(value, exp->instance->data);
12087 PopulateInstance(exp->instance);
12089 else if(_class->type == 2)
12091 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12092 uint64 bits = Get(value);
12094 exp->constant = PrintHexUInt64(bits);
12101 else if(_class->type == 1)
12103 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12109 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12111 if(_class->type == 1 && value)
12113 void (* Get)(void *, void *) = (void *)prop->Get;
12115 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12116 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12117 exp->instance->_class = MkSpecifierName(_class->fullName);
12118 exp->instance->loc = exp->loc;
12120 Get(value, exp->instance->data);
12121 PopulateInstance(exp->instance);
12132 exp->isConstant = 0x0;
12141 FreeExpression(memberExp);
12142 FreeIdentifier(memberID);
12148 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12150 FreeExpContents(exp);
12151 exp->constant = PrintUInt(ComputeTypeSize(type));
12158 struct Symbol * classSym = exp->_class->symbol;
12160 if(classSym && classSym->registered)
12162 if(classSym->registered->fixed)
12164 FreeSpecifier(exp->_class);
12165 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12170 char className[1024];
12172 strcpy(className, "__ecereClass_");
12173 FullClassNameCat(className, classSym->string, 0x1);
12174 MangleClassName(className);
12175 DeclareClass(classSym, className);
12176 FreeExpContents(exp);
12178 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12179 exp->member.member = MkIdentifier("structSize");
12186 struct Type * type;
12187 struct Expression * e = exp;
12189 if(exp->type == 11)
12192 ComputeExpression(exp->cast.exp);
12195 if(e && exp->expType)
12197 type = exp->expType;
12198 if(type->kind == 8)
12200 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12202 if(_class && (_class->type == 3 || _class->type == 2))
12204 if(!_class->dataType)
12205 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12206 type = _class->dataType;
12215 char value = (char)0;
12217 if(GetChar(e, &value))
12219 FreeExpContents(exp);
12220 exp->constant = PrintChar(value);
12226 unsigned char value = (unsigned char)0;
12228 if(GetUChar(e, &value))
12230 FreeExpContents(exp);
12231 exp->constant = PrintUChar(value);
12239 short value = (short)0;
12241 if(GetShort(e, &value))
12243 FreeExpContents(exp);
12244 exp->constant = PrintShort(value);
12250 unsigned short value = (unsigned short)0;
12252 if(GetUShort(e, &value))
12254 FreeExpContents(exp);
12255 exp->constant = PrintUShort(value);
12265 if(GetInt(e, &value))
12267 FreeExpContents(exp);
12268 exp->constant = PrintInt(value);
12274 unsigned int value = 0;
12276 if(GetUInt(e, &value))
12278 FreeExpContents(exp);
12279 exp->constant = PrintUInt(value);
12287 long long value = 0;
12289 if(GetInt64(e, &value))
12291 FreeExpContents(exp);
12292 exp->constant = PrintInt64(value);
12300 if(GetUInt64(e, &value))
12302 FreeExpContents(exp);
12303 exp->constant = PrintUInt64(value);
12311 intptr_t value = 0;
12313 if(GetIntPtr(e, &value))
12315 FreeExpContents(exp);
12316 exp->constant = PrintInt64((long long)value);
12322 uintptr_t value = 0;
12324 if(GetUIntPtr(e, &value))
12326 FreeExpContents(exp);
12327 exp->constant = PrintUInt64((uint64)value);
12337 if(GetIntSize(e, &value))
12339 FreeExpContents(exp);
12340 exp->constant = PrintInt64((long long)value);
12348 if(GetUIntSize(e, &value))
12350 FreeExpContents(exp);
12351 exp->constant = PrintUInt64((uint64)value);
12360 if(GetFloat(e, &value))
12362 FreeExpContents(exp);
12363 exp->constant = PrintFloat(value);
12372 if(GetDouble(e, &value))
12374 FreeExpContents(exp);
12375 exp->constant = PrintDouble(value);
12386 struct Operand op1 =
12390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12393 struct Operand op2 =
12397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12400 struct Operand op3 =
12404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12409 ComputeExpression((*exp->cond.exp).last);
12410 if(exp->cond.elseExp)
12411 ComputeExpression(exp->cond.elseExp);
12413 ComputeExpression(exp->cond.cond);
12414 op1 = GetOperand(exp->cond.cond);
12416 op1.type->refCount++;
12417 op2 = GetOperand((*exp->cond.exp).last);
12419 op2.type->refCount++;
12420 op3 = GetOperand(exp->cond.elseExp);
12422 op3.type->refCount++;
12425 FreeExpContents(exp);
12426 op1.ops.Cond(exp, &op1, &op2, &op3);
12429 FreeType(op1.type);
12431 FreeType(op2.type);
12433 FreeType(op3.type);
12439 void ApplyAnyObjectLogic(struct Expression * e);
12441 extern void CopyTypeInto(struct Type * type, struct Type * src);
12443 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12445 unsigned int result = 0x1;
12449 struct __ecereNameSpace__ecere__sys__OldList converts =
12453 struct Conversion * convert;
12455 if(destType->kind == 0)
12457 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12461 for(convert = converts.first; convert; convert = convert->next)
12463 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12467 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12468 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12471 newExp->destType = (((void *)0));
12475 exp->addedThis = 0x1;
12476 exp->member.exp = newExp;
12477 FreeType(exp->member.exp->expType);
12478 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12479 exp->member.exp->expType->classObjectType = objectType;
12480 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12481 exp->member.memberType = 1;
12482 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12483 exp->needCast = 0x1;
12485 exp->expType->refCount++;
12486 ApplyAnyObjectLogic(exp->member.exp);
12492 exp->addedThis = 0x1;
12493 exp->member.exp = newExp;
12494 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12496 newExp->byReference = 0x1;
12498 FreeType(exp->member.exp->expType);
12499 exp->member.exp->expType = (((void *)0));
12500 if(convert->convert->dataType)
12502 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12503 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12504 exp->member.exp->expType->refCount = 1;
12505 exp->member.exp->expType->classObjectType = objectType;
12506 ApplyAnyObjectLogic(exp->member.exp);
12508 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12509 exp->member.memberType = 4;
12510 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12511 exp->needCast = 0x1;
12512 if(convert->resultType)
12513 convert->resultType->refCount++;
12519 FreeType(exp->expType);
12522 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12523 exp->needCast = 0x1;
12525 exp->expType->refCount++;
12529 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12530 exp->needCast = 0x1;
12531 if(convert->resultType)
12532 convert->resultType->refCount++;
12536 if(exp->isConstant && inCompiler)
12537 ComputeExpression(exp);
12538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12540 if(!result && exp->expType && converts.count)
12542 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12544 if(!result && exp->expType && exp->destType)
12546 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))
12553 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12555 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12557 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12559 void CheckTemplateTypes(struct Expression * exp)
12561 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12563 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12564 struct Statement * compound;
12565 struct Context * context;
12569 exp->destType->refCount++;
12571 exp->expType->refCount++;
12572 newExp->prev = (((void *)0));
12573 newExp->next = (((void *)0));
12574 switch(exp->expType->kind)
12577 if(exp->destType->classObjectType)
12580 exp->destType->refCount--;
12582 exp->expType->refCount--;
12583 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12587 struct __ecereNameSpace__ecere__sys__OldList * specs;
12588 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12589 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12591 context = PushContext();
12592 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12593 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12594 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12596 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12597 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12598 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12599 exp->compound->compound.context = context;
12600 PopContext(context);
12605 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12606 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12610 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12612 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12613 struct Statement * compound;
12614 struct Context * context;
12618 exp->destType->refCount++;
12620 exp->expType->refCount++;
12621 newExp->prev = (((void *)0));
12622 newExp->next = (((void *)0));
12623 switch(exp->expType->kind)
12626 if(exp->destType->classObjectType)
12629 exp->destType->refCount--;
12631 exp->expType->refCount--;
12632 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12636 struct __ecereNameSpace__ecere__sys__OldList * specs;
12637 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12638 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12640 context = PushContext();
12641 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12642 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12643 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12645 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12646 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12647 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12648 exp->compound->compound.context = context;
12649 PopContext(context);
12654 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12657 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12658 ProcessExpressionType((*exp->list).first);
12664 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12665 newExp->needCast = 0x1;
12666 ProcessExpressionType((*exp->list).first);
12672 if(exp->expType->kind == 20)
12674 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12678 FreeType(exp->destType);
12679 FreeType(exp->expType);
12680 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12684 if(newExp->type == 8 && newExp->member.memberType == 3)
12688 exp->op.exp1 = (((void *)0));
12689 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12693 char typeString[1024];
12694 struct Declarator * decl;
12695 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12697 typeString[0] = '\0';
12698 PrintType(exp->expType, typeString, 0x0, 0x0);
12699 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12701 exp->cast.typeName = MkTypeName(specs, decl);
12702 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12703 exp->cast.exp->needCast = 0x1;
12711 extern int strncmp(const char * , const char * , size_t n);
12713 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12715 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12717 int nsLen = strlen(nameSpace);
12718 struct Symbol * symbol;
12720 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)))
12722 char * s = symbol->string;
12724 if(!strncmp(s, nameSpace, nsLen))
12729 for(c = strlen(s) - 1; c >= 0; c--)
12732 namePart = s + c + 1;
12733 if(!strcmp(namePart, name))
12741 return (((void *)0));
12744 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12747 char nameSpace[1024];
12749 unsigned int gotColon = 0x0;
12751 nameSpace[0] = '\0';
12752 for(c = strlen(name) - 1; c >= 0; c--)
12758 namePart = name + c + 1;
12759 while(c >= 0 && name[c] == ':')
12763 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12767 memcpy(nameSpace, name, c + 1);
12768 nameSpace[c + 1] = (char)0;
12769 return ScanWithNameSpace(tree, nameSpace, namePart);
12773 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12779 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12783 return ScanWithNameSpace(tree, "", namePart);
12785 return (((void *)0));
12788 static void ProcessDeclaration(struct Declaration * decl);
12790 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12792 struct Context * ctx;
12793 struct Symbol * symbol = (((void *)0));
12795 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12797 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12799 symbol = (((void *)0));
12802 char curName[1024];
12804 strcpy(curName, thisNameSpace);
12805 strcat(curName, "::");
12806 strcat(curName, name);
12807 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12810 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12813 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12814 if(symbol || ctx == endContext)
12817 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12819 if(symbol->pointerExternal->type == 0)
12821 struct FunctionDefinition * function = symbol->pointerExternal->function;
12822 struct Context * tmpContext = curContext;
12824 curContext = (((void *)0));
12825 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12826 curContext = tmpContext;
12827 symbol->pointerExternal->symbol = symbol;
12828 DeclareType(symbol->type, 0x1, 0x1);
12829 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12830 symbol->id = curExternal->symbol->idCode;
12832 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12834 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12835 symbol->id = curExternal->symbol->idCode;
12841 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12843 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12844 ListAdd(specs, MkSpecifier(UNSIGNED));
12849 if(type->_class->registered)
12851 if(!type->_class->registered->dataType)
12852 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12853 GetTypeSpecs(type->_class->registered->dataType, specs);
12858 ListAdd(specs, MkSpecifier(DOUBLE));
12861 ListAdd(specs, MkSpecifier(FLOAT));
12864 ListAdd(specs, MkSpecifier(CHAR));
12867 ListAdd(specs, MkSpecifier(_BOOL));
12870 ListAdd(specs, MkSpecifier(SHORT));
12873 ListAdd(specs, MkSpecifier(INT64));
12876 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12879 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12883 ListAdd(specs, MkSpecifier(INT));
12888 static void PrintArraySize(struct Type * arrayType, char * string)
12894 if(arrayType->enumClass)
12895 strcat(size, arrayType->enumClass->string);
12896 else if(arrayType->arraySizeExp)
12897 PrintExpression(arrayType->arraySizeExp, size);
12899 strcat(string, size);
12902 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12906 if(printConst && type->constant)
12907 strcat(string, "const ");
12912 struct Symbol * c = type->_class;
12914 if(type->classObjectType == 2)
12915 strcat(string, "typed_object");
12916 else if(type->classObjectType == 3)
12917 strcat(string, "any_object");
12921 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12923 if(type->byReference)
12924 strcat(string, " &");
12928 strcat(string, "void");
12931 strcat(string, type->isSigned ? "int" : "uint");
12934 strcat(string, type->isSigned ? "int64" : "uint64");
12937 strcat(string, type->isSigned ? "intptr" : "uintptr");
12940 strcat(string, type->isSigned ? "intsize" : "uintsize");
12943 strcat(string, type->isSigned ? "char" : "byte");
12946 strcat(string, "_Bool");
12949 strcat(string, type->isSigned ? "short" : "uint16");
12952 strcat(string, "float");
12955 strcat(string, "double");
12960 strcat(string, "struct ");
12961 strcat(string, type->enumName);
12963 else if(type->typeName)
12964 strcat(string, type->typeName);
12967 struct Type * member;
12969 strcat(string, "struct { ");
12970 for(member = type->members.first; member; member = member->next)
12972 PrintType(member, string, 0x1, fullName);
12973 strcat(string, "; ");
12975 strcat(string, "}");
12981 strcat(string, "union ");
12982 strcat(string, type->enumName);
12984 else if(type->typeName)
12985 strcat(string, type->typeName);
12988 strcat(string, "union ");
12989 strcat(string, "(unnamed)");
12995 strcat(string, "enum ");
12996 strcat(string, type->enumName);
12998 else if(type->typeName)
12999 strcat(string, type->typeName);
13001 strcat(string, "int");
13004 strcat(string, "...");
13007 strcat(string, "subclass(");
13008 strcat(string, type->_class ? type->_class->string : "int");
13009 strcat(string, ")");
13012 strcat(string, type->templateParameter->identifier->string);
13015 strcat(string, "thisclass");
13018 strcat(string, "__builtin_va_list");
13024 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13026 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13028 if(type->name && type->name[0])
13031 strcat(string, type->name);
13034 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13040 strcat(string, name);
13045 static void PrintAttribs(struct Type * type, char * string)
13049 if(type->dllExport)
13050 strcat(string, "dllexport ");
13051 if(type->attrStdcall)
13052 strcat(string, "stdcall ");
13056 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13058 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13060 struct Type * attrType = (((void *)0));
13062 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13063 PrintAttribs(type, string);
13064 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13065 strcat(string, " const");
13066 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13067 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13068 strcat(string, " (");
13069 if(type->kind == 13)
13071 if(type->type->kind == 11 || type->type->kind == 16)
13072 PrintAttribs(type->type, string);
13074 if(type->kind == 13)
13076 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13077 strcat(string, "*");
13079 strcat(string, " *");
13081 if(printConst && type->constant && type->kind == 13)
13082 strcat(string, " const");
13085 PrintTypeSpecs(type, string, fullName, printConst);
13088 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13090 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13091 strcat(string, ")");
13092 if(type->kind == 12)
13093 PrintArraySize(type, string);
13094 else if(type->kind == 11)
13096 struct Type * param;
13098 strcat(string, "(");
13099 for(param = type->params.first; param; param = param->next)
13101 PrintType(param, string, 0x1, fullName);
13103 strcat(string, ", ");
13105 strcat(string, ")");
13107 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13108 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13111 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13113 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13114 if(type->thisClass || (printName && type->name && type->name[0]))
13115 strcat(string, " ");
13116 if((type->thisClass || type->staticMethod))
13118 struct Symbol * _class = type->thisClass;
13120 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13122 if(type->classObjectType == 1)
13123 strcat(string, "class");
13125 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13127 else if(_class && _class->string)
13129 char * s = _class->string;
13135 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13141 strcat(string, name);
13144 strcat(string, "::");
13146 if(printName && type->name)
13147 PrintName(type, string, fullName);
13148 PostPrintType(type, string, fullName);
13149 if(type->bitFieldCount)
13153 sprintf(count, ":%d", type->bitFieldCount);
13154 strcat(string, count);
13158 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13160 _PrintType(type, string, printName, fullName, 0x1);
13163 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13165 _PrintType(type, string, printName, fullName, 0x0);
13168 static struct Type * FindMember(struct Type * type, char * string)
13170 struct Type * memberType;
13172 for(memberType = type->members.first; memberType; memberType = memberType->next)
13174 if(!memberType->name)
13176 struct Type * subType = FindMember(memberType, string);
13181 else if(!strcmp(memberType->name, string))
13184 return (((void *)0));
13187 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13189 struct Type * memberType;
13191 for(memberType = type->members.first; memberType; memberType = memberType->next)
13193 if(!memberType->name)
13195 struct Type * subType = FindMember(memberType, string);
13199 *offset += memberType->offset;
13203 else if(!strcmp(memberType->name, string))
13205 *offset += memberType->offset;
13209 return (((void *)0));
13212 extern unsigned int parseError;
13214 unsigned int GetParseError()
13219 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13221 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13223 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13225 struct Expression * ParseExpressionString(char * expression)
13228 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13229 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13230 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13232 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13233 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13234 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13235 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13237 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13238 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13240 parsedExpression = (((void *)0));
13242 expression_yyparse();
13243 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13244 return parsedExpression;
13247 extern char * QMkString(char * source);
13249 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13251 struct Identifier * id = exp->identifier;
13252 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13253 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13254 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13255 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13257 if(_class && _class->type == 4)
13259 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13260 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13264 struct __ecereNameSpace__ecere__com__Class * baseClass;
13266 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13268 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13270 for(value = e->values.first; value; value = value->next)
13272 if(!strcmp(value->name, id->string))
13277 char constant[256];
13279 FreeExpContents(exp);
13281 exp->isConstant = 0x1;
13282 if(!strcmp(baseClass->dataTypeString, "int"))
13283 sprintf(constant, "%d", (int)value->data);
13285 sprintf(constant, "0x%X", (int)value->data);
13286 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13287 exp->expType = MkClassType(baseClass->fullName);
13295 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13297 ProcessMethodType(method);
13298 exp->expType = __extension__ ({
13299 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13301 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13305 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13307 if(!prop->dataType)
13308 ProcessPropertyType(prop);
13309 exp->expType = prop->dataType;
13311 prop->dataType->refCount++;
13314 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13316 if(!member->dataType)
13317 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13318 exp->expType = member->dataType;
13319 if(member->dataType)
13320 member->dataType->refCount++;
13323 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13325 if(!classProp->dataType)
13326 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13327 if(classProp->constant)
13329 FreeExpContents(exp);
13330 exp->isConstant = 0x1;
13331 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13334 exp->constant = QMkString((char *)classProp->Get(_class));
13338 char constant[256];
13341 sprintf(constant, "%d", (int)classProp->Get(_class));
13342 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13348 exp->expType = classProp->dataType;
13349 if(classProp->dataType)
13350 classProp->dataType->refCount++;
13356 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13358 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13359 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13360 struct __ecereNameSpace__ecere__com__NameSpace * child;
13364 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)))
13366 data = ScanGlobalData(child, name);
13374 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13376 extern char * strncpy(char * , const char * , size_t n);
13378 static struct GlobalData * FindGlobalData(char * name)
13381 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13383 nameSpace = globalData;
13384 for(c = 0; name[c]; c++)
13386 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13388 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13389 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13391 strncpy(spaceName, name + start, c - start);
13392 spaceName[c - start] = '\0';
13393 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13394 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13396 return (((void *)0));
13397 nameSpace = newSpace;
13405 return ScanGlobalData(nameSpace, name + start);
13407 return (((void *)0));
13410 static int definedExpStackPos;
13412 static void * definedExpStack[512];
13414 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13416 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13418 FreeExpContents(checkedExp);
13419 FreeType(checkedExp->expType);
13420 FreeType(checkedExp->destType);
13421 *checkedExp = *newExp;
13422 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13423 checkedExp->prev = prev;
13424 checkedExp->next = next;
13427 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13429 extern int printf(char * , ...);
13431 void __ecereMethod_Expression_Clear();
13433 void ApplyAnyObjectLogic(struct Expression * e)
13435 struct Type * destType = e->destType;
13437 if(destType && (destType->classObjectType == 3))
13439 if(e && e->expType)
13441 struct Type * type = e->expType;
13442 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13444 if(type->kind == 8 && type->_class && type->_class->registered)
13446 _class = type->_class->registered;
13448 else if(type->kind == 19)
13450 _class = FindClass("ecere::com::Class")->registered;
13454 char string[1024] = "";
13455 struct Symbol * classSym;
13457 PrintTypeNoConst(type, string, 0x0, 0x1);
13458 classSym = FindClass(string);
13460 _class = classSym->registered;
13462 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)))
13464 if(!_class || strcmp(_class->fullName, "char *"))
13466 struct Expression * checkedExp = e, * newExp;
13468 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13470 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13472 if(checkedExp->type == 23)
13474 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13477 checkedExp = (*checkedExp->list).last;
13479 else if(checkedExp->type == 11)
13480 checkedExp = checkedExp->cast.exp;
13482 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13484 newExp = checkedExp->op.exp2;
13485 checkedExp->op.exp2 = (((void *)0));
13486 FreeExpContents(checkedExp);
13487 if(e->expType && e->expType->passAsTemplate)
13491 ComputeTypeSize(e->expType);
13492 sprintf(size, "%d", e->expType->size);
13493 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))))));
13495 ReplaceExpContents(checkedExp, newExp);
13496 e->byReference = 0x1;
13498 else if(!e->byReference || (_class && _class->type == 5))
13500 struct Expression * checkedExp, * newExp;
13503 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;
13505 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13507 struct Context * context = PushContext();
13508 struct Declarator * decl;
13509 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13510 char typeString[1024];
13511 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13513 typeString[0] = '\0';
13515 newExp->prev = (((void *)0));
13516 newExp->next = (((void *)0));
13517 newExp->expType = (((void *)0));
13518 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13519 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13520 newExp->destType = ProcessType(specs, decl);
13521 curContext = context;
13525 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13528 sprintf(name, "__internalValue%03X", internalValueCounter++);
13529 if(!curCompound->compound.declarations)
13530 curCompound->compound.declarations = MkList();
13531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13532 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13533 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13534 e->compound = MkCompoundStmt((((void *)0)), stmts);
13537 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13539 struct Type * type = e->destType;
13541 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13542 CopyTypeInto(e->destType, type);
13543 e->destType->refCount = 1;
13544 e->destType->classObjectType = 0;
13547 e->compound->compound.context = context;
13548 PopContext(context);
13549 curContext = context->parent;
13553 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13555 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13557 if(checkedExp->type == 23)
13559 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13562 checkedExp = (*checkedExp->list).last;
13564 else if(checkedExp->type == 11)
13565 checkedExp = checkedExp->cast.exp;
13568 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13570 *operand = *checkedExp;
13571 checkedExp->destType = (((void *)0));
13572 checkedExp->expType = (((void *)0));
13573 __ecereMethod_Expression_Clear(checkedExp);
13574 checkedExp->type = 4;
13575 checkedExp->op.op = '&';
13576 checkedExp->op.exp1 = (((void *)0));
13577 checkedExp->op.exp2 = operand;
13586 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))))
13588 if(e->expType->classObjectType && destType && destType->classObjectType)
13594 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13597 thisExp->prev = (((void *)0));
13598 thisExp->next = (((void *)0));
13599 __ecereMethod_Expression_Clear(e);
13601 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13602 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13603 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13605 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13606 CopyTypeInto(e->expType, thisExp->expType);
13607 e->expType->byReference = 0x0;
13608 e->expType->refCount = 1;
13609 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))
13611 e->expType->classObjectType = 0;
13616 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13618 if(destType->kind == 14)
13620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13622 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13624 unsigned int byReference = e->expType->byReference;
13625 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13626 struct Declarator * decl;
13627 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13628 char typeString[1024];
13629 struct Type * type;
13630 int backupClassObjectType;
13631 unsigned int backupByReference;
13633 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13637 backupClassObjectType = type->classObjectType;
13638 backupByReference = type->byReference;
13639 type->classObjectType = 0;
13640 type->byReference = 0x0;
13641 typeString[0] = '\0';
13642 PrintType(type, typeString, 0x0, 0x1);
13643 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13644 type->classObjectType = backupClassObjectType;
13645 type->byReference = backupByReference;
13647 thisExp->prev = (((void *)0));
13648 thisExp->next = (((void *)0));
13649 __ecereMethod_Expression_Clear(e);
13650 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)))
13654 e->op.exp1 = (((void *)0));
13655 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13656 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13657 CopyTypeInto(e->expType, type);
13658 e->expType->byReference = 0x0;
13659 e->expType->refCount = 1;
13664 e->cast.typeName = MkTypeName(specs, decl);
13665 e->cast.exp = thisExp;
13666 e->byReference = 0x1;
13670 e->destType = destType;
13671 destType->refCount++;
13676 extern char * strstr(const char * , const char * );
13678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13680 struct __ecereNameSpace__ecere__com__DefinedExpression
13682 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13683 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13686 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13687 } __attribute__ ((gcc_struct));
13689 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13691 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13693 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13695 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13697 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13699 extern struct Expression * CopyExpression(struct Expression * exp);
13701 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13703 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13705 static void ProcessStatement(struct Statement * stmt);
13707 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13709 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13711 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13713 extern char * sourceFile;
13715 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13717 void ProcessExpressionType(struct Expression * exp)
13719 unsigned int unresolved = 0x0;
13720 struct Location oldyylloc = yylloc;
13721 unsigned int notByReference = 0x0;
13723 if(!exp || exp->expType)
13730 struct Identifier * id = exp->identifier;
13732 if(!id || !topContext)
13734 if(id->_class && id->_class->name)
13736 id->classSym = id->_class->symbol;
13738 if(strstr(id->string, "__ecereClass") == id->string)
13740 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13743 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13745 ReplaceClassMembers(exp, thisClass);
13748 ProcessExpressionType(exp);
13751 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13756 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13760 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13766 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13769 ProcessExpressionType(exp);
13773 else if(currentClass && !id->_class)
13775 if(ResolveIdWithClass(exp, currentClass, 0x1))
13778 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13783 struct Type * type = symbol->type;
13784 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13786 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13788 struct Context * context = SetupTemplatesContext(_class);
13790 type = ReplaceThisClassType(_class);
13791 FinishTemplatesContext(context);
13793 type->refCount = 0;
13795 FreeSpecifier(id->_class);
13796 id->_class = (((void *)0));
13797 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13798 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13799 id->classSym = (((void *)0));
13800 exp->expType = type;
13803 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13804 exp->isConstant = 0x1;
13805 if(symbol->isParam || !strcmp(id->string, "this"))
13807 if(_class && _class->type == 1 && !type->declaredWithStruct)
13808 exp->byReference = 0x1;
13810 if(symbol->isIterator)
13812 if(symbol->isIterator == 3)
13815 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13816 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13817 exp->expType = (((void *)0));
13818 ProcessExpressionType(exp);
13820 else if(symbol->isIterator != 4)
13823 exp->member.exp = MkExpIdentifier(exp->identifier);
13824 exp->member.exp->expType = exp->expType;
13825 exp->member.member = MkIdentifier("data");
13826 exp->expType = (((void *)0));
13827 ProcessExpressionType(exp);
13834 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13836 if(thisNameSpace && !(id->_class && !id->_class->name))
13840 strcpy(name, thisNameSpace);
13841 strcat(name, "::");
13842 strcat(name, id->string);
13843 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13846 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13851 for(c = 0; c < definedExpStackPos; c++)
13852 if(definedExpStack[c] == definedExp)
13854 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13856 struct Location backupYylloc = yylloc;
13857 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13859 definedExpStack[definedExpStackPos++] = definedExp;
13860 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13861 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13862 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13864 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13865 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13866 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13867 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13869 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13870 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13872 parsedExpression = (((void *)0));
13874 expression_yyparse();
13875 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13877 fileInput = backInput;
13878 yylloc = backupYylloc;
13879 if(parsedExpression)
13881 FreeIdentifier(id);
13883 exp->list = MkListOne(parsedExpression);
13884 parsedExpression->loc = yylloc;
13885 ProcessExpressionType(exp);
13886 definedExpStackPos--;
13889 definedExpStackPos--;
13895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13901 struct GlobalData * data = (((void *)0));
13903 if(thisNameSpace && !(id->_class && !id->_class->name))
13907 strcpy(name, thisNameSpace);
13908 strcat(name, "::");
13909 strcat(name, id->string);
13910 data = FindGlobalData(name);
13913 data = FindGlobalData(id->string);
13916 DeclareGlobalData(data);
13917 exp->expType = data->dataType;
13919 data->dataType->refCount++;
13920 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13921 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13922 FreeSpecifier(id->_class);
13923 id->_class = (((void *)0));
13928 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13930 if(thisNameSpace && !(id->_class && !id->_class->name))
13934 strcpy(name, thisNameSpace);
13935 strcat(name, "::");
13936 strcat(name, id->string);
13937 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13940 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13945 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13946 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13948 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13949 strcpy(name, "__ecereFunction_");
13950 FullClassNameCat(name, id->string, 0x0);
13951 if(DeclareFunction(function, name))
13953 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13954 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13956 exp->expType = function->dataType;
13957 if(function->dataType)
13958 function->dataType->refCount++;
13959 FreeSpecifier(id->_class);
13960 id->_class = (((void *)0));
13972 struct __ecereNameSpace__ecere__com__Class * _class;
13974 if(!exp->instance->_class)
13976 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13978 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13981 ProcessInstantiationType(exp->instance);
13982 exp->isConstant = exp->instance->isConstant;
13983 if(exp->instance->_class)
13985 exp->expType = MkClassType(exp->instance->_class->name);
13993 char * constant = exp->constant;
13994 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13996 exp->expType = type;
13997 if(constant[0] == '\'')
13999 if((int)((unsigned char *)constant)[1] > 127)
14002 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14006 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14007 exp->constant = PrintUInt(ch);
14009 type->_class = FindClass("unichar");
14010 type->isSigned = 0x0;
14015 type->isSigned = 0x1;
14020 char * dot = strchr(constant, '.');
14021 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14026 exponent = strchr(constant, 'p');
14028 exponent = strchr(constant, 'P');
14032 exponent = strchr(constant, 'e');
14034 exponent = strchr(constant, 'E');
14036 if(dot || exponent)
14038 if(strchr(constant, 'f') || strchr(constant, 'F'))
14042 type->isSigned = 0x1;
14046 unsigned int isSigned = constant[0] == '-';
14047 long long i64 = strtoll(constant, (((void *)0)), 0);
14048 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14049 unsigned int is64Bit = 0x0;
14053 if(i64 < (((int)0x80000000)))
14058 if(ui64 > (((int)0x7fffffff)))
14060 if(ui64 > (0xffffffff))
14063 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14067 else if(constant[0] != '0' || !constant[1])
14070 type->kind = is64Bit ? 4 : 3;
14071 type->isSigned = isSigned;
14074 exp->isConstant = 0x1;
14075 if(exp->destType && exp->destType->kind == 7)
14077 else if(exp->destType && exp->destType->kind == 6)
14079 else if(exp->destType && exp->destType->kind == 4)
14086 exp->isConstant = 0x1;
14087 exp->expType = __extension__ ({
14088 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14090 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14091 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14093 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14094 }), __ecereInstance2;
14100 ProcessExpressionType(exp->_new.size);
14101 exp->expType = __extension__ ({
14102 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14104 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14106 DeclareType(exp->expType->type, 0x0, 0x0);
14110 ProcessExpressionType(exp->_renew.size);
14111 ProcessExpressionType(exp->_renew.exp);
14112 exp->expType = __extension__ ({
14113 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14115 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14117 DeclareType(exp->expType->type, 0x0, 0x0);
14121 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14122 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14123 unsigned int useDestType = 0x0, useSideType = 0x0;
14124 struct Location oldyylloc = yylloc;
14125 unsigned int useSideUnit = 0x0;
14126 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14168 if(exp->op.op != '*' || exp->op.exp1)
14175 if(exp->op.op == '&')
14177 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14179 struct Identifier * id = exp->op.exp2->identifier;
14180 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14182 if(symbol && symbol->isIterator == 2)
14185 exp->member.exp = exp->op.exp2;
14186 exp->member.member = MkIdentifier("key");
14187 exp->expType = (((void *)0));
14188 exp->op.exp2->expType = symbol->type;
14189 symbol->type->refCount++;
14190 ProcessExpressionType(exp);
14198 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))
14200 if(exp->op.exp1->destType)
14201 FreeType(exp->op.exp1->destType);
14202 exp->op.exp1->destType = exp->destType;
14204 exp->destType->refCount++;
14208 if(exp->op.exp1->destType)
14209 FreeType(exp->op.exp1->destType);
14210 exp->op.exp1->destType = dummy;
14213 if(exp->op.exp1->destType && exp->op.op != '=')
14214 exp->op.exp1->destType->count++;
14215 ProcessExpressionType(exp->op.exp1);
14216 if(exp->op.exp1->destType && exp->op.op != '=')
14217 exp->op.exp1->destType->count--;
14218 if(exp->op.exp1->destType == dummy)
14221 exp->op.exp1->destType = (((void *)0));
14223 type1 = exp->op.exp1->expType;
14227 char expString[10240];
14229 expString[0] = '\0';
14230 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14234 exp->op.exp2->destType = exp->op.exp1->expType;
14235 if(exp->op.exp1->expType)
14236 exp->op.exp1->expType->refCount++;
14240 exp->op.exp2->destType = exp->destType;
14242 exp->destType->refCount++;
14246 exp->expType = type1;
14251 PrintExpression(exp->op.exp2, expString);
14252 if(type1 && type1->kind == 13)
14254 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)
14255 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14256 else if(exp->op.op == '=')
14258 if(exp->op.exp2->destType)
14259 FreeType(exp->op.exp2->destType);
14260 exp->op.exp2->destType = type1;
14267 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)
14271 if(exp->op.exp2->destType)
14272 FreeType(exp->op.exp2->destType);
14273 exp->op.exp2->destType = type1;
14280 exp->expType = type1;
14282 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)))
14284 if(exp->op.exp2->destType)
14285 FreeType(exp->op.exp2->destType);
14286 exp->op.exp2->destType = exp->destType;
14288 exp->destType->refCount++;
14292 if(exp->op.exp2->destType)
14293 FreeType(exp->op.exp2->destType);
14294 exp->op.exp2->destType = dummy;
14297 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14299 FreeType(exp->op.exp2->destType);
14300 exp->op.exp2->destType = type1;
14303 if(exp->op.exp2->destType && exp->op.op != '=')
14304 exp->op.exp2->destType->count++;
14305 if(exp->op.op == SIZEOF)
14307 struct Expression * e = exp->op.exp2;
14309 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14311 if(e->type == 5 || e->type == 32 || e->type == 23)
14314 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14316 e = (*e->list).last;
14319 if(e->type == 11 && e->cast.exp)
14320 e->cast.exp->needCast = 0x1;
14322 ProcessExpressionType(exp->op.exp2);
14323 if(exp->op.exp2->destType && exp->op.op != '=')
14324 exp->op.exp2->destType->count--;
14325 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14327 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)
14329 if(exp->op.op != '=' && type1->type->kind == 0)
14330 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14332 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)))
14334 if(exp->op.op == ADD_ASSIGN)
14335 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14337 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))
14339 if(exp->op.op == ADD_ASSIGN)
14340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14342 else if(inCompiler)
14344 char type1String[1024];
14345 char type2String[1024];
14347 type1String[0] = '\0';
14348 type2String[0] = '\0';
14349 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14350 PrintType(type1, type2String, 0x0, 0x1);
14351 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14352 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14355 if(exp->op.exp2->destType == dummy)
14358 exp->op.exp2->destType = (((void *)0));
14360 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14362 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14363 type2->refCount = 1;
14364 CopyTypeInto(type2, exp->op.exp2->expType);
14365 type2->isSigned = 0x1;
14367 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14369 type2 = __extension__ ({
14370 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14372 __ecereInstance1->kind = 3, __ecereInstance1;
14374 type2->refCount = 1;
14375 type2->isSigned = 0x1;
14379 type2 = exp->op.exp2->expType;
14385 if(exp->op.op == SIZEOF)
14387 exp->expType = __extension__ ({
14388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14390 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14392 exp->isConstant = 0x1;
14394 else if(exp->op.op == '*' && !exp->op.exp1)
14396 exp->expType = Dereference(type2);
14397 if(type2 && type2->kind == 8)
14398 notByReference = 0x1;
14400 else if(exp->op.op == '&' && !exp->op.exp1)
14401 exp->expType = Reference(type2);
14408 if(exp->op.exp1->destType)
14409 FreeType(exp->op.exp1->destType);
14410 exp->op.exp1->destType = MkClassType("bool");
14411 exp->op.exp1->destType->truth = 0x1;
14412 if(!exp->op.exp1->expType)
14413 ProcessExpressionType(exp->op.exp1);
14415 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14416 FreeType(exp->op.exp1->expType);
14417 exp->op.exp1->expType = MkClassType("bool");
14418 exp->op.exp1->expType->truth = 0x1;
14422 if(exp->op.exp2->destType)
14423 FreeType(exp->op.exp2->destType);
14424 exp->op.exp2->destType = MkClassType("bool");
14425 exp->op.exp2->destType->truth = 0x1;
14426 if(!exp->op.exp2->expType)
14427 ProcessExpressionType(exp->op.exp2);
14429 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14430 FreeType(exp->op.exp2->expType);
14431 exp->op.exp2->expType = MkClassType("bool");
14432 exp->op.exp2->expType->truth = 0x1;
14435 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")))))
14437 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14439 if(exp->op.exp2->destType)
14440 FreeType(exp->op.exp2->destType);
14441 exp->op.exp2->destType = type1;
14443 if(exp->op.exp1->destType)
14444 FreeType(exp->op.exp1->destType);
14445 exp->op.exp1->destType = type2;
14447 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)
14448 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);
14449 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14451 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14455 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14457 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14458 ProcessExpressionType(exp->op.exp1);
14459 if(type2->kind != 13)
14461 ProcessExpressionType(classExp);
14462 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"))))))));
14463 if(!exp->op.exp2->expType)
14467 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14470 ProcessExpressionType(exp->op.exp2);
14474 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)))
14476 if(type1->kind != 8 && type1->type->kind == 0)
14477 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14478 exp->expType = type1;
14482 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)))
14484 if(type2->kind != 8 && type2->type->kind == 0)
14485 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14486 exp->expType = type2;
14490 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))
14492 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14496 unsigned int success = 0x0;
14498 if(type1->kind == 13 && type2->kind == 13)
14500 if(exp->op.op == '+')
14501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14502 else if(exp->op.op == '-')
14504 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14506 exp->expType = __extension__ ({
14507 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14509 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14512 if(type1->type->kind == 20)
14514 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14518 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14520 ProcessExpressionType(classExp);
14522 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")))))));
14523 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14531 if(!success && exp->op.exp1->type == 2)
14533 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14536 FreeType(exp->expType);
14537 exp->expType = exp->op.exp1->destType;
14538 if(exp->op.exp1->destType)
14539 exp->op.exp1->destType->refCount++;
14542 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14545 FreeType(exp->expType);
14546 exp->expType = exp->op.exp2->destType;
14547 if(exp->op.exp2->destType)
14548 exp->op.exp2->destType->refCount++;
14554 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14557 FreeType(exp->expType);
14558 exp->expType = exp->op.exp2->destType;
14559 if(exp->op.exp2->destType)
14560 exp->op.exp2->destType->refCount++;
14563 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14566 FreeType(exp->expType);
14567 exp->expType = exp->op.exp1->destType;
14568 if(exp->op.exp1->destType)
14569 exp->op.exp1->destType->refCount++;
14575 char expString1[10240];
14576 char expString2[10240];
14580 expString1[0] = '\0';
14581 expString2[0] = '\0';
14586 PrintExpression(exp->op.exp1, expString1);
14587 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14588 PrintExpression(exp->op.exp2, expString2);
14589 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14590 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14591 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14593 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14597 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14599 if(exp->op.exp1->destType)
14600 FreeType(exp->op.exp1->destType);
14601 exp->op.exp1->destType = type2->_class->registered->dataType;
14602 if(type2->_class->registered->dataType)
14603 type2->_class->registered->dataType->refCount++;
14604 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14605 exp->expType = type2;
14609 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14611 if(exp->op.exp2->destType)
14612 FreeType(exp->op.exp2->destType);
14613 exp->op.exp2->destType = type1->_class->registered->dataType;
14614 if(type1->_class->registered->dataType)
14615 type1->_class->registered->dataType->refCount++;
14616 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14617 exp->expType = type1;
14623 unsigned int valid = 0x0;
14625 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14627 if(exp->op.exp2->destType)
14628 FreeType(exp->op.exp2->destType);
14629 if(!type1->_class->registered->dataType)
14630 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14631 exp->op.exp2->destType = type1->_class->registered->dataType;
14632 exp->op.exp2->destType->refCount++;
14633 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14636 type2 = exp->op.exp2->destType;
14639 exp->expType = type2;
14642 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14644 if(exp->op.exp1->destType)
14645 FreeType(exp->op.exp1->destType);
14646 if(!type2->_class->registered->dataType)
14647 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14648 exp->op.exp1->destType = type2->_class->registered->dataType;
14649 exp->op.exp1->destType->refCount++;
14650 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14651 type1 = exp->op.exp1->destType;
14652 exp->expType = type1;
14655 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14657 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14659 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14662 FreeType(exp->expType);
14663 exp->expType = exp->op.exp1->expType;
14664 if(exp->op.exp2->expType)
14665 exp->op.exp1->expType->refCount++;
14669 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14671 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14674 FreeType(exp->expType);
14675 exp->expType = exp->op.exp2->expType;
14676 if(exp->op.exp2->expType)
14677 exp->op.exp2->expType->refCount++;
14684 if(exp->op.exp2->destType)
14685 FreeType(exp->op.exp2->destType);
14686 exp->op.exp2->destType = type1;
14688 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14691 FreeType(exp->expType);
14692 exp->expType = exp->op.exp2->destType;
14693 if(exp->op.exp2->destType)
14694 exp->op.exp2->destType->refCount++;
14696 else if(type1 && type2)
14698 char expString1[10240];
14699 char expString2[10240];
14700 char type1String[1024];
14701 char type2String[1024];
14703 expString1[0] = '\0';
14704 expString2[0] = '\0';
14705 type1String[0] = '\0';
14706 type2String[0] = '\0';
14709 PrintExpression(exp->op.exp1, expString1);
14710 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14711 PrintExpression(exp->op.exp2, expString2);
14712 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14713 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14714 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14716 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14717 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14719 exp->expType = exp->op.exp1->expType;
14720 if(exp->op.exp1->expType)
14721 exp->op.exp1->expType->refCount++;
14723 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14725 exp->expType = exp->op.exp2->expType;
14726 if(exp->op.exp2->expType)
14727 exp->op.exp2->expType->refCount++;
14734 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14736 struct Type * oldType = exp->op.exp1->expType;
14738 exp->op.exp1->expType = (((void *)0));
14739 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14742 exp->op.exp1->expType = oldType;
14744 if(exp->op.exp1->destType)
14745 FreeType(exp->op.exp1->destType);
14746 exp->op.exp1->destType = type2;
14748 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14751 FreeType(exp->expType);
14752 exp->expType = exp->op.exp1->destType;
14753 if(exp->op.exp1->destType)
14754 exp->op.exp1->destType->refCount++;
14758 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14760 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14762 if(exp->op.exp1->destType)
14763 FreeType(exp->op.exp1->destType);
14764 exp->op.exp1->destType = type2->_class->registered->dataType;
14765 if(type2->_class->registered->dataType)
14766 type2->_class->registered->dataType->refCount++;
14767 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14769 if(exp->op.op == '!')
14771 exp->expType = MkClassType("bool");
14772 exp->expType->truth = 0x1;
14776 exp->expType = type2;
14781 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14783 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14785 if(exp->op.exp2->destType)
14786 FreeType(exp->op.exp2->destType);
14787 exp->op.exp2->destType = type1->_class->registered->dataType;
14788 if(type1->_class->registered->dataType)
14789 type1->_class->registered->dataType->refCount++;
14790 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14792 exp->expType = type1;
14798 if(exp->op.exp1 && !exp->op.exp1->expType)
14800 char expString[10000];
14802 expString[0] = '\0';
14805 PrintExpression(exp->op.exp1, expString);
14806 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14809 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14811 if(exp->op.exp2 && !exp->op.exp2->expType)
14813 char expString[10240];
14815 expString[0] = '\0';
14818 PrintExpression(exp->op.exp2, expString);
14819 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14826 FreeType(exp->expType);
14827 exp->expType = MkClassType("bool");
14828 exp->expType->truth = 0x1;
14830 if(exp->op.op != SIZEOF)
14831 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14832 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14834 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14836 yylloc = oldyylloc;
14845 struct Expression * e;
14847 exp->isConstant = 0x1;
14848 for(e = (*exp->list).first; e; e = e->next)
14850 unsigned int inced = 0x0;
14854 FreeType(e->destType);
14855 e->destType = exp->destType;
14858 exp->destType->refCount++;
14859 e->destType->count++;
14863 ProcessExpressionType(e);
14865 exp->destType->count--;
14866 if(!exp->expType && !e->next)
14868 exp->expType = e->expType;
14870 e->expType->refCount++;
14873 exp->isConstant = 0x0;
14875 e = (*exp->list).first;
14876 if(!e->next && e->type == 8)
14878 struct Expression * next = exp->next, * prev = exp->prev;
14880 FreeType(exp->expType);
14881 FreeType(exp->destType);
14882 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14886 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14887 ProcessExpressionType(exp);
14893 struct Expression * e;
14895 exp->isConstant = 0x1;
14896 ProcessExpressionType(exp->index.exp);
14897 if(!exp->index.exp->isConstant)
14898 exp->isConstant = 0x0;
14899 if(exp->index.exp->expType)
14901 struct Type * source = exp->index.exp->expType;
14903 if(source->kind == 8 && source->_class && source->_class->registered)
14905 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14906 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14908 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14910 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14911 if(exp->index.index && (*exp->index.index).last)
14913 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14918 for(e = (*exp->index.index).first; e; e = e->next)
14920 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14923 FreeType(e->destType);
14924 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14926 ProcessExpressionType(e);
14931 exp->isConstant = 0x0;
14934 exp->expType = Dereference(exp->index.exp->expType);
14936 DeclareType(exp->expType, 0x0, 0x0);
14941 struct Expression * e;
14942 struct Type * functionType;
14943 struct Type * methodType = (((void *)0));
14949 PrintExpression(exp->call.exp, name);
14950 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14952 PrintExpression(exp->call.exp, name);
14955 if(exp->call.exp->type == 0)
14957 struct Expression * idExp = exp->call.exp;
14958 struct Identifier * id = idExp->identifier;
14960 if(!strcmp(id->string, "__builtin_frame_address"))
14962 exp->expType = ProcessTypeString("void *", 0x1);
14963 if(exp->call.arguments && (*exp->call.arguments).first)
14964 ProcessExpressionType((*exp->call.arguments).first);
14967 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14969 exp->expType = ProcessTypeString("int", 0x1);
14970 if(exp->call.arguments && (*exp->call.arguments).first)
14971 ProcessExpressionType((*exp->call.arguments).first);
14974 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14976 struct Expression * a = (((void *)0));
14977 struct Expression * b = (((void *)0));
14978 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14980 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14982 a = (*exp->call.arguments).first;
14983 b = (*exp->call.arguments).last;
14987 else if((*exp->call.arguments).count == 1)
14989 a = (*exp->call.arguments).first;
14994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14995 idExp->identifier = (((void *)0));
14996 FreeExpContents(exp);
14997 ProcessExpressionType(a);
14999 ProcessExpressionType(b);
15001 exp->list = MkList();
15002 if(a->expType && (!b || b->expType))
15004 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15008 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15009 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15010 struct Declaration * decl;
15011 char temp1[1024], temp2[1024];
15013 GetTypeSpecs(a->expType, specs);
15014 if(a && !a->isConstant && a->type != 0)
15016 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15017 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15018 tempExp1 = QMkExpId(temp1);
15019 tempExp1->expType = a->expType;
15021 a->expType->refCount++;
15022 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15024 if(b && !b->isConstant && b->type != 0)
15026 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15027 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15028 tempExp2 = QMkExpId(temp2);
15029 tempExp2->expType = b->expType;
15031 b->expType->refCount++;
15032 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15034 decl = MkDeclaration(specs, decls);
15035 if(!curCompound->compound.declarations)
15036 curCompound->compound.declarations = MkList();
15037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15041 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15043 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15045 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15046 exp->expType = a->expType;
15048 a->expType->refCount++;
15050 else if(!strcmp(id->string, "Abs"))
15052 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15053 exp->expType = a->expType;
15055 a->expType->refCount++;
15057 else if(!strcmp(id->string, "Sgn"))
15059 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"))))));
15060 exp->expType = ProcessTypeString("int", 0x0);
15062 FreeExpression(tempExp1);
15064 FreeExpression(tempExp2);
15065 FreeIdentifier(id);
15071 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15073 if(!exp->call.exp->destType)
15075 exp->call.exp->destType = dummy;
15078 ProcessExpressionType(exp->call.exp);
15079 if(exp->call.exp->destType == dummy)
15082 exp->call.exp->destType = (((void *)0));
15086 functionType = exp->call.exp->expType;
15087 if(functionType && functionType->kind == 16)
15089 methodType = functionType;
15090 functionType = methodType->method->dataType;
15091 if(exp->call.exp->expType->usedClass)
15093 char typeString[1024];
15095 typeString[0] = '\0';
15097 struct Symbol * back = functionType->thisClass;
15099 functionType->thisClass = (((void *)0));
15100 PrintType(functionType, typeString, 0x1, 0x1);
15101 functionType->thisClass = back;
15103 if(strstr(typeString, "thisclass"))
15105 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15106 struct Declarator * decl;
15109 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15111 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15112 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15113 thisClassParams = 0x0;
15114 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15116 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15118 thisClass = exp->call.exp->expType->usedClass;
15119 ProcessDeclarator(decl);
15120 thisClass = backupThisClass;
15122 thisClassParams = 0x1;
15123 functionType = ProcessType(specs, decl);
15124 functionType->refCount = 0;
15125 FinishTemplatesContext(context);
15127 FreeList(specs, FreeSpecifier);
15128 FreeDeclarator(decl);
15132 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15134 struct Type * type = functionType->type;
15136 if(!functionType->refCount)
15138 functionType->type = (((void *)0));
15139 FreeType(functionType);
15141 functionType = type;
15143 if(functionType && functionType->kind != 11)
15145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15147 else if(functionType)
15149 unsigned int emptyParams = 0x0, noParams = 0x0;
15150 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15151 struct Type * type = functionType->params.first;
15152 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15154 struct Location oldyylloc = yylloc;
15158 if(functionType->extraParam && e && functionType->thisClass)
15160 e->destType = MkClassType(functionType->thisClass->string);
15163 if(!functionType->staticMethod && !functionType->extraParam)
15165 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15167 type = MkClassType(memberExp->member.exp->expType->_class->string);
15170 e->destType = type;
15172 type = functionType->params.first;
15175 type->refCount = 0;
15177 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15179 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15180 type->byReference = functionType->byReference;
15181 type->typedByReference = functionType->typedByReference;
15184 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15186 e->destType = type;
15188 type = functionType->params.first;
15191 type->refCount = 0;
15194 if(type && type->kind == 0)
15197 if(!type->refCount)
15199 type = (((void *)0));
15201 for(; e; e = e->next)
15203 if(!type && !emptyParams)
15206 if(methodType && methodType->methodClass)
15207 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);
15209 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);
15212 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15214 struct Type * templatedType = (((void *)0));
15215 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15216 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15219 if(_class && _class->templateArgs)
15221 struct __ecereNameSpace__ecere__com__Class * sClass;
15223 for(sClass = _class; sClass; sClass = sClass->base)
15225 if(sClass->templateClass)
15226 sClass = sClass->templateClass;
15228 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15230 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15232 struct __ecereNameSpace__ecere__com__Class * nextClass;
15234 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15236 if(nextClass->templateClass)
15237 nextClass = nextClass->templateClass;
15238 id += nextClass->templateParams.count;
15248 if(curParam && _class->templateArgs[id].dataTypeString)
15250 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15253 struct Context * context = SetupTemplatesContext(_class);
15255 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15256 FinishTemplatesContext(context);
15258 e->destType = templatedType;
15261 templatedType->passAsTemplate = 0x1;
15266 e->destType = type;
15273 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15275 e->destType = type->prev;
15276 e->destType->refCount++;
15280 e->destType = type;
15285 if(type && type->kind != 14)
15287 struct Type * next = type->next;
15289 if(!type->refCount)
15294 if(type && type->kind != 14)
15296 if(methodType && methodType->methodClass)
15297 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);
15299 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);
15301 yylloc = oldyylloc;
15302 if(type && !type->refCount)
15307 functionType = __extension__ ({
15308 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15310 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15312 if(exp->call.exp->type == 0)
15314 char * string = exp->call.exp->identifier->string;
15318 struct Symbol * symbol;
15319 struct Location oldyylloc = yylloc;
15321 yylloc = exp->call.exp->identifier->loc;
15322 if(strstr(string, "__builtin_") == string)
15326 functionType->returnType = exp->destType;
15327 exp->destType->refCount++;
15331 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15332 symbol = __extension__ ({
15333 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15335 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15337 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15338 if(strstr(symbol->string, "::"))
15339 globalContext->hasNameSpace = 0x1;
15340 yylloc = oldyylloc;
15343 else if(exp->call.exp->type == 8)
15347 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15348 if(!functionType->returnType)
15350 functionType->returnType = __extension__ ({
15351 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15353 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15357 if(functionType && functionType->kind == 11)
15359 exp->expType = functionType->returnType;
15360 if(functionType->returnType)
15361 functionType->returnType->refCount++;
15362 if(!functionType->refCount)
15363 FreeType(functionType);
15365 if(exp->call.arguments)
15367 for(e = (*exp->call.arguments).first; e; e = e->next)
15369 struct Type * destType = e->destType;
15371 ProcessExpressionType(e);
15378 struct Type * type;
15379 struct Location oldyylloc = yylloc;
15380 unsigned int thisPtr;
15381 struct Expression * checkExp = exp->member.exp;
15385 if(checkExp->type == 11)
15386 checkExp = checkExp->cast.exp;
15387 else if(checkExp->type == 5)
15388 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15392 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15393 exp->thisPtr = thisPtr;
15394 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15396 exp->member.member->classSym = exp->member.member->_class->symbol;
15398 ProcessExpressionType(exp->member.exp);
15399 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)
15401 exp->isConstant = 0x0;
15404 exp->isConstant = exp->member.exp->isConstant;
15405 type = exp->member.exp->expType;
15407 if(type && (type->kind == 20))
15409 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15410 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15414 for(param = _class->templateParams.first; param; param = param->next)
15416 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15420 if(param && param->defaultArg.member)
15422 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15426 struct Expression * expMember = exp->member.exp;
15427 struct Declarator * decl;
15428 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15429 char thisClassTypeString[1024];
15431 FreeIdentifier(exp->member.member);
15432 ProcessExpressionType(argExp);
15434 char * colon = strstr(param->defaultArg.memberString, "::");
15438 char className[1024];
15439 struct __ecereNameSpace__ecere__com__Class * sClass;
15441 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15442 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15445 strcpy(thisClassTypeString, _class->fullName);
15447 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15448 exp->expType = ProcessType(specs, decl);
15449 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15451 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15452 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15454 int paramCount = 0;
15455 int lastParam = -1;
15456 char templateString[1024];
15457 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15459 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15460 for(cClass = expClass; cClass; cClass = cClass->base)
15464 for(param = cClass->templateParams.first; param; param = param->next)
15467 struct __ecereNameSpace__ecere__com__Class * sClass;
15468 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15470 for(sClass = cClass->base; sClass; sClass = sClass->base)
15471 id += sClass->templateParams.count;
15472 arg = expClass->templateArgs[id];
15473 for(sClass = _class; sClass; sClass = sClass->base)
15475 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15477 struct __ecereNameSpace__ecere__com__Class * nextClass;
15479 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15480 p += nextClass->templateParams.count;
15481 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15483 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15485 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15487 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15488 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15495 char argument[256];
15497 argument[0] = '\0';
15498 switch(param->type)
15502 char expString[1024];
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15505 struct Expression * exp;
15506 char * string = PrintHexUInt64(arg.expression.ui64);
15508 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15509 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15510 ProcessExpressionType(exp);
15511 ComputeExpression(exp);
15512 expString[0] = '\0';
15513 PrintExpression(exp, expString);
15514 strcat(argument, expString);
15515 FreeExpression(exp);
15520 strcat(argument, arg.member->name);
15525 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15527 if(!strcmp(arg.dataTypeString, "thisclass"))
15528 strcat(argument, thisClassTypeString);
15530 strcat(argument, arg.dataTypeString);
15538 strcat(templateString, ", ");
15539 if(lastParam != p - 1)
15541 strcat(templateString, param->name);
15542 strcat(templateString, " = ");
15544 strcat(templateString, argument);
15553 int len = strlen(templateString);
15555 if(templateString[len - 1] == '>')
15556 templateString[len++] = ' ';
15557 templateString[len++] = '>';
15558 templateString[len++] = '\0';
15561 struct Context * context = SetupTemplatesContext(_class);
15563 FreeType(exp->expType);
15564 exp->expType = ProcessTypeString(templateString, 0x0);
15565 FinishTemplatesContext(context);
15569 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")))))))));
15572 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15574 type = ProcessTemplateParameterType(type->templateParameter);
15577 if(type && (type->kind == 20))
15579 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)))
15581 struct Identifier * id = exp->member.member;
15582 int typeKind = type->kind;
15583 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));
15585 if(typeKind == 19 && exp->member.exp->type == 24)
15587 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15592 if(typeKind == 3 || typeKind == 15)
15593 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15596 if(type->kind == 8 && type->_class && type->_class->registered)
15598 _class = type->_class->registered;
15600 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15602 _class = FindClass("char *")->registered;
15604 else if(type->kind == 13)
15606 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15607 FreeType(exp->expType);
15608 exp->expType = ProcessTypeString("uintptr", 0x0);
15609 exp->byReference = 0x1;
15613 char string[1024] = "";
15614 struct Symbol * classSym;
15616 PrintTypeNoConst(type, string, 0x0, 0x1);
15617 classSym = FindClass(string);
15619 _class = classSym->registered;
15625 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15626 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15627 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15628 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15629 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15631 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15632 exp->member.memberType = 1;
15633 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15637 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15639 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15640 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15642 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15644 member = (((void *)0));
15646 if(!member && !prop)
15647 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15648 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15649 exp->member.thisPtr = 0x1;
15655 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15656 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15657 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15659 if(!prop && !member)
15661 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15664 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15665 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15666 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15671 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15672 prop = (((void *)0));
15674 member = (((void *)0));
15678 if(!prop && !member && !method)
15679 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15680 if(!prop && !member && !method)
15684 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15687 exp->member.memberType = 5;
15688 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15692 char structName[1024];
15693 struct Identifier * id = exp->member.member;
15694 struct Expression * classExp = exp->member.exp;
15697 FreeType(classExp->expType);
15698 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15699 strcpy(structName, "__ecereClassData_");
15700 FullClassNameCat(structName, type->_class->string, 0x0);
15702 exp->member.member = id;
15703 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"))))))));
15705 ProcessExpressionType(exp);
15711 struct Symbol * classSym = FindClass(id->string);
15715 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15718 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15724 exp->member.memberType = 1;
15725 if(!prop->dataType)
15726 ProcessPropertyType(prop);
15727 exp->expType = prop->dataType;
15729 prop->dataType->refCount++;
15733 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15735 FreeExpContents(exp);
15737 exp->identifier = MkIdentifier("class");
15738 ProcessExpressionType(exp);
15741 exp->member.memberType = 3;
15742 DeclareStruct(_class->fullName, 0x0);
15743 if(!member->dataType)
15745 struct Context * context = SetupTemplatesContext(_class);
15747 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15748 FinishTemplatesContext(context);
15750 exp->expType = member->dataType;
15751 if(member->dataType)
15752 member->dataType->refCount++;
15754 else if(revConvert)
15756 exp->member.memberType = 4;
15757 exp->expType = MkClassType(revConvert->_class->fullName);
15762 exp->member.memberType = 2;
15764 if(!method->dataType)
15765 ProcessMethodType(method);
15766 exp->expType = __extension__ ({
15767 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15769 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15771 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15772 exp->expType->usedClass = _class;
15774 else if(!classProp)
15776 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15778 FreeExpContents(exp);
15780 exp->identifier = MkIdentifier("class");
15781 FreeType(exp->expType);
15782 exp->expType = MkClassType("ecere::com::Class");
15785 yylloc = exp->member.member->loc;
15786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15788 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15790 if(_class && exp->expType)
15792 struct __ecereNameSpace__ecere__com__Class * tClass;
15795 while(tClass && !tClass->templateClass)
15796 tClass = tClass->base;
15797 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15800 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15801 struct __ecereNameSpace__ecere__com__Class * sClass;
15803 for(sClass = tClass; sClass; sClass = sClass->base)
15806 if(sClass->templateClass)
15807 sClass = sClass->templateClass;
15808 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15810 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15812 for(sClass = sClass->base; sClass; sClass = sClass->base)
15813 id += sClass->templateParams.count;
15821 if(curParam && tClass->templateArgs[id].dataTypeString)
15823 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15824 struct Context * context = SetupTemplatesContext(tClass);
15826 FreeType(exp->expType);
15827 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15830 if(exp->expType->kind == 21)
15832 FreeType(exp->expType);
15833 exp->expType = ReplaceThisClassType(_class);
15835 if(tClass->templateClass)
15836 exp->expType->passAsTemplate = 0x1;
15839 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15840 if(exp->destType->kind == 21)
15842 FreeType(exp->destType);
15843 exp->destType = ReplaceThisClassType(_class);
15847 FinishTemplatesContext(context);
15850 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15853 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15854 struct __ecereNameSpace__ecere__com__Class * sClass;
15856 for(sClass = tClass; sClass; sClass = sClass->base)
15859 if(sClass->templateClass)
15860 sClass = sClass->templateClass;
15861 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15863 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15865 for(sClass = sClass->base; sClass; sClass = sClass->base)
15866 id += sClass->templateParams.count;
15876 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15877 struct Context * context = SetupTemplatesContext(tClass);
15878 struct Type * basicType;
15880 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15883 if(basicType->kind == 21)
15885 FreeType(basicType);
15886 basicType = ReplaceThisClassType(_class);
15888 FreeType(exp->expType);
15889 exp->expType = __extension__ ({
15890 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15892 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15896 exp->destType = exp->expType;
15897 exp->destType->refCount++;
15900 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15901 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15902 struct Declarator * decl;
15904 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15907 exp->destType->refCount++;
15909 exp->expType->refCount++;
15911 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15912 exp->cast.exp = newExp;
15915 FinishTemplatesContext(context);
15918 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15920 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15924 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15927 int paramCount = 0;
15928 int lastParam = -1;
15929 char templateString[1024];
15930 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15932 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15933 while(cClass != expClass)
15935 struct __ecereNameSpace__ecere__com__Class * sClass;
15937 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15940 for(param = cClass->templateParams.first; param; param = param->next)
15942 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15945 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15946 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15948 while(cClassCur != tClass && !paramCur)
15950 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15952 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15954 cClassCur = sClassCur;
15955 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15957 if(!strcmp(paramCur->name, param->name))
15964 if(paramCur && paramCur->type == 0)
15965 arg = tClass->templateArgs[cp];
15967 arg = expClass->templateArgs[p];
15969 char argument[256];
15971 argument[0] = '\0';
15972 switch(param->type)
15976 char expString[1024];
15977 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15978 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15979 struct Expression * exp;
15980 char * string = PrintHexUInt64(arg.expression.ui64);
15982 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15983 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15984 ProcessExpressionType(exp);
15985 ComputeExpression(exp);
15986 expString[0] = '\0';
15987 PrintExpression(exp, expString);
15988 strcat(argument, expString);
15989 FreeExpression(exp);
15994 strcat(argument, arg.member->name);
15999 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16000 strcat(argument, arg.dataTypeString);
16007 strcat(templateString, ", ");
16008 if(lastParam != p - 1)
16010 strcat(templateString, param->name);
16011 strcat(templateString, " = ");
16013 strcat(templateString, argument);
16022 int len = strlen(templateString);
16024 if(templateString[len - 1] == '>')
16025 templateString[len++] = ' ';
16026 templateString[len++] = '>';
16027 templateString[len++] = '\0';
16029 FreeType(exp->expType);
16031 struct Context * context = SetupTemplatesContext(tClass);
16033 exp->expType = ProcessTypeString(templateString, 0x0);
16034 FinishTemplatesContext(context);
16041 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)");
16043 else if(type && (type->kind == 9 || type->kind == 10))
16045 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16049 exp->expType = memberType;
16051 memberType->refCount++;
16056 char expString[10240];
16058 expString[0] = '\0';
16061 PrintExpression(exp, expString);
16062 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16066 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16068 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16070 struct Identifier * id = exp->member.member;
16071 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));
16075 FreeType(exp->expType);
16076 exp->expType = ReplaceThisClassType(_class);
16080 yylloc = oldyylloc;
16085 struct Type * destType = exp->destType;
16087 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16089 exp->member.member->classSym = exp->member.member->_class->symbol;
16091 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16095 ProcessExpressionType(exp);
16102 struct Symbol * classSym = exp->_class->symbol;
16104 if(classSym && classSym->registered)
16106 if(classSym->registered->type == 5)
16111 DeclareStruct(classSym->string, 0x0);
16112 FreeSpecifier(exp->_class);
16114 FullClassNameCat(name, classSym->string, 0x0);
16115 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16119 if(classSym->registered->fixed)
16121 FreeSpecifier(exp->_class);
16122 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16127 char className[1024];
16129 strcpy(className, "__ecereClass_");
16130 FullClassNameCat(className, classSym->string, 0x1);
16131 MangleClassName(className);
16132 DeclareClass(classSym, className);
16133 FreeExpContents(exp);
16135 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16136 exp->member.member = MkIdentifier("structSize");
16140 exp->expType = __extension__ ({
16141 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16143 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16149 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16151 exp->expType = __extension__ ({
16152 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16154 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16156 exp->isConstant = 0x1;
16157 DeclareType(type, 0x0, 0x0);
16163 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16166 FreeType(exp->cast.exp->destType);
16167 exp->cast.exp->destType = type;
16169 ProcessExpressionType(exp->cast.exp);
16171 exp->expType = type;
16172 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16174 void * prev = exp->prev, * next = exp->next;
16175 struct Type * expType = exp->cast.exp->destType;
16176 struct Expression * castExp = exp->cast.exp;
16177 struct Type * destType = exp->destType;
16180 expType->refCount++;
16181 FreeType(exp->expType);
16182 FreeTypeName(exp->cast.typeName);
16184 FreeType(exp->expType);
16185 FreeType(exp->destType);
16186 exp->expType = expType;
16187 exp->destType = destType;
16188 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16194 exp->isConstant = exp->cast.exp->isConstant;
16200 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16202 exp->expType = type;
16207 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16209 ProcessExpressionType(exp->vaArg.exp);
16210 exp->expType = type;
16215 struct Expression * e;
16217 exp->isConstant = 0x1;
16218 FreeType(exp->cond.cond->destType);
16219 exp->cond.cond->destType = MkClassType("bool");
16220 exp->cond.cond->destType->truth = 0x1;
16221 ProcessExpressionType(exp->cond.cond);
16222 if(!exp->cond.cond->isConstant)
16223 exp->isConstant = 0x0;
16224 for(e = (*exp->cond.exp).first; e; e = e->next)
16228 FreeType(e->destType);
16229 e->destType = exp->destType;
16231 e->destType->refCount++;
16233 ProcessExpressionType(e);
16236 exp->expType = e->expType;
16238 e->expType->refCount++;
16241 exp->isConstant = 0x0;
16243 FreeType(exp->cond.elseExp->destType);
16244 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16245 if(exp->cond.elseExp->destType)
16246 exp->cond.elseExp->destType->refCount++;
16247 ProcessExpressionType(exp->cond.elseExp);
16248 if(!exp->cond.elseExp->isConstant)
16249 exp->isConstant = 0x0;
16254 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16256 struct Statement * last = (*exp->compound->compound.statements).last;
16258 if(last->type == 3 && last->expressions && (*last->expressions).last)
16260 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16262 exp->destType->refCount++;
16264 ProcessStatement(exp->compound);
16265 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16267 exp->expType->refCount++;
16273 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16275 if(spec && spec->type == 1)
16277 exp->expType = MkClassType(spec->name);
16278 exp->expType->kind = 19;
16279 exp->byReference = 0x1;
16283 exp->expType = MkClassType("ecere::com::Class");
16284 exp->byReference = 0x1;
16290 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16294 struct Identifier * id = exp->classData.id;
16295 char structName[1024];
16296 struct Expression * classExp;
16298 strcpy(structName, "__ecereClassData_");
16299 FullClassNameCat(structName, _class->fullName, 0x0);
16301 exp->member.member = id;
16302 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16303 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16305 classExp = MkExpIdentifier(MkIdentifier("class"));
16306 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"))))))));
16307 ProcessExpressionType(exp);
16314 struct Type * type = (((void *)0));
16315 char * typeString = (((void *)0));
16316 char typeStringBuf[1024];
16318 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))
16320 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16322 typeString = templateClass->templateArgs[2].dataTypeString;
16326 struct Expression * e;
16328 for(e = (*exp->list).first; e; e = e->next)
16330 ProcessExpressionType(e);
16340 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16344 e->expType = (((void *)0));
16345 e = (*exp->list).first;
16346 ProcessExpressionType(e);
16349 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16351 FreeType(e->expType);
16352 e->expType = (((void *)0));
16354 type = (((void *)0));
16362 FreeType(e->expType);
16363 e->expType = (((void *)0));
16369 typeStringBuf[0] = '\0';
16370 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16371 typeString = typeStringBuf;
16373 type = (((void *)0));
16378 char templateString[1024];
16379 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16380 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16381 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16382 struct Expression * expExt;
16383 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16385 sprintf(templateString, "Container<%s>", typeString);
16388 struct Expression * e;
16390 type = ProcessTypeString(typeString, 0x0);
16391 while(e = (*exp->list).first)
16393 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16394 e->destType = type;
16396 ProcessExpressionType(e);
16397 ListAdd(initializers, MkInitializerAssignment(e));
16400 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16402 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16403 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16404 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16405 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16406 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16407 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16408 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16409 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16410 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16411 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16412 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16414 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16416 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16417 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16418 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16419 exp->expType = ProcessTypeString(templateString, 0x0);
16421 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16422 ProcessExpressionType(expExt);
16426 exp->expType = ProcessTypeString("Container", 0x0);
16427 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16432 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16434 FreeType(exp->expType);
16435 exp->expType = ReplaceThisClassType(thisClass);
16437 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16439 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16443 if(exp->expType->kind != 15)
16445 struct Type * member;
16446 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16448 FreeType(exp->expType);
16449 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16450 exp->expType->kind = symbol->type->kind;
16451 exp->expType->refCount++;
16452 exp->expType->enumName = enumName;
16453 exp->expType->members = symbol->type->members;
16454 for(member = symbol->type->members.first; member; member = member->next)
16455 member->refCount++;
16459 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16461 for(member = symbol->type->members.first; member; member = member->next)
16463 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16471 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16473 else if(exp->destType && !exp->destType->keepCast)
16475 if(!CheckExpressionType(exp, exp->destType, 0x0))
16477 if(!exp->destType->count || unresolved)
16482 if(exp->destType->kind != 14)
16489 char expString[10240];
16491 expString[0] = '\0';
16492 PrintType(exp->destType, type2, 0x0, 0x1);
16495 PrintExpression(exp, expString);
16496 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16500 else if(exp->type != 16)
16501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16506 char expString[10240];
16508 expString[0] = '\0';
16511 PrintExpression(exp, expString);
16512 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16516 else if(exp->type != 16)
16517 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16529 PrintType(exp->expType, type1, 0x0, 0x1);
16530 PrintType(exp->destType, type2, 0x0, 0x1);
16532 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)))
16536 char expString[10240];
16538 expString[0] = '\0';
16541 PrintExpression(exp, expString);
16542 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16544 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16545 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16546 FreeType(exp->expType);
16547 exp->destType->refCount++;
16548 exp->expType = exp->destType;
16553 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16555 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16556 char typeString[1024];
16557 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16558 struct Declarator * decl;
16560 typeString[0] = '\0';
16563 exp->expType->refCount++;
16565 exp->expType->refCount++;
16567 newExp->destType = exp->expType;
16568 PrintType(exp->expType, typeString, 0x0, 0x0);
16569 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16570 exp->cast.typeName = MkTypeName(specs, decl);
16571 exp->cast.exp = newExp;
16574 else if(unresolved)
16576 if(exp->identifier->_class && exp->identifier->_class->name)
16577 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16578 else if(exp->identifier->string && exp->identifier->string[0])
16579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16581 else if(!exp->expType && exp->type != 16)
16583 char expString[10240];
16585 expString[0] = '\0';
16588 PrintExpression(exp, expString);
16589 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16594 ApplyAnyObjectLogic(exp);
16595 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)))
16597 exp->byReference = 0x1;
16599 yylloc = oldyylloc;
16602 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)
16606 *curMember = (*curMember)->next;
16607 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16609 *curMember = subMemberStack[--(*subMemberStackPos)];
16610 *curMember = (*curMember)->next;
16612 while((*curMember) && (*curMember)->isProperty)
16613 *curMember = (*curMember)->next;
16614 if(subMemberStackPos)
16616 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16618 subMemberStack[(*subMemberStackPos)++] = *curMember;
16619 *curMember = (*curMember)->members.first;
16620 while(*curMember && (*curMember)->isProperty)
16621 *curMember = (*curMember)->next;
16629 if(subMemberStackPos && *subMemberStackPos)
16631 *curMember = subMemberStack[--(*subMemberStackPos)];
16632 *curMember = (*curMember)->next;
16636 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16638 if(*curClass == _class)
16640 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16642 *curMember = (*curClass)->membersAndProperties.first;
16644 while((*curMember) && (*curMember)->isProperty)
16645 *curMember = (*curMember)->next;
16646 if(subMemberStackPos)
16648 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16650 subMemberStack[(*subMemberStackPos)++] = *curMember;
16651 *curMember = (*curMember)->members.first;
16652 while(*curMember && (*curMember)->isProperty)
16653 *curMember = (*curMember)->next;
16660 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16665 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16667 if(init->exp && !init->exp->destType)
16669 FreeType(init->exp->destType);
16670 init->exp->destType = type;
16676 ProcessExpressionType(init->exp);
16677 init->isConstant = init->exp->isConstant;
16683 struct Expression * exp = init->exp;
16684 struct Instantiation * inst = exp->instance;
16685 struct MembersInit * members;
16688 init->list = MkList();
16691 for(members = (*inst->members).first; members; members = members->next)
16693 if(members->type == 0)
16695 struct MemberInit * member;
16697 for(member = (*members->dataMembers).first; member; member = member->next)
16699 ListAdd(init->list, member->initializer);
16700 member->initializer = (((void *)0));
16705 FreeExpression(exp);
16709 struct Initializer * i;
16710 struct Type * initializerType = (((void *)0));
16711 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16712 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16713 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16714 int subMemberStackPos = 0;
16716 if(type && type->kind == 12)
16717 initializerType = Dereference(type);
16718 else if(type && (type->kind == 9 || type->kind == 10))
16719 initializerType = type->members.first;
16720 for(i = (*init->list).first; i; i = i->next)
16722 if(type && type->kind == 8 && type->_class && type->_class->registered)
16724 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16727 if(!curMember->dataType)
16728 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16729 initializerType = curMember->dataType;
16732 ProcessInitializer(i, initializerType);
16733 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16734 initializerType = initializerType->next;
16736 init->isConstant = 0x0;
16738 if(type && type->kind == 12)
16739 FreeType(initializerType);
16740 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16749 extern struct Symbol * FindType(struct Context * ctx, char * name);
16751 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16753 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16759 if(spec->specifier == THISCLASS)
16764 spec->name = ReplaceThisClass(thisClass);
16765 spec->symbol = FindClass(spec->name);
16766 ProcessSpecifier(spec, declareStruct);
16773 struct Symbol * symbol = FindType(curContext, spec->name);
16776 DeclareType(symbol->type, 0x1, 0x1);
16777 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16778 DeclareStruct(spec->name, 0x0);
16783 struct Enumerator * e;
16787 for(e = (*spec->list).first; e; e = e->next)
16790 ProcessExpressionType(e->exp);
16798 if(spec->definitions)
16800 struct ClassDef * def;
16801 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16803 ProcessClass(spec->definitions, symbol);
16810 static void ProcessDeclarator(struct Declarator * decl)
16815 if(decl->identifier->classSym)
16817 FreeSpecifier(decl->identifier->_class);
16818 decl->identifier->_class = (((void *)0));
16822 if(decl->array.exp)
16823 ProcessExpressionType(decl->array.exp);
16830 if(decl->declarator)
16831 ProcessDeclarator(decl->declarator);
16832 if(decl->type == 4)
16834 struct Identifier * id = GetDeclId(decl);
16836 if(id && id->_class)
16838 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16840 if(!decl->function.parameters)
16841 decl->function.parameters = MkList();
16842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16843 id->_class = (((void *)0));
16845 if(decl->function.parameters)
16847 struct TypeName * param;
16849 for(param = (*decl->function.parameters).first; param; param = param->next)
16851 if(param->qualifiers && (*param->qualifiers).first)
16853 struct Specifier * spec = (*param->qualifiers).first;
16855 if(spec && spec->specifier == TYPED_OBJECT)
16857 struct Declarator * d = param->declarator;
16858 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);
16860 FreeList(param->qualifiers, FreeSpecifier);
16861 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16862 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16863 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16866 else if(spec && spec->specifier == ANY_OBJECT)
16868 struct Declarator * d = param->declarator;
16870 FreeList(param->qualifiers, FreeSpecifier);
16871 param->qualifiers = MkListOne(MkSpecifier(VOID));
16872 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16874 else if(spec->specifier == THISCLASS)
16879 spec->name = ReplaceThisClass(thisClass);
16880 spec->symbol = FindClass(spec->name);
16881 ProcessSpecifier(spec, 0x0);
16885 if(param->declarator)
16886 ProcessDeclarator(param->declarator);
16894 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16896 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16898 static void ProcessDeclaration(struct Declaration * decl)
16900 yylloc = decl->loc;
16905 unsigned int declareStruct = 0x0;
16907 if(decl->declarators)
16909 struct InitDeclarator * d;
16911 for(d = (*decl->declarators).first; d; d = d->next)
16913 struct Type * type, * subType;
16915 ProcessDeclarator(d->declarator);
16916 type = ProcessType(decl->specifiers, d->declarator);
16919 ProcessInitializer(d->initializer, type);
16920 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16922 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16924 struct Instantiation * inst = d->initializer->exp->instance;
16926 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16927 d->initializer->exp->instance = (((void *)0));
16928 if(decl->specifiers)
16929 FreeList(decl->specifiers, FreeSpecifier);
16930 FreeList(decl->declarators, FreeInitDeclarator);
16937 for(subType = type; subType; )
16939 if(subType->kind == 8)
16941 declareStruct = 0x1;
16944 else if(subType->kind == 13)
16946 else if(subType->kind == 12)
16947 subType = subType->arrayType;
16956 if(decl->specifiers)
16958 struct Specifier * s;
16960 for(s = (*decl->specifiers).first; s; s = s->next)
16962 ProcessSpecifier(s, declareStruct);
16969 ProcessInstantiationType(decl->inst);
16974 struct Specifier * spec;
16975 struct Declarator * d;
16976 unsigned int declareStruct = 0x0;
16978 if(decl->declarators)
16980 for(d = (*decl->declarators).first; d; d = d->next)
16982 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16983 struct Type * subType;
16985 ProcessDeclarator(d);
16986 for(subType = type; subType; )
16988 if(subType->kind == 8)
16990 declareStruct = 0x1;
16993 else if(subType->kind == 13)
16995 else if(subType->kind == 12)
16996 subType = subType->arrayType;
17003 if(decl->specifiers)
17005 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17006 ProcessSpecifier(spec, declareStruct);
17013 static struct FunctionDefinition * curFunction;
17015 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17017 char propName[1024], propNameM[1024];
17018 char getName[1024], setName[1024];
17019 struct __ecereNameSpace__ecere__sys__OldList * args;
17021 DeclareProperty(prop, setName, getName);
17022 strcpy(propName, "__ecereProp_");
17023 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17024 strcat(propName, "_");
17025 FullClassNameCat(propName, prop->name, 0x1);
17026 MangleClassName(propName);
17027 strcpy(propNameM, "__ecerePropM_");
17028 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17029 strcat(propNameM, "_");
17030 FullClassNameCat(propNameM, prop->name, 0x1);
17031 MangleClassName(propNameM);
17032 if(prop->isWatchable)
17035 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17036 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17037 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17039 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17040 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17041 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17045 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17046 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17047 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17049 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17050 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17051 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17053 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17054 curFunction->propSet->fireWatchersDone = 0x1;
17057 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17059 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17061 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17063 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17065 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17067 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17069 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17071 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17073 static void ProcessStatement(struct Statement * stmt)
17075 yylloc = stmt->loc;
17079 ProcessStatement(stmt->labeled.stmt);
17082 if(stmt->caseStmt.exp)
17084 FreeType(stmt->caseStmt.exp->destType);
17085 stmt->caseStmt.exp->destType = curSwitchType;
17087 curSwitchType->refCount++;
17088 ProcessExpressionType(stmt->caseStmt.exp);
17089 ComputeExpression(stmt->caseStmt.exp);
17091 if(stmt->caseStmt.stmt)
17092 ProcessStatement(stmt->caseStmt.stmt);
17096 if(stmt->compound.context)
17098 struct Declaration * decl;
17099 struct Statement * s;
17100 struct Statement * prevCompound = curCompound;
17101 struct Context * prevContext = curContext;
17103 if(!stmt->compound.isSwitch)
17104 curCompound = stmt;
17105 curContext = stmt->compound.context;
17106 if(stmt->compound.declarations)
17108 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17109 ProcessDeclaration(decl);
17111 if(stmt->compound.statements)
17113 for(s = (*stmt->compound.statements).first; s; s = s->next)
17114 ProcessStatement(s);
17116 curContext = prevContext;
17117 curCompound = prevCompound;
17123 struct Expression * exp;
17125 if(stmt->expressions)
17127 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17128 ProcessExpressionType(exp);
17134 struct Expression * exp;
17136 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17137 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17138 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17139 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17141 ProcessExpressionType(exp);
17143 if(stmt->ifStmt.stmt)
17144 ProcessStatement(stmt->ifStmt.stmt);
17145 if(stmt->ifStmt.elseStmt)
17146 ProcessStatement(stmt->ifStmt.elseStmt);
17151 struct Type * oldSwitchType = curSwitchType;
17153 if(stmt->switchStmt.exp)
17155 struct Expression * exp;
17157 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17161 ProcessExpressionType(exp);
17164 curSwitchType = exp->expType;
17167 ProcessStatement(stmt->switchStmt.stmt);
17168 curSwitchType = oldSwitchType;
17173 if(stmt->whileStmt.exp)
17175 struct Expression * exp;
17177 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17178 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17179 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17180 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17182 ProcessExpressionType(exp);
17185 if(stmt->whileStmt.stmt)
17186 ProcessStatement(stmt->whileStmt.stmt);
17191 if(stmt->doWhile.exp)
17193 struct Expression * exp;
17195 if((*stmt->doWhile.exp).last)
17197 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17198 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17199 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17201 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17203 ProcessExpressionType(exp);
17206 if(stmt->doWhile.stmt)
17207 ProcessStatement(stmt->doWhile.stmt);
17212 struct Expression * exp;
17214 if(stmt->forStmt.init)
17215 ProcessStatement(stmt->forStmt.init);
17216 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17218 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17219 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17220 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17222 if(stmt->forStmt.check)
17223 ProcessStatement(stmt->forStmt.check);
17224 if(stmt->forStmt.increment)
17226 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17227 ProcessExpressionType(exp);
17229 if(stmt->forStmt.stmt)
17230 ProcessStatement(stmt->forStmt.stmt);
17235 struct Identifier * id = stmt->forEachStmt.id;
17236 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17237 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17238 struct Statement * block = stmt->forEachStmt.stmt;
17239 char iteratorType[1024];
17240 struct Type * source;
17241 struct Expression * e;
17242 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));
17243 struct Expression * arrayExp;
17244 char * typeString = (((void *)0));
17245 int builtinCount = 0;
17247 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17251 FreeType(e->destType);
17252 e->destType = ProcessTypeString("Container", 0x0);
17254 if(!isBuiltin || e->next)
17255 ProcessExpressionType(e);
17257 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17258 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17260 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17261 struct Symbol * symbol;
17262 struct Expression * expIt = (((void *)0));
17263 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17264 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17265 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17266 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17269 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17270 stmt->compound.context->parent = curContext;
17271 curContext = stmt->compound.context;
17272 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17274 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17275 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17277 isCustomAVLTree = 0x1;
17278 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17280 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17283 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17285 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17287 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17290 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17294 struct Declarator * decl;
17295 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17297 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17298 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17299 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17303 struct Type * type = (((void *)0));
17304 char typeStringBuf[1024];
17306 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17307 if(((struct Expression *)(*exp).last)->type == 11)
17309 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17312 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17314 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)
17316 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17318 typeString = templateClass->templateArgs[2].dataTypeString;
17320 else if(arrayExp->list)
17322 struct Expression * e;
17324 for(e = (*arrayExp->list).first; e; e = e->next)
17326 ProcessExpressionType(e);
17336 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17340 e->expType = (((void *)0));
17341 e = (*arrayExp->list).first;
17342 ProcessExpressionType(e);
17345 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17347 FreeType(e->expType);
17348 e->expType = (((void *)0));
17350 type = (((void *)0));
17358 FreeType(e->expType);
17359 e->expType = (((void *)0));
17365 typeStringBuf[0] = '\0';
17366 PrintType(type, typeStringBuf, 0x0, 0x1);
17367 typeString = typeStringBuf;
17373 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17374 struct Declarator * decl;
17375 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17379 struct Expression * e;
17381 builtinCount = (*arrayExp->list).count;
17382 type = ProcessTypeString(typeString, 0x0);
17383 while(e = (*arrayExp->list).first)
17385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17386 e->destType = type;
17388 ProcessExpressionType(e);
17389 ListAdd(initializers, MkInitializerAssignment(e));
17392 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17394 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17395 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17396 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17397 FreeList(exp, FreeExpression);
17401 arrayExp->expType = ProcessTypeString("Container", 0x0);
17402 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17405 else if(isLinkList && !isList)
17407 struct Declarator * decl;
17408 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17410 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17411 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17412 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17414 else if(_class->templateArgs)
17417 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17419 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17420 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17422 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17425 switch(block->type)
17428 if(block->compound.context)
17429 block->compound.context->parent = stmt->compound.context;
17432 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17433 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17434 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17435 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17438 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17439 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17442 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17443 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17446 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17447 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17450 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17451 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17454 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17455 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17461 block = MkIfStmt(filter, block, (((void *)0)));
17465 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));
17466 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17467 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17468 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17474 sprintf(count, "%d", builtinCount);
17475 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));
17476 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17477 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17478 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17480 else if(isLinkList && !isList)
17482 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17483 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17485 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17487 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));
17491 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17492 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17494 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));
17496 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17497 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17498 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17502 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17504 ProcessExpressionType(expIt);
17505 if((*stmt->compound.declarations).first)
17506 ProcessDeclaration((*stmt->compound.declarations).first);
17508 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17509 ProcessStatement(stmt);
17510 curContext = stmt->compound.context->parent;
17515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17527 struct Expression * exp;
17529 if(stmt->expressions)
17531 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17535 if(curFunction && !curFunction->type)
17536 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17537 FreeType(exp->destType);
17538 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17540 exp->destType->refCount++;
17542 ProcessExpressionType(exp);
17549 ProcessDeclaration(stmt->decl);
17554 struct AsmField * field;
17556 if(stmt->asmStmt.inputFields)
17558 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17559 if(field->expression)
17560 ProcessExpressionType(field->expression);
17562 if(stmt->asmStmt.outputFields)
17564 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17565 if(field->expression)
17566 ProcessExpressionType(field->expression);
17568 if(stmt->asmStmt.clobberedFields)
17570 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17572 if(field->expression)
17573 ProcessExpressionType(field->expression);
17580 struct PropertyWatch * propWatch;
17581 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17582 struct Expression * object = stmt->_watch.object;
17583 struct Expression * watcher = stmt->_watch.watcher;
17586 ProcessExpressionType(watcher);
17588 ProcessExpressionType(object);
17591 if(watcher || thisClass)
17593 struct External * external = curExternal;
17594 struct Context * context = curContext;
17597 stmt->expressions = MkList();
17598 curExternal = external->prev;
17599 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17601 struct ClassFunction * func;
17602 char watcherName[1024];
17603 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17604 struct External * createdExternal;
17605 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17607 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17608 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17609 if(propWatch->deleteWatch)
17610 strcat(watcherName, "_delete");
17613 struct Identifier * propID;
17615 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17617 strcat(watcherName, "_");
17618 strcat(watcherName, propID->string);
17621 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17623 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17624 ProcessClassFunctionBody(func, propWatch->compound);
17625 propWatch->compound = (((void *)0));
17626 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17627 createdExternal->symbol->idCode = external->symbol->idCode;
17628 curExternal = createdExternal;
17629 ProcessFunction(createdExternal->function);
17631 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17633 externalDecl->declaration = decl;
17634 if(decl->symbol && !decl->symbol->pointerExternal)
17635 decl->symbol->pointerExternal = externalDecl;
17637 if(propWatch->deleteWatch)
17639 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17641 ListAdd(args, CopyExpression(object));
17642 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17643 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17644 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17648 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17649 struct Identifier * propID;
17651 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17653 char propName[1024];
17654 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17658 char getName[1024], setName[1024];
17659 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17661 DeclareProperty(prop, setName, getName);
17662 strcpy(propName, "__ecereProp_");
17663 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17664 strcat(propName, "_");
17665 FullClassNameCat(propName, prop->name, 0x1);
17666 ListAdd(args, CopyExpression(object));
17667 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17668 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17669 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17670 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17678 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17680 curExternal = external;
17681 curContext = context;
17683 FreeExpression(watcher);
17685 FreeExpression(object);
17686 FreeList(watches, FreePropertyWatch);
17689 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17693 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17695 ProcessStatement(propWatch->compound);
17702 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17703 struct Expression * object = stmt->_watch.object;
17704 struct __ecereNameSpace__ecere__com__Class * _class;
17707 ProcessExpressionType(object);
17710 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17713 struct Identifier * propID;
17716 stmt->expressions = MkList();
17717 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17719 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17726 for(propID = (*watches).first; propID; propID = propID->next)
17728 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17732 CreateFireWatcher(prop, object, stmt);
17735 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17740 struct __ecereNameSpace__ecere__com__Property * prop;
17741 struct __ecereNameSpace__ecere__com__Class * base;
17743 for(base = _class; base; base = base->base)
17745 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17747 if(prop->isProperty && prop->isWatchable)
17749 CreateFireWatcher(prop, object, stmt);
17755 FreeExpression(object);
17756 FreeList(watches, FreeIdentifier);
17759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17765 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17766 struct Expression * object = stmt->_watch.object;
17767 struct Expression * watcher = stmt->_watch.watcher;
17768 struct __ecereNameSpace__ecere__com__Class * _class;
17771 ProcessExpressionType(object);
17773 ProcessExpressionType(watcher);
17776 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17777 if(watcher || thisClass)
17781 struct Identifier * propID;
17784 stmt->expressions = MkList();
17787 struct __ecereNameSpace__ecere__sys__OldList * args;
17790 ListAdd(args, CopyExpression(object));
17791 ListAdd(args, MkExpConstant("0"));
17792 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17793 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17797 for(propID = (*watches).first; propID; propID = propID->next)
17799 char propName[1024];
17800 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17804 char getName[1024], setName[1024];
17805 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17807 DeclareProperty(prop, setName, getName);
17808 strcpy(propName, "__ecereProp_");
17809 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17810 strcat(propName, "_");
17811 FullClassNameCat(propName, prop->name, 0x1);
17812 MangleClassName(propName);
17813 ListAdd(args, CopyExpression(object));
17814 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17815 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17816 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17819 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17823 FreeExpression(object);
17825 FreeExpression(watcher);
17826 FreeList(watches, FreeIdentifier);
17829 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17839 extern struct Expression * QBrackets(struct Expression * exp);
17841 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17843 extern struct Declarator * QMkPtrDecl(char * id);
17845 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17847 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17849 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17851 static void ProcessFunction(struct FunctionDefinition * function)
17853 struct Identifier * id = GetDeclId(function->declarator);
17854 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17855 struct Type * type = symbol ? symbol->type : (((void *)0));
17856 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17857 struct Context * oldTopContext = topContext;
17859 yylloc = function->loc;
17860 if(type && type->thisClass)
17862 struct Symbol * classSym = type->thisClass;
17863 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17864 char className[1024];
17865 char structName[1024];
17866 struct Declarator * funcDecl;
17867 struct Symbol * thisSymbol;
17868 unsigned int typedObject = 0x0;
17870 if(_class && !_class->base)
17872 _class = currentClass;
17873 if(_class && !_class->symbol)
17874 _class->symbol = FindClass(_class->fullName);
17875 classSym = _class ? _class->symbol : (((void *)0));
17878 thisClass = _class;
17879 if(inCompiler && _class)
17881 if(type->kind == 11)
17883 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17885 struct Type * param = symbol->type->params.first;
17887 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17890 if(type->classObjectType != 1)
17892 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17893 symbol->type->staticMethod = 0x1;
17894 symbol->type->thisClass = (((void *)0));
17895 symbol->type->extraParam = 0x0;
17898 strcpy(className, "__ecereClass_");
17899 FullClassNameCat(className, _class->fullName, 0x1);
17900 MangleClassName(className);
17901 structName[0] = (char)0;
17902 FullClassNameCat(structName, _class->fullName, 0x0);
17903 funcDecl = GetFuncDecl(function->declarator);
17906 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17908 struct TypeName * param = (*funcDecl->function.parameters).first;
17910 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17912 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17913 FreeTypeName(param);
17916 if(!function->propertyNoThis)
17918 struct TypeName * thisParam;
17920 if(type->classObjectType != 1)
17922 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17923 if(!funcDecl->function.parameters)
17924 funcDecl->function.parameters = MkList();
17925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17929 if(type->classObjectType != 1)
17931 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17932 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17934 thisParam = __extension__ ({
17935 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17937 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17943 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17945 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17947 funcDecl = GetFuncDecl(initDecl->declarator);
17950 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17952 struct TypeName * param = (*funcDecl->function.parameters).first;
17954 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17957 FreeTypeName(param);
17960 if(type->classObjectType != 1)
17962 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17964 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17966 if(!funcDecl->function.parameters)
17967 funcDecl->function.parameters = MkList();
17968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17976 if(type->classObjectType != 1)
17978 thisSymbol = __extension__ ({
17979 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17981 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17983 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17984 if(typedObject && thisSymbol->type)
17986 thisSymbol->type->classObjectType = 2;
17987 thisSymbol->type->byReference = type->byReference;
17988 thisSymbol->type->typedByReference = type->byReference;
17992 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17994 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17997 struct __ecereNameSpace__ecere__com__Class * base;
17999 for(base = _class; base && base->type != 1000; base = base->next)
18001 for(member = base->membersAndProperties.first; member; member = member->next)
18002 if(!member->isProperty)
18008 for(member = _class->membersAndProperties.first; member; member = member->next)
18009 if(!member->isProperty)
18013 char pointerName[1024];
18014 struct Declaration * decl;
18015 struct Initializer * initializer;
18016 struct Expression * exp, * bytePtr;
18018 strcpy(pointerName, "__ecerePointer_");
18019 FullClassNameCat(pointerName, _class->fullName, 0x0);
18021 char className[1024];
18023 strcpy(className, "__ecereClass_");
18024 FullClassNameCat(className, classSym->string, 0x1);
18025 MangleClassName(className);
18026 DeclareClass(classSym, className);
18028 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18033 sprintf(string, "%d", _class->offset);
18034 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18038 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18040 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18041 exp->expType = __extension__ ({
18042 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18044 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18045 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18047 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18048 }), __ecereInstance2;
18052 yylloc = function->body->loc;
18053 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18055 struct Context * prevContext = curContext;
18057 curContext = function->body->compound.context;
18058 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18059 curContext = prevContext;
18061 decl->symbol = (((void *)0));
18062 if(!function->body->compound.declarations)
18063 function->body->compound.declarations = MkList();
18064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18070 thisClass = (((void *)0));
18073 FreeSpecifier(id->_class);
18074 id->_class = (((void *)0));
18075 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18077 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18079 id = GetDeclId(initDecl->declarator);
18080 FreeSpecifier(id->_class);
18081 id->_class = (((void *)0));
18085 topContext = function->body->compound.context;
18087 struct FunctionDefinition * oldFunction = curFunction;
18089 curFunction = function;
18091 ProcessStatement(function->body);
18092 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18094 struct Statement * prevCompound = curCompound;
18095 struct Context * prevContext = curContext;
18096 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18098 if(!function->body->compound.statements)
18099 function->body->compound.statements = MkList();
18100 ListAdd(function->body->compound.statements, fireWatchers);
18101 curCompound = function->body;
18102 curContext = function->body->compound.context;
18103 ProcessStatement(fireWatchers);
18104 curContext = prevContext;
18105 curCompound = prevCompound;
18107 curFunction = oldFunction;
18109 if(function->declarator)
18111 ProcessDeclarator(function->declarator);
18113 topContext = oldTopContext;
18114 thisClass = oldThisClass;
18117 extern void FreeSymbol(struct Symbol * symbol);
18119 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18121 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18123 struct ClassDef * def;
18124 struct External * external = curExternal;
18125 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18127 for(def = definitions->first; def; def = def->next)
18131 if(def->function->declarator)
18132 curExternal = def->function->declarator->symbol->pointerExternal;
18134 curExternal = external;
18135 ProcessFunction((struct FunctionDefinition *)def->function);
18137 else if(def->type == 2)
18139 if(def->decl->type == 2)
18141 thisClass = regClass;
18142 ProcessInstantiationType(def->decl->inst);
18143 thisClass = (((void *)0));
18147 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18150 thisClass = regClass;
18151 ProcessDeclaration(def->decl);
18152 thisClass = backThisClass;
18155 else if(def->type == 1 && def->defProperties)
18157 struct MemberInit * defProperty;
18158 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);
18160 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18161 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18163 thisClass = regClass;
18164 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18165 thisClass = (((void *)0));
18167 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18168 FreeSymbol(thisSymbol);
18170 else if(def->type == 3 && def->propertyDef)
18172 struct PropertyDef * prop = def->propertyDef;
18174 thisClass = regClass;
18179 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18181 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18183 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18184 ProcessStatement(prop->setStmt);
18190 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18192 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18194 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18195 ProcessStatement(prop->getStmt);
18197 if(prop->issetStmt)
18201 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18203 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18205 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18206 ProcessStatement(prop->issetStmt);
18208 thisClass = (((void *)0));
18210 else if(def->type == 4 && def->propertyWatch)
18212 struct PropertyWatch * propertyWatch = def->propertyWatch;
18214 thisClass = regClass;
18215 if(propertyWatch->compound)
18217 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);
18219 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18220 curExternal = (((void *)0));
18221 ProcessStatement(propertyWatch->compound);
18223 thisClass = (((void *)0));
18228 void DeclareFunctionUtil(char * s)
18230 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18237 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18238 strcpy(name, "__ecereFunction_");
18239 FullClassNameCat(name, s, 0x0);
18240 DeclareFunction(function, name);
18244 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18246 void ComputeDataTypes()
18248 struct External * external;
18249 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18250 struct External * after = (((void *)0));
18252 currentClass = (((void *)0));
18253 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18254 for(external = (*ast).first; external; external = external->next)
18256 if(external->type == 1)
18258 struct Declaration * decl = external->declaration;
18262 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18266 struct InitDeclarator * initDecl = (*decls).first;
18270 struct Declarator * declarator = initDecl->declarator;
18272 if(declarator && declarator->type == 1)
18274 struct Identifier * id = declarator->identifier;
18276 if(id && id->string)
18278 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18280 external->symbol->id = -1001, external->symbol->idCode = -1001;
18290 temp->symbol = __extension__ ({
18291 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18293 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18296 curExternal = temp;
18297 DeclareFunctionUtil("eSystem_New");
18298 DeclareFunctionUtil("eSystem_New0");
18299 DeclareFunctionUtil("eSystem_Renew");
18300 DeclareFunctionUtil("eSystem_Renew0");
18301 DeclareFunctionUtil("eSystem_Delete");
18302 DeclareFunctionUtil("eClass_GetProperty");
18303 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18304 DeclareStruct("ecere::com::Class", 0x0);
18305 DeclareStruct("ecere::com::Instance", 0x0);
18306 DeclareStruct("ecere::com::Property", 0x0);
18307 DeclareStruct("ecere::com::DataMember", 0x0);
18308 DeclareStruct("ecere::com::Method", 0x0);
18309 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18310 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18311 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18312 for(external = (*ast).first; external; external = external->next)
18314 afterExternal = curExternal = external;
18315 if(external->type == 0)
18317 currentClass = external->function->_class;
18318 ProcessFunction(external->function);
18320 else if(external->type == 1)
18322 currentClass = (((void *)0));
18323 ProcessDeclaration(external->declaration);
18325 else if(external->type == 2)
18327 struct ClassDefinition * _class = external->_class;
18329 currentClass = external->symbol->registered;
18330 if(_class->definitions)
18332 ProcessClass(_class->definitions, _class->symbol);
18336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18337 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18340 else if(external->type == 4)
18342 thisNameSpace = external->id->string;
18345 currentClass = (((void *)0));
18346 thisNameSpace = (((void *)0));
18347 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18348 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18351 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);
18353 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);
18355 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18357 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18359 struct __ecereNameSpace__ecere__com__Class * class;
18361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18410 __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);
18411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18414 __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);
18415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18427 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18428 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18429 __ecereClass_Conversion = class;
18430 __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);
18431 __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);
18432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18433 __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);
18434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18457 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)