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 unsigned int opDestType;
492 } __attribute__ ((gcc_struct));
494 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
496 struct TemplateDatatype
498 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
499 struct Declarator * decl;
500 } __attribute__ ((gcc_struct));
502 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
504 struct TemplateArgument;
506 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
508 struct TemplateParameter
510 struct TemplateParameter * prev;
511 struct TemplateParameter * next;
514 struct Identifier * identifier;
517 struct TemplateDatatype * dataType;
519 } __attribute__ ((gcc_struct));
520 struct TemplateArgument * defaultArgument;
521 char * dataTypeString;
522 struct Type * baseType;
523 } __attribute__ ((gcc_struct));
525 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
529 struct Specifier * prev;
530 struct Specifier * next;
538 struct ExtDecl * extDecl;
540 struct Symbol * symbol;
541 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
542 } __attribute__ ((gcc_struct));
545 struct Identifier * id;
546 struct __ecereNameSpace__ecere__sys__OldList * list;
547 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
548 struct __ecereNameSpace__ecere__sys__OldList * definitions;
549 unsigned int addNameSpace;
550 struct Context * ctx;
551 struct ExtDecl * extDeclStruct;
552 } __attribute__ ((gcc_struct));
553 struct Expression * expression;
554 struct Specifier * _class;
555 struct TemplateParameter * templateParameter;
556 } __attribute__ ((gcc_struct));
557 } __attribute__ ((gcc_struct));
559 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
563 struct Identifier * prev;
564 struct Identifier * next;
566 struct Symbol * classSym;
567 struct Specifier * _class;
569 struct Identifier * badID;
570 } __attribute__ ((gcc_struct));
572 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
576 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
580 struct Declarator * prev;
581 struct Declarator * next;
584 struct Symbol * symbol;
585 struct Declarator * declarator;
588 struct Identifier * identifier;
591 struct Expression * exp;
592 struct Expression * posExp;
593 struct Attrib * attrib;
594 } __attribute__ ((gcc_struct)) structDecl;
597 struct Expression * exp;
598 struct Specifier * enumClass;
599 } __attribute__ ((gcc_struct)) array;
602 struct __ecereNameSpace__ecere__sys__OldList * parameters;
603 } __attribute__ ((gcc_struct)) function;
606 struct Pointer * pointer;
607 } __attribute__ ((gcc_struct)) pointer;
610 struct ExtDecl * extended;
611 } __attribute__ ((gcc_struct)) extended;
612 } __attribute__ ((gcc_struct));
613 } __attribute__ ((gcc_struct));
615 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
617 struct FunctionDefinition
619 struct FunctionDefinition * prev;
620 struct FunctionDefinition * next;
622 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
623 struct Declarator * declarator;
624 struct __ecereNameSpace__ecere__sys__OldList * declarations;
625 struct Statement * body;
626 struct __ecereNameSpace__ecere__com__Class * _class;
627 struct __ecereNameSpace__ecere__sys__OldList attached;
630 struct Symbol * propSet;
632 unsigned int propertyNoThis;
633 } __attribute__ ((gcc_struct));
635 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
639 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
643 struct External * prev;
644 struct External * next;
647 struct Symbol * symbol;
650 struct FunctionDefinition * function;
651 struct ClassDefinition * _class;
652 struct Declaration * declaration;
654 struct Identifier * id;
655 struct DBTableDef * table;
656 } __attribute__ ((gcc_struct));
658 } __attribute__ ((gcc_struct));
660 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
664 struct ModuleImport * prev;
665 struct ModuleImport * next;
667 struct __ecereNameSpace__ecere__sys__OldList classes;
668 struct __ecereNameSpace__ecere__sys__OldList functions;
671 } __attribute__ ((gcc_struct));
673 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
677 struct ClassImport * prev;
678 struct ClassImport * next;
680 struct __ecereNameSpace__ecere__sys__OldList methods;
681 struct __ecereNameSpace__ecere__sys__OldList properties;
684 } __attribute__ ((gcc_struct));
686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
691 struct Symbol * parent;
692 struct Symbol * left;
693 struct Symbol * right;
698 struct __ecereNameSpace__ecere__com__Method * method;
699 struct __ecereNameSpace__ecere__com__Property * _property;
700 struct __ecereNameSpace__ecere__com__Class * registered;
701 } __attribute__ ((gcc_struct));
708 struct External * pointerExternal;
709 struct External * structExternal;
710 } __attribute__ ((gcc_struct));
713 struct External * externalGet;
714 struct External * externalSet;
715 struct External * externalPtr;
716 struct External * externalIsSet;
717 } __attribute__ ((gcc_struct));
720 struct External * methodExternal;
721 struct External * methodCodeExternal;
722 } __attribute__ ((gcc_struct));
723 } __attribute__ ((gcc_struct));
724 unsigned int imported;
725 unsigned int declaredStructSym;
726 struct __ecereNameSpace__ecere__com__Class * _class;
727 unsigned int declaredStruct;
728 unsigned int needConstructor;
729 unsigned int needDestructor;
730 char * constructorName;
733 char * destructorName;
734 struct ModuleImport * module;
735 struct ClassImport * _import;
736 struct Location nameLoc;
737 unsigned int isParam;
738 unsigned int isRemote;
739 unsigned int isStruct;
740 unsigned int fireWatchersDone;
742 unsigned int classData;
743 unsigned int isStatic;
745 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
746 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
747 struct Context * ctx;
749 struct Expression * propCategory;
750 } __attribute__ ((gcc_struct));
752 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
761 struct Symbol * _class;
764 struct __ecereNameSpace__ecere__sys__OldList members;
766 } __attribute__ ((gcc_struct));
769 struct Type * returnType;
770 struct __ecereNameSpace__ecere__sys__OldList params;
771 struct Symbol * thisClass;
772 unsigned int staticMethod;
773 struct TemplateParameter * thisClassTemplate;
774 } __attribute__ ((gcc_struct));
777 struct __ecereNameSpace__ecere__com__Method * method;
778 struct __ecereNameSpace__ecere__com__Class * methodClass;
779 struct __ecereNameSpace__ecere__com__Class * usedClass;
780 } __attribute__ ((gcc_struct));
783 struct Type * arrayType;
785 struct Expression * arraySizeExp;
786 unsigned int freeExp;
787 struct Symbol * enumClass;
788 } __attribute__ ((gcc_struct));
790 struct TemplateParameter * templateParameter;
791 } __attribute__ ((gcc_struct));
801 unsigned int isSigned : 1;
802 unsigned int constant : 1;
803 unsigned int truth : 1;
804 unsigned int byReference : 1;
805 unsigned int extraParam : 1;
806 unsigned int directClassAccess : 1;
807 unsigned int computing : 1;
808 unsigned int keepCast : 1;
809 unsigned int passAsTemplate : 1;
810 unsigned int dllExport : 1;
811 unsigned int attrStdcall : 1;
812 unsigned int declaredWithStruct : 1;
813 unsigned int typedByReference : 1;
814 } __attribute__ ((gcc_struct));
816 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
818 struct __ecereNameSpace__ecere__com__Class
820 struct __ecereNameSpace__ecere__com__Class * prev;
821 struct __ecereNameSpace__ecere__com__Class * next;
827 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
828 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
831 struct __ecereNameSpace__ecere__com__Class * base;
832 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
833 struct __ecereNameSpace__ecere__sys__BinaryTree members;
834 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
835 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
836 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
837 struct __ecereNameSpace__ecere__sys__OldList derivatives;
841 struct __ecereNameSpace__ecere__com__Instance * module;
842 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
843 char * dataTypeString;
844 struct Type * dataType;
846 int defaultAlignment;
847 void (* Initialize)();
849 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
850 char * designerClass;
851 unsigned int noExpansion;
852 char * defaultProperty;
853 unsigned int comRedefinition;
856 unsigned int internalDecl;
858 unsigned int computeSize;
860 int destructionWatchOffset;
862 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
863 int inheritanceAccess;
866 struct __ecereNameSpace__ecere__sys__OldList conversions;
867 struct __ecereNameSpace__ecere__sys__OldList templateParams;
868 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
869 struct __ecereNameSpace__ecere__com__Class * templateClass;
870 struct __ecereNameSpace__ecere__sys__OldList templatized;
872 unsigned int isInstanceClass;
873 unsigned int byValueSystemClass;
874 } __attribute__ ((gcc_struct));
876 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
878 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
882 struct __ecereNameSpace__ecere__com__Instance
885 struct __ecereNameSpace__ecere__com__Class * _class;
887 } __attribute__ ((gcc_struct));
889 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
891 struct __ecereNameSpace__ecere__com__DataMember
893 struct __ecereNameSpace__ecere__com__DataMember * prev;
894 struct __ecereNameSpace__ecere__com__DataMember * next;
896 unsigned int isProperty;
899 struct __ecereNameSpace__ecere__com__Class * _class;
900 char * dataTypeString;
901 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
902 struct Type * dataType;
906 struct __ecereNameSpace__ecere__sys__OldList members;
907 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
910 } __attribute__ ((gcc_struct));
912 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
914 struct __ecereNameSpace__ecere__com__SerialBuffer
916 unsigned char * _buffer;
920 } __attribute__ ((gcc_struct));
922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
924 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
930 char * dataTypeString;
931 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
932 } __attribute__ ((gcc_struct));
933 struct __ecereNameSpace__ecere__com__DataValue expression;
939 struct __ecereNameSpace__ecere__com__DataMember * member;
940 struct __ecereNameSpace__ecere__com__Property * prop;
941 struct __ecereNameSpace__ecere__com__Method * method;
942 } __attribute__ ((gcc_struct));
943 } __attribute__ ((gcc_struct));
944 } __attribute__ ((gcc_struct));
945 } __attribute__ ((gcc_struct));
947 void exit(int status);
949 void * calloc(size_t nmemb, size_t size);
951 void free(void * ptr);
953 void * malloc(size_t size);
955 void * realloc(void * ptr, size_t size);
957 long int strtol(const char * nptr, char ** endptr, int base);
959 long long int strtoll(const char * nptr, char ** endptr, int base);
961 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
965 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
968 typedef union YYSTYPE
973 struct Identifier * id;
974 struct Expression * exp;
975 struct Specifier * specifier;
976 struct __ecereNameSpace__ecere__sys__OldList * list;
977 struct Enumerator * enumerator;
978 struct Declarator * declarator;
979 struct Pointer * pointer;
980 struct Initializer * initializer;
981 struct InitDeclarator * initDeclarator;
982 struct TypeName * typeName;
983 struct Declaration * declaration;
984 struct Statement * stmt;
985 struct FunctionDefinition * function;
986 struct External * external;
987 struct Context * context;
988 struct AsmField * asmField;
989 struct Attrib * attrib;
990 struct ExtDecl * extDecl;
991 struct Attribute * attribute;
992 struct Instantiation * instance;
993 struct MembersInit * membersInit;
994 struct MemberInit * memberInit;
995 struct ClassFunction * classFunction;
996 struct ClassDefinition * _class;
997 struct ClassDef * classDef;
998 struct PropertyDef * prop;
1000 struct Symbol * symbol;
1001 struct PropertyWatch * propertyWatch;
1002 struct TemplateParameter * templateParameter;
1003 struct TemplateArgument * templateArgument;
1004 struct TemplateDatatype * templateDatatype;
1005 struct DBTableEntry * dbtableEntry;
1006 struct DBIndexItem * dbindexItem;
1007 struct DBTableDef * dbtableDef;
1008 } __attribute__ ((gcc_struct)) YYSTYPE;
1010 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1014 struct Enumerator * prev;
1015 struct Enumerator * next;
1016 struct Location loc;
1017 struct Identifier * id;
1018 struct Expression * exp;
1019 } __attribute__ ((gcc_struct));
1021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1023 struct InitDeclarator
1025 struct InitDeclarator * prev;
1026 struct InitDeclarator * next;
1027 struct Location loc;
1028 struct Declarator * declarator;
1029 struct Initializer * initializer;
1030 } __attribute__ ((gcc_struct));
1032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1036 struct AsmField * prev;
1037 struct AsmField * next;
1038 struct Location loc;
1040 struct Expression * expression;
1041 struct Identifier * symbolic;
1042 } __attribute__ ((gcc_struct));
1044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1050 struct ClassFunction
1052 struct ClassFunction * prev;
1053 struct ClassFunction * next;
1054 struct Location loc;
1055 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1056 struct Declarator * declarator;
1057 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1058 struct Statement * body;
1059 struct __ecereNameSpace__ecere__com__Class * _class;
1060 struct __ecereNameSpace__ecere__sys__OldList attached;
1063 struct Symbol * propSet;
1064 unsigned int isVirtual;
1065 unsigned int isConstructor;
1066 unsigned int isDestructor;
1067 unsigned int dontMangle;
1070 } __attribute__ ((gcc_struct));
1072 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1076 struct MembersInit * prev;
1077 struct MembersInit * next;
1078 struct Location loc;
1082 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1083 struct ClassFunction * function;
1084 } __attribute__ ((gcc_struct));
1085 } __attribute__ ((gcc_struct));
1087 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1091 struct MemberInit * prev;
1092 struct MemberInit * next;
1093 struct Location loc;
1094 struct Location realLoc;
1095 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1096 struct Initializer * initializer;
1098 unsigned int variable;
1099 unsigned int takeOutExp;
1100 } __attribute__ ((gcc_struct));
1102 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1106 struct PropertyDef * prev;
1107 struct PropertyDef * next;
1108 struct Location loc;
1109 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1110 struct Declarator * declarator;
1111 struct Identifier * id;
1112 struct Statement * getStmt;
1113 struct Statement * setStmt;
1114 struct Statement * issetStmt;
1115 struct Symbol * symbol;
1116 struct Expression * category;
1119 unsigned int conversion : 1;
1120 unsigned int isWatchable : 1;
1121 unsigned int isDBProp : 1;
1122 } __attribute__ ((gcc_struct));
1123 } __attribute__ ((gcc_struct));
1125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1127 struct PropertyWatch
1129 struct PropertyWatch * prev;
1130 struct PropertyWatch * next;
1131 struct Location loc;
1132 struct Statement * compound;
1133 struct __ecereNameSpace__ecere__sys__OldList * properties;
1134 unsigned int deleteWatch;
1135 } __attribute__ ((gcc_struct));
1137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1141 struct ClassDef * prev;
1142 struct ClassDef * next;
1143 struct Location loc;
1147 struct Declaration * decl;
1148 struct ClassFunction * function;
1149 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1150 struct PropertyDef * propertyDef;
1151 struct PropertyWatch * propertyWatch;
1153 struct Identifier * defaultProperty;
1156 struct Identifier * id;
1157 struct Initializer * initializer;
1158 } __attribute__ ((gcc_struct));
1159 } __attribute__ ((gcc_struct));
1162 } __attribute__ ((gcc_struct));
1164 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1166 struct DBTableEntry;
1168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1172 extern YYSTYPE yylval;
1174 extern struct Location yylloc;
1176 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1178 extern int returnCode;
1180 extern struct Expression * parsedExpression;
1182 extern unsigned int yydebug;
1184 void SetYydebug(unsigned int b)
1189 extern unsigned int echoOn;
1191 void resetScanner();
1195 int expression_yyparse();
1197 static struct Statement * curCompound;
1199 struct External * curExternal, * afterExternal;
1201 static struct Type * curSwitchType;
1203 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1205 struct __ecereNameSpace__ecere__com__Class * thisClass;
1207 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1212 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1217 static char * thisNameSpace;
1219 struct __ecereNameSpace__ecere__com__Class * containerClass;
1221 unsigned int thisClassParams = 0x1;
1223 unsigned int internalValueCounter;
1225 extern unsigned int outputLineNumbers;
1227 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1229 extern size_t strlen(const char * );
1231 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1233 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1235 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1237 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1239 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1241 void PrintExpression(struct Expression * exp, char * string)
1244 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1246 unsigned int backOutputLineNumbers = outputLineNumbers;
1248 outputLineNumbers = 0x0;
1250 OutputExpression(exp, f);
1251 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1252 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1254 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1255 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1256 count = strlen(string);
1257 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1258 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1260 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1261 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1262 string[count] = '\0';
1263 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1264 outputLineNumbers = backOutputLineNumbers;
1268 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1270 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1272 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1274 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1276 if(!param->baseType)
1278 if(param->dataTypeString)
1279 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1281 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1283 return param->baseType;
1285 return (((void *)0));
1288 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1290 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1292 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1296 if(type1->kind == type2->kind)
1307 if(type1->passAsTemplate && !type2->passAsTemplate)
1309 return type1->isSigned != type2->isSigned;
1311 return type1->_class != type2->_class;
1313 return NeedCast(type1->type, type2->type);
1321 extern int strcmp(const char * , const char * );
1323 extern struct Context * curContext;
1325 extern struct Context * topContext;
1327 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1329 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);
1331 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1333 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);
1335 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);
1337 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1339 struct __ecereNameSpace__ecere__com__ClassProperty
1342 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1343 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1344 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1346 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1347 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1348 char * dataTypeString;
1349 struct Type * dataType;
1350 unsigned int constant;
1351 } __attribute__ ((gcc_struct));
1353 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1355 extern struct Expression * QMkExpId(char * id);
1357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1359 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1361 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1362 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1367 char * dataTypeString;
1369 } __attribute__ ((gcc_struct));
1370 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1372 } __attribute__ ((gcc_struct));
1374 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1376 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1378 extern void FreeIdentifier(struct Identifier * id);
1380 void ProcessExpressionType(struct Expression * exp);
1382 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1384 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1386 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1388 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1390 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1392 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1394 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1396 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1398 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1400 if(exp->type == 0 && exp->identifier)
1402 struct Identifier * id = exp->identifier;
1403 struct Context * ctx;
1404 struct Symbol * symbol = (((void *)0));
1406 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1408 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1410 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1415 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1417 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1418 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1419 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1420 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1424 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1426 if(!prop && !method)
1427 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1428 if(!prop && !method && !member)
1430 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1432 if(prop || method || member || classProp)
1435 exp->member.member = id;
1436 exp->member.memberType = 0;
1437 exp->member.exp = QMkExpId("this");
1438 exp->addedThis = 0x1;
1440 else if(_class && _class->templateParams.first)
1442 struct __ecereNameSpace__ecere__com__Class * sClass;
1444 for(sClass = _class; sClass; sClass = sClass->base)
1446 if(sClass->templateParams.first)
1448 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1450 for(param = sClass->templateParams.first; param; param = param->next)
1452 if(param->type == 2 && !strcmp(param->name, id->string))
1454 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1458 struct Declarator * decl;
1459 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1461 FreeIdentifier(exp->member.member);
1462 ProcessExpressionType(argExp);
1463 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1464 exp->expType = ProcessType(specs, decl);
1466 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1477 extern int sprintf(char * , char * , ...);
1479 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1481 extern char * strcat(char * , const char * );
1483 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1485 char * PrintInt(long long result)
1489 if(result > (((int)0x7fffffff)))
1490 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1492 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1493 if(result > (((int)0x7fffffff)) || result < (((int)0x80000000)))
1495 return __ecereNameSpace__ecere__sys__CopyString(temp);
1498 char * PrintUInt(uint64 result)
1502 if(result > (0xffffffff))
1503 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1504 else if(result > (((int)0x7fffffff)))
1505 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1507 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1508 return __ecereNameSpace__ecere__sys__CopyString(temp);
1511 char * PrintInt64(long long result)
1515 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1516 return __ecereNameSpace__ecere__sys__CopyString(temp);
1519 char * PrintUInt64(uint64 result)
1523 if(result > (((long long)0x7fffffffffffffffLL)))
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1527 return __ecereNameSpace__ecere__sys__CopyString(temp);
1530 char * PrintHexUInt(uint64 result)
1534 if(result > (0xffffffff))
1535 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1537 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1538 if(result > (0xffffffff))
1540 return __ecereNameSpace__ecere__sys__CopyString(temp);
1543 char * PrintHexUInt64(uint64 result)
1547 if(result > (0xffffffff))
1548 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1550 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1551 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 char * PrintShort(short result)
1558 sprintf(temp, "%d", (unsigned short)result);
1559 return __ecereNameSpace__ecere__sys__CopyString(temp);
1562 char * PrintUShort(unsigned short result)
1566 if(result > (unsigned short)32767)
1567 sprintf(temp, "0x%X", (int)result);
1569 sprintf(temp, "%d", (int)result);
1570 return __ecereNameSpace__ecere__sys__CopyString(temp);
1573 extern int isprint(int c);
1575 char * PrintChar(char result)
1579 if(result > (char)0 && isprint(result))
1580 sprintf(temp, "'%c'", result);
1581 else if(result < (char)0)
1582 sprintf(temp, "%d", (int)result);
1584 sprintf(temp, "0x%X", (unsigned char)result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 char * PrintUChar(unsigned char result)
1592 sprintf(temp, "0x%X", result);
1593 return __ecereNameSpace__ecere__sys__CopyString(temp);
1596 extern char * strcpy(char * , const char * );
1598 extern unsigned int (* __ecereProp_float_Get_isInf)(float this);
1600 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isInf;
1602 extern int (* __ecereProp_float_Get_signBit)(float this);
1604 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_signBit;
1606 extern unsigned int (* __ecereProp_float_Get_isNan)(float this);
1608 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_float_isNan;
1610 char * PrintFloat(float result)
1614 if(__ecereProp_float_Get_isInf(result))
1616 if(__ecereProp_float_Get_signBit(result))
1617 strcpy(temp, "-inf");
1619 strcpy(temp, "inf");
1621 else if(__ecereProp_float_Get_isNan(result))
1623 if(__ecereProp_float_Get_signBit(result))
1624 strcpy(temp, "-nan");
1626 strcpy(temp, "nan");
1629 sprintf(temp, "%.16ff", result);
1630 return __ecereNameSpace__ecere__sys__CopyString(temp);
1633 extern unsigned int (* __ecereProp_double_Get_isInf)(double this);
1635 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isInf;
1637 extern int (* __ecereProp_double_Get_signBit)(double this);
1639 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_signBit;
1641 extern unsigned int (* __ecereProp_double_Get_isNan)(double this);
1643 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp_double_isNan;
1645 char * PrintDouble(double result)
1649 if(__ecereProp_double_Get_isInf(result))
1651 if(__ecereProp_double_Get_signBit(result))
1652 strcpy(temp, "-inf");
1654 strcpy(temp, "inf");
1656 else if(__ecereProp_double_Get_isNan(result))
1658 if(__ecereProp_double_Get_signBit(result))
1659 strcpy(temp, "-nan");
1661 strcpy(temp, "nan");
1664 sprintf(temp, "%.16f", result);
1665 return __ecereNameSpace__ecere__sys__CopyString(temp);
1668 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1672 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* Neg)(struct Expression *, struct Operand *);
1678 unsigned int (* Inc)(struct Expression *, struct Operand *);
1679 unsigned int (* Dec)(struct Expression *, struct Operand *);
1680 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1690 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1692 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* Not)(struct Expression *, struct Operand *);
1698 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1707 } __attribute__ ((gcc_struct));
1709 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1715 unsigned int ptrSize;
1728 } __attribute__ ((gcc_struct));
1730 } __attribute__ ((gcc_struct));
1732 unsigned int GetOpInt(struct Operand * op2, int * value2)
1734 if(op2->kind == 3 && op2->type->isSigned)
1736 else if(op2->kind == 3)
1737 *value2 = (int)op2->ui;
1738 else if(op2->kind == 4 && op2->type->isSigned)
1739 *value2 = (int)op2->i64;
1740 else if(op2->kind == 4)
1741 *value2 = (int)op2->ui64;
1742 else if(op2->kind == 23 && op2->type->isSigned)
1743 *value2 = (int)op2->i64;
1744 else if(op2->kind == 23)
1745 *value2 = (int)op2->ui64;
1746 else if(op2->kind == 22 && op2->type->isSigned)
1747 *value2 = (int)op2->i64;
1748 else if(op2->kind == 22)
1749 *value2 = (int)op2->ui64;
1750 else if(op2->kind == 2 && op2->type->isSigned)
1751 *value2 = (int)op2->s;
1752 else if(op2->kind == 2)
1753 *value2 = (int)op2->us;
1754 else if(op2->kind == 1 && op2->type->isSigned)
1755 *value2 = (int)op2->c;
1756 else if(op2->kind == 24 || op2->kind == 1)
1757 *value2 = (int)op2->uc;
1758 else if(op2->kind == 6)
1759 *value2 = (int)op2->f;
1760 else if(op2->kind == 7)
1761 *value2 = (int)op2->d;
1762 else if(op2->kind == 13)
1763 *value2 = (int)op2->ui64;
1769 struct Operand GetOperand(struct Expression * exp);
1771 unsigned int GetInt(struct Expression * exp, int * value2)
1773 struct Operand op2 = GetOperand(exp);
1775 return GetOpInt(&op2, value2);
1778 unsigned int GetOpUInt(struct Operand * op2, unsigned int * value2)
1780 if(op2->kind == 3 && op2->type->isSigned)
1781 *value2 = (unsigned int)op2->i;
1782 else if(op2->kind == 3)
1784 else if(op2->kind == 4 && op2->type->isSigned)
1785 *value2 = (unsigned int)op2->i64;
1786 else if(op2->kind == 4)
1787 *value2 = (unsigned int)op2->ui64;
1788 else if(op2->kind == 23 && op2->type->isSigned)
1789 *value2 = (unsigned int)op2->i64;
1790 else if(op2->kind == 23)
1791 *value2 = (unsigned int)op2->ui64;
1792 else if(op2->kind == 22 && op2->type->isSigned)
1793 *value2 = (unsigned int)op2->i64;
1794 else if(op2->kind == 22)
1795 *value2 = (unsigned int)op2->ui64;
1796 else if(op2->kind == 2 && op2->type->isSigned)
1797 *value2 = (unsigned int)op2->s;
1798 else if(op2->kind == 2)
1799 *value2 = (unsigned int)op2->us;
1800 else if(op2->kind == 1 && op2->type->isSigned)
1801 *value2 = (unsigned int)op2->c;
1802 else if(op2->kind == 24 || op2->kind == 1)
1803 *value2 = (unsigned int)op2->uc;
1804 else if(op2->kind == 6)
1805 *value2 = (unsigned int)op2->f;
1806 else if(op2->kind == 7)
1807 *value2 = (unsigned int)op2->d;
1808 else if(op2->kind == 13)
1809 *value2 = (unsigned int)op2->ui64;
1815 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1817 struct Operand op2 = GetOperand(exp);
1819 return GetOpUInt(&op2, value2);
1822 unsigned int GetOpInt64(struct Operand * op2, long long * value2)
1824 if(op2->kind == 3 && op2->type->isSigned)
1825 *value2 = (long long)op2->i;
1826 else if(op2->kind == 3)
1827 *value2 = (long long)op2->ui;
1828 else if(op2->kind == 4 && op2->type->isSigned)
1830 else if(op2->kind == 4)
1831 *value2 = (long long)op2->ui64;
1832 else if(op2->kind == 23 && op2->type->isSigned)
1834 else if(op2->kind == 23)
1835 *value2 = (long long)op2->ui64;
1836 else if(op2->kind == 22 && op2->type->isSigned)
1838 else if(op2->kind == 22)
1839 *value2 = (long long)op2->ui64;
1840 else if(op2->kind == 2 && op2->type->isSigned)
1841 *value2 = (long long)op2->s;
1842 else if(op2->kind == 2)
1843 *value2 = (long long)op2->us;
1844 else if(op2->kind == 1 && op2->type->isSigned)
1845 *value2 = (long long)op2->c;
1846 else if(op2->kind == 24 || op2->kind == 1)
1847 *value2 = (long long)op2->uc;
1848 else if(op2->kind == 6)
1849 *value2 = (long long)op2->f;
1850 else if(op2->kind == 7)
1851 *value2 = (long long)op2->d;
1852 else if(op2->kind == 13)
1853 *value2 = (long long)op2->ui64;
1859 unsigned int GetInt64(struct Expression * exp, long long * value2)
1861 struct Operand op2 = GetOperand(exp);
1863 return GetOpInt64(&op2, value2);
1866 unsigned int GetOpUInt64(struct Operand * op2, uint64 * value2)
1868 if(op2->kind == 3 && op2->type->isSigned)
1869 *value2 = (uint64)op2->i;
1870 else if(op2->kind == 3)
1871 *value2 = (uint64)op2->ui;
1872 else if(op2->kind == 4 && op2->type->isSigned)
1873 *value2 = (uint64)op2->i64;
1874 else if(op2->kind == 4)
1875 *value2 = op2->ui64;
1876 else if(op2->kind == 23 && op2->type->isSigned)
1877 *value2 = (uint64)op2->i64;
1878 else if(op2->kind == 23)
1879 *value2 = op2->ui64;
1880 else if(op2->kind == 22 && op2->type->isSigned)
1881 *value2 = (uint64)op2->i64;
1882 else if(op2->kind == 22)
1883 *value2 = op2->ui64;
1884 else if(op2->kind == 2 && op2->type->isSigned)
1885 *value2 = (uint64)op2->s;
1886 else if(op2->kind == 2)
1887 *value2 = (uint64)op2->us;
1888 else if(op2->kind == 1 && op2->type->isSigned)
1889 *value2 = (uint64)op2->c;
1890 else if(op2->kind == 24 || op2->kind == 1)
1891 *value2 = (uint64)op2->uc;
1892 else if(op2->kind == 6)
1893 *value2 = (uint64)op2->f;
1894 else if(op2->kind == 7)
1895 *value2 = (uint64)op2->d;
1896 else if(op2->kind == 13)
1897 *value2 = op2->ui64;
1903 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1905 struct Operand op2 = GetOperand(exp);
1907 return GetOpUInt64(&op2, value2);
1910 unsigned int GetOpIntPtr(struct Operand * op2, intptr_t * value2)
1912 if(op2->kind == 3 && op2->type->isSigned)
1913 *value2 = (intptr_t)op2->i;
1914 else if(op2->kind == 3)
1915 *value2 = (intptr_t)op2->ui;
1916 else if(op2->kind == 4 && op2->type->isSigned)
1917 *value2 = (intptr_t)op2->i64;
1918 else if(op2->kind == 4)
1919 *value2 = (intptr_t)op2->ui64;
1920 else if(op2->kind == 23 && op2->type->isSigned)
1921 *value2 = (intptr_t)op2->i64;
1922 else if(op2->kind == 23)
1923 *value2 = (intptr_t)op2->ui64;
1924 else if(op2->kind == 22 && op2->type->isSigned)
1925 *value2 = (intptr_t)op2->i64;
1926 else if(op2->kind == 22)
1927 *value2 = (intptr_t)op2->ui64;
1928 else if(op2->kind == 2 && op2->type->isSigned)
1929 *value2 = (intptr_t)op2->s;
1930 else if(op2->kind == 2)
1931 *value2 = (intptr_t)op2->us;
1932 else if(op2->kind == 1 && op2->type->isSigned)
1933 *value2 = (intptr_t)op2->c;
1934 else if(op2->kind == 24 || op2->kind == 1)
1935 *value2 = (intptr_t)op2->uc;
1936 else if(op2->kind == 6)
1937 *value2 = (intptr_t)op2->f;
1938 else if(op2->kind == 7)
1939 *value2 = (intptr_t)op2->d;
1940 else if(op2->kind == 13)
1941 *value2 = (intptr_t)op2->ui64;
1947 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1949 struct Operand op2 = GetOperand(exp);
1951 return GetOpIntPtr(&op2, value2);
1954 unsigned int GetOpUIntPtr(struct Operand * op2, uintptr_t * value2)
1956 if(op2->kind == 3 && op2->type->isSigned)
1957 *value2 = (uintptr_t)op2->i;
1958 else if(op2->kind == 3)
1959 *value2 = (uintptr_t)op2->ui;
1960 else if(op2->kind == 4 && op2->type->isSigned)
1961 *value2 = (uintptr_t)op2->i64;
1962 else if(op2->kind == 4)
1963 *value2 = (uintptr_t)op2->ui64;
1964 else if(op2->kind == 23 && op2->type->isSigned)
1965 *value2 = (uintptr_t)op2->i64;
1966 else if(op2->kind == 23)
1967 *value2 = (uintptr_t)op2->ui64;
1968 else if(op2->kind == 22 && op2->type->isSigned)
1969 *value2 = (uintptr_t)op2->i64;
1970 else if(op2->kind == 22)
1971 *value2 = (uintptr_t)op2->ui64;
1972 else if(op2->kind == 2 && op2->type->isSigned)
1973 *value2 = (uintptr_t)op2->s;
1974 else if(op2->kind == 2)
1975 *value2 = (uintptr_t)op2->us;
1976 else if(op2->kind == 1 && op2->type->isSigned)
1977 *value2 = (uintptr_t)op2->c;
1978 else if(op2->kind == 24 || op2->kind == 1)
1979 *value2 = (uintptr_t)op2->uc;
1980 else if(op2->kind == 6)
1981 *value2 = (uintptr_t)op2->f;
1982 else if(op2->kind == 7)
1983 *value2 = (uintptr_t)op2->d;
1984 else if(op2->kind == 13)
1985 *value2 = (uintptr_t)op2->ui64;
1991 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1993 struct Operand op2 = GetOperand(exp);
1995 return GetOpUIntPtr(&op2, value2);
1998 unsigned int GetOpIntSize(struct Operand * op2, ssize_t * value2)
2000 if(op2->kind == 3 && op2->type->isSigned)
2001 *value2 = (ssize_t)op2->i;
2002 else if(op2->kind == 3)
2003 *value2 = (ssize_t)op2->ui;
2004 else if(op2->kind == 4 && op2->type->isSigned)
2005 *value2 = (ssize_t)op2->i64;
2006 else if(op2->kind == 4)
2007 *value2 = (ssize_t)op2->ui64;
2008 else if(op2->kind == 23 && op2->type->isSigned)
2009 *value2 = (ssize_t)op2->i64;
2010 else if(op2->kind == 23)
2011 *value2 = (ssize_t)op2->ui64;
2012 else if(op2->kind == 22 && op2->type->isSigned)
2013 *value2 = (ssize_t)op2->i64;
2014 else if(op2->kind == 22)
2015 *value2 = (ssize_t)op2->ui64;
2016 else if(op2->kind == 2 && op2->type->isSigned)
2017 *value2 = (ssize_t)op2->s;
2018 else if(op2->kind == 2)
2019 *value2 = (ssize_t)op2->us;
2020 else if(op2->kind == 1 && op2->type->isSigned)
2021 *value2 = (ssize_t)op2->c;
2022 else if(op2->kind == 24 || op2->kind == 1)
2023 *value2 = (ssize_t)op2->uc;
2024 else if(op2->kind == 6)
2025 *value2 = (ssize_t)op2->f;
2026 else if(op2->kind == 7)
2027 *value2 = (ssize_t)op2->d;
2028 else if(op2->kind == 13)
2029 *value2 = (ssize_t)op2->ui64;
2035 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
2037 struct Operand op2 = GetOperand(exp);
2039 return GetOpIntSize(&op2, value2);
2042 unsigned int GetOpUIntSize(struct Operand * op2, size_t * value2)
2044 if(op2->kind == 3 && op2->type->isSigned)
2045 *value2 = (size_t)op2->i;
2046 else if(op2->kind == 3)
2047 *value2 = (size_t)op2->ui;
2048 else if(op2->kind == 4 && op2->type->isSigned)
2049 *value2 = (size_t)op2->i64;
2050 else if(op2->kind == 4)
2051 *value2 = (size_t)op2->ui64;
2052 else if(op2->kind == 23 && op2->type->isSigned)
2053 *value2 = (size_t)op2->i64;
2054 else if(op2->kind == 23)
2055 *value2 = (size_t)op2->ui64;
2056 else if(op2->kind == 22 && op2->type->isSigned)
2057 *value2 = (size_t)op2->i64;
2058 else if(op2->kind == 22)
2059 *value2 = (size_t)op2->ui64;
2060 else if(op2->kind == 2 && op2->type->isSigned)
2061 *value2 = (size_t)op2->s;
2062 else if(op2->kind == 2)
2063 *value2 = (size_t)op2->us;
2064 else if(op2->kind == 1 && op2->type->isSigned)
2065 *value2 = (size_t)op2->c;
2066 else if(op2->kind == 24 || op2->kind == 1)
2067 *value2 = (size_t)op2->uc;
2068 else if(op2->kind == 6)
2069 *value2 = (size_t)op2->f;
2070 else if(op2->kind == 7)
2071 *value2 = (size_t)op2->d;
2072 else if(op2->kind == 13)
2073 *value2 = (size_t)op2->ui64;
2079 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
2081 struct Operand op2 = GetOperand(exp);
2083 return GetOpUIntSize(&op2, value2);
2086 unsigned int GetOpShort(struct Operand * op2, short * value2)
2088 if(op2->kind == 3 && op2->type->isSigned)
2089 *value2 = (short)op2->i;
2090 else if(op2->kind == 3)
2091 *value2 = (short)op2->ui;
2092 else if(op2->kind == 4 && op2->type->isSigned)
2093 *value2 = (short)op2->i64;
2094 else if(op2->kind == 4)
2095 *value2 = (short)op2->ui64;
2096 else if(op2->kind == 23 && op2->type->isSigned)
2097 *value2 = (short)op2->i64;
2098 else if(op2->kind == 23)
2099 *value2 = (short)op2->ui64;
2100 else if(op2->kind == 22 && op2->type->isSigned)
2101 *value2 = (short)op2->i64;
2102 else if(op2->kind == 22)
2103 *value2 = (short)op2->ui64;
2104 else if(op2->kind == 2 && op2->type->isSigned)
2106 else if(op2->kind == 2)
2107 *value2 = (short)op2->us;
2108 else if(op2->kind == 1 && op2->type->isSigned)
2109 *value2 = (short)op2->c;
2110 else if(op2->kind == 24 || op2->kind == 1)
2111 *value2 = (short)op2->uc;
2112 else if(op2->kind == 6)
2113 *value2 = (short)op2->f;
2114 else if(op2->kind == 7)
2115 *value2 = (short)op2->d;
2116 else if(op2->kind == 13)
2117 *value2 = (short)op2->ui64;
2123 unsigned int GetShort(struct Expression * exp, short * value2)
2125 struct Operand op2 = GetOperand(exp);
2127 return GetOpShort(&op2, value2);
2130 unsigned int GetOpUShort(struct Operand * op2, unsigned short * value2)
2132 if(op2->kind == 3 && op2->type->isSigned)
2133 *value2 = (unsigned short)op2->i;
2134 else if(op2->kind == 3)
2135 *value2 = (unsigned short)op2->ui;
2136 else if(op2->kind == 4 && op2->type->isSigned)
2137 *value2 = (unsigned short)op2->i64;
2138 else if(op2->kind == 4)
2139 *value2 = (unsigned short)op2->ui64;
2140 else if(op2->kind == 23 && op2->type->isSigned)
2141 *value2 = (unsigned short)op2->i64;
2142 else if(op2->kind == 23)
2143 *value2 = (unsigned short)op2->ui64;
2144 else if(op2->kind == 22 && op2->type->isSigned)
2145 *value2 = (unsigned short)op2->i64;
2146 else if(op2->kind == 22)
2147 *value2 = (unsigned short)op2->ui64;
2148 else if(op2->kind == 2 && op2->type->isSigned)
2149 *value2 = (unsigned short)op2->s;
2150 else if(op2->kind == 2)
2152 else if(op2->kind == 1 && op2->type->isSigned)
2153 *value2 = (unsigned short)op2->c;
2154 else if(op2->kind == 24 || op2->kind == 1)
2155 *value2 = (unsigned short)op2->uc;
2156 else if(op2->kind == 6)
2157 *value2 = (unsigned short)op2->f;
2158 else if(op2->kind == 7)
2159 *value2 = (unsigned short)op2->d;
2160 else if(op2->kind == 13)
2161 *value2 = (unsigned short)op2->ui64;
2167 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2169 struct Operand op2 = GetOperand(exp);
2171 return GetOpUShort(&op2, value2);
2174 unsigned int GetOpChar(struct Operand * op2, char * value2)
2176 if(op2->kind == 3 && op2->type->isSigned)
2177 *value2 = (char)op2->i;
2178 else if(op2->kind == 3)
2179 *value2 = (char)op2->ui;
2180 else if(op2->kind == 4 && op2->type->isSigned)
2181 *value2 = (char)op2->i64;
2182 else if(op2->kind == 4)
2183 *value2 = (char)op2->ui64;
2184 else if(op2->kind == 23 && op2->type->isSigned)
2185 *value2 = (char)op2->i64;
2186 else if(op2->kind == 23)
2187 *value2 = (char)op2->ui64;
2188 else if(op2->kind == 22 && op2->type->isSigned)
2189 *value2 = (char)op2->i64;
2190 else if(op2->kind == 22)
2191 *value2 = (char)op2->ui64;
2192 else if(op2->kind == 2 && op2->type->isSigned)
2193 *value2 = (char)op2->s;
2194 else if(op2->kind == 2)
2195 *value2 = (char)op2->us;
2196 else if(op2->kind == 1 && op2->type->isSigned)
2198 else if(op2->kind == 24 || op2->kind == 1)
2199 *value2 = (char)op2->uc;
2200 else if(op2->kind == 6)
2201 *value2 = (char)op2->f;
2202 else if(op2->kind == 7)
2203 *value2 = (char)op2->d;
2204 else if(op2->kind == 13)
2205 *value2 = (char)op2->ui64;
2211 unsigned int GetChar(struct Expression * exp, char * value2)
2213 struct Operand op2 = GetOperand(exp);
2215 return GetOpChar(&op2, value2);
2218 unsigned int GetOpUChar(struct Operand * op2, unsigned char * value2)
2220 if(op2->kind == 3 && op2->type->isSigned)
2221 *value2 = (unsigned char)op2->i;
2222 else if(op2->kind == 3)
2223 *value2 = (unsigned char)op2->ui;
2224 else if(op2->kind == 4 && op2->type->isSigned)
2225 *value2 = (unsigned char)op2->i64;
2226 else if(op2->kind == 4)
2227 *value2 = (unsigned char)op2->ui64;
2228 else if(op2->kind == 23 && op2->type->isSigned)
2229 *value2 = (unsigned char)op2->i64;
2230 else if(op2->kind == 23)
2231 *value2 = (unsigned char)op2->ui64;
2232 else if(op2->kind == 22 && op2->type->isSigned)
2233 *value2 = (unsigned char)op2->i64;
2234 else if(op2->kind == 22)
2235 *value2 = (unsigned char)op2->ui64;
2236 else if(op2->kind == 2 && op2->type->isSigned)
2237 *value2 = (unsigned char)op2->s;
2238 else if(op2->kind == 2)
2239 *value2 = (unsigned char)op2->us;
2240 else if(op2->kind == 1 && op2->type->isSigned)
2241 *value2 = (unsigned char)op2->c;
2242 else if(op2->kind == 24 || op2->kind == 1)
2244 else if(op2->kind == 6)
2245 *value2 = (unsigned char)op2->f;
2246 else if(op2->kind == 7)
2247 *value2 = (unsigned char)op2->d;
2248 else if(op2->kind == 13)
2249 *value2 = (unsigned char)op2->ui64;
2255 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2257 struct Operand op2 = GetOperand(exp);
2259 return GetOpUChar(&op2, value2);
2262 unsigned int GetOpFloat(struct Operand * op2, float * value2)
2264 if(op2->kind == 3 && op2->type->isSigned)
2265 *value2 = (float)(float)op2->i;
2266 else if(op2->kind == 3)
2267 *value2 = (float)(float)op2->ui;
2268 else if(op2->kind == 4 && op2->type->isSigned)
2269 *value2 = (float)(float)op2->i64;
2270 else if(op2->kind == 4)
2271 *value2 = (float)(float)op2->ui64;
2272 else if(op2->kind == 23 && op2->type->isSigned)
2273 *value2 = (float)(float)op2->i64;
2274 else if(op2->kind == 23)
2275 *value2 = (float)(float)op2->ui64;
2276 else if(op2->kind == 22 && op2->type->isSigned)
2277 *value2 = (float)(float)op2->i64;
2278 else if(op2->kind == 22)
2279 *value2 = (float)(float)op2->ui64;
2280 else if(op2->kind == 2 && op2->type->isSigned)
2281 *value2 = (float)(float)op2->s;
2282 else if(op2->kind == 2)
2283 *value2 = (float)(float)op2->us;
2284 else if(op2->kind == 1 && op2->type->isSigned)
2285 *value2 = (float)(float)op2->c;
2286 else if(op2->kind == 24 || op2->kind == 1)
2287 *value2 = (float)(float)op2->uc;
2288 else if(op2->kind == 6)
2289 *value2 = (float)op2->f;
2290 else if(op2->kind == 7)
2291 *value2 = (float)op2->d;
2292 else if(op2->kind == 13)
2293 *value2 = (float)(float)op2->ui64;
2299 unsigned int GetFloat(struct Expression * exp, float * value2)
2301 struct Operand op2 = GetOperand(exp);
2303 return GetOpFloat(&op2, value2);
2306 unsigned int GetOpDouble(struct Operand * op2, double * value2)
2308 if(op2->kind == 3 && op2->type->isSigned)
2309 *value2 = (double)(double)op2->i;
2310 else if(op2->kind == 3)
2311 *value2 = (double)(double)op2->ui;
2312 else if(op2->kind == 4 && op2->type->isSigned)
2313 *value2 = (double)(double)op2->i64;
2314 else if(op2->kind == 4)
2315 *value2 = (double)(double)op2->ui64;
2316 else if(op2->kind == 23 && op2->type->isSigned)
2317 *value2 = (double)(double)op2->i64;
2318 else if(op2->kind == 23)
2319 *value2 = (double)(double)op2->ui64;
2320 else if(op2->kind == 22 && op2->type->isSigned)
2321 *value2 = (double)(double)op2->i64;
2322 else if(op2->kind == 22)
2323 *value2 = (double)(double)op2->ui64;
2324 else if(op2->kind == 2 && op2->type->isSigned)
2325 *value2 = (double)(double)op2->s;
2326 else if(op2->kind == 2)
2327 *value2 = (double)(double)op2->us;
2328 else if(op2->kind == 1 && op2->type->isSigned)
2329 *value2 = (double)(double)op2->c;
2330 else if(op2->kind == 24 || op2->kind == 1)
2331 *value2 = (double)(double)op2->uc;
2332 else if(op2->kind == 6)
2333 *value2 = (double)op2->f;
2334 else if(op2->kind == 7)
2335 *value2 = (double)op2->d;
2336 else if(op2->kind == 13)
2337 *value2 = (double)(double)op2->ui64;
2343 unsigned int GetDouble(struct Expression * exp, double * value2)
2345 struct Operand op2 = GetOperand(exp);
2347 return GetOpDouble(&op2, value2);
2350 void ComputeExpression(struct Expression * exp);
2352 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2354 extern int targetBits;
2356 int ComputeTypeSize(struct Type * type);
2358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2360 struct __ecereNameSpace__ecere__com__BitMember
2362 struct __ecereNameSpace__ecere__com__BitMember * prev;
2363 struct __ecereNameSpace__ecere__com__BitMember * next;
2365 unsigned int isProperty;
2368 struct __ecereNameSpace__ecere__com__Class * _class;
2369 char * dataTypeString;
2370 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2371 struct Type * dataType;
2376 } __attribute__ ((gcc_struct));
2378 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2380 struct __ecereNameSpace__ecere__sys__OldLink
2382 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2383 struct __ecereNameSpace__ecere__sys__OldLink * next;
2385 } __attribute__ ((gcc_struct));
2387 void FinishTemplatesContext(struct Context * context);
2389 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2391 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2392 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2394 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))
2397 int unionMemberOffset = 0;
2402 member->memberOffset = 0;
2403 if(targetBits < sizeof(void *) * 8)
2404 member->structAlignment = 0;
2406 else if(targetBits < sizeof(void *) * 8)
2407 _class->structAlignment = 0;
2408 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2409 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2410 if(!member && _class->destructionWatchOffset)
2411 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2413 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2415 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2417 if(!dataMember->isProperty)
2419 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2421 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2427 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2429 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2431 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2433 if(!isMember && _class->type == 2 && dataMember->dataType)
2435 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2439 ComputeTypeSize(dataMember->dataType);
2440 if(bitMember->pos == -1)
2441 bitMember->pos = _class->memberOffset;
2442 if(!bitMember->size)
2443 bitMember->size = dataMember->dataType->size * 8;
2444 _class->memberOffset = bitMember->pos + bitMember->size;
2445 for(d = 0; d < bitMember->size; d++)
2451 bitMember->mask = mask << bitMember->pos;
2453 else if(dataMember->type == 0 && dataMember->dataType)
2458 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2459 ComputeTypeSize(dataMember->dataType);
2460 if(dataMember->dataType->bitFieldCount)
2462 bitFields += dataMember->dataType->bitFieldCount;
2469 int size = (bitFields + 7) / 8;
2473 int __simpleStruct0;
2477 int __simpleStruct0;
2479 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2480 if(member->memberOffset % alignment)
2481 member->memberOffset += alignment - (member->memberOffset % alignment);
2483 dataMember->offset = member->memberOffset;
2484 if(member->type == 1)
2485 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2488 member->memberOffset += size;
2495 int __simpleStruct0;
2497 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2498 if(_class->memberOffset % alignment)
2499 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2501 dataMember->offset = _class->memberOffset;
2502 _class->memberOffset += size;
2506 size = dataMember->dataType->size;
2507 alignment = dataMember->dataType->alignment;
2511 int __simpleStruct0;
2515 int __simpleStruct0;
2517 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2518 if(member->memberOffset % alignment)
2519 member->memberOffset += alignment - (member->memberOffset % alignment);
2521 dataMember->offset = member->memberOffset;
2522 if(member->type == 1)
2523 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2526 member->memberOffset += size;
2533 int __simpleStruct0;
2535 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2536 if(_class->memberOffset % alignment)
2537 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2539 dataMember->offset = _class->memberOffset;
2540 _class->memberOffset += size;
2547 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2548 alignment = dataMember->structAlignment;
2551 int __simpleStruct0;
2555 int __simpleStruct0;
2557 if(member->memberOffset % alignment)
2558 member->memberOffset += alignment - (member->memberOffset % alignment);
2559 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2561 dataMember->offset = member->memberOffset;
2562 if(member->type == 1)
2563 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2565 member->memberOffset += dataMember->memberOffset;
2571 int __simpleStruct0;
2573 if(_class->memberOffset % alignment)
2574 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2575 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2577 dataMember->offset = _class->memberOffset;
2578 _class->memberOffset += dataMember->memberOffset;
2586 int size = (bitFields + 7) / 8;
2590 int __simpleStruct0;
2594 int __simpleStruct0;
2596 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2597 if(member->memberOffset % alignment)
2598 member->memberOffset += alignment - (member->memberOffset % alignment);
2600 if(member->type == 1)
2601 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2604 member->memberOffset += size;
2611 int __simpleStruct0;
2613 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2614 if(_class->memberOffset % alignment)
2615 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2617 _class->memberOffset += size;
2622 if(member && member->type == 1)
2624 member->memberOffset = unionMemberOffset;
2628 if(_class->type != 2)
2632 if(_class->structAlignment)
2634 if(_class->memberOffset % _class->structAlignment)
2635 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2637 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2640 struct __ecereNameSpace__ecere__com__Property * prop;
2642 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2644 if(prop->isProperty && prop->isWatchable)
2646 prop->watcherOffset = _class->structSize;
2647 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2652 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2654 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2656 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2658 if(deriv->computeSize)
2660 deriv->offset = _class->structSize;
2661 deriv->memberOffset = 0;
2662 deriv->structSize = deriv->offset;
2663 ComputeClassMembers(deriv, 0x0);
2671 FinishTemplatesContext(context);
2674 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2676 struct __ecereNameSpace__ecere__com__NameSpace
2679 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2680 struct __ecereNameSpace__ecere__com__NameSpace * left;
2681 struct __ecereNameSpace__ecere__com__NameSpace * right;
2683 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2684 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2685 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2686 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2687 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2688 } __attribute__ ((gcc_struct));
2690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2692 struct __ecereNameSpace__ecere__com__Module
2694 struct __ecereNameSpace__ecere__com__Instance * application;
2695 struct __ecereNameSpace__ecere__sys__OldList classes;
2696 struct __ecereNameSpace__ecere__sys__OldList defines;
2697 struct __ecereNameSpace__ecere__sys__OldList functions;
2698 struct __ecereNameSpace__ecere__sys__OldList modules;
2699 struct __ecereNameSpace__ecere__com__Instance * prev;
2700 struct __ecereNameSpace__ecere__com__Instance * next;
2706 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2707 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2708 } __attribute__ ((gcc_struct));
2710 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2712 struct __ecereNameSpace__ecere__com__Class * _class;
2713 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2715 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2716 ComputeModuleClasses(subModule->data);
2717 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2718 ComputeClassMembers(_class, 0x0);
2721 extern unsigned int inCompiler;
2723 extern void Compiler_Error(char * format, ...);
2725 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2727 int ComputeTypeSize(struct Type * type)
2729 unsigned int size = type ? type->size : 0;
2731 if(!size && type && !type->computing)
2733 type->computing = 0x1;
2737 type->alignment = size = sizeof(char);
2740 type->alignment = size = sizeof(char);
2743 type->alignment = size = sizeof(int);
2746 type->alignment = size = sizeof(long long);
2749 type->alignment = size = targetBits / 8;
2752 type->alignment = size = targetBits / 8;
2755 type->alignment = size = sizeof(long);
2758 type->alignment = size = sizeof(short);
2761 type->alignment = size = sizeof(float);
2764 type->alignment = size = sizeof(double);
2768 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2770 if(_class && _class->type == 1)
2772 ComputeClassMembers(_class, 0x0);
2773 type->alignment = _class->structAlignment;
2774 size = _class->structSize;
2775 if(type->alignment && size % type->alignment)
2776 size += type->alignment - (size % type->alignment);
2778 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2780 if(!_class->dataType)
2781 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2782 size = type->alignment = ComputeTypeSize(_class->dataType);
2785 size = type->alignment = targetBits / 8;
2790 size = type->alignment = targetBits / 8;
2793 if(type->arraySizeExp)
2795 ProcessExpressionType(type->arraySizeExp);
2796 ComputeExpression(type->arraySizeExp);
2797 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)))
2799 struct Location oldLoc = yylloc;
2800 char expression[10240];
2802 expression[0] = '\0';
2803 type->arraySizeExp->expType = (((void *)0));
2804 yylloc = type->arraySizeExp->loc;
2806 PrintExpression(type->arraySizeExp, expression);
2807 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2810 GetInt(type->arraySizeExp, &type->arraySize);
2812 else if(type->enumClass)
2814 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2816 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2819 type->arraySize = 0;
2823 type->arraySize = 0;
2825 size = ComputeTypeSize(type->type) * type->arraySize;
2827 type->alignment = type->type->alignment;
2831 struct Type * member;
2833 for(member = type->members.first; member; member = member->next)
2835 int __simpleStruct0, __simpleStruct1;
2836 unsigned int addSize = ComputeTypeSize(member);
2838 member->offset = size;
2839 if(member->alignment && size % member->alignment)
2840 member->offset += member->alignment - (size % member->alignment);
2841 size = member->offset;
2842 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2845 if(type->alignment && size % type->alignment)
2846 size += type->alignment - (size % type->alignment);
2851 struct Type * member;
2853 for(member = type->members.first; member; member = member->next)
2855 int __simpleStruct0, __simpleStruct1;
2856 unsigned int addSize = ComputeTypeSize(member);
2858 member->offset = size;
2859 if(member->alignment && size % member->alignment)
2860 member->offset += member->alignment - (size % member->alignment);
2861 size = member->offset;
2862 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2863 size = ((size > addSize) ? size : addSize);
2865 if(type->alignment && size % type->alignment)
2866 size += type->alignment - (size % type->alignment);
2871 struct TemplateParameter * param = type->templateParameter;
2872 struct Type * baseType = ProcessTemplateParameterType(param);
2876 size = ComputeTypeSize(baseType);
2877 type->alignment = baseType->alignment;
2880 type->alignment = size = sizeof(uint64);
2885 type->alignment = size = sizeof(enum
2893 type->alignment = size = targetBits / 8;
2898 type->computing = 0x0;
2903 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2905 extern struct Identifier * MkIdentifier(char * string);
2907 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2909 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2911 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2913 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2915 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2917 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2919 extern void FreeType(struct Type * type);
2921 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2923 extern struct Specifier * MkSpecifier(int specifier);
2925 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2927 extern struct Expression * MkExpConstant(char * string);
2929 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)
2931 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2932 unsigned int totalSize = 0;
2933 unsigned int maxSize = 0;
2934 int alignment, size;
2935 struct __ecereNameSpace__ecere__com__DataMember * member;
2936 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2939 *addedPadding = 0x0;
2940 if(!isMember && _class->base)
2942 maxSize = _class->structSize;
2944 if(_class->type == 1 || _class->type == 5)
2945 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2948 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2950 if(maxSize > baseSize)
2951 maxSize -= baseSize;
2957 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2959 if(!member->isProperty)
2961 switch(member->type)
2965 if(member->dataTypeString)
2967 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2968 struct Declarator * decl;
2970 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2971 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2972 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2973 if(!member->dataType)
2974 member->dataType = ProcessType(specs, decl);
2975 ReplaceThisClassSpecifiers(specs, topClass);
2977 struct Type * type = ProcessType(specs, decl);
2979 DeclareType(member->dataType, 0x0, 0x0);
2982 ComputeTypeSize(member->dataType);
2983 size = member->dataType->size;
2984 alignment = member->dataType->alignment;
2987 if(totalSize % alignment)
2988 totalSize += alignment - (totalSize % alignment);
2997 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
3000 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
3001 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
3002 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
3003 alignment = member->structAlignment;
3006 if(totalSize % alignment)
3007 totalSize += alignment - (totalSize % alignment);
3017 unsigned int __simpleStruct0;
3019 if(topMember && topMember->type == 1)
3020 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
3022 *retSize += totalSize;
3024 else if(totalSize < maxSize && _class->type != 1000)
3026 int autoPadding = 0;
3028 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
3029 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
3030 if(totalSize + autoPadding < maxSize)
3032 char sizeString[50];
3034 sprintf(sizeString, "%d", maxSize - totalSize);
3035 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
3037 *addedPadding = 0x1;
3041 FinishTemplatesContext(context);
3042 return topMember ? topMember->memberID : _class->memberID;
3045 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
3047 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
3048 unsigned int totalSize = 0;
3049 struct __ecereNameSpace__ecere__com__DataMember * member;
3050 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
3052 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
3053 DeclareMembers(_class->base, 0x0);
3054 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
3056 if(!member->isProperty)
3058 switch(member->type)
3062 if(!member->dataType && member->dataTypeString)
3063 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
3064 if(member->dataType)
3065 DeclareType(member->dataType, 0x0, 0x0);
3071 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
3078 FinishTemplatesContext(context);
3079 return topMember ? topMember->memberID : _class->memberID;
3082 extern struct Symbol * FindClass(char * name);
3084 extern char * strchr(const char * , int);
3086 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
3088 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
3090 extern void FreeClassDef(struct ClassDef * def);
3092 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
3094 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
3096 extern void MangleClassName(char * className);
3098 extern void DeclareClass(struct Symbol * classSym, char * className);
3100 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
3102 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
3104 void DeclareStruct(char * name, unsigned int skipNoHead)
3106 struct External * external = (((void *)0));
3107 struct Symbol * classSym = FindClass(name);
3109 if(!inCompiler || !classSym)
3111 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
3113 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
3115 struct Declaration * decl;
3116 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3117 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
3118 char structName[1024];
3119 struct Specifier * spec = (((void *)0));
3121 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
3122 classSym->declaring++;
3123 if(strchr(classSym->string, '<'))
3125 if(classSym->registered->templateClass)
3127 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
3128 classSym->declaring--;
3132 DeclareMembers(classSym->registered, 0x0);
3133 structName[0] = (char)0;
3134 FullClassNameCat(structName, name, 0x0);
3135 if(external && external->declaration && external->declaration->specifiers)
3137 for(spec = (*external->declaration->specifiers).first; spec; spec = spec->next)
3139 if(spec->type == 3 || spec->type == 4)
3143 if(!skipNoHead && (!spec || !spec->definitions))
3145 unsigned int addedPadding = 0x0;
3147 classSym->declaredStructSym = 0x1;
3148 declarations = MkList();
3149 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
3150 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
3152 FreeList(declarations, FreeClassDef);
3153 declarations = (((void *)0));
3156 if(skipNoHead || declarations)
3161 spec->definitions = declarations;
3162 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3164 if(classSym->structExternal)
3165 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3167 classSym->id = curExternal->symbol->idCode;
3168 classSym->idCode = curExternal->symbol->idCode;
3174 external = MkExternalDeclaration((((void *)0)));
3175 specifiers = MkList();
3176 declarators = MkList();
3177 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3178 external->declaration = decl = MkDeclaration(specifiers, declarators);
3179 if(decl->symbol && !decl->symbol->pointerExternal)
3180 decl->symbol->pointerExternal = external;
3181 if(classSym->registered && classSym->registered->type == 1)
3183 char className[1024];
3185 strcpy(className, "__ecereClass_");
3186 FullClassNameCat(className, classSym->string, 0x1);
3187 MangleClassName(className);
3188 DeclareClass(classSym, className);
3189 external->symbol = classSym;
3190 classSym->pointerExternal = external;
3191 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3192 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3196 char className[1024];
3198 strcpy(className, "__ecereClass_");
3199 FullClassNameCat(className, classSym->string, 0x1);
3200 MangleClassName(className);
3201 classSym->structExternal = external;
3202 DeclareClass(classSym, className);
3203 external->symbol = classSym;
3205 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3208 classSym->declaring--;
3210 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3212 classSym->declaring++;
3214 if(classSym->registered)
3215 DeclareMembers(classSym->registered, 0x0);
3217 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3219 if(classSym->structExternal)
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3222 classSym->id = curExternal->symbol->idCode;
3223 classSym->idCode = curExternal->symbol->idCode;
3225 classSym->declaring--;
3229 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3231 extern struct ModuleImport * mainModule;
3233 extern struct Specifier * MkSpecifierName(char * name);
3235 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3237 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3239 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3241 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3243 extern void FreeDeclarator(struct Declarator * decl);
3245 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3247 struct PropertyImport
3249 struct PropertyImport * prev;
3250 struct PropertyImport * next;
3252 unsigned int isVirtual;
3253 unsigned int hasSet;
3254 unsigned int hasGet;
3255 } __attribute__ ((gcc_struct));
3257 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3259 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3261 struct Symbol * symbol = prop->symbol;
3262 char propName[1024];
3264 strcpy(setName, "__ecereProp_");
3265 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3266 strcat(setName, "_Set_");
3267 FullClassNameCat(setName, prop->name, 0x1);
3268 strcpy(getName, "__ecereProp_");
3269 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3270 strcat(getName, "_Get_");
3271 FullClassNameCat(getName, prop->name, 0x1);
3272 strcpy(propName, "__ecereProp_");
3273 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3274 strcat(propName, "_");
3275 FullClassNameCat(propName, prop->name, 0x1);
3276 MangleClassName(getName);
3277 MangleClassName(setName);
3278 MangleClassName(propName);
3279 if(prop->_class->type == 1)
3280 DeclareStruct(prop->_class->fullName, 0x0);
3281 if(!symbol || curExternal->symbol->idCode < symbol->id)
3283 unsigned int imported = 0x0;
3284 unsigned int dllImport = 0x0;
3286 if(!symbol || symbol->_import)
3290 struct Symbol * classSym;
3292 if(!prop->_class->symbol)
3293 prop->_class->symbol = FindClass(prop->_class->fullName);
3294 classSym = prop->_class->symbol;
3295 if(classSym && !classSym->_import)
3297 struct ModuleImport * module;
3299 if(prop->_class->module)
3300 module = FindModule(prop->_class->module);
3302 module = mainModule;
3303 classSym->_import = __extension__ ({
3304 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3306 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3310 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3311 symbol->_import = (struct ClassImport *)__extension__ ({
3312 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3314 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3317 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3320 if((prop->_class->module != privateModule || !strcmp(prop->_class->name, "float") || !strcmp(prop->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 24)))->importType != 1)
3325 struct Context * context = SetupTemplatesContext(prop->_class);
3327 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3328 FinishTemplatesContext(context);
3332 if(!symbol->externalGet || symbol->externalGet->type == 0)
3334 struct Declaration * decl;
3335 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3336 struct Declarator * d;
3337 struct __ecereNameSpace__ecere__sys__OldList * params;
3338 struct Specifier * spec;
3339 struct External * external;
3340 struct Declarator * typeDecl;
3341 unsigned int simple = 0x0;
3343 specifiers = MkList();
3344 declarators = MkList();
3346 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3347 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3349 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3351 struct Context * context = SetupTemplatesContext(prop->_class);
3353 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3354 FinishTemplatesContext(context);
3356 for(spec = (*specifiers).first; spec; spec = spec->next)
3360 if((!typeDecl || typeDecl->type == 1))
3362 struct Symbol * classSym = spec->symbol;
3364 symbol->_class = classSym->registered;
3365 if(classSym->registered && classSym->registered->type == 1)
3367 DeclareStruct(spec->name, 0x0);
3374 d = PlugDeclarator(typeDecl, d);
3377 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3378 specifiers = MkList();
3380 d = MkDeclaratorFunction(d, params);
3382 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3383 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3384 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3386 ListAdd(specifiers, MkSpecifier(VOID));
3387 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3388 decl = MkDeclaration(specifiers, declarators);
3389 external = MkExternalDeclaration(decl);
3390 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3391 external->symbol = symbol;
3392 symbol->externalGet = external;
3393 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3395 FreeDeclarator(typeDecl);
3399 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3404 if(!symbol->externalSet || symbol->externalSet->type == 0)
3406 struct Declaration * decl;
3407 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3408 struct Declarator * d;
3409 struct __ecereNameSpace__ecere__sys__OldList * params;
3410 struct Specifier * spec;
3411 struct External * external;
3412 struct Declarator * typeDecl;
3414 declarators = MkList();
3416 if(!prop->conversion || prop->_class->type == 1)
3418 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3420 specifiers = MkList();
3422 struct Context * context = SetupTemplatesContext(prop->_class);
3424 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3425 FinishTemplatesContext(context);
3427 ListAdd(params, MkTypeName(specifiers, d));
3428 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3430 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3431 d = MkDeclaratorFunction(d, params);
3432 for(spec = (*specifiers).first; spec; spec = spec->next)
3436 if((!typeDecl || typeDecl->type == 1))
3438 struct Symbol * classSym = spec->symbol;
3440 symbol->_class = classSym->registered;
3441 if(classSym->registered && classSym->registered->type == 1)
3442 DeclareStruct(spec->name, 0x0);
3446 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3447 specifiers = MkList();
3449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3450 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3451 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3452 if(!prop->conversion || prop->_class->type == 1)
3453 ListAdd(specifiers, MkSpecifier(VOID));
3455 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3456 decl = MkDeclaration(specifiers, declarators);
3457 external = MkExternalDeclaration(decl);
3458 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3459 external->symbol = symbol;
3460 symbol->externalSet = external;
3461 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3465 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3468 if(!symbol->externalPtr)
3470 struct Declaration * decl;
3471 struct External * external;
3472 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3477 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3478 ListAdd(specifiers, MkSpecifierName("Property"));
3480 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3482 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3485 strcpy(propName, "__ecerePropM_");
3486 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3487 strcat(propName, "_");
3488 FullClassNameCat(propName, prop->name, 0x1);
3489 MangleClassName(propName);
3490 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3492 decl = MkDeclaration(specifiers, list);
3494 external = MkExternalDeclaration(decl);
3495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3496 external->symbol = symbol;
3497 symbol->externalPtr = external;
3501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3503 symbol->id = curExternal->symbol->idCode;
3507 struct Type * Dereference(struct Type * source)
3509 struct Type * type = (((void *)0));
3513 if(source->kind == 13 || source->kind == 12)
3515 type = source->type;
3516 source->type->refCount++;
3518 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3520 type = __extension__ ({
3521 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3523 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3526 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3532 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3537 static struct Type * Reference(struct Type * source)
3539 struct Type * type = (((void *)0));
3543 type = __extension__ ({
3544 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3546 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3553 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);
3555 extern void * memcpy(void * , const void * , size_t size);
3557 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3559 extern void FreeExpression(struct Expression * exp);
3561 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3563 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);
3565 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3567 extern struct Type * MkClassType(char * name);
3569 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);
3571 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)
3573 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3574 unsigned int found = 0x0;
3575 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3576 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3577 unsigned int freeType = 0x0;
3579 yylloc = member->loc;
3584 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3588 dataMember = *curMember;
3594 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3595 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3596 int _subMemberStackPos = 0;
3599 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3602 dataMember = thisMember;
3603 if(curMember && thisMember->memberAccess == 1)
3605 *curMember = thisMember;
3606 *curClass = thisMember->_class;
3607 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3608 *subMemberStackPos = _subMemberStackPos;
3614 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3615 if(method && method->type == 1)
3618 method = (((void *)0));
3623 struct Type * type = (((void *)0));
3627 if(!dataMember->dataType && dataMember->dataTypeString)
3629 struct Context * context = SetupTemplatesContext(_class);
3631 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3632 FinishTemplatesContext(context);
3634 type = dataMember->dataType;
3638 if(!method->dataType)
3639 ProcessMethodType(method);
3640 type = method->dataType;
3642 if(ident && ident->next)
3644 for(ident = ident->next; ident && type; ident = ident->next)
3648 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3650 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3652 type = dataMember->dataType;
3654 else if(type->kind == 9 || type->kind == 10)
3656 struct Type * memberType;
3658 for(memberType = type->members.first; memberType; memberType = memberType->next)
3660 if(!strcmp(memberType->name, ident->string))
3669 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3672 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3673 struct __ecereNameSpace__ecere__com__Class * sClass;
3675 for(sClass = _class; sClass; sClass = sClass->base)
3678 if(sClass->templateClass)
3679 sClass = sClass->templateClass;
3680 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3682 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3684 for(sClass = sClass->base; sClass; sClass = sClass->base)
3686 if(sClass->templateClass)
3687 sClass = sClass->templateClass;
3688 id += sClass->templateParams.count;
3699 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3701 if(arg.dataTypeString)
3703 type = ProcessTypeString(arg.dataTypeString, 0x0);
3705 if(type && _class->templateClass)
3706 type->passAsTemplate = 0x1;
3713 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3715 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3716 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3720 char templateString[1024];
3721 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3723 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3724 for(cClass = expClass; cClass; cClass = cClass->base)
3728 if(cClass->templateClass)
3729 cClass = cClass->templateClass;
3730 for(param = cClass->templateParams.first; param; param = param->next)
3733 struct __ecereNameSpace__ecere__com__Class * sClass;
3734 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3736 for(sClass = cClass->base; sClass; sClass = sClass->base)
3738 if(sClass->templateClass)
3739 sClass = sClass->templateClass;
3740 id += sClass->templateParams.count;
3742 arg = expClass->templateArgs[id];
3743 for(sClass = _class; sClass; sClass = sClass->base)
3745 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3747 struct __ecereNameSpace__ecere__com__Class * nextClass;
3749 if(sClass->templateClass)
3750 sClass = sClass->templateClass;
3751 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3753 if(nextClass->templateClass)
3754 nextClass = nextClass->templateClass;
3755 p += nextClass->templateParams.count;
3757 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3759 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3761 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3763 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3764 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3778 char expString[1024];
3779 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3780 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3781 struct Expression * exp;
3782 char * string = PrintHexUInt64(arg.expression.ui64);
3784 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3785 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
3786 ProcessExpressionType(exp);
3787 ComputeExpression(exp);
3788 expString[0] = '\0';
3789 PrintExpression(exp, expString);
3790 strcat(argument, expString);
3791 FreeExpression(exp);
3796 strcat(argument, arg.member->name);
3801 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3802 strcat(argument, arg.dataTypeString);
3809 strcat(templateString, ", ");
3810 if(lastParam != p - 1)
3812 strcat(templateString, param->name);
3813 strcat(templateString, " = ");
3815 strcat(templateString, argument);
3824 int len = strlen(templateString);
3826 if(templateString[len - 1] == '<')
3830 if(templateString[len - 1] == '>')
3831 templateString[len++] = ' ';
3832 templateString[len++] = '>';
3834 templateString[len++] = '\0';
3837 struct Context * context = SetupTemplatesContext(_class);
3841 type = ProcessTypeString(templateString, 0x0);
3843 FinishTemplatesContext(context);
3846 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3848 ProcessExpressionType(member->initializer->exp);
3849 if(!member->initializer->exp->expType)
3853 char expString[10240];
3855 expString[0] = '\0';
3856 PrintExpression(member->initializer->exp, expString);
3857 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3858 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3861 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3863 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3866 else if(member->initializer)
3868 ProcessInitializer(member->initializer, type);
3875 if(_class && _class->type == 3)
3877 if(member->initializer)
3879 struct Type * type = MkClassType(_class->fullName);
3881 ProcessInitializer(member->initializer, type);
3887 if(member->initializer)
3889 ProcessInitializer(member->initializer, (((void *)0)));
3895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3901 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3910 extern struct Identifier * GetDeclId(struct Declarator * decl);
3912 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);
3914 extern void FreeSpecifier(struct Specifier * spec);
3916 static void ProcessFunction(struct FunctionDefinition * function);
3918 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3920 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3922 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3924 extern void FreeClassFunction(struct ClassFunction * func);
3926 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3928 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3930 void ProcessInstantiationType(struct Instantiation * inst)
3935 struct MembersInit * members;
3936 struct Symbol * classSym;
3937 struct __ecereNameSpace__ecere__com__Class * _class;
3939 classSym = inst->_class->symbol;
3940 _class = classSym ? classSym->registered : (((void *)0));
3941 if(!_class || _class->type != 5)
3942 DeclareStruct(inst->_class->name, 0x0);
3943 afterExternal = afterExternal ? afterExternal : curExternal;
3945 ProcessExpressionType(inst->exp);
3946 inst->isConstant = 0x1;
3949 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3950 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3951 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3952 int subMemberStackPos = 0;
3954 for(members = (*inst->members).first; members; members = members->next)
3956 switch(members->type)
3961 static unsigned int instMethodID = 0;
3962 struct External * external = curExternal;
3963 struct Context * context = curContext;
3964 struct Declarator * declarator = members->function->declarator;
3965 struct Identifier * nameID = GetDeclId(declarator);
3966 char * unmangled = nameID ? nameID->string : (((void *)0));
3967 struct Expression * exp;
3968 struct External * createdExternal = (((void *)0));
3974 strcpy(name, "__ecereInstMeth_");
3975 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3977 strcat(name, nameID->string);
3979 sprintf(number, "_%08d", instMethodID++);
3980 strcat(name, number);
3981 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3985 struct Symbol * symbol = declarator->symbol;
3986 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3988 if(method && method->type == 1)
3990 symbol->method = method;
3991 ProcessMethodType(method);
3992 if(!symbol->type->thisClass)
3994 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3996 if(!currentClass->symbol)
3997 currentClass->symbol = FindClass(currentClass->fullName);
3998 symbol->type->thisClass = currentClass->symbol;
4003 _class->symbol = FindClass(_class->fullName);
4004 symbol->type->thisClass = _class->symbol;
4007 DeclareType(symbol->type, 0x1, 0x1);
4011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
4014 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
4017 FreeSpecifier(nameID->_class);
4018 nameID->_class = (((void *)0));
4022 struct Type * type = declarator->symbol->type;
4023 struct External * oldExternal = curExternal;
4025 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
4027 struct External * externalDecl;
4029 externalDecl = MkExternalDeclaration((((void *)0)));
4030 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
4031 if(createdExternal->function)
4033 ProcessFunction(createdExternal->function);
4035 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
4037 externalDecl->declaration = decl;
4038 if(decl->symbol && !decl->symbol->pointerExternal)
4039 decl->symbol->pointerExternal = externalDecl;
4040 declarator->symbol->pointerExternal = externalDecl;
4047 curExternal = declarator->symbol->pointerExternal;
4048 ProcessFunction((struct FunctionDefinition *)members->function);
4050 curExternal = external;
4051 curContext = context;
4054 FreeClassFunction(members->function);
4055 exp = QMkExpId(name);
4057 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
4058 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
4064 if(members->dataMembers && classSym)
4066 struct MemberInit * member;
4067 struct Location oldyyloc = yylloc;
4069 for(member = (*members->dataMembers).first; member; member = member->next)
4071 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
4072 if(member->initializer && !member->initializer->isConstant)
4073 inst->isConstant = 0x0;
4085 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
4089 if(type->kind == 11)
4091 struct Type * param;
4095 for(param = type->params.first; param; param = param->next)
4096 DeclareType(param, declarePointers, 0x1);
4098 DeclareType(type->returnType, declarePointers, 0x1);
4100 else if(type->kind == 13 && declarePointers)
4101 DeclareType(type->type, declarePointers, 0x0);
4102 else if(type->kind == 8)
4104 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
4105 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
4107 else if(type->kind == 9 || type->kind == 10)
4109 struct Type * member;
4111 for(member = type->members.first; member; member = member->next)
4112 DeclareType(member, 0x0, 0x0);
4114 else if(type->kind == 12)
4115 DeclareType(type->arrayType, declarePointers, 0x0);
4119 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
4121 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
4123 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
4125 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4126 struct __ecereNameSpace__ecere__com__Class * sClass;
4128 for(sClass = _class; sClass; sClass = sClass->base)
4131 if(sClass->templateClass)
4132 sClass = sClass->templateClass;
4133 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4135 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
4137 for(sClass = sClass->base; sClass; sClass = sClass->base)
4139 if(sClass->templateClass)
4140 sClass = sClass->templateClass;
4141 id += sClass->templateParams.count;
4152 arg = &_class->templateArgs[id];
4153 if(arg && param->type == 0)
4154 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4159 extern struct Context * PushContext(void);
4161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4163 struct TemplatedType
4166 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4167 struct __ecereNameSpace__ecere__sys__BTNode * left;
4168 struct __ecereNameSpace__ecere__sys__BTNode * right;
4170 struct TemplateParameter * param;
4171 } __attribute__ ((gcc_struct));
4173 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4175 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4177 struct Context * context = PushContext();
4179 context->templateTypesOnly = 0x1;
4180 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4182 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4184 for(; param; param = param->next)
4186 if(param->type == 0 && param->identifier)
4188 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4190 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4196 struct __ecereNameSpace__ecere__com__Class * sClass;
4198 for(sClass = _class; sClass; sClass = sClass->base)
4200 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4202 for(p = sClass->templateParams.first; p; p = p->next)
4206 struct TemplateParameter * param = p->param;
4207 struct TemplatedType * type;
4211 p->param = param = __extension__ ({
4212 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4214 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4217 type = __extension__ ({
4218 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4220 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4222 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4230 extern void PopContext(struct Context * ctx);
4232 extern void FreeContext(struct Context * context);
4234 void FinishTemplatesContext(struct Context * context)
4236 PopContext(context);
4237 FreeContext(context);
4238 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4241 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4243 if(!method->dataType)
4245 struct Context * context = SetupTemplatesContext(method->_class);
4247 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4248 FinishTemplatesContext(context);
4249 if(method->type != 1 && method->dataType)
4251 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4253 if(!method->_class->symbol)
4254 method->_class->symbol = FindClass(method->_class->fullName);
4255 method->dataType->thisClass = method->_class->symbol;
4261 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4265 struct Context * context = SetupTemplatesContext(prop->_class);
4267 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4268 FinishTemplatesContext(context);
4272 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4274 extern void FreeTypeName(struct TypeName * typeName);
4276 static void ProcessDeclarator(struct Declarator * decl);
4278 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4280 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4284 struct MethodImport * prev;
4285 struct MethodImport * next;
4287 unsigned int isVirtual;
4288 } __attribute__ ((gcc_struct));
4290 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4292 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4294 struct Symbol * symbol = method->symbol;
4296 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4298 unsigned int imported = 0x0;
4299 unsigned int dllImport = 0x0;
4301 if(!method->dataType)
4302 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4303 if(!symbol || symbol->_import || method->type == 1)
4305 if(!symbol || method->type == 1)
4307 struct Symbol * classSym;
4309 if(!method->_class->symbol)
4310 method->_class->symbol = FindClass(method->_class->fullName);
4311 classSym = method->_class->symbol;
4312 if(!classSym->_import)
4314 struct ModuleImport * module;
4316 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4317 module = FindModule(method->_class->module);
4319 module = mainModule;
4320 classSym->_import = __extension__ ({
4321 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4323 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4325 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4329 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4331 if(!symbol->_import)
4333 symbol->_import = (struct ClassImport *)__extension__ ({
4334 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4336 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4342 symbol->type = method->dataType;
4344 symbol->type->refCount++;
4347 if(!method->dataType->dllExport)
4350 if((method->_class->module != privateModule || !strcmp(method->_class->name, "float") || !strcmp(method->_class->name, "double")) && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 24)))->importType != 1)
4354 if(method->type != 1 && method->dataType)
4355 DeclareType(method->dataType, 0x1, 0x1);
4356 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4358 struct Declaration * decl;
4359 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4360 struct Declarator * d;
4361 struct Declarator * funcDecl;
4362 struct External * external;
4364 specifiers = MkList();
4365 declarators = MkList();
4367 ListAdd(specifiers, MkSpecifier(EXTERN));
4368 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4369 ListAdd(specifiers, MkSpecifier(STATIC));
4370 if(method->type == 1)
4372 ListAdd(specifiers, MkSpecifier(INT));
4373 d = MkDeclaratorIdentifier(MkIdentifier(name));
4377 d = MkDeclaratorIdentifier(MkIdentifier(name));
4379 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4381 struct Context * context = SetupTemplatesContext(method->_class);
4383 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4384 FinishTemplatesContext(context);
4386 funcDecl = GetFuncDecl(d);
4389 struct Specifier * spec, * next;
4391 for(spec = (*specifiers).first; spec; spec = next)
4396 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4397 FreeSpecifier(spec);
4401 if(method->dataType && !method->dataType->staticMethod)
4403 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4405 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4406 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")));
4407 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4408 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4410 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4412 struct TypeName * param = (*funcDecl->function.parameters).first;
4414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4415 FreeTypeName(param);
4417 if(!funcDecl->function.parameters)
4418 funcDecl->function.parameters = MkList();
4419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4423 ProcessDeclarator(d);
4424 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4425 decl = MkDeclaration(specifiers, declarators);
4426 ReplaceThisClassSpecifiers(specifiers, method->_class);
4427 if(symbol->pointerExternal)
4429 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4432 *functionSymbol = *symbol;
4433 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4434 if(functionSymbol->type)
4435 functionSymbol->type->refCount++;
4437 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4438 symbol->pointerExternal->symbol = functionSymbol;
4440 external = MkExternalDeclaration(decl);
4442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4443 external->symbol = symbol;
4444 symbol->pointerExternal = external;
4448 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4450 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4454 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4456 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4458 unsigned int first = 0x1;
4460 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4462 char className[1024];
4464 strcpy(className, _class->fullName);
4465 for(param = _class->templateParams.first; param; param = param->next)
4469 strcat(className, "<");
4471 strcat(className, ", ");
4472 if(lastParam + 1 != p)
4474 strcat(className, param->name);
4475 strcat(className, " = ");
4477 strcat(className, param->name);
4485 int len = strlen(className);
4487 if(className[len - 1] == '>')
4488 className[len++] = ' ';
4489 className[len++] = '>';
4490 className[len++] = '\0';
4492 return __ecereNameSpace__ecere__sys__CopyString(className);
4495 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4498 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4500 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4502 unsigned int first = 0x1;
4504 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4506 char className[1024];
4508 strcpy(className, _class->fullName);
4509 for(param = _class->templateParams.first; param; param = param->next)
4513 strcat(className, "<");
4515 strcat(className, ", ");
4516 if(lastParam + 1 != p)
4518 strcat(className, param->name);
4519 strcat(className, " = ");
4521 strcat(className, param->name);
4529 int len = strlen(className);
4531 if(className[len - 1] == '>')
4532 className[len++] = ' ';
4533 className[len++] = '>';
4534 className[len++] = '\0';
4536 return MkClassType(className);
4540 return MkClassType(_class->fullName);
4544 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4546 if(specs != (((void *)0)) && _class)
4548 struct Specifier * spec;
4550 for(spec = specs->first; spec; spec = spec->next)
4552 if(spec->type == 0 && spec->specifier == THISCLASS)
4555 spec->name = ReplaceThisClass(_class);
4556 spec->symbol = FindClass(spec->name);
4562 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4564 struct __ecereNameSpace__ecere__com__GlobalFunction
4566 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4567 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4570 struct __ecereNameSpace__ecere__com__Instance * module;
4571 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4572 char * dataTypeString;
4573 struct Type * dataType;
4575 } __attribute__ ((gcc_struct));
4577 extern struct Context * globalContext;
4579 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4581 struct FunctionImport
4583 struct FunctionImport * prev;
4584 struct FunctionImport * next;
4586 } __attribute__ ((gcc_struct));
4588 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4590 struct Symbol * symbol = function->symbol;
4592 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4594 unsigned int imported = 0x0;
4595 unsigned int dllImport = 0x0;
4597 if(!function->dataType)
4599 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4600 if(!function->dataType->thisClass)
4601 function->dataType->staticMethod = 0x1;
4607 struct ModuleImport * module = FindModule(function->module);
4609 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4612 if(!function->dataType->dllExport)
4614 symbol->_import = (struct ClassImport *)__extension__ ({
4615 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4617 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4623 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4624 if(!symbol->type->thisClass)
4625 symbol->type->staticMethod = 0x1;
4628 imported = symbol->_import ? 0x1 : 0x0;
4629 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4632 DeclareType(function->dataType, 0x1, 0x1);
4635 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4637 struct Declaration * decl;
4638 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4639 struct Declarator * d;
4640 struct Declarator * funcDecl;
4641 struct External * external;
4643 specifiers = MkList();
4644 declarators = MkList();
4645 ListAdd(specifiers, MkSpecifier(EXTERN));
4646 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4648 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4649 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4650 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4652 struct Specifier * spec;
4654 for(spec = (*specifiers).first; spec; spec = spec->next)
4655 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4657 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4658 FreeSpecifier(spec);
4662 funcDecl = GetFuncDecl(d);
4663 if(funcDecl && !funcDecl->function.parameters)
4665 funcDecl->function.parameters = MkList();
4666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4668 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4670 struct Context * oldCtx = curContext;
4672 curContext = globalContext;
4673 decl = MkDeclaration(specifiers, declarators);
4674 curContext = oldCtx;
4676 if(symbol->pointerExternal)
4678 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4681 *functionSymbol = *symbol;
4682 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4683 if(functionSymbol->type)
4684 functionSymbol->type->refCount++;
4686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4687 symbol->pointerExternal->symbol = functionSymbol;
4689 external = MkExternalDeclaration(decl);
4691 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4692 external->symbol = symbol;
4693 symbol->pointerExternal = external;
4697 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4700 symbol->id = curExternal->symbol->idCode;
4703 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4706 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4711 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4712 struct __ecereNameSpace__ecere__sys__BTNode * left;
4713 struct __ecereNameSpace__ecere__sys__BTNode * right;
4715 struct __ecereNameSpace__ecere__com__Instance * module;
4716 char * dataTypeString;
4717 struct Type * dataType;
4720 } __attribute__ ((gcc_struct));
4722 void DeclareGlobalData(struct GlobalData * data)
4724 struct Symbol * symbol = data->symbol;
4726 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4731 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4734 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4735 DeclareType(data->dataType, 0x1, 0x1);
4738 if(!symbol->pointerExternal)
4740 struct Declaration * decl;
4741 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4742 struct Declarator * d;
4743 struct External * external;
4745 specifiers = MkList();
4746 declarators = MkList();
4747 ListAdd(specifiers, MkSpecifier(EXTERN));
4748 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4749 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4750 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4751 decl = MkDeclaration(specifiers, declarators);
4752 external = MkExternalDeclaration(decl);
4754 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4755 external->symbol = symbol;
4756 symbol->pointerExternal = external;
4760 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4763 symbol->id = curExternal->symbol->idCode;
4770 struct Conversion * prev, * next;
4771 struct __ecereNameSpace__ecere__com__Property * convert;
4773 struct Type * resultType;
4774 } __attribute__ ((gcc_struct));
4776 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4778 extern void Compiler_Warning(char * format, ...);
4780 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4782 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)
4786 if(source->kind == 20 && dest->kind != 20)
4788 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4793 if(dest->kind == 20 && source->kind != 20)
4795 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4800 if(dest->classObjectType == 2)
4802 if(source->classObjectType != 3)
4806 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4814 if(source->classObjectType == 3)
4816 if(dest->classObjectType == 3 && source->classObjectType != 2)
4819 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4821 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4824 if(dest->kind == 14 && source->kind != 0)
4826 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))
4828 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))
4830 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4832 if(source->_class->registered && source->_class->registered->type == 3)
4834 if(conversions != (((void *)0)))
4836 if(source->_class->registered == dest->_class->registered)
4841 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4843 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4845 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4847 if(sourceBase == destBase)
4851 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))
4855 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))
4857 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4864 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4868 if(source->kind == 8)
4870 struct __ecereNameSpace__ecere__com__Class * _class;
4872 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4874 struct __ecereNameSpace__ecere__com__Property * convert;
4876 for(convert = _class->conversions.first; convert; convert = convert->next)
4878 if(convert->memberAccess == 1 || _class->module == privateModule)
4880 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4882 if(!convert->dataType)
4883 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4884 if((!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), (convert->dataType->kind == 8 && !strcmp(convert->dataTypeString, "String")) ? 0x1 : 0x0, convert->dataType->kind == 8, 0x0, 0x1))
4886 if(!conversions && !convert->Get)
4888 else if(conversions != (((void *)0)))
4890 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))
4894 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4907 struct __ecereNameSpace__ecere__com__Class * _class;
4909 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4911 struct __ecereNameSpace__ecere__com__Property * convert;
4913 for(convert = _class->conversions.first; convert; convert = convert->next)
4915 if(convert->memberAccess == 1 || _class->module == privateModule)
4917 if(!convert->dataType)
4918 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4919 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4921 if(!conversions && !convert->Set)
4923 else if(conversions != (((void *)0)))
4925 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))
4929 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4931 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4939 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4941 if(!dest->_class->registered->dataType)
4942 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4943 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4945 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, dest->_class->registered->dataType->kind == 8, 0x0, 0x0))
4952 if(source->kind == 8)
4954 struct __ecereNameSpace__ecere__com__Class * _class;
4956 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4958 struct __ecereNameSpace__ecere__com__Property * convert;
4960 for(convert = _class->conversions.first; convert; convert = convert->next)
4962 if(convert->memberAccess == 1 || _class->module == privateModule)
4964 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4966 if(!convert->dataType)
4967 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4968 if(convert->dataType != source && (!isConversionExploration || convert->dataType->kind == 8 || !strcmp(_class->name, "String")) && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), convert->dataType->kind == 8, convert->dataType->kind == 8, 0x0, 0x1))
4970 if(!conversions && !convert->Get)
4972 else if(conversions != (((void *)0)))
4974 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))
4978 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4988 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4990 if(!source->_class->registered->dataType)
4991 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4992 if(!isConversionExploration || source->_class->registered->dataType->kind == 8 || !strcmp(source->_class->registered->name, "String"))
4994 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), source->_class->registered->dataType->kind == 8, source->_class->registered->dataType->kind == 8, 0x0, 0x0))
4996 else if(MatchTypes(dest, source->_class->registered->dataType, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
5002 if(source->kind == 8 || source->kind == 19)
5004 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
5006 else if(dest->kind == 7 && source->kind == 6)
5008 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
5010 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
5012 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
5014 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
5016 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
5018 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))
5020 else if(dest->kind == 15 && !isConversionExploration && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
5022 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)))
5024 struct Type * paramSource, * paramDest;
5026 if(dest->kind == 16)
5027 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
5028 if(source->kind == 16)
5029 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
5030 if(dest->kind == 13 && dest->type->kind == 11)
5032 if(source->kind == 13 && source->type->kind == 11)
5033 source = source->type;
5034 if(dest->kind == 16)
5035 dest = dest->method->dataType;
5036 if(source->kind == 16)
5037 source = source->method->dataType;
5038 paramSource = source->params.first;
5039 if(paramSource && paramSource->kind == 0)
5040 paramSource = (((void *)0));
5041 paramDest = dest->params.first;
5042 if(paramDest && paramDest->kind == 0)
5043 paramDest = (((void *)0));
5044 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
5046 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))))
5048 if(paramDest && paramDest->kind == 8)
5049 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
5051 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
5054 paramDest = paramDest->next;
5056 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
5058 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
5062 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
5064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5070 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
5073 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
5075 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
5079 paramSource = paramSource->next;
5085 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
5087 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
5093 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
5095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
5101 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5103 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
5106 for(; paramDest; paramDest = paramDest->next)
5110 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
5114 struct Type * paramDestType = paramDest;
5115 struct Type * paramSourceType = paramSource;
5116 struct Type * type = paramDestType;
5118 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
5121 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
5122 struct __ecereNameSpace__ecere__com__Class * sClass;
5124 for(sClass = owningClassSource; sClass; sClass = sClass->base)
5127 if(sClass->templateClass)
5128 sClass = sClass->templateClass;
5129 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
5131 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
5133 for(sClass = sClass->base; sClass; sClass = sClass->base)
5135 if(sClass->templateClass)
5136 sClass = sClass->templateClass;
5137 id += sClass->templateParams.count;
5148 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
5150 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
5153 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)))
5158 PrintType(paramDest, type, 0x0, 0x1);
5159 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5160 if(paramDestType != paramDest)
5161 FreeType(paramDestType);
5164 if(paramDestType != paramDest)
5165 FreeType(paramDestType);
5167 paramSource = paramSource->next;
5171 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5176 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5180 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5182 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5189 static void FreeConvert(struct Conversion * convert)
5191 if(convert->resultType)
5192 FreeType(convert->resultType);
5195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5197 struct __ecereNameSpace__ecere__com__BTNamedLink
5200 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5201 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5202 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5205 } __attribute__ ((gcc_struct));
5207 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5209 struct __ecereNameSpace__ecere__com__EnumClassData
5211 struct __ecereNameSpace__ecere__sys__OldList values;
5213 } __attribute__ ((gcc_struct));
5215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5217 struct __ecereNameSpace__ecere__sys__NamedLink
5219 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5220 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5223 } __attribute__ ((gcc_struct));
5225 extern void FreeExpContents(struct Expression * exp);
5227 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5229 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5231 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5233 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5235 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5237 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5239 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5241 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)))
5243 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5245 if(_class->type == 4)
5247 struct __ecereNameSpace__ecere__sys__OldList converts =
5251 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5255 _class->symbol = FindClass(_class->fullName);
5256 type->_class = _class->symbol;
5257 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5259 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5260 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5264 struct __ecereNameSpace__ecere__com__Class * baseClass;
5266 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5268 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5270 for(value = e->values.first; value; value = value->next)
5272 if(!strcmp(value->name, string))
5277 FreeExpContents(sourceExp);
5278 FreeType(sourceExp->expType);
5279 sourceExp->isConstant = 0x1;
5280 sourceExp->expType = MkClassType(baseClass->fullName);
5284 sourceExp->type = 2;
5285 if(!strcmp(baseClass->dataTypeString, "int"))
5286 sprintf(constant, "%d", (int)value->data);
5288 sprintf(constant, "0x%X", (int)value->data);
5289 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5291 while(converts.first)
5293 struct Conversion * convert = converts.first;
5295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5298 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5306 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5309 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)))
5310 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5315 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5317 struct __ecereNameSpace__ecere__com__SubModule
5319 struct __ecereNameSpace__ecere__com__SubModule * prev;
5320 struct __ecereNameSpace__ecere__com__SubModule * next;
5321 struct __ecereNameSpace__ecere__com__Instance * module;
5323 } __attribute__ ((gcc_struct));
5325 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5327 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5329 if(searchFor == searchIn)
5331 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5333 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5335 if(ModuleVisibility(subModule->module, searchFor))
5342 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5344 struct __ecereNameSpace__ecere__com__Application
5349 unsigned int isGUIApp;
5350 struct __ecereNameSpace__ecere__sys__OldList allModules;
5351 char * parsedCommand;
5352 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5353 } __attribute__ ((gcc_struct));
5355 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5357 struct __ecereNameSpace__ecere__com__Instance * module;
5359 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))
5361 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))
5363 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))
5365 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)
5367 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5373 extern struct Expression * CopyExpression(struct Expression * exp);
5375 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5377 void ReadString(char * output, char * string);
5379 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5381 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5383 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5385 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5387 struct Type * source;
5388 struct Type * realDest = dest;
5389 struct Type * backupSourceExpType = (((void *)0));
5390 struct Expression * computedExp = sourceExp;
5393 if(sourceExp->isConstant && sourceExp->type != 2 && sourceExp->type != 0 && sourceExp->type != 11 && dest->kind == 8 && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5395 computedExp = CopyExpression(sourceExp);
5396 ComputeExpression(computedExp);
5398 source = sourceExp->expType;
5399 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5401 if(computedExp != sourceExp)
5403 FreeExpression(computedExp);
5404 computedExp = sourceExp;
5409 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5411 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5413 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5415 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5417 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5419 if(sourceBase == destBase)
5421 if(computedExp != sourceExp)
5423 FreeExpression(computedExp);
5424 computedExp = sourceExp;
5433 struct __ecereNameSpace__ecere__sys__OldList * specs;
5434 unsigned int flag = 0x0;
5435 long long value = (((int)0x7fffffff));
5438 if(computedExp->type == 2)
5440 if(source->isSigned)
5441 value = strtoll(computedExp->constant, (((void *)0)), 0);
5443 value = strtoull(computedExp->constant, (((void *)0)), 0);
5445 else if(computedExp->type == 4 && sourceExp->op.op == '-' && !computedExp->op.exp1 && computedExp->op.exp2 && computedExp->op.exp2->type == 2)
5447 if(source->isSigned)
5448 value = -strtoll(computedExp->op.exp2->constant, (((void *)0)), 0);
5450 value = -strtoull(computedExp->op.exp2->constant, (((void *)0)), 0);
5452 if(computedExp != sourceExp)
5454 FreeExpression(computedExp);
5455 computedExp = sourceExp;
5457 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5460 source = __extension__ ({
5461 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5463 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5468 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5470 if(_class && _class->type == 3)
5472 if(source->kind != 8)
5474 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5475 struct Type * tempDest, * tempSource;
5477 for(; _class->base->type != 1000; _class = _class->base)
5480 tempDest = tempType;
5483 _class->symbol = FindClass(_class->fullName);
5484 tempType->_class = _class->symbol;
5485 tempType->truth = dest->truth;
5486 if(tempType->_class)
5487 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5488 backupSourceExpType = sourceExp->expType;
5489 sourceExp->expType = dest;
5492 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5495 if(_class && _class->type == 2 && source->kind != 8)
5497 if(!dest->_class->registered->dataType)
5498 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5499 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5502 FreeType(sourceExp->expType);
5503 source = sourceExp->expType = MkClassType(dest->_class->string);
5507 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5509 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5510 struct Declarator * decl;
5513 ReadString(string, sourceExp->string);
5514 decl = SpecDeclFromString(string, specs, (((void *)0)));
5515 FreeExpContents(sourceExp);
5516 FreeType(sourceExp->expType);
5517 sourceExp->type = 24;
5518 sourceExp->_classExp.specifiers = specs;
5519 sourceExp->_classExp.decl = decl;
5520 sourceExp->expType = dest;
5524 if(backupSourceExpType)
5525 FreeType(backupSourceExpType);
5529 else if(source->kind == 8)
5531 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5533 if(_class && (_class->type == 3 || _class->type == 2))
5537 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5538 struct Type * tempDest, * tempSource;
5540 if(!source->_class->registered->dataType)
5541 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5542 for(; _class->base->type != 1000; _class = _class->base)
5545 tempSource = tempType;
5547 tempType->_class = FindClass(_class->fullName);
5548 tempType->truth = source->truth;
5549 tempType->classObjectType = source->classObjectType;
5550 if(tempType->_class)
5551 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5552 if(conversions->last)
5554 ((struct Conversion *)conversions->last)->resultType = dest;
5557 FreeType(sourceExp->expType);
5558 sourceExp->expType = MkClassType(_class->fullName);
5559 sourceExp->expType->truth = source->truth;
5560 sourceExp->expType->classObjectType = source->classObjectType;
5561 if(!sourceExp->destType)
5563 FreeType(sourceExp->destType);
5564 sourceExp->destType = sourceExp->expType;
5565 if(sourceExp->expType)
5566 sourceExp->expType->refCount++;
5568 if(!_class->dataType)
5569 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5571 dest = MkClassType(source->_class->string);
5572 dest->truth = source->truth;
5573 dest->classObjectType = source->classObjectType;
5575 source = _class->dataType;
5577 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5583 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5592 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5593 unsigned int fittingValue = 0x0;
5595 if(_class && _class->type == 4)
5597 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5598 struct __ecereNameSpace__ecere__com__EnumClassData * c = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5600 if(c && value >= 0 && value <= c->largest)
5603 if(_class && !dest->truth && (_class->type == 3 || fittingValue || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5605 if(_class->type == 0 || _class->type == 5)
5607 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5609 *newExp = *sourceExp;
5610 if(sourceExp->destType)
5611 sourceExp->destType->refCount++;
5612 if(sourceExp->expType)
5613 sourceExp->expType->refCount++;
5614 sourceExp->type = 11;
5615 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5616 sourceExp->cast.exp = newExp;
5617 FreeType(sourceExp->expType);
5618 sourceExp->expType = (((void *)0));
5619 ProcessExpressionType(sourceExp);
5622 FreeType(sourceExp->expType);
5623 sourceExp->expType = dest;
5628 if(backupSourceExpType)
5629 FreeType(backupSourceExpType);
5632 if(!_class->dataType)
5633 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5635 dest = _class->dataType;
5638 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))
5640 specs = MkListOne(MkSpecifier(DOUBLE));
5642 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))
5644 specs = MkListOne(MkSpecifier(FLOAT));
5646 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))
5650 ListAdd(specs, MkSpecifier(UNSIGNED));
5651 ListAdd(specs, MkSpecifier(INT64));
5653 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5657 ListAdd(specs, MkSpecifier(UNSIGNED));
5658 ListAdd(specs, MkSpecifier(INT));
5660 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5664 ListAdd(specs, MkSpecifier(UNSIGNED));
5665 ListAdd(specs, MkSpecifier(SHORT));
5667 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5671 ListAdd(specs, MkSpecifier(UNSIGNED));
5672 ListAdd(specs, MkSpecifier(CHAR));
5678 if(backupSourceExpType)
5680 if(sourceExp->expType)
5681 FreeType(sourceExp->expType);
5682 sourceExp->expType = backupSourceExpType;
5687 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))
5689 specs = MkListOne(MkSpecifier(DOUBLE));
5691 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))
5693 specs = MkListOne(MkSpecifier(FLOAT));
5695 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5698 ListAdd(specs, MkSpecifier(BOOL));
5700 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)))
5704 ListAdd(specs, MkSpecifier(UNSIGNED));
5705 ListAdd(specs, MkSpecifier(CHAR));
5707 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)))))
5711 ListAdd(specs, MkSpecifier(UNSIGNED));
5712 ListAdd(specs, MkSpecifier(SHORT));
5714 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5718 ListAdd(specs, MkSpecifier(UNSIGNED));
5719 ListAdd(specs, MkSpecifier(INT));
5721 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5725 ListAdd(specs, MkSpecifier(UNSIGNED));
5726 ListAdd(specs, MkSpecifier(INT64));
5728 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5730 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5736 if(backupSourceExpType)
5738 if(sourceExp->expType)
5739 FreeType(sourceExp->expType);
5740 sourceExp->expType = backupSourceExpType;
5744 if(!flag && !sourceExp->opDestType)
5746 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5748 *newExp = *sourceExp;
5749 newExp->prev = (((void *)0));
5750 newExp->next = (((void *)0));
5751 if(sourceExp->destType)
5752 sourceExp->destType->refCount++;
5753 if(sourceExp->expType)
5754 sourceExp->expType->refCount++;
5755 sourceExp->type = 11;
5756 if(realDest->kind == 8)
5758 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5759 FreeList(specs, FreeSpecifier);
5762 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5763 if(newExp->type == 4)
5765 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5768 sourceExp->cast.exp = newExp;
5769 FreeType(sourceExp->expType);
5770 sourceExp->expType = (((void *)0));
5771 ProcessExpressionType(sourceExp);
5774 FreeList(specs, FreeSpecifier);
5777 if(backupSourceExpType)
5778 FreeType(backupSourceExpType);
5783 if(computedExp != sourceExp)
5785 FreeExpression(computedExp);
5786 computedExp = sourceExp;
5788 while((sourceExp->type == 5 || sourceExp->type == 32) && sourceExp->list)
5789 sourceExp = (*sourceExp->list).last;
5790 if(sourceExp->type == 0)
5792 struct Identifier * id = sourceExp->identifier;
5796 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5798 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5799 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5803 for(; _class && _class->type == 4; _class = _class->base)
5805 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5806 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5808 for(value = e->values.first; value; value = value->next)
5810 if(!strcmp(value->name, id->string))
5815 FreeExpContents(sourceExp);
5816 FreeType(sourceExp->expType);
5817 sourceExp->isConstant = 0x1;
5818 sourceExp->expType = MkClassType(_class->fullName);
5822 sourceExp->type = 2;
5823 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5824 sprintf(constant, "%d", (int)value->data);
5826 sprintf(constant, "0x%X", (int)value->data);
5827 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5836 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5847 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5849 int value2 = op2->i;
5852 exp->string = PrintInt((op1->i + value2));
5855 exp->expType = op1->type;
5857 op1->type->refCount++;
5862 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5864 unsigned int value2 = op2->ui;
5867 exp->string = PrintUInt((op1->ui + value2));
5870 exp->expType = op1->type;
5872 op1->type->refCount++;
5877 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5879 long long value2 = op2->i64;
5882 exp->string = PrintInt64((op1->i64 + value2));
5885 exp->expType = op1->type;
5887 op1->type->refCount++;
5892 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5894 uint64 value2 = op2->ui64;
5897 exp->string = PrintUInt64((op1->ui64 + value2));
5900 exp->expType = op1->type;
5902 op1->type->refCount++;
5907 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5909 short value2 = op2->s;
5912 exp->string = PrintShort((op1->s + value2));
5915 exp->expType = op1->type;
5917 op1->type->refCount++;
5922 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5924 unsigned short value2 = op2->us;
5927 exp->string = PrintUShort((op1->us + value2));
5930 exp->expType = op1->type;
5932 op1->type->refCount++;
5937 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5939 char value2 = op2->c;
5942 exp->string = PrintChar((op1->c + value2));
5945 exp->expType = op1->type;
5947 op1->type->refCount++;
5952 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5954 unsigned char value2 = op2->uc;
5957 exp->string = PrintUChar((op1->uc + value2));
5960 exp->expType = op1->type;
5962 op1->type->refCount++;
5967 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5969 float value2 = op2->f;
5972 exp->string = PrintFloat((float)(op1->f + value2));
5975 exp->expType = op1->type;
5977 op1->type->refCount++;
5982 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5984 double value2 = op2->d;
5987 exp->string = PrintDouble((double)(op1->d + value2));
5990 exp->expType = op1->type;
5992 op1->type->refCount++;
5997 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5999 int value2 = op2->i;
6002 exp->string = PrintInt((op1->i - value2));
6005 exp->expType = op1->type;
6007 op1->type->refCount++;
6012 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6014 unsigned int value2 = op2->ui;
6017 exp->string = PrintUInt((op1->ui - value2));
6020 exp->expType = op1->type;
6022 op1->type->refCount++;
6027 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6029 long long value2 = op2->i64;
6032 exp->string = PrintInt64((op1->i64 - value2));
6035 exp->expType = op1->type;
6037 op1->type->refCount++;
6042 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6044 uint64 value2 = op2->ui64;
6047 exp->string = PrintUInt64((op1->ui64 - value2));
6050 exp->expType = op1->type;
6052 op1->type->refCount++;
6057 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6059 short value2 = op2->s;
6062 exp->string = PrintShort((op1->s - value2));
6065 exp->expType = op1->type;
6067 op1->type->refCount++;
6072 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6074 unsigned short value2 = op2->us;
6077 exp->string = PrintUShort((op1->us - value2));
6080 exp->expType = op1->type;
6082 op1->type->refCount++;
6087 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6089 char value2 = op2->c;
6092 exp->string = PrintChar((op1->c - value2));
6095 exp->expType = op1->type;
6097 op1->type->refCount++;
6102 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6104 unsigned char value2 = op2->uc;
6107 exp->string = PrintUChar((op1->uc - value2));
6110 exp->expType = op1->type;
6112 op1->type->refCount++;
6117 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6119 float value2 = op2->f;
6122 exp->string = PrintFloat((float)(op1->f - value2));
6125 exp->expType = op1->type;
6127 op1->type->refCount++;
6132 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6134 double value2 = op2->d;
6137 exp->string = PrintDouble((double)(op1->d - value2));
6140 exp->expType = op1->type;
6142 op1->type->refCount++;
6147 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6149 int value2 = op2->i;
6152 exp->string = PrintInt((op1->i * value2));
6155 exp->expType = op1->type;
6157 op1->type->refCount++;
6162 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6164 unsigned int value2 = op2->ui;
6167 exp->string = PrintUInt((op1->ui * value2));
6170 exp->expType = op1->type;
6172 op1->type->refCount++;
6177 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6179 long long value2 = op2->i64;
6182 exp->string = PrintInt64((op1->i64 * value2));
6185 exp->expType = op1->type;
6187 op1->type->refCount++;
6192 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6194 uint64 value2 = op2->ui64;
6197 exp->string = PrintUInt64((op1->ui64 * value2));
6200 exp->expType = op1->type;
6202 op1->type->refCount++;
6207 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 short value2 = op2->s;
6212 exp->string = PrintShort((op1->s * value2));
6215 exp->expType = op1->type;
6217 op1->type->refCount++;
6222 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 unsigned short value2 = op2->us;
6227 exp->string = PrintUShort((op1->us * value2));
6230 exp->expType = op1->type;
6232 op1->type->refCount++;
6237 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 char value2 = op2->c;
6242 exp->string = PrintChar((op1->c * value2));
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 unsigned char value2 = op2->uc;
6257 exp->string = PrintUChar((op1->uc * value2));
6260 exp->expType = op1->type;
6262 op1->type->refCount++;
6267 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 float value2 = op2->f;
6272 exp->string = PrintFloat((float)(op1->f * value2));
6275 exp->expType = op1->type;
6277 op1->type->refCount++;
6282 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 double value2 = op2->d;
6287 exp->string = PrintDouble((double)(op1->d * value2));
6290 exp->expType = op1->type;
6292 op1->type->refCount++;
6297 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 int value2 = op2->i;
6302 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6305 exp->expType = op1->type;
6307 op1->type->refCount++;
6312 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 unsigned int value2 = op2->ui;
6317 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6320 exp->expType = op1->type;
6322 op1->type->refCount++;
6327 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 long long value2 = op2->i64;
6332 exp->string = PrintInt64(value2 ? (op1->i64 / value2) : 0);
6335 exp->expType = op1->type;
6337 op1->type->refCount++;
6342 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 uint64 value2 = op2->ui64;
6347 exp->string = PrintUInt64(value2 ? (op1->ui64 / value2) : 0);
6350 exp->expType = op1->type;
6352 op1->type->refCount++;
6357 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 short value2 = op2->s;
6362 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6365 exp->expType = op1->type;
6367 op1->type->refCount++;
6372 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 unsigned short value2 = op2->us;
6377 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6380 exp->expType = op1->type;
6382 op1->type->refCount++;
6387 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 char value2 = op2->c;
6392 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6395 exp->expType = op1->type;
6397 op1->type->refCount++;
6402 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 unsigned char value2 = op2->uc;
6407 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6410 exp->expType = op1->type;
6412 op1->type->refCount++;
6417 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 float value2 = op2->f;
6422 exp->string = PrintFloat(op1->f / value2);
6425 exp->expType = op1->type;
6427 op1->type->refCount++;
6432 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 double value2 = op2->d;
6437 exp->string = PrintDouble(op1->d / value2);
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 int value2 = op2->i;
6452 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 unsigned int value2 = op2->ui;
6467 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6470 exp->expType = op1->type;
6472 op1->type->refCount++;
6477 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 long long value2 = op2->i64;
6482 exp->string = PrintInt64(value2 ? (op1->i64 % value2) : 0);
6485 exp->expType = op1->type;
6487 op1->type->refCount++;
6492 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 uint64 value2 = op2->ui64;
6497 exp->string = PrintUInt64(value2 ? (op1->ui64 % value2) : 0);
6500 exp->expType = op1->type;
6502 op1->type->refCount++;
6507 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 short value2 = op2->s;
6512 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6515 exp->expType = op1->type;
6517 op1->type->refCount++;
6522 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 unsigned short value2 = op2->us;
6527 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6530 exp->expType = op1->type;
6532 op1->type->refCount++;
6537 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 char value2 = op2->c;
6542 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6545 exp->expType = op1->type;
6547 op1->type->refCount++;
6552 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 unsigned char value2 = op2->uc;
6557 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6560 exp->expType = op1->type;
6562 op1->type->refCount++;
6567 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6570 exp->string = PrintInt((-op1->i));
6573 exp->expType = op1->type;
6575 op1->type->refCount++;
6580 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6583 exp->string = PrintUInt((unsigned int)(-op1->ui));
6586 exp->expType = op1->type;
6588 op1->type->refCount++;
6593 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6596 exp->string = PrintInt64((-op1->i64));
6599 exp->expType = op1->type;
6601 op1->type->refCount++;
6606 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6609 exp->string = PrintUInt64((uint64)(-op1->ui64));
6612 exp->expType = op1->type;
6614 op1->type->refCount++;
6619 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6622 exp->string = PrintShort((-op1->s));
6625 exp->expType = op1->type;
6627 op1->type->refCount++;
6632 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6635 exp->string = PrintUShort((unsigned short)(-op1->us));
6638 exp->expType = op1->type;
6640 op1->type->refCount++;
6645 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6648 exp->string = PrintChar((-op1->c));
6651 exp->expType = op1->type;
6653 op1->type->refCount++;
6658 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6661 exp->string = PrintUChar((unsigned char)(-op1->uc));
6664 exp->expType = op1->type;
6666 op1->type->refCount++;
6671 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6674 exp->string = PrintFloat((float)(-op1->f));
6677 exp->expType = op1->type;
6679 op1->type->refCount++;
6684 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6687 exp->string = PrintDouble((double)(-op1->d));
6690 exp->expType = op1->type;
6692 op1->type->refCount++;
6697 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6700 exp->string = PrintInt((++op1->i));
6703 exp->expType = op1->type;
6705 op1->type->refCount++;
6710 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6713 exp->string = PrintUInt((++op1->ui));
6716 exp->expType = op1->type;
6718 op1->type->refCount++;
6723 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6726 exp->string = PrintInt64((++op1->i64));
6729 exp->expType = op1->type;
6731 op1->type->refCount++;
6736 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6739 exp->string = PrintUInt64((++op1->ui64));
6742 exp->expType = op1->type;
6744 op1->type->refCount++;
6749 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6752 exp->string = PrintShort((++op1->s));
6755 exp->expType = op1->type;
6757 op1->type->refCount++;
6762 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6765 exp->string = PrintUShort((++op1->us));
6768 exp->expType = op1->type;
6770 op1->type->refCount++;
6775 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6778 exp->string = PrintChar((++op1->c));
6781 exp->expType = op1->type;
6783 op1->type->refCount++;
6788 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6791 exp->string = PrintUChar((++op1->uc));
6794 exp->expType = op1->type;
6796 op1->type->refCount++;
6801 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6804 exp->string = PrintFloat((float)(++op1->f));
6807 exp->expType = op1->type;
6809 op1->type->refCount++;
6814 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6817 exp->string = PrintDouble((double)(++op1->d));
6820 exp->expType = op1->type;
6822 op1->type->refCount++;
6827 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6830 exp->string = PrintInt((--op1->i));
6833 exp->expType = op1->type;
6835 op1->type->refCount++;
6840 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6843 exp->string = PrintUInt((--op1->ui));
6846 exp->expType = op1->type;
6848 op1->type->refCount++;
6853 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6856 exp->string = PrintInt64((--op1->i64));
6859 exp->expType = op1->type;
6861 op1->type->refCount++;
6866 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6869 exp->string = PrintUInt64((--op1->ui64));
6872 exp->expType = op1->type;
6874 op1->type->refCount++;
6879 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6882 exp->string = PrintShort((--op1->s));
6885 exp->expType = op1->type;
6887 op1->type->refCount++;
6892 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6895 exp->string = PrintUShort((--op1->us));
6898 exp->expType = op1->type;
6900 op1->type->refCount++;
6905 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6908 exp->string = PrintChar((--op1->c));
6911 exp->expType = op1->type;
6913 op1->type->refCount++;
6918 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6921 exp->string = PrintUChar((--op1->uc));
6924 exp->expType = op1->type;
6926 op1->type->refCount++;
6931 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6934 exp->string = PrintFloat((float)(--op1->f));
6937 exp->expType = op1->type;
6939 op1->type->refCount++;
6944 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6947 exp->string = PrintDouble((double)(--op1->d));
6950 exp->expType = op1->type;
6952 op1->type->refCount++;
6957 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 int value2 = op2->i;
6962 exp->string = PrintInt((op1->i = value2));
6965 exp->expType = op1->type;
6967 op1->type->refCount++;
6972 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 unsigned int value2 = op2->ui;
6977 exp->string = PrintUInt((op1->ui = value2));
6980 exp->expType = op1->type;
6982 op1->type->refCount++;
6987 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 long long value2 = op2->i64;
6992 exp->string = PrintInt64((op1->i64 = value2));
6995 exp->expType = op1->type;
6997 op1->type->refCount++;
7002 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 uint64 value2 = op2->ui64;
7007 exp->string = PrintUInt64((op1->ui64 = value2));
7010 exp->expType = op1->type;
7012 op1->type->refCount++;
7017 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 short value2 = op2->s;
7022 exp->string = PrintShort((op1->s = value2));
7025 exp->expType = op1->type;
7027 op1->type->refCount++;
7032 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 unsigned short value2 = op2->us;
7037 exp->string = PrintUShort((op1->us = value2));
7040 exp->expType = op1->type;
7042 op1->type->refCount++;
7047 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 char value2 = op2->c;
7052 exp->string = PrintChar((op1->c = value2));
7055 exp->expType = op1->type;
7057 op1->type->refCount++;
7062 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 unsigned char value2 = op2->uc;
7067 exp->string = PrintUChar((op1->uc = value2));
7070 exp->expType = op1->type;
7072 op1->type->refCount++;
7077 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 float value2 = op2->f;
7082 exp->string = PrintFloat((float)(op1->f = value2));
7085 exp->expType = op1->type;
7087 op1->type->refCount++;
7092 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 double value2 = op2->d;
7097 exp->string = PrintDouble((double)(op1->d = value2));
7100 exp->expType = op1->type;
7102 op1->type->refCount++;
7107 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 int value2 = op2->i;
7112 exp->string = PrintInt((op1->i += value2));
7115 exp->expType = op1->type;
7117 op1->type->refCount++;
7122 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 unsigned int value2 = op2->ui;
7127 exp->string = PrintUInt((op1->ui += value2));
7130 exp->expType = op1->type;
7132 op1->type->refCount++;
7137 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 long long value2 = op2->i64;
7142 exp->string = PrintInt64((op1->i64 += value2));
7145 exp->expType = op1->type;
7147 op1->type->refCount++;
7152 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 uint64 value2 = op2->ui64;
7157 exp->string = PrintUInt64((op1->ui64 += value2));
7160 exp->expType = op1->type;
7162 op1->type->refCount++;
7167 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 short value2 = op2->s;
7172 exp->string = PrintShort((op1->s += value2));
7175 exp->expType = op1->type;
7177 op1->type->refCount++;
7182 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 unsigned short value2 = op2->us;
7187 exp->string = PrintUShort((op1->us += value2));
7190 exp->expType = op1->type;
7192 op1->type->refCount++;
7197 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 char value2 = op2->c;
7202 exp->string = PrintChar((op1->c += value2));
7205 exp->expType = op1->type;
7207 op1->type->refCount++;
7212 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 unsigned char value2 = op2->uc;
7217 exp->string = PrintUChar((op1->uc += value2));
7220 exp->expType = op1->type;
7222 op1->type->refCount++;
7227 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 float value2 = op2->f;
7232 exp->string = PrintFloat((float)(op1->f += value2));
7235 exp->expType = op1->type;
7237 op1->type->refCount++;
7242 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 double value2 = op2->d;
7247 exp->string = PrintDouble((double)(op1->d += value2));
7250 exp->expType = op1->type;
7252 op1->type->refCount++;
7257 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 int value2 = op2->i;
7262 exp->string = PrintInt((op1->i -= value2));
7265 exp->expType = op1->type;
7267 op1->type->refCount++;
7272 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 unsigned int value2 = op2->ui;
7277 exp->string = PrintUInt((op1->ui -= value2));
7280 exp->expType = op1->type;
7282 op1->type->refCount++;
7287 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 long long value2 = op2->i64;
7292 exp->string = PrintInt64((op1->i64 -= value2));
7295 exp->expType = op1->type;
7297 op1->type->refCount++;
7302 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 uint64 value2 = op2->ui64;
7307 exp->string = PrintUInt64((op1->ui64 -= value2));
7310 exp->expType = op1->type;
7312 op1->type->refCount++;
7317 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 short value2 = op2->s;
7322 exp->string = PrintShort((op1->s -= value2));
7325 exp->expType = op1->type;
7327 op1->type->refCount++;
7332 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 unsigned short value2 = op2->us;
7337 exp->string = PrintUShort((op1->us -= value2));
7340 exp->expType = op1->type;
7342 op1->type->refCount++;
7347 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7349 char value2 = op2->c;
7352 exp->string = PrintChar((op1->c -= value2));
7355 exp->expType = op1->type;
7357 op1->type->refCount++;
7362 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7364 unsigned char value2 = op2->uc;
7367 exp->string = PrintUChar((op1->uc -= value2));
7370 exp->expType = op1->type;
7372 op1->type->refCount++;
7377 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7379 float value2 = op2->f;
7382 exp->string = PrintFloat((float)(op1->f -= value2));
7385 exp->expType = op1->type;
7387 op1->type->refCount++;
7392 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7394 double value2 = op2->d;
7397 exp->string = PrintDouble((double)(op1->d -= value2));
7400 exp->expType = op1->type;
7402 op1->type->refCount++;
7407 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7409 int value2 = op2->i;
7412 exp->string = PrintInt((op1->i *= value2));
7415 exp->expType = op1->type;
7417 op1->type->refCount++;
7422 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7424 unsigned int value2 = op2->ui;
7427 exp->string = PrintUInt((op1->ui *= value2));
7430 exp->expType = op1->type;
7432 op1->type->refCount++;
7437 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7439 long long value2 = op2->i64;
7442 exp->string = PrintInt64((op1->i64 *= value2));
7445 exp->expType = op1->type;
7447 op1->type->refCount++;
7452 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7454 uint64 value2 = op2->ui64;
7457 exp->string = PrintUInt64((op1->ui64 *= value2));
7460 exp->expType = op1->type;
7462 op1->type->refCount++;
7467 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7469 short value2 = op2->s;
7472 exp->string = PrintShort((op1->s *= value2));
7475 exp->expType = op1->type;
7477 op1->type->refCount++;
7482 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7484 unsigned short value2 = op2->us;
7487 exp->string = PrintUShort((op1->us *= value2));
7490 exp->expType = op1->type;
7492 op1->type->refCount++;
7497 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7499 char value2 = op2->c;
7502 exp->string = PrintChar((op1->c *= value2));
7505 exp->expType = op1->type;
7507 op1->type->refCount++;
7512 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 unsigned char value2 = op2->uc;
7517 exp->string = PrintUChar((op1->uc *= value2));
7520 exp->expType = op1->type;
7522 op1->type->refCount++;
7527 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 float value2 = op2->f;
7532 exp->string = PrintFloat((float)(op1->f *= value2));
7535 exp->expType = op1->type;
7537 op1->type->refCount++;
7542 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 double value2 = op2->d;
7547 exp->string = PrintDouble((double)(op1->d *= value2));
7550 exp->expType = op1->type;
7552 op1->type->refCount++;
7557 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 int value2 = op2->i;
7562 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7565 exp->expType = op1->type;
7567 op1->type->refCount++;
7572 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 unsigned int value2 = op2->ui;
7577 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7580 exp->expType = op1->type;
7582 op1->type->refCount++;
7587 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 long long value2 = op2->i64;
7592 exp->string = PrintInt64(value2 ? (op1->i64 /= value2) : 0);
7595 exp->expType = op1->type;
7597 op1->type->refCount++;
7602 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 uint64 value2 = op2->ui64;
7607 exp->string = PrintUInt64(value2 ? (op1->ui64 /= value2) : 0);
7610 exp->expType = op1->type;
7612 op1->type->refCount++;
7617 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 short value2 = op2->s;
7622 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7625 exp->expType = op1->type;
7627 op1->type->refCount++;
7632 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 unsigned short value2 = op2->us;
7637 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7640 exp->expType = op1->type;
7642 op1->type->refCount++;
7647 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 char value2 = op2->c;
7652 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7655 exp->expType = op1->type;
7657 op1->type->refCount++;
7662 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 unsigned char value2 = op2->uc;
7667 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7670 exp->expType = op1->type;
7672 op1->type->refCount++;
7677 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 float value2 = op2->f;
7682 exp->string = PrintFloat(op1->f /= value2);
7685 exp->expType = op1->type;
7687 op1->type->refCount++;
7692 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 double value2 = op2->d;
7697 exp->string = PrintDouble(op1->d /= value2);
7700 exp->expType = op1->type;
7702 op1->type->refCount++;
7707 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 int value2 = op2->i;
7712 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7715 exp->expType = op1->type;
7717 op1->type->refCount++;
7722 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 unsigned int value2 = op2->ui;
7727 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7730 exp->expType = op1->type;
7732 op1->type->refCount++;
7737 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 long long value2 = op2->i64;
7742 exp->string = PrintInt64(value2 ? (op1->i64 %= value2) : 0);
7745 exp->expType = op1->type;
7747 op1->type->refCount++;
7752 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 uint64 value2 = op2->ui64;
7757 exp->string = PrintUInt64(value2 ? (op1->ui64 %= value2) : 0);
7760 exp->expType = op1->type;
7762 op1->type->refCount++;
7767 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 short value2 = op2->s;
7772 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7775 exp->expType = op1->type;
7777 op1->type->refCount++;
7782 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 unsigned short value2 = op2->us;
7787 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7790 exp->expType = op1->type;
7792 op1->type->refCount++;
7797 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 char value2 = op2->c;
7802 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7805 exp->expType = op1->type;
7807 op1->type->refCount++;
7812 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 unsigned char value2 = op2->uc;
7817 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7820 exp->expType = op1->type;
7822 op1->type->refCount++;
7827 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 int value2 = op2->i;
7832 exp->string = PrintInt((op1->i & value2));
7835 exp->expType = op1->type;
7837 op1->type->refCount++;
7842 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 unsigned int value2 = op2->ui;
7847 exp->string = PrintUInt((op1->ui & value2));
7850 exp->expType = op1->type;
7852 op1->type->refCount++;
7857 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 long long value2 = op2->i64;
7862 exp->string = PrintInt64((op1->i64 & value2));
7865 exp->expType = op1->type;
7867 op1->type->refCount++;
7872 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 uint64 value2 = op2->ui64;
7877 exp->string = PrintUInt64((op1->ui64 & value2));
7880 exp->expType = op1->type;
7882 op1->type->refCount++;
7887 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 short value2 = op2->s;
7892 exp->string = PrintShort((op1->s & value2));
7895 exp->expType = op1->type;
7897 op1->type->refCount++;
7902 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 unsigned short value2 = op2->us;
7907 exp->string = PrintUShort((op1->us & value2));
7910 exp->expType = op1->type;
7912 op1->type->refCount++;
7917 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 char value2 = op2->c;
7922 exp->string = PrintChar((op1->c & value2));
7925 exp->expType = op1->type;
7927 op1->type->refCount++;
7932 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 unsigned char value2 = op2->uc;
7937 exp->string = PrintUChar((op1->uc & value2));
7940 exp->expType = op1->type;
7942 op1->type->refCount++;
7947 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 int value2 = op2->i;
7952 exp->string = PrintInt((op1->i | value2));
7955 exp->expType = op1->type;
7957 op1->type->refCount++;
7962 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7964 unsigned int value2 = op2->ui;
7967 exp->string = PrintUInt((op1->ui | value2));
7970 exp->expType = op1->type;
7972 op1->type->refCount++;
7977 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7979 long long value2 = op2->i64;
7982 exp->string = PrintInt64((op1->i64 | value2));
7985 exp->expType = op1->type;
7987 op1->type->refCount++;
7992 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7994 uint64 value2 = op2->ui64;
7997 exp->string = PrintUInt64((op1->ui64 | value2));
8000 exp->expType = op1->type;
8002 op1->type->refCount++;
8007 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8009 short value2 = op2->s;
8012 exp->string = PrintShort((op1->s | value2));
8015 exp->expType = op1->type;
8017 op1->type->refCount++;
8022 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8024 unsigned short value2 = op2->us;
8027 exp->string = PrintUShort((op1->us | value2));
8030 exp->expType = op1->type;
8032 op1->type->refCount++;
8037 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8039 char value2 = op2->c;
8042 exp->string = PrintChar((op1->c | value2));
8045 exp->expType = op1->type;
8047 op1->type->refCount++;
8052 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8054 unsigned char value2 = op2->uc;
8057 exp->string = PrintUChar((op1->uc | value2));
8060 exp->expType = op1->type;
8062 op1->type->refCount++;
8067 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8069 int value2 = op2->i;
8072 exp->string = PrintInt((op1->i ^ value2));
8075 exp->expType = op1->type;
8077 op1->type->refCount++;
8082 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8084 unsigned int value2 = op2->ui;
8087 exp->string = PrintUInt((op1->ui ^ value2));
8090 exp->expType = op1->type;
8092 op1->type->refCount++;
8097 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8099 long long value2 = op2->i64;
8102 exp->string = PrintInt64((op1->i64 ^ value2));
8105 exp->expType = op1->type;
8107 op1->type->refCount++;
8112 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 uint64 value2 = op2->ui64;
8117 exp->string = PrintUInt64((op1->ui64 ^ value2));
8120 exp->expType = op1->type;
8122 op1->type->refCount++;
8127 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 short value2 = op2->s;
8132 exp->string = PrintShort((op1->s ^ value2));
8135 exp->expType = op1->type;
8137 op1->type->refCount++;
8142 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 unsigned short value2 = op2->us;
8147 exp->string = PrintUShort((op1->us ^ value2));
8150 exp->expType = op1->type;
8152 op1->type->refCount++;
8157 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 char value2 = op2->c;
8162 exp->string = PrintChar((op1->c ^ value2));
8165 exp->expType = op1->type;
8167 op1->type->refCount++;
8172 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 unsigned char value2 = op2->uc;
8177 exp->string = PrintUChar((op1->uc ^ value2));
8180 exp->expType = op1->type;
8182 op1->type->refCount++;
8187 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 int value2 = op2->i;
8192 exp->string = PrintInt((op1->i << value2));
8195 exp->expType = op1->type;
8197 op1->type->refCount++;
8202 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 unsigned int value2 = op2->ui;
8207 exp->string = PrintUInt((op1->ui << value2));
8210 exp->expType = op1->type;
8212 op1->type->refCount++;
8217 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8219 long long value2 = op2->i64;
8222 exp->string = PrintInt64((op1->i64 << value2));
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 uint64 value2 = op2->ui64;
8237 exp->string = PrintUInt64((op1->ui64 << value2));
8240 exp->expType = op1->type;
8242 op1->type->refCount++;
8247 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 short value2 = op2->s;
8252 exp->string = PrintShort((op1->s << value2));
8255 exp->expType = op1->type;
8257 op1->type->refCount++;
8262 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 unsigned short value2 = op2->us;
8267 exp->string = PrintUShort((op1->us << value2));
8270 exp->expType = op1->type;
8272 op1->type->refCount++;
8277 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 char value2 = op2->c;
8282 exp->string = PrintChar((op1->c << value2));
8285 exp->expType = op1->type;
8287 op1->type->refCount++;
8292 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 unsigned char value2 = op2->uc;
8297 exp->string = PrintUChar((op1->uc << value2));
8300 exp->expType = op1->type;
8302 op1->type->refCount++;
8307 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 int value2 = op2->i;
8312 exp->string = PrintInt((op1->i >> value2));
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 unsigned int value2 = op2->ui;
8327 exp->string = PrintUInt((op1->ui >> value2));
8330 exp->expType = op1->type;
8332 op1->type->refCount++;
8337 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 long long value2 = op2->i64;
8342 exp->string = PrintInt64((op1->i64 >> value2));
8345 exp->expType = op1->type;
8347 op1->type->refCount++;
8352 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 uint64 value2 = op2->ui64;
8357 exp->string = PrintUInt64((op1->ui64 >> value2));
8360 exp->expType = op1->type;
8362 op1->type->refCount++;
8367 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 short value2 = op2->s;
8372 exp->string = PrintShort((op1->s >> value2));
8375 exp->expType = op1->type;
8377 op1->type->refCount++;
8382 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 unsigned short value2 = op2->us;
8387 exp->string = PrintUShort((op1->us >> value2));
8390 exp->expType = op1->type;
8392 op1->type->refCount++;
8397 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 char value2 = op2->c;
8402 exp->string = PrintChar((op1->c >> value2));
8405 exp->expType = op1->type;
8407 op1->type->refCount++;
8412 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 unsigned char value2 = op2->uc;
8417 exp->string = PrintUChar((op1->uc >> value2));
8420 exp->expType = op1->type;
8422 op1->type->refCount++;
8427 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8430 exp->string = PrintInt((~op1->i));
8433 exp->expType = op1->type;
8435 op1->type->refCount++;
8440 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8443 exp->string = PrintUInt((unsigned int)(~op1->ui));
8446 exp->expType = op1->type;
8448 op1->type->refCount++;
8453 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8456 exp->string = PrintInt64((long long)(~op1->i64));
8459 exp->expType = op1->type;
8461 op1->type->refCount++;
8466 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8469 exp->string = PrintUInt64((uint64)(~op1->ui64));
8472 exp->expType = op1->type;
8474 op1->type->refCount++;
8479 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8482 exp->string = PrintShort((short)(~op1->s));
8485 exp->expType = op1->type;
8487 op1->type->refCount++;
8492 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8495 exp->string = PrintUShort((unsigned short)(~op1->us));
8498 exp->expType = op1->type;
8500 op1->type->refCount++;
8505 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8508 exp->string = PrintChar((char)(~op1->c));
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8521 exp->string = PrintUChar((unsigned char)(~op1->uc));
8524 exp->expType = op1->type;
8526 op1->type->refCount++;
8531 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8533 int value2 = op2->i;
8536 exp->string = PrintInt((op1->i &= value2));
8539 exp->expType = op1->type;
8541 op1->type->refCount++;
8546 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8548 unsigned int value2 = op2->ui;
8551 exp->string = PrintUInt((op1->ui &= value2));
8554 exp->expType = op1->type;
8556 op1->type->refCount++;
8561 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8563 long long value2 = op2->i64;
8566 exp->string = PrintInt64((op1->i64 &= value2));
8569 exp->expType = op1->type;
8571 op1->type->refCount++;
8576 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8578 uint64 value2 = op2->ui64;
8581 exp->string = PrintUInt64((op1->ui64 &= value2));
8584 exp->expType = op1->type;
8586 op1->type->refCount++;
8591 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8593 short value2 = op2->s;
8596 exp->string = PrintShort((op1->s &= value2));
8599 exp->expType = op1->type;
8601 op1->type->refCount++;
8606 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8608 unsigned short value2 = op2->us;
8611 exp->string = PrintUShort((op1->us &= value2));
8614 exp->expType = op1->type;
8616 op1->type->refCount++;
8621 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8623 char value2 = op2->c;
8626 exp->string = PrintChar((op1->c &= value2));
8629 exp->expType = op1->type;
8631 op1->type->refCount++;
8636 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8638 unsigned char value2 = op2->uc;
8641 exp->string = PrintUChar((op1->uc &= value2));
8644 exp->expType = op1->type;
8646 op1->type->refCount++;
8651 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8653 int value2 = op2->i;
8656 exp->string = PrintInt((op1->i |= value2));
8659 exp->expType = op1->type;
8661 op1->type->refCount++;
8666 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8668 unsigned int value2 = op2->ui;
8671 exp->string = PrintUInt((op1->ui |= value2));
8674 exp->expType = op1->type;
8676 op1->type->refCount++;
8681 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8683 long long value2 = op2->i64;
8686 exp->string = PrintInt64((op1->i64 |= value2));
8689 exp->expType = op1->type;
8691 op1->type->refCount++;
8696 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8698 uint64 value2 = op2->ui64;
8701 exp->string = PrintUInt64((op1->ui64 |= value2));
8704 exp->expType = op1->type;
8706 op1->type->refCount++;
8711 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8713 short value2 = op2->s;
8716 exp->string = PrintShort((op1->s |= value2));
8719 exp->expType = op1->type;
8721 op1->type->refCount++;
8726 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8728 unsigned short value2 = op2->us;
8731 exp->string = PrintUShort((op1->us |= value2));
8734 exp->expType = op1->type;
8736 op1->type->refCount++;
8741 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8743 char value2 = op2->c;
8746 exp->string = PrintChar((op1->c |= value2));
8749 exp->expType = op1->type;
8751 op1->type->refCount++;
8756 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8758 unsigned char value2 = op2->uc;
8761 exp->string = PrintUChar((op1->uc |= value2));
8764 exp->expType = op1->type;
8766 op1->type->refCount++;
8771 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8773 int value2 = op2->i;
8776 exp->string = PrintInt((op1->i ^= value2));
8779 exp->expType = op1->type;
8781 op1->type->refCount++;
8786 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8788 unsigned int value2 = op2->ui;
8791 exp->string = PrintUInt((op1->ui ^= value2));
8794 exp->expType = op1->type;
8796 op1->type->refCount++;
8801 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8803 long long value2 = op2->i64;
8806 exp->string = PrintInt64((op1->i64 ^= value2));
8809 exp->expType = op1->type;
8811 op1->type->refCount++;
8816 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8818 uint64 value2 = op2->ui64;
8821 exp->string = PrintUInt64((op1->ui64 ^= value2));
8824 exp->expType = op1->type;
8826 op1->type->refCount++;
8831 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8833 short value2 = op2->s;
8836 exp->string = PrintShort((op1->s ^= value2));
8839 exp->expType = op1->type;
8841 op1->type->refCount++;
8846 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8848 unsigned short value2 = op2->us;
8851 exp->string = PrintUShort((op1->us ^= value2));
8854 exp->expType = op1->type;
8856 op1->type->refCount++;
8861 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8863 char value2 = op2->c;
8866 exp->string = PrintChar((op1->c ^= value2));
8869 exp->expType = op1->type;
8871 op1->type->refCount++;
8876 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8878 unsigned char value2 = op2->uc;
8881 exp->string = PrintUChar((op1->uc ^= value2));
8884 exp->expType = op1->type;
8886 op1->type->refCount++;
8891 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8893 int value2 = op2->i;
8896 exp->string = PrintInt((op1->i <<= value2));
8899 exp->expType = op1->type;
8901 op1->type->refCount++;
8906 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8908 unsigned int value2 = op2->ui;
8911 exp->string = PrintUInt((op1->ui <<= value2));
8914 exp->expType = op1->type;
8916 op1->type->refCount++;
8921 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8923 long long value2 = op2->i64;
8926 exp->string = PrintInt64((op1->i64 <<= value2));
8929 exp->expType = op1->type;
8931 op1->type->refCount++;
8936 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8938 uint64 value2 = op2->ui64;
8941 exp->string = PrintUInt64((op1->ui64 <<= value2));
8944 exp->expType = op1->type;
8946 op1->type->refCount++;
8951 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8953 short value2 = op2->s;
8956 exp->string = PrintShort((op1->s <<= value2));
8959 exp->expType = op1->type;
8961 op1->type->refCount++;
8966 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8968 unsigned short value2 = op2->us;
8971 exp->string = PrintUShort((op1->us <<= value2));
8974 exp->expType = op1->type;
8976 op1->type->refCount++;
8981 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8983 char value2 = op2->c;
8986 exp->string = PrintChar((op1->c <<= value2));
8989 exp->expType = op1->type;
8991 op1->type->refCount++;
8996 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8998 unsigned char value2 = op2->uc;
9001 exp->string = PrintUChar((op1->uc <<= value2));
9004 exp->expType = op1->type;
9006 op1->type->refCount++;
9011 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9013 int value2 = op2->i;
9016 exp->string = PrintInt((op1->i >>= value2));
9019 exp->expType = op1->type;
9021 op1->type->refCount++;
9026 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 unsigned int value2 = op2->ui;
9031 exp->string = PrintUInt((op1->ui >>= value2));
9034 exp->expType = op1->type;
9036 op1->type->refCount++;
9041 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 long long value2 = op2->i64;
9046 exp->string = PrintInt64((op1->i64 >>= value2));
9049 exp->expType = op1->type;
9051 op1->type->refCount++;
9056 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 uint64 value2 = op2->ui64;
9061 exp->string = PrintUInt64((op1->ui64 >>= value2));
9064 exp->expType = op1->type;
9066 op1->type->refCount++;
9071 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 short value2 = op2->s;
9076 exp->string = PrintShort((op1->s >>= value2));
9079 exp->expType = op1->type;
9081 op1->type->refCount++;
9086 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 unsigned short value2 = op2->us;
9091 exp->string = PrintUShort((op1->us >>= value2));
9094 exp->expType = op1->type;
9096 op1->type->refCount++;
9101 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 char value2 = op2->c;
9106 exp->string = PrintChar((op1->c >>= value2));
9109 exp->expType = op1->type;
9111 op1->type->refCount++;
9116 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 unsigned char value2 = op2->uc;
9121 exp->string = PrintUChar((op1->uc >>= value2));
9124 exp->expType = op1->type;
9126 op1->type->refCount++;
9131 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
9134 exp->string = PrintInt((int)(!op1->i));
9137 exp->expType = op1->type;
9139 op1->type->refCount++;
9144 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
9147 exp->string = PrintUInt((unsigned int)(!op1->ui));
9150 exp->expType = op1->type;
9152 op1->type->refCount++;
9157 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
9160 exp->string = PrintInt64((long long)(!op1->i64));
9163 exp->expType = op1->type;
9165 op1->type->refCount++;
9170 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
9173 exp->string = PrintUInt64((uint64)(!op1->ui64));
9176 exp->expType = op1->type;
9178 op1->type->refCount++;
9183 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
9186 exp->string = PrintShort((short)(!op1->s));
9189 exp->expType = op1->type;
9191 op1->type->refCount++;
9196 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
9199 exp->string = PrintUShort((unsigned short)(!op1->us));
9202 exp->expType = op1->type;
9204 op1->type->refCount++;
9209 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9212 exp->string = PrintChar((char)(!op1->c));
9215 exp->expType = op1->type;
9217 op1->type->refCount++;
9222 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9225 exp->string = PrintUChar((unsigned char)(!op1->uc));
9228 exp->expType = op1->type;
9230 op1->type->refCount++;
9235 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9237 int value2 = op2->i;
9240 exp->string = PrintInt((int)(op1->i == value2));
9243 exp->expType = op1->type;
9245 op1->type->refCount++;
9250 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9252 unsigned int value2 = op2->ui;
9255 exp->string = PrintUInt((unsigned int)(op1->ui == value2));
9258 exp->expType = op1->type;
9260 op1->type->refCount++;
9265 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9267 long long value2 = op2->i64;
9270 exp->string = PrintInt64((long long)(op1->i64 == value2));
9273 exp->expType = op1->type;
9275 op1->type->refCount++;
9280 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9282 uint64 value2 = op2->ui64;
9285 exp->string = PrintUInt64((uint64)(op1->ui64 == value2));
9288 exp->expType = op1->type;
9290 op1->type->refCount++;
9295 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9297 short value2 = op2->s;
9300 exp->string = PrintShort((short)(op1->s == value2));
9303 exp->expType = op1->type;
9305 op1->type->refCount++;
9310 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9312 unsigned short value2 = op2->us;
9315 exp->string = PrintUShort((unsigned short)(op1->us == value2));
9318 exp->expType = op1->type;
9320 op1->type->refCount++;
9325 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9327 char value2 = op2->c;
9330 exp->string = PrintChar((char)(op1->c == value2));
9333 exp->expType = op1->type;
9335 op1->type->refCount++;
9340 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9342 unsigned char value2 = op2->uc;
9345 exp->string = PrintUChar((unsigned char)(op1->uc == value2));
9348 exp->expType = op1->type;
9350 op1->type->refCount++;
9355 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9357 float value2 = op2->f;
9360 exp->string = PrintFloat((float)(op1->f == value2));
9363 exp->expType = op1->type;
9365 op1->type->refCount++;
9370 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9372 double value2 = op2->d;
9375 exp->string = PrintDouble((double)(op1->d == value2));
9378 exp->expType = op1->type;
9380 op1->type->refCount++;
9385 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9387 int value2 = op2->i;
9390 exp->string = PrintInt((int)(op1->i != value2));
9393 exp->expType = op1->type;
9395 op1->type->refCount++;
9400 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9402 unsigned int value2 = op2->ui;
9405 exp->string = PrintUInt((unsigned int)(op1->ui != value2));
9408 exp->expType = op1->type;
9410 op1->type->refCount++;
9415 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9417 long long value2 = op2->i64;
9420 exp->string = PrintInt64((long long)(op1->i64 != value2));
9423 exp->expType = op1->type;
9425 op1->type->refCount++;
9430 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9432 uint64 value2 = op2->ui64;
9435 exp->string = PrintUInt64((uint64)(op1->ui64 != value2));
9438 exp->expType = op1->type;
9440 op1->type->refCount++;
9445 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9447 short value2 = op2->s;
9450 exp->string = PrintShort((short)(op1->s != value2));
9453 exp->expType = op1->type;
9455 op1->type->refCount++;
9460 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9462 unsigned short value2 = op2->us;
9465 exp->string = PrintUShort((unsigned short)(op1->us != value2));
9468 exp->expType = op1->type;
9470 op1->type->refCount++;
9475 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9477 char value2 = op2->c;
9480 exp->string = PrintChar((char)(op1->c != value2));
9483 exp->expType = op1->type;
9485 op1->type->refCount++;
9490 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9492 unsigned char value2 = op2->uc;
9495 exp->string = PrintUChar((unsigned char)(op1->uc != value2));
9498 exp->expType = op1->type;
9500 op1->type->refCount++;
9505 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9507 float value2 = op2->f;
9510 exp->string = PrintFloat((float)(op1->f != value2));
9513 exp->expType = op1->type;
9515 op1->type->refCount++;
9520 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9522 double value2 = op2->d;
9525 exp->string = PrintDouble((double)(op1->d != value2));
9528 exp->expType = op1->type;
9530 op1->type->refCount++;
9535 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9537 int value2 = op2->i;
9540 exp->string = PrintInt((int)(op1->i && value2));
9543 exp->expType = op1->type;
9545 op1->type->refCount++;
9550 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9552 unsigned int value2 = op2->ui;
9555 exp->string = PrintUInt((unsigned int)(op1->ui && value2));
9558 exp->expType = op1->type;
9560 op1->type->refCount++;
9565 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9567 long long value2 = op2->i64;
9570 exp->string = PrintInt64((long long)(op1->i64 && value2));
9573 exp->expType = op1->type;
9575 op1->type->refCount++;
9580 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9582 uint64 value2 = op2->ui64;
9585 exp->string = PrintUInt64((uint64)(op1->ui64 && value2));
9588 exp->expType = op1->type;
9590 op1->type->refCount++;
9595 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9597 short value2 = op2->s;
9600 exp->string = PrintShort((short)(op1->s && value2));
9603 exp->expType = op1->type;
9605 op1->type->refCount++;
9610 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9612 unsigned short value2 = op2->us;
9615 exp->string = PrintUShort((unsigned short)(op1->us && value2));
9618 exp->expType = op1->type;
9620 op1->type->refCount++;
9625 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9627 char value2 = op2->c;
9630 exp->string = PrintChar((char)(op1->c && value2));
9633 exp->expType = op1->type;
9635 op1->type->refCount++;
9640 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9642 unsigned char value2 = op2->uc;
9645 exp->string = PrintUChar((unsigned char)(op1->uc && value2));
9648 exp->expType = op1->type;
9650 op1->type->refCount++;
9655 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9657 float value2 = op2->f;
9660 exp->string = PrintFloat((float)(op1->f && value2));
9663 exp->expType = op1->type;
9665 op1->type->refCount++;
9670 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9672 double value2 = op2->d;
9675 exp->string = PrintDouble((double)(op1->d && value2));
9678 exp->expType = op1->type;
9680 op1->type->refCount++;
9685 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9687 int value2 = op2->i;
9690 exp->string = PrintInt((int)(op1->i || value2));
9693 exp->expType = op1->type;
9695 op1->type->refCount++;
9700 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9702 unsigned int value2 = op2->ui;
9705 exp->string = PrintUInt((unsigned int)(op1->ui || value2));
9708 exp->expType = op1->type;
9710 op1->type->refCount++;
9715 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9717 long long value2 = op2->i64;
9720 exp->string = PrintInt64((long long)(op1->i64 || value2));
9723 exp->expType = op1->type;
9725 op1->type->refCount++;
9730 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9732 uint64 value2 = op2->ui64;
9735 exp->string = PrintUInt64((uint64)(op1->ui64 || value2));
9738 exp->expType = op1->type;
9740 op1->type->refCount++;
9745 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9747 short value2 = op2->s;
9750 exp->string = PrintShort((short)(op1->s || value2));
9753 exp->expType = op1->type;
9755 op1->type->refCount++;
9760 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9762 unsigned short value2 = op2->us;
9765 exp->string = PrintUShort((unsigned short)(op1->us || value2));
9768 exp->expType = op1->type;
9770 op1->type->refCount++;
9775 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9777 char value2 = op2->c;
9780 exp->string = PrintChar((char)(op1->c || value2));
9783 exp->expType = op1->type;
9785 op1->type->refCount++;
9790 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9792 unsigned char value2 = op2->uc;
9795 exp->string = PrintUChar((unsigned char)(op1->uc || value2));
9798 exp->expType = op1->type;
9800 op1->type->refCount++;
9805 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9807 float value2 = op2->f;
9810 exp->string = PrintFloat((float)(op1->f || value2));
9813 exp->expType = op1->type;
9815 op1->type->refCount++;
9820 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9822 double value2 = op2->d;
9825 exp->string = PrintDouble((double)(op1->d || value2));
9828 exp->expType = op1->type;
9830 op1->type->refCount++;
9835 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9837 int value2 = op2->i;
9840 exp->string = PrintInt((int)(op1->i > value2));
9843 exp->expType = op1->type;
9845 op1->type->refCount++;
9850 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9852 unsigned int value2 = op2->ui;
9855 exp->string = PrintUInt((unsigned int)(op1->ui > value2));
9858 exp->expType = op1->type;
9860 op1->type->refCount++;
9865 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9867 long long value2 = op2->i64;
9870 exp->string = PrintInt64((long long)(op1->i64 > value2));
9873 exp->expType = op1->type;
9875 op1->type->refCount++;
9880 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9882 uint64 value2 = op2->ui64;
9885 exp->string = PrintUInt64((uint64)(op1->ui64 > value2));
9888 exp->expType = op1->type;
9890 op1->type->refCount++;
9895 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9897 short value2 = op2->s;
9900 exp->string = PrintShort((short)(op1->s > value2));
9903 exp->expType = op1->type;
9905 op1->type->refCount++;
9910 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9912 unsigned short value2 = op2->us;
9915 exp->string = PrintUShort((unsigned short)(op1->us > value2));
9918 exp->expType = op1->type;
9920 op1->type->refCount++;
9925 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9927 char value2 = op2->c;
9930 exp->string = PrintChar((char)(op1->c > value2));
9933 exp->expType = op1->type;
9935 op1->type->refCount++;
9940 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9942 unsigned char value2 = op2->uc;
9945 exp->string = PrintUChar((unsigned char)(op1->uc > value2));
9948 exp->expType = op1->type;
9950 op1->type->refCount++;
9955 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9957 float value2 = op2->f;
9960 exp->string = PrintFloat((float)(op1->f > value2));
9963 exp->expType = op1->type;
9965 op1->type->refCount++;
9970 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9972 double value2 = op2->d;
9975 exp->string = PrintDouble((double)(op1->d > value2));
9978 exp->expType = op1->type;
9980 op1->type->refCount++;
9985 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9987 int value2 = op2->i;
9990 exp->string = PrintInt((int)(op1->i < value2));
9993 exp->expType = op1->type;
9995 op1->type->refCount++;
10000 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10002 unsigned int value2 = op2->ui;
10005 exp->string = PrintUInt((unsigned int)(op1->ui < value2));
10008 exp->expType = op1->type;
10010 op1->type->refCount++;
10015 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10017 long long value2 = op2->i64;
10020 exp->string = PrintInt64((long long)(op1->i64 < value2));
10023 exp->expType = op1->type;
10025 op1->type->refCount++;
10030 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10032 uint64 value2 = op2->ui64;
10035 exp->string = PrintUInt64((uint64)(op1->ui64 < value2));
10038 exp->expType = op1->type;
10040 op1->type->refCount++;
10045 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10047 short value2 = op2->s;
10050 exp->string = PrintShort((short)(op1->s < value2));
10053 exp->expType = op1->type;
10055 op1->type->refCount++;
10060 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10062 unsigned short value2 = op2->us;
10065 exp->string = PrintUShort((unsigned short)(op1->us < value2));
10068 exp->expType = op1->type;
10070 op1->type->refCount++;
10075 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10077 char value2 = op2->c;
10080 exp->string = PrintChar((char)(op1->c < value2));
10083 exp->expType = op1->type;
10085 op1->type->refCount++;
10090 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10092 unsigned char value2 = op2->uc;
10095 exp->string = PrintUChar((unsigned char)(op1->uc < value2));
10098 exp->expType = op1->type;
10100 op1->type->refCount++;
10105 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10107 float value2 = op2->f;
10110 exp->string = PrintFloat((float)(op1->f < value2));
10113 exp->expType = op1->type;
10115 op1->type->refCount++;
10120 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10122 double value2 = op2->d;
10125 exp->string = PrintDouble((double)(op1->d < value2));
10128 exp->expType = op1->type;
10130 op1->type->refCount++;
10135 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10137 int value2 = op2->i;
10140 exp->string = PrintInt((int)(op1->i >= value2));
10143 exp->expType = op1->type;
10145 op1->type->refCount++;
10150 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10152 unsigned int value2 = op2->ui;
10155 exp->string = PrintUInt((unsigned int)(op1->ui >= value2));
10158 exp->expType = op1->type;
10160 op1->type->refCount++;
10165 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10167 long long value2 = op2->i64;
10170 exp->string = PrintInt64((long long)(op1->i64 >= value2));
10173 exp->expType = op1->type;
10175 op1->type->refCount++;
10180 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10182 uint64 value2 = op2->ui64;
10185 exp->string = PrintUInt64((uint64)(op1->ui64 >= value2));
10188 exp->expType = op1->type;
10190 op1->type->refCount++;
10195 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10197 short value2 = op2->s;
10200 exp->string = PrintShort((short)(op1->s >= value2));
10203 exp->expType = op1->type;
10205 op1->type->refCount++;
10210 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10212 unsigned short value2 = op2->us;
10215 exp->string = PrintUShort((unsigned short)(op1->us >= value2));
10218 exp->expType = op1->type;
10220 op1->type->refCount++;
10225 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10227 char value2 = op2->c;
10230 exp->string = PrintChar((char)(op1->c >= value2));
10233 exp->expType = op1->type;
10235 op1->type->refCount++;
10240 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10242 unsigned char value2 = op2->uc;
10245 exp->string = PrintUChar((unsigned char)(op1->uc >= value2));
10248 exp->expType = op1->type;
10250 op1->type->refCount++;
10255 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10257 float value2 = op2->f;
10260 exp->string = PrintFloat((float)(op1->f >= value2));
10263 exp->expType = op1->type;
10265 op1->type->refCount++;
10270 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10272 double value2 = op2->d;
10275 exp->string = PrintDouble((double)(op1->d >= value2));
10278 exp->expType = op1->type;
10280 op1->type->refCount++;
10285 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10287 int value2 = op2->i;
10290 exp->string = PrintInt((int)(op1->i <= value2));
10293 exp->expType = op1->type;
10295 op1->type->refCount++;
10300 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10302 unsigned int value2 = op2->ui;
10305 exp->string = PrintUInt((unsigned int)(op1->ui <= value2));
10308 exp->expType = op1->type;
10310 op1->type->refCount++;
10315 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10317 long long value2 = op2->i64;
10320 exp->string = PrintInt64((long long)(op1->i64 <= value2));
10323 exp->expType = op1->type;
10325 op1->type->refCount++;
10330 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10332 uint64 value2 = op2->ui64;
10335 exp->string = PrintUInt64((uint64)(op1->ui64 <= value2));
10338 exp->expType = op1->type;
10340 op1->type->refCount++;
10345 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10347 short value2 = op2->s;
10350 exp->string = PrintShort((short)(op1->s <= value2));
10353 exp->expType = op1->type;
10355 op1->type->refCount++;
10360 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10362 unsigned short value2 = op2->us;
10365 exp->string = PrintUShort((unsigned short)(op1->us <= value2));
10368 exp->expType = op1->type;
10370 op1->type->refCount++;
10375 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10377 char value2 = op2->c;
10380 exp->string = PrintChar((char)(op1->c <= value2));
10383 exp->expType = op1->type;
10385 op1->type->refCount++;
10390 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10392 unsigned char value2 = op2->uc;
10395 exp->string = PrintUChar((unsigned char)(op1->uc <= value2));
10398 exp->expType = op1->type;
10400 op1->type->refCount++;
10405 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10407 float value2 = op2->f;
10410 exp->string = PrintFloat((float)(op1->f <= value2));
10413 exp->expType = op1->type;
10415 op1->type->refCount++;
10420 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10422 double value2 = op2->d;
10425 exp->string = PrintDouble((double)(op1->d <= value2));
10428 exp->expType = op1->type;
10430 op1->type->refCount++;
10435 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10438 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10441 exp->expType = op1->type;
10443 op1->type->refCount++;
10448 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10451 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10454 exp->expType = op1->type;
10456 op1->type->refCount++;
10461 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10464 exp->string = PrintInt64(op1->i64 ? op2->i64 : op3->i64);
10467 exp->expType = op1->type;
10469 op1->type->refCount++;
10474 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10477 exp->string = PrintUInt64(op1->ui64 ? op2->ui64 : op3->ui64);
10480 exp->expType = op1->type;
10482 op1->type->refCount++;
10487 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10490 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10493 exp->expType = op1->type;
10495 op1->type->refCount++;
10500 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10503 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10506 exp->expType = op1->type;
10508 op1->type->refCount++;
10513 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10516 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10519 exp->expType = op1->type;
10521 op1->type->refCount++;
10526 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10529 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10532 exp->expType = op1->type;
10534 op1->type->refCount++;
10539 struct OpTable intOps =
10541 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
10544 struct OpTable uintOps =
10546 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
10549 struct OpTable int64Ops =
10551 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
10554 struct OpTable uint64Ops =
10556 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
10559 struct OpTable shortOps =
10561 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
10564 struct OpTable ushortOps =
10566 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
10569 struct OpTable floatOps =
10571 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
10574 struct OpTable doubleOps =
10576 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
10579 struct OpTable charOps =
10581 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
10584 struct OpTable ucharOps =
10586 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
10589 void ReadString(char * output, char * string)
10591 int len = strlen(string);
10593 unsigned int quoted = 0x0, escaped = 0x0;
10595 for(c = 0; c < len; c++)
10597 char ch = string[c];
10655 int UnescapeString(char * d, char * s, int len)
10660 while(j < len && (ch = s[j]))
10665 switch((ch = s[++j]))
10711 char * OffsetEscapedString(char * s, int len, int offset)
10716 while(j < len && k < offset && (ch = s[j]))
10722 return (k == offset) ? s + j : (((void *)0));
10725 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10727 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10729 extern double strtod(char * , char * * );
10731 extern float (* __ecereMethod_float_inf)(void);
10733 extern float (* __ecereMethod_float_nan)(void);
10735 extern double (* __ecereMethod_double_inf)(void);
10737 extern double (* __ecereMethod_double_nan)(void);
10739 struct Operand GetOperand(struct Expression * exp)
10741 struct Operand op =
10745 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10748 struct Type * type = exp->expType;
10752 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10754 if(!type->_class->registered->dataType)
10755 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10756 type = type->_class->registered->dataType;
10758 if(exp->type == 3 && op.kind == 13)
10760 op.ui64 = (uint64)exp->string;
10762 op.ops = uint64Ops;
10764 else if(exp->isConstant && exp->type == 2)
10766 op.kind = type->kind;
10767 op.type = exp->expType;
10773 if(exp->constant[0] == '\'')
10775 op.c = exp->constant[1];
10778 else if(type->isSigned)
10780 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10785 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10793 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10798 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10799 op.ops = ushortOps;
10806 op.i = strtol(exp->constant, (((void *)0)), 0);
10811 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10819 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10824 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10825 op.ops = uint64Ops;
10832 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10837 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10838 op.ops = uint64Ops;
10845 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10850 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10851 op.ops = uint64Ops;
10856 if(!strcmp(exp->constant, "inf"))
10857 op.f = __ecereMethod_float_inf();
10858 else if(!strcmp(exp->constant, "-inf"))
10859 op.f = -__ecereMethod_float_inf();
10860 else if(!strcmp(exp->constant, "nan"))
10861 op.f = __ecereMethod_float_nan();
10862 else if(!strcmp(exp->constant, "-nan"))
10863 op.f = -__ecereMethod_float_nan();
10865 op.f = (float)strtod(exp->constant, (((void *)0)));
10869 if(!strcmp(exp->constant, "inf"))
10870 op.d = __ecereMethod_double_inf();
10871 else if(!strcmp(exp->constant, "-inf"))
10872 op.d = -__ecereMethod_double_inf();
10873 else if(!strcmp(exp->constant, "nan"))
10874 op.d = __ecereMethod_double_nan();
10875 else if(!strcmp(exp->constant, "-nan"))
10876 op.d = -__ecereMethod_double_nan();
10878 op.d = (double)strtod(exp->constant, (((void *)0)));
10879 op.ops = doubleOps;
10884 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10886 op.ops = uint64Ops;
10894 int __ecereVMethodID_class_OnGetString;
10896 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10898 static void UnusedFunction()
10902 ((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);
10905 extern int __ecereVMethodID_class_OnGetString;
10907 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10909 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10911 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10913 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10914 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + 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 + 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;
10951 exp->identifier = MkIdentifier(result);
10953 exp->destType = MkClassType(_class->fullName);
10954 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 FreeExpContents(exp);
10972 exp->constant = PrintFloat(*(float *)ptr);
10978 FreeExpContents(exp);
10979 exp->constant = PrintDouble(*(double *)ptr);
10985 FreeExpContents(exp);
10986 exp->constant = PrintInt(*(int *)ptr);
10992 FreeExpContents(exp);
10993 exp->constant = PrintInt64(*(long long *)ptr);
10999 FreeExpContents(exp);
11000 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11006 FreeExpContents(exp);
11007 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11015 ListAdd(memberList, member);
11017 if(parentDataMember->type == 1)
11022 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
11024 void PopulateInstance(struct Instantiation * inst)
11026 struct Symbol * classSym = inst->_class->symbol;
11027 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
11028 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
11029 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
11032 inst->members = MkListOne(MkMembersInitList(memberList));
11034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
11035 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
11037 if(!dataMember->isProperty)
11039 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
11040 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
11043 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11044 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
11045 struct Type * type;
11046 void * ptr = inst->data + dataMember->offset;
11047 char * result = (((void *)0));
11049 exp->loc = member->loc = inst->loc;
11050 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
11051 if(!dataMember->dataType)
11052 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11053 type = dataMember->dataType;
11054 if(type->kind == 8)
11056 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11058 if(_class->type == 4)
11060 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11064 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
11065 struct __ecereNameSpace__ecere__sys__NamedLink * item;
11067 for(item = e->values.first; item; item = item->next)
11069 if((int)item->data == *(int *)ptr)
11071 result = item->name;
11078 exp->identifier = MkIdentifier(result);
11080 exp->destType = MkClassType(_class->fullName);
11081 ProcessExpressionType(exp);
11084 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
11086 if(!_class->dataType)
11087 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11088 type = _class->dataType;
11097 exp->constant = PrintFloat(*(float *)ptr);
11103 exp->constant = PrintDouble(*(double *)ptr);
11109 exp->constant = PrintInt(*(int *)ptr);
11115 exp->constant = PrintInt64(*(long long *)ptr);
11121 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
11126 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
11129 ListAdd(memberList, member);
11135 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);
11137 extern void FreeInstance(struct Instantiation * inst);
11139 void ComputeInstantiation(struct Expression * exp)
11141 struct Instantiation * inst = exp->instance;
11142 struct MembersInit * members;
11143 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
11144 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
11145 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
11146 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
11147 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
11148 int subMemberStackPos = 0;
11151 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11155 if(_class->type == 0 || _class->type == 5)
11157 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
11158 if(_class->type == 0)
11159 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
11162 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11166 for(members = (*inst->members).first; members; members = members->next)
11168 switch(members->type)
11172 if(members->dataMembers)
11174 struct MemberInit * member;
11176 for(member = (*members->dataMembers).first; member; member = member->next)
11178 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
11179 unsigned int found = 0x0;
11180 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11181 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
11182 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11183 unsigned int dataMemberOffset;
11187 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
11190 if(curMember->isProperty)
11191 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
11194 dataMember = curMember;
11195 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11196 if(_class->type == 0)
11197 dataMemberOffset += _class->base->structSize;
11204 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
11208 if(prop->memberAccess == 1)
11210 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
11211 curClass = prop->_class;
11216 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
11217 int _subMemberStackPos = 0;
11219 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
11223 if(dataMember->memberAccess == 1)
11225 curMember = dataMember;
11226 curClass = dataMember->_class;
11227 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
11228 subMemberStackPos = _subMemberStackPos;
11233 if(found && member->initializer && member->initializer->type == 0)
11235 struct Expression * value = member->initializer->exp;
11236 struct Type * type = (((void *)0));
11237 unsigned int deepMember = 0x0;
11241 type = prop->dataType;
11243 else if(dataMember)
11245 if(!dataMember->dataType)
11246 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
11247 type = dataMember->dataType;
11249 if(ident && ident->next)
11252 for(ident = ident->next; ident && type; ident = ident->next)
11254 if(type->kind == 8)
11256 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
11258 type = prop->dataType;
11261 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
11263 type = dataMember->dataType;
11266 else if(type->kind == 9 || type->kind == 10)
11268 struct Type * memberType;
11270 for(memberType = type->members.first; memberType; memberType = memberType->next)
11272 if(!strcmp(memberType->name, ident->string))
11283 FreeType(value->destType);
11284 value->destType = type;
11287 ComputeExpression(value);
11289 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11291 if(type->kind == 8)
11293 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11295 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11297 if(!_class->dataType)
11298 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11299 type = _class->dataType;
11304 void * ptr = inst->data + dataMemberOffset;
11306 if(value->type == 2)
11312 GetInt(value, (int *)ptr);
11317 GetInt64(value, (long long *)ptr);
11322 GetIntPtr(value, (intptr_t *)ptr);
11327 GetIntSize(value, (ssize_t *)ptr);
11332 GetFloat(value, (float *)ptr);
11337 GetDouble(value, (double *)ptr);
11342 else if(value->type == 1)
11344 if(type->kind == 8)
11346 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11348 if(_class->type == 1)
11350 ComputeTypeSize(type);
11351 if(value->instance->data)
11352 memcpy(ptr, value->instance->data, type->size);
11359 if(value->type == 1 && value->instance->data)
11361 if(type->kind == 8)
11363 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11365 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)))
11367 void (* Set)(void *, void *) = (void *)prop->Set;
11369 Set(inst->data, value->instance->data);
11370 PopulateInstance(inst);
11374 else if(value->type == 2)
11380 void (* Set)(void *, double) = (void *)prop->Set;
11382 Set(inst->data, strtod(value->constant, (((void *)0))));
11387 void (* Set)(void *, float) = (void *)prop->Set;
11389 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11394 void (* Set)(void *, int) = (void *)prop->Set;
11396 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11401 void (* Set)(void *, long long) = (void *)prop->Set;
11403 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11408 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11410 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11415 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11417 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11422 else if(value->type == 3)
11426 ReadString(temp, value->string);
11427 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11431 else if(!deepMember && type && _class->type == 3)
11435 if(value->type == 2)
11437 if(type->kind == 8)
11439 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11441 if(_class->type == 3)
11443 if(!_class->dataType)
11444 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11445 type = _class->dataType;
11453 float (* Set)(float) = (void *)prop->Set;
11455 GetFloat(member->initializer->exp, &fValue);
11456 exp->constant = PrintFloat(Set(fValue));
11463 double (* Set)(double) = (void *)prop->Set;
11465 GetDouble(member->initializer->exp, &dValue);
11466 exp->constant = PrintDouble(Set(dValue));
11474 else if(!deepMember && type && _class->type == 2)
11478 if(value->type == 1 && value->instance->data)
11480 unsigned int (* Set)(void *) = (void *)prop->Set;
11482 bits = Set(value->instance->data);
11484 else if(value->type == 2)
11488 else if(dataMember)
11490 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11491 struct Type * type;
11494 bits = (bits & ~bitMember->mask);
11495 if(!bitMember->dataType)
11496 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11497 type = bitMember->dataType;
11498 if(type->kind == 8 && type->_class && type->_class->registered)
11500 if(!type->_class->registered->dataType)
11501 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11502 type = type->_class->registered->dataType;
11511 type->isSigned ? GetChar(value, &v) : GetUChar(value, &v);
11519 type->isSigned ? GetShort(value, &v) : GetUShort(value, &v);
11528 type->isSigned ? GetInt(value, &v) : GetUInt(value, &v);
11536 type->isSigned ? GetInt64(value, &v) : GetUInt64(value, &v);
11544 type->isSigned ? GetIntPtr(value, &v) : GetUIntPtr(value, &v);
11552 type->isSigned ? GetIntSize(value, &v) : GetUIntSize(value, &v);
11557 bits += part << bitMember->pos;
11563 if(_class && _class->type == 3)
11565 ComputeExpression(member->initializer->exp);
11566 exp->constant = member->initializer->exp->constant;
11568 member->initializer->exp->constant = (((void *)0));
11578 if(_class && _class->type == 2)
11580 exp->constant = PrintHexUInt(bits);
11585 FreeInstance(inst);
11589 static unsigned int Promote(struct Operand * op, int kind, unsigned int isSigned)
11591 unsigned int result = 0x0;
11596 if(op->kind == 1 || op->kind == 15 || op->kind == 24)
11597 result = isSigned ? GetOpShort(op, &op->s) : GetOpUShort(op, &op->us);
11601 if(op->kind == 1 || op->kind == 2 || op->kind == 15 || op->kind == 24)
11602 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11605 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)
11606 result = isSigned ? GetOpInt64(op, &op->i64) : GetOpUInt64(op, &op->ui64);
11609 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)
11610 result = GetOpFloat(op, &op->f);
11613 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)
11614 result = GetOpDouble(op, &op->d);
11617 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)
11618 result = GetOpUIntPtr(op, &op->ui64);
11621 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)
11622 result = isSigned ? GetOpInt(op, &op->i) : GetOpUInt(op, &op->ui);
11625 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11626 result = isSigned ? GetOpIntPtr(op, &op->i64) : GetOpUIntPtr(op, &op->i64);
11629 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
11630 result = isSigned ? GetOpIntSize(op, &op->ui64) : GetOpUIntSize(op, &op->ui64);
11636 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11638 if(exp->op.op == SIZEOF)
11640 FreeExpContents(exp);
11642 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11652 struct Expression * exp2 = exp->op.exp2;
11654 exp->op.exp2 = (((void *)0));
11655 FreeExpContents(exp);
11656 FreeType(exp->expType);
11657 FreeType(exp->destType);
11659 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11665 FreeExpContents(exp);
11666 op1->ops.Neg(exp, op1);
11670 if(op1->ops.BitNot)
11672 FreeExpContents(exp);
11673 op1->ops.BitNot(exp, op1);
11679 FreeExpContents(exp);
11680 op1->ops.Not(exp, op1);
11687 if(op1 && op2 && op1->type && op2->type && op1->kind != op2->kind)
11689 if(Promote(op2, op1->kind, op1->type->isSigned))
11690 op2->kind = op1->kind, op2->ops = op1->ops;
11691 else if(Promote(op1, op2->kind, op2->type->isSigned))
11692 op1->kind = op2->kind, op1->ops = op2->ops;
11699 FreeExpContents(exp);
11700 op1->ops.Add(exp, op1, op2);
11706 FreeExpContents(exp);
11707 op1->ops.Sub(exp, op1, op2);
11713 FreeExpContents(exp);
11714 op1->ops.Mul(exp, op1, op2);
11720 FreeExpContents(exp);
11721 op1->ops.Div(exp, op1, op2);
11727 FreeExpContents(exp);
11728 op1->ops.Mod(exp, op1, op2);
11734 if(op1->ops.BitAnd)
11736 FreeExpContents(exp);
11737 op1->ops.BitAnd(exp, op1, op2);
11744 FreeExpContents(exp);
11745 op1->ops.BitOr(exp, op1, op2);
11749 if(op1->ops.BitXor)
11751 FreeExpContents(exp);
11752 op1->ops.BitXor(exp, op1, op2);
11756 if(op1->ops.LShift)
11758 FreeExpContents(exp);
11759 op1->ops.LShift(exp, op1, op2);
11763 if(op1->ops.RShift)
11765 FreeExpContents(exp);
11766 op1->ops.RShift(exp, op1, op2);
11772 FreeExpContents(exp);
11773 op1->ops.Equ(exp, op1, op2);
11779 FreeExpContents(exp);
11780 op1->ops.Nqu(exp, op1, op2);
11786 FreeExpContents(exp);
11787 op1->ops.And(exp, op1, op2);
11793 FreeExpContents(exp);
11794 op1->ops.Or(exp, op1, op2);
11800 FreeExpContents(exp);
11801 op1->ops.Grt(exp, op1, op2);
11807 FreeExpContents(exp);
11808 op1->ops.Sma(exp, op1, op2);
11812 if(op1->ops.GrtEqu)
11814 FreeExpContents(exp);
11815 op1->ops.GrtEqu(exp, op1, op2);
11819 if(op1->ops.SmaEqu)
11821 FreeExpContents(exp);
11822 op1->ops.SmaEqu(exp, op1, op2);
11830 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11832 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11834 void ComputeExpression(struct Expression * exp)
11836 char expString[10240];
11838 expString[0] = '\0';
11843 ComputeInstantiation(exp);
11848 struct Expression * exp1, * exp2 = (((void *)0));
11849 struct Operand op1 =
11853 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11856 struct Operand op2 =
11860 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11866 struct Expression * e = exp->op.exp2;
11868 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
11870 if(e->type == 5 || e->type == 32 || e->type == 23)
11873 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
11875 e = (*e->list).last;
11878 if(exp->op.op == 261 && e && e->expType)
11880 if(e->type == 3 && e->string)
11882 char * string = e->string;
11883 int len = strlen(string);
11884 char * tmp = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (len - 2 + 1));
11886 len = UnescapeString(tmp, string + 1, len - 2);
11887 (__ecereNameSpace__ecere__com__eSystem_Delete(tmp), tmp = 0);
11888 FreeExpContents(exp);
11890 exp->constant = PrintUInt(len + 1);
11894 struct Type * type = e->expType;
11897 FreeExpContents(exp);
11899 exp->constant = PrintUInt(ComputeTypeSize(type));
11905 ComputeExpression(exp->op.exp2);
11909 ComputeExpression(exp->op.exp1);
11910 exp1 = exp->op.exp1;
11911 exp2 = exp->op.exp2;
11912 op1 = GetOperand(exp1);
11914 op1.type->refCount++;
11917 op2 = GetOperand(exp2);
11919 op2.type->refCount++;
11924 exp1 = exp->op.exp2;
11925 op1 = GetOperand(exp1);
11927 op1.type->refCount++;
11929 CallOperator(exp, exp1, exp2, &op1, &op2);
11931 FreeType(op1.type);
11933 FreeType(op2.type);
11939 struct Expression * e, * n;
11941 for(e = (*exp->list).first; e; e = n)
11946 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11947 struct Expression * prev = exp->prev;
11948 struct Expression * next = exp->next;
11950 ComputeExpression(e);
11951 FreeType(exp->expType);
11952 FreeType(exp->destType);
11956 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11957 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11968 struct Expression * memberExp = exp->member.exp;
11969 struct Identifier * memberID = exp->member.member;
11970 struct Type * type;
11972 ComputeExpression(exp->member.exp);
11973 type = exp->member.exp->expType;
11976 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)));
11977 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11978 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11979 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11981 if(type->kind == 19 && exp->member.exp->type == 24)
11982 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11986 struct Symbol * classSym;
11989 PrintTypeNoConst(type, string, 0x0, 0x1);
11990 classSym = FindClass(string);
11991 _class = classSym ? classSym->registered : (((void *)0));
11993 if(exp->member.member)
11995 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11997 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11999 if(!prop && !member && _class && exp->member.member)
12001 struct Symbol * classSym = FindClass(exp->member.member->string);
12003 convertTo = _class;
12004 _class = classSym ? classSym->registered : (((void *)0));
12005 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
12011 struct Type * type = prop->dataType;
12013 if(_class->type == 3)
12015 if(type->kind == 8)
12017 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12019 if(_class->type == 3)
12021 if(!_class->dataType)
12022 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12023 type = _class->dataType;
12031 float (* Get)(float) = (void *)prop->Get;
12033 GetFloat(exp->member.exp, &value);
12034 exp->constant = PrintFloat(Get ? Get(value) : value);
12041 double (* Get)(double);
12043 GetDouble(exp->member.exp, &value);
12045 Get = (void *)prop->Set;
12047 Get = (void *)prop->Get;
12048 exp->constant = PrintDouble(Get ? Get(value) : value);
12058 struct Expression * value = exp->member.exp;
12059 struct Type * type;
12061 if(!prop->dataType)
12062 ProcessPropertyType(prop);
12063 type = prop->dataType;
12067 else if(_class->type == 1)
12073 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12075 if(propertyClass->type == 1 && value->type == 1)
12077 void (* Set)(void *, void *) = (void *)prop->Set;
12079 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12080 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12081 exp->instance->_class = MkSpecifierName(_class->fullName);
12082 exp->instance->loc = exp->loc;
12084 Set(exp->instance->data, value->instance->data);
12085 PopulateInstance(exp->instance);
12092 void (* Set)(void *, int) = (void *)prop->Set;
12094 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12095 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12096 exp->instance->_class = MkSpecifierName(_class->fullName);
12097 exp->instance->loc = exp->loc;
12099 GetInt(value, &intValue);
12100 Set(exp->instance->data, intValue);
12101 PopulateInstance(exp->instance);
12106 long long intValue;
12107 void (* Set)(void *, long long) = (void *)prop->Set;
12109 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12110 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12111 exp->instance->_class = MkSpecifierName(_class->fullName);
12112 exp->instance->loc = exp->loc;
12114 GetInt64(value, &intValue);
12115 Set(exp->instance->data, intValue);
12116 PopulateInstance(exp->instance);
12122 void (* Set)(void *, intptr_t) = (void *)prop->Set;
12124 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12125 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12126 exp->instance->_class = MkSpecifierName(_class->fullName);
12127 exp->instance->loc = exp->loc;
12129 GetIntPtr(value, &intValue);
12130 Set(exp->instance->data, intValue);
12131 PopulateInstance(exp->instance);
12137 void (* Set)(void *, ssize_t) = (void *)prop->Set;
12139 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12140 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12141 exp->instance->_class = MkSpecifierName(_class->fullName);
12142 exp->instance->loc = exp->loc;
12144 GetIntSize(value, &intValue);
12145 Set(exp->instance->data, intValue);
12146 PopulateInstance(exp->instance);
12152 void (* Set)(void *, float) = (void *)prop->Set;
12154 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12155 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12156 exp->instance->_class = MkSpecifierName(_class->fullName);
12157 exp->instance->loc = exp->loc;
12159 GetFloat(value, &floatValue);
12160 Set(exp->instance->data, floatValue);
12161 PopulateInstance(exp->instance);
12166 double doubleValue;
12167 void (* Set)(void *, double) = (void *)prop->Set;
12169 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12170 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12171 exp->instance->_class = MkSpecifierName(_class->fullName);
12172 exp->instance->loc = exp->loc;
12174 GetDouble(value, &doubleValue);
12175 Set(exp->instance->data, doubleValue);
12176 PopulateInstance(exp->instance);
12181 else if(_class->type == 2)
12187 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
12189 if(propertyClass->type == 1 && value->instance->data)
12191 unsigned int (* Set)(void *) = (void *)prop->Set;
12192 unsigned int bits = Set(value->instance->data);
12194 exp->constant = PrintHexUInt(bits);
12198 else if(_class->type == 2)
12200 unsigned int value;
12201 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
12204 GetUInt(exp->member.exp, &value);
12206 exp->constant = PrintHexUInt(bits);
12215 if(_class->type == 2)
12217 unsigned int value;
12219 GetUInt(exp->member.exp, &value);
12224 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12226 if(_class->type == 1)
12228 void (* Get)(unsigned int, void *) = (void *)prop->Get;
12230 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12231 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12232 exp->instance->_class = MkSpecifierName(_class->fullName);
12233 exp->instance->loc = exp->loc;
12235 Get(value, exp->instance->data);
12236 PopulateInstance(exp->instance);
12238 else if(_class->type == 2)
12240 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
12241 uint64 bits = Get(value);
12243 exp->constant = PrintHexUInt64(bits);
12250 else if(_class->type == 1)
12252 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
12258 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12260 if(_class->type == 1 && value)
12262 void (* Get)(void *, void *) = (void *)prop->Get;
12264 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
12265 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
12266 exp->instance->_class = MkSpecifierName(_class->fullName);
12267 exp->instance->loc = exp->loc;
12269 Get(value, exp->instance->data);
12270 PopulateInstance(exp->instance);
12281 exp->isConstant = 0x0;
12290 FreeExpression(memberExp);
12291 FreeIdentifier(memberID);
12297 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
12299 FreeExpContents(exp);
12300 exp->constant = PrintUInt(ComputeTypeSize(type));
12307 struct Symbol * classSym = exp->_class->symbol;
12309 if(classSym && classSym->registered)
12311 if(classSym->registered->fixed)
12313 FreeSpecifier(exp->_class);
12314 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
12319 char className[1024];
12321 strcpy(className, "__ecereClass_");
12322 FullClassNameCat(className, classSym->string, 0x1);
12323 MangleClassName(className);
12324 DeclareClass(classSym, className);
12325 FreeExpContents(exp);
12327 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
12328 exp->member.member = MkIdentifier("structSize");
12335 struct Type * type;
12336 struct Expression * e = exp;
12338 if(exp->type == 11)
12341 ComputeExpression(exp->cast.exp);
12344 if(e && exp->expType)
12346 type = exp->expType;
12347 if(type->kind == 8)
12349 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
12351 if(_class && (_class->type == 3 || _class->type == 2))
12353 if(!_class->dataType)
12354 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
12355 type = _class->dataType;
12364 char value = (char)0;
12366 if(GetChar(e, &value))
12368 FreeExpContents(exp);
12369 exp->constant = PrintChar(value);
12375 unsigned char value = (unsigned char)0;
12377 if(GetUChar(e, &value))
12379 FreeExpContents(exp);
12380 exp->constant = PrintUChar(value);
12388 short value = (short)0;
12390 if(GetShort(e, &value))
12392 FreeExpContents(exp);
12393 exp->constant = PrintShort(value);
12399 unsigned short value = (unsigned short)0;
12401 if(GetUShort(e, &value))
12403 FreeExpContents(exp);
12404 exp->constant = PrintUShort(value);
12414 if(GetInt(e, &value))
12416 FreeExpContents(exp);
12417 exp->constant = PrintInt(value);
12423 unsigned int value = 0;
12425 if(GetUInt(e, &value))
12427 FreeExpContents(exp);
12428 exp->constant = PrintUInt(value);
12436 long long value = 0;
12438 if(GetInt64(e, &value))
12440 FreeExpContents(exp);
12441 exp->constant = PrintInt64(value);
12449 if(GetUInt64(e, &value))
12451 FreeExpContents(exp);
12452 exp->constant = PrintUInt64(value);
12460 intptr_t value = 0;
12462 if(GetIntPtr(e, &value))
12464 FreeExpContents(exp);
12465 exp->constant = PrintInt64((long long)value);
12471 uintptr_t value = 0;
12473 if(GetUIntPtr(e, &value))
12475 FreeExpContents(exp);
12476 exp->constant = PrintUInt64((uint64)value);
12486 if(GetIntSize(e, &value))
12488 FreeExpContents(exp);
12489 exp->constant = PrintInt64((long long)value);
12497 if(GetUIntSize(e, &value))
12499 FreeExpContents(exp);
12500 exp->constant = PrintUInt64((uint64)value);
12509 if(GetFloat(e, &value))
12511 FreeExpContents(exp);
12512 exp->constant = PrintFloat(value);
12521 if(GetDouble(e, &value))
12523 FreeExpContents(exp);
12524 exp->constant = PrintDouble(value);
12535 struct Operand op1 =
12539 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12542 struct Operand op2 =
12546 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12549 struct Operand op3 =
12553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12558 ComputeExpression((*exp->cond.exp).last);
12559 if(exp->cond.elseExp)
12560 ComputeExpression(exp->cond.elseExp);
12562 ComputeExpression(exp->cond.cond);
12563 op1 = GetOperand(exp->cond.cond);
12565 op1.type->refCount++;
12566 op2 = GetOperand((*exp->cond.exp).last);
12568 op2.type->refCount++;
12569 op3 = GetOperand(exp->cond.elseExp);
12571 op3.type->refCount++;
12574 FreeExpContents(exp);
12575 op1.ops.Cond(exp, &op1, &op2, &op3);
12578 FreeType(op1.type);
12580 FreeType(op2.type);
12582 FreeType(op3.type);
12588 void ApplyAnyObjectLogic(struct Expression * e);
12590 extern void CopyTypeInto(struct Type * type, struct Type * src);
12592 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12594 unsigned int result = 0x1;
12598 struct __ecereNameSpace__ecere__sys__OldList converts =
12602 struct Conversion * convert;
12604 if(destType->kind == 0)
12606 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12610 for(convert = converts.first; convert; convert = convert->next)
12612 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12616 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12617 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12620 newExp->prev = (((void *)0));
12621 newExp->next = (((void *)0));
12622 newExp->destType = (((void *)0));
12626 exp->addedThis = 0x1;
12627 exp->member.exp = newExp;
12628 FreeType(exp->member.exp->expType);
12629 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12630 exp->member.exp->expType->classObjectType = objectType;
12631 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12632 exp->member.memberType = 1;
12633 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12634 exp->needCast = 0x1;
12636 exp->expType->refCount++;
12637 ApplyAnyObjectLogic(exp->member.exp);
12643 exp->addedThis = 0x1;
12644 exp->member.exp = newExp;
12645 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12647 newExp->byReference = 0x1;
12649 FreeType(exp->member.exp->expType);
12650 exp->member.exp->expType = (((void *)0));
12651 if(convert->convert->dataType)
12653 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12654 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12655 exp->member.exp->expType->refCount = 1;
12656 exp->member.exp->expType->classObjectType = objectType;
12657 ApplyAnyObjectLogic(exp->member.exp);
12659 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12660 exp->member.memberType = 4;
12661 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12662 exp->needCast = 0x1;
12663 if(convert->resultType)
12664 convert->resultType->refCount++;
12670 FreeType(exp->expType);
12673 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12674 exp->needCast = 0x1;
12676 exp->expType->refCount++;
12680 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12681 exp->needCast = 0x1;
12682 if(convert->resultType)
12683 convert->resultType->refCount++;
12687 if(exp->isConstant && inCompiler)
12688 ComputeExpression(exp);
12689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12691 if(!result && exp->expType && converts.count)
12693 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12695 if(!result && exp->expType && exp->destType)
12697 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))
12704 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12706 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12708 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12710 void CheckTemplateTypes(struct Expression * exp)
12712 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12714 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12715 struct Statement * compound;
12716 struct Context * context;
12720 exp->destType->refCount++;
12722 exp->expType->refCount++;
12723 newExp->prev = (((void *)0));
12724 newExp->next = (((void *)0));
12725 switch(exp->expType->kind)
12728 if(exp->destType->classObjectType)
12731 exp->destType->refCount--;
12733 exp->expType->refCount--;
12734 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12738 struct __ecereNameSpace__ecere__sys__OldList * specs;
12739 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12740 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12742 context = PushContext();
12743 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12744 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12745 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12747 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12748 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12749 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12750 exp->compound->compound.context = context;
12751 PopContext(context);
12756 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12757 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12761 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12763 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12764 struct Statement * compound;
12765 struct Context * context;
12769 exp->destType->refCount++;
12771 exp->expType->refCount++;
12772 newExp->prev = (((void *)0));
12773 newExp->next = (((void *)0));
12774 switch(exp->expType->kind)
12777 if(exp->destType->classObjectType)
12780 exp->destType->refCount--;
12782 exp->expType->refCount--;
12783 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12787 struct __ecereNameSpace__ecere__sys__OldList * specs;
12788 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12789 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12791 context = PushContext();
12792 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12793 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12794 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12796 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12797 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12798 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12799 exp->compound->compound.context = context;
12800 PopContext(context);
12805 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12808 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12809 ProcessExpressionType((*exp->list).first);
12815 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12816 newExp->needCast = 0x1;
12817 ProcessExpressionType((*exp->list).first);
12823 if(exp->expType->kind == 20)
12825 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12829 FreeType(exp->destType);
12830 FreeType(exp->expType);
12831 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12835 if(newExp->type == 8 && newExp->member.memberType == 3)
12839 exp->op.exp1 = (((void *)0));
12840 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12844 char typeString[1024];
12845 struct Declarator * decl;
12846 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12848 typeString[0] = '\0';
12849 PrintType(exp->expType, typeString, 0x0, 0x0);
12850 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12852 exp->cast.typeName = MkTypeName(specs, decl);
12853 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12854 exp->cast.exp->needCast = 0x1;
12862 extern int strncmp(const char * , const char * , size_t n);
12864 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12866 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12868 int nsLen = strlen(nameSpace);
12869 struct Symbol * symbol;
12871 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)))
12873 char * s = symbol->string;
12875 if(!strncmp(s, nameSpace, nsLen))
12880 for(c = strlen(s) - 1; c >= 0; c--)
12883 namePart = s + c + 1;
12884 if(!strcmp(namePart, name))
12892 return (((void *)0));
12895 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12898 char nameSpace[1024];
12900 unsigned int gotColon = 0x0;
12902 nameSpace[0] = '\0';
12903 for(c = strlen(name) - 1; c >= 0; c--)
12909 namePart = name + c + 1;
12910 while(c >= 0 && name[c] == ':')
12914 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12918 memcpy(nameSpace, name, c + 1);
12919 nameSpace[c + 1] = (char)0;
12920 return ScanWithNameSpace(tree, nameSpace, namePart);
12924 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12930 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12934 return ScanWithNameSpace(tree, "", namePart);
12936 return (((void *)0));
12939 static void ProcessDeclaration(struct Declaration * decl);
12941 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12943 struct Context * ctx;
12944 struct Symbol * symbol = (((void *)0));
12946 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12948 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12950 symbol = (((void *)0));
12953 char curName[1024];
12955 strcpy(curName, thisNameSpace);
12956 strcat(curName, "::");
12957 strcat(curName, name);
12958 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12961 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12964 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12965 if(symbol || ctx == endContext)
12968 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12970 if(symbol->pointerExternal->type == 0)
12972 struct FunctionDefinition * function = symbol->pointerExternal->function;
12973 struct Context * tmpContext = curContext;
12975 curContext = (((void *)0));
12976 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12977 curContext = tmpContext;
12978 symbol->pointerExternal->symbol = symbol;
12979 DeclareType(symbol->type, 0x1, 0x1);
12980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12981 symbol->id = curExternal->symbol->idCode;
12983 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12986 symbol->id = curExternal->symbol->idCode;
12992 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12994 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12995 ListAdd(specs, MkSpecifier(UNSIGNED));
13000 if(type->_class->registered)
13002 if(!type->_class->registered->dataType)
13003 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
13004 GetTypeSpecs(type->_class->registered->dataType, specs);
13009 ListAdd(specs, MkSpecifier(DOUBLE));
13012 ListAdd(specs, MkSpecifier(FLOAT));
13015 ListAdd(specs, MkSpecifier(CHAR));
13018 ListAdd(specs, MkSpecifier(_BOOL));
13021 ListAdd(specs, MkSpecifier(SHORT));
13024 ListAdd(specs, MkSpecifier(INT64));
13027 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
13030 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
13034 ListAdd(specs, MkSpecifier(INT));
13039 static void PrintArraySize(struct Type * arrayType, char * string)
13045 if(arrayType->enumClass)
13046 strcat(size, arrayType->enumClass->string);
13047 else if(arrayType->arraySizeExp)
13048 PrintExpression(arrayType->arraySizeExp, size);
13050 strcat(string, size);
13053 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
13057 if(printConst && type->constant)
13058 strcat(string, "const ");
13063 struct Symbol * c = type->_class;
13065 if(type->classObjectType == 2)
13066 strcat(string, "typed_object");
13067 else if(type->classObjectType == 3)
13068 strcat(string, "any_object");
13072 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
13074 if(type->byReference)
13075 strcat(string, " &");
13079 strcat(string, "void");
13082 strcat(string, type->isSigned ? "int" : "uint");
13085 strcat(string, type->isSigned ? "int64" : "uint64");
13088 strcat(string, type->isSigned ? "intptr" : "uintptr");
13091 strcat(string, type->isSigned ? "intsize" : "uintsize");
13094 strcat(string, type->isSigned ? "char" : "byte");
13097 strcat(string, "_Bool");
13100 strcat(string, type->isSigned ? "short" : "uint16");
13103 strcat(string, "float");
13106 strcat(string, "double");
13111 strcat(string, "struct ");
13112 strcat(string, type->enumName);
13114 else if(type->typeName)
13115 strcat(string, type->typeName);
13118 struct Type * member;
13120 strcat(string, "struct { ");
13121 for(member = type->members.first; member; member = member->next)
13123 PrintType(member, string, 0x1, fullName);
13124 strcat(string, "; ");
13126 strcat(string, "}");
13132 strcat(string, "union ");
13133 strcat(string, type->enumName);
13135 else if(type->typeName)
13136 strcat(string, type->typeName);
13139 strcat(string, "union ");
13140 strcat(string, "(unnamed)");
13146 strcat(string, "enum ");
13147 strcat(string, type->enumName);
13149 else if(type->typeName)
13150 strcat(string, type->typeName);
13152 strcat(string, "int");
13155 strcat(string, "...");
13158 strcat(string, "subclass(");
13159 strcat(string, type->_class ? type->_class->string : "int");
13160 strcat(string, ")");
13163 strcat(string, type->templateParameter->identifier->string);
13166 strcat(string, "thisclass");
13169 strcat(string, "__builtin_va_list");
13175 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
13177 static void PrintName(struct Type * type, char * string, unsigned int fullName)
13179 if(type->name && type->name[0])
13182 strcat(string, type->name);
13185 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
13191 strcat(string, name);
13196 static void PrintAttribs(struct Type * type, char * string)
13200 if(type->dllExport)
13201 strcat(string, "dllexport ");
13202 if(type->attrStdcall)
13203 strcat(string, "stdcall ");
13207 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
13209 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13211 struct Type * attrType = (((void *)0));
13213 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
13214 PrintAttribs(type, string);
13215 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
13216 strcat(string, " const");
13217 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
13218 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13219 strcat(string, " (");
13220 if(type->kind == 13)
13222 if(type->type->kind == 11 || type->type->kind == 16)
13223 PrintAttribs(type->type, string);
13225 if(type->kind == 13)
13227 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
13228 strcat(string, "*");
13230 strcat(string, " *");
13232 if(printConst && type->constant && type->kind == 13)
13233 strcat(string, " const");
13236 PrintTypeSpecs(type, string, fullName, printConst);
13239 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
13241 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
13242 strcat(string, ")");
13243 if(type->kind == 12)
13244 PrintArraySize(type, string);
13245 else if(type->kind == 11)
13247 struct Type * param;
13249 strcat(string, "(");
13250 for(param = type->params.first; param; param = param->next)
13252 PrintType(param, string, 0x1, fullName);
13254 strcat(string, ", ");
13256 strcat(string, ")");
13258 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
13259 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
13262 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
13264 PrePrintType(type, string, fullName, (((void *)0)), printConst);
13265 if(type->thisClass || (printName && type->name && type->name[0]))
13266 strcat(string, " ");
13267 if((type->thisClass || type->staticMethod))
13269 struct Symbol * _class = type->thisClass;
13271 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
13273 if(type->classObjectType == 1)
13274 strcat(string, "class");
13276 strcat(string, type->byReference ? "typed_object&" : "typed_object");
13278 else if(_class && _class->string)
13280 char * s = _class->string;
13286 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
13292 strcat(string, name);
13295 strcat(string, "::");
13297 if(printName && type->name)
13298 PrintName(type, string, fullName);
13299 PostPrintType(type, string, fullName);
13300 if(type->bitFieldCount)
13304 sprintf(count, ":%d", type->bitFieldCount);
13305 strcat(string, count);
13309 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13311 _PrintType(type, string, printName, fullName, 0x1);
13314 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
13316 _PrintType(type, string, printName, fullName, 0x0);
13319 static struct Type * FindMember(struct Type * type, char * string)
13321 struct Type * memberType;
13323 for(memberType = type->members.first; memberType; memberType = memberType->next)
13325 if(!memberType->name)
13327 struct Type * subType = FindMember(memberType, string);
13332 else if(!strcmp(memberType->name, string))
13335 return (((void *)0));
13338 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
13340 struct Type * memberType;
13342 for(memberType = type->members.first; memberType; memberType = memberType->next)
13344 if(!memberType->name)
13346 struct Type * subType = FindMember(memberType, string);
13350 *offset += memberType->offset;
13354 else if(!strcmp(memberType->name, string))
13356 *offset += memberType->offset;
13360 return (((void *)0));
13363 extern unsigned int parseError;
13365 unsigned int GetParseError()
13370 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
13372 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
13374 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
13376 struct Expression * ParseExpressionString(char * expression)
13379 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13380 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13381 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13383 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13384 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
13385 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13386 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13388 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13389 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13391 parsedExpression = (((void *)0));
13393 expression_yyparse();
13394 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13395 return parsedExpression;
13398 extern char * QMkString(char * source);
13400 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
13402 struct Identifier * id = exp->identifier;
13403 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13404 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13405 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13406 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13408 if(_class && _class->type == 4)
13410 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
13411 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
13415 struct __ecereNameSpace__ecere__com__Class * baseClass;
13417 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
13419 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
13421 for(value = e->values.first; value; value = value->next)
13423 if(!strcmp(value->name, id->string))
13428 char constant[256];
13430 FreeExpContents(exp);
13432 exp->isConstant = 0x1;
13433 if(!strcmp(baseClass->dataTypeString, "int"))
13434 sprintf(constant, "%d", (int)value->data);
13436 sprintf(constant, "0x%X", (int)value->data);
13437 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13438 exp->expType = MkClassType(baseClass->fullName);
13446 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13448 ProcessMethodType(method);
13449 exp->expType = __extension__ ({
13450 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13452 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13456 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13458 if(!prop->dataType)
13459 ProcessPropertyType(prop);
13460 exp->expType = prop->dataType;
13462 prop->dataType->refCount++;
13465 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13467 if(!member->dataType)
13468 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13469 exp->expType = member->dataType;
13470 if(member->dataType)
13471 member->dataType->refCount++;
13474 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13476 if(!classProp->dataType)
13477 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13478 if(classProp->constant)
13480 FreeExpContents(exp);
13481 exp->isConstant = 0x1;
13482 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13485 exp->constant = QMkString((char *)classProp->Get(_class));
13489 char constant[256];
13492 sprintf(constant, "%d", (int)classProp->Get(_class));
13493 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13499 exp->expType = classProp->dataType;
13500 if(classProp->dataType)
13501 classProp->dataType->refCount++;
13507 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13509 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13510 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13511 struct __ecereNameSpace__ecere__com__NameSpace * child;
13515 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)))
13517 data = ScanGlobalData(child, name);
13525 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13527 extern char * strncpy(char * , const char * , size_t n);
13529 static struct GlobalData * FindGlobalData(char * name)
13532 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13534 nameSpace = globalData;
13535 for(c = 0; name[c]; c++)
13537 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13539 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13540 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13542 strncpy(spaceName, name + start, c - start);
13543 spaceName[c - start] = '\0';
13544 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13545 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13547 return (((void *)0));
13548 nameSpace = newSpace;
13556 return ScanGlobalData(nameSpace, name + start);
13558 return (((void *)0));
13561 static int definedExpStackPos;
13563 static void * definedExpStack[512];
13565 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13567 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13569 FreeExpContents(checkedExp);
13570 FreeType(checkedExp->expType);
13571 FreeType(checkedExp->destType);
13572 *checkedExp = *newExp;
13573 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13574 checkedExp->prev = prev;
13575 checkedExp->next = next;
13578 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13580 extern int printf(char * , ...);
13582 void __ecereMethod_Expression_Clear();
13584 void ApplyAnyObjectLogic(struct Expression * e)
13586 struct Type * destType = e->destType;
13588 if(destType && (destType->classObjectType == 3))
13590 if(e && e->expType)
13592 struct Type * type = e->expType;
13593 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13595 if(type->kind == 8 && type->_class && type->_class->registered)
13597 _class = type->_class->registered;
13599 else if(type->kind == 19)
13601 _class = FindClass("ecere::com::Class")->registered;
13605 char string[1024] = "";
13606 struct Symbol * classSym;
13608 PrintTypeNoConst(type, string, 0x0, 0x1);
13609 classSym = FindClass(string);
13611 _class = classSym->registered;
13613 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)))
13615 if(!_class || strcmp(_class->fullName, "char *"))
13617 struct Expression * checkedExp = e, * newExp;
13619 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13621 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13623 if(checkedExp->type == 23)
13625 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13628 checkedExp = (*checkedExp->list).last;
13630 else if(checkedExp->type == 11)
13631 checkedExp = checkedExp->cast.exp;
13633 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13635 newExp = checkedExp->op.exp2;
13636 checkedExp->op.exp2 = (((void *)0));
13637 FreeExpContents(checkedExp);
13638 if(e->expType && e->expType->passAsTemplate)
13642 ComputeTypeSize(e->expType);
13643 sprintf(size, "%d", e->expType->size);
13644 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))))));
13646 ReplaceExpContents(checkedExp, newExp);
13647 e->byReference = 0x1;
13649 else if(!e->byReference || (_class && _class->type == 5))
13651 struct Expression * checkedExp, * newExp;
13654 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;
13656 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13658 struct Context * context = PushContext();
13659 struct Declarator * decl;
13660 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13661 char typeString[1024];
13662 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13664 typeString[0] = '\0';
13666 newExp->prev = (((void *)0));
13667 newExp->next = (((void *)0));
13668 newExp->expType = (((void *)0));
13669 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13670 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13671 newExp->destType = ProcessType(specs, decl);
13672 curContext = context;
13676 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13679 sprintf(name, "__internalValue%03X", internalValueCounter++);
13680 if(!curCompound->compound.declarations)
13681 curCompound->compound.declarations = MkList();
13682 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13683 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13684 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13685 e->compound = MkCompoundStmt((((void *)0)), stmts);
13688 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13690 struct Type * type = e->destType;
13692 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13693 CopyTypeInto(e->destType, type);
13694 e->destType->refCount = 1;
13695 e->destType->classObjectType = 0;
13698 e->compound->compound.context = context;
13699 PopContext(context);
13700 curContext = context->parent;
13704 while(((checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23) && checkedExp->list) || checkedExp->type == 11)
13706 if(checkedExp->type == 5 || checkedExp->type == 32 || checkedExp->type == 23)
13708 if(checkedExp->type == 23)
13710 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13713 checkedExp = (*checkedExp->list).last;
13715 else if(checkedExp->type == 11)
13716 checkedExp = checkedExp->cast.exp;
13719 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13721 *operand = *checkedExp;
13722 checkedExp->destType = (((void *)0));
13723 checkedExp->expType = (((void *)0));
13724 __ecereMethod_Expression_Clear(checkedExp);
13725 checkedExp->type = 4;
13726 checkedExp->op.op = '&';
13727 checkedExp->op.exp1 = (((void *)0));
13728 checkedExp->op.exp2 = operand;
13737 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))))
13739 if(e->expType->classObjectType && destType && destType->classObjectType)
13745 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13748 thisExp->prev = (((void *)0));
13749 thisExp->next = (((void *)0));
13750 __ecereMethod_Expression_Clear(e);
13752 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13753 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13754 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13756 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13757 CopyTypeInto(e->expType, thisExp->expType);
13758 e->expType->byReference = 0x0;
13759 e->expType->refCount = 1;
13760 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))
13762 e->expType->classObjectType = 0;
13767 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13769 if(destType->kind == 14)
13771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13773 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13775 unsigned int byReference = e->expType->byReference;
13776 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13777 struct Declarator * decl;
13778 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13779 char typeString[1024];
13780 struct Type * type;
13781 int backupClassObjectType;
13782 unsigned int backupByReference;
13784 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13788 backupClassObjectType = type->classObjectType;
13789 backupByReference = type->byReference;
13790 type->classObjectType = 0;
13791 type->byReference = 0x0;
13792 typeString[0] = '\0';
13793 PrintType(type, typeString, 0x0, 0x1);
13794 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13795 type->classObjectType = backupClassObjectType;
13796 type->byReference = backupByReference;
13798 thisExp->prev = (((void *)0));
13799 thisExp->next = (((void *)0));
13800 __ecereMethod_Expression_Clear(e);
13801 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)))
13805 e->op.exp1 = (((void *)0));
13806 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13807 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13808 CopyTypeInto(e->expType, type);
13809 e->expType->byReference = 0x0;
13810 e->expType->refCount = 1;
13815 e->cast.typeName = MkTypeName(specs, decl);
13816 e->cast.exp = thisExp;
13817 e->byReference = 0x1;
13821 e->destType = destType;
13822 destType->refCount++;
13827 extern char * strstr(const char * , const char * );
13829 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13831 struct __ecereNameSpace__ecere__com__DefinedExpression
13833 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13834 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13837 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13838 } __attribute__ ((gcc_struct));
13840 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13842 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13844 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13846 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13848 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13850 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13852 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13854 static void ProcessStatement(struct Statement * stmt);
13856 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13858 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13860 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13862 extern char * sourceFile;
13864 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13866 void ProcessExpressionType(struct Expression * exp)
13868 unsigned int unresolved = 0x0;
13869 struct Location oldyylloc = yylloc;
13870 unsigned int notByReference = 0x0;
13872 if(!exp || exp->expType)
13879 struct Identifier * id = exp->identifier;
13881 if(!id || !topContext)
13883 if(id->_class && id->_class->name)
13885 id->classSym = id->_class->symbol;
13887 if(strstr(id->string, "__ecereClass") == id->string)
13889 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13892 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13894 ReplaceClassMembers(exp, thisClass);
13897 ProcessExpressionType(exp);
13900 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13905 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13909 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13915 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13918 ProcessExpressionType(exp);
13922 else if(currentClass && !id->_class)
13924 if(ResolveIdWithClass(exp, currentClass, 0x1))
13927 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13932 struct Type * type = symbol->type;
13933 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13935 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13937 struct Context * context = SetupTemplatesContext(_class);
13939 type = ReplaceThisClassType(_class);
13940 FinishTemplatesContext(context);
13942 type->refCount = 0;
13944 FreeSpecifier(id->_class);
13945 id->_class = (((void *)0));
13946 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13947 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13948 id->classSym = (((void *)0));
13949 exp->expType = type;
13952 if(type && (type->kind == 15))
13953 exp->isConstant = 0x1;
13954 if(symbol->isParam || !strcmp(id->string, "this"))
13956 if(_class && _class->type == 1 && !type->declaredWithStruct)
13957 exp->byReference = 0x1;
13959 if(symbol->isIterator)
13961 if(symbol->isIterator == 3)
13964 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13965 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13966 exp->expType = (((void *)0));
13967 ProcessExpressionType(exp);
13969 else if(symbol->isIterator != 4)
13972 exp->member.exp = MkExpIdentifier(exp->identifier);
13973 exp->member.exp->expType = exp->expType;
13974 exp->member.member = MkIdentifier("data");
13975 exp->expType = (((void *)0));
13976 ProcessExpressionType(exp);
13983 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13985 if(thisNameSpace && !(id->_class && !id->_class->name))
13989 strcpy(name, thisNameSpace);
13990 strcat(name, "::");
13991 strcat(name, id->string);
13992 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13995 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
14000 for(c = 0; c < definedExpStackPos; c++)
14001 if(definedExpStack[c] == definedExp)
14003 if(c == definedExpStackPos && c < sizeof (definedExpStack) / sizeof(void *))
14005 struct Location backupYylloc = yylloc;
14006 struct __ecereNameSpace__ecere__com__Instance * backInput = fileInput;
14008 definedExpStack[definedExpStackPos++] = definedExp;
14009 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
14010 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
14011 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14013 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14014 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
14015 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
14016 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
14018 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
14019 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
14021 parsedExpression = (((void *)0));
14023 expression_yyparse();
14024 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
14026 fileInput = backInput;
14027 yylloc = backupYylloc;
14028 if(parsedExpression)
14030 FreeIdentifier(id);
14032 exp->list = MkListOne(parsedExpression);
14033 parsedExpression->loc = yylloc;
14034 ProcessExpressionType(exp);
14035 definedExpStackPos--;
14038 definedExpStackPos--;
14044 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
14050 struct GlobalData * data = (((void *)0));
14052 if(thisNameSpace && !(id->_class && !id->_class->name))
14056 strcpy(name, thisNameSpace);
14057 strcat(name, "::");
14058 strcat(name, id->string);
14059 data = FindGlobalData(name);
14062 data = FindGlobalData(id->string);
14065 DeclareGlobalData(data);
14066 exp->expType = data->dataType;
14068 data->dataType->refCount++;
14069 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14070 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
14071 FreeSpecifier(id->_class);
14072 id->_class = (((void *)0));
14077 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
14079 if(thisNameSpace && !(id->_class && !id->_class->name))
14083 strcpy(name, thisNameSpace);
14084 strcat(name, "::");
14085 strcat(name, id->string);
14086 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
14089 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
14094 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14095 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
14097 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
14098 strcpy(name, "__ecereFunction_");
14099 FullClassNameCat(name, id->string, 0x0);
14100 if(DeclareFunction(function, name))
14102 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
14103 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
14105 exp->expType = function->dataType;
14106 if(function->dataType)
14107 function->dataType->refCount++;
14108 FreeSpecifier(id->_class);
14109 id->_class = (((void *)0));
14121 struct __ecereNameSpace__ecere__com__Class * _class;
14123 if(!exp->instance->_class)
14125 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
14127 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
14130 ProcessInstantiationType(exp->instance);
14131 exp->isConstant = exp->instance->isConstant;
14132 if(exp->instance->_class)
14134 exp->expType = MkClassType(exp->instance->_class->name);
14142 char * constant = exp->constant;
14143 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
14145 exp->expType = type;
14146 if(constant[0] == '\'')
14148 if((int)((unsigned char *)constant)[1] > 127)
14151 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
14155 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
14156 exp->constant = PrintUInt(ch);
14158 type->_class = FindClass("unichar");
14159 type->isSigned = 0x0;
14164 type->isSigned = 0x1;
14169 char * dot = strchr(constant, '.');
14170 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
14175 exponent = strchr(constant, 'p');
14177 exponent = strchr(constant, 'P');
14181 exponent = strchr(constant, 'e');
14183 exponent = strchr(constant, 'E');
14185 if(dot || exponent)
14187 if(strchr(constant, 'f') || strchr(constant, 'F'))
14191 type->isSigned = 0x1;
14195 unsigned int isSigned = constant[0] == '-';
14196 char * endP = (((void *)0));
14197 long long i64 = strtoll(constant, &endP, 0);
14198 uint64 ui64 = strtoull(constant, &endP, 0);
14199 unsigned int is64Bit = endP && (!strcmp(endP, "LL") || !strcmp(endP, "ll"));
14203 if(i64 < (((int)0x80000000)))
14208 if(ui64 > (((int)0x7fffffff)))
14210 if(ui64 > (0xffffffff))
14213 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
14217 else if(constant[0] != '0' || !constant[1])
14220 type->kind = is64Bit ? 4 : 3;
14221 type->isSigned = isSigned;
14224 exp->isConstant = 0x1;
14225 if(exp->destType && exp->destType->kind == 7)
14227 else if(exp->destType && exp->destType->kind == 6)
14229 else if(exp->destType && exp->destType->kind == 4)
14236 exp->isConstant = 0x1;
14237 exp->expType = __extension__ ({
14238 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14240 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
14241 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14243 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
14244 }), __ecereInstance2;
14250 ProcessExpressionType(exp->_new.size);
14251 exp->expType = __extension__ ({
14252 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14254 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
14256 DeclareType(exp->expType->type, 0x0, 0x0);
14260 ProcessExpressionType(exp->_renew.size);
14261 ProcessExpressionType(exp->_renew.exp);
14262 exp->expType = __extension__ ({
14263 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14265 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
14267 DeclareType(exp->expType->type, 0x0, 0x0);
14271 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
14272 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
14273 unsigned int useDestType = 0x0, useSideType = 0x0;
14274 struct Location oldyylloc = yylloc;
14275 unsigned int useSideUnit = 0x0;
14276 struct __ecereNameSpace__ecere__com__Class * destClass = (exp->destType && exp->destType->kind == 8 && exp->destType->_class) ? exp->destType->_class->registered : (((void *)0));
14277 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14340 if(exp->op.op == '&')
14342 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
14344 struct Identifier * id = exp->op.exp2->identifier;
14345 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
14347 if(symbol && symbol->isIterator == 2)
14350 exp->member.exp = exp->op.exp2;
14351 exp->member.member = MkIdentifier("key");
14352 exp->expType = (((void *)0));
14353 exp->op.exp2->expType = symbol->type;
14354 symbol->type->refCount++;
14355 ProcessExpressionType(exp);
14363 if(exp->op.exp2 && useSideUnit && useDestType && destClass && destClass->type == 3 && destClass->base->type != 3)
14365 if(destClass && useDestType && ((destClass->type == 3 && useSideUnit) || destClass->type == 4 || destClass->type == 2))
14367 if(exp->op.exp1->destType)
14368 FreeType(exp->op.exp1->destType);
14369 exp->op.exp1->destType = exp->destType;
14370 exp->op.exp1->opDestType = 0x1;
14372 exp->destType->refCount++;
14376 if(exp->op.exp1->destType)
14377 FreeType(exp->op.exp1->destType);
14378 exp->op.exp1->destType = dummy;
14381 if(exp->op.exp1->destType && exp->op.op != '=')
14382 exp->op.exp1->destType->count++;
14383 ProcessExpressionType(exp->op.exp1);
14384 if(exp->op.exp1->destType && exp->op.op != '=')
14385 exp->op.exp1->destType->count--;
14386 exp->op.exp1->opDestType = 0x0;
14387 if(!exp->op.exp2 && (exp->op.op == INC_OP || exp->op.op == DEC_OP) && exp->op.exp1->expType && exp->op.exp1->expType->kind == 8 && exp->op.exp1->expType->_class && exp->op.exp1->expType->_class->registered && exp->op.exp1->expType->_class->registered->type == 3)
14389 exp->op.exp2 = MkExpConstant("1");
14390 exp->op.op = exp->op.op == INC_OP ? ADD_ASSIGN : SUB_ASSIGN;
14393 if(exp->op.exp1->destType == dummy)
14396 exp->op.exp1->destType = (((void *)0));
14398 type1 = exp->op.exp1->expType;
14402 char expString[10240];
14404 expString[0] = '\0';
14405 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
14409 exp->op.exp2->destType = exp->op.exp1->expType;
14410 if(exp->op.exp1->expType)
14411 exp->op.exp1->expType->refCount++;
14415 exp->op.exp2->destType = exp->destType;
14416 if(!exp->op.exp1 || exp->op.op != '&')
14417 exp->op.exp2->opDestType = 0x1;
14419 exp->destType->refCount++;
14423 exp->expType = type1;
14428 PrintExpression(exp->op.exp2, expString);
14429 if(type1 && type1->kind == 13)
14431 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)
14432 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
14433 else if(exp->op.op == '=')
14435 if(exp->op.exp2->destType)
14436 FreeType(exp->op.exp2->destType);
14437 exp->op.exp2->destType = type1;
14444 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)
14448 if(exp->op.exp2->destType)
14449 FreeType(exp->op.exp2->destType);
14450 exp->op.exp2->destType = type1;
14457 exp->expType = type1;
14459 else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (destClass->type == 4 && useDestType)))
14461 if(exp->op.exp2->destType)
14462 FreeType(exp->op.exp2->destType);
14463 exp->op.exp2->destType = exp->destType;
14464 if(exp->op.op != '&')
14465 exp->op.exp2->opDestType = 0x1;
14467 exp->destType->refCount++;
14471 if(exp->op.exp2->destType)
14472 FreeType(exp->op.exp2->destType);
14473 exp->op.exp2->destType = dummy;
14476 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14478 FreeType(exp->op.exp2->destType);
14479 exp->op.exp2->destType = type1;
14482 if(exp->op.exp2->destType && exp->op.op != '=')
14483 exp->op.exp2->destType->count++;
14484 if(exp->op.op == SIZEOF)
14486 struct Expression * e = exp->op.exp2;
14488 while((e->type == 5 || e->type == 32 || e->type == 23) && e->list)
14490 if(e->type == 5 || e->type == 32 || e->type == 23)
14493 e = (*((struct Statement *)(*e->compound->compound.statements).last)->expressions).last;
14495 e = (*e->list).last;
14498 if(e->type == 11 && e->cast.exp)
14499 e->cast.exp->needCast = 0x1;
14501 ProcessExpressionType(exp->op.exp2);
14502 exp->op.exp2->opDestType = 0x0;
14503 if(exp->op.exp2->destType && exp->op.op != '=')
14504 exp->op.exp2->destType->count--;
14505 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14507 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)
14509 if(exp->op.op != '=' && type1->type->kind == 0)
14510 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14512 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)))
14514 if(exp->op.op == ADD_ASSIGN)
14515 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14517 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))
14519 if(exp->op.op == ADD_ASSIGN)
14520 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14522 else if(inCompiler)
14524 char type1String[1024];
14525 char type2String[1024];
14527 type1String[0] = '\0';
14528 type2String[0] = '\0';
14529 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14530 PrintType(type1, type2String, 0x0, 0x1);
14531 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14532 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14535 if(exp->op.exp2->destType == dummy)
14538 exp->op.exp2->destType = (((void *)0));
14540 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14542 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14543 type2->refCount = 1;
14544 CopyTypeInto(type2, exp->op.exp2->expType);
14545 type2->isSigned = 0x1;
14547 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14549 type2 = __extension__ ({
14550 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14552 __ecereInstance1->kind = 3, __ecereInstance1;
14554 type2->refCount = 1;
14555 type2->isSigned = 0x1;
14559 type2 = exp->op.exp2->expType;
14565 if(exp->op.op == SIZEOF)
14567 exp->expType = __extension__ ({
14568 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14570 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14572 exp->isConstant = 0x1;
14574 else if(exp->op.op == '*' && !exp->op.exp1)
14576 exp->expType = Dereference(type2);
14577 if(type2 && type2->kind == 8)
14578 notByReference = 0x1;
14580 else if(exp->op.op == '&' && !exp->op.exp1)
14581 exp->expType = Reference(type2);
14588 if(exp->op.exp1->destType)
14589 FreeType(exp->op.exp1->destType);
14590 exp->op.exp1->destType = MkClassType("bool");
14591 exp->op.exp1->destType->truth = 0x1;
14592 if(!exp->op.exp1->expType)
14593 ProcessExpressionType(exp->op.exp1);
14595 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14596 FreeType(exp->op.exp1->expType);
14597 exp->op.exp1->expType = MkClassType("bool");
14598 exp->op.exp1->expType->truth = 0x1;
14602 if(exp->op.exp2->destType)
14603 FreeType(exp->op.exp2->destType);
14604 exp->op.exp2->destType = MkClassType("bool");
14605 exp->op.exp2->destType->truth = 0x1;
14606 if(!exp->op.exp2->expType)
14607 ProcessExpressionType(exp->op.exp2);
14609 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14610 FreeType(exp->op.exp2->expType);
14611 exp->op.exp2->expType = MkClassType("bool");
14612 exp->op.exp2->expType->truth = 0x1;
14615 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")))))
14617 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14619 if(exp->op.op == '-' && ((type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 4) || (type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 4)))
14621 struct Type * intType;
14623 if(!type1->_class->registered->dataType)
14624 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14625 if(!type2->_class->registered->dataType)
14626 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14627 intType = ProcessTypeString((type1->_class->registered->dataType->kind == 4 || type2->_class->registered->dataType->kind == 4) ? "int64" : "int", 0x0);
14628 if(exp->op.exp1->destType)
14629 FreeType(exp->op.exp1->destType);
14630 if(exp->op.exp2->destType)
14631 FreeType(exp->op.exp2->destType);
14632 exp->op.exp1->destType = intType;
14633 exp->op.exp2->destType = intType;
14634 intType->refCount++;
14638 if(exp->op.exp2->destType)
14639 FreeType(exp->op.exp2->destType);
14640 exp->op.exp2->destType = type1;
14642 if(exp->op.exp1->destType)
14643 FreeType(exp->op.exp1->destType);
14644 exp->op.exp1->destType = type2;
14647 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)
14648 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);
14649 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14651 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14655 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14657 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14658 ProcessExpressionType(exp->op.exp1);
14659 if(type2->kind != 13)
14661 ProcessExpressionType(classExp);
14662 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"))))))));
14663 if(!exp->op.exp2->expType)
14667 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14670 ProcessExpressionType(exp->op.exp2);
14674 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)))
14676 if(type1->kind != 8 && type1->type->kind == 0)
14677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14678 exp->expType = type1;
14682 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)))
14684 if(type2->kind != 8 && type2->type->kind == 0)
14685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14686 exp->expType = type2;
14690 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))
14692 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14696 unsigned int success = 0x0;
14698 if(type1->kind == 13 && type2->kind == 13)
14700 if(exp->op.op == '+')
14701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14702 else if(exp->op.op == '-')
14704 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14706 exp->expType = __extension__ ({
14707 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14709 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14712 if(type1->type->kind == 20)
14714 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14718 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14720 ProcessExpressionType(classExp);
14722 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")))))));
14723 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14731 if(!success && exp->op.exp1->type == 2)
14733 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14736 FreeType(exp->expType);
14737 exp->expType = exp->op.exp1->destType;
14738 if(exp->op.exp1->destType)
14739 exp->op.exp1->destType->refCount++;
14742 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14745 FreeType(exp->expType);
14746 exp->expType = exp->op.exp2->destType;
14747 if(exp->op.exp2->destType)
14748 exp->op.exp2->destType->refCount++;
14754 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14757 FreeType(exp->expType);
14758 exp->expType = exp->op.exp2->destType;
14759 if(exp->op.exp2->destType)
14760 exp->op.exp2->destType->refCount++;
14763 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14766 FreeType(exp->expType);
14767 exp->expType = exp->op.exp1->destType;
14768 if(exp->op.exp1->destType)
14769 exp->op.exp1->destType->refCount++;
14775 char expString1[10240];
14776 char expString2[10240];
14780 expString1[0] = '\0';
14781 expString2[0] = '\0';
14786 PrintExpression(exp->op.exp1, expString1);
14787 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14788 PrintExpression(exp->op.exp2, expString2);
14789 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14790 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14791 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14793 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14797 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14799 if(exp->op.exp1->destType)
14800 FreeType(exp->op.exp1->destType);
14801 exp->op.exp1->destType = type2->_class->registered->dataType;
14802 if(type2->_class->registered->dataType)
14803 type2->_class->registered->dataType->refCount++;
14804 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14805 exp->expType = type2;
14809 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14811 if(exp->op.exp2->destType)
14812 FreeType(exp->op.exp2->destType);
14813 exp->op.exp2->destType = type1->_class->registered->dataType;
14814 if(type1->_class->registered->dataType)
14815 type1->_class->registered->dataType->refCount++;
14816 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14817 exp->expType = type1;
14823 unsigned int valid = 0x0;
14825 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14827 if(exp->op.exp2->destType)
14828 FreeType(exp->op.exp2->destType);
14829 if(!type1->_class->registered->dataType)
14830 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14831 exp->op.exp2->destType = type1->_class->registered->dataType;
14832 exp->op.exp2->destType->refCount++;
14833 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14836 type2 = exp->op.exp2->destType;
14839 exp->expType = type2;
14842 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14844 if(exp->op.exp1->destType)
14845 FreeType(exp->op.exp1->destType);
14846 if(!type2->_class->registered->dataType)
14847 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14848 exp->op.exp1->destType = type2->_class->registered->dataType;
14849 exp->op.exp1->destType->refCount++;
14850 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14851 type1 = exp->op.exp1->destType;
14852 exp->expType = type1;
14855 if(!boolResult || exp->op.op == '>' || exp->op.op == '<' || exp->op.op == GE_OP || exp->op.op == LE_OP)
14857 unsigned int op1IsEnum = type1 && type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4;
14858 unsigned int op2IsEnum = type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4;
14860 if(exp->op.op == '*' || exp->op.op == '/' || exp->op.op == '-' || exp->op.op == '|' || exp->op.op == '^')
14862 if(op1IsEnum && exp->op.exp2->expType)
14864 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14867 FreeType(exp->expType);
14868 exp->expType = exp->op.exp2->expType;
14869 if(exp->op.exp2->expType)
14870 exp->op.exp2->expType->refCount++;
14874 else if(op2IsEnum && exp->op.exp1->expType)
14876 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14879 FreeType(exp->expType);
14880 exp->expType = exp->op.exp1->expType;
14881 if(exp->op.exp1->expType)
14882 exp->op.exp1->expType->refCount++;
14889 if(op1IsEnum && exp->op.exp2->expType)
14891 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14894 FreeType(exp->expType);
14895 exp->expType = exp->op.exp1->expType;
14896 if(exp->op.exp1->expType)
14897 exp->op.exp1->expType->refCount++;
14901 else if(op2IsEnum && exp->op.exp1->expType)
14903 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14906 FreeType(exp->expType);
14907 exp->expType = exp->op.exp2->expType;
14908 if(exp->op.exp2->expType)
14909 exp->op.exp2->expType->refCount++;
14917 if(type2 && type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3 && (type1->kind != 8 || !type1->_class || !type1->_class->registered || type1->_class->registered->type != 3))
14919 if(exp->op.exp1->destType)
14920 FreeType(exp->op.exp1->destType);
14921 exp->op.exp1->destType = type2;
14923 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14926 FreeType(exp->expType);
14927 exp->expType = exp->op.exp1->destType;
14928 if(exp->op.exp1->destType)
14929 exp->op.exp1->destType->refCount++;
14934 if(exp->op.exp2->destType)
14935 FreeType(exp->op.exp2->destType);
14936 exp->op.exp2->destType = type1;
14938 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14941 FreeType(exp->expType);
14942 exp->expType = exp->op.exp2->destType;
14943 if(exp->op.exp2->destType)
14944 exp->op.exp2->destType->refCount++;
14946 else if(type1 && type2)
14948 char expString1[10240];
14949 char expString2[10240];
14950 char type1String[1024];
14951 char type2String[1024];
14953 expString1[0] = '\0';
14954 expString2[0] = '\0';
14955 type1String[0] = '\0';
14956 type2String[0] = '\0';
14959 PrintExpression(exp->op.exp1, expString1);
14960 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14961 PrintExpression(exp->op.exp2, expString2);
14962 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14963 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14964 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14966 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14967 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14969 exp->expType = exp->op.exp1->expType;
14970 if(exp->op.exp1->expType)
14971 exp->op.exp1->expType->refCount++;
14973 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14975 exp->expType = exp->op.exp2->expType;
14976 if(exp->op.exp2->expType)
14977 exp->op.exp2->expType->refCount++;
14985 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14987 struct Type * oldType = exp->op.exp1->expType;
14989 exp->op.exp1->expType = (((void *)0));
14990 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14993 exp->op.exp1->expType = oldType;
14995 if(exp->op.exp1->destType)
14996 FreeType(exp->op.exp1->destType);
14997 exp->op.exp1->destType = type2;
14999 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
15002 FreeType(exp->expType);
15003 exp->expType = exp->op.exp1->destType;
15004 if(exp->op.exp1->destType)
15005 exp->op.exp1->destType->refCount++;
15009 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
15011 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
15013 if(exp->op.exp1->destType)
15014 FreeType(exp->op.exp1->destType);
15015 exp->op.exp1->destType = type2->_class->registered->dataType;
15016 if(type2->_class->registered->dataType)
15017 type2->_class->registered->dataType->refCount++;
15018 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
15020 if(exp->op.op == '!')
15022 exp->expType = MkClassType("bool");
15023 exp->expType->truth = 0x1;
15027 exp->expType = type2;
15032 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
15034 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
15036 if(exp->op.exp2->destType)
15037 FreeType(exp->op.exp2->destType);
15038 exp->op.exp2->destType = type1->_class->registered->dataType;
15039 if(type1->_class->registered->dataType)
15040 type1->_class->registered->dataType->refCount++;
15041 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
15043 exp->expType = type1;
15049 if(exp->op.exp1 && !exp->op.exp1->expType)
15051 char expString[10000];
15053 expString[0] = '\0';
15056 PrintExpression(exp->op.exp1, expString);
15057 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15060 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15062 if(exp->op.exp2 && !exp->op.exp2->expType)
15064 char expString[10240];
15066 expString[0] = '\0';
15069 PrintExpression(exp->op.exp2, expString);
15070 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15073 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
15077 FreeType(exp->expType);
15078 exp->expType = MkClassType("bool");
15079 exp->expType->truth = 0x1;
15081 if(exp->op.op != SIZEOF)
15082 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
15083 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
15085 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
15087 yylloc = oldyylloc;
15096 struct Expression * e;
15098 exp->isConstant = 0x1;
15099 for(e = (*exp->list).first; e; e = e->next)
15101 unsigned int inced = 0x0;
15105 FreeType(e->destType);
15106 e->opDestType = exp->opDestType;
15107 e->destType = exp->destType;
15110 exp->destType->refCount++;
15111 e->destType->count++;
15115 ProcessExpressionType(e);
15117 exp->destType->count--;
15118 if(!exp->expType && !e->next)
15120 exp->expType = e->expType;
15122 e->expType->refCount++;
15125 exp->isConstant = 0x0;
15127 e = (*exp->list).first;
15128 if(!e->next && e->type == 8)
15130 struct Expression * next = exp->next, * prev = exp->prev;
15132 FreeType(exp->expType);
15133 FreeType(exp->destType);
15134 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
15138 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
15139 ProcessExpressionType(exp);
15145 struct Expression * e;
15147 exp->isConstant = 0x1;
15148 ProcessExpressionType(exp->index.exp);
15149 if(!exp->index.exp->isConstant)
15150 exp->isConstant = 0x0;
15151 if(exp->index.exp->expType)
15153 struct Type * source = exp->index.exp->expType;
15155 if(source->kind == 8 && source->_class && source->_class->registered)
15157 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
15158 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
15160 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
15162 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
15163 if(exp->index.index && (*exp->index.index).last)
15165 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
15170 for(e = (*exp->index.index).first; e; e = e->next)
15172 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
15175 FreeType(e->destType);
15176 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
15178 ProcessExpressionType(e);
15183 exp->isConstant = 0x0;
15186 exp->expType = Dereference(exp->index.exp->expType);
15188 DeclareType(exp->expType, 0x0, 0x0);
15193 struct Expression * e;
15194 struct Type * functionType;
15195 struct Type * methodType = (((void *)0));
15201 PrintExpression(exp->call.exp, name);
15202 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
15204 PrintExpression(exp->call.exp, name);
15207 if(exp->call.exp->type == 0)
15209 struct Expression * idExp = exp->call.exp;
15210 struct Identifier * id = idExp->identifier;
15212 if(!strcmp(id->string, "__builtin_frame_address"))
15214 exp->expType = ProcessTypeString("void *", 0x1);
15215 if(exp->call.arguments && (*exp->call.arguments).first)
15216 ProcessExpressionType((*exp->call.arguments).first);
15219 else if(!strcmp(id->string, "__ENDIAN_PAD"))
15221 exp->expType = ProcessTypeString("int", 0x1);
15222 if(exp->call.arguments && (*exp->call.arguments).first)
15223 ProcessExpressionType((*exp->call.arguments).first);
15226 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
15228 struct Expression * a = (((void *)0));
15229 struct Expression * b = (((void *)0));
15230 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
15232 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
15234 a = (*exp->call.arguments).first;
15235 b = (*exp->call.arguments).last;
15239 else if((*exp->call.arguments).count == 1)
15241 a = (*exp->call.arguments).first;
15246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
15247 idExp->identifier = (((void *)0));
15248 FreeExpContents(exp);
15249 ProcessExpressionType(a);
15251 ProcessExpressionType(b);
15253 exp->list = MkList();
15254 if(a->expType && (!b || b->expType))
15256 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
15260 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15261 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
15262 struct Declaration * decl;
15263 char temp1[1024], temp2[1024];
15265 GetTypeSpecs(a->expType, specs);
15266 if(a && !a->isConstant && a->type != 0)
15268 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
15269 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
15270 tempExp1 = QMkExpId(temp1);
15271 tempExp1->expType = a->expType;
15273 a->expType->refCount++;
15274 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
15276 if(b && !b->isConstant && b->type != 0)
15278 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
15279 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
15280 tempExp2 = QMkExpId(temp2);
15281 tempExp2->expType = b->expType;
15283 b->expType->refCount++;
15284 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
15286 decl = MkDeclaration(specs, decls);
15287 if(!curCompound->compound.declarations)
15288 curCompound->compound.declarations = MkList();
15289 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
15293 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
15295 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
15297 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
15298 exp->expType = a->expType;
15300 a->expType->refCount++;
15302 else if(!strcmp(id->string, "Abs"))
15304 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
15305 exp->expType = a->expType;
15307 a->expType->refCount++;
15309 else if(!strcmp(id->string, "Sgn"))
15311 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"))))));
15312 exp->expType = ProcessTypeString("int", 0x0);
15314 FreeExpression(tempExp1);
15316 FreeExpression(tempExp2);
15317 FreeIdentifier(id);
15323 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
15325 if(!exp->call.exp->destType)
15327 exp->call.exp->destType = dummy;
15330 ProcessExpressionType(exp->call.exp);
15331 if(exp->call.exp->destType == dummy)
15334 exp->call.exp->destType = (((void *)0));
15338 functionType = exp->call.exp->expType;
15339 if(functionType && functionType->kind == 16)
15341 methodType = functionType;
15342 functionType = methodType->method->dataType;
15343 if(exp->call.exp->expType->usedClass)
15345 char typeString[1024];
15347 typeString[0] = '\0';
15349 struct Symbol * back = functionType->thisClass;
15351 functionType->thisClass = (((void *)0));
15352 PrintType(functionType, typeString, 0x1, 0x1);
15353 functionType->thisClass = back;
15355 if(strstr(typeString, "thisclass"))
15357 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15358 struct Declarator * decl;
15361 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
15363 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15364 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
15365 thisClassParams = 0x0;
15366 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
15368 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
15370 thisClass = exp->call.exp->expType->usedClass;
15371 ProcessDeclarator(decl);
15372 thisClass = backupThisClass;
15374 thisClassParams = 0x1;
15375 functionType = ProcessType(specs, decl);
15376 functionType->refCount = 0;
15377 FinishTemplatesContext(context);
15379 FreeList(specs, FreeSpecifier);
15380 FreeDeclarator(decl);
15384 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
15386 struct Type * type = functionType->type;
15388 if(!functionType->refCount)
15390 functionType->type = (((void *)0));
15391 FreeType(functionType);
15393 functionType = type;
15395 if(functionType && functionType->kind != 11)
15397 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
15399 else if(functionType)
15401 unsigned int emptyParams = 0x0, noParams = 0x0;
15402 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
15403 struct Type * type = functionType->params.first;
15404 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
15406 struct Location oldyylloc = yylloc;
15410 if(functionType->extraParam && e && functionType->thisClass)
15412 e->destType = MkClassType(functionType->thisClass->string);
15415 if(!functionType->staticMethod && !functionType->extraParam)
15417 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
15419 type = MkClassType(memberExp->member.exp->expType->_class->string);
15422 e->destType = type;
15424 type = functionType->params.first;
15427 type->refCount = 0;
15429 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
15431 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
15432 type->byReference = functionType->byReference;
15433 type->typedByReference = functionType->typedByReference;
15436 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
15438 e->destType = type;
15440 type = functionType->params.first;
15443 type->refCount = 0;
15446 if(type && type->kind == 0)
15449 if(!type->refCount)
15451 type = (((void *)0));
15453 for(; e; e = e->next)
15455 if(!type && !emptyParams)
15458 if(methodType && methodType->methodClass)
15459 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);
15461 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);
15464 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
15466 struct Type * templatedType = (((void *)0));
15467 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
15468 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15471 if(_class && _class->templateArgs)
15473 struct __ecereNameSpace__ecere__com__Class * sClass;
15475 for(sClass = _class; sClass; sClass = sClass->base)
15477 if(sClass->templateClass)
15478 sClass = sClass->templateClass;
15480 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15482 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
15484 struct __ecereNameSpace__ecere__com__Class * nextClass;
15486 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15488 if(nextClass->templateClass)
15489 nextClass = nextClass->templateClass;
15490 id += nextClass->templateParams.count;
15500 if(curParam && _class->templateArgs[id].dataTypeString)
15502 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
15505 struct Context * context = SetupTemplatesContext(_class);
15507 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
15508 FinishTemplatesContext(context);
15510 e->destType = templatedType;
15513 templatedType->passAsTemplate = 0x1;
15518 e->destType = type;
15525 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
15527 e->destType = type->prev;
15528 e->destType->refCount++;
15532 e->destType = type;
15537 if(type && type->kind != 14)
15539 struct Type * next = type->next;
15541 if(!type->refCount)
15546 if(type && type->kind != 14)
15548 if(methodType && methodType->methodClass)
15549 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);
15551 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);
15553 yylloc = oldyylloc;
15554 if(type && !type->refCount)
15559 functionType = __extension__ ({
15560 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15562 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
15564 if(exp->call.exp->type == 0)
15566 char * string = exp->call.exp->identifier->string;
15570 struct Symbol * symbol;
15571 struct Location oldyylloc = yylloc;
15573 yylloc = exp->call.exp->identifier->loc;
15574 if(strstr(string, "__builtin_") == string)
15578 functionType->returnType = exp->destType;
15579 exp->destType->refCount++;
15583 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15584 symbol = __extension__ ({
15585 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15587 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15589 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15590 if(strstr(symbol->string, "::"))
15591 globalContext->hasNameSpace = 0x1;
15592 yylloc = oldyylloc;
15595 else if(exp->call.exp->type == 8)
15599 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15600 if(!functionType->returnType)
15602 functionType->returnType = __extension__ ({
15603 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15605 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15609 if(functionType && functionType->kind == 11)
15611 exp->expType = functionType->returnType;
15612 if(functionType->returnType)
15613 functionType->returnType->refCount++;
15614 if(!functionType->refCount)
15615 FreeType(functionType);
15617 if(exp->call.arguments)
15619 for(e = (*exp->call.arguments).first; e; e = e->next)
15621 struct Type * destType = e->destType;
15623 ProcessExpressionType(e);
15630 struct Type * type;
15631 struct Location oldyylloc = yylloc;
15632 unsigned int thisPtr;
15633 struct Expression * checkExp = exp->member.exp;
15637 if(checkExp->type == 11)
15638 checkExp = checkExp->cast.exp;
15639 else if(checkExp->type == 5)
15640 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15644 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15645 exp->thisPtr = thisPtr;
15646 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15648 exp->member.member->classSym = exp->member.member->_class->symbol;
15650 ProcessExpressionType(exp->member.exp);
15651 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)
15653 exp->isConstant = 0x0;
15656 exp->isConstant = exp->member.exp->isConstant;
15657 type = exp->member.exp->expType;
15659 if(type && (type->kind == 20))
15661 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15662 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15666 for(param = _class->templateParams.first; param; param = param->next)
15668 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15672 if(param && param->defaultArg.member)
15674 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15678 struct Expression * expMember = exp->member.exp;
15679 struct Declarator * decl;
15680 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15681 char thisClassTypeString[1024];
15683 FreeIdentifier(exp->member.member);
15684 ProcessExpressionType(argExp);
15686 char * colon = strstr(param->defaultArg.memberString, "::");
15690 char className[1024];
15691 struct __ecereNameSpace__ecere__com__Class * sClass;
15693 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15694 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15697 strcpy(thisClassTypeString, _class->fullName);
15699 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15700 exp->expType = ProcessType(specs, decl);
15701 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15703 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15704 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15706 int paramCount = 0;
15707 int lastParam = -1;
15708 char templateString[1024];
15709 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15711 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15712 for(cClass = expClass; cClass; cClass = cClass->base)
15716 for(param = cClass->templateParams.first; param; param = param->next)
15719 struct __ecereNameSpace__ecere__com__Class * sClass;
15720 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15722 for(sClass = cClass->base; sClass; sClass = sClass->base)
15723 id += sClass->templateParams.count;
15724 arg = expClass->templateArgs[id];
15725 for(sClass = _class; sClass; sClass = sClass->base)
15727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15729 struct __ecereNameSpace__ecere__com__Class * nextClass;
15731 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15732 p += nextClass->templateParams.count;
15733 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15735 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15737 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15739 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15740 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15747 char argument[256];
15749 argument[0] = '\0';
15750 switch(param->type)
15754 char expString[1024];
15755 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15756 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15757 struct Expression * exp;
15758 char * string = PrintHexUInt64(arg.expression.ui64);
15760 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15761 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
15762 ProcessExpressionType(exp);
15763 ComputeExpression(exp);
15764 expString[0] = '\0';
15765 PrintExpression(exp, expString);
15766 strcat(argument, expString);
15767 FreeExpression(exp);
15772 strcat(argument, arg.member->name);
15777 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15779 if(!strcmp(arg.dataTypeString, "thisclass"))
15780 strcat(argument, thisClassTypeString);
15782 strcat(argument, arg.dataTypeString);
15790 strcat(templateString, ", ");
15791 if(lastParam != p - 1)
15793 strcat(templateString, param->name);
15794 strcat(templateString, " = ");
15796 strcat(templateString, argument);
15805 int len = strlen(templateString);
15807 if(templateString[len - 1] == '>')
15808 templateString[len++] = ' ';
15809 templateString[len++] = '>';
15810 templateString[len++] = '\0';
15813 struct Context * context = SetupTemplatesContext(_class);
15815 FreeType(exp->expType);
15816 exp->expType = ProcessTypeString(templateString, 0x0);
15817 FinishTemplatesContext(context);
15821 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")))))))));
15824 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15826 type = ProcessTemplateParameterType(type->templateParameter);
15829 if(type && (type->kind == 20))
15831 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)))
15833 struct Identifier * id = exp->member.member;
15834 int typeKind = type->kind;
15835 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));
15837 if(typeKind == 19 && exp->member.exp->type == 24)
15839 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15844 if(typeKind == 3 || typeKind == 15)
15845 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15848 if(type->kind == 8 && type->_class && type->_class->registered)
15850 _class = type->_class->registered;
15852 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15854 _class = FindClass("char *")->registered;
15856 else if(type->kind == 13)
15858 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15859 FreeType(exp->expType);
15860 exp->expType = ProcessTypeString("uintptr", 0x0);
15861 exp->byReference = 0x1;
15865 char string[1024] = "";
15866 struct Symbol * classSym;
15868 PrintTypeNoConst(type, string, 0x0, 0x1);
15869 classSym = FindClass(string);
15871 _class = classSym->registered;
15877 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15878 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15879 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15880 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15881 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15883 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15884 exp->member.memberType = 1;
15885 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15889 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15891 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15892 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15894 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15896 member = (((void *)0));
15898 if(!member && !prop)
15899 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15900 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15901 exp->member.thisPtr = 0x1;
15907 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15908 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15909 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15911 if(!prop && !member)
15913 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15916 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15917 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15918 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15923 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15924 prop = (((void *)0));
15926 member = (((void *)0));
15930 if(!prop && !member && !method)
15931 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15932 if(!prop && !member && !method)
15936 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15939 exp->member.memberType = 5;
15940 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15944 char structName[1024];
15945 struct Identifier * id = exp->member.member;
15946 struct Expression * classExp = exp->member.exp;
15949 FreeType(classExp->expType);
15950 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15951 strcpy(structName, "__ecereClassData_");
15952 FullClassNameCat(structName, type->_class->string, 0x0);
15954 exp->member.member = id;
15955 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"))))))));
15957 ProcessExpressionType(exp);
15963 struct Symbol * classSym = FindClass(id->string);
15967 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15970 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15976 exp->member.memberType = 1;
15977 if(!prop->dataType)
15978 ProcessPropertyType(prop);
15979 exp->expType = prop->dataType;
15981 prop->dataType->refCount++;
15985 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15987 FreeExpContents(exp);
15989 exp->identifier = MkIdentifier("class");
15990 ProcessExpressionType(exp);
15993 exp->member.memberType = 3;
15994 DeclareStruct(_class->fullName, 0x0);
15995 if(!member->dataType)
15997 struct Context * context = SetupTemplatesContext(_class);
15999 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
16000 FinishTemplatesContext(context);
16002 exp->expType = member->dataType;
16003 if(member->dataType)
16004 member->dataType->refCount++;
16006 else if(revConvert)
16008 exp->member.memberType = 4;
16009 exp->expType = MkClassType(revConvert->_class->fullName);
16014 exp->member.memberType = 2;
16016 if(!method->dataType)
16017 ProcessMethodType(method);
16018 exp->expType = __extension__ ({
16019 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16021 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
16023 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
16024 exp->expType->usedClass = _class;
16026 else if(!classProp)
16028 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
16030 FreeExpContents(exp);
16032 exp->identifier = MkIdentifier("class");
16033 FreeType(exp->expType);
16034 exp->expType = MkClassType("ecere::com::Class");
16037 yylloc = exp->member.member->loc;
16038 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
16040 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
16042 if(_class && exp->expType)
16044 struct __ecereNameSpace__ecere__com__Class * tClass;
16047 while(tClass && !tClass->templateClass)
16048 tClass = tClass->base;
16049 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
16052 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16053 struct __ecereNameSpace__ecere__com__Class * sClass;
16055 for(sClass = tClass; sClass; sClass = sClass->base)
16058 if(sClass->templateClass)
16059 sClass = sClass->templateClass;
16060 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16062 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
16064 for(sClass = sClass->base; sClass; sClass = sClass->base)
16065 id += sClass->templateParams.count;
16073 if(curParam && tClass->templateArgs[id].dataTypeString)
16075 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16076 struct Context * context = SetupTemplatesContext(tClass);
16078 FreeType(exp->expType);
16079 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
16082 if(exp->expType->kind == 21)
16084 FreeType(exp->expType);
16085 exp->expType = ReplaceThisClassType(_class);
16087 if(tClass->templateClass)
16088 exp->expType->passAsTemplate = 0x1;
16091 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
16092 if(exp->destType->kind == 21)
16094 FreeType(exp->destType);
16095 exp->destType = ReplaceThisClassType(_class);
16099 FinishTemplatesContext(context);
16102 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
16105 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
16106 struct __ecereNameSpace__ecere__com__Class * sClass;
16108 for(sClass = tClass; sClass; sClass = sClass->base)
16111 if(sClass->templateClass)
16112 sClass = sClass->templateClass;
16113 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
16115 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
16117 for(sClass = sClass->base; sClass; sClass = sClass->base)
16118 id += sClass->templateParams.count;
16128 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
16129 struct Context * context = SetupTemplatesContext(tClass);
16130 struct Type * basicType;
16132 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
16135 if(basicType->kind == 21)
16137 FreeType(basicType);
16138 basicType = ReplaceThisClassType(_class);
16140 FreeType(exp->expType);
16141 exp->expType = __extension__ ({
16142 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16144 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
16148 exp->destType = exp->expType;
16149 exp->destType->refCount++;
16152 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16153 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16154 struct Declarator * decl;
16156 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
16159 exp->destType->refCount++;
16161 exp->expType->refCount++;
16163 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
16164 exp->cast.exp = newExp;
16167 FinishTemplatesContext(context);
16170 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
16172 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
16176 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
16179 int paramCount = 0;
16180 int lastParam = -1;
16181 char templateString[1024];
16182 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
16184 sprintf(templateString, "%s<", expClass->templateClass->fullName);
16185 while(cClass != expClass)
16187 struct __ecereNameSpace__ecere__com__Class * sClass;
16189 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
16192 for(param = cClass->templateParams.first; param; param = param->next)
16194 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
16197 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
16198 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
16200 while(cClassCur != tClass && !paramCur)
16202 struct __ecereNameSpace__ecere__com__Class * sClassCur;
16204 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
16206 cClassCur = sClassCur;
16207 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
16209 if(!strcmp(paramCur->name, param->name))
16216 if(paramCur && paramCur->type == 0)
16217 arg = tClass->templateArgs[cp];
16219 arg = expClass->templateArgs[p];
16221 char argument[256];
16223 argument[0] = '\0';
16224 switch(param->type)
16228 char expString[1024];
16229 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16230 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
16231 struct Expression * exp;
16232 char * string = PrintHexUInt64(arg.expression.ui64);
16234 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
16235 (__ecereNameSpace__ecere__com__eSystem_Delete(string), string = 0);
16236 ProcessExpressionType(exp);
16237 ComputeExpression(exp);
16238 expString[0] = '\0';
16239 PrintExpression(exp, expString);
16240 strcat(argument, expString);
16241 FreeExpression(exp);
16246 strcat(argument, arg.member->name);
16251 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
16252 strcat(argument, arg.dataTypeString);
16259 strcat(templateString, ", ");
16260 if(lastParam != p - 1)
16262 strcat(templateString, param->name);
16263 strcat(templateString, " = ");
16265 strcat(templateString, argument);
16274 int len = strlen(templateString);
16276 if(templateString[len - 1] == '>')
16277 templateString[len++] = ' ';
16278 templateString[len++] = '>';
16279 templateString[len++] = '\0';
16281 FreeType(exp->expType);
16283 struct Context * context = SetupTemplatesContext(tClass);
16285 exp->expType = ProcessTypeString(templateString, 0x0);
16286 FinishTemplatesContext(context);
16293 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)");
16295 else if(type && (type->kind == 9 || type->kind == 10))
16297 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
16301 exp->expType = memberType;
16303 memberType->refCount++;
16308 char expString[10240];
16310 expString[0] = '\0';
16313 PrintExpression(exp, expString);
16314 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16316 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
16318 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
16320 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
16322 struct Identifier * id = exp->member.member;
16323 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));
16327 FreeType(exp->expType);
16328 exp->expType = ReplaceThisClassType(_class);
16332 yylloc = oldyylloc;
16337 struct Type * destType = exp->destType;
16339 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
16341 exp->member.member->classSym = exp->member.member->_class->symbol;
16343 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
16347 ProcessExpressionType(exp);
16354 struct Symbol * classSym = exp->_class->symbol;
16356 if(classSym && classSym->registered)
16358 if(classSym->registered->type == 5)
16363 DeclareStruct(classSym->string, 0x0);
16364 FreeSpecifier(exp->_class);
16366 FullClassNameCat(name, classSym->string, 0x0);
16367 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
16371 if(classSym->registered->fixed)
16373 FreeSpecifier(exp->_class);
16374 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
16379 char className[1024];
16381 strcpy(className, "__ecereClass_");
16382 FullClassNameCat(className, classSym->string, 0x1);
16383 MangleClassName(className);
16384 DeclareClass(classSym, className);
16385 FreeExpContents(exp);
16387 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
16388 exp->member.member = MkIdentifier("structSize");
16392 exp->expType = __extension__ ({
16393 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16395 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16401 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
16403 exp->expType = __extension__ ({
16404 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16406 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
16408 exp->isConstant = 0x1;
16409 DeclareType(type, 0x0, 0x0);
16415 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
16418 FreeType(exp->cast.exp->destType);
16419 exp->cast.exp->destType = type;
16421 ProcessExpressionType(exp->cast.exp);
16423 exp->expType = type;
16424 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
16426 void * prev = exp->prev, * next = exp->next;
16427 struct Type * expType = exp->cast.exp->destType;
16428 struct Expression * castExp = exp->cast.exp;
16429 struct Type * destType = exp->destType;
16432 expType->refCount++;
16433 FreeType(exp->expType);
16434 FreeTypeName(exp->cast.typeName);
16436 FreeType(exp->expType);
16437 FreeType(exp->destType);
16438 exp->expType = expType;
16439 exp->destType = destType;
16440 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
16446 exp->isConstant = exp->cast.exp->isConstant;
16452 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
16454 exp->expType = type;
16459 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
16461 ProcessExpressionType(exp->vaArg.exp);
16462 exp->expType = type;
16467 struct Expression * e;
16469 exp->isConstant = 0x1;
16470 FreeType(exp->cond.cond->destType);
16471 exp->cond.cond->destType = MkClassType("bool");
16472 exp->cond.cond->destType->truth = 0x1;
16473 ProcessExpressionType(exp->cond.cond);
16474 if(!exp->cond.cond->isConstant)
16475 exp->isConstant = 0x0;
16476 for(e = (*exp->cond.exp).first; e; e = e->next)
16480 FreeType(e->destType);
16481 e->destType = exp->destType;
16483 e->destType->refCount++;
16485 ProcessExpressionType(e);
16488 exp->expType = e->expType;
16490 e->expType->refCount++;
16493 exp->isConstant = 0x0;
16495 FreeType(exp->cond.elseExp->destType);
16496 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
16497 if(exp->cond.elseExp->destType)
16498 exp->cond.elseExp->destType->refCount++;
16499 ProcessExpressionType(exp->cond.elseExp);
16500 if(!exp->cond.elseExp->isConstant)
16501 exp->isConstant = 0x0;
16506 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
16508 struct Statement * last = (*exp->compound->compound.statements).last;
16510 if(last->type == 3 && last->expressions && (*last->expressions).last)
16512 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
16514 exp->destType->refCount++;
16516 ProcessStatement(exp->compound);
16517 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
16519 exp->expType->refCount++;
16525 struct Specifier * spec = (*exp->_classExp.specifiers).first;
16527 if(spec && spec->type == 1)
16529 exp->expType = MkClassType(spec->name);
16530 exp->expType->kind = 19;
16531 exp->byReference = 0x1;
16535 exp->expType = MkClassType("ecere::com::Class");
16536 exp->byReference = 0x1;
16542 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
16546 struct Identifier * id = exp->classData.id;
16547 char structName[1024];
16548 struct Expression * classExp;
16550 strcpy(structName, "__ecereClassData_");
16551 FullClassNameCat(structName, _class->fullName, 0x0);
16553 exp->member.member = id;
16554 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
16555 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
16557 classExp = MkExpIdentifier(MkIdentifier("class"));
16558 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"))))))));
16559 ProcessExpressionType(exp);
16566 struct Type * type = (((void *)0));
16567 char * typeString = (((void *)0));
16568 char typeStringBuf[1024];
16570 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))
16572 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
16574 typeString = templateClass->templateArgs[2].dataTypeString;
16578 struct Expression * e;
16580 for(e = (*exp->list).first; e; e = e->next)
16582 ProcessExpressionType(e);
16592 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16596 e->expType = (((void *)0));
16597 e = (*exp->list).first;
16598 ProcessExpressionType(e);
16601 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16603 FreeType(e->expType);
16604 e->expType = (((void *)0));
16606 type = (((void *)0));
16614 FreeType(e->expType);
16615 e->expType = (((void *)0));
16621 typeStringBuf[0] = '\0';
16622 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16623 typeString = typeStringBuf;
16625 type = (((void *)0));
16630 char templateString[1024];
16631 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16632 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16633 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16634 struct Expression * expExt;
16635 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16637 sprintf(templateString, "Container<%s>", typeString);
16640 struct Expression * e;
16642 type = ProcessTypeString(typeString, 0x0);
16643 while(e = (*exp->list).first)
16645 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16646 e->destType = type;
16648 ProcessExpressionType(e);
16649 ListAdd(initializers, MkInitializerAssignment(e));
16652 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16654 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16655 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16656 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16657 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16658 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16659 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16660 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16661 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16662 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16663 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16664 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16666 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16668 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16669 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16670 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16671 exp->expType = ProcessTypeString(templateString, 0x0);
16673 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16674 ProcessExpressionType(expExt);
16678 exp->expType = ProcessTypeString("Container", 0x0);
16679 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16684 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16686 FreeType(exp->expType);
16687 exp->expType = ReplaceThisClassType(thisClass);
16689 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16691 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16695 if(exp->expType->kind != 15)
16697 struct Type * member;
16698 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16700 FreeType(exp->expType);
16701 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16702 exp->expType->kind = symbol->type->kind;
16703 exp->expType->refCount++;
16704 exp->expType->enumName = enumName;
16705 exp->expType->members = symbol->type->members;
16706 for(member = symbol->type->members.first; member; member = member->next)
16707 member->refCount++;
16711 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16713 for(member = symbol->type->members.first; member; member = member->next)
16715 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16717 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16723 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16725 else if(exp->destType && !exp->destType->keepCast)
16727 if(!CheckExpressionType(exp, exp->destType, 0x0))
16729 if(!exp->destType->count || unresolved)
16734 if(exp->destType->kind != 14)
16741 char expString[10240];
16743 expString[0] = '\0';
16744 PrintType(exp->destType, type2, 0x0, 0x1);
16747 PrintExpression(exp, expString);
16748 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16752 else if(exp->type != 16)
16753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16758 char expString[10240];
16760 expString[0] = '\0';
16763 PrintExpression(exp, expString);
16764 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16768 else if(exp->type != 16)
16769 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16781 PrintType(exp->expType, type1, 0x0, 0x1);
16782 PrintType(exp->destType, type2, 0x0, 0x1);
16784 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)))
16788 char expString[10240];
16790 expString[0] = '\0';
16793 PrintExpression(exp, expString);
16794 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16796 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16797 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16798 FreeType(exp->expType);
16799 exp->destType->refCount++;
16800 exp->expType = exp->destType;
16805 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16807 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16808 char typeString[1024];
16809 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16810 struct Declarator * decl;
16812 typeString[0] = '\0';
16815 exp->expType->refCount++;
16817 exp->expType->refCount++;
16819 newExp->destType = exp->expType;
16820 PrintType(exp->expType, typeString, 0x0, 0x0);
16821 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16822 exp->cast.typeName = MkTypeName(specs, decl);
16823 exp->cast.exp = newExp;
16826 else if(unresolved)
16828 if(exp->identifier->_class && exp->identifier->_class->name)
16829 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16830 else if(exp->identifier->string && exp->identifier->string[0])
16831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16833 else if(!exp->expType && exp->type != 16)
16835 char expString[10240];
16837 expString[0] = '\0';
16840 PrintExpression(exp, expString);
16841 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16843 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16846 ApplyAnyObjectLogic(exp);
16847 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)))
16849 exp->byReference = 0x1;
16851 yylloc = oldyylloc;
16854 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)
16858 *curMember = (*curMember)->next;
16859 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16861 *curMember = subMemberStack[--(*subMemberStackPos)];
16862 *curMember = (*curMember)->next;
16864 while((*curMember) && (*curMember)->isProperty)
16865 *curMember = (*curMember)->next;
16866 if(subMemberStackPos)
16868 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16870 subMemberStack[(*subMemberStackPos)++] = *curMember;
16871 *curMember = (*curMember)->members.first;
16872 while(*curMember && (*curMember)->isProperty)
16873 *curMember = (*curMember)->next;
16881 if(subMemberStackPos && *subMemberStackPos)
16883 *curMember = subMemberStack[--(*subMemberStackPos)];
16884 *curMember = (*curMember)->next;
16888 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16890 if(*curClass == _class)
16892 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16894 *curMember = (*curClass)->membersAndProperties.first;
16896 while((*curMember) && (*curMember)->isProperty)
16897 *curMember = (*curMember)->next;
16898 if(subMemberStackPos)
16900 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16902 subMemberStack[(*subMemberStackPos)++] = *curMember;
16903 *curMember = (*curMember)->members.first;
16904 while(*curMember && (*curMember)->isProperty)
16905 *curMember = (*curMember)->next;
16912 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16917 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16919 if(init->exp && !init->exp->destType)
16921 FreeType(init->exp->destType);
16922 init->exp->destType = type;
16928 ProcessExpressionType(init->exp);
16929 init->isConstant = init->exp->isConstant;
16935 struct Expression * exp = init->exp;
16936 struct Instantiation * inst = exp->instance;
16937 struct MembersInit * members;
16940 init->list = MkList();
16943 for(members = (*inst->members).first; members; members = members->next)
16945 if(members->type == 0)
16947 struct MemberInit * member;
16949 for(member = (*members->dataMembers).first; member; member = member->next)
16951 ListAdd(init->list, member->initializer);
16952 member->initializer = (((void *)0));
16957 FreeExpression(exp);
16961 struct Initializer * i;
16962 struct Type * initializerType = (((void *)0));
16963 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16964 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16965 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16966 int subMemberStackPos = 0;
16968 if(type && type->kind == 12)
16969 initializerType = Dereference(type);
16970 else if(type && (type->kind == 9 || type->kind == 10))
16971 initializerType = type->members.first;
16972 for(i = (*init->list).first; i; i = i->next)
16974 if(type && type->kind == 8 && type->_class && type->_class->registered)
16976 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16979 if(!curMember->dataType)
16980 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16981 initializerType = curMember->dataType;
16984 ProcessInitializer(i, initializerType);
16985 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16986 initializerType = initializerType->next;
16988 init->isConstant = 0x0;
16990 if(type && type->kind == 12)
16991 FreeType(initializerType);
16992 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
17001 extern struct Symbol * FindType(struct Context * ctx, char * name);
17003 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
17005 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
17011 if(spec->specifier == THISCLASS)
17016 spec->name = ReplaceThisClass(thisClass);
17017 spec->symbol = FindClass(spec->name);
17018 ProcessSpecifier(spec, declareStruct);
17025 struct Symbol * symbol = FindType(curContext, spec->name);
17028 DeclareType(symbol->type, 0x1, 0x1);
17029 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
17030 DeclareStruct(spec->name, 0x0);
17035 struct Enumerator * e;
17039 for(e = (*spec->list).first; e; e = e->next)
17042 ProcessExpressionType(e->exp);
17050 if(spec->definitions)
17052 struct ClassDef * def;
17053 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
17055 ProcessClass(spec->definitions, symbol);
17062 static void ProcessDeclarator(struct Declarator * decl)
17067 if(decl->identifier->classSym)
17069 FreeSpecifier(decl->identifier->_class);
17070 decl->identifier->_class = (((void *)0));
17074 if(decl->array.exp)
17075 ProcessExpressionType(decl->array.exp);
17082 if(decl->declarator)
17083 ProcessDeclarator(decl->declarator);
17084 if(decl->type == 4)
17086 struct Identifier * id = GetDeclId(decl);
17088 if(id && id->_class)
17090 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
17092 if(!decl->function.parameters)
17093 decl->function.parameters = MkList();
17094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
17095 id->_class = (((void *)0));
17097 if(decl->function.parameters)
17099 struct TypeName * param;
17101 for(param = (*decl->function.parameters).first; param; param = param->next)
17103 if(param->qualifiers && (*param->qualifiers).first)
17105 struct Specifier * spec = (*param->qualifiers).first;
17107 if(spec && spec->specifier == TYPED_OBJECT)
17109 struct Declarator * d = param->declarator;
17110 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);
17112 FreeList(param->qualifiers, FreeSpecifier);
17113 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
17114 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
17115 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
17118 else if(spec && spec->specifier == ANY_OBJECT)
17120 struct Declarator * d = param->declarator;
17122 FreeList(param->qualifiers, FreeSpecifier);
17123 param->qualifiers = MkListOne(MkSpecifier(VOID));
17124 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
17126 else if(spec->specifier == THISCLASS)
17131 spec->name = ReplaceThisClass(thisClass);
17132 spec->symbol = FindClass(spec->name);
17133 ProcessSpecifier(spec, 0x0);
17137 if(param->declarator)
17138 ProcessDeclarator(param->declarator);
17146 extern struct Identifier * CopyIdentifier(struct Identifier * id);
17148 extern void FreeInitDeclarator(struct InitDeclarator * decl);
17150 static void ProcessDeclaration(struct Declaration * decl)
17152 yylloc = decl->loc;
17157 unsigned int declareStruct = 0x0;
17159 if(decl->declarators)
17161 struct InitDeclarator * d;
17163 for(d = (*decl->declarators).first; d; d = d->next)
17165 struct Type * type, * subType;
17167 ProcessDeclarator(d->declarator);
17168 type = ProcessType(decl->specifiers, d->declarator);
17171 ProcessInitializer(d->initializer, type);
17172 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
17174 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
17176 struct Instantiation * inst = d->initializer->exp->instance;
17178 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
17179 d->initializer->exp->instance = (((void *)0));
17180 if(decl->specifiers)
17181 FreeList(decl->specifiers, FreeSpecifier);
17182 FreeList(decl->declarators, FreeInitDeclarator);
17189 for(subType = type; subType; )
17191 if(subType->kind == 8)
17193 declareStruct = 0x1;
17196 else if(subType->kind == 13)
17198 else if(subType->kind == 12)
17199 subType = subType->arrayType;
17208 if(decl->specifiers)
17210 struct Specifier * s;
17212 for(s = (*decl->specifiers).first; s; s = s->next)
17214 ProcessSpecifier(s, declareStruct);
17221 ProcessInstantiationType(decl->inst);
17226 struct Specifier * spec;
17227 struct Declarator * d;
17228 unsigned int declareStruct = 0x0;
17230 if(decl->declarators)
17232 for(d = (*decl->declarators).first; d; d = d->next)
17234 struct Type * type = ProcessType(decl->specifiers, d->declarator);
17235 struct Type * subType;
17237 ProcessDeclarator(d);
17238 for(subType = type; subType; )
17240 if(subType->kind == 8)
17242 declareStruct = 0x1;
17245 else if(subType->kind == 13)
17247 else if(subType->kind == 12)
17248 subType = subType->arrayType;
17255 if(decl->specifiers)
17257 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
17258 ProcessSpecifier(spec, declareStruct);
17265 static struct FunctionDefinition * curFunction;
17267 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
17269 char propName[1024], propNameM[1024];
17270 char getName[1024], setName[1024];
17271 struct __ecereNameSpace__ecere__sys__OldList * args;
17273 DeclareProperty(prop, setName, getName);
17274 strcpy(propName, "__ecereProp_");
17275 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17276 strcat(propName, "_");
17277 FullClassNameCat(propName, prop->name, 0x1);
17278 MangleClassName(propName);
17279 strcpy(propNameM, "__ecerePropM_");
17280 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
17281 strcat(propNameM, "_");
17282 FullClassNameCat(propNameM, prop->name, 0x1);
17283 MangleClassName(propNameM);
17284 if(prop->isWatchable)
17287 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17288 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17289 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17291 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17292 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17293 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
17297 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17298 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17299 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17301 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
17302 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
17303 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
17305 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17306 curFunction->propSet->fireWatchersDone = 0x1;
17309 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
17311 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
17313 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
17315 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
17317 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
17319 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
17321 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
17323 extern void FreePropertyWatch(struct PropertyWatch * watcher);
17325 static void ProcessStatement(struct Statement * stmt)
17327 yylloc = stmt->loc;
17331 ProcessStatement(stmt->labeled.stmt);
17334 if(stmt->caseStmt.exp)
17336 FreeType(stmt->caseStmt.exp->destType);
17337 stmt->caseStmt.exp->destType = curSwitchType;
17339 curSwitchType->refCount++;
17340 ProcessExpressionType(stmt->caseStmt.exp);
17341 ComputeExpression(stmt->caseStmt.exp);
17343 if(stmt->caseStmt.stmt)
17344 ProcessStatement(stmt->caseStmt.stmt);
17348 if(stmt->compound.context)
17350 struct Declaration * decl;
17351 struct Statement * s;
17352 struct Statement * prevCompound = curCompound;
17353 struct Context * prevContext = curContext;
17355 if(!stmt->compound.isSwitch)
17356 curCompound = stmt;
17357 curContext = stmt->compound.context;
17358 if(stmt->compound.declarations)
17360 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
17361 ProcessDeclaration(decl);
17363 if(stmt->compound.statements)
17365 for(s = (*stmt->compound.statements).first; s; s = s->next)
17366 ProcessStatement(s);
17368 curContext = prevContext;
17369 curCompound = prevCompound;
17375 struct Expression * exp;
17377 if(stmt->expressions)
17379 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17380 ProcessExpressionType(exp);
17386 struct Expression * exp;
17388 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
17389 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
17390 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
17391 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
17393 ProcessExpressionType(exp);
17395 if(stmt->ifStmt.stmt)
17396 ProcessStatement(stmt->ifStmt.stmt);
17397 if(stmt->ifStmt.elseStmt)
17398 ProcessStatement(stmt->ifStmt.elseStmt);
17403 struct Type * oldSwitchType = curSwitchType;
17405 if(stmt->switchStmt.exp)
17407 struct Expression * exp;
17409 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
17413 ProcessExpressionType(exp);
17416 curSwitchType = exp->expType;
17419 ProcessStatement(stmt->switchStmt.stmt);
17420 curSwitchType = oldSwitchType;
17425 if(stmt->whileStmt.exp)
17427 struct Expression * exp;
17429 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
17430 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
17431 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
17432 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
17434 ProcessExpressionType(exp);
17437 if(stmt->whileStmt.stmt)
17438 ProcessStatement(stmt->whileStmt.stmt);
17443 if(stmt->doWhile.exp)
17445 struct Expression * exp;
17447 if((*stmt->doWhile.exp).last)
17449 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
17450 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
17451 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
17453 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
17455 ProcessExpressionType(exp);
17458 if(stmt->doWhile.stmt)
17459 ProcessStatement(stmt->doWhile.stmt);
17464 struct Expression * exp;
17466 if(stmt->forStmt.init)
17467 ProcessStatement(stmt->forStmt.init);
17468 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
17470 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
17471 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
17472 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
17474 if(stmt->forStmt.check)
17475 ProcessStatement(stmt->forStmt.check);
17476 if(stmt->forStmt.increment)
17478 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
17479 ProcessExpressionType(exp);
17481 if(stmt->forStmt.stmt)
17482 ProcessStatement(stmt->forStmt.stmt);
17487 struct Identifier * id = stmt->forEachStmt.id;
17488 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
17489 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
17490 struct Statement * block = stmt->forEachStmt.stmt;
17491 char iteratorType[1024];
17492 struct Type * source;
17493 struct Expression * e;
17494 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));
17495 struct Expression * arrayExp;
17496 char * typeString = (((void *)0));
17497 int builtinCount = 0;
17499 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
17503 FreeType(e->destType);
17504 e->destType = ProcessTypeString("Container", 0x0);
17506 if(!isBuiltin || e->next)
17507 ProcessExpressionType(e);
17509 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
17510 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
17512 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
17513 struct Symbol * symbol;
17514 struct Expression * expIt = (((void *)0));
17515 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
17516 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
17517 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
17518 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
17521 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
17522 stmt->compound.context->parent = curContext;
17523 curContext = stmt->compound.context;
17524 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
17526 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
17527 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
17529 isCustomAVLTree = 0x1;
17530 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
17532 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
17535 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
17537 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
17539 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
17542 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
17546 struct Declarator * decl;
17547 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17549 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
17550 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17551 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
17555 struct Type * type = (((void *)0));
17556 char typeStringBuf[1024];
17558 arrayExp = (((struct Expression *)(*exp).last)->type == 35) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
17559 if(((struct Expression *)(*exp).last)->type == 11)
17561 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
17564 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
17566 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)
17568 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
17570 typeString = templateClass->templateArgs[2].dataTypeString;
17572 else if(arrayExp->list)
17574 struct Expression * e;
17576 for(e = (*arrayExp->list).first; e; e = e->next)
17578 ProcessExpressionType(e);
17588 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17592 e->expType = (((void *)0));
17593 e = (*arrayExp->list).first;
17594 ProcessExpressionType(e);
17597 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17599 FreeType(e->expType);
17600 e->expType = (((void *)0));
17602 type = (((void *)0));
17610 FreeType(e->expType);
17611 e->expType = (((void *)0));
17617 typeStringBuf[0] = '\0';
17618 PrintType(type, typeStringBuf, 0x0, 0x1);
17619 typeString = typeStringBuf;
17625 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17626 struct Declarator * decl;
17627 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17631 struct Expression * e;
17633 builtinCount = (*arrayExp->list).count;
17634 type = ProcessTypeString(typeString, 0x0);
17635 while(e = (*arrayExp->list).first)
17637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17638 e->destType = type;
17640 ProcessExpressionType(e);
17641 ListAdd(initializers, MkInitializerAssignment(e));
17644 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17646 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17647 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17648 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17649 FreeList(exp, FreeExpression);
17653 arrayExp->expType = ProcessTypeString("Container", 0x0);
17654 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17657 else if(isLinkList && !isList)
17659 struct Declarator * decl;
17660 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17662 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17663 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17664 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17666 else if(_class->templateArgs)
17669 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17671 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17672 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17674 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17677 switch(block->type)
17680 if(block->compound.context)
17681 block->compound.context->parent = stmt->compound.context;
17684 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17685 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17686 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17687 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17690 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17691 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17694 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17695 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17698 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17699 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17702 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17703 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17706 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17707 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17713 block = MkIfStmt(filter, block, (((void *)0)));
17717 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));
17718 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17719 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17720 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17726 sprintf(count, "%d", builtinCount);
17727 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));
17728 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17729 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17730 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17732 else if(isLinkList && !isList)
17734 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17735 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17737 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17739 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));
17743 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17744 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17746 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpCast(MkTypeName(specs, decl), MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("GetNext")), MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("IteratorPointer")), (((void *)0))), MkExpIdentifier(CopyIdentifier(id)))))))), block));
17748 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17749 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17750 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17754 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17756 ProcessExpressionType(expIt);
17757 if((*stmt->compound.declarations).first)
17758 ProcessDeclaration((*stmt->compound.declarations).first);
17760 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17761 ProcessStatement(stmt);
17762 curContext = stmt->compound.context->parent;
17767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17779 struct Expression * exp;
17781 if(stmt->expressions)
17783 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17787 if(curFunction && !curFunction->type)
17788 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17789 FreeType(exp->destType);
17790 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17792 exp->destType->refCount++;
17794 ProcessExpressionType(exp);
17801 ProcessDeclaration(stmt->decl);
17806 struct AsmField * field;
17808 if(stmt->asmStmt.inputFields)
17810 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17811 if(field->expression)
17812 ProcessExpressionType(field->expression);
17814 if(stmt->asmStmt.outputFields)
17816 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17817 if(field->expression)
17818 ProcessExpressionType(field->expression);
17820 if(stmt->asmStmt.clobberedFields)
17822 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17824 if(field->expression)
17825 ProcessExpressionType(field->expression);
17832 struct PropertyWatch * propWatch;
17833 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17834 struct Expression * object = stmt->_watch.object;
17835 struct Expression * watcher = stmt->_watch.watcher;
17838 ProcessExpressionType(watcher);
17840 ProcessExpressionType(object);
17843 if(watcher || thisClass)
17845 struct External * external = curExternal;
17846 struct Context * context = curContext;
17849 stmt->expressions = MkList();
17850 curExternal = external->prev;
17851 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17853 struct ClassFunction * func;
17854 char watcherName[1024];
17855 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17856 struct External * createdExternal;
17857 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17860 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17861 if(propWatch->deleteWatch)
17862 strcat(watcherName, "_delete");
17865 struct Identifier * propID;
17867 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17869 strcat(watcherName, "_");
17870 strcat(watcherName, propID->string);
17873 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17875 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17876 ProcessClassFunctionBody(func, propWatch->compound);
17877 propWatch->compound = (((void *)0));
17878 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17879 createdExternal->symbol->idCode = external->symbol->idCode;
17880 curExternal = createdExternal;
17881 ProcessFunction(createdExternal->function);
17883 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17885 externalDecl->declaration = decl;
17886 if(decl->symbol && !decl->symbol->pointerExternal)
17887 decl->symbol->pointerExternal = externalDecl;
17889 if(propWatch->deleteWatch)
17891 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17893 ListAdd(args, CopyExpression(object));
17894 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17895 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17896 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17900 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17901 struct Identifier * propID;
17903 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17905 char propName[1024];
17906 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17910 char getName[1024], setName[1024];
17911 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17913 DeclareProperty(prop, setName, getName);
17914 strcpy(propName, "__ecereProp_");
17915 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17916 strcat(propName, "_");
17917 FullClassNameCat(propName, prop->name, 0x1);
17918 ListAdd(args, CopyExpression(object));
17919 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17920 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17921 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17922 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17925 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17930 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17932 curExternal = external;
17933 curContext = context;
17935 FreeExpression(watcher);
17937 FreeExpression(object);
17938 FreeList(watches, FreePropertyWatch);
17941 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17945 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17947 ProcessStatement(propWatch->compound);
17954 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17955 struct Expression * object = stmt->_watch.object;
17956 struct __ecereNameSpace__ecere__com__Class * _class;
17959 ProcessExpressionType(object);
17962 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17965 struct Identifier * propID;
17968 stmt->expressions = MkList();
17969 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17971 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17978 for(propID = (*watches).first; propID; propID = propID->next)
17980 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17984 CreateFireWatcher(prop, object, stmt);
17987 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17992 struct __ecereNameSpace__ecere__com__Property * prop;
17993 struct __ecereNameSpace__ecere__com__Class * base;
17995 for(base = _class; base; base = base->base)
17997 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17999 if(prop->isProperty && prop->isWatchable)
18001 CreateFireWatcher(prop, object, stmt);
18007 FreeExpression(object);
18008 FreeList(watches, FreeIdentifier);
18011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18017 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
18018 struct Expression * object = stmt->_watch.object;
18019 struct Expression * watcher = stmt->_watch.watcher;
18020 struct __ecereNameSpace__ecere__com__Class * _class;
18023 ProcessExpressionType(object);
18025 ProcessExpressionType(watcher);
18028 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
18029 if(watcher || thisClass)
18033 struct Identifier * propID;
18036 stmt->expressions = MkList();
18039 struct __ecereNameSpace__ecere__sys__OldList * args;
18042 ListAdd(args, CopyExpression(object));
18043 ListAdd(args, MkExpConstant("0"));
18044 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18045 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18049 for(propID = (*watches).first; propID; propID = propID->next)
18051 char propName[1024];
18052 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
18056 char getName[1024], setName[1024];
18057 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
18059 DeclareProperty(prop, setName, getName);
18060 strcpy(propName, "__ecereProp_");
18061 FullClassNameCat(propName, prop->_class->fullName, 0x0);
18062 strcat(propName, "_");
18063 FullClassNameCat(propName, prop->name, 0x1);
18064 MangleClassName(propName);
18065 ListAdd(args, CopyExpression(object));
18066 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
18067 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
18068 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
18071 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
18075 FreeExpression(object);
18077 FreeExpression(watcher);
18078 FreeList(watches, FreeIdentifier);
18081 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
18084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
18091 extern struct Expression * QBrackets(struct Expression * exp);
18093 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
18095 extern struct Declarator * QMkPtrDecl(char * id);
18097 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
18099 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
18101 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
18103 static void ProcessFunction(struct FunctionDefinition * function)
18105 struct Identifier * id = GetDeclId(function->declarator);
18106 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
18107 struct Type * type = symbol ? symbol->type : (((void *)0));
18108 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
18109 struct Context * oldTopContext = topContext;
18111 yylloc = function->loc;
18112 if(type && type->thisClass)
18114 struct Symbol * classSym = type->thisClass;
18115 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
18116 char className[1024];
18117 char structName[1024];
18118 struct Declarator * funcDecl;
18119 struct Symbol * thisSymbol;
18120 unsigned int typedObject = 0x0;
18122 if(_class && !_class->base)
18124 _class = currentClass;
18125 if(_class && !_class->symbol)
18126 _class->symbol = FindClass(_class->fullName);
18127 classSym = _class ? _class->symbol : (((void *)0));
18130 thisClass = _class;
18131 if(inCompiler && _class)
18133 if(type->kind == 11)
18135 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
18137 struct Type * param = symbol->type->params.first;
18139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
18142 if(type->classObjectType != 1)
18144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
18145 symbol->type->staticMethod = 0x1;
18146 symbol->type->thisClass = (((void *)0));
18147 symbol->type->extraParam = 0x0;
18150 strcpy(className, "__ecereClass_");
18151 FullClassNameCat(className, _class->fullName, 0x1);
18152 MangleClassName(className);
18153 structName[0] = (char)0;
18154 FullClassNameCat(structName, _class->fullName, 0x0);
18155 funcDecl = GetFuncDecl(function->declarator);
18158 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18160 struct TypeName * param = (*funcDecl->function.parameters).first;
18162 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18165 FreeTypeName(param);
18168 if(!function->propertyNoThis)
18170 struct TypeName * thisParam;
18172 if(type->classObjectType != 1)
18174 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18175 if(!funcDecl->function.parameters)
18176 funcDecl->function.parameters = MkList();
18177 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18181 if(type->classObjectType != 1)
18183 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
18184 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
18186 thisParam = __extension__ ({
18187 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
18189 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
18191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18195 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18197 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18199 funcDecl = GetFuncDecl(initDecl->declarator);
18202 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
18204 struct TypeName * param = (*funcDecl->function.parameters).first;
18206 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
18208 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
18209 FreeTypeName(param);
18212 if(type->classObjectType != 1)
18214 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
18216 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
18218 if(!funcDecl->function.parameters)
18219 funcDecl->function.parameters = MkList();
18220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
18228 if(type->classObjectType != 1)
18230 thisSymbol = __extension__ ({
18231 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18233 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
18235 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18236 if(typedObject && thisSymbol->type)
18238 thisSymbol->type->classObjectType = 2;
18239 thisSymbol->type->byReference = type->byReference;
18240 thisSymbol->type->typedByReference = type->byReference;
18244 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
18246 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
18249 struct __ecereNameSpace__ecere__com__Class * base;
18251 for(base = _class; base && base->type != 1000; base = base->next)
18253 for(member = base->membersAndProperties.first; member; member = member->next)
18254 if(!member->isProperty)
18260 for(member = _class->membersAndProperties.first; member; member = member->next)
18261 if(!member->isProperty)
18265 char pointerName[1024];
18266 struct Declaration * decl;
18267 struct Initializer * initializer;
18268 struct Expression * exp, * bytePtr;
18270 strcpy(pointerName, "__ecerePointer_");
18271 FullClassNameCat(pointerName, _class->fullName, 0x0);
18273 char className[1024];
18275 strcpy(className, "__ecereClass_");
18276 FullClassNameCat(className, classSym->string, 0x1);
18277 MangleClassName(className);
18278 DeclareClass(classSym, className);
18280 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
18285 sprintf(string, "%d", _class->offset);
18286 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
18290 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
18292 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
18293 exp->expType = __extension__ ({
18294 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18296 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
18297 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
18299 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
18300 }), __ecereInstance2;
18304 yylloc = function->body->loc;
18305 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
18307 struct Context * prevContext = curContext;
18309 curContext = function->body->compound.context;
18310 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
18311 curContext = prevContext;
18313 decl->symbol = (((void *)0));
18314 if(!function->body->compound.declarations)
18315 function->body->compound.declarations = MkList();
18316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
18322 thisClass = (((void *)0));
18325 FreeSpecifier(id->_class);
18326 id->_class = (((void *)0));
18327 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
18329 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
18331 id = GetDeclId(initDecl->declarator);
18332 FreeSpecifier(id->_class);
18333 id->_class = (((void *)0));
18337 topContext = function->body->compound.context;
18339 struct FunctionDefinition * oldFunction = curFunction;
18341 curFunction = function;
18343 ProcessStatement(function->body);
18344 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
18346 struct Statement * prevCompound = curCompound;
18347 struct Context * prevContext = curContext;
18348 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
18350 if(!function->body->compound.statements)
18351 function->body->compound.statements = MkList();
18352 ListAdd(function->body->compound.statements, fireWatchers);
18353 curCompound = function->body;
18354 curContext = function->body->compound.context;
18355 ProcessStatement(fireWatchers);
18356 curContext = prevContext;
18357 curCompound = prevCompound;
18359 curFunction = oldFunction;
18361 if(function->declarator)
18363 ProcessDeclarator(function->declarator);
18365 topContext = oldTopContext;
18366 thisClass = oldThisClass;
18369 extern void FreeSymbol(struct Symbol * symbol);
18371 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
18373 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
18375 struct ClassDef * def;
18376 struct External * external = curExternal;
18377 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
18379 for(def = definitions->first; def; def = def->next)
18383 if(def->function->declarator)
18384 curExternal = def->function->declarator->symbol->pointerExternal;
18386 curExternal = external;
18387 ProcessFunction((struct FunctionDefinition *)def->function);
18389 else if(def->type == 2)
18391 if(def->decl->type == 2)
18393 thisClass = regClass;
18394 ProcessInstantiationType(def->decl->inst);
18395 thisClass = (((void *)0));
18399 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
18402 thisClass = regClass;
18403 ProcessDeclaration(def->decl);
18404 thisClass = backThisClass;
18407 else if(def->type == 1 && def->defProperties)
18409 struct MemberInit * defProperty;
18410 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);
18412 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18413 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
18415 thisClass = regClass;
18416 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
18417 thisClass = (((void *)0));
18419 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18420 FreeSymbol(thisSymbol);
18422 else if(def->type == 3 && def->propertyDef)
18424 struct PropertyDef * prop = def->propertyDef;
18426 thisClass = regClass;
18431 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18433 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18435 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
18436 ProcessStatement(prop->setStmt);
18442 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18444 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18446 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
18447 ProcessStatement(prop->getStmt);
18449 if(prop->issetStmt)
18453 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
18455 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18457 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
18458 ProcessStatement(prop->issetStmt);
18460 thisClass = (((void *)0));
18462 else if(def->type == 4 && def->propertyWatch)
18464 struct PropertyWatch * propertyWatch = def->propertyWatch;
18466 thisClass = regClass;
18467 if(propertyWatch->compound)
18469 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);
18471 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
18472 curExternal = (((void *)0));
18473 ProcessStatement(propertyWatch->compound);
18475 thisClass = (((void *)0));
18480 void DeclareFunctionUtil(char * s)
18482 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
18489 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
18490 strcpy(name, "__ecereFunction_");
18491 FullClassNameCat(name, s, 0x0);
18492 DeclareFunction(function, name);
18496 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
18498 void ComputeDataTypes()
18500 struct External * external;
18501 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
18502 struct External * after = (((void *)0));
18504 currentClass = (((void *)0));
18505 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
18506 for(external = (*ast).first; external; external = external->next)
18508 if(external->type == 1)
18510 struct Declaration * decl = external->declaration;
18514 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
18518 struct InitDeclarator * initDecl = (*decls).first;
18522 struct Declarator * declarator = initDecl->declarator;
18524 if(declarator && declarator->type == 1)
18526 struct Identifier * id = declarator->identifier;
18528 if(id && id->string)
18530 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
18532 external->symbol->id = -1001, external->symbol->idCode = -1001;
18542 temp->symbol = __extension__ ({
18543 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
18545 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
18547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
18548 curExternal = temp;
18549 DeclareFunctionUtil("eSystem_New");
18550 DeclareFunctionUtil("eSystem_New0");
18551 DeclareFunctionUtil("eSystem_Renew");
18552 DeclareFunctionUtil("eSystem_Renew0");
18553 DeclareFunctionUtil("eSystem_Delete");
18554 DeclareFunctionUtil("eClass_GetProperty");
18555 DeclareFunctionUtil("eInstance_FireSelfWatchers");
18556 DeclareStruct("ecere::com::Class", 0x0);
18557 DeclareStruct("ecere::com::Instance", 0x0);
18558 DeclareStruct("ecere::com::Property", 0x0);
18559 DeclareStruct("ecere::com::DataMember", 0x0);
18560 DeclareStruct("ecere::com::Method", 0x0);
18561 DeclareStruct("ecere::com::SerialBuffer", 0x0);
18562 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
18563 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
18564 for(external = (*ast).first; external; external = external->next)
18566 afterExternal = curExternal = external;
18567 if(external->type == 0)
18569 currentClass = external->function->_class;
18570 ProcessFunction(external->function);
18572 else if(external->type == 1)
18574 currentClass = (((void *)0));
18575 if(external->declaration)
18576 ProcessDeclaration(external->declaration);
18578 else if(external->type == 2)
18580 struct ClassDefinition * _class = external->_class;
18582 currentClass = external->symbol->registered;
18583 if(_class->definitions)
18585 ProcessClass(_class->definitions, _class->symbol);
18589 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18590 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18593 else if(external->type == 4)
18595 thisNameSpace = external->id->string;
18598 currentClass = (((void *)0));
18599 thisNameSpace = (((void *)0));
18600 curExternal = (((void *)0));
18601 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18602 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18605 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);
18607 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);
18609 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18611 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18613 struct __ecereNameSpace__ecere__com__Class * class;
18615 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt", "bool GetOpInt(Operand op2, int * value2)", GetOpInt, module, 1);
18634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt", "bool GetOpUInt(Operand op2, uint * value2)", GetOpUInt, module, 1);
18636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpInt64", "bool GetOpInt64(Operand op2, int64 * value2)", GetOpInt64, module, 1);
18638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUInt64", "bool GetOpUInt64(Operand op2, uint64 * value2)", GetOpUInt64, module, 1);
18640 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntPtr", "bool GetOpIntPtr(Operand op2, intptr * value2)", GetOpIntPtr, module, 1);
18642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntPtr", "bool GetOpUIntPtr(Operand op2, uintptr * value2)", GetOpUIntPtr, module, 1);
18644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpIntSize", "bool GetOpIntSize(Operand op2, intsize * value2)", GetOpIntSize, module, 1);
18646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUIntSize", "bool GetOpUIntSize(Operand op2, uintsize * value2)", GetOpUIntSize, module, 1);
18648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpShort", "bool GetOpShort(Operand op2, short * value2)", GetOpShort, module, 1);
18650 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18651 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUShort", "bool GetOpUShort(Operand op2, uint16 * value2)", GetOpUShort, module, 1);
18652 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18653 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpChar", "bool GetOpChar(Operand op2, char * value2)", GetOpChar, module, 1);
18654 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpUChar", "bool GetOpUChar(Operand op2, byte * value2)", GetOpUChar, module, 1);
18656 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18657 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpFloat", "bool GetOpFloat(Operand op2, float * value2)", GetOpFloat, module, 1);
18658 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18659 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOpDouble", "bool GetOpDouble(Operand op2, double * value2)", GetOpDouble, module, 1);
18660 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18661 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18663 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18664 __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);
18665 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18668 __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);
18669 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18677 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18681 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18682 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18683 __ecereClass_Conversion = class;
18684 __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);
18685 __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);
18686 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18687 __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);
18688 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18689 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18690 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("UnescapeString", "int UnescapeString(char * d, char * s, int len)", UnescapeString, module, 1);
18691 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("OffsetEscapedString", "char * OffsetEscapedString(char * s, int len, int offset)", OffsetEscapedString, module, 1);
18692 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18693 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18694 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18695 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18696 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18697 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18698 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18699 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18700 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18701 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18702 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetParseError", "bool GetParseError(void)", GetParseError, module, 1);
18703 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18704 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18705 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18706 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18707 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18708 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18711 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)