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 op.kind = type->kind;
10651 op.type = exp->expType;
10652 if(exp->type == 3 && op.kind == 13)
10654 op.ui64 = (uint64)exp->string;
10656 op.ops = uint64Ops;
10658 else if(exp->isConstant && exp->type == 2)
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->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;
12217 GetChar(e, &value);
12218 FreeExpContents(exp);
12219 exp->constant = PrintChar(value);
12224 unsigned char value;
12226 GetUChar(e, &value);
12227 FreeExpContents(exp);
12228 exp->constant = PrintUChar(value);
12237 GetShort(e, &value);
12238 FreeExpContents(exp);
12239 exp->constant = PrintShort(value);
12244 unsigned short value;
12246 GetUShort(e, &value);
12247 FreeExpContents(exp);
12248 exp->constant = PrintUShort(value);
12258 FreeExpContents(exp);
12259 exp->constant = PrintInt(value);
12264 unsigned int value;
12266 GetUInt(e, &value);
12267 FreeExpContents(exp);
12268 exp->constant = PrintUInt(value);
12277 GetInt64(e, &value);
12278 FreeExpContents(exp);
12279 exp->constant = PrintInt64(value);
12286 GetUInt64(e, &value);
12287 FreeExpContents(exp);
12288 exp->constant = PrintUInt64(value);
12297 GetIntPtr(e, &value);
12298 FreeExpContents(exp);
12299 exp->constant = PrintInt64((long long)value);
12306 GetUIntPtr(e, &value);
12307 FreeExpContents(exp);
12308 exp->constant = PrintUInt64((uint64)value);
12317 GetIntSize(e, &value);
12318 FreeExpContents(exp);
12319 exp->constant = PrintInt64((long long)value);
12326 GetUIntSize(e, &value);
12327 FreeExpContents(exp);
12328 exp->constant = PrintUInt64((uint64)value);
12336 GetFloat(e, &value);
12337 FreeExpContents(exp);
12338 exp->constant = PrintFloat(value);
12346 GetDouble(e, &value);
12347 FreeExpContents(exp);
12348 exp->constant = PrintDouble(value);
12358 struct Operand op1 =
12362 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12365 struct Operand op2 =
12369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12372 struct Operand op3 =
12376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12381 ComputeExpression((*exp->cond.exp).last);
12382 if(exp->cond.elseExp)
12383 ComputeExpression(exp->cond.elseExp);
12385 ComputeExpression(exp->cond.cond);
12386 op1 = GetOperand(exp->cond.cond);
12388 op1.type->refCount++;
12389 op2 = GetOperand((*exp->cond.exp).last);
12391 op2.type->refCount++;
12392 op3 = GetOperand(exp->cond.elseExp);
12394 op3.type->refCount++;
12397 FreeExpContents(exp);
12398 op1.ops.Cond(exp, &op1, &op2, &op3);
12401 FreeType(op1.type);
12403 FreeType(op2.type);
12405 FreeType(op3.type);
12411 void ApplyAnyObjectLogic(struct Expression * e);
12413 extern void CopyTypeInto(struct Type * type, struct Type * src);
12415 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12417 unsigned int result = 0x1;
12421 struct __ecereNameSpace__ecere__sys__OldList converts =
12425 struct Conversion * convert;
12427 if(destType->kind == 0)
12429 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12433 for(convert = converts.first; convert; convert = convert->next)
12435 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12439 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12440 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12443 newExp->destType = (((void *)0));
12447 exp->addedThis = 0x1;
12448 exp->member.exp = newExp;
12449 FreeType(exp->member.exp->expType);
12450 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12451 exp->member.exp->expType->classObjectType = objectType;
12452 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12453 exp->member.memberType = 1;
12454 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12455 exp->needCast = 0x1;
12457 exp->expType->refCount++;
12458 ApplyAnyObjectLogic(exp->member.exp);
12464 exp->addedThis = 0x1;
12465 exp->member.exp = newExp;
12466 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12468 newExp->byReference = 0x1;
12470 FreeType(exp->member.exp->expType);
12471 exp->member.exp->expType = (((void *)0));
12472 if(convert->convert->dataType)
12474 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12475 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12476 exp->member.exp->expType->refCount = 1;
12477 exp->member.exp->expType->classObjectType = objectType;
12478 ApplyAnyObjectLogic(exp->member.exp);
12480 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12481 exp->member.memberType = 4;
12482 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12483 exp->needCast = 0x1;
12484 if(convert->resultType)
12485 convert->resultType->refCount++;
12491 FreeType(exp->expType);
12494 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12495 exp->needCast = 0x1;
12497 exp->expType->refCount++;
12501 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12502 exp->needCast = 0x1;
12503 if(convert->resultType)
12504 convert->resultType->refCount++;
12508 if(exp->isConstant && inCompiler)
12509 ComputeExpression(exp);
12510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12512 if(!result && exp->expType && converts.count)
12514 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12516 if(!result && exp->expType && exp->destType)
12518 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))
12525 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12527 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12529 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12531 void CheckTemplateTypes(struct Expression * exp)
12533 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12535 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12536 struct Statement * compound;
12537 struct Context * context;
12541 exp->destType->refCount++;
12543 exp->expType->refCount++;
12544 newExp->prev = (((void *)0));
12545 newExp->next = (((void *)0));
12546 switch(exp->expType->kind)
12549 if(exp->destType->classObjectType)
12552 exp->destType->refCount--;
12554 exp->expType->refCount--;
12555 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12559 struct __ecereNameSpace__ecere__sys__OldList * specs;
12560 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12561 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12563 context = PushContext();
12564 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12565 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12566 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12568 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12569 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12570 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12571 exp->compound->compound.context = context;
12572 PopContext(context);
12577 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12578 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12582 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12584 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12585 struct Statement * compound;
12586 struct Context * context;
12590 exp->destType->refCount++;
12592 exp->expType->refCount++;
12593 newExp->prev = (((void *)0));
12594 newExp->next = (((void *)0));
12595 switch(exp->expType->kind)
12598 if(exp->destType->classObjectType)
12601 exp->destType->refCount--;
12603 exp->expType->refCount--;
12604 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12608 struct __ecereNameSpace__ecere__sys__OldList * specs;
12609 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12610 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12612 context = PushContext();
12613 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12614 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12615 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12617 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12618 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12619 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12620 exp->compound->compound.context = context;
12621 PopContext(context);
12626 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12629 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12630 ProcessExpressionType((*exp->list).first);
12636 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12637 newExp->needCast = 0x1;
12638 ProcessExpressionType((*exp->list).first);
12644 if(exp->expType->kind == 20)
12646 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12650 FreeType(exp->destType);
12651 FreeType(exp->expType);
12652 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12656 if(newExp->type == 8 && newExp->member.memberType == 3)
12660 exp->op.exp1 = (((void *)0));
12661 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12665 char typeString[1024];
12666 struct Declarator * decl;
12667 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12669 typeString[0] = '\0';
12670 PrintType(exp->expType, typeString, 0x0, 0x0);
12671 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12673 exp->cast.typeName = MkTypeName(specs, decl);
12674 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12675 exp->cast.exp->needCast = 0x1;
12683 extern int strncmp(const char * , const char * , size_t n);
12685 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12687 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12689 int nsLen = strlen(nameSpace);
12690 struct Symbol * symbol;
12692 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)))
12694 char * s = symbol->string;
12696 if(!strncmp(s, nameSpace, nsLen))
12701 for(c = strlen(s) - 1; c >= 0; c--)
12704 namePart = s + c + 1;
12705 if(!strcmp(namePart, name))
12713 return (((void *)0));
12716 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12719 char nameSpace[1024];
12721 unsigned int gotColon = 0x0;
12723 nameSpace[0] = '\0';
12724 for(c = strlen(name) - 1; c >= 0; c--)
12730 namePart = name + c + 1;
12731 while(c >= 0 && name[c] == ':')
12735 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12739 memcpy(nameSpace, name, c + 1);
12740 nameSpace[c + 1] = (char)0;
12741 return ScanWithNameSpace(tree, nameSpace, namePart);
12745 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12751 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12755 return ScanWithNameSpace(tree, "", namePart);
12757 return (((void *)0));
12760 static void ProcessDeclaration(struct Declaration * decl);
12762 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12764 struct Context * ctx;
12765 struct Symbol * symbol = (((void *)0));
12767 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12769 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12771 symbol = (((void *)0));
12774 char curName[1024];
12776 strcpy(curName, thisNameSpace);
12777 strcat(curName, "::");
12778 strcat(curName, name);
12779 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12782 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12785 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12786 if(symbol || ctx == endContext)
12789 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12791 if(symbol->pointerExternal->type == 0)
12793 struct FunctionDefinition * function = symbol->pointerExternal->function;
12794 struct Context * tmpContext = curContext;
12796 curContext = (((void *)0));
12797 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12798 curContext = tmpContext;
12799 symbol->pointerExternal->symbol = symbol;
12800 DeclareType(symbol->type, 0x1, 0x1);
12801 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12802 symbol->id = curExternal->symbol->idCode;
12804 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12806 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12807 symbol->id = curExternal->symbol->idCode;
12813 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12815 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12816 ListAdd(specs, MkSpecifier(UNSIGNED));
12821 if(type->_class->registered)
12823 if(!type->_class->registered->dataType)
12824 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12825 GetTypeSpecs(type->_class->registered->dataType, specs);
12830 ListAdd(specs, MkSpecifier(DOUBLE));
12833 ListAdd(specs, MkSpecifier(FLOAT));
12836 ListAdd(specs, MkSpecifier(CHAR));
12839 ListAdd(specs, MkSpecifier(_BOOL));
12842 ListAdd(specs, MkSpecifier(SHORT));
12845 ListAdd(specs, MkSpecifier(INT64));
12848 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12851 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12855 ListAdd(specs, MkSpecifier(INT));
12860 static void PrintArraySize(struct Type * arrayType, char * string)
12866 if(arrayType->enumClass)
12867 strcat(size, arrayType->enumClass->string);
12868 else if(arrayType->arraySizeExp)
12869 PrintExpression(arrayType->arraySizeExp, size);
12871 strcat(string, size);
12874 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12878 if(printConst && type->constant)
12879 strcat(string, "const ");
12884 struct Symbol * c = type->_class;
12886 if(type->classObjectType == 2)
12887 strcat(string, "typed_object");
12888 else if(type->classObjectType == 3)
12889 strcat(string, "any_object");
12893 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12895 if(type->byReference)
12896 strcat(string, " &");
12900 strcat(string, "void");
12903 strcat(string, type->isSigned ? "int" : "uint");
12906 strcat(string, type->isSigned ? "int64" : "uint64");
12909 strcat(string, type->isSigned ? "intptr" : "uintptr");
12912 strcat(string, type->isSigned ? "intsize" : "uintsize");
12915 strcat(string, type->isSigned ? "char" : "byte");
12918 strcat(string, "_Bool");
12921 strcat(string, type->isSigned ? "short" : "uint16");
12924 strcat(string, "float");
12927 strcat(string, "double");
12932 strcat(string, "struct ");
12933 strcat(string, type->enumName);
12935 else if(type->typeName)
12936 strcat(string, type->typeName);
12939 struct Type * member;
12941 strcat(string, "struct { ");
12942 for(member = type->members.first; member; member = member->next)
12944 PrintType(member, string, 0x1, fullName);
12945 strcat(string, "; ");
12947 strcat(string, "}");
12953 strcat(string, "union ");
12954 strcat(string, type->enumName);
12956 else if(type->typeName)
12957 strcat(string, type->typeName);
12960 strcat(string, "union ");
12961 strcat(string, "(unnamed)");
12967 strcat(string, "enum ");
12968 strcat(string, type->enumName);
12970 else if(type->typeName)
12971 strcat(string, type->typeName);
12973 strcat(string, "int");
12976 strcat(string, "...");
12979 strcat(string, "subclass(");
12980 strcat(string, type->_class ? type->_class->string : "int");
12981 strcat(string, ")");
12984 strcat(string, type->templateParameter->identifier->string);
12987 strcat(string, "thisclass");
12990 strcat(string, "__builtin_va_list");
12996 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12998 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13000 if(type->name && type->name[0])
13003 strcat(string, type->name);
13006 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13012 strcat(string, name);
13017 static void PrintAttribs(struct Type * type, char * string)
13021 if(type->dllExport)
13022 strcat(string, "dllexport ");
13023 if(type->attrStdcall)
13024 strcat(string, "stdcall ");
13028 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13030 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13032 struct Type * attrType = (((void *)0));
13034 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13035 PrintAttribs(type, string);
13036 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13037 strcat(string, " const");
13038 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13039 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13040 strcat(string, " (");
13041 if(type->kind == 13)
13043 if(type->type->kind == 11 || type->type->kind == 16)
13044 PrintAttribs(type->type, string);
13046 if(type->kind == 13)
13048 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13049 strcat(string, "*");
13051 strcat(string, " *");
13053 if(printConst && type->constant && type->kind == 13)
13054 strcat(string, " const");
13057 PrintTypeSpecs(type, string, fullName, printConst);
13060 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13062 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13063 strcat(string, ")");
13064 if(type->kind == 12)
13065 PrintArraySize(type, string);
13066 else if(type->kind == 11)
13068 struct Type * param;
13070 strcat(string, "(");
13071 for(param = type->params.first; param; param = param->next)
13073 PrintType(param, string, 0x1, fullName);
13075 strcat(string, ", ");
13077 strcat(string, ")");
13079 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13080 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13083 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13085 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13086 if(type->thisClass || (printName && type->name && type->name[0]))
13087 strcat(string, " ");
13088 if((type->thisClass || type->staticMethod))
13090 struct Symbol * _class = type->thisClass;
13092 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13094 if(type->classObjectType == 1)
13095 strcat(string, "class");
13097 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13099 else if(_class && _class->string)
13101 char * s = _class->string;
13107 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13113 strcat(string, name);
13116 strcat(string, "::");
13118 if(printName && type->name)
13119 PrintName(type, string, fullName);
13120 PostPrintType(type, string, fullName);
13121 if(type->bitFieldCount)
13125 sprintf(count, ":%d", type->bitFieldCount);
13126 strcat(string, count);
13130 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13132 _PrintType(type, string, printName, fullName, 0x1);
13135 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13137 _PrintType(type, string, printName, fullName, 0x0);
13140 static struct Type * FindMember(struct Type * type, char * string)
13142 struct Type * memberType;
13144 for(memberType = type->members.first; memberType; memberType = memberType->next)
13146 if(!memberType->name)
13148 struct Type * subType = FindMember(memberType, string);
13153 else if(!strcmp(memberType->name, string))
13156 return (((void *)0));
13159 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13161 struct Type * memberType;
13163 for(memberType = type->members.first; memberType; memberType = memberType->next)
13165 if(!memberType->name)
13167 struct Type * subType = FindMember(memberType, string);
13171 *offset += memberType->offset;
13175 else if(!strcmp(memberType->name, string))
13177 *offset += memberType->offset;
13181 return (((void *)0));
13184 extern unsigned int parseError;
13186 unsigned int GetParseError()
13191 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13193 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13197 struct Expression * ParseExpressionString(char * expression)
13200 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13201 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13202 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13204 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13205 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13206 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13207 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13209 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13210 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13212 parsedExpression = (((void *)0));
13214 expression_yyparse();
13215 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13216 return parsedExpression;
13219 extern char * QMkString(char * source);
13221 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13223 struct Identifier * id = exp->identifier;
13224 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13225 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13226 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13227 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13229 if(_class && _class->type == 4)
13231 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13232 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13236 struct __ecereNameSpace__ecere__com__Class * baseClass;
13238 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13240 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13242 for(value = e->values.first; value; value = value->next)
13244 if(!strcmp(value->name, id->string))
13249 char constant[256];
13251 FreeExpContents(exp);
13253 exp->isConstant = 0x1;
13254 if(!strcmp(baseClass->dataTypeString, "int"))
13255 sprintf(constant, "%d", (int)value->data);
13257 sprintf(constant, "0x%X", (int)value->data);
13258 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13259 exp->expType = MkClassType(baseClass->fullName);
13267 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13269 ProcessMethodType(method);
13270 exp->expType = __extension__ ({
13271 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13273 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13277 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13279 if(!prop->dataType)
13280 ProcessPropertyType(prop);
13281 exp->expType = prop->dataType;
13283 prop->dataType->refCount++;
13286 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13288 if(!member->dataType)
13289 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13290 exp->expType = member->dataType;
13291 if(member->dataType)
13292 member->dataType->refCount++;
13295 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13297 if(!classProp->dataType)
13298 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13299 if(classProp->constant)
13301 FreeExpContents(exp);
13302 exp->isConstant = 0x1;
13303 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13306 exp->constant = QMkString((char *)classProp->Get(_class));
13310 char constant[256];
13313 sprintf(constant, "%d", (int)classProp->Get(_class));
13314 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13320 exp->expType = classProp->dataType;
13321 if(classProp->dataType)
13322 classProp->dataType->refCount++;
13328 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13330 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13331 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13332 struct __ecereNameSpace__ecere__com__NameSpace * child;
13336 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)))
13338 data = ScanGlobalData(child, name);
13346 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13348 extern char * strncpy(char * , const char * , size_t n);
13350 static struct GlobalData * FindGlobalData(char * name)
13353 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13355 nameSpace = globalData;
13356 for(c = 0; name[c]; c++)
13358 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13360 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13361 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13363 strncpy(spaceName, name + start, c - start);
13364 spaceName[c - start] = '\0';
13365 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13366 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13368 return (((void *)0));
13369 nameSpace = newSpace;
13377 return ScanGlobalData(nameSpace, name + start);
13379 return (((void *)0));
13382 static int definedExpStackPos;
13384 static void * definedExpStack[512];
13386 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13388 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13390 FreeExpContents(checkedExp);
13391 FreeType(checkedExp->expType);
13392 FreeType(checkedExp->destType);
13393 *checkedExp = *newExp;
13394 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13395 checkedExp->prev = prev;
13396 checkedExp->next = next;
13399 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13401 extern int printf(char * , ...);
13403 void __ecereMethod_Expression_Clear();
13405 void ApplyAnyObjectLogic(struct Expression * e)
13407 struct Type * destType = e->destType;
13409 if(destType && (destType->classObjectType == 3))
13411 if(e && e->expType)
13413 struct Type * type = e->expType;
13414 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13416 if(type->kind == 8 && type->_class && type->_class->registered)
13418 _class = type->_class->registered;
13420 else if(type->kind == 19)
13422 _class = FindClass("ecere::com::Class")->registered;
13426 char string[1024] = "";
13427 struct Symbol * classSym;
13429 PrintTypeNoConst(type, string, 0x0, 0x1);
13430 classSym = FindClass(string);
13432 _class = classSym->registered;
13434 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)))
13436 if(!_class || strcmp(_class->fullName, "char *"))
13438 struct Expression * checkedExp = e, * newExp;
13440 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13442 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13444 if(checkedExp->type == 23)
13446 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13449 checkedExp = (*checkedExp->list).last;
13451 else if(checkedExp->type == 11)
13452 checkedExp = checkedExp->cast.exp;
13454 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13456 newExp = checkedExp->op.exp2;
13457 checkedExp->op.exp2 = (((void *)0));
13458 FreeExpContents(checkedExp);
13459 if(e->expType && e->expType->passAsTemplate)
13463 ComputeTypeSize(e->expType);
13464 sprintf(size, "%d", e->expType->size);
13465 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))))));
13467 ReplaceExpContents(checkedExp, newExp);
13468 e->byReference = 0x1;
13470 else if(!e->byReference || (_class && _class->type == 5))
13472 struct Expression * checkedExp, * newExp;
13475 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;
13477 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13479 struct Context * context = PushContext();
13480 struct Declarator * decl;
13481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13482 char typeString[1024];
13483 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13485 typeString[0] = '\0';
13487 newExp->prev = (((void *)0));
13488 newExp->next = (((void *)0));
13489 newExp->expType = (((void *)0));
13490 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13491 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13492 newExp->destType = ProcessType(specs, decl);
13493 curContext = context;
13497 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13500 sprintf(name, "__internalValue%03X", internalValueCounter++);
13501 if(!curCompound->compound.declarations)
13502 curCompound->compound.declarations = MkList();
13503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13504 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13505 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13506 e->compound = MkCompoundStmt((((void *)0)), stmts);
13509 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13511 struct Type * type = e->destType;
13513 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13514 CopyTypeInto(e->destType, type);
13515 e->destType->refCount = 1;
13516 e->destType->classObjectType = 0;
13519 e->compound->compound.context = context;
13520 PopContext(context);
13521 curContext = context->parent;
13525 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13527 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13529 if(checkedExp->type == 23)
13531 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13534 checkedExp = (*checkedExp->list).last;
13536 else if(checkedExp->type == 11)
13537 checkedExp = checkedExp->cast.exp;
13540 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13542 *operand = *checkedExp;
13543 checkedExp->destType = (((void *)0));
13544 checkedExp->expType = (((void *)0));
13545 __ecereMethod_Expression_Clear(checkedExp);
13546 checkedExp->type = 4;
13547 checkedExp->op.op = '&';
13548 checkedExp->op.exp1 = (((void *)0));
13549 checkedExp->op.exp2 = operand;
13558 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))))
13560 if(e->expType->classObjectType && destType && destType->classObjectType)
13566 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13569 thisExp->prev = (((void *)0));
13570 thisExp->next = (((void *)0));
13571 __ecereMethod_Expression_Clear(e);
13573 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13574 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13575 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13577 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13578 CopyTypeInto(e->expType, thisExp->expType);
13579 e->expType->byReference = 0x0;
13580 e->expType->refCount = 1;
13581 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))
13583 e->expType->classObjectType = 0;
13588 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13590 if(destType->kind == 14)
13592 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13594 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13596 unsigned int byReference = e->expType->byReference;
13597 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13598 struct Declarator * decl;
13599 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13600 char typeString[1024];
13601 struct Type * type;
13602 int backupClassObjectType;
13603 unsigned int backupByReference;
13605 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13609 backupClassObjectType = type->classObjectType;
13610 backupByReference = type->byReference;
13611 type->classObjectType = 0;
13612 type->byReference = 0x0;
13613 typeString[0] = '\0';
13614 PrintType(type, typeString, 0x0, 0x1);
13615 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13616 type->classObjectType = backupClassObjectType;
13617 type->byReference = backupByReference;
13619 thisExp->prev = (((void *)0));
13620 thisExp->next = (((void *)0));
13621 __ecereMethod_Expression_Clear(e);
13622 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)))
13626 e->op.exp1 = (((void *)0));
13627 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13628 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13629 CopyTypeInto(e->expType, type);
13630 e->expType->byReference = 0x0;
13631 e->expType->refCount = 1;
13636 e->cast.typeName = MkTypeName(specs, decl);
13637 e->cast.exp = thisExp;
13638 e->byReference = 0x1;
13642 e->destType = destType;
13643 destType->refCount++;
13648 extern char * strstr(const char * , const char * );
13650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13652 struct __ecereNameSpace__ecere__com__DefinedExpression
13654 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13655 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13658 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13659 } __attribute__ ((gcc_struct));
13661 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13663 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13665 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13667 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13669 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13671 extern struct Expression * CopyExpression(struct Expression * exp);
13673 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13675 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13677 static void ProcessStatement(struct Statement * stmt);
13679 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13681 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13683 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13685 extern char * sourceFile;
13687 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13689 void ProcessExpressionType(struct Expression * exp)
13691 unsigned int unresolved = 0x0;
13692 struct Location oldyylloc = yylloc;
13693 unsigned int notByReference = 0x0;
13695 if(!exp || exp->expType)
13702 struct Identifier * id = exp->identifier;
13704 if(!id || !topContext)
13706 if(id->_class && id->_class->name)
13708 id->classSym = id->_class->symbol;
13710 if(strstr(id->string, "__ecereClass") == id->string)
13712 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13715 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13717 ReplaceClassMembers(exp, thisClass);
13720 ProcessExpressionType(exp);
13723 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13728 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13732 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13738 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13741 ProcessExpressionType(exp);
13745 else if(currentClass && !id->_class)
13747 if(ResolveIdWithClass(exp, currentClass, 0x1))
13750 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13755 struct Type * type = symbol->type;
13756 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13758 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13760 struct Context * context = SetupTemplatesContext(_class);
13762 type = ReplaceThisClassType(_class);
13763 FinishTemplatesContext(context);
13765 type->refCount = 0;
13767 FreeSpecifier(id->_class);
13768 id->_class = (((void *)0));
13769 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13770 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13771 id->classSym = (((void *)0));
13772 exp->expType = type;
13775 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13776 exp->isConstant = 0x1;
13777 if(symbol->isParam || !strcmp(id->string, "this"))
13779 if(_class && _class->type == 1 && !type->declaredWithStruct)
13780 exp->byReference = 0x1;
13782 if(symbol->isIterator)
13784 if(symbol->isIterator == 3)
13787 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13788 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13789 exp->expType = (((void *)0));
13790 ProcessExpressionType(exp);
13792 else if(symbol->isIterator != 4)
13795 exp->member.exp = MkExpIdentifier(exp->identifier);
13796 exp->member.exp->expType = exp->expType;
13797 exp->member.member = MkIdentifier("data");
13798 exp->expType = (((void *)0));
13799 ProcessExpressionType(exp);
13806 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13808 if(thisNameSpace && !(id->_class && !id->_class->name))
13812 strcpy(name, thisNameSpace);
13813 strcat(name, "::");
13814 strcat(name, id->string);
13815 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13818 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13823 for(c = 0; c < definedExpStackPos; c++)
13824 if(definedExpStack[c] == definedExp)
13826 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
13828 struct Location backupYylloc = yylloc;
13829 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
13831 definedExpStack[definedExpStackPos++] = definedExp;
13832 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13833 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13834 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13836 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13837 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13838 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13839 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13841 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13842 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13844 parsedExpression = (((void *)0));
13846 expression_yyparse();
13847 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13849 fileInput = backInput;
13850 yylloc = backupYylloc;
13851 if(parsedExpression)
13853 FreeIdentifier(id);
13855 exp->list = MkListOne(parsedExpression);
13856 parsedExpression->loc = yylloc;
13857 ProcessExpressionType(exp);
13858 definedExpStackPos--;
13861 definedExpStackPos--;
13867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13873 struct GlobalData * data = (((void *)0));
13875 if(thisNameSpace && !(id->_class && !id->_class->name))
13879 strcpy(name, thisNameSpace);
13880 strcat(name, "::");
13881 strcat(name, id->string);
13882 data = FindGlobalData(name);
13885 data = FindGlobalData(id->string);
13888 DeclareGlobalData(data);
13889 exp->expType = data->dataType;
13891 data->dataType->refCount++;
13892 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13893 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13894 FreeSpecifier(id->_class);
13895 id->_class = (((void *)0));
13900 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13902 if(thisNameSpace && !(id->_class && !id->_class->name))
13906 strcpy(name, thisNameSpace);
13907 strcat(name, "::");
13908 strcat(name, id->string);
13909 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13912 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13917 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13918 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13920 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13921 strcpy(name, "__ecereFunction_");
13922 FullClassNameCat(name, id->string, 0x0);
13923 if(DeclareFunction(function, name))
13925 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13926 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13928 exp->expType = function->dataType;
13929 if(function->dataType)
13930 function->dataType->refCount++;
13931 FreeSpecifier(id->_class);
13932 id->_class = (((void *)0));
13944 struct __ecereNameSpace__ecere__com__Class * _class;
13946 if(!exp->instance->_class)
13948 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13950 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13953 ProcessInstantiationType(exp->instance);
13954 exp->isConstant = exp->instance->isConstant;
13955 if(exp->instance->_class)
13957 exp->expType = MkClassType(exp->instance->_class->name);
13965 char * constant = exp->constant;
13966 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13968 exp->expType = type;
13969 if(constant[0] == '\'')
13971 if((int)((unsigned char *)constant)[1] > 127)
13974 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13978 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13979 exp->constant = PrintUInt(ch);
13981 type->_class = FindClass("unichar");
13982 type->isSigned = 0x0;
13987 type->isSigned = 0x1;
13992 char * dot = strchr(constant, '.');
13993 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13998 exponent = strchr(constant, 'p');
14000 exponent = strchr(constant, 'P');
14004 exponent = strchr(constant, 'e');
14006 exponent = strchr(constant, 'E');
14008 if(dot || exponent)
14010 if(strchr(constant, 'f') || strchr(constant, 'F'))
14014 type->isSigned = 0x1;
14018 unsigned int isSigned = constant[0] == '-';
14019 long long i64 = strtoll(constant, (((void *)0)), 0);
14020 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
14021 unsigned int is64Bit = 0x0;
14025 if(i64 < (((int)0x80000000)))
14030 if(ui64 > (((int)0x7fffffff)))
14032 if(ui64 > (0xffffffff))
14035 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14039 else if(constant[0] != '0' || !constant[1])
14042 type->kind = is64Bit ? 4 : 3;
14043 type->isSigned = isSigned;
14046 exp->isConstant = 0x1;
14047 if(exp->destType && exp->destType->kind == 7)
14049 else if(exp->destType && exp->destType->kind == 6)
14051 else if(exp->destType && exp->destType->kind == 4)
14058 exp->isConstant = 0x1;
14059 exp->expType = __extension__ ({
14060 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14062 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14063 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14065 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14066 }), __ecereInstance2;
14072 ProcessExpressionType(exp->_new.size);
14073 exp->expType = __extension__ ({
14074 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14076 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14078 DeclareType(exp->expType->type, 0x0, 0x0);
14082 ProcessExpressionType(exp->_renew.size);
14083 ProcessExpressionType(exp->_renew.exp);
14084 exp->expType = __extension__ ({
14085 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14087 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14089 DeclareType(exp->expType->type, 0x0, 0x0);
14093 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14094 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14095 unsigned int useDestType = 0x0, useSideType = 0x0;
14096 struct Location oldyylloc = yylloc;
14097 unsigned int useSideUnit = 0x0;
14098 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14140 if(exp->op.op != '*' || exp->op.exp1)
14147 if(exp->op.op == '&')
14149 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14151 struct Identifier * id = exp->op.exp2->identifier;
14152 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14154 if(symbol && symbol->isIterator == 2)
14157 exp->member.exp = exp->op.exp2;
14158 exp->member.member = MkIdentifier("key");
14159 exp->expType = (((void *)0));
14160 exp->op.exp2->expType = symbol->type;
14161 symbol->type->refCount++;
14162 ProcessExpressionType(exp);
14170 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))
14172 if(exp->op.exp1->destType)
14173 FreeType(exp->op.exp1->destType);
14174 exp->op.exp1->destType = exp->destType;
14176 exp->destType->refCount++;
14180 if(exp->op.exp1->destType)
14181 FreeType(exp->op.exp1->destType);
14182 exp->op.exp1->destType = dummy;
14185 if(exp->op.exp1->destType && exp->op.op != '=')
14186 exp->op.exp1->destType->count++;
14187 ProcessExpressionType(exp->op.exp1);
14188 if(exp->op.exp1->destType && exp->op.op != '=')
14189 exp->op.exp1->destType->count--;
14190 if(exp->op.exp1->destType == dummy)
14193 exp->op.exp1->destType = (((void *)0));
14195 type1 = exp->op.exp1->expType;
14199 char expString[10240];
14201 expString[0] = '\0';
14202 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14206 exp->op.exp2->destType = exp->op.exp1->expType;
14207 if(exp->op.exp1->expType)
14208 exp->op.exp1->expType->refCount++;
14212 exp->op.exp2->destType = exp->destType;
14214 exp->destType->refCount++;
14218 exp->expType = type1;
14223 PrintExpression(exp->op.exp2, expString);
14224 if(type1 && type1->kind == 13)
14226 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)
14227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14228 else if(exp->op.op == '=')
14230 if(exp->op.exp2->destType)
14231 FreeType(exp->op.exp2->destType);
14232 exp->op.exp2->destType = type1;
14239 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)
14243 if(exp->op.exp2->destType)
14244 FreeType(exp->op.exp2->destType);
14245 exp->op.exp2->destType = type1;
14252 exp->expType = type1;
14254 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)))
14256 if(exp->op.exp2->destType)
14257 FreeType(exp->op.exp2->destType);
14258 exp->op.exp2->destType = exp->destType;
14260 exp->destType->refCount++;
14264 if(exp->op.exp2->destType)
14265 FreeType(exp->op.exp2->destType);
14266 exp->op.exp2->destType = dummy;
14269 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14271 FreeType(exp->op.exp2->destType);
14272 exp->op.exp2->destType = type1;
14275 if(exp->op.exp2->destType && exp->op.op != '=')
14276 exp->op.exp2->destType->count++;
14277 if(exp->op.op == SIZEOF)
14279 struct Expression * e = exp->op.exp2;
14281 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14283 if(e->type == 5 || e->type == 32 || e->type == 23)
14286 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14288 e = (*e->list).last;
14291 if(e->type == 11 && e->cast.exp)
14292 e->cast.exp->needCast = 0x1;
14294 ProcessExpressionType(exp->op.exp2);
14295 if(exp->op.exp2->destType && exp->op.op != '=')
14296 exp->op.exp2->destType->count--;
14297 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14299 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)
14301 if(exp->op.op != '=' && type1->type->kind == 0)
14302 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14304 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)))
14306 if(exp->op.op == ADD_ASSIGN)
14307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14309 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))
14311 if(exp->op.op == ADD_ASSIGN)
14312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14314 else if(inCompiler)
14316 char type1String[1024];
14317 char type2String[1024];
14319 type1String[0] = '\0';
14320 type2String[0] = '\0';
14321 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14322 PrintType(type1, type2String, 0x0, 0x1);
14323 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14324 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14327 if(exp->op.exp2->destType == dummy)
14330 exp->op.exp2->destType = (((void *)0));
14332 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14334 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14335 type2->refCount = 1;
14336 CopyTypeInto(type2, exp->op.exp2->expType);
14337 type2->isSigned = 0x1;
14339 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14341 type2 = __extension__ ({
14342 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14344 __ecereInstance1->kind = 3, __ecereInstance1;
14346 type2->refCount = 1;
14347 type2->isSigned = 0x1;
14351 type2 = exp->op.exp2->expType;
14357 if(exp->op.op == SIZEOF)
14359 exp->expType = __extension__ ({
14360 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14362 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14364 exp->isConstant = 0x1;
14366 else if(exp->op.op == '*' && !exp->op.exp1)
14368 exp->expType = Dereference(type2);
14369 if(type2 && type2->kind == 8)
14370 notByReference = 0x1;
14372 else if(exp->op.op == '&' && !exp->op.exp1)
14373 exp->expType = Reference(type2);
14380 if(exp->op.exp1->destType)
14381 FreeType(exp->op.exp1->destType);
14382 exp->op.exp1->destType = MkClassType("bool");
14383 exp->op.exp1->destType->truth = 0x1;
14384 if(!exp->op.exp1->expType)
14385 ProcessExpressionType(exp->op.exp1);
14387 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14388 FreeType(exp->op.exp1->expType);
14389 exp->op.exp1->expType = MkClassType("bool");
14390 exp->op.exp1->expType->truth = 0x1;
14394 if(exp->op.exp2->destType)
14395 FreeType(exp->op.exp2->destType);
14396 exp->op.exp2->destType = MkClassType("bool");
14397 exp->op.exp2->destType->truth = 0x1;
14398 if(!exp->op.exp2->expType)
14399 ProcessExpressionType(exp->op.exp2);
14401 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14402 FreeType(exp->op.exp2->expType);
14403 exp->op.exp2->expType = MkClassType("bool");
14404 exp->op.exp2->expType->truth = 0x1;
14407 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")))))
14409 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14411 if(exp->op.exp2->destType)
14412 FreeType(exp->op.exp2->destType);
14413 exp->op.exp2->destType = type1;
14415 if(exp->op.exp1->destType)
14416 FreeType(exp->op.exp1->destType);
14417 exp->op.exp1->destType = type2;
14419 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)
14420 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);
14421 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14423 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14427 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14429 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14430 ProcessExpressionType(exp->op.exp1);
14431 if(type2->kind != 13)
14433 ProcessExpressionType(classExp);
14434 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"))))))));
14435 if(!exp->op.exp2->expType)
14439 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14442 ProcessExpressionType(exp->op.exp2);
14446 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)))
14448 if(type1->kind != 8 && type1->type->kind == 0)
14449 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14450 exp->expType = type1;
14454 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)))
14456 if(type2->kind != 8 && type2->type->kind == 0)
14457 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14458 exp->expType = type2;
14462 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))
14464 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14468 unsigned int success = 0x0;
14470 if(type1->kind == 13 && type2->kind == 13)
14472 if(exp->op.op == '+')
14473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14474 else if(exp->op.op == '-')
14476 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14478 exp->expType = __extension__ ({
14479 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14481 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14484 if(type1->type->kind == 20)
14486 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14490 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14492 ProcessExpressionType(classExp);
14494 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")))))));
14495 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14503 if(!success && exp->op.exp1->type == 2)
14505 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14508 FreeType(exp->expType);
14509 exp->expType = exp->op.exp1->destType;
14510 if(exp->op.exp1->destType)
14511 exp->op.exp1->destType->refCount++;
14514 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14517 FreeType(exp->expType);
14518 exp->expType = exp->op.exp2->destType;
14519 if(exp->op.exp2->destType)
14520 exp->op.exp2->destType->refCount++;
14526 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14529 FreeType(exp->expType);
14530 exp->expType = exp->op.exp2->destType;
14531 if(exp->op.exp2->destType)
14532 exp->op.exp2->destType->refCount++;
14535 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14538 FreeType(exp->expType);
14539 exp->expType = exp->op.exp1->destType;
14540 if(exp->op.exp1->destType)
14541 exp->op.exp1->destType->refCount++;
14547 char expString1[10240];
14548 char expString2[10240];
14552 expString1[0] = '\0';
14553 expString2[0] = '\0';
14558 PrintExpression(exp->op.exp1, expString1);
14559 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14560 PrintExpression(exp->op.exp2, expString2);
14561 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14562 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14563 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14565 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14569 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14571 if(exp->op.exp1->destType)
14572 FreeType(exp->op.exp1->destType);
14573 exp->op.exp1->destType = type2->_class->registered->dataType;
14574 if(type2->_class->registered->dataType)
14575 type2->_class->registered->dataType->refCount++;
14576 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14577 exp->expType = type2;
14581 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14583 if(exp->op.exp2->destType)
14584 FreeType(exp->op.exp2->destType);
14585 exp->op.exp2->destType = type1->_class->registered->dataType;
14586 if(type1->_class->registered->dataType)
14587 type1->_class->registered->dataType->refCount++;
14588 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14589 exp->expType = type1;
14595 unsigned int valid = 0x0;
14597 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14599 if(exp->op.exp2->destType)
14600 FreeType(exp->op.exp2->destType);
14601 if(!type1->_class->registered->dataType)
14602 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14603 exp->op.exp2->destType = type1->_class->registered->dataType;
14604 exp->op.exp2->destType->refCount++;
14605 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14608 type2 = exp->op.exp2->destType;
14611 exp->expType = type2;
14614 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14616 if(exp->op.exp1->destType)
14617 FreeType(exp->op.exp1->destType);
14618 if(!type2->_class->registered->dataType)
14619 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14620 exp->op.exp1->destType = type2->_class->registered->dataType;
14621 exp->op.exp1->destType->refCount++;
14622 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14623 type1 = exp->op.exp1->destType;
14624 exp->expType = type1;
14627 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14629 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14631 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14634 FreeType(exp->expType);
14635 exp->expType = exp->op.exp1->expType;
14636 if(exp->op.exp2->expType)
14637 exp->op.exp1->expType->refCount++;
14641 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14643 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14646 FreeType(exp->expType);
14647 exp->expType = exp->op.exp2->expType;
14648 if(exp->op.exp2->expType)
14649 exp->op.exp2->expType->refCount++;
14656 if(exp->op.exp2->destType)
14657 FreeType(exp->op.exp2->destType);
14658 exp->op.exp2->destType = type1;
14660 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14663 FreeType(exp->expType);
14664 exp->expType = exp->op.exp2->destType;
14665 if(exp->op.exp2->destType)
14666 exp->op.exp2->destType->refCount++;
14668 else if(type1 && type2)
14670 char expString1[10240];
14671 char expString2[10240];
14672 char type1String[1024];
14673 char type2String[1024];
14675 expString1[0] = '\0';
14676 expString2[0] = '\0';
14677 type1String[0] = '\0';
14678 type2String[0] = '\0';
14681 PrintExpression(exp->op.exp1, expString1);
14682 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14683 PrintExpression(exp->op.exp2, expString2);
14684 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14685 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14686 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14688 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14689 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14691 exp->expType = exp->op.exp1->expType;
14692 if(exp->op.exp1->expType)
14693 exp->op.exp1->expType->refCount++;
14695 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14697 exp->expType = exp->op.exp2->expType;
14698 if(exp->op.exp2->expType)
14699 exp->op.exp2->expType->refCount++;
14706 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14708 struct Type * oldType = exp->op.exp1->expType;
14710 exp->op.exp1->expType = (((void *)0));
14711 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14714 exp->op.exp1->expType = oldType;
14716 if(exp->op.exp1->destType)
14717 FreeType(exp->op.exp1->destType);
14718 exp->op.exp1->destType = type2;
14720 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14723 FreeType(exp->expType);
14724 exp->expType = exp->op.exp1->destType;
14725 if(exp->op.exp1->destType)
14726 exp->op.exp1->destType->refCount++;
14730 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14732 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14734 if(exp->op.exp1->destType)
14735 FreeType(exp->op.exp1->destType);
14736 exp->op.exp1->destType = type2->_class->registered->dataType;
14737 if(type2->_class->registered->dataType)
14738 type2->_class->registered->dataType->refCount++;
14739 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14741 if(exp->op.op == '!')
14743 exp->expType = MkClassType("bool");
14744 exp->expType->truth = 0x1;
14748 exp->expType = type2;
14753 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14755 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14757 if(exp->op.exp2->destType)
14758 FreeType(exp->op.exp2->destType);
14759 exp->op.exp2->destType = type1->_class->registered->dataType;
14760 if(type1->_class->registered->dataType)
14761 type1->_class->registered->dataType->refCount++;
14762 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14764 exp->expType = type1;
14770 if(exp->op.exp1 && !exp->op.exp1->expType)
14772 char expString[10000];
14774 expString[0] = '\0';
14777 PrintExpression(exp->op.exp1, expString);
14778 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14781 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14783 if(exp->op.exp2 && !exp->op.exp2->expType)
14785 char expString[10240];
14787 expString[0] = '\0';
14790 PrintExpression(exp->op.exp2, expString);
14791 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14794 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14798 FreeType(exp->expType);
14799 exp->expType = MkClassType("bool");
14800 exp->expType->truth = 0x1;
14802 if(exp->op.op != SIZEOF)
14803 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14804 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14806 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14808 yylloc = oldyylloc;
14817 struct Expression * e;
14819 exp->isConstant = 0x1;
14820 for(e = (*exp->list).first; e; e = e->next)
14822 unsigned int inced = 0x0;
14826 FreeType(e->destType);
14827 e->destType = exp->destType;
14830 exp->destType->refCount++;
14831 e->destType->count++;
14835 ProcessExpressionType(e);
14837 exp->destType->count--;
14838 if(!exp->expType && !e->next)
14840 exp->expType = e->expType;
14842 e->expType->refCount++;
14845 exp->isConstant = 0x0;
14847 e = (*exp->list).first;
14848 if(!e->next && e->type == 8)
14850 struct Expression * next = exp->next, * prev = exp->prev;
14852 FreeType(exp->expType);
14853 FreeType(exp->destType);
14854 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14858 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14859 ProcessExpressionType(exp);
14865 struct Expression * e;
14867 exp->isConstant = 0x1;
14868 ProcessExpressionType(exp->index.exp);
14869 if(!exp->index.exp->isConstant)
14870 exp->isConstant = 0x0;
14871 if(exp->index.exp->expType)
14873 struct Type * source = exp->index.exp->expType;
14875 if(source->kind == 8 && source->_class && source->_class->registered)
14877 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14878 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14880 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14882 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14883 if(exp->index.index && (*exp->index.index).last)
14885 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14890 for(e = (*exp->index.index).first; e; e = e->next)
14892 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14895 FreeType(e->destType);
14896 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14898 ProcessExpressionType(e);
14903 exp->isConstant = 0x0;
14906 exp->expType = Dereference(exp->index.exp->expType);
14908 DeclareType(exp->expType, 0x0, 0x0);
14913 struct Expression * e;
14914 struct Type * functionType;
14915 struct Type * methodType = (((void *)0));
14921 PrintExpression(exp->call.exp, name);
14922 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14924 PrintExpression(exp->call.exp, name);
14927 if(exp->call.exp->type == 0)
14929 struct Expression * idExp = exp->call.exp;
14930 struct Identifier * id = idExp->identifier;
14932 if(!strcmp(id->string, "__builtin_frame_address"))
14934 exp->expType = ProcessTypeString("void *", 0x1);
14935 if(exp->call.arguments && (*exp->call.arguments).first)
14936 ProcessExpressionType((*exp->call.arguments).first);
14939 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14941 exp->expType = ProcessTypeString("int", 0x1);
14942 if(exp->call.arguments && (*exp->call.arguments).first)
14943 ProcessExpressionType((*exp->call.arguments).first);
14946 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14948 struct Expression * a = (((void *)0));
14949 struct Expression * b = (((void *)0));
14950 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14952 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14954 a = (*exp->call.arguments).first;
14955 b = (*exp->call.arguments).last;
14959 else if((*exp->call.arguments).count == 1)
14961 a = (*exp->call.arguments).first;
14966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14967 idExp->identifier = (((void *)0));
14968 FreeExpContents(exp);
14969 ProcessExpressionType(a);
14971 ProcessExpressionType(b);
14973 exp->list = MkList();
14974 if(a->expType && (!b || b->expType))
14976 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14981 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14982 struct Declaration * decl;
14983 char temp1[1024], temp2[1024];
14985 GetTypeSpecs(a->expType, specs);
14986 if(a && !a->isConstant && a->type != 0)
14988 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14989 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14990 tempExp1 = QMkExpId(temp1);
14991 tempExp1->expType = a->expType;
14993 a->expType->refCount++;
14994 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14996 if(b && !b->isConstant && b->type != 0)
14998 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14999 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15000 tempExp2 = QMkExpId(temp2);
15001 tempExp2->expType = b->expType;
15003 b->expType->refCount++;
15004 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15006 decl = MkDeclaration(specs, decls);
15007 if(!curCompound->compound.declarations)
15008 curCompound->compound.declarations = MkList();
15009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15013 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15015 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15017 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15018 exp->expType = a->expType;
15020 a->expType->refCount++;
15022 else if(!strcmp(id->string, "Abs"))
15024 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15025 exp->expType = a->expType;
15027 a->expType->refCount++;
15029 else if(!strcmp(id->string, "Sgn"))
15031 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"))))));
15032 exp->expType = ProcessTypeString("int", 0x0);
15034 FreeExpression(tempExp1);
15036 FreeExpression(tempExp2);
15037 FreeIdentifier(id);
15043 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15045 if(!exp->call.exp->destType)
15047 exp->call.exp->destType = dummy;
15050 ProcessExpressionType(exp->call.exp);
15051 if(exp->call.exp->destType == dummy)
15054 exp->call.exp->destType = (((void *)0));
15058 functionType = exp->call.exp->expType;
15059 if(functionType && functionType->kind == 16)
15061 methodType = functionType;
15062 functionType = methodType->method->dataType;
15063 if(exp->call.exp->expType->usedClass)
15065 char typeString[1024];
15067 typeString[0] = '\0';
15069 struct Symbol * back = functionType->thisClass;
15071 functionType->thisClass = (((void *)0));
15072 PrintType(functionType, typeString, 0x1, 0x1);
15073 functionType->thisClass = back;
15075 if(strstr(typeString, "thisclass"))
15077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15078 struct Declarator * decl;
15081 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15083 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15084 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15085 thisClassParams = 0x0;
15086 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15088 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15090 thisClass = exp->call.exp->expType->usedClass;
15091 ProcessDeclarator(decl);
15092 thisClass = backupThisClass;
15094 thisClassParams = 0x1;
15095 functionType = ProcessType(specs, decl);
15096 functionType->refCount = 0;
15097 FinishTemplatesContext(context);
15099 FreeList(specs, FreeSpecifier);
15100 FreeDeclarator(decl);
15104 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15106 struct Type * type = functionType->type;
15108 if(!functionType->refCount)
15110 functionType->type = (((void *)0));
15111 FreeType(functionType);
15113 functionType = type;
15115 if(functionType && functionType->kind != 11)
15117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15119 else if(functionType)
15121 unsigned int emptyParams = 0x0, noParams = 0x0;
15122 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15123 struct Type * type = functionType->params.first;
15124 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15126 struct Location oldyylloc = yylloc;
15130 if(functionType->extraParam && e && functionType->thisClass)
15132 e->destType = MkClassType(functionType->thisClass->string);
15135 if(!functionType->staticMethod && !functionType->extraParam)
15137 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15139 type = MkClassType(memberExp->member.exp->expType->_class->string);
15142 e->destType = type;
15144 type = functionType->params.first;
15147 type->refCount = 0;
15149 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15151 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15152 type->byReference = functionType->byReference;
15153 type->typedByReference = functionType->typedByReference;
15156 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15158 e->destType = type;
15160 type = functionType->params.first;
15163 type->refCount = 0;
15166 if(type && type->kind == 0)
15169 if(!type->refCount)
15171 type = (((void *)0));
15173 for(; e; e = e->next)
15175 if(!type && !emptyParams)
15178 if(methodType && methodType->methodClass)
15179 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);
15181 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);
15184 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15186 struct Type * templatedType = (((void *)0));
15187 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15188 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15191 if(_class && _class->templateArgs)
15193 struct __ecereNameSpace__ecere__com__Class * sClass;
15195 for(sClass = _class; sClass; sClass = sClass->base)
15197 if(sClass->templateClass)
15198 sClass = sClass->templateClass;
15200 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15202 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15204 struct __ecereNameSpace__ecere__com__Class * nextClass;
15206 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15208 if(nextClass->templateClass)
15209 nextClass = nextClass->templateClass;
15210 id += nextClass->templateParams.count;
15220 if(curParam && _class->templateArgs[id].dataTypeString)
15222 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15225 struct Context * context = SetupTemplatesContext(_class);
15227 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15228 FinishTemplatesContext(context);
15230 e->destType = templatedType;
15233 templatedType->passAsTemplate = 0x1;
15238 e->destType = type;
15245 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15247 e->destType = type->prev;
15248 e->destType->refCount++;
15252 e->destType = type;
15257 if(type && type->kind != 14)
15259 struct Type * next = type->next;
15261 if(!type->refCount)
15266 if(type && type->kind != 14)
15268 if(methodType && methodType->methodClass)
15269 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);
15271 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);
15273 yylloc = oldyylloc;
15274 if(type && !type->refCount)
15279 functionType = __extension__ ({
15280 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15282 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15284 if(exp->call.exp->type == 0)
15286 char * string = exp->call.exp->identifier->string;
15290 struct Symbol * symbol;
15291 struct Location oldyylloc = yylloc;
15293 yylloc = exp->call.exp->identifier->loc;
15294 if(strstr(string, "__builtin_") == string)
15298 functionType->returnType = exp->destType;
15299 exp->destType->refCount++;
15303 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15304 symbol = __extension__ ({
15305 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15307 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15309 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15310 if(strstr(symbol->string, "::"))
15311 globalContext->hasNameSpace = 0x1;
15312 yylloc = oldyylloc;
15315 else if(exp->call.exp->type == 8)
15319 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15320 if(!functionType->returnType)
15322 functionType->returnType = __extension__ ({
15323 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15325 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15329 if(functionType && functionType->kind == 11)
15331 exp->expType = functionType->returnType;
15332 if(functionType->returnType)
15333 functionType->returnType->refCount++;
15334 if(!functionType->refCount)
15335 FreeType(functionType);
15337 if(exp->call.arguments)
15339 for(e = (*exp->call.arguments).first; e; e = e->next)
15341 struct Type * destType = e->destType;
15343 ProcessExpressionType(e);
15350 struct Type * type;
15351 struct Location oldyylloc = yylloc;
15352 unsigned int thisPtr;
15353 struct Expression * checkExp = exp->member.exp;
15357 if(checkExp->type == 11)
15358 checkExp = checkExp->cast.exp;
15359 else if(checkExp->type == 5)
15360 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15364 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15365 exp->thisPtr = thisPtr;
15366 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15368 exp->member.member->classSym = exp->member.member->_class->symbol;
15370 ProcessExpressionType(exp->member.exp);
15371 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)
15373 exp->isConstant = 0x0;
15376 exp->isConstant = exp->member.exp->isConstant;
15377 type = exp->member.exp->expType;
15379 if(type && (type->kind == 20))
15381 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15382 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15386 for(param = _class->templateParams.first; param; param = param->next)
15388 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15392 if(param && param->defaultArg.member)
15394 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15398 struct Expression * expMember = exp->member.exp;
15399 struct Declarator * decl;
15400 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15401 char thisClassTypeString[1024];
15403 FreeIdentifier(exp->member.member);
15404 ProcessExpressionType(argExp);
15406 char * colon = strstr(param->defaultArg.memberString, "::");
15410 char className[1024];
15411 struct __ecereNameSpace__ecere__com__Class * sClass;
15413 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15414 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15417 strcpy(thisClassTypeString, _class->fullName);
15419 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15420 exp->expType = ProcessType(specs, decl);
15421 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15423 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15424 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15426 int paramCount = 0;
15427 int lastParam = -1;
15428 char templateString[1024];
15429 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15431 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15432 for(cClass = expClass; cClass; cClass = cClass->base)
15436 for(param = cClass->templateParams.first; param; param = param->next)
15439 struct __ecereNameSpace__ecere__com__Class * sClass;
15440 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15442 for(sClass = cClass->base; sClass; sClass = sClass->base)
15443 id += sClass->templateParams.count;
15444 arg = expClass->templateArgs[id];
15445 for(sClass = _class; sClass; sClass = sClass->base)
15447 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15449 struct __ecereNameSpace__ecere__com__Class * nextClass;
15451 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15452 p += nextClass->templateParams.count;
15453 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15455 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15457 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15459 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15460 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15467 char argument[256];
15469 argument[0] = '\0';
15470 switch(param->type)
15474 char expString[1024];
15475 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15476 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15477 struct Expression * exp;
15478 char * string = PrintHexUInt64(arg.expression.ui64);
15480 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15481 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15482 ProcessExpressionType(exp);
15483 ComputeExpression(exp);
15484 expString[0] = '\0';
15485 PrintExpression(exp, expString);
15486 strcat(argument, expString);
15487 FreeExpression(exp);
15492 strcat(argument, arg.member->name);
15497 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15499 if(!strcmp(arg.dataTypeString, "thisclass"))
15500 strcat(argument, thisClassTypeString);
15502 strcat(argument, arg.dataTypeString);
15510 strcat(templateString, ", ");
15511 if(lastParam != p - 1)
15513 strcat(templateString, param->name);
15514 strcat(templateString, " = ");
15516 strcat(templateString, argument);
15525 int len = strlen(templateString);
15527 if(templateString[len - 1] == '>')
15528 templateString[len++] = ' ';
15529 templateString[len++] = '>';
15530 templateString[len++] = '\0';
15533 struct Context * context = SetupTemplatesContext(_class);
15535 FreeType(exp->expType);
15536 exp->expType = ProcessTypeString(templateString, 0x0);
15537 FinishTemplatesContext(context);
15541 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")))))))));
15544 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15546 type = ProcessTemplateParameterType(type->templateParameter);
15549 if(type && (type->kind == 20))
15551 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)))
15553 struct Identifier * id = exp->member.member;
15554 int typeKind = type->kind;
15555 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));
15557 if(typeKind == 19 && exp->member.exp->type == 24)
15559 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15564 if(typeKind == 3 || typeKind == 15)
15565 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15568 if(type->kind == 8 && type->_class && type->_class->registered)
15570 _class = type->_class->registered;
15572 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15574 _class = FindClass("char *")->registered;
15576 else if(type->kind == 13)
15578 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15579 FreeType(exp->expType);
15580 exp->expType = ProcessTypeString("uintptr", 0x0);
15581 exp->byReference = 0x1;
15585 char string[1024] = "";
15586 struct Symbol * classSym;
15588 PrintTypeNoConst(type, string, 0x0, 0x1);
15589 classSym = FindClass(string);
15591 _class = classSym->registered;
15597 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15598 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15599 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15600 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15601 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15603 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15604 exp->member.memberType = 1;
15605 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15609 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15611 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15612 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15614 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15616 member = (((void *)0));
15618 if(!member && !prop)
15619 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15620 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15621 exp->member.thisPtr = 0x1;
15627 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15628 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15629 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15631 if(!prop && !member)
15633 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15636 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15637 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15638 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15643 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15644 prop = (((void *)0));
15646 member = (((void *)0));
15650 if(!prop && !member && !method)
15651 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15652 if(!prop && !member && !method)
15656 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15659 exp->member.memberType = 5;
15660 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15664 char structName[1024];
15665 struct Identifier * id = exp->member.member;
15666 struct Expression * classExp = exp->member.exp;
15669 FreeType(classExp->expType);
15670 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15671 strcpy(structName, "__ecereClassData_");
15672 FullClassNameCat(structName, type->_class->string, 0x0);
15674 exp->member.member = id;
15675 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"))))))));
15677 ProcessExpressionType(exp);
15683 struct Symbol * classSym = FindClass(id->string);
15687 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15690 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15696 exp->member.memberType = 1;
15697 if(!prop->dataType)
15698 ProcessPropertyType(prop);
15699 exp->expType = prop->dataType;
15701 prop->dataType->refCount++;
15705 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15707 FreeExpContents(exp);
15709 exp->identifier = MkIdentifier("class");
15710 ProcessExpressionType(exp);
15713 exp->member.memberType = 3;
15714 DeclareStruct(_class->fullName, 0x0);
15715 if(!member->dataType)
15717 struct Context * context = SetupTemplatesContext(_class);
15719 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15720 FinishTemplatesContext(context);
15722 exp->expType = member->dataType;
15723 if(member->dataType)
15724 member->dataType->refCount++;
15726 else if(revConvert)
15728 exp->member.memberType = 4;
15729 exp->expType = MkClassType(revConvert->_class->fullName);
15734 exp->member.memberType = 2;
15736 if(!method->dataType)
15737 ProcessMethodType(method);
15738 exp->expType = __extension__ ({
15739 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15741 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15743 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15744 exp->expType->usedClass = _class;
15746 else if(!classProp)
15748 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15750 FreeExpContents(exp);
15752 exp->identifier = MkIdentifier("class");
15753 FreeType(exp->expType);
15754 exp->expType = MkClassType("ecere::com::Class");
15757 yylloc = exp->member.member->loc;
15758 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15760 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15762 if(_class && exp->expType)
15764 struct __ecereNameSpace__ecere__com__Class * tClass;
15767 while(tClass && !tClass->templateClass)
15768 tClass = tClass->base;
15769 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15772 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15773 struct __ecereNameSpace__ecere__com__Class * sClass;
15775 for(sClass = tClass; sClass; sClass = sClass->base)
15778 if(sClass->templateClass)
15779 sClass = sClass->templateClass;
15780 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15782 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15784 for(sClass = sClass->base; sClass; sClass = sClass->base)
15785 id += sClass->templateParams.count;
15793 if(curParam && tClass->templateArgs[id].dataTypeString)
15795 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15796 struct Context * context = SetupTemplatesContext(tClass);
15798 FreeType(exp->expType);
15799 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15802 if(exp->expType->kind == 21)
15804 FreeType(exp->expType);
15805 exp->expType = ReplaceThisClassType(_class);
15807 if(tClass->templateClass)
15808 exp->expType->passAsTemplate = 0x1;
15811 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15812 if(exp->destType->kind == 21)
15814 FreeType(exp->destType);
15815 exp->destType = ReplaceThisClassType(_class);
15819 FinishTemplatesContext(context);
15822 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15825 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15826 struct __ecereNameSpace__ecere__com__Class * sClass;
15828 for(sClass = tClass; sClass; sClass = sClass->base)
15831 if(sClass->templateClass)
15832 sClass = sClass->templateClass;
15833 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15835 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15837 for(sClass = sClass->base; sClass; sClass = sClass->base)
15838 id += sClass->templateParams.count;
15848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15849 struct Context * context = SetupTemplatesContext(tClass);
15850 struct Type * basicType;
15852 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15855 if(basicType->kind == 21)
15857 FreeType(basicType);
15858 basicType = ReplaceThisClassType(_class);
15860 FreeType(exp->expType);
15861 exp->expType = __extension__ ({
15862 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15864 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15868 exp->destType = exp->expType;
15869 exp->destType->refCount++;
15872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15873 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15874 struct Declarator * decl;
15876 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15879 exp->destType->refCount++;
15881 exp->expType->refCount++;
15883 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15884 exp->cast.exp = newExp;
15887 FinishTemplatesContext(context);
15890 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15892 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15896 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15899 int paramCount = 0;
15900 int lastParam = -1;
15901 char templateString[1024];
15902 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15904 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15905 while(cClass != expClass)
15907 struct __ecereNameSpace__ecere__com__Class * sClass;
15909 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15912 for(param = cClass->templateParams.first; param; param = param->next)
15914 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15917 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15918 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15920 while(cClassCur != tClass && !paramCur)
15922 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15924 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15926 cClassCur = sClassCur;
15927 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15929 if(!strcmp(paramCur->name, param->name))
15936 if(paramCur && paramCur->type == 0)
15937 arg = tClass->templateArgs[cp];
15939 arg = expClass->templateArgs[p];
15941 char argument[256];
15943 argument[0] = '\0';
15944 switch(param->type)
15948 char expString[1024];
15949 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15950 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15951 struct Expression * exp;
15952 char * string = PrintHexUInt64(arg.expression.ui64);
15954 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15955 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15956 ProcessExpressionType(exp);
15957 ComputeExpression(exp);
15958 expString[0] = '\0';
15959 PrintExpression(exp, expString);
15960 strcat(argument, expString);
15961 FreeExpression(exp);
15966 strcat(argument, arg.member->name);
15971 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15972 strcat(argument, arg.dataTypeString);
15979 strcat(templateString, ", ");
15980 if(lastParam != p - 1)
15982 strcat(templateString, param->name);
15983 strcat(templateString, " = ");
15985 strcat(templateString, argument);
15994 int len = strlen(templateString);
15996 if(templateString[len - 1] == '>')
15997 templateString[len++] = ' ';
15998 templateString[len++] = '>';
15999 templateString[len++] = '\0';
16001 FreeType(exp->expType);
16003 struct Context * context = SetupTemplatesContext(tClass);
16005 exp->expType = ProcessTypeString(templateString, 0x0);
16006 FinishTemplatesContext(context);
16013 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)");
16015 else if(type && (type->kind == 9 || type->kind == 10))
16017 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16021 exp->expType = memberType;
16023 memberType->refCount++;
16028 char expString[10240];
16030 expString[0] = '\0';
16033 PrintExpression(exp, expString);
16034 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16036 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16038 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16040 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16042 struct Identifier * id = exp->member.member;
16043 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));
16047 FreeType(exp->expType);
16048 exp->expType = ReplaceThisClassType(_class);
16052 yylloc = oldyylloc;
16057 struct Type * destType = exp->destType;
16059 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16061 exp->member.member->classSym = exp->member.member->_class->symbol;
16063 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16067 ProcessExpressionType(exp);
16074 struct Symbol * classSym = exp->_class->symbol;
16076 if(classSym && classSym->registered)
16078 if(classSym->registered->type == 5)
16083 DeclareStruct(classSym->string, 0x0);
16084 FreeSpecifier(exp->_class);
16086 FullClassNameCat(name, classSym->string, 0x0);
16087 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16091 if(classSym->registered->fixed)
16093 FreeSpecifier(exp->_class);
16094 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16099 char className[1024];
16101 strcpy(className, "__ecereClass_");
16102 FullClassNameCat(className, classSym->string, 0x1);
16103 MangleClassName(className);
16104 DeclareClass(classSym, className);
16105 FreeExpContents(exp);
16107 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16108 exp->member.member = MkIdentifier("structSize");
16112 exp->expType = __extension__ ({
16113 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16115 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16121 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16123 exp->expType = __extension__ ({
16124 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16126 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16128 exp->isConstant = 0x1;
16129 DeclareType(type, 0x0, 0x0);
16135 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16138 FreeType(exp->cast.exp->destType);
16139 exp->cast.exp->destType = type;
16141 ProcessExpressionType(exp->cast.exp);
16143 exp->expType = type;
16144 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16146 void * prev = exp->prev, * next = exp->next;
16147 struct Type * expType = exp->cast.exp->destType;
16148 struct Expression * castExp = exp->cast.exp;
16149 struct Type * destType = exp->destType;
16152 expType->refCount++;
16153 FreeType(exp->expType);
16154 FreeTypeName(exp->cast.typeName);
16156 FreeType(exp->expType);
16157 FreeType(exp->destType);
16158 exp->expType = expType;
16159 exp->destType = destType;
16160 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16166 exp->isConstant = exp->cast.exp->isConstant;
16172 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16174 exp->expType = type;
16179 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16181 ProcessExpressionType(exp->vaArg.exp);
16182 exp->expType = type;
16187 struct Expression * e;
16189 exp->isConstant = 0x1;
16190 FreeType(exp->cond.cond->destType);
16191 exp->cond.cond->destType = MkClassType("bool");
16192 exp->cond.cond->destType->truth = 0x1;
16193 ProcessExpressionType(exp->cond.cond);
16194 if(!exp->cond.cond->isConstant)
16195 exp->isConstant = 0x0;
16196 for(e = (*exp->cond.exp).first; e; e = e->next)
16200 FreeType(e->destType);
16201 e->destType = exp->destType;
16203 e->destType->refCount++;
16205 ProcessExpressionType(e);
16208 exp->expType = e->expType;
16210 e->expType->refCount++;
16213 exp->isConstant = 0x0;
16215 FreeType(exp->cond.elseExp->destType);
16216 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16217 if(exp->cond.elseExp->destType)
16218 exp->cond.elseExp->destType->refCount++;
16219 ProcessExpressionType(exp->cond.elseExp);
16220 if(!exp->cond.elseExp->isConstant)
16221 exp->isConstant = 0x0;
16226 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16228 struct Statement * last = (*exp->compound->compound.statements).last;
16230 if(last->type == 3 && last->expressions && (*last->expressions).last)
16232 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16234 exp->destType->refCount++;
16236 ProcessStatement(exp->compound);
16237 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16239 exp->expType->refCount++;
16245 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16247 if(spec && spec->type == 1)
16249 exp->expType = MkClassType(spec->name);
16250 exp->expType->kind = 19;
16251 exp->byReference = 0x1;
16255 exp->expType = MkClassType("ecere::com::Class");
16256 exp->byReference = 0x1;
16262 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16266 struct Identifier * id = exp->classData.id;
16267 char structName[1024];
16268 struct Expression * classExp;
16270 strcpy(structName, "__ecereClassData_");
16271 FullClassNameCat(structName, _class->fullName, 0x0);
16273 exp->member.member = id;
16274 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16275 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16277 classExp = MkExpIdentifier(MkIdentifier("class"));
16278 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"))))))));
16279 ProcessExpressionType(exp);
16286 struct Type * type = (((void *)0));
16287 char * typeString = (((void *)0));
16288 char typeStringBuf[1024];
16290 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))
16292 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16294 typeString = templateClass->templateArgs[2].dataTypeString;
16298 struct Expression * e;
16300 for(e = (*exp->list).first; e; e = e->next)
16302 ProcessExpressionType(e);
16312 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16316 e->expType = (((void *)0));
16317 e = (*exp->list).first;
16318 ProcessExpressionType(e);
16321 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16323 FreeType(e->expType);
16324 e->expType = (((void *)0));
16326 type = (((void *)0));
16334 FreeType(e->expType);
16335 e->expType = (((void *)0));
16341 typeStringBuf[0] = '\0';
16342 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16343 typeString = typeStringBuf;
16345 type = (((void *)0));
16350 char templateString[1024];
16351 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16352 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16353 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16354 struct Expression * expExt;
16355 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16357 sprintf(templateString, "Container<%s>", typeString);
16360 struct Expression * e;
16362 type = ProcessTypeString(typeString, 0x0);
16363 while(e = (*exp->list).first)
16365 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16366 e->destType = type;
16368 ProcessExpressionType(e);
16369 ListAdd(initializers, MkInitializerAssignment(e));
16372 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16374 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16375 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16376 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16377 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16378 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16379 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16380 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16381 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16382 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16383 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16384 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16386 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16388 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16389 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16390 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16391 exp->expType = ProcessTypeString(templateString, 0x0);
16393 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16394 ProcessExpressionType(expExt);
16398 exp->expType = ProcessTypeString("Container", 0x0);
16399 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16404 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16406 FreeType(exp->expType);
16407 exp->expType = ReplaceThisClassType(thisClass);
16409 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16411 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16415 if(exp->expType->kind != 15)
16417 struct Type * member;
16418 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16420 FreeType(exp->expType);
16421 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16422 exp->expType->kind = symbol->type->kind;
16423 exp->expType->refCount++;
16424 exp->expType->enumName = enumName;
16425 exp->expType->members = symbol->type->members;
16426 for(member = symbol->type->members.first; member; member = member->next)
16427 member->refCount++;
16431 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16433 for(member = symbol->type->members.first; member; member = member->next)
16435 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16443 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16445 else if(exp->destType && !exp->destType->keepCast)
16447 if(!CheckExpressionType(exp, exp->destType, 0x0))
16449 if(!exp->destType->count || unresolved)
16454 if(exp->destType->kind != 14)
16461 char expString[10240];
16463 expString[0] = '\0';
16464 PrintType(exp->destType, type2, 0x0, 0x1);
16467 PrintExpression(exp, expString);
16468 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16471 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16472 else if(exp->type != 16)
16473 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16478 char expString[10240];
16480 expString[0] = '\0';
16483 PrintExpression(exp, expString);
16484 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16488 else if(exp->type != 16)
16489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16501 PrintType(exp->expType, type1, 0x0, 0x1);
16502 PrintType(exp->destType, type2, 0x0, 0x1);
16504 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)))
16508 char expString[10240];
16510 expString[0] = '\0';
16513 PrintExpression(exp, expString);
16514 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16516 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16518 FreeType(exp->expType);
16519 exp->destType->refCount++;
16520 exp->expType = exp->destType;
16525 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16527 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16528 char typeString[1024];
16529 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16530 struct Declarator * decl;
16532 typeString[0] = '\0';
16535 exp->expType->refCount++;
16537 exp->expType->refCount++;
16539 newExp->destType = exp->expType;
16540 PrintType(exp->expType, typeString, 0x0, 0x0);
16541 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16542 exp->cast.typeName = MkTypeName(specs, decl);
16543 exp->cast.exp = newExp;
16546 else if(unresolved)
16548 if(exp->identifier->_class && exp->identifier->_class->name)
16549 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16550 else if(exp->identifier->string && exp->identifier->string[0])
16551 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16553 else if(!exp->expType && exp->type != 16)
16555 char expString[10240];
16557 expString[0] = '\0';
16560 PrintExpression(exp, expString);
16561 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16563 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16566 ApplyAnyObjectLogic(exp);
16567 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)))
16569 exp->byReference = 0x1;
16571 yylloc = oldyylloc;
16574 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)
16578 *curMember = (*curMember)->next;
16579 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16581 *curMember = subMemberStack[--(*subMemberStackPos)];
16582 *curMember = (*curMember)->next;
16584 while((*curMember) && (*curMember)->isProperty)
16585 *curMember = (*curMember)->next;
16586 if(subMemberStackPos)
16588 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16590 subMemberStack[(*subMemberStackPos)++] = *curMember;
16591 *curMember = (*curMember)->members.first;
16592 while(*curMember && (*curMember)->isProperty)
16593 *curMember = (*curMember)->next;
16601 if(subMemberStackPos && *subMemberStackPos)
16603 *curMember = subMemberStack[--(*subMemberStackPos)];
16604 *curMember = (*curMember)->next;
16608 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16610 if(*curClass == _class)
16612 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16614 *curMember = (*curClass)->membersAndProperties.first;
16616 while((*curMember) && (*curMember)->isProperty)
16617 *curMember = (*curMember)->next;
16618 if(subMemberStackPos)
16620 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16622 subMemberStack[(*subMemberStackPos)++] = *curMember;
16623 *curMember = (*curMember)->members.first;
16624 while(*curMember && (*curMember)->isProperty)
16625 *curMember = (*curMember)->next;
16632 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16637 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16639 if(init->exp && !init->exp->destType)
16641 FreeType(init->exp->destType);
16642 init->exp->destType = type;
16648 ProcessExpressionType(init->exp);
16649 init->isConstant = init->exp->isConstant;
16655 struct Expression * exp = init->exp;
16656 struct Instantiation * inst = exp->instance;
16657 struct MembersInit * members;
16660 init->list = MkList();
16663 for(members = (*inst->members).first; members; members = members->next)
16665 if(members->type == 0)
16667 struct MemberInit * member;
16669 for(member = (*members->dataMembers).first; member; member = member->next)
16671 ListAdd(init->list, member->initializer);
16672 member->initializer = (((void *)0));
16677 FreeExpression(exp);
16681 struct Initializer * i;
16682 struct Type * initializerType = (((void *)0));
16683 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16684 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16685 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16686 int subMemberStackPos = 0;
16688 if(type && type->kind == 12)
16689 initializerType = Dereference(type);
16690 else if(type && (type->kind == 9 || type->kind == 10))
16691 initializerType = type->members.first;
16692 for(i = (*init->list).first; i; i = i->next)
16694 if(type && type->kind == 8 && type->_class && type->_class->registered)
16696 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16699 if(!curMember->dataType)
16700 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16701 initializerType = curMember->dataType;
16704 ProcessInitializer(i, initializerType);
16705 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16706 initializerType = initializerType->next;
16708 init->isConstant = 0x0;
16710 if(type && type->kind == 12)
16711 FreeType(initializerType);
16712 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16721 extern struct Symbol * FindType(struct Context * ctx, char * name);
16723 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16725 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16731 if(spec->specifier == THISCLASS)
16736 spec->name = ReplaceThisClass(thisClass);
16737 spec->symbol = FindClass(spec->name);
16738 ProcessSpecifier(spec, declareStruct);
16745 struct Symbol * symbol = FindType(curContext, spec->name);
16748 DeclareType(symbol->type, 0x1, 0x1);
16749 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16750 DeclareStruct(spec->name, 0x0);
16755 struct Enumerator * e;
16759 for(e = (*spec->list).first; e; e = e->next)
16762 ProcessExpressionType(e->exp);
16770 if(spec->definitions)
16772 struct ClassDef * def;
16773 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16775 ProcessClass(spec->definitions, symbol);
16782 static void ProcessDeclarator(struct Declarator * decl)
16787 if(decl->identifier->classSym)
16789 FreeSpecifier(decl->identifier->_class);
16790 decl->identifier->_class = (((void *)0));
16794 if(decl->array.exp)
16795 ProcessExpressionType(decl->array.exp);
16802 if(decl->declarator)
16803 ProcessDeclarator(decl->declarator);
16804 if(decl->type == 4)
16806 struct Identifier * id = GetDeclId(decl);
16808 if(id && id->_class)
16810 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16812 if(!decl->function.parameters)
16813 decl->function.parameters = MkList();
16814 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16815 id->_class = (((void *)0));
16817 if(decl->function.parameters)
16819 struct TypeName * param;
16821 for(param = (*decl->function.parameters).first; param; param = param->next)
16823 if(param->qualifiers && (*param->qualifiers).first)
16825 struct Specifier * spec = (*param->qualifiers).first;
16827 if(spec && spec->specifier == TYPED_OBJECT)
16829 struct Declarator * d = param->declarator;
16830 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);
16832 FreeList(param->qualifiers, FreeSpecifier);
16833 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16834 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16835 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16838 else if(spec && spec->specifier == ANY_OBJECT)
16840 struct Declarator * d = param->declarator;
16842 FreeList(param->qualifiers, FreeSpecifier);
16843 param->qualifiers = MkListOne(MkSpecifier(VOID));
16844 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16846 else if(spec->specifier == THISCLASS)
16851 spec->name = ReplaceThisClass(thisClass);
16852 spec->symbol = FindClass(spec->name);
16853 ProcessSpecifier(spec, 0x0);
16857 if(param->declarator)
16858 ProcessDeclarator(param->declarator);
16866 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16868 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16870 static void ProcessDeclaration(struct Declaration * decl)
16872 yylloc = decl->loc;
16877 unsigned int declareStruct = 0x0;
16879 if(decl->declarators)
16881 struct InitDeclarator * d;
16883 for(d = (*decl->declarators).first; d; d = d->next)
16885 struct Type * type, * subType;
16887 ProcessDeclarator(d->declarator);
16888 type = ProcessType(decl->specifiers, d->declarator);
16891 ProcessInitializer(d->initializer, type);
16892 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16894 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16896 struct Instantiation * inst = d->initializer->exp->instance;
16898 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16899 d->initializer->exp->instance = (((void *)0));
16900 if(decl->specifiers)
16901 FreeList(decl->specifiers, FreeSpecifier);
16902 FreeList(decl->declarators, FreeInitDeclarator);
16909 for(subType = type; subType; )
16911 if(subType->kind == 8)
16913 declareStruct = 0x1;
16916 else if(subType->kind == 13)
16918 else if(subType->kind == 12)
16919 subType = subType->arrayType;
16928 if(decl->specifiers)
16930 struct Specifier * s;
16932 for(s = (*decl->specifiers).first; s; s = s->next)
16934 ProcessSpecifier(s, declareStruct);
16941 ProcessInstantiationType(decl->inst);
16946 struct Specifier * spec;
16947 struct Declarator * d;
16948 unsigned int declareStruct = 0x0;
16950 if(decl->declarators)
16952 for(d = (*decl->declarators).first; d; d = d->next)
16954 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16955 struct Type * subType;
16957 ProcessDeclarator(d);
16958 for(subType = type; subType; )
16960 if(subType->kind == 8)
16962 declareStruct = 0x1;
16965 else if(subType->kind == 13)
16967 else if(subType->kind == 12)
16968 subType = subType->arrayType;
16975 if(decl->specifiers)
16977 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16978 ProcessSpecifier(spec, declareStruct);
16985 static struct FunctionDefinition * curFunction;
16987 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16989 char propName[1024], propNameM[1024];
16990 char getName[1024], setName[1024];
16991 struct __ecereNameSpace__ecere__sys__OldList * args;
16993 DeclareProperty(prop, setName, getName);
16994 strcpy(propName, "__ecereProp_");
16995 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16996 strcat(propName, "_");
16997 FullClassNameCat(propName, prop->name, 0x1);
16998 MangleClassName(propName);
16999 strcpy(propNameM, "__ecerePropM_");
17000 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17001 strcat(propNameM, "_");
17002 FullClassNameCat(propNameM, prop->name, 0x1);
17003 MangleClassName(propNameM);
17004 if(prop->isWatchable)
17007 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17008 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17009 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17011 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17012 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17013 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17017 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17018 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17019 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17021 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17022 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17023 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17025 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17026 curFunction->propSet->fireWatchersDone = 0x1;
17029 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17031 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17033 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17035 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17037 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17039 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17041 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17043 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17045 static void ProcessStatement(struct Statement * stmt)
17047 yylloc = stmt->loc;
17051 ProcessStatement(stmt->labeled.stmt);
17054 if(stmt->caseStmt.exp)
17056 FreeType(stmt->caseStmt.exp->destType);
17057 stmt->caseStmt.exp->destType = curSwitchType;
17059 curSwitchType->refCount++;
17060 ProcessExpressionType(stmt->caseStmt.exp);
17061 ComputeExpression(stmt->caseStmt.exp);
17063 if(stmt->caseStmt.stmt)
17064 ProcessStatement(stmt->caseStmt.stmt);
17068 if(stmt->compound.context)
17070 struct Declaration * decl;
17071 struct Statement * s;
17072 struct Statement * prevCompound = curCompound;
17073 struct Context * prevContext = curContext;
17075 if(!stmt->compound.isSwitch)
17076 curCompound = stmt;
17077 curContext = stmt->compound.context;
17078 if(stmt->compound.declarations)
17080 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17081 ProcessDeclaration(decl);
17083 if(stmt->compound.statements)
17085 for(s = (*stmt->compound.statements).first; s; s = s->next)
17086 ProcessStatement(s);
17088 curContext = prevContext;
17089 curCompound = prevCompound;
17095 struct Expression * exp;
17097 if(stmt->expressions)
17099 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17100 ProcessExpressionType(exp);
17106 struct Expression * exp;
17108 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17109 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17110 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17111 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17113 ProcessExpressionType(exp);
17115 if(stmt->ifStmt.stmt)
17116 ProcessStatement(stmt->ifStmt.stmt);
17117 if(stmt->ifStmt.elseStmt)
17118 ProcessStatement(stmt->ifStmt.elseStmt);
17123 struct Type * oldSwitchType = curSwitchType;
17125 if(stmt->switchStmt.exp)
17127 struct Expression * exp;
17129 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17133 ProcessExpressionType(exp);
17136 curSwitchType = exp->expType;
17139 ProcessStatement(stmt->switchStmt.stmt);
17140 curSwitchType = oldSwitchType;
17145 if(stmt->whileStmt.exp)
17147 struct Expression * exp;
17149 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17150 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17151 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17152 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17154 ProcessExpressionType(exp);
17157 if(stmt->whileStmt.stmt)
17158 ProcessStatement(stmt->whileStmt.stmt);
17163 if(stmt->doWhile.exp)
17165 struct Expression * exp;
17167 if((*stmt->doWhile.exp).last)
17169 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17170 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17171 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17173 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17175 ProcessExpressionType(exp);
17178 if(stmt->doWhile.stmt)
17179 ProcessStatement(stmt->doWhile.stmt);
17184 struct Expression * exp;
17186 if(stmt->forStmt.init)
17187 ProcessStatement(stmt->forStmt.init);
17188 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17190 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17191 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17192 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17194 if(stmt->forStmt.check)
17195 ProcessStatement(stmt->forStmt.check);
17196 if(stmt->forStmt.increment)
17198 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17199 ProcessExpressionType(exp);
17201 if(stmt->forStmt.stmt)
17202 ProcessStatement(stmt->forStmt.stmt);
17207 struct Identifier * id = stmt->forEachStmt.id;
17208 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17209 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17210 struct Statement * block = stmt->forEachStmt.stmt;
17211 char iteratorType[1024];
17212 struct Type * source;
17213 struct Expression * e;
17214 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));
17215 struct Expression * arrayExp;
17216 char * typeString = (((void *)0));
17217 int builtinCount = 0;
17219 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17223 FreeType(e->destType);
17224 e->destType = ProcessTypeString("Container", 0x0);
17226 if(!isBuiltin || e->next)
17227 ProcessExpressionType(e);
17229 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17230 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17232 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17233 struct Symbol * symbol;
17234 struct Expression * expIt = (((void *)0));
17235 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17236 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17237 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17238 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17241 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17242 stmt->compound.context->parent = curContext;
17243 curContext = stmt->compound.context;
17244 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17246 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17247 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17249 isCustomAVLTree = 0x1;
17250 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17252 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17255 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17257 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17259 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17262 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17266 struct Declarator * decl;
17267 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17269 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17270 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17271 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17275 struct Type * type = (((void *)0));
17276 char typeStringBuf[1024];
17278 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17279 if(((struct Expression *)(*exp).last)->type == 11)
17281 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17284 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17286 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)
17288 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17290 typeString = templateClass->templateArgs[2].dataTypeString;
17292 else if(arrayExp->list)
17294 struct Expression * e;
17296 for(e = (*arrayExp->list).first; e; e = e->next)
17298 ProcessExpressionType(e);
17308 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17312 e->expType = (((void *)0));
17313 e = (*arrayExp->list).first;
17314 ProcessExpressionType(e);
17317 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17319 FreeType(e->expType);
17320 e->expType = (((void *)0));
17322 type = (((void *)0));
17330 FreeType(e->expType);
17331 e->expType = (((void *)0));
17337 typeStringBuf[0] = '\0';
17338 PrintType(type, typeStringBuf, 0x0, 0x1);
17339 typeString = typeStringBuf;
17345 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17346 struct Declarator * decl;
17347 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17351 struct Expression * e;
17353 builtinCount = (*arrayExp->list).count;
17354 type = ProcessTypeString(typeString, 0x0);
17355 while(e = (*arrayExp->list).first)
17357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17358 e->destType = type;
17360 ProcessExpressionType(e);
17361 ListAdd(initializers, MkInitializerAssignment(e));
17364 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17366 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17367 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17368 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17369 FreeList(exp, FreeExpression);
17373 arrayExp->expType = ProcessTypeString("Container", 0x0);
17374 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17377 else if(isLinkList && !isList)
17379 struct Declarator * decl;
17380 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17382 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17383 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17384 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17386 else if(_class->templateArgs)
17389 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17391 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17392 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17394 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17397 switch(block->type)
17400 if(block->compound.context)
17401 block->compound.context->parent = stmt->compound.context;
17404 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17405 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17406 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17407 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17410 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17411 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17414 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17415 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17418 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17419 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17422 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17423 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17426 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17427 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17433 block = MkIfStmt(filter, block, (((void *)0)));
17437 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));
17438 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17439 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17440 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17446 sprintf(count, "%d", builtinCount);
17447 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));
17448 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17449 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17450 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17452 else if(isLinkList && !isList)
17454 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17455 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17457 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17459 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));
17463 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17464 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17466 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));
17468 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17469 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17470 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17474 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17476 ProcessExpressionType(expIt);
17477 if((*stmt->compound.declarations).first)
17478 ProcessDeclaration((*stmt->compound.declarations).first);
17480 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17481 ProcessStatement(stmt);
17482 curContext = stmt->compound.context->parent;
17487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17499 struct Expression * exp;
17501 if(stmt->expressions)
17503 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17507 if(curFunction && !curFunction->type)
17508 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17509 FreeType(exp->destType);
17510 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17512 exp->destType->refCount++;
17514 ProcessExpressionType(exp);
17521 ProcessDeclaration(stmt->decl);
17526 struct AsmField * field;
17528 if(stmt->asmStmt.inputFields)
17530 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17531 if(field->expression)
17532 ProcessExpressionType(field->expression);
17534 if(stmt->asmStmt.outputFields)
17536 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17537 if(field->expression)
17538 ProcessExpressionType(field->expression);
17540 if(stmt->asmStmt.clobberedFields)
17542 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17544 if(field->expression)
17545 ProcessExpressionType(field->expression);
17552 struct PropertyWatch * propWatch;
17553 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17554 struct Expression * object = stmt->_watch.object;
17555 struct Expression * watcher = stmt->_watch.watcher;
17558 ProcessExpressionType(watcher);
17560 ProcessExpressionType(object);
17563 if(watcher || thisClass)
17565 struct External * external = curExternal;
17566 struct Context * context = curContext;
17569 stmt->expressions = MkList();
17570 curExternal = external->prev;
17571 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17573 struct ClassFunction * func;
17574 char watcherName[1024];
17575 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17576 struct External * createdExternal;
17577 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17580 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17581 if(propWatch->deleteWatch)
17582 strcat(watcherName, "_delete");
17585 struct Identifier * propID;
17587 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17589 strcat(watcherName, "_");
17590 strcat(watcherName, propID->string);
17593 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17595 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17596 ProcessClassFunctionBody(func, propWatch->compound);
17597 propWatch->compound = (((void *)0));
17598 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17599 createdExternal->symbol->idCode = external->symbol->idCode;
17600 curExternal = createdExternal;
17601 ProcessFunction(createdExternal->function);
17603 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17605 externalDecl->declaration = decl;
17606 if(decl->symbol && !decl->symbol->pointerExternal)
17607 decl->symbol->pointerExternal = externalDecl;
17609 if(propWatch->deleteWatch)
17611 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17613 ListAdd(args, CopyExpression(object));
17614 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17615 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17616 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17620 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17621 struct Identifier * propID;
17623 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17625 char propName[1024];
17626 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17630 char getName[1024], setName[1024];
17631 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17633 DeclareProperty(prop, setName, getName);
17634 strcpy(propName, "__ecereProp_");
17635 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17636 strcat(propName, "_");
17637 FullClassNameCat(propName, prop->name, 0x1);
17638 ListAdd(args, CopyExpression(object));
17639 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17640 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17641 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17642 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17645 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17650 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17652 curExternal = external;
17653 curContext = context;
17655 FreeExpression(watcher);
17657 FreeExpression(object);
17658 FreeList(watches, FreePropertyWatch);
17661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17665 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17667 ProcessStatement(propWatch->compound);
17674 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17675 struct Expression * object = stmt->_watch.object;
17676 struct __ecereNameSpace__ecere__com__Class * _class;
17679 ProcessExpressionType(object);
17682 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17685 struct Identifier * propID;
17688 stmt->expressions = MkList();
17689 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17691 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17698 for(propID = (*watches).first; propID; propID = propID->next)
17700 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17704 CreateFireWatcher(prop, object, stmt);
17707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17712 struct __ecereNameSpace__ecere__com__Property * prop;
17713 struct __ecereNameSpace__ecere__com__Class * base;
17715 for(base = _class; base; base = base->base)
17717 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17719 if(prop->isProperty && prop->isWatchable)
17721 CreateFireWatcher(prop, object, stmt);
17727 FreeExpression(object);
17728 FreeList(watches, FreeIdentifier);
17731 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17737 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17738 struct Expression * object = stmt->_watch.object;
17739 struct Expression * watcher = stmt->_watch.watcher;
17740 struct __ecereNameSpace__ecere__com__Class * _class;
17743 ProcessExpressionType(object);
17745 ProcessExpressionType(watcher);
17748 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17749 if(watcher || thisClass)
17753 struct Identifier * propID;
17756 stmt->expressions = MkList();
17759 struct __ecereNameSpace__ecere__sys__OldList * args;
17762 ListAdd(args, CopyExpression(object));
17763 ListAdd(args, MkExpConstant("0"));
17764 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17765 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17769 for(propID = (*watches).first; propID; propID = propID->next)
17771 char propName[1024];
17772 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17776 char getName[1024], setName[1024];
17777 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17779 DeclareProperty(prop, setName, getName);
17780 strcpy(propName, "__ecereProp_");
17781 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17782 strcat(propName, "_");
17783 FullClassNameCat(propName, prop->name, 0x1);
17784 MangleClassName(propName);
17785 ListAdd(args, CopyExpression(object));
17786 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17787 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17788 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17795 FreeExpression(object);
17797 FreeExpression(watcher);
17798 FreeList(watches, FreeIdentifier);
17801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17804 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17811 extern struct Expression * QBrackets(struct Expression * exp);
17813 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17815 extern struct Declarator * QMkPtrDecl(char * id);
17817 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17819 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17821 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17823 static void ProcessFunction(struct FunctionDefinition * function)
17825 struct Identifier * id = GetDeclId(function->declarator);
17826 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17827 struct Type * type = symbol ? symbol->type : (((void *)0));
17828 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17829 struct Context * oldTopContext = topContext;
17831 yylloc = function->loc;
17832 if(type && type->thisClass)
17834 struct Symbol * classSym = type->thisClass;
17835 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17836 char className[1024];
17837 char structName[1024];
17838 struct Declarator * funcDecl;
17839 struct Symbol * thisSymbol;
17840 unsigned int typedObject = 0x0;
17842 if(_class && !_class->base)
17844 _class = currentClass;
17845 if(_class && !_class->symbol)
17846 _class->symbol = FindClass(_class->fullName);
17847 classSym = _class ? _class->symbol : (((void *)0));
17850 thisClass = _class;
17851 if(inCompiler && _class)
17853 if(type->kind == 11)
17855 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17857 struct Type * param = symbol->type->params.first;
17859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17862 if(type->classObjectType != 1)
17864 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17865 symbol->type->staticMethod = 0x1;
17866 symbol->type->thisClass = (((void *)0));
17867 symbol->type->extraParam = 0x0;
17870 strcpy(className, "__ecereClass_");
17871 FullClassNameCat(className, _class->fullName, 0x1);
17872 MangleClassName(className);
17873 structName[0] = (char)0;
17874 FullClassNameCat(structName, _class->fullName, 0x0);
17875 funcDecl = GetFuncDecl(function->declarator);
17878 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17880 struct TypeName * param = (*funcDecl->function.parameters).first;
17882 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17884 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17885 FreeTypeName(param);
17888 if(!function->propertyNoThis)
17890 struct TypeName * thisParam;
17892 if(type->classObjectType != 1)
17894 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17895 if(!funcDecl->function.parameters)
17896 funcDecl->function.parameters = MkList();
17897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17901 if(type->classObjectType != 1)
17903 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17904 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17906 thisParam = __extension__ ({
17907 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17909 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17915 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17917 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17919 funcDecl = GetFuncDecl(initDecl->declarator);
17922 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17924 struct TypeName * param = (*funcDecl->function.parameters).first;
17926 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17928 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17929 FreeTypeName(param);
17932 if(type->classObjectType != 1)
17934 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17936 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17938 if(!funcDecl->function.parameters)
17939 funcDecl->function.parameters = MkList();
17940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17948 if(type->classObjectType != 1)
17950 thisSymbol = __extension__ ({
17951 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17953 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17955 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17956 if(typedObject && thisSymbol->type)
17958 thisSymbol->type->classObjectType = 2;
17959 thisSymbol->type->byReference = type->byReference;
17960 thisSymbol->type->typedByReference = type->byReference;
17964 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17966 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17969 struct __ecereNameSpace__ecere__com__Class * base;
17971 for(base = _class; base && base->type != 1000; base = base->next)
17973 for(member = base->membersAndProperties.first; member; member = member->next)
17974 if(!member->isProperty)
17980 for(member = _class->membersAndProperties.first; member; member = member->next)
17981 if(!member->isProperty)
17985 char pointerName[1024];
17986 struct Declaration * decl;
17987 struct Initializer * initializer;
17988 struct Expression * exp, * bytePtr;
17990 strcpy(pointerName, "__ecerePointer_");
17991 FullClassNameCat(pointerName, _class->fullName, 0x0);
17993 char className[1024];
17995 strcpy(className, "__ecereClass_");
17996 FullClassNameCat(className, classSym->string, 0x1);
17997 MangleClassName(className);
17998 DeclareClass(classSym, className);
18000 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18005 sprintf(string, "%d", _class->offset);
18006 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18010 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18012 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18013 exp->expType = __extension__ ({
18014 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18016 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18017 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18019 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18020 }), __ecereInstance2;
18024 yylloc = function->body->loc;
18025 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18027 struct Context * prevContext = curContext;
18029 curContext = function->body->compound.context;
18030 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18031 curContext = prevContext;
18033 decl->symbol = (((void *)0));
18034 if(!function->body->compound.declarations)
18035 function->body->compound.declarations = MkList();
18036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18042 thisClass = (((void *)0));
18045 FreeSpecifier(id->_class);
18046 id->_class = (((void *)0));
18047 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18049 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18051 id = GetDeclId(initDecl->declarator);
18052 FreeSpecifier(id->_class);
18053 id->_class = (((void *)0));
18057 topContext = function->body->compound.context;
18059 struct FunctionDefinition * oldFunction = curFunction;
18061 curFunction = function;
18063 ProcessStatement(function->body);
18064 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18066 struct Statement * prevCompound = curCompound;
18067 struct Context * prevContext = curContext;
18068 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18070 if(!function->body->compound.statements)
18071 function->body->compound.statements = MkList();
18072 ListAdd(function->body->compound.statements, fireWatchers);
18073 curCompound = function->body;
18074 curContext = function->body->compound.context;
18075 ProcessStatement(fireWatchers);
18076 curContext = prevContext;
18077 curCompound = prevCompound;
18079 curFunction = oldFunction;
18081 if(function->declarator)
18083 ProcessDeclarator(function->declarator);
18085 topContext = oldTopContext;
18086 thisClass = oldThisClass;
18089 extern void FreeSymbol(struct Symbol * symbol);
18091 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18093 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18095 struct ClassDef * def;
18096 struct External * external = curExternal;
18097 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18099 for(def = definitions->first; def; def = def->next)
18103 if(def->function->declarator)
18104 curExternal = def->function->declarator->symbol->pointerExternal;
18106 curExternal = external;
18107 ProcessFunction((struct FunctionDefinition *)def->function);
18109 else if(def->type == 2)
18111 if(def->decl->type == 2)
18113 thisClass = regClass;
18114 ProcessInstantiationType(def->decl->inst);
18115 thisClass = (((void *)0));
18119 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18122 thisClass = regClass;
18123 ProcessDeclaration(def->decl);
18124 thisClass = backThisClass;
18127 else if(def->type == 1 && def->defProperties)
18129 struct MemberInit * defProperty;
18130 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);
18132 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18133 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18135 thisClass = regClass;
18136 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18137 thisClass = (((void *)0));
18139 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18140 FreeSymbol(thisSymbol);
18142 else if(def->type == 3 && def->propertyDef)
18144 struct PropertyDef * prop = def->propertyDef;
18146 thisClass = regClass;
18151 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18153 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18155 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18156 ProcessStatement(prop->setStmt);
18162 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18164 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18166 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18167 ProcessStatement(prop->getStmt);
18169 if(prop->issetStmt)
18173 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18175 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18177 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18178 ProcessStatement(prop->issetStmt);
18180 thisClass = (((void *)0));
18182 else if(def->type == 4 && def->propertyWatch)
18184 struct PropertyWatch * propertyWatch = def->propertyWatch;
18186 thisClass = regClass;
18187 if(propertyWatch->compound)
18189 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);
18191 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18192 curExternal = (((void *)0));
18193 ProcessStatement(propertyWatch->compound);
18195 thisClass = (((void *)0));
18200 void DeclareFunctionUtil(char * s)
18202 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18209 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18210 strcpy(name, "__ecereFunction_");
18211 FullClassNameCat(name, s, 0x0);
18212 DeclareFunction(function, name);
18216 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18218 void ComputeDataTypes()
18220 struct External * external;
18221 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18222 struct External * after = (((void *)0));
18224 currentClass = (((void *)0));
18225 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18226 for(external = (*ast).first; external; external = external->next)
18228 if(external->type == 1)
18230 struct Declaration * decl = external->declaration;
18234 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18238 struct InitDeclarator * initDecl = (*decls).first;
18242 struct Declarator * declarator = initDecl->declarator;
18244 if(declarator && declarator->type == 1)
18246 struct Identifier * id = declarator->identifier;
18248 if(id && id->string)
18250 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18252 external->symbol->id = -1001, external->symbol->idCode = -1001;
18262 temp->symbol = __extension__ ({
18263 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18265 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18268 curExternal = temp;
18269 DeclareFunctionUtil("eSystem_New");
18270 DeclareFunctionUtil("eSystem_New0");
18271 DeclareFunctionUtil("eSystem_Renew");
18272 DeclareFunctionUtil("eSystem_Renew0");
18273 DeclareFunctionUtil("eSystem_Delete");
18274 DeclareFunctionUtil("eClass_GetProperty");
18275 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18276 DeclareStruct("ecere::com::Class", 0x0);
18277 DeclareStruct("ecere::com::Instance", 0x0);
18278 DeclareStruct("ecere::com::Property", 0x0);
18279 DeclareStruct("ecere::com::DataMember", 0x0);
18280 DeclareStruct("ecere::com::Method", 0x0);
18281 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18282 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18283 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18284 for(external = (*ast).first; external; external = external->next)
18286 afterExternal = curExternal = external;
18287 if(external->type == 0)
18289 currentClass = external->function->_class;
18290 ProcessFunction(external->function);
18292 else if(external->type == 1)
18294 currentClass = (((void *)0));
18295 ProcessDeclaration(external->declaration);
18297 else if(external->type == 2)
18299 struct ClassDefinition * _class = external->_class;
18301 currentClass = external->symbol->registered;
18302 if(_class->definitions)
18304 ProcessClass(_class->definitions, _class->symbol);
18308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18309 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18312 else if(external->type == 4)
18314 thisNameSpace = external->id->string;
18317 currentClass = (((void *)0));
18318 thisNameSpace = (((void *)0));
18319 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18320 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18323 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);
18325 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);
18327 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18329 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18331 struct __ecereNameSpace__ecere__com__Class * class;
18333 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18334 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18335 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18336 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18382 __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);
18383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18386 __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);
18387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18399 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18400 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18401 __ecereClass_Conversion = class;
18402 __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);
18403 __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);
18404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18405 __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);
18406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18429 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)