2 typedef long long int64;
3 typedef unsigned long long uint64;
7 #elif defined(__TINYC__)
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
19 typedef long long int64;
20 typedef unsigned long long uint64;
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
26 #define __ENDIAN_PAD(x) (8 - (x))
28 #define __ENDIAN_PAD(x) 0
31 #include <sys/types.h>
33 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
39 #define arch_PointerSize sizeof(void *)
40 #define structSize_Instance (_64BIT ? 24 : 12)
41 #define structSize_Module (_64BIT ? 560 : 300)
42 #define structSize_NamedLink (_64BIT ? 32 : 16)
44 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
50 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
52 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
54 struct __ecereNameSpace__ecere__sys__BTNode;
56 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
58 struct __ecereNameSpace__ecere__sys__BinaryTree
60 struct __ecereNameSpace__ecere__sys__BTNode * root;
62 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
63 void (* FreeKey)(void * key);
64 } __attribute__ ((gcc_struct));
66 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
68 struct __ecereNameSpace__ecere__sys__OldList
75 } __attribute__ ((gcc_struct));
77 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
79 struct __ecereNameSpace__ecere__com__Method
82 struct __ecereNameSpace__ecere__com__Method * parent;
83 struct __ecereNameSpace__ecere__com__Method * left;
84 struct __ecereNameSpace__ecere__com__Method * right;
89 struct __ecereNameSpace__ecere__com__Class * _class;
91 char * dataTypeString;
92 struct Type * dataType;
94 } __attribute__ ((gcc_struct));
96 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
98 struct __ecereNameSpace__ecere__com__Property
100 struct __ecereNameSpace__ecere__com__Property * prev;
101 struct __ecereNameSpace__ecere__com__Property * next;
103 unsigned int isProperty;
106 struct __ecereNameSpace__ecere__com__Class * _class;
107 char * dataTypeString;
108 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
109 struct Type * dataType;
110 void (* Set)(void * , int);
111 int (* Get)(void * );
112 unsigned int (* IsSet)(void * );
116 unsigned int conversion;
117 unsigned int watcherOffset;
119 unsigned int compiled;
120 unsigned int selfWatchable;
121 unsigned int isWatchable;
122 } __attribute__ ((gcc_struct));
124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
131 unsigned int included;
132 } __attribute__ ((gcc_struct));
134 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138 struct CodePosition start;
139 struct CodePosition end;
140 } __attribute__ ((gcc_struct));
142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
155 struct Attrib * attr;
156 } __attribute__ ((gcc_struct));
157 } __attribute__ ((gcc_struct));
159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
161 struct ClassDefinition
163 struct ClassDefinition * prev;
164 struct ClassDefinition * next;
166 struct Specifier * _class;
167 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
168 struct __ecereNameSpace__ecere__sys__OldList * definitions;
169 struct Symbol * symbol;
170 struct Location blockStart;
171 struct Location nameLoc;
174 unsigned int deleteWatchable;
175 } __attribute__ ((gcc_struct));
177 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181 struct Context * parent;
182 struct __ecereNameSpace__ecere__sys__BinaryTree types;
183 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
184 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
185 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
189 struct ClassDefinition * classDef;
190 unsigned int templateTypesOnly;
191 unsigned int hasNameSpace;
192 } __attribute__ ((gcc_struct));
194 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198 struct Instantiation * prev;
199 struct Instantiation * next;
201 struct Specifier * _class;
202 struct Expression * exp;
203 struct __ecereNameSpace__ecere__sys__OldList * members;
204 struct Symbol * symbol;
205 unsigned int fullSet;
206 unsigned int isConstant;
207 unsigned char * data;
208 struct Location nameLoc;
209 struct Location insideLoc;
211 } __attribute__ ((gcc_struct));
213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217 struct Declaration * prev;
218 struct Declaration * next;
225 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
226 struct __ecereNameSpace__ecere__sys__OldList * declarators;
227 } __attribute__ ((gcc_struct));
228 struct Instantiation * inst;
231 struct Identifier * id;
232 struct Expression * exp;
233 } __attribute__ ((gcc_struct));
234 } __attribute__ ((gcc_struct));
235 struct Specifier * extStorage;
236 struct Symbol * symbol;
238 } __attribute__ ((gcc_struct));
240 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244 struct Statement * prev;
245 struct Statement * next;
250 struct __ecereNameSpace__ecere__sys__OldList * expressions;
253 struct Identifier * id;
254 struct Statement * stmt;
255 } __attribute__ ((gcc_struct)) labeled;
258 struct Expression * exp;
259 struct Statement * stmt;
260 } __attribute__ ((gcc_struct)) caseStmt;
263 struct __ecereNameSpace__ecere__sys__OldList * declarations;
264 struct __ecereNameSpace__ecere__sys__OldList * statements;
265 struct Context * context;
266 unsigned int isSwitch;
267 } __attribute__ ((gcc_struct)) compound;
270 struct __ecereNameSpace__ecere__sys__OldList * exp;
271 struct Statement * stmt;
272 struct Statement * elseStmt;
273 } __attribute__ ((gcc_struct)) ifStmt;
276 struct __ecereNameSpace__ecere__sys__OldList * exp;
277 struct Statement * stmt;
278 } __attribute__ ((gcc_struct)) switchStmt;
281 struct __ecereNameSpace__ecere__sys__OldList * exp;
282 struct Statement * stmt;
283 } __attribute__ ((gcc_struct)) whileStmt;
286 struct __ecereNameSpace__ecere__sys__OldList * exp;
287 struct Statement * stmt;
288 } __attribute__ ((gcc_struct)) doWhile;
291 struct Statement * init;
292 struct Statement * check;
293 struct __ecereNameSpace__ecere__sys__OldList * increment;
294 struct Statement * stmt;
295 } __attribute__ ((gcc_struct)) forStmt;
298 struct Identifier * id;
299 } __attribute__ ((gcc_struct)) gotoStmt;
302 struct Specifier * spec;
304 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
305 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
307 } __attribute__ ((gcc_struct)) asmStmt;
310 struct Expression * watcher;
311 struct Expression * object;
312 struct __ecereNameSpace__ecere__sys__OldList * watches;
313 } __attribute__ ((gcc_struct)) _watch;
316 struct Identifier * id;
317 struct __ecereNameSpace__ecere__sys__OldList * exp;
318 struct __ecereNameSpace__ecere__sys__OldList * filter;
319 struct Statement * stmt;
320 } __attribute__ ((gcc_struct)) forEachStmt;
321 struct Declaration * decl;
322 } __attribute__ ((gcc_struct));
323 } __attribute__ ((gcc_struct));
325 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329 struct TypeName * prev;
330 struct TypeName * next;
332 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
333 struct Declarator * declarator;
335 struct Expression * bitCount;
336 } __attribute__ ((gcc_struct));
338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342 struct Initializer * prev;
343 struct Initializer * next;
348 struct Expression * exp;
349 struct __ecereNameSpace__ecere__sys__OldList * list;
350 } __attribute__ ((gcc_struct));
351 unsigned int isConstant;
352 } __attribute__ ((gcc_struct));
354 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
356 struct __ecereNameSpace__ecere__com__DataValue
371 } __attribute__ ((gcc_struct));
372 } __attribute__ ((gcc_struct));
374 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
378 struct Expression * prev;
379 struct Expression * next;
387 struct Identifier * identifier;
388 } __attribute__ ((gcc_struct));
389 struct Statement * compound;
390 struct Instantiation * instance;
392 struct __ecereNameSpace__ecere__sys__OldList * list;
395 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
396 struct Declarator * decl;
397 } __attribute__ ((gcc_struct)) _classExp;
400 struct Identifier * id;
401 } __attribute__ ((gcc_struct)) classData;
404 struct Expression * exp;
405 struct __ecereNameSpace__ecere__sys__OldList * arguments;
406 struct Location argLoc;
407 } __attribute__ ((gcc_struct)) call;
410 struct Expression * exp;
411 struct __ecereNameSpace__ecere__sys__OldList * index;
412 } __attribute__ ((gcc_struct)) index;
415 struct Expression * exp;
416 struct Identifier * member;
418 unsigned int thisPtr;
419 } __attribute__ ((gcc_struct)) member;
423 struct Expression * exp1;
424 struct Expression * exp2;
425 } __attribute__ ((gcc_struct)) op;
426 struct TypeName * typeName;
427 struct Specifier * _class;
430 struct TypeName * typeName;
431 struct Expression * exp;
432 } __attribute__ ((gcc_struct)) cast;
435 struct Expression * cond;
436 struct __ecereNameSpace__ecere__sys__OldList * exp;
437 struct Expression * elseExp;
438 } __attribute__ ((gcc_struct)) cond;
441 struct TypeName * typeName;
442 struct Expression * size;
443 } __attribute__ ((gcc_struct)) _new;
446 struct TypeName * typeName;
447 struct Expression * size;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) _renew;
453 struct Identifier * id;
454 } __attribute__ ((gcc_struct)) db;
457 struct Expression * ds;
458 struct Expression * name;
459 } __attribute__ ((gcc_struct)) dbopen;
462 struct TypeName * typeName;
463 struct Initializer * initializer;
464 } __attribute__ ((gcc_struct)) initializer;
467 struct Expression * exp;
468 struct TypeName * typeName;
469 } __attribute__ ((gcc_struct)) vaArg;
470 } __attribute__ ((gcc_struct));
471 unsigned int debugValue;
472 struct __ecereNameSpace__ecere__com__DataValue val;
474 unsigned int hasAddress;
475 struct Type * expType;
476 struct Type * destType;
479 unsigned int byReference;
480 unsigned int isConstant;
481 unsigned int addedThis;
482 unsigned int needCast;
483 unsigned int thisPtr;
484 } __attribute__ ((gcc_struct));
486 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
488 struct TemplateDatatype
490 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
491 struct Declarator * decl;
492 } __attribute__ ((gcc_struct));
494 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
496 struct TemplateArgument;
498 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
500 struct TemplateParameter
502 struct TemplateParameter * prev;
503 struct TemplateParameter * next;
506 struct Identifier * identifier;
509 struct TemplateDatatype * dataType;
511 } __attribute__ ((gcc_struct));
512 struct TemplateArgument * defaultArgument;
513 char * dataTypeString;
514 struct Type * baseType;
515 } __attribute__ ((gcc_struct));
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
521 struct Specifier * prev;
522 struct Specifier * next;
530 struct ExtDecl * extDecl;
532 struct Symbol * symbol;
533 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
534 } __attribute__ ((gcc_struct));
537 struct Identifier * id;
538 struct __ecereNameSpace__ecere__sys__OldList * list;
539 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
540 struct __ecereNameSpace__ecere__sys__OldList * definitions;
541 unsigned int addNameSpace;
542 struct Context * ctx;
543 struct ExtDecl * extDeclStruct;
544 } __attribute__ ((gcc_struct));
545 struct Expression * expression;
546 struct Specifier * _class;
547 struct TemplateParameter * templateParameter;
548 } __attribute__ ((gcc_struct));
549 } __attribute__ ((gcc_struct));
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
555 struct Identifier * prev;
556 struct Identifier * next;
558 struct Symbol * classSym;
559 struct Specifier * _class;
561 struct Identifier * badID;
562 } __attribute__ ((gcc_struct));
564 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
568 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
572 struct Declarator * prev;
573 struct Declarator * next;
576 struct Symbol * symbol;
577 struct Declarator * declarator;
580 struct Identifier * identifier;
583 struct Expression * exp;
584 struct Expression * posExp;
585 struct Attrib * attrib;
586 } __attribute__ ((gcc_struct)) structDecl;
589 struct Expression * exp;
590 struct Specifier * enumClass;
591 } __attribute__ ((gcc_struct)) array;
594 struct __ecereNameSpace__ecere__sys__OldList * parameters;
595 } __attribute__ ((gcc_struct)) function;
598 struct Pointer * pointer;
599 } __attribute__ ((gcc_struct)) pointer;
602 struct ExtDecl * extended;
603 } __attribute__ ((gcc_struct)) extended;
604 } __attribute__ ((gcc_struct));
605 } __attribute__ ((gcc_struct));
607 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
609 struct FunctionDefinition
611 struct FunctionDefinition * prev;
612 struct FunctionDefinition * next;
614 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
615 struct Declarator * declarator;
616 struct __ecereNameSpace__ecere__sys__OldList * declarations;
617 struct Statement * body;
618 struct __ecereNameSpace__ecere__com__Class * _class;
619 struct __ecereNameSpace__ecere__sys__OldList attached;
622 struct Symbol * propSet;
624 unsigned int propertyNoThis;
625 } __attribute__ ((gcc_struct));
627 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
631 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
635 struct External * prev;
636 struct External * next;
639 struct Symbol * symbol;
642 struct FunctionDefinition * function;
643 struct ClassDefinition * _class;
644 struct Declaration * declaration;
646 struct Identifier * id;
647 struct DBTableDef * table;
648 } __attribute__ ((gcc_struct));
650 } __attribute__ ((gcc_struct));
652 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
656 struct ModuleImport * prev;
657 struct ModuleImport * next;
659 struct __ecereNameSpace__ecere__sys__OldList classes;
660 struct __ecereNameSpace__ecere__sys__OldList functions;
663 } __attribute__ ((gcc_struct));
665 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
669 struct ClassImport * prev;
670 struct ClassImport * next;
672 struct __ecereNameSpace__ecere__sys__OldList methods;
673 struct __ecereNameSpace__ecere__sys__OldList properties;
675 unsigned int isRemote;
676 } __attribute__ ((gcc_struct));
678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
683 struct Symbol * parent;
684 struct Symbol * left;
685 struct Symbol * right;
690 struct __ecereNameSpace__ecere__com__Method * method;
691 struct __ecereNameSpace__ecere__com__Property * _property;
692 struct __ecereNameSpace__ecere__com__Class * registered;
693 } __attribute__ ((gcc_struct));
700 struct External * pointerExternal;
701 struct External * structExternal;
702 } __attribute__ ((gcc_struct));
705 struct External * externalGet;
706 struct External * externalSet;
707 struct External * externalPtr;
708 struct External * externalIsSet;
709 } __attribute__ ((gcc_struct));
712 struct External * methodExternal;
713 struct External * methodCodeExternal;
714 } __attribute__ ((gcc_struct));
715 } __attribute__ ((gcc_struct));
716 unsigned int imported;
717 unsigned int declaredStructSym;
718 struct __ecereNameSpace__ecere__com__Class * _class;
719 unsigned int declaredStruct;
720 unsigned int needConstructor;
721 unsigned int needDestructor;
722 char * constructorName;
725 char * destructorName;
726 struct ModuleImport * module;
727 struct ClassImport * _import;
728 struct Location nameLoc;
729 unsigned int isParam;
730 unsigned int isRemote;
731 unsigned int isStruct;
732 unsigned int fireWatchersDone;
734 unsigned int classData;
735 unsigned int isStatic;
737 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
738 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
739 struct Context * ctx;
741 struct Expression * propCategory;
742 } __attribute__ ((gcc_struct));
744 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
753 struct Symbol * _class;
756 struct __ecereNameSpace__ecere__sys__OldList members;
758 } __attribute__ ((gcc_struct));
761 struct Type * returnType;
762 struct __ecereNameSpace__ecere__sys__OldList params;
763 struct Symbol * thisClass;
764 unsigned int staticMethod;
765 struct TemplateParameter * thisClassTemplate;
766 } __attribute__ ((gcc_struct));
769 struct __ecereNameSpace__ecere__com__Method * method;
770 struct __ecereNameSpace__ecere__com__Class * methodClass;
771 struct __ecereNameSpace__ecere__com__Class * usedClass;
772 } __attribute__ ((gcc_struct));
775 struct Type * arrayType;
777 struct Expression * arraySizeExp;
778 unsigned int freeExp;
779 struct Symbol * enumClass;
780 } __attribute__ ((gcc_struct));
782 struct TemplateParameter * templateParameter;
783 } __attribute__ ((gcc_struct));
793 unsigned int isSigned : 1;
794 unsigned int constant : 1;
795 unsigned int truth : 1;
796 unsigned int byReference : 1;
797 unsigned int extraParam : 1;
798 unsigned int directClassAccess : 1;
799 unsigned int computing : 1;
800 unsigned int keepCast : 1;
801 unsigned int passAsTemplate : 1;
802 unsigned int dllExport : 1;
803 unsigned int attrStdcall : 1;
804 } __attribute__ ((gcc_struct));
806 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
808 struct __ecereNameSpace__ecere__com__Class
810 struct __ecereNameSpace__ecere__com__Class * prev;
811 struct __ecereNameSpace__ecere__com__Class * next;
817 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
818 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 struct __ecereNameSpace__ecere__com__Class * base;
822 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
823 struct __ecereNameSpace__ecere__sys__BinaryTree members;
824 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
825 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
826 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
827 struct __ecereNameSpace__ecere__sys__OldList derivatives;
831 struct __ecereNameSpace__ecere__com__Instance * module;
832 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
833 char * dataTypeString;
834 struct Type * dataType;
836 int defaultAlignment;
837 void (* Initialize)();
839 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
840 char * designerClass;
841 unsigned int noExpansion;
842 char * defaultProperty;
843 unsigned int comRedefinition;
845 unsigned int isRemote;
846 unsigned int internalDecl;
848 unsigned int computeSize;
850 int destructionWatchOffset;
852 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
853 int inheritanceAccess;
856 struct __ecereNameSpace__ecere__sys__OldList conversions;
857 struct __ecereNameSpace__ecere__sys__OldList templateParams;
858 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
859 struct __ecereNameSpace__ecere__com__Class * templateClass;
860 struct __ecereNameSpace__ecere__sys__OldList templatized;
862 } __attribute__ ((gcc_struct));
864 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
866 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
868 struct __ecereNameSpace__ecere__com__Instance
871 struct __ecereNameSpace__ecere__com__Class * _class;
873 } __attribute__ ((gcc_struct));
875 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
877 struct __ecereNameSpace__ecere__com__DataMember
879 struct __ecereNameSpace__ecere__com__DataMember * prev;
880 struct __ecereNameSpace__ecere__com__DataMember * next;
882 unsigned int isProperty;
885 struct __ecereNameSpace__ecere__com__Class * _class;
886 char * dataTypeString;
887 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
888 struct Type * dataType;
892 struct __ecereNameSpace__ecere__sys__OldList members;
893 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
896 } __attribute__ ((gcc_struct));
898 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
900 struct __ecereNameSpace__ecere__com__SerialBuffer
902 unsigned char * _buffer;
906 } __attribute__ ((gcc_struct));
908 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
910 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
916 char * dataTypeString;
917 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
918 } __attribute__ ((gcc_struct));
919 struct __ecereNameSpace__ecere__com__DataValue expression;
925 struct __ecereNameSpace__ecere__com__DataMember * member;
926 struct __ecereNameSpace__ecere__com__Property * prop;
927 struct __ecereNameSpace__ecere__com__Method * method;
928 } __attribute__ ((gcc_struct));
929 } __attribute__ ((gcc_struct));
930 } __attribute__ ((gcc_struct));
931 } __attribute__ ((gcc_struct));
933 void exit(int status);
935 void * calloc(size_t nmemb, size_t size);
937 void free(void * ptr);
939 void * malloc(size_t size);
941 void * realloc(void * ptr, size_t size);
943 long int strtol(const char * nptr, char ** endptr, int base);
945 long long int strtoll(const char * nptr, char ** endptr, int base);
947 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
951 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
954 typedef union YYSTYPE
959 struct Identifier * id;
960 struct Expression * exp;
961 struct Specifier * specifier;
962 struct __ecereNameSpace__ecere__sys__OldList * list;
963 struct Enumerator * enumerator;
964 struct Declarator * declarator;
965 struct Pointer * pointer;
966 struct Initializer * initializer;
967 struct InitDeclarator * initDeclarator;
968 struct TypeName * typeName;
969 struct Declaration * declaration;
970 struct Statement * stmt;
971 struct FunctionDefinition * function;
972 struct External * external;
973 struct Context * context;
974 struct AsmField * asmField;
975 struct Attrib * attrib;
976 struct ExtDecl * extDecl;
977 struct Attribute * attribute;
978 struct Instantiation * instance;
979 struct MembersInit * membersInit;
980 struct MemberInit * memberInit;
981 struct ClassFunction * classFunction;
982 struct ClassDefinition * _class;
983 struct ClassDef * classDef;
984 struct PropertyDef * prop;
986 struct Symbol * symbol;
987 struct PropertyWatch * propertyWatch;
988 struct TemplateParameter * templateParameter;
989 struct TemplateArgument * templateArgument;
990 struct TemplateDatatype * templateDatatype;
991 struct DBTableEntry * dbtableEntry;
992 struct DBIndexItem * dbindexItem;
993 struct DBTableDef * dbtableDef;
994 } __attribute__ ((gcc_struct)) YYSTYPE;
996 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1000 struct Enumerator * prev;
1001 struct Enumerator * next;
1002 struct Location loc;
1003 struct Identifier * id;
1004 struct Expression * exp;
1005 } __attribute__ ((gcc_struct));
1007 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1009 struct InitDeclarator
1011 struct InitDeclarator * prev;
1012 struct InitDeclarator * next;
1013 struct Location loc;
1014 struct Declarator * declarator;
1015 struct Initializer * initializer;
1016 } __attribute__ ((gcc_struct));
1018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1022 struct AsmField * prev;
1023 struct AsmField * next;
1024 struct Location loc;
1026 struct Expression * expression;
1027 } __attribute__ ((gcc_struct));
1029 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1035 struct ClassFunction
1037 struct ClassFunction * prev;
1038 struct ClassFunction * next;
1039 struct Location loc;
1040 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1041 struct Declarator * declarator;
1042 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1043 struct Statement * body;
1044 struct __ecereNameSpace__ecere__com__Class * _class;
1045 struct __ecereNameSpace__ecere__sys__OldList attached;
1048 struct Symbol * propSet;
1049 unsigned int isVirtual;
1050 unsigned int isConstructor;
1051 unsigned int isDestructor;
1052 unsigned int dontMangle;
1055 } __attribute__ ((gcc_struct));
1057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1061 struct MembersInit * prev;
1062 struct MembersInit * next;
1063 struct Location loc;
1067 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1068 struct ClassFunction * function;
1069 } __attribute__ ((gcc_struct));
1070 } __attribute__ ((gcc_struct));
1072 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1076 struct MemberInit * prev;
1077 struct MemberInit * next;
1078 struct Location loc;
1079 struct Location realLoc;
1080 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1081 struct Initializer * initializer;
1083 unsigned int variable;
1084 unsigned int takeOutExp;
1085 } __attribute__ ((gcc_struct));
1087 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1091 struct PropertyDef * prev;
1092 struct PropertyDef * next;
1093 struct Location loc;
1094 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1095 struct Declarator * declarator;
1096 struct Identifier * id;
1097 struct Statement * getStmt;
1098 struct Statement * setStmt;
1099 struct Statement * issetStmt;
1100 struct Symbol * symbol;
1101 unsigned int conversion;
1102 unsigned int isWatchable;
1103 struct Expression * category;
1104 } __attribute__ ((gcc_struct));
1106 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1108 struct PropertyWatch
1110 struct PropertyWatch * prev;
1111 struct PropertyWatch * next;
1112 struct Location loc;
1113 struct Statement * compound;
1114 struct __ecereNameSpace__ecere__sys__OldList * properties;
1115 unsigned int deleteWatch;
1116 } __attribute__ ((gcc_struct));
1118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1122 struct ClassDef * prev;
1123 struct ClassDef * next;
1124 struct Location loc;
1128 struct Declaration * decl;
1129 struct ClassFunction * function;
1130 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1131 struct PropertyDef * propertyDef;
1132 struct PropertyWatch * propertyWatch;
1134 struct Identifier * defaultProperty;
1137 struct Identifier * id;
1138 struct Initializer * initializer;
1139 } __attribute__ ((gcc_struct));
1140 } __attribute__ ((gcc_struct));
1143 } __attribute__ ((gcc_struct));
1145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1147 struct DBTableEntry;
1149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1153 extern YYSTYPE yylval;
1155 extern struct Location yylloc;
1157 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1159 extern int returnCode;
1161 extern struct Expression * parsedExpression;
1163 extern unsigned int yydebug;
1165 void SetYydebug(unsigned int b)
1170 extern unsigned int echoOn;
1172 void resetScanner();
1176 int expression_yyparse();
1178 static struct Statement * curCompound;
1180 struct External * curExternal, * afterExternal;
1182 static struct Type * curSwitchType;
1184 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1186 struct __ecereNameSpace__ecere__com__Class * thisClass;
1188 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1193 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1198 static char * thisNameSpace;
1200 struct __ecereNameSpace__ecere__com__Class * containerClass;
1202 unsigned int thisClassParams = 0x1;
1204 unsigned int internalValueCounter;
1206 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1208 extern size_t strlen(const char * );
1210 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1212 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1214 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1216 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1218 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1220 void PrintExpression(struct Expression * exp, char * string)
1223 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1227 OutputExpression(exp, f);
1228 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1229 count = strlen(string);
1230 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1231 string[count] = '\0';
1232 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1236 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1238 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1240 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1242 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1244 if(!param->baseType)
1246 if(param->dataTypeString)
1247 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1249 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1251 return param->baseType;
1253 return (((void *)0));
1256 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1258 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1260 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1264 if(type1->kind == type2->kind)
1274 if(type1->passAsTemplate && !type2->passAsTemplate)
1276 return type1->isSigned != type2->isSigned;
1278 return type1->_class != type2->_class;
1280 return NeedCast(type1->type, type2->type);
1288 extern int strcmp(const char * , const char * );
1290 extern struct Context * curContext;
1292 extern struct Context * topContext;
1294 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1296 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);
1298 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1300 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);
1302 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);
1304 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1306 struct __ecereNameSpace__ecere__com__ClassProperty
1309 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1310 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1311 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1313 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1314 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1315 char * dataTypeString;
1316 struct Type * dataType;
1317 unsigned int constant;
1318 } __attribute__ ((gcc_struct));
1320 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1322 extern struct Expression * QMkExpId(char * id);
1324 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1326 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1328 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1329 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1334 char * dataTypeString;
1336 } __attribute__ ((gcc_struct));
1337 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1339 } __attribute__ ((gcc_struct));
1341 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1343 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1345 extern void FreeIdentifier(struct Identifier * id);
1347 void ProcessExpressionType(struct Expression * exp);
1349 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1351 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1353 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1355 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1357 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1359 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1361 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1363 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1365 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1367 if(exp->type == 0 && exp->identifier)
1369 struct Identifier * id = exp->identifier;
1370 struct Context * ctx;
1371 struct Symbol * symbol = (((void *)0));
1373 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1375 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1377 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1382 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1384 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1385 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1386 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1387 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1391 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1393 if(!prop && !method)
1394 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1395 if(!prop && !method && !member)
1397 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1399 if(prop || method || member || classProp)
1402 exp->member.member = id;
1403 exp->member.memberType = 0;
1404 exp->member.exp = QMkExpId("this");
1405 exp->addedThis = 0x1;
1407 else if(_class && _class->templateParams.first)
1409 struct __ecereNameSpace__ecere__com__Class * sClass;
1411 for(sClass = _class; sClass; sClass = sClass->base)
1413 if(sClass->templateParams.first)
1415 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1417 for(param = sClass->templateParams.first; param; param = param->next)
1419 if(param->type == 2 && !strcmp(param->name, id->string))
1421 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1425 struct Declarator * decl;
1426 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1428 FreeIdentifier(exp->member.member);
1429 ProcessExpressionType(argExp);
1430 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1431 exp->expType = ProcessType(specs, decl);
1433 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1444 extern int sprintf(char * , char * , ...);
1446 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1448 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1450 char * PrintInt(long long result)
1454 if(result > (((long long)0x7fffffffffffffffLL)))
1455 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1457 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1458 return __ecereNameSpace__ecere__sys__CopyString(temp);
1461 char * PrintUInt(uint64 result)
1465 if(result > (0xffffffff))
1466 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1467 else if(result > (((int)0x7fffffff)))
1468 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1471 return __ecereNameSpace__ecere__sys__CopyString(temp);
1474 char * PrintInt64(long long result)
1478 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1479 return __ecereNameSpace__ecere__sys__CopyString(temp);
1482 char * PrintUInt64(uint64 result)
1486 if(result > (((long long)0x7fffffffffffffffLL)))
1487 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1489 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1490 return __ecereNameSpace__ecere__sys__CopyString(temp);
1493 char * PrintHexUInt(uint64 result)
1497 if(result > (0xffffffff))
1498 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1500 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1501 return __ecereNameSpace__ecere__sys__CopyString(temp);
1504 char * PrintHexUInt64(uint64 result)
1508 if(result > (0xffffffff))
1509 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1511 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1512 return __ecereNameSpace__ecere__sys__CopyString(temp);
1515 char * PrintShort(short result)
1519 sprintf(temp, "%d", (unsigned short)result);
1520 return __ecereNameSpace__ecere__sys__CopyString(temp);
1523 char * PrintUShort(unsigned short result)
1527 if(result > (unsigned short)32767)
1528 sprintf(temp, "0x%X", (int)result);
1530 sprintf(temp, "%d", (int)result);
1531 return __ecereNameSpace__ecere__sys__CopyString(temp);
1534 extern int isprint(int c);
1536 char * PrintChar(char result)
1540 if(result > (char)0 && isprint(result))
1541 sprintf(temp, "'%c'", result);
1542 else if(result < (char)0)
1543 sprintf(temp, "%d", (int)result);
1545 sprintf(temp, "0x%X", (unsigned char)result);
1546 return __ecereNameSpace__ecere__sys__CopyString(temp);
1549 char * PrintUChar(unsigned char result)
1553 sprintf(temp, "0x%X", result);
1554 return __ecereNameSpace__ecere__sys__CopyString(temp);
1557 char * PrintFloat(float result)
1561 sprintf(temp, "%.16ff", result);
1562 return __ecereNameSpace__ecere__sys__CopyString(temp);
1565 char * PrintDouble(double result)
1569 sprintf(temp, "%.16f", result);
1570 return __ecereNameSpace__ecere__sys__CopyString(temp);
1573 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1577 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1578 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1579 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1580 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1581 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1582 unsigned int (* Neg)(struct Expression *, struct Operand *);
1583 unsigned int (* Inc)(struct Expression *, struct Operand *);
1584 unsigned int (* Dec)(struct Expression *, struct Operand *);
1585 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1586 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1587 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1597 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* Not)(struct Expression *, struct Operand *);
1603 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1612 } __attribute__ ((gcc_struct));
1614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1620 unsigned int ptrSize;
1633 } __attribute__ ((gcc_struct));
1635 } __attribute__ ((gcc_struct));
1637 struct Operand GetOperand(struct Expression * exp);
1639 unsigned int GetInt(struct Expression * exp, int * value2)
1641 struct Operand op2 = GetOperand(exp);
1643 if(op2.kind == 3 && op2.type->isSigned)
1645 else if(op2.kind == 3)
1646 *value2 = (int)op2.ui;
1647 else if(op2.kind == 4 && op2.type->isSigned)
1648 *value2 = (int)op2.i64;
1649 else if(op2.kind == 4)
1650 *value2 = (int)op2.ui64;
1651 else if(op2.kind == 23 && op2.type->isSigned)
1652 *value2 = (int)op2.i64;
1653 else if(op2.kind == 23)
1654 *value2 = (int)op2.ui64;
1655 else if(op2.kind == 22 && op2.type->isSigned)
1656 *value2 = (int)op2.i64;
1657 else if(op2.kind == 22)
1658 *value2 = (int)op2.ui64;
1659 else if(op2.kind == 2 && op2.type->isSigned)
1660 *value2 = (int)op2.s;
1661 else if(op2.kind == 2)
1662 *value2 = (int)op2.us;
1663 else if(op2.kind == 1 && op2.type->isSigned)
1664 *value2 = (int)op2.c;
1665 else if(op2.kind == 1)
1666 *value2 = (int)op2.uc;
1667 else if(op2.kind == 6)
1668 *value2 = (int)op2.f;
1669 else if(op2.kind == 7)
1670 *value2 = (int)op2.d;
1671 else if(op2.kind == 13)
1672 *value2 = (int)op2.ui64;
1678 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1680 struct Operand op2 = GetOperand(exp);
1682 if(op2.kind == 3 && op2.type->isSigned)
1683 *value2 = (unsigned int)op2.i;
1684 else if(op2.kind == 3)
1686 else if(op2.kind == 4 && op2.type->isSigned)
1687 *value2 = (unsigned int)op2.i64;
1688 else if(op2.kind == 4)
1689 *value2 = (unsigned int)op2.ui64;
1690 else if(op2.kind == 23 && op2.type->isSigned)
1691 *value2 = (unsigned int)op2.i64;
1692 else if(op2.kind == 23)
1693 *value2 = (unsigned int)op2.ui64;
1694 else if(op2.kind == 22 && op2.type->isSigned)
1695 *value2 = (unsigned int)op2.i64;
1696 else if(op2.kind == 22)
1697 *value2 = (unsigned int)op2.ui64;
1698 else if(op2.kind == 2 && op2.type->isSigned)
1699 *value2 = (unsigned int)op2.s;
1700 else if(op2.kind == 2)
1701 *value2 = (unsigned int)op2.us;
1702 else if(op2.kind == 1 && op2.type->isSigned)
1703 *value2 = (unsigned int)op2.c;
1704 else if(op2.kind == 1)
1705 *value2 = (unsigned int)op2.uc;
1706 else if(op2.kind == 6)
1707 *value2 = (unsigned int)op2.f;
1708 else if(op2.kind == 7)
1709 *value2 = (unsigned int)op2.d;
1710 else if(op2.kind == 13)
1711 *value2 = (unsigned int)op2.ui64;
1717 unsigned int GetInt64(struct Expression * exp, long long * value2)
1719 struct Operand op2 = GetOperand(exp);
1721 if(op2.kind == 3 && op2.type->isSigned)
1722 *value2 = (long long)op2.i;
1723 else if(op2.kind == 3)
1724 *value2 = (long long)op2.ui;
1725 else if(op2.kind == 4 && op2.type->isSigned)
1727 else if(op2.kind == 4)
1728 *value2 = (long long)op2.ui64;
1729 else if(op2.kind == 23 && op2.type->isSigned)
1731 else if(op2.kind == 23)
1732 *value2 = (long long)op2.ui64;
1733 else if(op2.kind == 22 && op2.type->isSigned)
1735 else if(op2.kind == 22)
1736 *value2 = (long long)op2.ui64;
1737 else if(op2.kind == 2 && op2.type->isSigned)
1738 *value2 = (long long)op2.s;
1739 else if(op2.kind == 2)
1740 *value2 = (long long)op2.us;
1741 else if(op2.kind == 1 && op2.type->isSigned)
1742 *value2 = (long long)op2.c;
1743 else if(op2.kind == 1)
1744 *value2 = (long long)op2.uc;
1745 else if(op2.kind == 6)
1746 *value2 = (long long)op2.f;
1747 else if(op2.kind == 7)
1748 *value2 = (long long)op2.d;
1749 else if(op2.kind == 13)
1750 *value2 = (long long)op2.ui64;
1756 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1758 struct Operand op2 = GetOperand(exp);
1760 if(op2.kind == 3 && op2.type->isSigned)
1761 *value2 = (uint64)op2.i;
1762 else if(op2.kind == 3)
1763 *value2 = (uint64)op2.ui;
1764 else if(op2.kind == 4 && op2.type->isSigned)
1765 *value2 = (uint64)op2.i64;
1766 else if(op2.kind == 4)
1768 else if(op2.kind == 23 && op2.type->isSigned)
1769 *value2 = (uint64)op2.i64;
1770 else if(op2.kind == 23)
1772 else if(op2.kind == 22 && op2.type->isSigned)
1773 *value2 = (uint64)op2.i64;
1774 else if(op2.kind == 22)
1776 else if(op2.kind == 2 && op2.type->isSigned)
1777 *value2 = (uint64)op2.s;
1778 else if(op2.kind == 2)
1779 *value2 = (uint64)op2.us;
1780 else if(op2.kind == 1 && op2.type->isSigned)
1781 *value2 = (uint64)op2.c;
1782 else if(op2.kind == 1)
1783 *value2 = (uint64)op2.uc;
1784 else if(op2.kind == 6)
1785 *value2 = (uint64)op2.f;
1786 else if(op2.kind == 7)
1787 *value2 = (uint64)op2.d;
1788 else if(op2.kind == 13)
1795 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1797 struct Operand op2 = GetOperand(exp);
1799 if(op2.kind == 3 && op2.type->isSigned)
1800 *value2 = (intptr_t)op2.i;
1801 else if(op2.kind == 3)
1802 *value2 = (intptr_t)op2.ui;
1803 else if(op2.kind == 4 && op2.type->isSigned)
1804 *value2 = (intptr_t)op2.i64;
1805 else if(op2.kind == 4)
1806 *value2 = (intptr_t)op2.ui64;
1807 else if(op2.kind == 23 && op2.type->isSigned)
1808 *value2 = (intptr_t)op2.i64;
1809 else if(op2.kind == 23)
1810 *value2 = (intptr_t)op2.ui64;
1811 else if(op2.kind == 22 && op2.type->isSigned)
1812 *value2 = (intptr_t)op2.i64;
1813 else if(op2.kind == 22)
1814 *value2 = (intptr_t)op2.ui64;
1815 else if(op2.kind == 2 && op2.type->isSigned)
1816 *value2 = (intptr_t)op2.s;
1817 else if(op2.kind == 2)
1818 *value2 = (intptr_t)op2.us;
1819 else if(op2.kind == 1 && op2.type->isSigned)
1820 *value2 = (intptr_t)op2.c;
1821 else if(op2.kind == 1)
1822 *value2 = (intptr_t)op2.uc;
1823 else if(op2.kind == 6)
1824 *value2 = (intptr_t)op2.f;
1825 else if(op2.kind == 7)
1826 *value2 = (intptr_t)op2.d;
1827 else if(op2.kind == 13)
1828 *value2 = (intptr_t)op2.ui64;
1834 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1836 struct Operand op2 = GetOperand(exp);
1838 if(op2.kind == 3 && op2.type->isSigned)
1839 *value2 = (uintptr_t)op2.i;
1840 else if(op2.kind == 3)
1841 *value2 = (uintptr_t)op2.ui;
1842 else if(op2.kind == 4 && op2.type->isSigned)
1843 *value2 = (uintptr_t)op2.i64;
1844 else if(op2.kind == 4)
1845 *value2 = (uintptr_t)op2.ui64;
1846 else if(op2.kind == 23 && op2.type->isSigned)
1847 *value2 = (uintptr_t)op2.i64;
1848 else if(op2.kind == 23)
1849 *value2 = (uintptr_t)op2.ui64;
1850 else if(op2.kind == 22 && op2.type->isSigned)
1851 *value2 = (uintptr_t)op2.i64;
1852 else if(op2.kind == 22)
1853 *value2 = (uintptr_t)op2.ui64;
1854 else if(op2.kind == 2 && op2.type->isSigned)
1855 *value2 = (uintptr_t)op2.s;
1856 else if(op2.kind == 2)
1857 *value2 = (uintptr_t)op2.us;
1858 else if(op2.kind == 1 && op2.type->isSigned)
1859 *value2 = (uintptr_t)op2.c;
1860 else if(op2.kind == 1)
1861 *value2 = (uintptr_t)op2.uc;
1862 else if(op2.kind == 6)
1863 *value2 = (uintptr_t)op2.f;
1864 else if(op2.kind == 7)
1865 *value2 = (uintptr_t)op2.d;
1866 else if(op2.kind == 13)
1867 *value2 = (uintptr_t)op2.ui64;
1873 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1875 struct Operand op2 = GetOperand(exp);
1877 if(op2.kind == 3 && op2.type->isSigned)
1878 *value2 = (ssize_t)op2.i;
1879 else if(op2.kind == 3)
1880 *value2 = (ssize_t)op2.ui;
1881 else if(op2.kind == 4 && op2.type->isSigned)
1882 *value2 = (ssize_t)op2.i64;
1883 else if(op2.kind == 4)
1884 *value2 = (ssize_t)op2.ui64;
1885 else if(op2.kind == 23 && op2.type->isSigned)
1886 *value2 = (ssize_t)op2.i64;
1887 else if(op2.kind == 23)
1888 *value2 = (ssize_t)op2.ui64;
1889 else if(op2.kind == 22 && op2.type->isSigned)
1890 *value2 = (ssize_t)op2.i64;
1891 else if(op2.kind == 22)
1892 *value2 = (ssize_t)op2.ui64;
1893 else if(op2.kind == 2 && op2.type->isSigned)
1894 *value2 = (ssize_t)op2.s;
1895 else if(op2.kind == 2)
1896 *value2 = (ssize_t)op2.us;
1897 else if(op2.kind == 1 && op2.type->isSigned)
1898 *value2 = (ssize_t)op2.c;
1899 else if(op2.kind == 1)
1900 *value2 = (ssize_t)op2.uc;
1901 else if(op2.kind == 6)
1902 *value2 = (ssize_t)op2.f;
1903 else if(op2.kind == 7)
1904 *value2 = (ssize_t)op2.d;
1905 else if(op2.kind == 13)
1906 *value2 = (ssize_t)op2.ui64;
1912 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1914 struct Operand op2 = GetOperand(exp);
1916 if(op2.kind == 3 && op2.type->isSigned)
1917 *value2 = (size_t)op2.i;
1918 else if(op2.kind == 3)
1919 *value2 = (size_t)op2.ui;
1920 else if(op2.kind == 4 && op2.type->isSigned)
1921 *value2 = (size_t)op2.i64;
1922 else if(op2.kind == 4)
1923 *value2 = (size_t)op2.ui64;
1924 else if(op2.kind == 23 && op2.type->isSigned)
1925 *value2 = (size_t)op2.i64;
1926 else if(op2.kind == 23)
1927 *value2 = (size_t)op2.ui64;
1928 else if(op2.kind == 22 && op2.type->isSigned)
1929 *value2 = (size_t)op2.i64;
1930 else if(op2.kind == 22)
1931 *value2 = (size_t)op2.ui64;
1932 else if(op2.kind == 2 && op2.type->isSigned)
1933 *value2 = (size_t)op2.s;
1934 else if(op2.kind == 2)
1935 *value2 = (size_t)op2.us;
1936 else if(op2.kind == 1 && op2.type->isSigned)
1937 *value2 = (size_t)op2.c;
1938 else if(op2.kind == 1)
1939 *value2 = (size_t)op2.uc;
1940 else if(op2.kind == 6)
1941 *value2 = (size_t)op2.f;
1942 else if(op2.kind == 7)
1943 *value2 = (size_t)op2.d;
1944 else if(op2.kind == 13)
1945 *value2 = (size_t)op2.ui64;
1951 unsigned int GetShort(struct Expression * exp, short * value2)
1953 struct Operand op2 = GetOperand(exp);
1955 if(op2.kind == 3 && op2.type->isSigned)
1956 *value2 = (short)op2.i;
1957 else if(op2.kind == 3)
1958 *value2 = (short)op2.ui;
1959 else if(op2.kind == 4 && op2.type->isSigned)
1960 *value2 = (short)op2.i64;
1961 else if(op2.kind == 4)
1962 *value2 = (short)op2.ui64;
1963 else if(op2.kind == 23 && op2.type->isSigned)
1964 *value2 = (short)op2.i64;
1965 else if(op2.kind == 23)
1966 *value2 = (short)op2.ui64;
1967 else if(op2.kind == 22 && op2.type->isSigned)
1968 *value2 = (short)op2.i64;
1969 else if(op2.kind == 22)
1970 *value2 = (short)op2.ui64;
1971 else if(op2.kind == 2 && op2.type->isSigned)
1973 else if(op2.kind == 2)
1974 *value2 = (short)op2.us;
1975 else if(op2.kind == 1 && op2.type->isSigned)
1976 *value2 = (short)op2.c;
1977 else if(op2.kind == 1)
1978 *value2 = (short)op2.uc;
1979 else if(op2.kind == 6)
1980 *value2 = (short)op2.f;
1981 else if(op2.kind == 7)
1982 *value2 = (short)op2.d;
1983 else if(op2.kind == 13)
1984 *value2 = (short)op2.ui64;
1990 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1992 struct Operand op2 = GetOperand(exp);
1994 if(op2.kind == 3 && op2.type->isSigned)
1995 *value2 = (unsigned short)op2.i;
1996 else if(op2.kind == 3)
1997 *value2 = (unsigned short)op2.ui;
1998 else if(op2.kind == 4 && op2.type->isSigned)
1999 *value2 = (unsigned short)op2.i64;
2000 else if(op2.kind == 4)
2001 *value2 = (unsigned short)op2.ui64;
2002 else if(op2.kind == 23 && op2.type->isSigned)
2003 *value2 = (unsigned short)op2.i64;
2004 else if(op2.kind == 23)
2005 *value2 = (unsigned short)op2.ui64;
2006 else if(op2.kind == 22 && op2.type->isSigned)
2007 *value2 = (unsigned short)op2.i64;
2008 else if(op2.kind == 22)
2009 *value2 = (unsigned short)op2.ui64;
2010 else if(op2.kind == 2 && op2.type->isSigned)
2011 *value2 = (unsigned short)op2.s;
2012 else if(op2.kind == 2)
2014 else if(op2.kind == 1 && op2.type->isSigned)
2015 *value2 = (unsigned short)op2.c;
2016 else if(op2.kind == 1)
2017 *value2 = (unsigned short)op2.uc;
2018 else if(op2.kind == 6)
2019 *value2 = (unsigned short)op2.f;
2020 else if(op2.kind == 7)
2021 *value2 = (unsigned short)op2.d;
2022 else if(op2.kind == 13)
2023 *value2 = (unsigned short)op2.ui64;
2029 unsigned int GetChar(struct Expression * exp, char * value2)
2031 struct Operand op2 = GetOperand(exp);
2033 if(op2.kind == 3 && op2.type->isSigned)
2034 *value2 = (char)op2.i;
2035 else if(op2.kind == 3)
2036 *value2 = (char)op2.ui;
2037 else if(op2.kind == 4 && op2.type->isSigned)
2038 *value2 = (char)op2.i64;
2039 else if(op2.kind == 4)
2040 *value2 = (char)op2.ui64;
2041 else if(op2.kind == 23 && op2.type->isSigned)
2042 *value2 = (char)op2.i64;
2043 else if(op2.kind == 23)
2044 *value2 = (char)op2.ui64;
2045 else if(op2.kind == 22 && op2.type->isSigned)
2046 *value2 = (char)op2.i64;
2047 else if(op2.kind == 22)
2048 *value2 = (char)op2.ui64;
2049 else if(op2.kind == 2 && op2.type->isSigned)
2050 *value2 = (char)op2.s;
2051 else if(op2.kind == 2)
2052 *value2 = (char)op2.us;
2053 else if(op2.kind == 1 && op2.type->isSigned)
2055 else if(op2.kind == 1)
2056 *value2 = (char)op2.uc;
2057 else if(op2.kind == 6)
2058 *value2 = (char)op2.f;
2059 else if(op2.kind == 7)
2060 *value2 = (char)op2.d;
2061 else if(op2.kind == 13)
2062 *value2 = (char)op2.ui64;
2068 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2070 struct Operand op2 = GetOperand(exp);
2072 if(op2.kind == 3 && op2.type->isSigned)
2073 *value2 = (unsigned char)op2.i;
2074 else if(op2.kind == 3)
2075 *value2 = (unsigned char)op2.ui;
2076 else if(op2.kind == 4 && op2.type->isSigned)
2077 *value2 = (unsigned char)op2.i64;
2078 else if(op2.kind == 4)
2079 *value2 = (unsigned char)op2.ui64;
2080 else if(op2.kind == 23 && op2.type->isSigned)
2081 *value2 = (unsigned char)op2.i64;
2082 else if(op2.kind == 23)
2083 *value2 = (unsigned char)op2.ui64;
2084 else if(op2.kind == 22 && op2.type->isSigned)
2085 *value2 = (unsigned char)op2.i64;
2086 else if(op2.kind == 22)
2087 *value2 = (unsigned char)op2.ui64;
2088 else if(op2.kind == 2 && op2.type->isSigned)
2089 *value2 = (unsigned char)op2.s;
2090 else if(op2.kind == 2)
2091 *value2 = (unsigned char)op2.us;
2092 else if(op2.kind == 1 && op2.type->isSigned)
2093 *value2 = (unsigned char)op2.c;
2094 else if(op2.kind == 1)
2096 else if(op2.kind == 6)
2097 *value2 = (unsigned char)op2.f;
2098 else if(op2.kind == 7)
2099 *value2 = (unsigned char)op2.d;
2100 else if(op2.kind == 13)
2101 *value2 = (unsigned char)op2.ui64;
2107 unsigned int GetFloat(struct Expression * exp, float * value2)
2109 struct Operand op2 = GetOperand(exp);
2111 if(op2.kind == 3 && op2.type->isSigned)
2112 *value2 = (float)(float)op2.i;
2113 else if(op2.kind == 3)
2114 *value2 = (float)(float)op2.ui;
2115 else if(op2.kind == 4 && op2.type->isSigned)
2116 *value2 = (float)(float)op2.i64;
2117 else if(op2.kind == 4)
2118 *value2 = (float)(float)op2.ui64;
2119 else if(op2.kind == 23 && op2.type->isSigned)
2120 *value2 = (float)(float)op2.i64;
2121 else if(op2.kind == 23)
2122 *value2 = (float)(float)op2.ui64;
2123 else if(op2.kind == 22 && op2.type->isSigned)
2124 *value2 = (float)(float)op2.i64;
2125 else if(op2.kind == 22)
2126 *value2 = (float)(float)op2.ui64;
2127 else if(op2.kind == 2 && op2.type->isSigned)
2128 *value2 = (float)(float)op2.s;
2129 else if(op2.kind == 2)
2130 *value2 = (float)(float)op2.us;
2131 else if(op2.kind == 1 && op2.type->isSigned)
2132 *value2 = (float)(float)op2.c;
2133 else if(op2.kind == 1)
2134 *value2 = (float)(float)op2.uc;
2135 else if(op2.kind == 6)
2136 *value2 = (float)op2.f;
2137 else if(op2.kind == 7)
2138 *value2 = (float)op2.d;
2139 else if(op2.kind == 13)
2140 *value2 = (float)(float)op2.ui64;
2146 unsigned int GetDouble(struct Expression * exp, double * value2)
2148 struct Operand op2 = GetOperand(exp);
2150 if(op2.kind == 3 && op2.type->isSigned)
2151 *value2 = (double)(double)op2.i;
2152 else if(op2.kind == 3)
2153 *value2 = (double)(double)op2.ui;
2154 else if(op2.kind == 4 && op2.type->isSigned)
2155 *value2 = (double)(double)op2.i64;
2156 else if(op2.kind == 4)
2157 *value2 = (double)(double)op2.ui64;
2158 else if(op2.kind == 23 && op2.type->isSigned)
2159 *value2 = (double)(double)op2.i64;
2160 else if(op2.kind == 23)
2161 *value2 = (double)(double)op2.ui64;
2162 else if(op2.kind == 22 && op2.type->isSigned)
2163 *value2 = (double)(double)op2.i64;
2164 else if(op2.kind == 22)
2165 *value2 = (double)(double)op2.ui64;
2166 else if(op2.kind == 2 && op2.type->isSigned)
2167 *value2 = (double)(double)op2.s;
2168 else if(op2.kind == 2)
2169 *value2 = (double)(double)op2.us;
2170 else if(op2.kind == 1 && op2.type->isSigned)
2171 *value2 = (double)(double)op2.c;
2172 else if(op2.kind == 1)
2173 *value2 = (double)(double)op2.uc;
2174 else if(op2.kind == 6)
2175 *value2 = (double)op2.f;
2176 else if(op2.kind == 7)
2177 *value2 = (double)op2.d;
2178 else if(op2.kind == 13)
2179 *value2 = (double)(double)op2.ui64;
2185 void ComputeExpression(struct Expression * exp);
2187 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2189 extern int targetBits;
2191 int ComputeTypeSize(struct Type * type);
2193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2195 struct __ecereNameSpace__ecere__com__BitMember
2197 struct __ecereNameSpace__ecere__com__BitMember * prev;
2198 struct __ecereNameSpace__ecere__com__BitMember * next;
2200 unsigned int isProperty;
2203 struct __ecereNameSpace__ecere__com__Class * _class;
2204 char * dataTypeString;
2205 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2206 struct Type * dataType;
2211 } __attribute__ ((gcc_struct));
2213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2215 struct __ecereNameSpace__ecere__sys__OldLink
2217 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2218 struct __ecereNameSpace__ecere__sys__OldLink * next;
2220 } __attribute__ ((gcc_struct));
2222 void FinishTemplatesContext(struct Context * context);
2224 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2226 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2227 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2229 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))
2232 int unionMemberOffset = 0;
2237 member->memberOffset = 0;
2238 if(targetBits < sizeof(void *) * 8)
2239 member->structAlignment = 0;
2241 else if(targetBits < sizeof(void *) * 8)
2242 _class->structAlignment = 0;
2243 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2244 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2245 if(!member && _class->destructionWatchOffset)
2246 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2248 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2250 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2252 if(!dataMember->isProperty)
2254 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2256 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2262 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2264 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2266 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2268 if(!isMember && _class->type == 2 && dataMember->dataType)
2270 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2274 ComputeTypeSize(dataMember->dataType);
2275 if(bitMember->pos == -1)
2276 bitMember->pos = _class->memberOffset;
2277 if(!bitMember->size)
2278 bitMember->size = dataMember->dataType->size * 8;
2279 _class->memberOffset = bitMember->pos + bitMember->size;
2280 for(d = 0; d < bitMember->size; d++)
2286 bitMember->mask = mask << bitMember->pos;
2288 else if(dataMember->type == 0 && dataMember->dataType)
2293 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2294 ComputeTypeSize(dataMember->dataType);
2295 if(dataMember->dataType->bitFieldCount)
2297 bitFields += dataMember->dataType->bitFieldCount;
2304 int size = (bitFields + 7) / 8;
2308 int __simpleStruct0;
2312 int __simpleStruct0;
2314 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2315 if(member->memberOffset % alignment)
2316 member->memberOffset += alignment - (member->memberOffset % alignment);
2318 dataMember->offset = member->memberOffset;
2319 if(member->type == 1)
2320 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2323 member->memberOffset += size;
2330 int __simpleStruct0;
2332 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2333 if(_class->memberOffset % alignment)
2334 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2336 dataMember->offset = _class->memberOffset;
2337 _class->memberOffset += size;
2341 size = dataMember->dataType->size;
2342 alignment = dataMember->dataType->alignment;
2346 int __simpleStruct0;
2350 int __simpleStruct0;
2352 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2353 if(member->memberOffset % alignment)
2354 member->memberOffset += alignment - (member->memberOffset % alignment);
2356 dataMember->offset = member->memberOffset;
2357 if(member->type == 1)
2358 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2361 member->memberOffset += size;
2368 int __simpleStruct0;
2370 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2371 if(_class->memberOffset % alignment)
2372 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2374 dataMember->offset = _class->memberOffset;
2375 _class->memberOffset += size;
2382 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2383 alignment = dataMember->structAlignment;
2386 int __simpleStruct0;
2390 int __simpleStruct0;
2392 if(member->memberOffset % alignment)
2393 member->memberOffset += alignment - (member->memberOffset % alignment);
2394 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2396 dataMember->offset = member->memberOffset;
2397 if(member->type == 1)
2398 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2400 member->memberOffset += dataMember->memberOffset;
2406 int __simpleStruct0;
2408 if(_class->memberOffset % alignment)
2409 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2410 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2412 dataMember->offset = _class->memberOffset;
2413 _class->memberOffset += dataMember->memberOffset;
2421 int size = (bitFields + 7) / 8;
2425 int __simpleStruct0;
2429 int __simpleStruct0;
2431 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2432 if(member->memberOffset % alignment)
2433 member->memberOffset += alignment - (member->memberOffset % alignment);
2435 if(member->type == 1)
2436 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2439 member->memberOffset += size;
2446 int __simpleStruct0;
2448 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2449 if(_class->memberOffset % alignment)
2450 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2452 _class->memberOffset += size;
2457 if(member && member->type == 1)
2459 member->memberOffset = unionMemberOffset;
2463 if(_class->type != 2)
2467 if(_class->structAlignment)
2469 if(_class->memberOffset % _class->structAlignment)
2470 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2472 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2475 struct __ecereNameSpace__ecere__com__Property * prop;
2477 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2479 if(prop->isProperty && prop->isWatchable)
2481 prop->watcherOffset = _class->structSize;
2482 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2487 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2489 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2491 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2493 if(deriv->computeSize)
2495 deriv->offset = _class->structSize;
2496 deriv->memberOffset = 0;
2497 deriv->structSize = deriv->offset;
2498 ComputeClassMembers(deriv, 0x0);
2506 FinishTemplatesContext(context);
2509 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2511 struct __ecereNameSpace__ecere__com__NameSpace
2514 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2515 struct __ecereNameSpace__ecere__com__NameSpace * left;
2516 struct __ecereNameSpace__ecere__com__NameSpace * right;
2518 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2519 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2520 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2521 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2522 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2523 } __attribute__ ((gcc_struct));
2525 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2527 struct __ecereNameSpace__ecere__com__Module
2529 struct __ecereNameSpace__ecere__com__Instance * application;
2530 struct __ecereNameSpace__ecere__sys__OldList classes;
2531 struct __ecereNameSpace__ecere__sys__OldList defines;
2532 struct __ecereNameSpace__ecere__sys__OldList functions;
2533 struct __ecereNameSpace__ecere__sys__OldList modules;
2534 struct __ecereNameSpace__ecere__com__Instance * prev;
2535 struct __ecereNameSpace__ecere__com__Instance * next;
2541 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2542 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2543 } __attribute__ ((gcc_struct));
2545 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2547 struct __ecereNameSpace__ecere__com__Class * _class;
2548 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2550 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2551 ComputeModuleClasses(subModule->data);
2552 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2553 ComputeClassMembers(_class, 0x0);
2556 extern unsigned int inCompiler;
2558 extern void Compiler_Error(char * format, ...);
2560 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2562 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2564 int ComputeTypeSize(struct Type * type)
2566 unsigned int size = type ? type->size : 0;
2568 if(!size && type && !type->computing)
2570 type->computing = 0x1;
2574 type->alignment = size = sizeof(char);
2577 type->alignment = size = sizeof(int);
2580 type->alignment = size = sizeof(long long);
2583 type->alignment = size = targetBits / 8;
2586 type->alignment = size = targetBits / 8;
2589 type->alignment = size = sizeof(long);
2592 type->alignment = size = sizeof(short);
2595 type->alignment = size = sizeof(float);
2598 type->alignment = size = sizeof(double);
2602 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2604 if(_class && _class->type == 1)
2606 ComputeClassMembers(_class, 0x0);
2607 type->alignment = _class->structAlignment;
2608 size = _class->structSize;
2609 if(type->alignment && size % type->alignment)
2610 size += type->alignment - (size % type->alignment);
2612 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2614 if(!_class->dataType)
2615 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2616 size = type->alignment = ComputeTypeSize(_class->dataType);
2619 size = type->alignment = targetBits / 8;
2624 size = type->alignment = targetBits / 8;
2627 if(type->arraySizeExp)
2629 ProcessExpressionType(type->arraySizeExp);
2630 ComputeExpression(type->arraySizeExp);
2631 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)))
2633 struct Location oldLoc = yylloc;
2634 char expression[10240];
2636 expression[0] = '\0';
2637 type->arraySizeExp->expType = (((void *)0));
2638 yylloc = type->arraySizeExp->loc;
2640 PrintExpression(type->arraySizeExp, expression);
2641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2644 GetInt(type->arraySizeExp, &type->arraySize);
2646 else if(type->enumClass)
2648 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2650 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2653 type->arraySize = 0;
2657 type->arraySize = 0;
2659 size = ComputeTypeSize(type->type) * type->arraySize;
2661 type->alignment = type->type->alignment;
2665 struct Type * member;
2667 for(member = type->members.first; member; member = member->next)
2669 int __simpleStruct0, __simpleStruct1;
2670 unsigned int addSize = ComputeTypeSize(member);
2672 member->offset = size;
2673 if(member->alignment && size % member->alignment)
2674 member->offset += member->alignment - (size % member->alignment);
2675 size = member->offset;
2676 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2679 if(type->alignment && size % type->alignment)
2680 size += type->alignment - (size % type->alignment);
2685 struct Type * member;
2687 for(member = type->members.first; member; member = member->next)
2689 int __simpleStruct0, __simpleStruct1;
2690 unsigned int addSize = ComputeTypeSize(member);
2692 member->offset = size;
2693 if(member->alignment && size % member->alignment)
2694 member->offset += member->alignment - (size % member->alignment);
2695 size = member->offset;
2696 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2697 size = ((size > addSize) ? size : addSize);
2699 if(type->alignment && size % type->alignment)
2700 size += type->alignment - (size % type->alignment);
2705 struct TemplateParameter * param = type->templateParameter;
2706 struct Type * baseType = ProcessTemplateParameterType(param);
2710 size = ComputeTypeSize(baseType);
2711 type->alignment = baseType->alignment;
2714 type->alignment = size = sizeof(uint64);
2719 type->alignment = size = sizeof(enum
2727 type->alignment = size = targetBits / 8;
2732 type->computing = 0x0;
2737 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2739 extern struct Identifier * MkIdentifier(char * string);
2741 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2743 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2745 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2747 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2749 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2751 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2753 extern void FreeType(struct Type * type);
2755 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2757 extern struct Specifier * MkSpecifier(int specifier);
2759 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2761 extern struct Expression * MkExpConstant(char * string);
2763 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)
2765 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2766 unsigned int totalSize = 0;
2767 unsigned int maxSize = 0;
2768 int alignment, size;
2769 struct __ecereNameSpace__ecere__com__DataMember * member;
2770 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2773 *addedPadding = 0x0;
2774 if(!isMember && _class->base)
2776 maxSize = _class->structSize;
2778 if(_class->type == 1 || _class->type == 5)
2779 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2782 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2784 if(maxSize > baseSize)
2785 maxSize -= baseSize;
2791 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2793 if(!member->isProperty)
2795 switch(member->type)
2799 if(member->dataTypeString)
2801 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2802 struct Declarator * decl;
2804 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2805 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2806 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2807 if(!member->dataType)
2808 member->dataType = ProcessType(specs, decl);
2809 ReplaceThisClassSpecifiers(specs, topClass);
2811 struct Type * type = ProcessType(specs, decl);
2813 DeclareType(member->dataType, 0x0, 0x0);
2816 ComputeTypeSize(member->dataType);
2817 size = member->dataType->size;
2818 alignment = member->dataType->alignment;
2821 if(totalSize % alignment)
2822 totalSize += alignment - (totalSize % alignment);
2831 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2834 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2835 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2836 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2837 alignment = member->structAlignment;
2840 if(totalSize % alignment)
2841 totalSize += alignment - (totalSize % alignment);
2851 unsigned int __simpleStruct0;
2853 if(topMember && topMember->type == 1)
2854 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2856 *retSize += totalSize;
2858 else if(totalSize < maxSize && _class->type != 1000)
2860 int autoPadding = 0;
2862 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2863 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2864 if(totalSize + autoPadding < maxSize)
2866 char sizeString[50];
2868 sprintf(sizeString, "%d", maxSize - totalSize);
2869 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2871 *addedPadding = 0x1;
2875 FinishTemplatesContext(context);
2876 return topMember ? topMember->memberID : _class->memberID;
2879 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2881 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2882 unsigned int totalSize = 0;
2883 struct __ecereNameSpace__ecere__com__DataMember * member;
2884 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2886 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2887 DeclareMembers(_class->base, 0x0);
2888 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2890 if(!member->isProperty)
2892 switch(member->type)
2896 if(!member->dataType && member->dataTypeString)
2897 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2898 if(member->dataType)
2899 DeclareType(member->dataType, 0x0, 0x0);
2905 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2912 FinishTemplatesContext(context);
2913 return topMember ? topMember->memberID : _class->memberID;
2916 extern struct Symbol * FindClass(char * name);
2918 extern char * strchr(const char * , int);
2920 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2922 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2924 extern void FreeClassDef(struct ClassDef * def);
2926 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2928 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2930 extern char * strcpy(char * , const char * );
2932 extern void MangleClassName(char * className);
2934 extern void DeclareClass(struct Symbol * classSym, char * className);
2936 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2938 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2940 void DeclareStruct(char * name, unsigned int skipNoHead)
2942 struct External * external = (((void *)0));
2943 struct Symbol * classSym = FindClass(name);
2945 if(!inCompiler || !classSym)
2947 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2949 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2951 struct Declaration * decl;
2952 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2953 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2954 char structName[1024];
2956 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2957 classSym->declaring++;
2958 if(strchr(classSym->string, '<'))
2960 if(classSym->registered->templateClass)
2962 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2963 classSym->declaring--;
2967 DeclareMembers(classSym->registered, 0x0);
2968 structName[0] = (char)0;
2969 FullClassNameCat(structName, name, 0x0);
2972 unsigned int addedPadding = 0x0;
2974 classSym->declaredStructSym = 0x1;
2975 declarations = MkList();
2976 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2977 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2979 FreeList(declarations, FreeClassDef);
2980 declarations = (((void *)0));
2983 if(skipNoHead || declarations)
2985 if(external && external->declaration)
2987 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2988 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2990 if(classSym->structExternal)
2991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2993 classSym->id = curExternal->symbol->idCode;
2994 classSym->idCode = curExternal->symbol->idCode;
3000 external = MkExternalDeclaration((((void *)0)));
3001 specifiers = MkList();
3002 declarators = MkList();
3003 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3004 external->declaration = decl = MkDeclaration(specifiers, declarators);
3005 if(decl->symbol && !decl->symbol->pointerExternal)
3006 decl->symbol->pointerExternal = external;
3007 if(classSym->registered && classSym->registered->type == 1)
3009 char className[1024];
3011 strcpy(className, "__ecereClass_");
3012 FullClassNameCat(className, classSym->string, 0x1);
3013 MangleClassName(className);
3014 DeclareClass(classSym, className);
3015 external->symbol = classSym;
3016 classSym->pointerExternal = external;
3017 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3018 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3022 char className[1024];
3024 strcpy(className, "__ecereClass_");
3025 FullClassNameCat(className, classSym->string, 0x1);
3026 MangleClassName(className);
3027 classSym->structExternal = external;
3028 DeclareClass(classSym, className);
3029 external->symbol = classSym;
3031 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3034 classSym->declaring--;
3036 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3038 classSym->declaring++;
3040 if(classSym->registered)
3041 DeclareMembers(classSym->registered, 0x0);
3043 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3045 if(classSym->structExternal)
3046 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3048 classSym->id = curExternal->symbol->idCode;
3049 classSym->idCode = curExternal->symbol->idCode;
3051 classSym->declaring--;
3055 extern char * strcat(char * , const char * );
3057 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3059 extern struct ModuleImport * mainModule;
3061 extern struct Specifier * MkSpecifierName(char * name);
3063 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3065 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3067 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3069 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3071 extern void FreeDeclarator(struct Declarator * decl);
3073 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3075 struct PropertyImport
3077 struct PropertyImport * prev;
3078 struct PropertyImport * next;
3080 unsigned int isVirtual;
3081 unsigned int hasSet;
3082 unsigned int hasGet;
3083 } __attribute__ ((gcc_struct));
3085 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3087 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3089 struct Symbol * symbol = prop->symbol;
3090 char propName[1024];
3092 strcpy(setName, "__ecereProp_");
3093 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3094 strcat(setName, "_Set_");
3095 FullClassNameCat(setName, prop->name, 0x1);
3096 strcpy(getName, "__ecereProp_");
3097 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3098 strcat(getName, "_Get_");
3099 FullClassNameCat(getName, prop->name, 0x1);
3100 strcpy(propName, "__ecereProp_");
3101 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3102 strcat(propName, "_");
3103 FullClassNameCat(propName, prop->name, 0x1);
3104 MangleClassName(getName);
3105 MangleClassName(setName);
3106 MangleClassName(propName);
3107 if(prop->_class->type == 1)
3108 DeclareStruct(prop->_class->fullName, 0x0);
3109 if(!symbol || curExternal->symbol->idCode < symbol->id)
3111 unsigned int imported = 0x0;
3112 unsigned int dllImport = 0x0;
3114 if(!symbol || symbol->_import)
3118 struct Symbol * classSym;
3120 if(!prop->_class->symbol)
3121 prop->_class->symbol = FindClass(prop->_class->fullName);
3122 classSym = prop->_class->symbol;
3123 if(classSym && !classSym->_import)
3125 struct ModuleImport * module;
3127 if(prop->_class->module)
3128 module = FindModule(prop->_class->module);
3130 module = mainModule;
3131 classSym->_import = __extension__ ({
3132 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3134 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3138 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3139 symbol->_import = (struct ClassImport *)__extension__ ({
3140 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3142 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3148 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3153 struct Context * context = SetupTemplatesContext(prop->_class);
3155 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3156 FinishTemplatesContext(context);
3160 if(!symbol->externalGet || symbol->externalGet->type == 0)
3162 struct Declaration * decl;
3163 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3164 struct Declarator * d;
3165 struct __ecereNameSpace__ecere__sys__OldList * params;
3166 struct Specifier * spec;
3167 struct External * external;
3168 struct Declarator * typeDecl;
3169 unsigned int simple = 0x0;
3171 specifiers = MkList();
3172 declarators = MkList();
3174 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3175 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3177 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3179 struct Context * context = SetupTemplatesContext(prop->_class);
3181 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3182 FinishTemplatesContext(context);
3184 for(spec = (*specifiers).first; spec; spec = spec->next)
3188 if((!typeDecl || typeDecl->type == 1))
3190 struct Symbol * classSym = spec->symbol;
3192 symbol->_class = classSym->registered;
3193 if(classSym->registered && classSym->registered->type == 1)
3195 DeclareStruct(spec->name, 0x0);
3202 d = PlugDeclarator(typeDecl, d);
3205 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3206 specifiers = MkList();
3208 d = MkDeclaratorFunction(d, params);
3210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3211 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3214 ListAdd(specifiers, MkSpecifier(VOID));
3215 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3216 decl = MkDeclaration(specifiers, declarators);
3217 external = MkExternalDeclaration(decl);
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3219 external->symbol = symbol;
3220 symbol->externalGet = external;
3221 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3223 FreeDeclarator(typeDecl);
3227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3232 if(!symbol->externalSet || symbol->externalSet->type == 0)
3234 struct Declaration * decl;
3235 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3236 struct Declarator * d;
3237 struct __ecereNameSpace__ecere__sys__OldList * params;
3238 struct Specifier * spec;
3239 struct External * external;
3240 struct Declarator * typeDecl;
3242 declarators = MkList();
3244 if(!prop->conversion || prop->_class->type == 1)
3246 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3248 specifiers = MkList();
3250 struct Context * context = SetupTemplatesContext(prop->_class);
3252 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3253 FinishTemplatesContext(context);
3255 ListAdd(params, MkTypeName(specifiers, d));
3256 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3258 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3259 d = MkDeclaratorFunction(d, params);
3260 for(spec = (*specifiers).first; spec; spec = spec->next)
3264 if((!typeDecl || typeDecl->type == 1))
3266 struct Symbol * classSym = spec->symbol;
3268 symbol->_class = classSym->registered;
3269 if(classSym->registered && classSym->registered->type == 1)
3270 DeclareStruct(spec->name, 0x0);
3274 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3275 specifiers = MkList();
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3278 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3280 if(!prop->conversion || prop->_class->type == 1)
3281 ListAdd(specifiers, MkSpecifier(VOID));
3283 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3284 decl = MkDeclaration(specifiers, declarators);
3285 external = MkExternalDeclaration(decl);
3286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3287 external->symbol = symbol;
3288 symbol->externalSet = external;
3289 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3296 if(!symbol->externalPtr)
3298 struct Declaration * decl;
3299 struct External * external;
3300 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3305 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3306 ListAdd(specifiers, MkSpecifierName("Property"));
3308 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3310 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3313 strcpy(propName, "__ecerePropM_");
3314 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3315 strcat(propName, "_");
3316 FullClassNameCat(propName, prop->name, 0x1);
3317 MangleClassName(propName);
3318 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3320 decl = MkDeclaration(specifiers, list);
3322 external = MkExternalDeclaration(decl);
3323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3324 external->symbol = symbol;
3325 symbol->externalPtr = external;
3329 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3331 symbol->id = curExternal->symbol->idCode;
3335 struct Type * Dereference(struct Type * source)
3337 struct Type * type = (((void *)0));
3341 if(source->kind == 13 || source->kind == 12)
3343 type = source->type;
3344 source->type->refCount++;
3346 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3348 type = __extension__ ({
3349 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3351 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3354 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3360 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3365 static struct Type * Reference(struct Type * source)
3367 struct Type * type = (((void *)0));
3371 type = __extension__ ({
3372 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3374 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3381 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);
3383 extern void * memcpy(void * , const void * , size_t size);
3385 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3387 extern void FreeExpression(struct Expression * exp);
3389 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3391 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);
3393 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3395 extern struct Type * MkClassType(char * name);
3397 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);
3399 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)
3401 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3402 unsigned int found = 0x0;
3403 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3404 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3405 unsigned int freeType = 0x0;
3407 yylloc = member->loc;
3412 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3416 dataMember = *curMember;
3422 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3423 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3424 int _subMemberStackPos = 0;
3427 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3430 dataMember = thisMember;
3431 if(curMember && thisMember->memberAccess == 1)
3433 *curMember = thisMember;
3434 *curClass = thisMember->_class;
3435 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3436 *subMemberStackPos = _subMemberStackPos;
3442 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3443 if(method && method->type == 1)
3446 method = (((void *)0));
3451 struct Type * type = (((void *)0));
3455 if(!dataMember->dataType && dataMember->dataTypeString)
3457 struct Context * context = SetupTemplatesContext(_class);
3459 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3460 FinishTemplatesContext(context);
3462 type = dataMember->dataType;
3466 if(!method->dataType)
3467 ProcessMethodType(method);
3468 type = method->dataType;
3470 if(ident && ident->next)
3472 for(ident = ident->next; ident && type; ident = ident->next)
3476 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3478 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3480 type = dataMember->dataType;
3482 else if(type->kind == 9 || type->kind == 10)
3484 struct Type * memberType;
3486 for(memberType = type->members.first; memberType; memberType = memberType->next)
3488 if(!strcmp(memberType->name, ident->string))
3497 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3500 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3501 struct __ecereNameSpace__ecere__com__Class * sClass;
3503 for(sClass = _class; sClass; sClass = sClass->base)
3506 if(sClass->templateClass)
3507 sClass = sClass->templateClass;
3508 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3510 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3512 for(sClass = sClass->base; sClass; sClass = sClass->base)
3514 if(sClass->templateClass)
3515 sClass = sClass->templateClass;
3516 id += sClass->templateParams.count;
3527 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3529 if(arg.dataTypeString)
3531 type = ProcessTypeString(arg.dataTypeString, 0x0);
3533 if(type && _class->templateClass)
3534 type->passAsTemplate = 0x1;
3541 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3543 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3544 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3548 char templateString[1024];
3549 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3551 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3552 for(cClass = expClass; cClass; cClass = cClass->base)
3556 if(cClass->templateClass)
3557 cClass = cClass->templateClass;
3558 for(param = cClass->templateParams.first; param; param = param->next)
3561 struct __ecereNameSpace__ecere__com__Class * sClass;
3562 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3564 for(sClass = cClass->base; sClass; sClass = sClass->base)
3566 if(sClass->templateClass)
3567 sClass = sClass->templateClass;
3568 id += sClass->templateParams.count;
3570 arg = expClass->templateArgs[id];
3571 for(sClass = _class; sClass; sClass = sClass->base)
3573 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3575 struct __ecereNameSpace__ecere__com__Class * nextClass;
3577 if(sClass->templateClass)
3578 sClass = sClass->templateClass;
3579 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3581 if(nextClass->templateClass)
3582 nextClass = nextClass->templateClass;
3583 p += nextClass->templateParams.count;
3585 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3587 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3589 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3591 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3592 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3606 char expString[1024];
3607 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3608 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3609 struct Expression * exp;
3610 char * string = PrintHexUInt64(arg.expression.ui64);
3612 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3613 ProcessExpressionType(exp);
3614 ComputeExpression(exp);
3615 expString[0] = '\0';
3616 PrintExpression(exp, expString);
3617 strcat(argument, expString);
3618 FreeExpression(exp);
3623 strcat(argument, arg.member->name);
3628 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3629 strcat(argument, arg.dataTypeString);
3636 strcat(templateString, ", ");
3637 if(lastParam != p - 1)
3639 strcat(templateString, param->name);
3640 strcat(templateString, " = ");
3642 strcat(templateString, argument);
3651 int len = strlen(templateString);
3653 if(templateString[len - 1] == '<')
3657 if(templateString[len - 1] == '>')
3658 templateString[len++] = ' ';
3659 templateString[len++] = '>';
3661 templateString[len++] = '\0';
3664 struct Context * context = SetupTemplatesContext(_class);
3668 type = ProcessTypeString(templateString, 0x0);
3670 FinishTemplatesContext(context);
3673 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3675 ProcessExpressionType(member->initializer->exp);
3676 if(!member->initializer->exp->expType)
3680 char expString[10240];
3682 expString[0] = '\0';
3683 PrintExpression(member->initializer->exp, expString);
3684 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3688 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3693 else if(member->initializer)
3695 ProcessInitializer(member->initializer, type);
3702 if(_class && _class->type == 3)
3704 if(member->initializer)
3706 struct Type * type = MkClassType(_class->fullName);
3708 ProcessInitializer(member->initializer, type);
3714 if(member->initializer)
3716 ProcessInitializer(member->initializer, (((void *)0)));
3722 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3728 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3737 extern struct Identifier * GetDeclId(struct Declarator * decl);
3739 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);
3741 extern void FreeSpecifier(struct Specifier * spec);
3743 static void ProcessFunction(struct FunctionDefinition * function);
3745 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3747 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3749 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3751 extern void FreeClassFunction(struct ClassFunction * func);
3753 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3755 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3757 void ProcessInstantiationType(struct Instantiation * inst)
3762 struct MembersInit * members;
3763 struct Symbol * classSym;
3764 struct __ecereNameSpace__ecere__com__Class * _class;
3766 classSym = inst->_class->symbol;
3767 _class = classSym ? classSym->registered : (((void *)0));
3768 if(!_class || _class->type != 5)
3769 DeclareStruct(inst->_class->name, 0x0);
3770 afterExternal = afterExternal ? afterExternal : curExternal;
3772 ProcessExpressionType(inst->exp);
3773 inst->isConstant = 0x1;
3776 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3777 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3778 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3779 int subMemberStackPos = 0;
3781 for(members = (*inst->members).first; members; members = members->next)
3783 switch(members->type)
3788 static unsigned int instMethodID = 0;
3789 struct External * external = curExternal;
3790 struct Context * context = curContext;
3791 struct Declarator * declarator = members->function->declarator;
3792 struct Identifier * nameID = GetDeclId(declarator);
3793 char * unmangled = nameID ? nameID->string : (((void *)0));
3794 struct Expression * exp;
3795 struct External * createdExternal = (((void *)0));
3801 strcpy(name, "__ecereInstMeth_");
3802 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3804 strcat(name, nameID->string);
3806 sprintf(number, "_%08d", instMethodID++);
3807 strcat(name, number);
3808 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3812 struct Symbol * symbol = declarator->symbol;
3813 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3815 if(method && method->type == 1)
3817 symbol->method = method;
3818 ProcessMethodType(method);
3819 if(!symbol->type->thisClass)
3821 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3823 if(!currentClass->symbol)
3824 currentClass->symbol = FindClass(currentClass->fullName);
3825 symbol->type->thisClass = currentClass->symbol;
3830 _class->symbol = FindClass(_class->fullName);
3831 symbol->type->thisClass = _class->symbol;
3834 DeclareType(symbol->type, 0x1, 0x1);
3838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3841 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3844 FreeSpecifier(nameID->_class);
3845 nameID->_class = (((void *)0));
3849 struct Type * type = declarator->symbol->type;
3850 struct External * oldExternal = curExternal;
3852 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3854 struct External * externalDecl;
3856 externalDecl = MkExternalDeclaration((((void *)0)));
3857 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3858 if(createdExternal->function)
3860 ProcessFunction(createdExternal->function);
3862 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3864 externalDecl->declaration = decl;
3865 if(decl->symbol && !decl->symbol->pointerExternal)
3866 decl->symbol->pointerExternal = externalDecl;
3867 declarator->symbol->pointerExternal = externalDecl;
3874 curExternal = declarator->symbol->pointerExternal;
3875 ProcessFunction((struct FunctionDefinition *)members->function);
3877 curExternal = external;
3878 curContext = context;
3881 FreeClassFunction(members->function);
3882 exp = QMkExpId(name);
3884 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3885 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3891 if(members->dataMembers && classSym)
3893 struct MemberInit * member;
3894 struct Location oldyyloc = yylloc;
3896 for(member = (*members->dataMembers).first; member; member = member->next)
3898 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3899 if(member->initializer && !member->initializer->isConstant)
3900 inst->isConstant = 0x0;
3912 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3916 if(type->kind == 11)
3918 struct Type * param;
3922 for(param = type->params.first; param; param = param->next)
3923 DeclareType(param, declarePointers, 0x1);
3925 DeclareType(type->returnType, declarePointers, 0x1);
3927 else if(type->kind == 13 && declarePointers)
3928 DeclareType(type->type, declarePointers, 0x0);
3929 else if(type->kind == 8)
3931 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3932 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3934 else if(type->kind == 9 || type->kind == 10)
3936 struct Type * member;
3938 for(member = type->members.first; member; member = member->next)
3939 DeclareType(member, 0x0, 0x0);
3941 else if(type->kind == 12)
3942 DeclareType(type->arrayType, declarePointers, 0x0);
3946 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3948 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3950 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3952 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3953 struct __ecereNameSpace__ecere__com__Class * sClass;
3955 for(sClass = _class; sClass; sClass = sClass->base)
3958 if(sClass->templateClass)
3959 sClass = sClass->templateClass;
3960 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3962 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3964 for(sClass = sClass->base; sClass; sClass = sClass->base)
3966 if(sClass->templateClass)
3967 sClass = sClass->templateClass;
3968 id += sClass->templateParams.count;
3979 arg = &_class->templateArgs[id];
3980 if(arg && param->type == 0)
3981 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3986 extern struct Context * PushContext(void);
3988 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3990 struct TemplatedType
3993 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3994 struct __ecereNameSpace__ecere__sys__BTNode * left;
3995 struct __ecereNameSpace__ecere__sys__BTNode * right;
3997 struct TemplateParameter * param;
3998 } __attribute__ ((gcc_struct));
4000 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4002 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4004 struct Context * context = PushContext();
4006 context->templateTypesOnly = 0x1;
4007 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4009 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4011 for(; param; param = param->next)
4013 if(param->type == 0 && param->identifier)
4015 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4017 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4023 struct __ecereNameSpace__ecere__com__Class * sClass;
4025 for(sClass = _class; sClass; sClass = sClass->base)
4027 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4029 for(p = sClass->templateParams.first; p; p = p->next)
4033 struct TemplateParameter * param = p->param;
4034 struct TemplatedType * type;
4038 p->param = param = __extension__ ({
4039 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4041 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4044 type = __extension__ ({
4045 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4047 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4049 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4057 extern void PopContext(struct Context * ctx);
4059 extern void FreeContext(struct Context * context);
4061 void FinishTemplatesContext(struct Context * context)
4063 PopContext(context);
4064 FreeContext(context);
4065 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4068 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4070 if(!method->dataType)
4072 struct Context * context = SetupTemplatesContext(method->_class);
4074 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4075 FinishTemplatesContext(context);
4076 if(method->type != 1 && method->dataType)
4078 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4080 if(!method->_class->symbol)
4081 method->_class->symbol = FindClass(method->_class->fullName);
4082 method->dataType->thisClass = method->_class->symbol;
4088 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4092 struct Context * context = SetupTemplatesContext(prop->_class);
4094 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4095 FinishTemplatesContext(context);
4099 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4101 extern void FreeTypeName(struct TypeName * typeName);
4103 static void ProcessDeclarator(struct Declarator * decl);
4105 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4107 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4111 struct MethodImport * prev;
4112 struct MethodImport * next;
4114 unsigned int isVirtual;
4115 } __attribute__ ((gcc_struct));
4117 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4119 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4121 struct Symbol * symbol = method->symbol;
4123 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4125 unsigned int imported = 0x0;
4126 unsigned int dllImport = 0x0;
4128 if(!method->dataType)
4129 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4130 if(!symbol || symbol->_import || method->type == 1)
4132 if(!symbol || method->type == 1)
4134 struct Symbol * classSym;
4136 if(!method->_class->symbol)
4137 method->_class->symbol = FindClass(method->_class->fullName);
4138 classSym = method->_class->symbol;
4139 if(!classSym->_import)
4141 struct ModuleImport * module;
4143 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4144 module = FindModule(method->_class->module);
4146 module = mainModule;
4147 classSym->_import = __extension__ ({
4148 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4150 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4156 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4158 if(!symbol->_import)
4160 symbol->_import = (struct ClassImport *)__extension__ ({
4161 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4163 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4165 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4169 symbol->type = method->dataType;
4171 symbol->type->refCount++;
4174 if(!method->dataType->dllExport)
4177 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4181 if(method->type != 1 && method->dataType)
4182 DeclareType(method->dataType, 0x1, 0x1);
4183 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4185 struct Declaration * decl;
4186 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4187 struct Declarator * d;
4188 struct Declarator * funcDecl;
4189 struct External * external;
4191 specifiers = MkList();
4192 declarators = MkList();
4194 ListAdd(specifiers, MkSpecifier(EXTERN));
4195 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4196 ListAdd(specifiers, MkSpecifier(STATIC));
4197 if(method->type == 1)
4199 ListAdd(specifiers, MkSpecifier(INT));
4200 d = MkDeclaratorIdentifier(MkIdentifier(name));
4204 d = MkDeclaratorIdentifier(MkIdentifier(name));
4206 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4208 struct Context * context = SetupTemplatesContext(method->_class);
4210 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4211 FinishTemplatesContext(context);
4213 funcDecl = GetFuncDecl(d);
4216 struct Specifier * spec, * next;
4218 for(spec = (*specifiers).first; spec; spec = next)
4223 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4224 FreeSpecifier(spec);
4228 if(method->dataType && !method->dataType->staticMethod)
4230 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4232 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4233 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")));
4234 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4235 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4237 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4239 struct TypeName * param = (*funcDecl->function.parameters).first;
4241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4242 FreeTypeName(param);
4244 if(!funcDecl->function.parameters)
4245 funcDecl->function.parameters = MkList();
4246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4250 ProcessDeclarator(d);
4251 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4252 decl = MkDeclaration(specifiers, declarators);
4253 ReplaceThisClassSpecifiers(specifiers, method->_class);
4254 if(symbol->pointerExternal)
4256 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4259 *functionSymbol = *symbol;
4260 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4261 if(functionSymbol->type)
4262 functionSymbol->type->refCount++;
4264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4265 symbol->pointerExternal->symbol = functionSymbol;
4267 external = MkExternalDeclaration(decl);
4269 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4270 external->symbol = symbol;
4271 symbol->pointerExternal = external;
4275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4277 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4281 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4283 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4285 unsigned int first = 0x1;
4287 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4289 char className[1024];
4291 strcpy(className, _class->fullName);
4292 for(param = _class->templateParams.first; param; param = param->next)
4296 strcat(className, "<");
4298 strcat(className, ", ");
4299 if(lastParam + 1 != p)
4301 strcat(className, param->name);
4302 strcat(className, " = ");
4304 strcat(className, param->name);
4312 int len = strlen(className);
4314 if(className[len - 1] == '>')
4315 className[len++] = ' ';
4316 className[len++] = '>';
4317 className[len++] = '\0';
4319 return __ecereNameSpace__ecere__sys__CopyString(className);
4322 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4325 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4327 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4329 unsigned int first = 0x1;
4331 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4333 char className[1024];
4335 strcpy(className, _class->fullName);
4336 for(param = _class->templateParams.first; param; param = param->next)
4340 strcat(className, "<");
4342 strcat(className, ", ");
4343 if(lastParam + 1 != p)
4345 strcat(className, param->name);
4346 strcat(className, " = ");
4348 strcat(className, param->name);
4356 int len = strlen(className);
4358 if(className[len - 1] == '>')
4359 className[len++] = ' ';
4360 className[len++] = '>';
4361 className[len++] = '\0';
4363 return MkClassType(className);
4367 return MkClassType(_class->fullName);
4371 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4373 if(specs != (((void *)0)) && _class)
4375 struct Specifier * spec;
4377 for(spec = specs->first; spec; spec = spec->next)
4379 if(spec->type == 0 && spec->specifier == THISCLASS)
4382 spec->name = ReplaceThisClass(_class);
4383 spec->symbol = FindClass(spec->name);
4389 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4391 struct __ecereNameSpace__ecere__com__GlobalFunction
4393 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4394 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4397 struct __ecereNameSpace__ecere__com__Instance * module;
4398 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4399 char * dataTypeString;
4400 struct Type * dataType;
4402 } __attribute__ ((gcc_struct));
4404 extern struct Context * globalContext;
4406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4408 struct FunctionImport
4410 struct FunctionImport * prev;
4411 struct FunctionImport * next;
4413 } __attribute__ ((gcc_struct));
4415 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4417 struct Symbol * symbol = function->symbol;
4419 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4421 unsigned int imported = 0x0;
4422 unsigned int dllImport = 0x0;
4424 if(!function->dataType)
4426 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4427 if(!function->dataType->thisClass)
4428 function->dataType->staticMethod = 0x1;
4434 struct ModuleImport * module = FindModule(function->module);
4436 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4439 if(!function->dataType->dllExport)
4441 symbol->_import = (struct ClassImport *)__extension__ ({
4442 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4444 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4450 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4451 if(!symbol->type->thisClass)
4452 symbol->type->staticMethod = 0x1;
4455 imported = symbol->_import ? 0x1 : 0x0;
4456 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4459 DeclareType(function->dataType, 0x1, 0x1);
4462 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4464 struct Declaration * decl;
4465 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4466 struct Declarator * d;
4467 struct Declarator * funcDecl;
4468 struct External * external;
4470 specifiers = MkList();
4471 declarators = MkList();
4472 ListAdd(specifiers, MkSpecifier(EXTERN));
4473 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4475 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4476 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4477 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4479 struct Specifier * spec;
4481 for(spec = (*specifiers).first; spec; spec = spec->next)
4482 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4484 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4485 FreeSpecifier(spec);
4489 funcDecl = GetFuncDecl(d);
4490 if(funcDecl && !funcDecl->function.parameters)
4492 funcDecl->function.parameters = MkList();
4493 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4495 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4497 struct Context * oldCtx = curContext;
4499 curContext = globalContext;
4500 decl = MkDeclaration(specifiers, declarators);
4501 curContext = oldCtx;
4503 if(symbol->pointerExternal)
4505 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4508 *functionSymbol = *symbol;
4509 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4510 if(functionSymbol->type)
4511 functionSymbol->type->refCount++;
4513 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4514 symbol->pointerExternal->symbol = functionSymbol;
4516 external = MkExternalDeclaration(decl);
4518 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4519 external->symbol = symbol;
4520 symbol->pointerExternal = external;
4524 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4527 symbol->id = curExternal->symbol->idCode;
4530 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4533 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4538 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4539 struct __ecereNameSpace__ecere__sys__BTNode * left;
4540 struct __ecereNameSpace__ecere__sys__BTNode * right;
4542 struct __ecereNameSpace__ecere__com__Instance * module;
4543 char * dataTypeString;
4544 struct Type * dataType;
4547 } __attribute__ ((gcc_struct));
4549 void DeclareGlobalData(struct GlobalData * data)
4551 struct Symbol * symbol = data->symbol;
4553 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4558 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4561 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4562 DeclareType(data->dataType, 0x1, 0x1);
4565 if(!symbol->pointerExternal)
4567 struct Declaration * decl;
4568 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4569 struct Declarator * d;
4570 struct External * external;
4572 specifiers = MkList();
4573 declarators = MkList();
4574 ListAdd(specifiers, MkSpecifier(EXTERN));
4575 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4576 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4577 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4578 decl = MkDeclaration(specifiers, declarators);
4579 external = MkExternalDeclaration(decl);
4581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4582 external->symbol = symbol;
4583 symbol->pointerExternal = external;
4587 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4590 symbol->id = curExternal->symbol->idCode;
4597 struct Conversion * prev, * next;
4598 struct __ecereNameSpace__ecere__com__Property * convert;
4600 struct Type * resultType;
4601 } __attribute__ ((gcc_struct));
4603 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4605 extern void Compiler_Warning(char * format, ...);
4607 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4609 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)
4613 if(source->kind == 20 && dest->kind != 20)
4615 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4620 if(dest->kind == 20 && source->kind != 20)
4622 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4627 if(dest->classObjectType == 2)
4629 if(source->classObjectType != 3)
4633 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4641 if(source->classObjectType == 3)
4643 if(dest->classObjectType == 3 && source->classObjectType != 2)
4646 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4648 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4651 if(dest->kind == 14 && source->kind != 0)
4653 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))
4655 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))
4657 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4659 if(source->_class->registered && source->_class->registered->type == 3)
4661 if(conversions != (((void *)0)))
4663 if(source->_class->registered == dest->_class->registered)
4668 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4670 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4672 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4674 if(sourceBase == destBase)
4678 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))
4682 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4684 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4691 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4695 if(source->kind == 8)
4697 struct __ecereNameSpace__ecere__com__Class * _class;
4699 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4701 struct __ecereNameSpace__ecere__com__Property * convert;
4703 for(convert = _class->conversions.first; convert; convert = convert->next)
4705 if(convert->memberAccess == 1 || _class->module == privateModule)
4707 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4709 if(!convert->dataType)
4710 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4711 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4713 if(!conversions && !convert->Get)
4715 else if(conversions != (((void *)0)))
4717 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))
4721 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4723 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4734 struct __ecereNameSpace__ecere__com__Class * _class;
4736 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4738 struct __ecereNameSpace__ecere__com__Property * convert;
4740 for(convert = _class->conversions.first; convert; convert = convert->next)
4742 if(convert->memberAccess == 1 || _class->module == privateModule)
4744 if(!convert->dataType)
4745 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4746 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4748 if(!conversions && !convert->Set)
4750 else if(conversions != (((void *)0)))
4752 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))
4756 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4766 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4768 if(!dest->_class->registered->dataType)
4769 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4770 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4772 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4779 if(source->kind == 8)
4781 struct __ecereNameSpace__ecere__com__Class * _class;
4783 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4785 struct __ecereNameSpace__ecere__com__Property * convert;
4787 for(convert = _class->conversions.first; convert; convert = convert->next)
4789 if(convert->memberAccess == 1 || _class->module == privateModule)
4791 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4793 if(!convert->dataType)
4794 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4795 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4797 if(!conversions && !convert->Get)
4799 else if(conversions != (((void *)0)))
4801 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))
4805 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4807 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4815 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4817 if(!source->_class->registered->dataType)
4818 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4819 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4826 if(source->kind == 8 || source->kind == 19)
4828 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4830 else if(dest->kind == 7 && source->kind == 6)
4832 else if(dest->kind == 2 && source->kind == 1)
4834 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4836 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4838 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4840 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4842 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
4844 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4846 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)))
4848 struct Type * paramSource, * paramDest;
4850 if(dest->kind == 16)
4851 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4852 if(source->kind == 16)
4853 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4854 if(dest->kind == 13 && dest->type->kind == 11)
4856 if(source->kind == 13 && source->type->kind == 11)
4857 source = source->type;
4858 if(dest->kind == 16)
4859 dest = dest->method->dataType;
4860 if(source->kind == 16)
4861 source = source->method->dataType;
4862 paramSource = source->params.first;
4863 if(paramSource && paramSource->kind == 0)
4864 paramSource = (((void *)0));
4865 paramDest = dest->params.first;
4866 if(paramDest && paramDest->kind == 0)
4867 paramDest = (((void *)0));
4868 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4870 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))))
4872 if(paramDest && paramDest->kind == 8)
4873 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4878 paramDest = paramDest->next;
4880 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4882 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4886 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4894 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4899 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4903 paramSource = paramSource->next;
4909 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4911 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4917 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4919 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4925 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4927 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4930 for(; paramDest; paramDest = paramDest->next)
4934 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4938 struct Type * paramDestType = paramDest;
4939 struct Type * paramSourceType = paramSource;
4940 struct Type * type = paramDestType;
4942 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4945 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4946 struct __ecereNameSpace__ecere__com__Class * sClass;
4948 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4951 if(sClass->templateClass)
4952 sClass = sClass->templateClass;
4953 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4955 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4957 for(sClass = sClass->base; sClass; sClass = sClass->base)
4959 if(sClass->templateClass)
4960 sClass = sClass->templateClass;
4961 id += sClass->templateParams.count;
4972 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4974 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4977 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)))
4982 PrintType(paramDest, type, 0x0, 0x1);
4983 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4984 if(paramDestType != paramDest)
4985 FreeType(paramDestType);
4988 if(paramDestType != paramDest)
4989 FreeType(paramDestType);
4991 paramSource = paramSource->next;
4995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5000 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5004 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5006 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5013 static void FreeConvert(struct Conversion * convert)
5015 if(convert->resultType)
5016 FreeType(convert->resultType);
5019 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5021 struct __ecereNameSpace__ecere__com__BTNamedLink
5024 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5025 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5026 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5029 } __attribute__ ((gcc_struct));
5031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5033 struct __ecereNameSpace__ecere__com__EnumClassData
5035 struct __ecereNameSpace__ecere__sys__OldList values;
5037 } __attribute__ ((gcc_struct));
5039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5041 struct __ecereNameSpace__ecere__sys__NamedLink
5043 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5044 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5047 } __attribute__ ((gcc_struct));
5049 extern void FreeExpContents(struct Expression * exp);
5051 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5053 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5055 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5057 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5059 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5061 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5063 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5065 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)))
5067 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5069 if(_class->type == 4)
5071 struct __ecereNameSpace__ecere__sys__OldList converts =
5075 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5079 _class->symbol = FindClass(_class->fullName);
5080 type->_class = _class->symbol;
5081 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5083 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5084 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5088 struct __ecereNameSpace__ecere__com__Class * baseClass;
5090 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5092 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5094 for(value = e->values.first; value; value = value->next)
5096 if(!strcmp(value->name, string))
5101 FreeExpContents(sourceExp);
5102 FreeType(sourceExp->expType);
5103 sourceExp->isConstant = 0x1;
5104 sourceExp->expType = MkClassType(baseClass->fullName);
5108 sourceExp->type = 2;
5109 if(!strcmp(baseClass->dataTypeString, "int"))
5110 sprintf(constant, "%d", (int)value->data);
5112 sprintf(constant, "0x%X", (int)value->data);
5113 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5115 while(converts.first)
5117 struct Conversion * convert = converts.first;
5119 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5122 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5130 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5133 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)))
5134 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5141 struct __ecereNameSpace__ecere__com__SubModule
5143 struct __ecereNameSpace__ecere__com__SubModule * prev;
5144 struct __ecereNameSpace__ecere__com__SubModule * next;
5145 struct __ecereNameSpace__ecere__com__Instance * module;
5147 } __attribute__ ((gcc_struct));
5149 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5151 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5153 if(searchFor == searchIn)
5155 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5157 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5159 if(ModuleVisibility(subModule->module, searchFor))
5166 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5168 struct __ecereNameSpace__ecere__com__Application
5173 unsigned int isGUIApp;
5174 struct __ecereNameSpace__ecere__sys__OldList allModules;
5175 char * parsedCommand;
5176 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5177 } __attribute__ ((gcc_struct));
5179 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5181 struct __ecereNameSpace__ecere__com__Instance * module;
5183 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))
5185 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))
5187 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))
5189 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)
5191 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5197 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5199 void ReadString(char * output, char * string);
5201 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5203 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5205 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5207 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5209 struct Type * source = sourceExp->expType;
5210 struct Type * realDest = dest;
5211 struct Type * backupSourceExpType = (((void *)0));
5213 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5215 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5217 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5219 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5221 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5223 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5225 if(sourceBase == destBase)
5231 struct __ecereNameSpace__ecere__sys__OldList * specs;
5232 unsigned int flag = 0x0;
5233 long long value = (((int)0x7fffffff));
5237 if(sourceExp->type == 2)
5239 if(source->isSigned)
5240 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5242 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5244 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5246 if(source->isSigned)
5247 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5249 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5251 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5254 source = __extension__ ({
5255 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5257 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5262 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5264 if(_class && _class->type == 3)
5266 if(source->kind != 8)
5268 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5269 struct Type * tempDest, * tempSource;
5271 for(; _class->base->type != 1000; _class = _class->base)
5274 tempDest = tempType;
5277 _class->symbol = FindClass(_class->fullName);
5278 tempType->_class = _class->symbol;
5279 tempType->truth = dest->truth;
5280 if(tempType->_class)
5281 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5282 backupSourceExpType = sourceExp->expType;
5283 sourceExp->expType = dest;
5286 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5289 if(_class && _class->type == 2 && source->kind != 8)
5291 if(!dest->_class->registered->dataType)
5292 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5293 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5296 FreeType(sourceExp->expType);
5297 source = sourceExp->expType = MkClassType(dest->_class->string);
5301 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5303 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5304 struct Declarator * decl;
5307 ReadString(string, sourceExp->string);
5308 decl = SpecDeclFromString(string, specs, (((void *)0)));
5309 FreeExpContents(sourceExp);
5310 FreeType(sourceExp->expType);
5311 sourceExp->type = 26;
5312 sourceExp->_classExp.specifiers = specs;
5313 sourceExp->_classExp.decl = decl;
5314 sourceExp->expType = dest;
5318 if(backupSourceExpType)
5319 FreeType(backupSourceExpType);
5323 else if(source->kind == 8)
5325 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5327 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5331 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5332 struct Type * tempDest, * tempSource;
5334 if(!source->_class->registered->dataType)
5335 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5336 for(; _class->base->type != 1000; _class = _class->base)
5339 tempSource = tempType;
5341 tempType->_class = FindClass(_class->fullName);
5342 tempType->truth = source->truth;
5343 tempType->classObjectType = source->classObjectType;
5344 if(tempType->_class)
5345 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5346 if(conversions->last)
5348 ((struct Conversion *)conversions->last)->resultType = dest;
5351 FreeType(sourceExp->expType);
5352 sourceExp->expType = MkClassType(_class->fullName);
5353 sourceExp->expType->truth = source->truth;
5354 sourceExp->expType->classObjectType = source->classObjectType;
5355 if(!sourceExp->destType)
5357 FreeType(sourceExp->destType);
5358 sourceExp->destType = sourceExp->expType;
5359 if(sourceExp->expType)
5360 sourceExp->expType->refCount++;
5362 if(!_class->dataType)
5363 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5365 dest = MkClassType(source->_class->string);
5366 dest->truth = source->truth;
5367 dest->classObjectType = source->classObjectType;
5369 source = _class->dataType;
5371 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5377 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5386 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5388 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5390 if(_class->type == 0 || _class->type == 5)
5392 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5394 *newExp = *sourceExp;
5395 if(sourceExp->destType)
5396 sourceExp->destType->refCount++;
5397 if(sourceExp->expType)
5398 sourceExp->expType->refCount++;
5399 sourceExp->type = 11;
5400 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5401 sourceExp->cast.exp = newExp;
5402 FreeType(sourceExp->expType);
5403 sourceExp->expType = (((void *)0));
5404 ProcessExpressionType(sourceExp);
5407 FreeType(sourceExp->expType);
5408 sourceExp->expType = dest;
5413 if(backupSourceExpType)
5414 FreeType(backupSourceExpType);
5417 if(!_class->dataType)
5418 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5420 dest = _class->dataType;
5423 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5425 specs = MkListOne(MkSpecifier(DOUBLE));
5427 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5429 specs = MkListOne(MkSpecifier(FLOAT));
5431 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5435 ListAdd(specs, MkSpecifier(UNSIGNED));
5436 ListAdd(specs, MkSpecifier(INT64));
5438 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5442 ListAdd(specs, MkSpecifier(UNSIGNED));
5443 ListAdd(specs, MkSpecifier(INT));
5445 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5449 ListAdd(specs, MkSpecifier(UNSIGNED));
5450 ListAdd(specs, MkSpecifier(SHORT));
5452 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5456 ListAdd(specs, MkSpecifier(UNSIGNED));
5457 ListAdd(specs, MkSpecifier(CHAR));
5463 if(backupSourceExpType)
5465 if(sourceExp->expType)
5466 FreeType(sourceExp->expType);
5467 sourceExp->expType = backupSourceExpType;
5472 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 == 1))
5474 specs = MkListOne(MkSpecifier(DOUBLE));
5476 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5478 specs = MkListOne(MkSpecifier(FLOAT));
5480 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5484 ListAdd(specs, MkSpecifier(UNSIGNED));
5485 ListAdd(specs, MkSpecifier(CHAR));
5487 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5491 ListAdd(specs, MkSpecifier(UNSIGNED));
5492 ListAdd(specs, MkSpecifier(SHORT));
5494 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5498 ListAdd(specs, MkSpecifier(UNSIGNED));
5499 ListAdd(specs, MkSpecifier(INT));
5501 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5505 ListAdd(specs, MkSpecifier(UNSIGNED));
5506 ListAdd(specs, MkSpecifier(INT64));
5508 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5510 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5516 if(backupSourceExpType)
5518 if(sourceExp->expType)
5519 FreeType(sourceExp->expType);
5520 sourceExp->expType = backupSourceExpType;
5526 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5528 *newExp = *sourceExp;
5529 newExp->prev = (((void *)0));
5530 newExp->next = (((void *)0));
5531 if(sourceExp->destType)
5532 sourceExp->destType->refCount++;
5533 if(sourceExp->expType)
5534 sourceExp->expType->refCount++;
5535 sourceExp->type = 11;
5536 if(realDest->kind == 8)
5538 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5539 FreeList(specs, FreeSpecifier);
5542 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5543 if(newExp->type == 4)
5545 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5548 sourceExp->cast.exp = newExp;
5549 FreeType(sourceExp->expType);
5550 sourceExp->expType = (((void *)0));
5551 ProcessExpressionType(sourceExp);
5554 FreeList(specs, FreeSpecifier);
5557 if(backupSourceExpType)
5558 FreeType(backupSourceExpType);
5563 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5564 sourceExp = (*sourceExp->list).last;
5565 if(sourceExp->type == 0)
5567 struct Identifier * id = sourceExp->identifier;
5571 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5573 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5574 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5578 for(; _class && _class->type == 4; _class = _class->base)
5580 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5581 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5583 for(value = e->values.first; value; value = value->next)
5585 if(!strcmp(value->name, id->string))
5590 FreeExpContents(sourceExp);
5591 FreeType(sourceExp->expType);
5592 sourceExp->isConstant = 0x1;
5593 sourceExp->expType = MkClassType(_class->fullName);
5597 sourceExp->type = 2;
5598 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5599 sprintf(constant, "%d", (int)value->data);
5601 sprintf(constant, "0x%X", (int)value->data);
5602 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5610 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5617 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5619 int value2 = op2->i;
5622 exp->string = PrintInt(op1->i + value2);
5625 exp->expType = op1->type;
5627 op1->type->refCount++;
5632 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5634 unsigned int value2 = op2->ui;
5637 exp->string = PrintUInt(op1->ui + value2);
5640 exp->expType = op1->type;
5642 op1->type->refCount++;
5647 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5649 short value2 = op2->s;
5652 exp->string = PrintShort(op1->s + value2);
5655 exp->expType = op1->type;
5657 op1->type->refCount++;
5662 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5664 unsigned short value2 = op2->us;
5667 exp->string = PrintUShort(op1->us + value2);
5670 exp->expType = op1->type;
5672 op1->type->refCount++;
5677 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5679 char value2 = op2->c;
5682 exp->string = PrintChar(op1->c + value2);
5685 exp->expType = op1->type;
5687 op1->type->refCount++;
5692 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5694 unsigned char value2 = op2->uc;
5697 exp->string = PrintUChar(op1->uc + value2);
5700 exp->expType = op1->type;
5702 op1->type->refCount++;
5707 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5709 float value2 = op2->f;
5712 exp->string = PrintFloat(op1->f + value2);
5715 exp->expType = op1->type;
5717 op1->type->refCount++;
5722 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5724 double value2 = op2->d;
5727 exp->string = PrintDouble(op1->d + value2);
5730 exp->expType = op1->type;
5732 op1->type->refCount++;
5737 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5739 int value2 = op2->i;
5742 exp->string = PrintInt(op1->i - value2);
5745 exp->expType = op1->type;
5747 op1->type->refCount++;
5752 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5754 unsigned int value2 = op2->ui;
5757 exp->string = PrintUInt(op1->ui - value2);
5760 exp->expType = op1->type;
5762 op1->type->refCount++;
5767 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5769 short value2 = op2->s;
5772 exp->string = PrintShort(op1->s - value2);
5775 exp->expType = op1->type;
5777 op1->type->refCount++;
5782 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5784 unsigned short value2 = op2->us;
5787 exp->string = PrintUShort(op1->us - value2);
5790 exp->expType = op1->type;
5792 op1->type->refCount++;
5797 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5799 char value2 = op2->c;
5802 exp->string = PrintChar(op1->c - value2);
5805 exp->expType = op1->type;
5807 op1->type->refCount++;
5812 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5814 unsigned char value2 = op2->uc;
5817 exp->string = PrintUChar(op1->uc - value2);
5820 exp->expType = op1->type;
5822 op1->type->refCount++;
5827 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5829 float value2 = op2->f;
5832 exp->string = PrintFloat(op1->f - value2);
5835 exp->expType = op1->type;
5837 op1->type->refCount++;
5842 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5844 double value2 = op2->d;
5847 exp->string = PrintDouble(op1->d - value2);
5850 exp->expType = op1->type;
5852 op1->type->refCount++;
5857 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5859 int value2 = op2->i;
5862 exp->string = PrintInt(op1->i * value2);
5865 exp->expType = op1->type;
5867 op1->type->refCount++;
5872 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5874 unsigned int value2 = op2->ui;
5877 exp->string = PrintUInt(op1->ui * value2);
5880 exp->expType = op1->type;
5882 op1->type->refCount++;
5887 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5889 short value2 = op2->s;
5892 exp->string = PrintShort(op1->s * value2);
5895 exp->expType = op1->type;
5897 op1->type->refCount++;
5902 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5904 unsigned short value2 = op2->us;
5907 exp->string = PrintUShort(op1->us * value2);
5910 exp->expType = op1->type;
5912 op1->type->refCount++;
5917 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5919 char value2 = op2->c;
5922 exp->string = PrintChar(op1->c * value2);
5925 exp->expType = op1->type;
5927 op1->type->refCount++;
5932 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5934 unsigned char value2 = op2->uc;
5937 exp->string = PrintUChar(op1->uc * value2);
5940 exp->expType = op1->type;
5942 op1->type->refCount++;
5947 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5949 float value2 = op2->f;
5952 exp->string = PrintFloat(op1->f * value2);
5955 exp->expType = op1->type;
5957 op1->type->refCount++;
5962 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5964 double value2 = op2->d;
5967 exp->string = PrintDouble(op1->d * value2);
5970 exp->expType = op1->type;
5972 op1->type->refCount++;
5977 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5979 int value2 = op2->i;
5982 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5985 exp->expType = op1->type;
5987 op1->type->refCount++;
5992 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5994 unsigned int value2 = op2->ui;
5997 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6000 exp->expType = op1->type;
6002 op1->type->refCount++;
6007 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6009 short value2 = op2->s;
6012 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6015 exp->expType = op1->type;
6017 op1->type->refCount++;
6022 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6024 unsigned short value2 = op2->us;
6027 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6030 exp->expType = op1->type;
6032 op1->type->refCount++;
6037 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6039 char value2 = op2->c;
6042 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6045 exp->expType = op1->type;
6047 op1->type->refCount++;
6052 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6054 unsigned char value2 = op2->uc;
6057 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6060 exp->expType = op1->type;
6062 op1->type->refCount++;
6067 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6069 float value2 = op2->f;
6072 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
6075 exp->expType = op1->type;
6077 op1->type->refCount++;
6082 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6084 double value2 = op2->d;
6087 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
6090 exp->expType = op1->type;
6092 op1->type->refCount++;
6097 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6099 int value2 = op2->i;
6102 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6105 exp->expType = op1->type;
6107 op1->type->refCount++;
6112 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6114 unsigned int value2 = op2->ui;
6117 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6120 exp->expType = op1->type;
6122 op1->type->refCount++;
6127 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6129 short value2 = op2->s;
6132 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6135 exp->expType = op1->type;
6137 op1->type->refCount++;
6142 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6144 unsigned short value2 = op2->us;
6147 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6150 exp->expType = op1->type;
6152 op1->type->refCount++;
6157 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6159 char value2 = op2->c;
6162 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6165 exp->expType = op1->type;
6167 op1->type->refCount++;
6172 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6174 unsigned char value2 = op2->uc;
6177 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6180 exp->expType = op1->type;
6182 op1->type->refCount++;
6187 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6190 exp->string = PrintInt(-op1->i);
6193 exp->expType = op1->type;
6195 op1->type->refCount++;
6200 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6203 exp->string = PrintUInt(-op1->ui);
6206 exp->expType = op1->type;
6208 op1->type->refCount++;
6213 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6216 exp->string = PrintShort(-op1->s);
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6229 exp->string = PrintUShort(-op1->us);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6242 exp->string = PrintChar(-op1->c);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6255 exp->string = PrintUChar(-op1->uc);
6258 exp->expType = op1->type;
6260 op1->type->refCount++;
6265 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6268 exp->string = PrintFloat(-op1->f);
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6281 exp->string = PrintDouble(-op1->d);
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6294 exp->string = PrintInt(++op1->i);
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6307 exp->string = PrintUInt(++op1->ui);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6320 exp->string = PrintShort(++op1->s);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6333 exp->string = PrintUShort(++op1->us);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6346 exp->string = PrintChar(++op1->c);
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6359 exp->string = PrintUChar(++op1->uc);
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6372 exp->string = PrintFloat(++op1->f);
6375 exp->expType = op1->type;
6377 op1->type->refCount++;
6382 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6385 exp->string = PrintDouble(++op1->d);
6388 exp->expType = op1->type;
6390 op1->type->refCount++;
6395 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6398 exp->string = PrintInt(--op1->i);
6401 exp->expType = op1->type;
6403 op1->type->refCount++;
6408 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6411 exp->string = PrintUInt(--op1->ui);
6414 exp->expType = op1->type;
6416 op1->type->refCount++;
6421 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6424 exp->string = PrintShort(--op1->s);
6427 exp->expType = op1->type;
6429 op1->type->refCount++;
6434 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6437 exp->string = PrintUShort(--op1->us);
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6450 exp->string = PrintChar(--op1->c);
6453 exp->expType = op1->type;
6455 op1->type->refCount++;
6460 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6463 exp->string = PrintUChar(--op1->uc);
6466 exp->expType = op1->type;
6468 op1->type->refCount++;
6473 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6476 exp->string = PrintFloat(--op1->f);
6479 exp->expType = op1->type;
6481 op1->type->refCount++;
6486 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6489 exp->string = PrintDouble(--op1->d);
6492 exp->expType = op1->type;
6494 op1->type->refCount++;
6499 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6501 int value2 = op2->i;
6504 exp->string = PrintInt(op1->i = value2);
6507 exp->expType = op1->type;
6509 op1->type->refCount++;
6514 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6516 unsigned int value2 = op2->ui;
6519 exp->string = PrintUInt(op1->ui = value2);
6522 exp->expType = op1->type;
6524 op1->type->refCount++;
6529 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6531 short value2 = op2->s;
6534 exp->string = PrintShort(op1->s = value2);
6537 exp->expType = op1->type;
6539 op1->type->refCount++;
6544 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6546 unsigned short value2 = op2->us;
6549 exp->string = PrintUShort(op1->us = value2);
6552 exp->expType = op1->type;
6554 op1->type->refCount++;
6559 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6561 char value2 = op2->c;
6564 exp->string = PrintChar(op1->c = value2);
6567 exp->expType = op1->type;
6569 op1->type->refCount++;
6574 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6576 unsigned char value2 = op2->uc;
6579 exp->string = PrintUChar(op1->uc = value2);
6582 exp->expType = op1->type;
6584 op1->type->refCount++;
6589 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6591 float value2 = op2->f;
6594 exp->string = PrintFloat(op1->f = value2);
6597 exp->expType = op1->type;
6599 op1->type->refCount++;
6604 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6606 double value2 = op2->d;
6609 exp->string = PrintDouble(op1->d = value2);
6612 exp->expType = op1->type;
6614 op1->type->refCount++;
6619 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6621 int value2 = op2->i;
6624 exp->string = PrintInt(op1->i += value2);
6627 exp->expType = op1->type;
6629 op1->type->refCount++;
6634 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6636 unsigned int value2 = op2->ui;
6639 exp->string = PrintUInt(op1->ui += value2);
6642 exp->expType = op1->type;
6644 op1->type->refCount++;
6649 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6651 short value2 = op2->s;
6654 exp->string = PrintShort(op1->s += value2);
6657 exp->expType = op1->type;
6659 op1->type->refCount++;
6664 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6666 unsigned short value2 = op2->us;
6669 exp->string = PrintUShort(op1->us += value2);
6672 exp->expType = op1->type;
6674 op1->type->refCount++;
6679 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6681 char value2 = op2->c;
6684 exp->string = PrintChar(op1->c += value2);
6687 exp->expType = op1->type;
6689 op1->type->refCount++;
6694 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6696 unsigned char value2 = op2->uc;
6699 exp->string = PrintUChar(op1->uc += value2);
6702 exp->expType = op1->type;
6704 op1->type->refCount++;
6709 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6711 float value2 = op2->f;
6714 exp->string = PrintFloat(op1->f += value2);
6717 exp->expType = op1->type;
6719 op1->type->refCount++;
6724 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6726 double value2 = op2->d;
6729 exp->string = PrintDouble(op1->d += value2);
6732 exp->expType = op1->type;
6734 op1->type->refCount++;
6739 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6741 int value2 = op2->i;
6744 exp->string = PrintInt(op1->i -= value2);
6747 exp->expType = op1->type;
6749 op1->type->refCount++;
6754 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6756 unsigned int value2 = op2->ui;
6759 exp->string = PrintUInt(op1->ui -= value2);
6762 exp->expType = op1->type;
6764 op1->type->refCount++;
6769 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6771 short value2 = op2->s;
6774 exp->string = PrintShort(op1->s -= value2);
6777 exp->expType = op1->type;
6779 op1->type->refCount++;
6784 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6786 unsigned short value2 = op2->us;
6789 exp->string = PrintUShort(op1->us -= value2);
6792 exp->expType = op1->type;
6794 op1->type->refCount++;
6799 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6801 char value2 = op2->c;
6804 exp->string = PrintChar(op1->c -= value2);
6807 exp->expType = op1->type;
6809 op1->type->refCount++;
6814 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6816 unsigned char value2 = op2->uc;
6819 exp->string = PrintUChar(op1->uc -= value2);
6822 exp->expType = op1->type;
6824 op1->type->refCount++;
6829 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6831 float value2 = op2->f;
6834 exp->string = PrintFloat(op1->f -= value2);
6837 exp->expType = op1->type;
6839 op1->type->refCount++;
6844 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6846 double value2 = op2->d;
6849 exp->string = PrintDouble(op1->d -= value2);
6852 exp->expType = op1->type;
6854 op1->type->refCount++;
6859 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6861 int value2 = op2->i;
6864 exp->string = PrintInt(op1->i *= value2);
6867 exp->expType = op1->type;
6869 op1->type->refCount++;
6874 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6876 unsigned int value2 = op2->ui;
6879 exp->string = PrintUInt(op1->ui *= value2);
6882 exp->expType = op1->type;
6884 op1->type->refCount++;
6889 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6891 short value2 = op2->s;
6894 exp->string = PrintShort(op1->s *= value2);
6897 exp->expType = op1->type;
6899 op1->type->refCount++;
6904 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6906 unsigned short value2 = op2->us;
6909 exp->string = PrintUShort(op1->us *= value2);
6912 exp->expType = op1->type;
6914 op1->type->refCount++;
6919 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6921 char value2 = op2->c;
6924 exp->string = PrintChar(op1->c *= value2);
6927 exp->expType = op1->type;
6929 op1->type->refCount++;
6934 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6936 unsigned char value2 = op2->uc;
6939 exp->string = PrintUChar(op1->uc *= value2);
6942 exp->expType = op1->type;
6944 op1->type->refCount++;
6949 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6951 float value2 = op2->f;
6954 exp->string = PrintFloat(op1->f *= value2);
6957 exp->expType = op1->type;
6959 op1->type->refCount++;
6964 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6966 double value2 = op2->d;
6969 exp->string = PrintDouble(op1->d *= value2);
6972 exp->expType = op1->type;
6974 op1->type->refCount++;
6979 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6981 int value2 = op2->i;
6984 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6987 exp->expType = op1->type;
6989 op1->type->refCount++;
6994 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6996 unsigned int value2 = op2->ui;
6999 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7002 exp->expType = op1->type;
7004 op1->type->refCount++;
7009 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7011 short value2 = op2->s;
7014 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7017 exp->expType = op1->type;
7019 op1->type->refCount++;
7024 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7026 unsigned short value2 = op2->us;
7029 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7032 exp->expType = op1->type;
7034 op1->type->refCount++;
7039 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7041 char value2 = op2->c;
7044 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7047 exp->expType = op1->type;
7049 op1->type->refCount++;
7054 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7056 unsigned char value2 = op2->uc;
7059 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7062 exp->expType = op1->type;
7064 op1->type->refCount++;
7069 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7071 float value2 = op2->f;
7074 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
7077 exp->expType = op1->type;
7079 op1->type->refCount++;
7084 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7086 double value2 = op2->d;
7089 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
7092 exp->expType = op1->type;
7094 op1->type->refCount++;
7099 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7101 int value2 = op2->i;
7104 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7107 exp->expType = op1->type;
7109 op1->type->refCount++;
7114 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7116 unsigned int value2 = op2->ui;
7119 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7122 exp->expType = op1->type;
7124 op1->type->refCount++;
7129 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7131 short value2 = op2->s;
7134 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7137 exp->expType = op1->type;
7139 op1->type->refCount++;
7144 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7146 unsigned short value2 = op2->us;
7149 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7152 exp->expType = op1->type;
7154 op1->type->refCount++;
7159 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7161 char value2 = op2->c;
7164 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7167 exp->expType = op1->type;
7169 op1->type->refCount++;
7174 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7176 unsigned char value2 = op2->uc;
7179 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7182 exp->expType = op1->type;
7184 op1->type->refCount++;
7189 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7191 int value2 = op2->i;
7194 exp->string = PrintInt(op1->i & value2);
7197 exp->expType = op1->type;
7199 op1->type->refCount++;
7204 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7206 unsigned int value2 = op2->ui;
7209 exp->string = PrintUInt(op1->ui & value2);
7212 exp->expType = op1->type;
7214 op1->type->refCount++;
7219 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7221 short value2 = op2->s;
7224 exp->string = PrintShort(op1->s & value2);
7227 exp->expType = op1->type;
7229 op1->type->refCount++;
7234 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7236 unsigned short value2 = op2->us;
7239 exp->string = PrintUShort(op1->us & value2);
7242 exp->expType = op1->type;
7244 op1->type->refCount++;
7249 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7251 char value2 = op2->c;
7254 exp->string = PrintChar(op1->c & value2);
7257 exp->expType = op1->type;
7259 op1->type->refCount++;
7264 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7266 unsigned char value2 = op2->uc;
7269 exp->string = PrintUChar(op1->uc & value2);
7272 exp->expType = op1->type;
7274 op1->type->refCount++;
7279 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7281 int value2 = op2->i;
7284 exp->string = PrintInt(op1->i | value2);
7287 exp->expType = op1->type;
7289 op1->type->refCount++;
7294 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7296 unsigned int value2 = op2->ui;
7299 exp->string = PrintUInt(op1->ui | value2);
7302 exp->expType = op1->type;
7304 op1->type->refCount++;
7309 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7311 short value2 = op2->s;
7314 exp->string = PrintShort(op1->s | value2);
7317 exp->expType = op1->type;
7319 op1->type->refCount++;
7324 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7326 unsigned short value2 = op2->us;
7329 exp->string = PrintUShort(op1->us | value2);
7332 exp->expType = op1->type;
7334 op1->type->refCount++;
7339 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7341 char value2 = op2->c;
7344 exp->string = PrintChar(op1->c | value2);
7347 exp->expType = op1->type;
7349 op1->type->refCount++;
7354 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7356 unsigned char value2 = op2->uc;
7359 exp->string = PrintUChar(op1->uc | value2);
7362 exp->expType = op1->type;
7364 op1->type->refCount++;
7369 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7371 int value2 = op2->i;
7374 exp->string = PrintInt(op1->i ^ value2);
7377 exp->expType = op1->type;
7379 op1->type->refCount++;
7384 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7386 unsigned int value2 = op2->ui;
7389 exp->string = PrintUInt(op1->ui ^ value2);
7392 exp->expType = op1->type;
7394 op1->type->refCount++;
7399 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7401 short value2 = op2->s;
7404 exp->string = PrintShort(op1->s ^ value2);
7407 exp->expType = op1->type;
7409 op1->type->refCount++;
7414 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7416 unsigned short value2 = op2->us;
7419 exp->string = PrintUShort(op1->us ^ value2);
7422 exp->expType = op1->type;
7424 op1->type->refCount++;
7429 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7431 char value2 = op2->c;
7434 exp->string = PrintChar(op1->c ^ value2);
7437 exp->expType = op1->type;
7439 op1->type->refCount++;
7444 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7446 unsigned char value2 = op2->uc;
7449 exp->string = PrintUChar(op1->uc ^ value2);
7452 exp->expType = op1->type;
7454 op1->type->refCount++;
7459 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7461 int value2 = op2->i;
7464 exp->string = PrintInt(op1->i << value2);
7467 exp->expType = op1->type;
7469 op1->type->refCount++;
7474 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7476 unsigned int value2 = op2->ui;
7479 exp->string = PrintUInt(op1->ui << value2);
7482 exp->expType = op1->type;
7484 op1->type->refCount++;
7489 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7491 short value2 = op2->s;
7494 exp->string = PrintShort(op1->s << value2);
7497 exp->expType = op1->type;
7499 op1->type->refCount++;
7504 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7506 unsigned short value2 = op2->us;
7509 exp->string = PrintUShort(op1->us << value2);
7512 exp->expType = op1->type;
7514 op1->type->refCount++;
7519 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7521 char value2 = op2->c;
7524 exp->string = PrintChar(op1->c << value2);
7527 exp->expType = op1->type;
7529 op1->type->refCount++;
7534 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7536 unsigned char value2 = op2->uc;
7539 exp->string = PrintUChar(op1->uc << value2);
7542 exp->expType = op1->type;
7544 op1->type->refCount++;
7549 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7551 int value2 = op2->i;
7554 exp->string = PrintInt(op1->i >> value2);
7557 exp->expType = op1->type;
7559 op1->type->refCount++;
7564 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7566 unsigned int value2 = op2->ui;
7569 exp->string = PrintUInt(op1->ui >> value2);
7572 exp->expType = op1->type;
7574 op1->type->refCount++;
7579 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7581 short value2 = op2->s;
7584 exp->string = PrintShort(op1->s >> value2);
7587 exp->expType = op1->type;
7589 op1->type->refCount++;
7594 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7596 unsigned short value2 = op2->us;
7599 exp->string = PrintUShort(op1->us >> value2);
7602 exp->expType = op1->type;
7604 op1->type->refCount++;
7609 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7611 char value2 = op2->c;
7614 exp->string = PrintChar(op1->c >> value2);
7617 exp->expType = op1->type;
7619 op1->type->refCount++;
7624 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7626 unsigned char value2 = op2->uc;
7629 exp->string = PrintUChar(op1->uc >> value2);
7632 exp->expType = op1->type;
7634 op1->type->refCount++;
7639 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7642 exp->string = PrintInt(~op1->i);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7655 exp->string = PrintUInt(~op1->ui);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7668 exp->string = PrintShort(~op1->s);
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7681 exp->string = PrintUShort(~op1->us);
7684 exp->expType = op1->type;
7686 op1->type->refCount++;
7691 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7694 exp->string = PrintChar(~op1->c);
7697 exp->expType = op1->type;
7699 op1->type->refCount++;
7704 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7707 exp->string = PrintUChar(~op1->uc);
7710 exp->expType = op1->type;
7712 op1->type->refCount++;
7717 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7719 int value2 = op2->i;
7722 exp->string = PrintInt(op1->i &= value2);
7725 exp->expType = op1->type;
7727 op1->type->refCount++;
7732 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7734 unsigned int value2 = op2->ui;
7737 exp->string = PrintUInt(op1->ui &= value2);
7740 exp->expType = op1->type;
7742 op1->type->refCount++;
7747 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7749 short value2 = op2->s;
7752 exp->string = PrintShort(op1->s &= value2);
7755 exp->expType = op1->type;
7757 op1->type->refCount++;
7762 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7764 unsigned short value2 = op2->us;
7767 exp->string = PrintUShort(op1->us &= value2);
7770 exp->expType = op1->type;
7772 op1->type->refCount++;
7777 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7779 char value2 = op2->c;
7782 exp->string = PrintChar(op1->c &= value2);
7785 exp->expType = op1->type;
7787 op1->type->refCount++;
7792 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7794 unsigned char value2 = op2->uc;
7797 exp->string = PrintUChar(op1->uc &= value2);
7800 exp->expType = op1->type;
7802 op1->type->refCount++;
7807 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7809 int value2 = op2->i;
7812 exp->string = PrintInt(op1->i |= value2);
7815 exp->expType = op1->type;
7817 op1->type->refCount++;
7822 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7824 unsigned int value2 = op2->ui;
7827 exp->string = PrintUInt(op1->ui |= value2);
7830 exp->expType = op1->type;
7832 op1->type->refCount++;
7837 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7839 short value2 = op2->s;
7842 exp->string = PrintShort(op1->s |= value2);
7845 exp->expType = op1->type;
7847 op1->type->refCount++;
7852 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7854 unsigned short value2 = op2->us;
7857 exp->string = PrintUShort(op1->us |= value2);
7860 exp->expType = op1->type;
7862 op1->type->refCount++;
7867 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7869 char value2 = op2->c;
7872 exp->string = PrintChar(op1->c |= value2);
7875 exp->expType = op1->type;
7877 op1->type->refCount++;
7882 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7884 unsigned char value2 = op2->uc;
7887 exp->string = PrintUChar(op1->uc |= value2);
7890 exp->expType = op1->type;
7892 op1->type->refCount++;
7897 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7899 int value2 = op2->i;
7902 exp->string = PrintInt(op1->i ^= value2);
7905 exp->expType = op1->type;
7907 op1->type->refCount++;
7912 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7914 unsigned int value2 = op2->ui;
7917 exp->string = PrintUInt(op1->ui ^= value2);
7920 exp->expType = op1->type;
7922 op1->type->refCount++;
7927 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7929 short value2 = op2->s;
7932 exp->string = PrintShort(op1->s ^= value2);
7935 exp->expType = op1->type;
7937 op1->type->refCount++;
7942 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7944 unsigned short value2 = op2->us;
7947 exp->string = PrintUShort(op1->us ^= value2);
7950 exp->expType = op1->type;
7952 op1->type->refCount++;
7957 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7959 char value2 = op2->c;
7962 exp->string = PrintChar(op1->c ^= value2);
7965 exp->expType = op1->type;
7967 op1->type->refCount++;
7972 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7974 unsigned char value2 = op2->uc;
7977 exp->string = PrintUChar(op1->uc ^= value2);
7980 exp->expType = op1->type;
7982 op1->type->refCount++;
7987 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7989 int value2 = op2->i;
7992 exp->string = PrintInt(op1->i <<= value2);
7995 exp->expType = op1->type;
7997 op1->type->refCount++;
8002 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8004 unsigned int value2 = op2->ui;
8007 exp->string = PrintUInt(op1->ui <<= value2);
8010 exp->expType = op1->type;
8012 op1->type->refCount++;
8017 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8019 short value2 = op2->s;
8022 exp->string = PrintShort(op1->s <<= value2);
8025 exp->expType = op1->type;
8027 op1->type->refCount++;
8032 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8034 unsigned short value2 = op2->us;
8037 exp->string = PrintUShort(op1->us <<= value2);
8040 exp->expType = op1->type;
8042 op1->type->refCount++;
8047 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8049 char value2 = op2->c;
8052 exp->string = PrintChar(op1->c <<= value2);
8055 exp->expType = op1->type;
8057 op1->type->refCount++;
8062 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8064 unsigned char value2 = op2->uc;
8067 exp->string = PrintUChar(op1->uc <<= value2);
8070 exp->expType = op1->type;
8072 op1->type->refCount++;
8077 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8079 int value2 = op2->i;
8082 exp->string = PrintInt(op1->i >>= value2);
8085 exp->expType = op1->type;
8087 op1->type->refCount++;
8092 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8094 unsigned int value2 = op2->ui;
8097 exp->string = PrintUInt(op1->ui >>= value2);
8100 exp->expType = op1->type;
8102 op1->type->refCount++;
8107 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8109 short value2 = op2->s;
8112 exp->string = PrintShort(op1->s >>= value2);
8115 exp->expType = op1->type;
8117 op1->type->refCount++;
8122 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8124 unsigned short value2 = op2->us;
8127 exp->string = PrintUShort(op1->us >>= value2);
8130 exp->expType = op1->type;
8132 op1->type->refCount++;
8137 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8139 char value2 = op2->c;
8142 exp->string = PrintChar(op1->c >>= value2);
8145 exp->expType = op1->type;
8147 op1->type->refCount++;
8152 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8154 unsigned char value2 = op2->uc;
8157 exp->string = PrintUChar(op1->uc >>= value2);
8160 exp->expType = op1->type;
8162 op1->type->refCount++;
8167 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8170 exp->string = PrintInt(!op1->i);
8173 exp->expType = op1->type;
8175 op1->type->refCount++;
8180 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8183 exp->string = PrintUInt(!op1->ui);
8186 exp->expType = op1->type;
8188 op1->type->refCount++;
8193 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8196 exp->string = PrintShort(!op1->s);
8199 exp->expType = op1->type;
8201 op1->type->refCount++;
8206 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8209 exp->string = PrintUShort(!op1->us);
8212 exp->expType = op1->type;
8214 op1->type->refCount++;
8219 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8222 exp->string = PrintChar(!op1->c);
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8235 exp->string = PrintUChar(!op1->uc);
8238 exp->expType = op1->type;
8240 op1->type->refCount++;
8245 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8247 int value2 = op2->i;
8250 exp->string = PrintInt(op1->i == value2);
8253 exp->expType = op1->type;
8255 op1->type->refCount++;
8260 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8262 unsigned int value2 = op2->ui;
8265 exp->string = PrintUInt(op1->ui == value2);
8268 exp->expType = op1->type;
8270 op1->type->refCount++;
8275 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8277 short value2 = op2->s;
8280 exp->string = PrintShort(op1->s == value2);
8283 exp->expType = op1->type;
8285 op1->type->refCount++;
8290 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8292 unsigned short value2 = op2->us;
8295 exp->string = PrintUShort(op1->us == value2);
8298 exp->expType = op1->type;
8300 op1->type->refCount++;
8305 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8307 char value2 = op2->c;
8310 exp->string = PrintChar(op1->c == value2);
8313 exp->expType = op1->type;
8315 op1->type->refCount++;
8320 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8322 unsigned char value2 = op2->uc;
8325 exp->string = PrintUChar(op1->uc == value2);
8328 exp->expType = op1->type;
8330 op1->type->refCount++;
8335 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8337 float value2 = op2->f;
8340 exp->string = PrintFloat(op1->f == value2);
8343 exp->expType = op1->type;
8345 op1->type->refCount++;
8350 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8352 double value2 = op2->d;
8355 exp->string = PrintDouble(op1->d == value2);
8358 exp->expType = op1->type;
8360 op1->type->refCount++;
8365 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8367 int value2 = op2->i;
8370 exp->string = PrintInt(op1->i != value2);
8373 exp->expType = op1->type;
8375 op1->type->refCount++;
8380 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8382 unsigned int value2 = op2->ui;
8385 exp->string = PrintUInt(op1->ui != value2);
8388 exp->expType = op1->type;
8390 op1->type->refCount++;
8395 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8397 short value2 = op2->s;
8400 exp->string = PrintShort(op1->s != value2);
8403 exp->expType = op1->type;
8405 op1->type->refCount++;
8410 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8412 unsigned short value2 = op2->us;
8415 exp->string = PrintUShort(op1->us != value2);
8418 exp->expType = op1->type;
8420 op1->type->refCount++;
8425 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8427 char value2 = op2->c;
8430 exp->string = PrintChar(op1->c != value2);
8433 exp->expType = op1->type;
8435 op1->type->refCount++;
8440 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8442 unsigned char value2 = op2->uc;
8445 exp->string = PrintUChar(op1->uc != value2);
8448 exp->expType = op1->type;
8450 op1->type->refCount++;
8455 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8457 float value2 = op2->f;
8460 exp->string = PrintFloat(op1->f != value2);
8463 exp->expType = op1->type;
8465 op1->type->refCount++;
8470 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8472 double value2 = op2->d;
8475 exp->string = PrintDouble(op1->d != value2);
8478 exp->expType = op1->type;
8480 op1->type->refCount++;
8485 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8487 int value2 = op2->i;
8490 exp->string = PrintInt(op1->i && value2);
8493 exp->expType = op1->type;
8495 op1->type->refCount++;
8500 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8502 unsigned int value2 = op2->ui;
8505 exp->string = PrintUInt(op1->ui && value2);
8508 exp->expType = op1->type;
8510 op1->type->refCount++;
8515 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8517 short value2 = op2->s;
8520 exp->string = PrintShort(op1->s && value2);
8523 exp->expType = op1->type;
8525 op1->type->refCount++;
8530 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8532 unsigned short value2 = op2->us;
8535 exp->string = PrintUShort(op1->us && value2);
8538 exp->expType = op1->type;
8540 op1->type->refCount++;
8545 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8547 char value2 = op2->c;
8550 exp->string = PrintChar(op1->c && value2);
8553 exp->expType = op1->type;
8555 op1->type->refCount++;
8560 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8562 unsigned char value2 = op2->uc;
8565 exp->string = PrintUChar(op1->uc && value2);
8568 exp->expType = op1->type;
8570 op1->type->refCount++;
8575 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8577 float value2 = op2->f;
8580 exp->string = PrintFloat(op1->f && value2);
8583 exp->expType = op1->type;
8585 op1->type->refCount++;
8590 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8592 double value2 = op2->d;
8595 exp->string = PrintDouble(op1->d && value2);
8598 exp->expType = op1->type;
8600 op1->type->refCount++;
8605 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8607 int value2 = op2->i;
8610 exp->string = PrintInt(op1->i || value2);
8613 exp->expType = op1->type;
8615 op1->type->refCount++;
8620 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8622 unsigned int value2 = op2->ui;
8625 exp->string = PrintUInt(op1->ui || value2);
8628 exp->expType = op1->type;
8630 op1->type->refCount++;
8635 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8637 short value2 = op2->s;
8640 exp->string = PrintShort(op1->s || value2);
8643 exp->expType = op1->type;
8645 op1->type->refCount++;
8650 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8652 unsigned short value2 = op2->us;
8655 exp->string = PrintUShort(op1->us || value2);
8658 exp->expType = op1->type;
8660 op1->type->refCount++;
8665 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8667 char value2 = op2->c;
8670 exp->string = PrintChar(op1->c || value2);
8673 exp->expType = op1->type;
8675 op1->type->refCount++;
8680 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8682 unsigned char value2 = op2->uc;
8685 exp->string = PrintUChar(op1->uc || value2);
8688 exp->expType = op1->type;
8690 op1->type->refCount++;
8695 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8697 float value2 = op2->f;
8700 exp->string = PrintFloat(op1->f || value2);
8703 exp->expType = op1->type;
8705 op1->type->refCount++;
8710 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8712 double value2 = op2->d;
8715 exp->string = PrintDouble(op1->d || value2);
8718 exp->expType = op1->type;
8720 op1->type->refCount++;
8725 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8727 int value2 = op2->i;
8730 exp->string = PrintInt(op1->i > value2);
8733 exp->expType = op1->type;
8735 op1->type->refCount++;
8740 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8742 unsigned int value2 = op2->ui;
8745 exp->string = PrintUInt(op1->ui > value2);
8748 exp->expType = op1->type;
8750 op1->type->refCount++;
8755 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8757 short value2 = op2->s;
8760 exp->string = PrintShort(op1->s > value2);
8763 exp->expType = op1->type;
8765 op1->type->refCount++;
8770 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8772 unsigned short value2 = op2->us;
8775 exp->string = PrintUShort(op1->us > value2);
8778 exp->expType = op1->type;
8780 op1->type->refCount++;
8785 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8787 char value2 = op2->c;
8790 exp->string = PrintChar(op1->c > value2);
8793 exp->expType = op1->type;
8795 op1->type->refCount++;
8800 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8802 unsigned char value2 = op2->uc;
8805 exp->string = PrintUChar(op1->uc > value2);
8808 exp->expType = op1->type;
8810 op1->type->refCount++;
8815 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8817 float value2 = op2->f;
8820 exp->string = PrintFloat(op1->f > value2);
8823 exp->expType = op1->type;
8825 op1->type->refCount++;
8830 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8832 double value2 = op2->d;
8835 exp->string = PrintDouble(op1->d > value2);
8838 exp->expType = op1->type;
8840 op1->type->refCount++;
8845 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8847 int value2 = op2->i;
8850 exp->string = PrintInt(op1->i < value2);
8853 exp->expType = op1->type;
8855 op1->type->refCount++;
8860 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8862 unsigned int value2 = op2->ui;
8865 exp->string = PrintUInt(op1->ui < value2);
8868 exp->expType = op1->type;
8870 op1->type->refCount++;
8875 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8877 short value2 = op2->s;
8880 exp->string = PrintShort(op1->s < value2);
8883 exp->expType = op1->type;
8885 op1->type->refCount++;
8890 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8892 unsigned short value2 = op2->us;
8895 exp->string = PrintUShort(op1->us < value2);
8898 exp->expType = op1->type;
8900 op1->type->refCount++;
8905 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8907 char value2 = op2->c;
8910 exp->string = PrintChar(op1->c < value2);
8913 exp->expType = op1->type;
8915 op1->type->refCount++;
8920 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8922 unsigned char value2 = op2->uc;
8925 exp->string = PrintUChar(op1->uc < value2);
8928 exp->expType = op1->type;
8930 op1->type->refCount++;
8935 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8937 float value2 = op2->f;
8940 exp->string = PrintFloat(op1->f < value2);
8943 exp->expType = op1->type;
8945 op1->type->refCount++;
8950 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8952 double value2 = op2->d;
8955 exp->string = PrintDouble(op1->d < value2);
8958 exp->expType = op1->type;
8960 op1->type->refCount++;
8965 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8967 int value2 = op2->i;
8970 exp->string = PrintInt(op1->i >= value2);
8973 exp->expType = op1->type;
8975 op1->type->refCount++;
8980 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8982 unsigned int value2 = op2->ui;
8985 exp->string = PrintUInt(op1->ui >= value2);
8988 exp->expType = op1->type;
8990 op1->type->refCount++;
8995 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8997 short value2 = op2->s;
9000 exp->string = PrintShort(op1->s >= value2);
9003 exp->expType = op1->type;
9005 op1->type->refCount++;
9010 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9012 unsigned short value2 = op2->us;
9015 exp->string = PrintUShort(op1->us >= value2);
9018 exp->expType = op1->type;
9020 op1->type->refCount++;
9025 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9027 char value2 = op2->c;
9030 exp->string = PrintChar(op1->c >= value2);
9033 exp->expType = op1->type;
9035 op1->type->refCount++;
9040 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9042 unsigned char value2 = op2->uc;
9045 exp->string = PrintUChar(op1->uc >= value2);
9048 exp->expType = op1->type;
9050 op1->type->refCount++;
9055 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9057 float value2 = op2->f;
9060 exp->string = PrintFloat(op1->f >= value2);
9063 exp->expType = op1->type;
9065 op1->type->refCount++;
9070 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9072 double value2 = op2->d;
9075 exp->string = PrintDouble(op1->d >= value2);
9078 exp->expType = op1->type;
9080 op1->type->refCount++;
9085 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9087 int value2 = op2->i;
9090 exp->string = PrintInt(op1->i <= value2);
9093 exp->expType = op1->type;
9095 op1->type->refCount++;
9100 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9102 unsigned int value2 = op2->ui;
9105 exp->string = PrintUInt(op1->ui <= value2);
9108 exp->expType = op1->type;
9110 op1->type->refCount++;
9115 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9117 short value2 = op2->s;
9120 exp->string = PrintShort(op1->s <= value2);
9123 exp->expType = op1->type;
9125 op1->type->refCount++;
9130 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9132 unsigned short value2 = op2->us;
9135 exp->string = PrintUShort(op1->us <= value2);
9138 exp->expType = op1->type;
9140 op1->type->refCount++;
9145 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9147 char value2 = op2->c;
9150 exp->string = PrintChar(op1->c <= value2);
9153 exp->expType = op1->type;
9155 op1->type->refCount++;
9160 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9162 unsigned char value2 = op2->uc;
9165 exp->string = PrintUChar(op1->uc <= value2);
9168 exp->expType = op1->type;
9170 op1->type->refCount++;
9175 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9177 float value2 = op2->f;
9180 exp->string = PrintFloat(op1->f <= value2);
9183 exp->expType = op1->type;
9185 op1->type->refCount++;
9190 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9192 double value2 = op2->d;
9195 exp->string = PrintDouble(op1->d <= value2);
9198 exp->expType = op1->type;
9200 op1->type->refCount++;
9205 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9208 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9211 exp->expType = op1->type;
9213 op1->type->refCount++;
9218 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9221 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9224 exp->expType = op1->type;
9226 op1->type->refCount++;
9231 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9234 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9237 exp->expType = op1->type;
9239 op1->type->refCount++;
9244 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9247 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9250 exp->expType = op1->type;
9252 op1->type->refCount++;
9257 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9260 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9263 exp->expType = op1->type;
9265 op1->type->refCount++;
9270 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9273 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9276 exp->expType = op1->type;
9278 op1->type->refCount++;
9283 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9286 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9289 exp->expType = op1->type;
9291 op1->type->refCount++;
9296 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9299 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9302 exp->expType = op1->type;
9304 op1->type->refCount++;
9309 struct OpTable intOps =
9311 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
9314 struct OpTable uintOps =
9316 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
9319 struct OpTable shortOps =
9321 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
9324 struct OpTable ushortOps =
9326 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
9329 struct OpTable floatOps =
9331 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
9334 struct OpTable doubleOps =
9336 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
9339 struct OpTable charOps =
9341 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
9344 struct OpTable ucharOps =
9346 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
9349 void ReadString(char * output, char * string)
9351 int len = strlen(string);
9353 unsigned int quoted = 0x0, escaped = 0x0;
9355 for(c = 0; c < len; c++)
9357 char ch = string[c];
9413 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9415 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9417 extern double strtod(char * , char * * );
9419 struct Operand GetOperand(struct Expression * exp)
9425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9428 struct Type * type = exp->expType;
9432 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9434 if(!type->_class->registered->dataType)
9435 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9436 type = type->_class->registered->dataType;
9438 op.kind = type->kind;
9439 op.type = exp->expType;
9440 if(exp->isConstant && exp->type == 2)
9446 if(exp->constant[0] == '\'')
9447 op.c = exp->constant[1];
9448 else if(type->isSigned)
9450 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9455 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9463 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9468 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9476 op.i = strtol(exp->constant, (((void *)0)), 0);
9481 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9489 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9494 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9502 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9507 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9515 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9520 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9526 op.f = (float)strtod(exp->constant, (((void *)0)));
9530 op.d = (double)strtod(exp->constant, (((void *)0)));
9536 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9546 int __ecereVMethodID_class_OnGetString;
9548 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9550 static void UnusedFunction()
9554 ((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);
9557 extern int __ecereVMethodID_class_OnGetString;
9559 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9561 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9563 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9565 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9566 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9569 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9570 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9572 void * ptr = inst->data + dataMember->offset + offset;
9573 char * result = (((void *)0));
9575 exp->loc = member->loc = inst->loc;
9576 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9577 if(!dataMember->dataType)
9578 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9579 type = dataMember->dataType;
9582 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9584 if(_class->type == 4)
9586 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9590 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9591 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9593 for(item = e->values.first; item; item = item->next)
9595 if((int)item->data == *(int *)ptr)
9597 result = item->name;
9603 exp->identifier = MkIdentifier(result);
9605 exp->destType = MkClassType(_class->fullName);
9606 ProcessExpressionType(exp);
9610 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9612 if(!_class->dataType)
9613 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9614 type = _class->dataType;
9623 FreeExpContents(exp);
9624 exp->constant = PrintFloat(*(float *)ptr);
9630 FreeExpContents(exp);
9631 exp->constant = PrintDouble(*(double *)ptr);
9637 FreeExpContents(exp);
9638 exp->constant = PrintInt(*(int *)ptr);
9644 FreeExpContents(exp);
9645 exp->constant = PrintInt64(*(long long *)ptr);
9651 FreeExpContents(exp);
9652 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9658 FreeExpContents(exp);
9659 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9667 ListAdd(memberList, member);
9669 if(parentDataMember->type == 1)
9674 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9676 void PopulateInstance(struct Instantiation * inst)
9678 struct Symbol * classSym = inst->_class->symbol;
9679 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9680 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9681 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9684 inst->members = MkListOne(MkMembersInitList(memberList));
9686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
9687 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9689 if(!dataMember->isProperty)
9691 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9692 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9695 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9696 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9698 void * ptr = inst->data + dataMember->offset;
9699 char * result = (((void *)0));
9701 exp->loc = member->loc = inst->loc;
9702 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9703 if(!dataMember->dataType)
9704 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9705 type = dataMember->dataType;
9708 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9710 if(_class->type == 4)
9712 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9716 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9717 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9719 for(item = e->values.first; item; item = item->next)
9721 if((int)item->data == *(int *)ptr)
9723 result = item->name;
9730 exp->identifier = MkIdentifier(result);
9732 exp->destType = MkClassType(_class->fullName);
9733 ProcessExpressionType(exp);
9736 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9738 if(!_class->dataType)
9739 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9740 type = _class->dataType;
9749 exp->constant = PrintFloat(*(float *)ptr);
9755 exp->constant = PrintDouble(*(double *)ptr);
9761 exp->constant = PrintInt(*(int *)ptr);
9767 exp->constant = PrintInt64(*(long long *)ptr);
9773 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9781 ListAdd(memberList, member);
9787 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);
9789 extern void FreeInstance(struct Instantiation * inst);
9791 void ComputeInstantiation(struct Expression * exp)
9793 struct Instantiation * inst = exp->instance;
9794 struct MembersInit * members;
9795 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9796 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9797 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9798 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9799 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9800 int subMemberStackPos = 0;
9803 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9807 if(_class->type == 0 || _class->type == 5)
9808 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9810 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9814 for(members = (*inst->members).first; members; members = members->next)
9816 switch(members->type)
9820 if(members->dataMembers)
9822 struct MemberInit * member;
9824 for(member = (*members->dataMembers).first; member; member = member->next)
9826 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9827 unsigned int found = 0x0;
9828 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9829 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9830 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9831 unsigned int dataMemberOffset;
9835 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9838 if(curMember->isProperty)
9839 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9842 dataMember = curMember;
9843 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9850 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9854 if(prop->memberAccess == 1)
9856 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9857 curClass = prop->_class;
9862 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9863 int _subMemberStackPos = 0;
9865 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9869 if(dataMember->memberAccess == 1)
9871 curMember = dataMember;
9872 curClass = dataMember->_class;
9873 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
9874 subMemberStackPos = _subMemberStackPos;
9879 if(found && member->initializer && member->initializer->type == 0)
9881 struct Expression * value = member->initializer->exp;
9882 struct Type * type = (((void *)0));
9883 unsigned int deepMember = 0x0;
9887 type = prop->dataType;
9891 if(!dataMember->dataType)
9892 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9893 type = dataMember->dataType;
9895 if(ident && ident->next)
9898 for(ident = ident->next; ident && type; ident = ident->next)
9902 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9904 type = prop->dataType;
9907 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9909 type = dataMember->dataType;
9912 else if(type->kind == 9 || type->kind == 10)
9914 struct Type * memberType;
9916 for(memberType = type->members.first; memberType; memberType = memberType->next)
9918 if(!strcmp(memberType->name, ident->string))
9929 FreeType(value->destType);
9930 value->destType = type;
9933 ComputeExpression(value);
9935 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9939 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9941 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9943 if(!_class->dataType)
9944 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9945 type = _class->dataType;
9950 void * ptr = inst->data + dataMemberOffset;
9952 if(value->type == 2)
9958 GetInt(value, (int *)ptr);
9963 GetInt64(value, (long long *)ptr);
9968 GetIntPtr(value, (intptr_t *)ptr);
9973 GetIntSize(value, (ssize_t *)ptr);
9978 GetFloat(value, (float *)ptr);
9983 GetDouble(value, (double *)ptr);
9988 else if(value->type == 1)
9992 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9994 if(_class->type == 1)
9996 ComputeTypeSize(type);
9997 if(value->instance->data)
9998 memcpy(ptr, value->instance->data, type->size);
10005 if(value->type == 1 && value->instance->data)
10007 if(type->kind == 8)
10009 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10011 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)))
10013 void (* Set)(void *, void *) = (void *)prop->Set;
10015 Set(inst->data, value->instance->data);
10016 PopulateInstance(inst);
10020 else if(value->type == 2)
10026 void (* Set)(void *, double) = (void *)prop->Set;
10028 Set(inst->data, strtod(value->constant, (((void *)0))));
10033 void (* Set)(void *, float) = (void *)prop->Set;
10035 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10040 void (* Set)(void *, int) = (void *)prop->Set;
10042 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10047 void (* Set)(void *, long long) = (void *)prop->Set;
10049 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10054 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10056 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10061 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10063 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10068 else if(value->type == 3)
10072 ReadString(temp, value->string);
10073 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10077 else if(!deepMember && type && _class->type == 3)
10081 if(value->type == 2)
10083 if(type->kind == 8)
10085 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10087 if(_class->type == 3)
10089 if(!_class->dataType)
10090 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10091 type = _class->dataType;
10099 float (* Set)(float) = (void *)prop->Set;
10101 GetFloat(member->initializer->exp, &fValue);
10102 exp->constant = PrintFloat(Set(fValue));
10109 double (* Set)(double) = (void *)prop->Set;
10111 GetDouble(member->initializer->exp, &dValue);
10112 exp->constant = PrintDouble(Set(dValue));
10120 else if(!deepMember && type && _class->type == 2)
10124 if(value->type == 1 && value->instance->data)
10126 unsigned int (* Set)(void *) = (void *)prop->Set;
10128 bits = Set(value->instance->data);
10130 else if(value->type == 2)
10134 else if(dataMember)
10136 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10137 struct Type * type;
10140 GetInt(value, &part);
10141 bits = (bits & ~bitMember->mask);
10142 if(!bitMember->dataType)
10143 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10144 type = bitMember->dataType;
10145 if(type->kind == 8 && type->_class && type->_class->registered)
10147 if(!type->_class->registered->dataType)
10148 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10149 type = type->_class->registered->dataType;
10155 bits |= ((char)part << bitMember->pos);
10157 bits |= ((unsigned char)part << bitMember->pos);
10161 bits |= ((short)part << bitMember->pos);
10163 bits |= ((unsigned short)part << bitMember->pos);
10168 bits |= (part << bitMember->pos);
10170 bits |= ((unsigned int)part << bitMember->pos);
10174 bits |= ((long long)part << bitMember->pos);
10176 bits |= ((uint64)part << bitMember->pos);
10181 bits |= ((intptr_t)part << bitMember->pos);
10185 bits |= ((uintptr_t)part << bitMember->pos);
10191 bits |= ((ssize_t)part << bitMember->pos);
10195 bits |= ((size_t)part << bitMember->pos);
10204 if(_class && _class->type == 3)
10206 ComputeExpression(member->initializer->exp);
10207 exp->constant = member->initializer->exp->constant;
10209 member->initializer->exp->constant = (((void *)0));
10219 if(_class && _class->type == 2)
10221 exp->constant = PrintHexUInt(bits);
10226 FreeInstance(inst);
10230 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10232 if(exp->op.op == SIZEOF)
10234 FreeExpContents(exp);
10236 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10246 struct Expression * exp2 = exp->op.exp2;
10248 exp->op.exp2 = (((void *)0));
10249 FreeExpContents(exp);
10250 FreeType(exp->expType);
10251 FreeType(exp->destType);
10253 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10259 FreeExpContents(exp);
10260 op1->ops.Neg(exp, op1);
10264 if(op1->ops.BitNot)
10266 FreeExpContents(exp);
10267 op1->ops.BitNot(exp, op1);
10273 FreeExpContents(exp);
10274 op1->ops.Not(exp, op1);
10286 FreeExpContents(exp);
10287 op1->ops.Add(exp, op1, op2);
10293 FreeExpContents(exp);
10294 op1->ops.Sub(exp, op1, op2);
10300 FreeExpContents(exp);
10301 op1->ops.Mul(exp, op1, op2);
10307 FreeExpContents(exp);
10308 op1->ops.Div(exp, op1, op2);
10314 FreeExpContents(exp);
10315 op1->ops.Mod(exp, op1, op2);
10321 if(op1->ops.BitAnd)
10323 FreeExpContents(exp);
10324 op1->ops.BitAnd(exp, op1, op2);
10331 FreeExpContents(exp);
10332 op1->ops.BitOr(exp, op1, op2);
10336 if(op1->ops.BitXor)
10338 FreeExpContents(exp);
10339 op1->ops.BitXor(exp, op1, op2);
10343 if(op1->ops.LShift)
10345 FreeExpContents(exp);
10346 op1->ops.LShift(exp, op1, op2);
10350 if(op1->ops.RShift)
10352 FreeExpContents(exp);
10353 op1->ops.RShift(exp, op1, op2);
10359 FreeExpContents(exp);
10360 op1->ops.Equ(exp, op1, op2);
10366 FreeExpContents(exp);
10367 op1->ops.Nqu(exp, op1, op2);
10373 FreeExpContents(exp);
10374 op1->ops.And(exp, op1, op2);
10380 FreeExpContents(exp);
10381 op1->ops.Or(exp, op1, op2);
10387 FreeExpContents(exp);
10388 op1->ops.Grt(exp, op1, op2);
10394 FreeExpContents(exp);
10395 op1->ops.Sma(exp, op1, op2);
10399 if(op1->ops.GrtEqu)
10401 FreeExpContents(exp);
10402 op1->ops.GrtEqu(exp, op1, op2);
10406 if(op1->ops.SmaEqu)
10408 FreeExpContents(exp);
10409 op1->ops.SmaEqu(exp, op1, op2);
10417 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
10419 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10421 void ComputeExpression(struct Expression * exp)
10423 char expString[10240];
10425 expString[0] = '\0';
10430 ComputeInstantiation(exp);
10435 struct Expression * exp1, * exp2 = (((void *)0));
10436 struct Operand op1 =
10440 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10443 struct Operand op2 =
10447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10452 ComputeExpression(exp->op.exp2);
10455 ComputeExpression(exp->op.exp1);
10456 exp1 = exp->op.exp1;
10457 exp2 = exp->op.exp2;
10458 op1 = GetOperand(exp1);
10460 op1.type->refCount++;
10463 op2 = GetOperand(exp2);
10465 op2.type->refCount++;
10470 exp1 = exp->op.exp2;
10471 op1 = GetOperand(exp1);
10473 op1.type->refCount++;
10475 CallOperator(exp, exp1, exp2, &op1, &op2);
10477 FreeType(op1.type);
10479 FreeType(op2.type);
10485 struct Expression * e, * n;
10487 for(e = (*exp->list).first; e; e = n)
10492 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10494 ComputeExpression(e);
10495 FreeType(exp->expType);
10496 FreeType(exp->destType);
10498 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10499 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10510 struct Expression * memberExp = exp->member.exp;
10511 struct Identifier * memberID = exp->member.member;
10512 struct Type * type;
10514 ComputeExpression(exp->member.exp);
10515 type = exp->member.exp->expType;
10518 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)));
10519 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10520 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10521 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10523 if(type->kind == 19 && exp->member.exp->type == 26)
10524 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10528 struct Symbol * classSym;
10531 PrintTypeNoConst(type, string, 0x0, 0x1);
10532 classSym = FindClass(string);
10533 _class = classSym ? classSym->registered : (((void *)0));
10535 if(exp->member.member)
10537 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10539 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10541 if(!prop && !member && _class && exp->member.member)
10543 struct Symbol * classSym = FindClass(exp->member.member->string);
10545 convertTo = _class;
10546 _class = classSym ? classSym->registered : (((void *)0));
10547 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10553 struct Type * type = prop->dataType;
10555 if(_class->type == 3)
10557 if(type->kind == 8)
10559 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10561 if(_class->type == 3)
10563 if(!_class->dataType)
10564 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10565 type = _class->dataType;
10573 float (* Get)(float) = (void *)prop->Get;
10575 GetFloat(exp->member.exp, &value);
10576 exp->constant = PrintFloat(Get ? Get(value) : value);
10583 double (* Get)(double);
10585 GetDouble(exp->member.exp, &value);
10587 Get = (void *)prop->Set;
10589 Get = (void *)prop->Get;
10590 exp->constant = PrintDouble(Get ? Get(value) : value);
10600 struct Expression * value = exp->member.exp;
10601 struct Type * type;
10603 if(!prop->dataType)
10604 ProcessPropertyType(prop);
10605 type = prop->dataType;
10609 else if(_class->type == 1)
10615 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10617 if(propertyClass->type == 1 && value->type == 1)
10619 void (* Set)(void *, void *) = (void *)prop->Set;
10621 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10622 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10623 exp->instance->_class = MkSpecifierName(_class->fullName);
10624 exp->instance->loc = exp->loc;
10626 Set(exp->instance->data, value->instance->data);
10627 PopulateInstance(exp->instance);
10634 void (* Set)(void *, int) = (void *)prop->Set;
10636 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10637 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10638 exp->instance->_class = MkSpecifierName(_class->fullName);
10639 exp->instance->loc = exp->loc;
10641 GetInt(value, &intValue);
10642 Set(exp->instance->data, intValue);
10643 PopulateInstance(exp->instance);
10648 long long intValue;
10649 void (* Set)(void *, long long) = (void *)prop->Set;
10651 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10652 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10653 exp->instance->_class = MkSpecifierName(_class->fullName);
10654 exp->instance->loc = exp->loc;
10656 GetInt64(value, &intValue);
10657 Set(exp->instance->data, intValue);
10658 PopulateInstance(exp->instance);
10664 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10666 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10667 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10668 exp->instance->_class = MkSpecifierName(_class->fullName);
10669 exp->instance->loc = exp->loc;
10671 GetIntPtr(value, &intValue);
10672 Set(exp->instance->data, intValue);
10673 PopulateInstance(exp->instance);
10679 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10681 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10682 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10683 exp->instance->_class = MkSpecifierName(_class->fullName);
10684 exp->instance->loc = exp->loc;
10686 GetIntSize(value, &intValue);
10687 Set(exp->instance->data, intValue);
10688 PopulateInstance(exp->instance);
10693 double doubleValue;
10694 void (* Set)(void *, double) = (void *)prop->Set;
10696 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10697 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10698 exp->instance->_class = MkSpecifierName(_class->fullName);
10699 exp->instance->loc = exp->loc;
10701 GetDouble(value, &doubleValue);
10702 Set(exp->instance->data, doubleValue);
10703 PopulateInstance(exp->instance);
10708 else if(_class->type == 2)
10714 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10716 if(propertyClass->type == 1 && value->instance->data)
10718 unsigned int (* Set)(void *) = (void *)prop->Set;
10719 unsigned int bits = Set(value->instance->data);
10721 exp->constant = PrintHexUInt(bits);
10725 else if(_class->type == 2)
10727 unsigned int value;
10728 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10731 GetUInt(exp->member.exp, &value);
10733 exp->constant = PrintHexUInt(bits);
10742 if(_class->type == 2)
10744 unsigned int value;
10746 GetUInt(exp->member.exp, &value);
10751 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10753 if(_class->type == 1)
10755 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10757 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10758 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10759 exp->instance->_class = MkSpecifierName(_class->fullName);
10760 exp->instance->loc = exp->loc;
10762 Get(value, exp->instance->data);
10763 PopulateInstance(exp->instance);
10765 else if(_class->type == 2)
10767 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10768 uint64 bits = Get(value);
10770 exp->constant = PrintHexUInt64(bits);
10777 else if(_class->type == 1)
10779 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10785 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10787 if(_class->type == 1 && value)
10789 void (* Get)(void *, void *) = (void *)prop->Get;
10791 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10792 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10793 exp->instance->_class = MkSpecifierName(_class->fullName);
10794 exp->instance->loc = exp->loc;
10796 Get(value, exp->instance->data);
10797 PopulateInstance(exp->instance);
10808 exp->isConstant = 0x0;
10817 FreeExpression(memberExp);
10818 FreeIdentifier(memberID);
10824 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10826 FreeExpContents(exp);
10827 exp->constant = PrintUInt(ComputeTypeSize(type));
10834 struct Symbol * classSym = exp->_class->symbol;
10836 if(classSym && classSym->registered)
10838 if(classSym->registered->fixed)
10840 FreeSpecifier(exp->_class);
10841 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10846 char className[1024];
10848 strcpy(className, "__ecereClass_");
10849 FullClassNameCat(className, classSym->string, 0x1);
10850 MangleClassName(className);
10851 FreeExpContents(exp);
10853 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10854 exp->member.member = MkIdentifier("structSize");
10861 struct Type * type;
10862 struct Expression * e = exp;
10864 if(exp->type == 11)
10867 ComputeExpression(exp->cast.exp);
10870 if(e && exp->expType)
10872 type = exp->expType;
10873 if(type->kind == 8)
10875 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10877 if(_class && (_class->type == 3 || _class->type == 2))
10879 if(!_class->dataType)
10880 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10881 type = _class->dataType;
10891 GetChar(e, &value);
10892 FreeExpContents(exp);
10893 exp->constant = PrintChar(value);
10898 unsigned char value;
10900 GetUChar(e, &value);
10901 FreeExpContents(exp);
10902 exp->constant = PrintUChar(value);
10911 GetShort(e, &value);
10912 FreeExpContents(exp);
10913 exp->constant = PrintShort(value);
10918 unsigned short value;
10920 GetUShort(e, &value);
10921 FreeExpContents(exp);
10922 exp->constant = PrintUShort(value);
10932 FreeExpContents(exp);
10933 exp->constant = PrintInt(value);
10938 unsigned int value;
10940 GetUInt(e, &value);
10941 FreeExpContents(exp);
10942 exp->constant = PrintUInt(value);
10951 GetInt64(e, &value);
10952 FreeExpContents(exp);
10953 exp->constant = PrintInt64(value);
10960 GetUInt64(e, &value);
10961 FreeExpContents(exp);
10962 exp->constant = PrintUInt64(value);
10971 GetIntPtr(e, &value);
10972 FreeExpContents(exp);
10973 exp->constant = PrintInt64((long long)value);
10980 GetUIntPtr(e, &value);
10981 FreeExpContents(exp);
10982 exp->constant = PrintUInt64((uint64)value);
10991 GetIntSize(e, &value);
10992 FreeExpContents(exp);
10993 exp->constant = PrintInt64((long long)value);
11000 GetUIntSize(e, &value);
11001 FreeExpContents(exp);
11002 exp->constant = PrintUInt64((uint64)value);
11010 GetFloat(e, &value);
11011 FreeExpContents(exp);
11012 exp->constant = PrintFloat(value);
11020 GetDouble(e, &value);
11021 FreeExpContents(exp);
11022 exp->constant = PrintDouble(value);
11032 struct Operand op1 =
11036 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11039 struct Operand op2 =
11043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11046 struct Operand op3 =
11050 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11055 ComputeExpression((*exp->cond.exp).last);
11056 if(exp->cond.elseExp)
11057 ComputeExpression(exp->cond.elseExp);
11059 ComputeExpression(exp->cond.cond);
11060 op1 = GetOperand(exp->cond.cond);
11062 op1.type->refCount++;
11063 op2 = GetOperand((*exp->cond.exp).last);
11065 op2.type->refCount++;
11066 op3 = GetOperand(exp->cond.elseExp);
11068 op3.type->refCount++;
11071 FreeExpContents(exp);
11072 op1.ops.Cond(exp, &op1, &op2, &op3);
11075 FreeType(op1.type);
11077 FreeType(op2.type);
11079 FreeType(op3.type);
11085 void ApplyAnyObjectLogic(struct Expression * e);
11087 extern void CopyTypeInto(struct Type * type, struct Type * src);
11089 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11091 unsigned int result = 0x1;
11095 struct __ecereNameSpace__ecere__sys__OldList converts =
11099 struct Conversion * convert;
11101 if(destType->kind == 0)
11103 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11107 for(convert = converts.first; convert; convert = convert->next)
11109 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11113 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11114 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11117 newExp->destType = (((void *)0));
11121 exp->addedThis = 0x1;
11122 exp->member.exp = newExp;
11123 FreeType(exp->member.exp->expType);
11124 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11125 exp->member.exp->expType->classObjectType = objectType;
11126 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11127 exp->member.memberType = 1;
11128 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11129 exp->needCast = 0x1;
11131 exp->expType->refCount++;
11132 ApplyAnyObjectLogic(exp->member.exp);
11138 exp->addedThis = 0x1;
11139 exp->member.exp = newExp;
11140 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11142 newExp->byReference = 0x1;
11144 FreeType(exp->member.exp->expType);
11145 exp->member.exp->expType = (((void *)0));
11146 if(convert->convert->dataType)
11148 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11149 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11150 exp->member.exp->expType->refCount = 1;
11151 exp->member.exp->expType->classObjectType = objectType;
11152 ApplyAnyObjectLogic(exp->member.exp);
11154 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11155 exp->member.memberType = 4;
11156 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11157 exp->needCast = 0x1;
11158 if(convert->resultType)
11159 convert->resultType->refCount++;
11165 FreeType(exp->expType);
11168 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11169 exp->needCast = 0x1;
11171 exp->expType->refCount++;
11175 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11176 exp->needCast = 0x1;
11177 if(convert->resultType)
11178 convert->resultType->refCount++;
11182 if(exp->isConstant && inCompiler)
11183 ComputeExpression(exp);
11184 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11186 if(!result && exp->expType && converts.count)
11188 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11190 if(!result && exp->expType && exp->destType)
11192 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))
11199 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11201 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11203 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11205 void CheckTemplateTypes(struct Expression * exp)
11207 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11209 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11210 struct Statement * compound;
11211 struct Context * context;
11215 exp->destType->refCount++;
11217 exp->expType->refCount++;
11218 newExp->prev = (((void *)0));
11219 newExp->next = (((void *)0));
11220 switch(exp->expType->kind)
11223 if(exp->destType->classObjectType)
11226 exp->destType->refCount--;
11228 exp->expType->refCount--;
11229 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11233 struct __ecereNameSpace__ecere__sys__OldList * specs;
11234 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11235 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11237 context = PushContext();
11238 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11239 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11240 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11242 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11243 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11244 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11245 exp->compound->compound.context = context;
11246 PopContext(context);
11251 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11252 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11256 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11258 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11259 struct Statement * compound;
11260 struct Context * context;
11264 exp->destType->refCount++;
11266 exp->expType->refCount++;
11267 newExp->prev = (((void *)0));
11268 newExp->next = (((void *)0));
11269 switch(exp->expType->kind)
11272 if(exp->destType->classObjectType)
11275 exp->destType->refCount--;
11277 exp->expType->refCount--;
11278 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11282 struct __ecereNameSpace__ecere__sys__OldList * specs;
11283 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11284 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11286 context = PushContext();
11287 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11288 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11289 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11291 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11292 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11293 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11294 exp->compound->compound.context = context;
11295 PopContext(context);
11300 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11303 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11304 ProcessExpressionType((*exp->list).first);
11310 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11311 newExp->needCast = 0x1;
11312 ProcessExpressionType((*exp->list).first);
11318 if(exp->expType->kind == 20)
11320 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11324 FreeType(exp->destType);
11325 FreeType(exp->expType);
11326 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11330 if(newExp->type == 8 && newExp->member.memberType == 3)
11334 exp->op.exp1 = (((void *)0));
11335 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11339 char typeString[1024];
11340 struct Declarator * decl;
11341 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11343 typeString[0] = '\0';
11344 PrintType(exp->expType, typeString, 0x0, 0x0);
11345 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11347 exp->cast.typeName = MkTypeName(specs, decl);
11348 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11349 exp->cast.exp->needCast = 0x1;
11357 extern int strncmp(const char * , const char * , size_t n);
11359 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11361 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11363 int nsLen = strlen(nameSpace);
11364 struct Symbol * symbol;
11366 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)))
11368 char * s = symbol->string;
11370 if(!strncmp(s, nameSpace, nsLen))
11375 for(c = strlen(s) - 1; c >= 0; c--)
11378 namePart = s + c + 1;
11379 if(!strcmp(namePart, name))
11387 return (((void *)0));
11390 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11393 char nameSpace[1024];
11395 unsigned int gotColon = 0x0;
11397 nameSpace[0] = '\0';
11398 for(c = strlen(name) - 1; c >= 0; c--)
11404 namePart = name + c + 1;
11405 while(c >= 0 && name[c] == ':')
11409 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11413 memcpy(nameSpace, name, c + 1);
11414 nameSpace[c + 1] = (char)0;
11415 return ScanWithNameSpace(tree, nameSpace, namePart);
11419 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11425 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11429 return ScanWithNameSpace(tree, "", namePart);
11431 return (((void *)0));
11434 static void ProcessDeclaration(struct Declaration * decl);
11436 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11438 struct Context * ctx;
11439 struct Symbol * symbol = (((void *)0));
11441 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11443 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11445 symbol = (((void *)0));
11448 char curName[1024];
11450 strcpy(curName, thisNameSpace);
11451 strcat(curName, "::");
11452 strcat(curName, name);
11453 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11456 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11459 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11460 if(symbol || ctx == endContext)
11463 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11465 if(symbol->pointerExternal->type == 0)
11467 struct FunctionDefinition * function = symbol->pointerExternal->function;
11468 struct Context * tmpContext = curContext;
11470 curContext = (((void *)0));
11471 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11472 curContext = tmpContext;
11473 symbol->pointerExternal->symbol = symbol;
11474 DeclareType(symbol->type, 0x1, 0x1);
11475 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11476 symbol->id = curExternal->symbol->idCode;
11478 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11480 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11481 symbol->id = curExternal->symbol->idCode;
11487 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11489 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11490 ListAdd(specs, MkSpecifier(UNSIGNED));
11495 if(type->_class->registered)
11497 if(!type->_class->registered->dataType)
11498 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11499 GetTypeSpecs(type->_class->registered->dataType, specs);
11504 ListAdd(specs, MkSpecifier(DOUBLE));
11507 ListAdd(specs, MkSpecifier(FLOAT));
11510 ListAdd(specs, MkSpecifier(CHAR));
11513 ListAdd(specs, MkSpecifier(SHORT));
11516 ListAdd(specs, MkSpecifier(INT64));
11519 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11522 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11526 ListAdd(specs, MkSpecifier(INT));
11531 static void PrintArraySize(struct Type * arrayType, char * string)
11537 if(arrayType->enumClass)
11538 strcat(size, arrayType->enumClass->string);
11539 else if(arrayType->arraySizeExp)
11540 PrintExpression(arrayType->arraySizeExp, size);
11542 strcat(string, size);
11545 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
11549 if(printConst && type->constant)
11550 strcat(string, "const ");
11555 struct Symbol * c = type->_class;
11557 if(type->classObjectType == 2)
11558 strcat(string, "typed_object");
11559 else if(type->classObjectType == 3)
11560 strcat(string, "any_object");
11564 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
11566 if(type->byReference)
11567 strcat(string, " &");
11571 strcat(string, "void");
11574 strcat(string, type->isSigned ? "int" : "uint");
11577 strcat(string, type->isSigned ? "int64" : "uint64");
11580 strcat(string, type->isSigned ? "intptr" : "uintptr");
11583 strcat(string, type->isSigned ? "intsize" : "uintsize");
11586 strcat(string, type->isSigned ? "char" : "byte");
11589 strcat(string, type->isSigned ? "short" : "uint16");
11592 strcat(string, "float");
11595 strcat(string, "double");
11600 strcat(string, "struct ");
11601 strcat(string, type->enumName);
11603 else if(type->typeName)
11604 strcat(string, type->typeName);
11607 struct Type * member;
11609 strcat(string, "struct { ");
11610 for(member = type->members.first; member; member = member->next)
11612 PrintType(member, string, 0x1, fullName);
11613 strcat(string, "; ");
11615 strcat(string, "}");
11621 strcat(string, "union ");
11622 strcat(string, type->enumName);
11624 else if(type->typeName)
11625 strcat(string, type->typeName);
11628 strcat(string, "union ");
11629 strcat(string, "(unnamed)");
11635 strcat(string, "enum ");
11636 strcat(string, type->enumName);
11638 else if(type->typeName)
11639 strcat(string, type->typeName);
11641 strcat(string, "int");
11644 strcat(string, "...");
11647 strcat(string, "subclass(");
11648 strcat(string, type->_class ? type->_class->string : "int");
11649 strcat(string, ")");
11652 strcat(string, type->templateParameter->identifier->string);
11655 strcat(string, "thisclass");
11658 strcat(string, "__builtin_va_list");
11664 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11666 static void PrintName(struct Type * type, char * string, unsigned int fullName)
11668 if(type->name && type->name[0])
11671 strcat(string, type->name);
11674 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11680 strcat(string, name);
11685 static void PrintAttribs(struct Type * type, char * string)
11689 if(type->dllExport)
11690 strcat(string, "dllexport ");
11691 if(type->attrStdcall)
11692 strcat(string, "stdcall ");
11696 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
11698 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11700 struct Type * attrType = (((void *)0));
11702 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
11703 PrintAttribs(type, string);
11704 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
11705 strcat(string, " const");
11706 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
11707 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11708 strcat(string, " (");
11709 if(type->kind == 13)
11711 if(type->type->kind == 11 || type->type->kind == 16)
11712 PrintAttribs(type->type, string);
11714 if(type->kind == 13)
11716 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
11717 strcat(string, "*");
11719 strcat(string, " *");
11721 if(printConst && type->constant && type->kind == 13)
11722 strcat(string, " const");
11725 PrintTypeSpecs(type, string, fullName, printConst);
11728 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
11730 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11731 strcat(string, ")");
11732 if(type->kind == 12)
11733 PrintArraySize(type, string);
11734 else if(type->kind == 11)
11736 struct Type * param;
11738 strcat(string, "(");
11739 for(param = type->params.first; param; param = param->next)
11741 PrintType(param, string, 0x1, fullName);
11743 strcat(string, ", ");
11745 strcat(string, ")");
11747 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11748 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
11751 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
11753 PrePrintType(type, string, fullName, (((void *)0)), printConst);
11754 if(type->thisClass || (printName && type->name && type->name[0]))
11755 strcat(string, " ");
11756 if((type->thisClass || type->staticMethod))
11758 struct Symbol * _class = type->thisClass;
11760 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
11762 if(type->classObjectType == 1)
11763 strcat(string, "class");
11765 strcat(string, type->byReference ? "typed_object&" : "typed_object");
11767 else if(_class && _class->string)
11769 char * s = _class->string;
11775 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
11781 strcat(string, name);
11784 strcat(string, "::");
11786 if(printName && type->name)
11787 PrintName(type, string, fullName);
11788 PostPrintType(type, string, fullName);
11789 if(type->bitFieldCount)
11793 sprintf(count, ":%d", type->bitFieldCount);
11794 strcat(string, count);
11798 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11800 _PrintType(type, string, printName, fullName, 0x1);
11803 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11805 _PrintType(type, string, printName, fullName, 0x0);
11808 static struct Type * FindMember(struct Type * type, char * string)
11810 struct Type * memberType;
11812 for(memberType = type->members.first; memberType; memberType = memberType->next)
11814 if(!memberType->name)
11816 struct Type * subType = FindMember(memberType, string);
11821 else if(!strcmp(memberType->name, string))
11824 return (((void *)0));
11827 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11829 struct Type * memberType;
11831 for(memberType = type->members.first; memberType; memberType = memberType->next)
11833 if(!memberType->name)
11835 struct Type * subType = FindMember(memberType, string);
11839 *offset += memberType->offset;
11843 else if(!strcmp(memberType->name, string))
11845 *offset += memberType->offset;
11849 return (((void *)0));
11852 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11854 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11856 struct Expression * ParseExpressionString(char * expression)
11858 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11859 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11860 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11862 parsedExpression = (((void *)0));
11864 expression_yyparse();
11865 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11866 return parsedExpression;
11869 extern char * QMkString(char * source);
11871 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11873 struct Identifier * id = exp->identifier;
11874 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11875 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11876 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11877 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11879 if(_class && _class->type == 4)
11881 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11882 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11886 struct __ecereNameSpace__ecere__com__Class * baseClass;
11888 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11890 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11892 for(value = e->values.first; value; value = value->next)
11894 if(!strcmp(value->name, id->string))
11899 char constant[256];
11901 FreeExpContents(exp);
11903 exp->isConstant = 0x1;
11904 if(!strcmp(baseClass->dataTypeString, "int"))
11905 sprintf(constant, "%d", (int)value->data);
11907 sprintf(constant, "0x%X", (int)value->data);
11908 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11909 exp->expType = MkClassType(baseClass->fullName);
11917 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11919 ProcessMethodType(method);
11920 exp->expType = __extension__ ({
11921 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11923 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11927 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11929 if(!prop->dataType)
11930 ProcessPropertyType(prop);
11931 exp->expType = prop->dataType;
11933 prop->dataType->refCount++;
11936 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11938 if(!member->dataType)
11939 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11940 exp->expType = member->dataType;
11941 if(member->dataType)
11942 member->dataType->refCount++;
11945 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11947 if(!classProp->dataType)
11948 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11949 if(classProp->constant)
11951 FreeExpContents(exp);
11952 exp->isConstant = 0x1;
11953 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11956 exp->constant = QMkString((char *)classProp->Get(_class));
11960 char constant[256];
11963 sprintf(constant, "%d", (int)classProp->Get(_class));
11964 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11970 exp->expType = classProp->dataType;
11971 if(classProp->dataType)
11972 classProp->dataType->refCount++;
11978 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11980 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11981 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11982 struct __ecereNameSpace__ecere__com__NameSpace * child;
11986 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)))
11988 data = ScanGlobalData(child, name);
11996 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11998 extern char * strncpy(char * , const char * , size_t n);
12000 static struct GlobalData * FindGlobalData(char * name)
12003 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12005 nameSpace = globalData;
12006 for(c = 0; name[c]; c++)
12008 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
12010 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
12011 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
12013 strncpy(spaceName, name + start, c - start);
12014 spaceName[c - start] = '\0';
12015 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
12016 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
12018 return (((void *)0));
12019 nameSpace = newSpace;
12027 return ScanGlobalData(nameSpace, name + start);
12029 return (((void *)0));
12032 static int definedExpStackPos;
12034 static void * definedExpStack[512];
12036 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
12038 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
12040 FreeExpContents(checkedExp);
12041 FreeType(checkedExp->expType);
12042 FreeType(checkedExp->destType);
12043 *checkedExp = *newExp;
12044 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12045 checkedExp->prev = prev;
12046 checkedExp->next = next;
12049 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
12051 extern int printf(char * , ...);
12053 void __ecereMethod_Expression_Clear();
12055 void ApplyAnyObjectLogic(struct Expression * e)
12057 struct Type * destType = e->destType;
12059 if(destType && (destType->classObjectType == 3))
12061 if(e && e->expType)
12063 struct Type * type = e->expType;
12064 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12066 if(type->kind == 8 && type->_class && type->_class->registered)
12068 _class = type->_class->registered;
12070 else if(type->kind == 19)
12072 _class = FindClass("ecere::com::Class")->registered;
12076 char string[1024] = "";
12077 struct Symbol * classSym;
12079 PrintTypeNoConst(type, string, 0x0, 0x1);
12080 classSym = FindClass(string);
12082 _class = classSym->registered;
12084 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
12086 if(!_class || strcmp(_class->fullName, "char *"))
12088 struct Expression * checkedExp = e, * newExp;
12090 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12092 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12094 if(checkedExp->type == 25)
12096 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12099 checkedExp = (*checkedExp->list).last;
12101 else if(checkedExp->type == 11)
12102 checkedExp = checkedExp->cast.exp;
12104 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12106 newExp = checkedExp->op.exp2;
12107 checkedExp->op.exp2 = (((void *)0));
12108 FreeExpContents(checkedExp);
12109 if(e->expType && e->expType->passAsTemplate)
12113 ComputeTypeSize(e->expType);
12114 sprintf(size, "%d", e->expType->size);
12115 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))))));
12117 ReplaceExpContents(checkedExp, newExp);
12118 e->byReference = 0x1;
12120 else if(!e->byReference || (_class && _class->type == 5))
12122 struct Expression * checkedExp, * newExp;
12125 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;
12127 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12129 struct Context * context = PushContext();
12130 struct Declarator * decl;
12131 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12132 char typeString[1024];
12133 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12135 typeString[0] = '\0';
12137 newExp->prev = (((void *)0));
12138 newExp->next = (((void *)0));
12139 newExp->expType = (((void *)0));
12140 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
12141 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12142 newExp->destType = ProcessType(specs, decl);
12143 curContext = context;
12147 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12150 sprintf(name, "__internalValue%03X", internalValueCounter++);
12151 if(!curCompound->compound.declarations)
12152 curCompound->compound.declarations = MkList();
12153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12154 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12155 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12156 e->compound = MkCompoundStmt((((void *)0)), stmts);
12159 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12161 struct Type * type = e->destType;
12163 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12164 CopyTypeInto(e->destType, type);
12165 e->destType->refCount = 1;
12166 e->destType->classObjectType = 0;
12169 e->compound->compound.context = context;
12170 PopContext(context);
12171 curContext = context->parent;
12175 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12177 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12179 if(checkedExp->type == 25)
12181 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12184 checkedExp = (*checkedExp->list).last;
12186 else if(checkedExp->type == 11)
12187 checkedExp = checkedExp->cast.exp;
12190 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12192 *operand = *checkedExp;
12193 checkedExp->destType = (((void *)0));
12194 checkedExp->expType = (((void *)0));
12195 __ecereMethod_Expression_Clear(checkedExp);
12196 checkedExp->type = 4;
12197 checkedExp->op.op = '&';
12198 checkedExp->op.exp1 = (((void *)0));
12199 checkedExp->op.exp2 = operand;
12208 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))))
12210 if(e->expType->classObjectType && destType && destType->classObjectType)
12216 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12219 thisExp->prev = (((void *)0));
12220 thisExp->next = (((void *)0));
12221 __ecereMethod_Expression_Clear(e);
12223 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12224 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12225 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12227 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12228 CopyTypeInto(e->expType, thisExp->expType);
12229 e->expType->byReference = 0x0;
12230 e->expType->refCount = 1;
12231 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))
12233 e->expType->classObjectType = 0;
12238 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12240 if(destType->kind == 14)
12242 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12244 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12246 unsigned int byReference = e->expType->byReference;
12247 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12248 struct Declarator * decl;
12249 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12250 char typeString[1024];
12251 struct Type * type;
12252 int backupClassObjectType;
12253 unsigned int backupByReference;
12255 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12259 backupClassObjectType = type->classObjectType;
12260 backupByReference = type->byReference;
12261 type->classObjectType = 0;
12262 type->byReference = 0x0;
12263 typeString[0] = '\0';
12264 PrintType(type, typeString, 0x0, 0x1);
12265 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12266 type->classObjectType = backupClassObjectType;
12267 type->byReference = backupByReference;
12269 thisExp->prev = (((void *)0));
12270 thisExp->next = (((void *)0));
12271 __ecereMethod_Expression_Clear(e);
12272 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (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 != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12276 e->op.exp1 = (((void *)0));
12277 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12282 e->cast.typeName = MkTypeName(specs, decl);
12283 e->cast.exp = thisExp;
12284 e->byReference = 0x1;
12287 e->destType = destType;
12289 destType->refCount++;
12294 extern char * strstr(const char * , const char * );
12296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12298 struct __ecereNameSpace__ecere__com__DefinedExpression
12300 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12301 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12304 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12305 } __attribute__ ((gcc_struct));
12307 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12309 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12311 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12313 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12315 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12317 extern struct Expression * CopyExpression(struct Expression * exp);
12319 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12321 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12323 static void ProcessStatement(struct Statement * stmt);
12325 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12327 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12329 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12331 extern char * sourceFile;
12333 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12335 void ProcessExpressionType(struct Expression * exp)
12337 unsigned int unresolved = 0x0;
12338 struct Location oldyylloc = yylloc;
12339 unsigned int notByReference = 0x0;
12341 if(!exp || exp->expType)
12348 struct Identifier * id = exp->identifier;
12352 if(id->_class && id->_class->name)
12354 id->classSym = id->_class->symbol;
12356 if(strstr(id->string, "__ecereClass") == id->string)
12358 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12361 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12363 ReplaceClassMembers(exp, thisClass);
12366 ProcessExpressionType(exp);
12369 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12374 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12378 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12384 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12387 ProcessExpressionType(exp);
12391 else if(currentClass && !id->_class)
12393 if(ResolveIdWithClass(exp, currentClass, 0x1))
12396 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12401 struct Type * type = symbol->type;
12402 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12404 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12406 struct Context * context = SetupTemplatesContext(_class);
12408 type = ReplaceThisClassType(_class);
12409 FinishTemplatesContext(context);
12411 type->refCount = 0;
12413 FreeSpecifier(id->_class);
12414 id->_class = (((void *)0));
12415 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12416 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12417 id->classSym = (((void *)0));
12418 exp->expType = type;
12421 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12422 exp->isConstant = 0x1;
12423 if(symbol->isParam || !strcmp(id->string, "this"))
12425 if(_class && _class->type == 1)
12426 exp->byReference = 0x1;
12428 if(symbol->isIterator)
12430 if(symbol->isIterator == 3)
12433 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12434 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12435 exp->expType = (((void *)0));
12436 ProcessExpressionType(exp);
12438 else if(symbol->isIterator != 4)
12441 exp->member.exp = MkExpIdentifier(exp->identifier);
12442 exp->member.exp->expType = exp->expType;
12443 exp->member.member = MkIdentifier("data");
12444 exp->expType = (((void *)0));
12445 ProcessExpressionType(exp);
12452 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12454 if(thisNameSpace && !(id->_class && !id->_class->name))
12458 strcpy(name, thisNameSpace);
12459 strcat(name, "::");
12460 strcat(name, id->string);
12461 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12464 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12469 for(c = 0; c < definedExpStackPos; c++)
12470 if(definedExpStack[c] == definedExp)
12472 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12474 struct Location backupYylloc = yylloc;
12476 definedExpStack[definedExpStackPos++] = definedExp;
12477 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12478 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12479 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12481 parsedExpression = (((void *)0));
12483 expression_yyparse();
12484 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12485 yylloc = backupYylloc;
12486 if(parsedExpression)
12488 FreeIdentifier(id);
12490 exp->list = MkListOne(parsedExpression);
12491 parsedExpression->loc = yylloc;
12492 ProcessExpressionType(exp);
12493 definedExpStackPos--;
12496 definedExpStackPos--;
12502 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12508 struct GlobalData * data = (((void *)0));
12510 if(thisNameSpace && !(id->_class && !id->_class->name))
12514 strcpy(name, thisNameSpace);
12515 strcat(name, "::");
12516 strcat(name, id->string);
12517 data = FindGlobalData(name);
12520 data = FindGlobalData(id->string);
12523 DeclareGlobalData(data);
12524 exp->expType = data->dataType;
12526 data->dataType->refCount++;
12527 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12528 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12529 FreeSpecifier(id->_class);
12530 id->_class = (((void *)0));
12535 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12537 if(thisNameSpace && !(id->_class && !id->_class->name))
12541 strcpy(name, thisNameSpace);
12542 strcat(name, "::");
12543 strcat(name, id->string);
12544 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12547 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12552 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12553 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12555 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12556 strcpy(name, "__ecereFunction_");
12557 FullClassNameCat(name, id->string, 0x0);
12558 if(DeclareFunction(function, name))
12560 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12561 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12563 exp->expType = function->dataType;
12564 if(function->dataType)
12565 function->dataType->refCount++;
12566 FreeSpecifier(id->_class);
12567 id->_class = (((void *)0));
12579 struct __ecereNameSpace__ecere__com__Class * _class;
12581 if(!exp->instance->_class)
12583 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12585 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12588 ProcessInstantiationType(exp->instance);
12589 exp->isConstant = exp->instance->isConstant;
12590 if(exp->instance->_class)
12592 exp->expType = MkClassType(exp->instance->_class->name);
12600 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12602 exp->expType = type;
12603 if(exp->constant[0] == '\'')
12605 if((int)((unsigned char *)exp->constant)[1] > 127)
12608 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12611 ch = exp->constant[1];
12612 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12613 exp->constant = PrintUInt(ch);
12615 type->_class = FindClass("unichar");
12616 type->isSigned = 0x0;
12621 type->isSigned = 0x1;
12624 else if(strchr(exp->constant, '.'))
12626 char ch = exp->constant[strlen(exp->constant) - 1];
12632 type->isSigned = 0x1;
12636 if(exp->constant[0] == '0' && exp->constant[1])
12637 type->isSigned = 0x0;
12638 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12639 type->isSigned = 0x0;
12640 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12641 type->isSigned = 0x0;
12643 type->isSigned = 0x1;
12646 exp->isConstant = 0x1;
12652 exp->isConstant = 0x1;
12653 exp->expType = __extension__ ({
12654 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12656 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12657 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12659 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
12660 }), __ecereInstance2;
12666 ProcessExpressionType(exp->_new.size);
12667 exp->expType = __extension__ ({
12668 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12670 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12672 DeclareType(exp->expType->type, 0x0, 0x0);
12676 ProcessExpressionType(exp->_renew.size);
12677 ProcessExpressionType(exp->_renew.exp);
12678 exp->expType = __extension__ ({
12679 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12681 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12683 DeclareType(exp->expType->type, 0x0, 0x0);
12687 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12688 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12689 unsigned int useDestType = 0x0, useSideType = 0x0;
12690 struct Location oldyylloc = yylloc;
12691 unsigned int useSideUnit = 0x0;
12692 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
12734 if(exp->op.op != '*' || exp->op.exp1)
12741 if(exp->op.op == '&')
12743 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12745 struct Identifier * id = exp->op.exp2->identifier;
12746 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12748 if(symbol && symbol->isIterator == 2)
12751 exp->member.exp = exp->op.exp2;
12752 exp->member.member = MkIdentifier("key");
12753 exp->expType = (((void *)0));
12754 exp->op.exp2->expType = symbol->type;
12755 symbol->type->refCount++;
12756 ProcessExpressionType(exp);
12764 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
12766 if(exp->op.exp1->destType)
12767 FreeType(exp->op.exp1->destType);
12768 exp->op.exp1->destType = exp->destType;
12770 exp->destType->refCount++;
12774 if(exp->op.exp1->destType)
12775 FreeType(exp->op.exp1->destType);
12776 exp->op.exp1->destType = dummy;
12779 if(exp->op.exp1->destType && exp->op.op != '=')
12780 exp->op.exp1->destType->count++;
12781 ProcessExpressionType(exp->op.exp1);
12782 if(exp->op.exp1->destType && exp->op.op != '=')
12783 exp->op.exp1->destType->count--;
12784 if(exp->op.exp1->destType == dummy)
12787 exp->op.exp1->destType = (((void *)0));
12789 type1 = exp->op.exp1->expType;
12793 char expString[10240];
12795 expString[0] = '\0';
12796 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12800 exp->op.exp2->destType = exp->op.exp1->expType;
12801 if(exp->op.exp1->expType)
12802 exp->op.exp1->expType->refCount++;
12806 exp->op.exp2->destType = exp->destType;
12808 exp->destType->refCount++;
12812 exp->expType = type1;
12817 PrintExpression(exp->op.exp2, expString);
12818 if(type1 && type1->kind == 13)
12820 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)
12821 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12822 else if(exp->op.op == '=')
12824 if(exp->op.exp2->destType)
12825 FreeType(exp->op.exp2->destType);
12826 exp->op.exp2->destType = type1;
12833 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)
12837 if(exp->op.exp2->destType)
12838 FreeType(exp->op.exp2->destType);
12839 exp->op.exp2->destType = type1;
12846 exp->expType = type1;
12848 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
12850 if(exp->op.exp2->destType)
12851 FreeType(exp->op.exp2->destType);
12852 exp->op.exp2->destType = exp->destType;
12854 exp->destType->refCount++;
12858 if(exp->op.exp2->destType)
12859 FreeType(exp->op.exp2->destType);
12860 exp->op.exp2->destType = dummy;
12863 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12865 FreeType(exp->op.exp2->destType);
12866 exp->op.exp2->destType = type1;
12869 if(exp->op.exp2->destType && exp->op.op != '=')
12870 exp->op.exp2->destType->count++;
12871 ProcessExpressionType(exp->op.exp2);
12872 if(exp->op.exp2->destType && exp->op.op != '=')
12873 exp->op.exp2->destType->count--;
12874 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12876 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)
12878 if(exp->op.op != '=' && type1->type->kind == 0)
12879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12881 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)))
12883 if(exp->op.op == ADD_ASSIGN)
12884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12886 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))
12888 if(exp->op.op == ADD_ASSIGN)
12889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12891 else if(inCompiler)
12893 char type1String[1024];
12894 char type2String[1024];
12896 type1String[0] = '\0';
12897 type2String[0] = '\0';
12898 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12899 PrintType(type1, type2String, 0x0, 0x1);
12900 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12901 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12904 if(exp->op.exp2->destType == dummy)
12907 exp->op.exp2->destType = (((void *)0));
12909 type2 = exp->op.exp2->expType;
12912 if(exp->op.op == SIZEOF)
12914 exp->expType = __extension__ ({
12915 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12917 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
12919 exp->isConstant = 0x1;
12921 else if(exp->op.op == '*' && !exp->op.exp1)
12923 exp->expType = Dereference(type2);
12924 if(type2 && type2->kind == 8)
12925 notByReference = 0x1;
12927 else if(exp->op.op == '&' && !exp->op.exp1)
12928 exp->expType = Reference(type2);
12935 if(exp->op.exp1->destType)
12936 FreeType(exp->op.exp1->destType);
12937 exp->op.exp1->destType = MkClassType("bool");
12938 exp->op.exp1->destType->truth = 0x1;
12939 if(!exp->op.exp1->expType)
12940 ProcessExpressionType(exp->op.exp1);
12942 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12943 FreeType(exp->op.exp1->expType);
12944 exp->op.exp1->expType = MkClassType("bool");
12945 exp->op.exp1->expType->truth = 0x1;
12949 if(exp->op.exp2->destType)
12950 FreeType(exp->op.exp2->destType);
12951 exp->op.exp2->destType = MkClassType("bool");
12952 exp->op.exp2->destType->truth = 0x1;
12953 if(!exp->op.exp2->expType)
12954 ProcessExpressionType(exp->op.exp2);
12956 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12957 FreeType(exp->op.exp2->expType);
12958 exp->op.exp2->expType = MkClassType("bool");
12959 exp->op.exp2->expType->truth = 0x1;
12962 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")))))
12964 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12966 if(exp->op.exp2->destType)
12967 FreeType(exp->op.exp2->destType);
12968 exp->op.exp2->destType = type1;
12970 if(exp->op.exp1->destType)
12971 FreeType(exp->op.exp1->destType);
12972 exp->op.exp1->destType = type2;
12974 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)
12975 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
12976 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12978 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12982 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12984 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12985 ProcessExpressionType(exp->op.exp1);
12986 if(type2->kind != 13)
12988 ProcessExpressionType(classExp);
12989 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"))))))));
12990 if(!exp->op.exp2->expType)
12991 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12992 ProcessExpressionType(exp->op.exp2);
12996 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)))
12998 if(type1->kind != 8 && type1->type->kind == 0)
12999 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13000 exp->expType = type1;
13004 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)))
13006 if(type2->kind != 8 && type2->type->kind == 0)
13007 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13008 exp->expType = type2;
13012 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))
13014 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
13018 unsigned int success = 0x0;
13020 if(type1->kind == 13 && type2->kind == 13)
13022 if(exp->op.op == '+')
13023 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
13024 else if(exp->op.op == '-')
13026 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
13028 exp->expType = __extension__ ({
13029 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13031 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
13034 if(type1->type->kind == 20)
13036 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13040 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13042 ProcessExpressionType(classExp);
13044 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")))))));
13045 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
13053 if(!success && exp->op.exp1->type == 2)
13055 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13058 FreeType(exp->expType);
13059 exp->expType = exp->op.exp1->destType;
13060 if(exp->op.exp1->destType)
13061 exp->op.exp1->destType->refCount++;
13064 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13067 FreeType(exp->expType);
13068 exp->expType = exp->op.exp2->destType;
13069 if(exp->op.exp2->destType)
13070 exp->op.exp2->destType->refCount++;
13076 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13079 FreeType(exp->expType);
13080 exp->expType = exp->op.exp2->destType;
13081 if(exp->op.exp2->destType)
13082 exp->op.exp2->destType->refCount++;
13085 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13088 FreeType(exp->expType);
13089 exp->expType = exp->op.exp1->destType;
13090 if(exp->op.exp1->destType)
13091 exp->op.exp1->destType->refCount++;
13097 char expString1[10240];
13098 char expString2[10240];
13102 expString1[0] = '\0';
13103 expString2[0] = '\0';
13108 PrintExpression(exp->op.exp1, expString1);
13109 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13110 PrintExpression(exp->op.exp2, expString2);
13111 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13112 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13113 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13115 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13119 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13121 if(exp->op.exp1->destType)
13122 FreeType(exp->op.exp1->destType);
13123 exp->op.exp1->destType = type2->_class->registered->dataType;
13124 if(type2->_class->registered->dataType)
13125 type2->_class->registered->dataType->refCount++;
13126 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13127 exp->expType = type2;
13131 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13133 if(exp->op.exp2->destType)
13134 FreeType(exp->op.exp2->destType);
13135 exp->op.exp2->destType = type1->_class->registered->dataType;
13136 if(type1->_class->registered->dataType)
13137 type1->_class->registered->dataType->refCount++;
13138 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13139 exp->expType = type1;
13145 unsigned int valid = 0x0;
13147 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13149 if(exp->op.exp2->destType)
13150 FreeType(exp->op.exp2->destType);
13151 if(!type1->_class->registered->dataType)
13152 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13153 exp->op.exp2->destType = type1->_class->registered->dataType;
13154 exp->op.exp2->destType->refCount++;
13155 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13156 type2 = exp->op.exp2->destType;
13157 exp->expType = type2;
13160 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13162 if(exp->op.exp1->destType)
13163 FreeType(exp->op.exp1->destType);
13164 if(!type2->_class->registered->dataType)
13165 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13166 exp->op.exp1->destType = type2->_class->registered->dataType;
13167 exp->op.exp1->destType->refCount++;
13168 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13169 type1 = exp->op.exp1->destType;
13170 exp->expType = type1;
13173 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13175 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13177 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13180 FreeType(exp->expType);
13181 exp->expType = exp->op.exp1->expType;
13182 if(exp->op.exp2->expType)
13183 exp->op.exp1->expType->refCount++;
13187 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13189 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13192 FreeType(exp->expType);
13193 exp->expType = exp->op.exp2->expType;
13194 if(exp->op.exp2->expType)
13195 exp->op.exp2->expType->refCount++;
13202 if(exp->op.exp2->destType)
13203 FreeType(exp->op.exp2->destType);
13204 exp->op.exp2->destType = type1;
13206 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13209 FreeType(exp->expType);
13210 exp->expType = exp->op.exp2->destType;
13211 if(exp->op.exp2->destType)
13212 exp->op.exp2->destType->refCount++;
13214 else if(type1 && type2)
13216 char expString1[10240];
13217 char expString2[10240];
13218 char type1String[1024];
13219 char type2String[1024];
13221 expString1[0] = '\0';
13222 expString2[0] = '\0';
13223 type1String[0] = '\0';
13224 type2String[0] = '\0';
13227 PrintExpression(exp->op.exp1, expString1);
13228 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13229 PrintExpression(exp->op.exp2, expString2);
13230 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13231 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13232 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13234 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13235 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13237 exp->expType = exp->op.exp1->expType;
13238 if(exp->op.exp1->expType)
13239 exp->op.exp1->expType->refCount++;
13241 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13243 exp->expType = exp->op.exp2->expType;
13244 if(exp->op.exp2->expType)
13245 exp->op.exp2->expType->refCount++;
13252 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13254 struct Type * oldType = exp->op.exp1->expType;
13256 exp->op.exp1->expType = (((void *)0));
13257 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13260 exp->op.exp1->expType = oldType;
13262 if(exp->op.exp1->destType)
13263 FreeType(exp->op.exp1->destType);
13264 exp->op.exp1->destType = type2;
13266 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13269 FreeType(exp->expType);
13270 exp->expType = exp->op.exp1->destType;
13271 if(exp->op.exp1->destType)
13272 exp->op.exp1->destType->refCount++;
13276 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13278 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13280 if(exp->op.exp1->destType)
13281 FreeType(exp->op.exp1->destType);
13282 exp->op.exp1->destType = type2->_class->registered->dataType;
13283 if(type2->_class->registered->dataType)
13284 type2->_class->registered->dataType->refCount++;
13285 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13287 if(exp->op.op == '!')
13289 exp->expType = MkClassType("bool");
13290 exp->expType->truth = 0x1;
13294 exp->expType = type2;
13299 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13301 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13303 if(exp->op.exp2->destType)
13304 FreeType(exp->op.exp2->destType);
13305 exp->op.exp2->destType = type1->_class->registered->dataType;
13306 if(type1->_class->registered->dataType)
13307 type1->_class->registered->dataType->refCount++;
13308 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13310 exp->expType = type1;
13316 if(exp->op.exp1 && !exp->op.exp1->expType)
13318 char expString[10000];
13320 expString[0] = '\0';
13323 PrintExpression(exp->op.exp1, expString);
13324 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13327 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13329 if(exp->op.exp2 && !exp->op.exp2->expType)
13331 char expString[10240];
13333 expString[0] = '\0';
13336 PrintExpression(exp->op.exp2, expString);
13337 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13344 FreeType(exp->expType);
13345 exp->expType = MkClassType("bool");
13346 exp->expType->truth = 0x1;
13348 if(exp->op.op != SIZEOF)
13349 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13350 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13352 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13354 yylloc = oldyylloc;
13361 struct Expression * e;
13363 exp->isConstant = 0x1;
13364 for(e = (*exp->list).first; e; e = e->next)
13366 unsigned int inced = 0x0;
13370 FreeType(e->destType);
13371 e->destType = exp->destType;
13374 exp->destType->refCount++;
13375 e->destType->count++;
13379 ProcessExpressionType(e);
13381 exp->destType->count--;
13382 if(!exp->expType && !e->next)
13384 exp->expType = e->expType;
13386 e->expType->refCount++;
13389 exp->isConstant = 0x0;
13391 e = (*exp->list).first;
13392 if(!e->next && e->type == 8)
13394 struct Expression * next = exp->next, * prev = exp->prev;
13396 FreeType(exp->expType);
13397 FreeType(exp->destType);
13398 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13402 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13403 ProcessExpressionType(exp);
13409 struct Expression * e;
13411 exp->isConstant = 0x1;
13412 ProcessExpressionType(exp->index.exp);
13413 if(!exp->index.exp->isConstant)
13414 exp->isConstant = 0x0;
13415 if(exp->index.exp->expType)
13417 struct Type * source = exp->index.exp->expType;
13419 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13421 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13423 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13424 if(exp->index.index && (*exp->index.index).last)
13426 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13430 for(e = (*exp->index.index).first; e; e = e->next)
13432 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13435 FreeType(e->destType);
13436 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13438 ProcessExpressionType(e);
13443 exp->isConstant = 0x0;
13446 exp->expType = Dereference(exp->index.exp->expType);
13448 DeclareType(exp->expType, 0x0, 0x0);
13453 struct Expression * e;
13454 struct Type * functionType;
13455 struct Type * methodType = (((void *)0));
13461 PrintExpression(exp->call.exp, name);
13462 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13464 PrintExpression(exp->call.exp, name);
13467 if(exp->call.exp->type == 0)
13469 struct Expression * idExp = exp->call.exp;
13470 struct Identifier * id = idExp->identifier;
13472 if(!strcmp(id->string, "__builtin_frame_address"))
13474 exp->expType = ProcessTypeString("void *", 0x1);
13475 if(exp->call.arguments && (*exp->call.arguments).first)
13476 ProcessExpressionType((*exp->call.arguments).first);
13479 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13481 exp->expType = ProcessTypeString("int", 0x1);
13482 if(exp->call.arguments && (*exp->call.arguments).first)
13483 ProcessExpressionType((*exp->call.arguments).first);
13486 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13488 struct Expression * a = (((void *)0));
13489 struct Expression * b = (((void *)0));
13490 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13492 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13494 a = (*exp->call.arguments).first;
13495 b = (*exp->call.arguments).last;
13499 else if((*exp->call.arguments).count == 1)
13501 a = (*exp->call.arguments).first;
13506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13507 idExp->identifier = (((void *)0));
13508 FreeExpContents(exp);
13509 ProcessExpressionType(a);
13511 ProcessExpressionType(b);
13513 exp->list = MkList();
13514 if(a->expType && (!b || b->expType))
13516 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13520 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13521 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13522 struct Declaration * decl;
13523 char temp1[1024], temp2[1024];
13525 GetTypeSpecs(a->expType, specs);
13526 if(a && !a->isConstant && a->type != 0)
13528 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13529 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13530 tempExp1 = QMkExpId(temp1);
13531 tempExp1->expType = a->expType;
13533 a->expType->refCount++;
13534 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13536 if(b && !b->isConstant && b->type != 0)
13538 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13539 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13540 tempExp2 = QMkExpId(temp2);
13541 tempExp2->expType = b->expType;
13543 b->expType->refCount++;
13544 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13546 decl = MkDeclaration(specs, decls);
13547 if(!curCompound->compound.declarations)
13548 curCompound->compound.declarations = MkList();
13549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13553 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13555 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13557 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13558 exp->expType = a->expType;
13560 a->expType->refCount++;
13562 else if(!strcmp(id->string, "Abs"))
13564 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13565 exp->expType = a->expType;
13567 a->expType->refCount++;
13569 else if(!strcmp(id->string, "Sgn"))
13571 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"))))));
13572 exp->expType = ProcessTypeString("int", 0x0);
13574 FreeExpression(tempExp1);
13576 FreeExpression(tempExp2);
13577 FreeIdentifier(id);
13583 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13585 if(!exp->call.exp->destType)
13587 exp->call.exp->destType = dummy;
13590 ProcessExpressionType(exp->call.exp);
13591 if(exp->call.exp->destType == dummy)
13594 exp->call.exp->destType = (((void *)0));
13598 functionType = exp->call.exp->expType;
13599 if(functionType && functionType->kind == 16)
13601 methodType = functionType;
13602 functionType = methodType->method->dataType;
13603 if(exp->call.exp->expType->usedClass)
13605 char typeString[1024];
13607 typeString[0] = '\0';
13609 struct Symbol * back = functionType->thisClass;
13611 functionType->thisClass = (((void *)0));
13612 PrintType(functionType, typeString, 0x1, 0x1);
13613 functionType->thisClass = back;
13615 if(strstr(typeString, "thisclass"))
13617 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13618 struct Declarator * decl;
13621 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13623 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13624 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13625 thisClassParams = 0x0;
13626 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13628 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13630 thisClass = exp->call.exp->expType->usedClass;
13631 ProcessDeclarator(decl);
13632 thisClass = backupThisClass;
13634 thisClassParams = 0x1;
13635 functionType = ProcessType(specs, decl);
13636 functionType->refCount = 0;
13637 FinishTemplatesContext(context);
13639 FreeList(specs, FreeSpecifier);
13640 FreeDeclarator(decl);
13644 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13646 struct Type * type = functionType->type;
13648 if(!functionType->refCount)
13650 functionType->type = (((void *)0));
13651 FreeType(functionType);
13653 functionType = type;
13655 if(functionType && functionType->kind != 11)
13657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13659 else if(functionType)
13661 unsigned int emptyParams = 0x0, noParams = 0x0;
13662 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13663 struct Type * type = functionType->params.first;
13664 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13666 struct Location oldyylloc = yylloc;
13670 if(functionType->extraParam && e && functionType->thisClass)
13672 e->destType = MkClassType(functionType->thisClass->string);
13675 if(!functionType->staticMethod)
13677 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13679 type = MkClassType(memberExp->member.exp->expType->_class->string);
13682 e->destType = type;
13684 type = functionType->params.first;
13687 type->refCount = 0;
13689 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13691 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13694 e->destType = type;
13696 type = functionType->params.first;
13699 type->refCount = 0;
13702 if(type && type->kind == 0)
13705 if(!type->refCount)
13707 type = (((void *)0));
13709 for(; e; e = e->next)
13711 if(!type && !emptyParams)
13714 if(methodType && methodType->methodClass)
13715 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13720 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13722 struct Type * templatedType = (((void *)0));
13723 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13724 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13727 if(_class && _class->templateArgs)
13729 struct __ecereNameSpace__ecere__com__Class * sClass;
13731 for(sClass = _class; sClass; sClass = sClass->base)
13733 if(sClass->templateClass)
13734 sClass = sClass->templateClass;
13736 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13738 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13740 struct __ecereNameSpace__ecere__com__Class * nextClass;
13742 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13744 if(nextClass->templateClass)
13745 nextClass = nextClass->templateClass;
13746 id += nextClass->templateParams.count;
13756 if(curParam && _class->templateArgs[id].dataTypeString)
13758 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13761 struct Context * context = SetupTemplatesContext(_class);
13763 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13764 FinishTemplatesContext(context);
13766 e->destType = templatedType;
13769 templatedType->passAsTemplate = 0x1;
13774 e->destType = type;
13781 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13783 e->destType = type->prev;
13784 e->destType->refCount++;
13788 e->destType = type;
13793 if(type && type->kind != 14)
13795 struct Type * next = type->next;
13797 if(!type->refCount)
13802 if(type && type->kind != 14)
13804 if(methodType && methodType->methodClass)
13805 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13807 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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);
13809 yylloc = oldyylloc;
13810 if(type && !type->refCount)
13815 functionType = __extension__ ({
13816 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13818 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13820 if(exp->call.exp->type == 0)
13822 char * string = exp->call.exp->identifier->string;
13826 struct Symbol * symbol;
13827 struct Location oldyylloc = yylloc;
13829 yylloc = exp->call.exp->identifier->loc;
13830 if(strstr(string, "__builtin_") == string)
13834 functionType->returnType = exp->destType;
13835 exp->destType->refCount++;
13839 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13840 symbol = __extension__ ({
13841 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13843 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13845 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13846 if(strstr(symbol->string, "::"))
13847 globalContext->hasNameSpace = 0x1;
13848 yylloc = oldyylloc;
13851 else if(exp->call.exp->type == 8)
13855 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13856 if(!functionType->returnType)
13858 functionType->returnType = __extension__ ({
13859 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13861 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13865 if(functionType && functionType->kind == 11)
13867 exp->expType = functionType->returnType;
13868 if(functionType->returnType)
13869 functionType->returnType->refCount++;
13870 if(!functionType->refCount)
13871 FreeType(functionType);
13873 if(exp->call.arguments)
13875 for(e = (*exp->call.arguments).first; e; e = e->next)
13877 struct Type * destType = e->destType;
13879 ProcessExpressionType(e);
13886 struct Type * type;
13887 struct Location oldyylloc = yylloc;
13888 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13890 exp->thisPtr = thisPtr;
13891 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13893 exp->member.member->classSym = exp->member.member->_class->symbol;
13895 ProcessExpressionType(exp->member.exp);
13896 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)
13898 exp->isConstant = 0x0;
13901 exp->isConstant = exp->member.exp->isConstant;
13902 type = exp->member.exp->expType;
13904 if(type && (type->kind == 20))
13906 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13907 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13911 for(param = _class->templateParams.first; param; param = param->next)
13913 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13917 if(param && param->defaultArg.member)
13919 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13923 struct Expression * expMember = exp->member.exp;
13924 struct Declarator * decl;
13925 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13926 char thisClassTypeString[1024];
13928 FreeIdentifier(exp->member.member);
13929 ProcessExpressionType(argExp);
13931 char * colon = strstr(param->defaultArg.memberString, "::");
13935 char className[1024];
13936 struct __ecereNameSpace__ecere__com__Class * sClass;
13938 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13939 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13942 strcpy(thisClassTypeString, _class->fullName);
13944 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13945 exp->expType = ProcessType(specs, decl);
13946 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13948 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13949 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13951 int paramCount = 0;
13952 int lastParam = -1;
13953 char templateString[1024];
13954 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13956 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13957 for(cClass = expClass; cClass; cClass = cClass->base)
13961 for(param = cClass->templateParams.first; param; param = param->next)
13964 struct __ecereNameSpace__ecere__com__Class * sClass;
13965 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13967 for(sClass = cClass->base; sClass; sClass = sClass->base)
13968 id += sClass->templateParams.count;
13969 arg = expClass->templateArgs[id];
13970 for(sClass = _class; sClass; sClass = sClass->base)
13972 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13974 struct __ecereNameSpace__ecere__com__Class * nextClass;
13976 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13977 p += nextClass->templateParams.count;
13978 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13980 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13982 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13984 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13985 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13992 char argument[256];
13994 argument[0] = '\0';
13995 switch(param->type)
13999 char expString[1024];
14000 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14001 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14002 struct Expression * exp;
14003 char * string = PrintHexUInt64(arg.expression.ui64);
14005 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14006 ProcessExpressionType(exp);
14007 ComputeExpression(exp);
14008 expString[0] = '\0';
14009 PrintExpression(exp, expString);
14010 strcat(argument, expString);
14011 FreeExpression(exp);
14016 strcat(argument, arg.member->name);
14021 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14023 if(!strcmp(arg.dataTypeString, "thisclass"))
14024 strcat(argument, thisClassTypeString);
14026 strcat(argument, arg.dataTypeString);
14034 strcat(templateString, ", ");
14035 if(lastParam != p - 1)
14037 strcat(templateString, param->name);
14038 strcat(templateString, " = ");
14040 strcat(templateString, argument);
14049 int len = strlen(templateString);
14051 if(templateString[len - 1] == '>')
14052 templateString[len++] = ' ';
14053 templateString[len++] = '>';
14054 templateString[len++] = '\0';
14057 struct Context * context = SetupTemplatesContext(_class);
14059 FreeType(exp->expType);
14060 exp->expType = ProcessTypeString(templateString, 0x0);
14061 FinishTemplatesContext(context);
14065 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")))))))));
14068 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
14070 type = ProcessTemplateParameterType(type->templateParameter);
14073 if(type && (type->kind == 20))
14075 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 == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7))
14077 struct Identifier * id = exp->member.member;
14078 int typeKind = type->kind;
14079 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));
14081 if(typeKind == 19 && exp->member.exp->type == 26)
14083 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14088 if(typeKind == 3 || typeKind == 15)
14089 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14092 if(type->kind == 8 && type->_class && type->_class->registered)
14094 _class = type->_class->registered;
14096 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
14098 _class = FindClass("char *")->registered;
14100 else if(type->kind == 13)
14102 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
14103 FreeType(exp->expType);
14104 exp->expType = ProcessTypeString("uintptr", 0x0);
14105 exp->byReference = 0x0;
14109 char string[1024] = "";
14110 struct Symbol * classSym;
14112 PrintTypeNoConst(type, string, 0x0, 0x1);
14113 classSym = FindClass(string);
14115 _class = classSym->registered;
14121 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14122 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14123 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14124 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14125 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14127 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14128 exp->member.memberType = 1;
14129 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14130 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14133 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14135 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14136 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14138 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14140 member = (((void *)0));
14142 if(!member && !prop)
14143 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14144 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14145 exp->member.thisPtr = 0x1;
14151 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14152 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14153 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14155 if(!prop && !member)
14157 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14160 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14161 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14162 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14167 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14168 prop = (((void *)0));
14170 member = (((void *)0));
14174 if(!prop && !member && !method)
14175 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14176 if(!prop && !member && !method)
14180 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14183 exp->member.memberType = 5;
14184 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14188 char structName[1024];
14189 struct Identifier * id = exp->member.member;
14190 struct Expression * classExp = exp->member.exp;
14193 FreeType(classExp->expType);
14194 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14195 strcpy(structName, "__ecereClassData_");
14196 FullClassNameCat(structName, type->_class->string, 0x0);
14198 exp->member.member = id;
14199 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"))))))));
14201 ProcessExpressionType(exp);
14207 struct Symbol * classSym = FindClass(id->string);
14211 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14214 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14220 exp->member.memberType = 1;
14221 if(!prop->dataType)
14222 ProcessPropertyType(prop);
14223 exp->expType = prop->dataType;
14225 prop->dataType->refCount++;
14229 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14231 FreeExpContents(exp);
14233 exp->identifier = MkIdentifier("class");
14234 ProcessExpressionType(exp);
14237 exp->member.memberType = 3;
14238 DeclareStruct(_class->fullName, 0x0);
14239 if(!member->dataType)
14241 struct Context * context = SetupTemplatesContext(_class);
14243 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14244 FinishTemplatesContext(context);
14246 exp->expType = member->dataType;
14247 if(member->dataType)
14248 member->dataType->refCount++;
14250 else if(revConvert)
14252 exp->member.memberType = 4;
14253 exp->expType = MkClassType(revConvert->_class->fullName);
14258 exp->member.memberType = 2;
14260 if(!method->dataType)
14261 ProcessMethodType(method);
14262 exp->expType = __extension__ ({
14263 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14265 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14267 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14268 exp->expType->usedClass = _class;
14270 else if(!classProp)
14272 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14274 FreeExpContents(exp);
14276 exp->identifier = MkIdentifier("class");
14277 ProcessExpressionType(exp);
14280 yylloc = exp->member.member->loc;
14281 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14283 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14285 if(_class && exp->expType)
14287 struct __ecereNameSpace__ecere__com__Class * tClass;
14290 while(tClass && !tClass->templateClass)
14291 tClass = tClass->base;
14292 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14295 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14296 struct __ecereNameSpace__ecere__com__Class * sClass;
14298 for(sClass = tClass; sClass; sClass = sClass->base)
14301 if(sClass->templateClass)
14302 sClass = sClass->templateClass;
14303 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14305 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14307 for(sClass = sClass->base; sClass; sClass = sClass->base)
14308 id += sClass->templateParams.count;
14316 if(curParam && tClass->templateArgs[id].dataTypeString)
14318 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14319 struct Context * context = SetupTemplatesContext(tClass);
14321 FreeType(exp->expType);
14322 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14325 if(exp->expType->kind == 21)
14327 FreeType(exp->expType);
14328 exp->expType = ReplaceThisClassType(_class);
14330 if(tClass->templateClass)
14331 exp->expType->passAsTemplate = 0x1;
14334 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14335 if(exp->destType->kind == 21)
14337 FreeType(exp->destType);
14338 exp->destType = ReplaceThisClassType(_class);
14342 FinishTemplatesContext(context);
14345 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14348 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14349 struct __ecereNameSpace__ecere__com__Class * sClass;
14351 for(sClass = tClass; sClass; sClass = sClass->base)
14354 if(sClass->templateClass)
14355 sClass = sClass->templateClass;
14356 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14358 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14360 for(sClass = sClass->base; sClass; sClass = sClass->base)
14361 id += sClass->templateParams.count;
14371 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14372 struct Context * context = SetupTemplatesContext(tClass);
14373 struct Type * basicType;
14375 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14378 if(basicType->kind == 21)
14380 FreeType(basicType);
14381 basicType = ReplaceThisClassType(_class);
14383 FreeType(exp->expType);
14384 exp->expType = __extension__ ({
14385 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14387 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14391 exp->destType = exp->expType;
14392 exp->destType->refCount++;
14395 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14396 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14397 struct Declarator * decl;
14399 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14402 exp->destType->refCount++;
14404 exp->expType->refCount++;
14406 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14407 exp->cast.exp = newExp;
14410 FinishTemplatesContext(context);
14413 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14415 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14419 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14422 int paramCount = 0;
14423 int lastParam = -1;
14424 char templateString[1024];
14425 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14427 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14428 while(cClass != expClass)
14430 struct __ecereNameSpace__ecere__com__Class * sClass;
14432 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14435 for(param = cClass->templateParams.first; param; param = param->next)
14437 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14441 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14443 while(cClassCur != tClass && !paramCur)
14445 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14447 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14449 cClassCur = sClassCur;
14450 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14452 if(!strcmp(paramCur->name, param->name))
14459 if(paramCur && paramCur->type == 0)
14460 arg = tClass->templateArgs[cp];
14462 arg = expClass->templateArgs[p];
14464 char argument[256];
14466 argument[0] = '\0';
14467 switch(param->type)
14471 char expString[1024];
14472 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14473 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14474 struct Expression * exp;
14475 char * string = PrintHexUInt64(arg.expression.ui64);
14477 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14478 ProcessExpressionType(exp);
14479 ComputeExpression(exp);
14480 expString[0] = '\0';
14481 PrintExpression(exp, expString);
14482 strcat(argument, expString);
14483 FreeExpression(exp);
14488 strcat(argument, arg.member->name);
14493 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14494 strcat(argument, arg.dataTypeString);
14501 strcat(templateString, ", ");
14502 if(lastParam != p - 1)
14504 strcat(templateString, param->name);
14505 strcat(templateString, " = ");
14507 strcat(templateString, argument);
14516 int len = strlen(templateString);
14518 if(templateString[len - 1] == '>')
14519 templateString[len++] = ' ';
14520 templateString[len++] = '>';
14521 templateString[len++] = '\0';
14523 FreeType(exp->expType);
14525 struct Context * context = SetupTemplatesContext(tClass);
14527 exp->expType = ProcessTypeString(templateString, 0x0);
14528 FinishTemplatesContext(context);
14535 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "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)");
14537 else if(type && (type->kind == 9 || type->kind == 10))
14539 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14543 exp->expType = memberType;
14545 memberType->refCount++;
14550 char expString[10240];
14552 expString[0] = '\0';
14555 PrintExpression(exp, expString);
14556 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14558 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14560 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14562 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14564 struct Identifier * id = exp->member.member;
14565 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));
14569 FreeType(exp->expType);
14570 exp->expType = ReplaceThisClassType(_class);
14574 yylloc = oldyylloc;
14579 struct Type * destType = exp->destType;
14581 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14583 exp->member.member->classSym = exp->member.member->_class->symbol;
14585 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14589 ProcessExpressionType(exp);
14596 struct Symbol * classSym = exp->_class->symbol;
14598 if(classSym && classSym->registered)
14600 if(classSym->registered->type == 5)
14605 DeclareStruct(classSym->string, 0x0);
14606 FreeSpecifier(exp->_class);
14608 FullClassNameCat(name, classSym->string, 0x0);
14609 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14613 if(classSym->registered->fixed)
14615 FreeSpecifier(exp->_class);
14616 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14621 char className[1024];
14623 strcpy(className, "__ecereClass_");
14624 FullClassNameCat(className, classSym->string, 0x1);
14625 MangleClassName(className);
14626 DeclareClass(classSym, className);
14627 FreeExpContents(exp);
14629 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14630 exp->member.member = MkIdentifier("structSize");
14634 exp->expType = __extension__ ({
14635 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14637 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14643 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14645 exp->expType = __extension__ ({
14646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14648 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14650 exp->isConstant = 0x1;
14651 DeclareType(type, 0x0, 0x0);
14657 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14660 FreeType(exp->cast.exp->destType);
14661 exp->cast.exp->destType = type;
14663 ProcessExpressionType(exp->cast.exp);
14665 exp->expType = type;
14666 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14668 void * prev = exp->prev, * next = exp->next;
14669 struct Type * expType = exp->cast.exp->destType;
14670 struct Expression * castExp = exp->cast.exp;
14671 struct Type * destType = exp->destType;
14674 expType->refCount++;
14675 FreeType(exp->expType);
14676 FreeTypeName(exp->cast.typeName);
14678 FreeType(exp->expType);
14679 FreeType(exp->destType);
14680 exp->expType = expType;
14681 exp->destType = destType;
14682 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14688 exp->isConstant = exp->cast.exp->isConstant;
14694 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14696 exp->expType = type;
14701 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14703 ProcessExpressionType(exp->vaArg.exp);
14704 exp->expType = type;
14709 struct Expression * e;
14711 exp->isConstant = 0x1;
14712 FreeType(exp->cond.cond->destType);
14713 exp->cond.cond->destType = MkClassType("bool");
14714 exp->cond.cond->destType->truth = 0x1;
14715 ProcessExpressionType(exp->cond.cond);
14716 if(!exp->cond.cond->isConstant)
14717 exp->isConstant = 0x0;
14718 for(e = (*exp->cond.exp).first; e; e = e->next)
14722 FreeType(e->destType);
14723 e->destType = exp->destType;
14725 e->destType->refCount++;
14727 ProcessExpressionType(e);
14730 exp->expType = e->expType;
14732 e->expType->refCount++;
14735 exp->isConstant = 0x0;
14737 FreeType(exp->cond.elseExp->destType);
14738 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14739 if(exp->cond.elseExp->destType)
14740 exp->cond.elseExp->destType->refCount++;
14741 ProcessExpressionType(exp->cond.elseExp);
14742 if(!exp->cond.elseExp->isConstant)
14743 exp->isConstant = 0x0;
14748 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14750 struct Statement * last = (*exp->compound->compound.statements).last;
14752 if(last->type == 3 && last->expressions && (*last->expressions).last)
14754 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14756 exp->destType->refCount++;
14758 ProcessStatement(exp->compound);
14759 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14761 exp->expType->refCount++;
14767 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14769 if(spec && spec->type == 1)
14771 exp->expType = MkClassType(spec->name);
14772 exp->expType->kind = 19;
14773 exp->byReference = 0x1;
14777 exp->expType = MkClassType("ecere::com::Class");
14778 exp->byReference = 0x1;
14784 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14788 struct Identifier * id = exp->classData.id;
14789 char structName[1024];
14790 struct Expression * classExp;
14792 strcpy(structName, "__ecereClassData_");
14793 FullClassNameCat(structName, _class->fullName, 0x0);
14795 exp->member.member = id;
14796 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14797 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14799 classExp = MkExpIdentifier(MkIdentifier("class"));
14800 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"))))))));
14801 ProcessExpressionType(exp);
14808 struct Type * type = (((void *)0));
14809 char * typeString = (((void *)0));
14810 char typeStringBuf[1024];
14812 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))
14814 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14816 typeString = templateClass->templateArgs[2].dataTypeString;
14820 struct Expression * e;
14822 for(e = (*exp->list).first; e; e = e->next)
14824 ProcessExpressionType(e);
14834 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14838 e->expType = (((void *)0));
14839 e = (*exp->list).first;
14840 ProcessExpressionType(e);
14843 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14845 FreeType(e->expType);
14846 e->expType = (((void *)0));
14848 type = (((void *)0));
14856 FreeType(e->expType);
14857 e->expType = (((void *)0));
14863 typeStringBuf[0] = '\0';
14864 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
14865 typeString = typeStringBuf;
14867 type = (((void *)0));
14872 char templateString[1024];
14873 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14874 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14875 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14876 struct Expression * expExt;
14877 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14879 sprintf(templateString, "Container<%s>", typeString);
14882 struct Expression * e;
14884 type = ProcessTypeString(typeString, 0x0);
14885 while(e = (*exp->list).first)
14887 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14888 e->destType = type;
14890 ProcessExpressionType(e);
14891 ListAdd(initializers, MkInitializerAssignment(e));
14894 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14896 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14897 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14898 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14899 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14900 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14901 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14902 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14903 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14904 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14905 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
14906 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14908 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
14910 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14911 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14912 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14913 exp->expType = ProcessTypeString(templateString, 0x0);
14915 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14916 ProcessExpressionType(expExt);
14920 exp->expType = ProcessTypeString("Container", 0x0);
14921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14926 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14928 FreeType(exp->expType);
14929 exp->expType = ReplaceThisClassType(thisClass);
14931 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14933 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14937 if(exp->expType->kind != 15)
14939 struct Type * member;
14940 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14942 FreeType(exp->expType);
14943 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14944 exp->expType->kind = symbol->type->kind;
14945 exp->expType->refCount++;
14946 exp->expType->enumName = enumName;
14947 exp->expType->members = symbol->type->members;
14948 for(member = symbol->type->members.first; member; member = member->next)
14949 member->refCount++;
14953 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14955 for(member = symbol->type->members.first; member; member = member->next)
14957 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14959 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14965 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14967 else if(exp->destType && !exp->destType->keepCast)
14969 if(!CheckExpressionType(exp, exp->destType, 0x0))
14971 if(!exp->destType->count || unresolved)
14976 if(exp->destType->kind != 14)
14983 char expString[10240];
14985 expString[0] = '\0';
14986 PrintType(exp->destType, type2, 0x0, 0x1);
14989 PrintExpression(exp, expString);
14990 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14993 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14994 else if(exp->type != 16)
14995 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
15000 char expString[10240];
15002 expString[0] = '\0';
15005 PrintExpression(exp, expString);
15006 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15009 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
15010 else if(exp->type != 16)
15011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15023 PrintType(exp->expType, type1, 0x0, 0x1);
15024 PrintType(exp->destType, type2, 0x0, 0x1);
15026 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)))
15030 char expString[10240];
15032 expString[0] = '\0';
15035 PrintExpression(exp, expString);
15036 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15038 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
15039 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
15040 FreeType(exp->expType);
15041 exp->destType->refCount++;
15042 exp->expType = exp->destType;
15047 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
15049 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15050 char typeString[1024];
15051 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15052 struct Declarator * decl;
15054 typeString[0] = '\0';
15057 exp->expType->refCount++;
15059 exp->expType->refCount++;
15061 newExp->destType = exp->expType;
15062 PrintType(exp->expType, typeString, 0x0, 0x0);
15063 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15064 exp->cast.typeName = MkTypeName(specs, decl);
15065 exp->cast.exp = newExp;
15068 else if(unresolved)
15070 if(exp->identifier->_class && exp->identifier->_class->name)
15071 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
15072 else if(exp->identifier->string && exp->identifier->string[0])
15073 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
15075 else if(!exp->expType && exp->type != 16)
15077 char expString[10240];
15079 expString[0] = '\0';
15082 PrintExpression(exp, expString);
15083 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15085 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15088 ApplyAnyObjectLogic(exp);
15089 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)))
15091 exp->byReference = 0x1;
15093 yylloc = oldyylloc;
15096 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)
15100 *curMember = (*curMember)->next;
15101 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
15103 *curMember = subMemberStack[--(*subMemberStackPos)];
15104 *curMember = (*curMember)->next;
15106 while((*curMember) && (*curMember)->isProperty)
15107 *curMember = (*curMember)->next;
15108 if(subMemberStackPos)
15110 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15112 subMemberStack[(*subMemberStackPos)++] = *curMember;
15113 *curMember = (*curMember)->members.first;
15114 while(*curMember && (*curMember)->isProperty)
15115 *curMember = (*curMember)->next;
15123 if(subMemberStackPos && *subMemberStackPos)
15125 *curMember = subMemberStack[--(*subMemberStackPos)];
15126 *curMember = (*curMember)->next;
15130 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15132 if(*curClass == _class)
15134 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15136 *curMember = (*curClass)->membersAndProperties.first;
15138 while((*curMember) && (*curMember)->isProperty)
15139 *curMember = (*curMember)->next;
15140 if(subMemberStackPos)
15142 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15144 subMemberStack[(*subMemberStackPos)++] = *curMember;
15145 *curMember = (*curMember)->members.first;
15146 while(*curMember && (*curMember)->isProperty)
15147 *curMember = (*curMember)->next;
15154 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15159 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15161 if(init->exp && !init->exp->destType)
15163 FreeType(init->exp->destType);
15164 init->exp->destType = type;
15170 ProcessExpressionType(init->exp);
15171 init->isConstant = init->exp->isConstant;
15177 struct Expression * exp = init->exp;
15178 struct Instantiation * inst = exp->instance;
15179 struct MembersInit * members;
15182 init->list = MkList();
15185 for(members = (*inst->members).first; members; members = members->next)
15187 if(members->type == 0)
15189 struct MemberInit * member;
15191 for(member = (*members->dataMembers).first; member; member = member->next)
15193 ListAdd(init->list, member->initializer);
15194 member->initializer = (((void *)0));
15199 FreeExpression(exp);
15203 struct Initializer * i;
15204 struct Type * initializerType = (((void *)0));
15205 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15206 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15207 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15208 int subMemberStackPos = 0;
15210 if(type && type->kind == 12)
15211 initializerType = Dereference(type);
15212 else if(type && (type->kind == 9 || type->kind == 10))
15213 initializerType = type->members.first;
15214 for(i = (*init->list).first; i; i = i->next)
15216 if(type && type->kind == 8 && type->_class && type->_class->registered)
15218 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15221 if(!curMember->dataType)
15222 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15223 initializerType = curMember->dataType;
15226 ProcessInitializer(i, initializerType);
15227 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15228 initializerType = initializerType->next;
15230 init->isConstant = 0x0;
15232 if(type && type->kind == 12)
15233 FreeType(initializerType);
15234 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15236 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15243 extern struct Symbol * FindType(struct Context * ctx, char * name);
15245 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15247 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15253 if(spec->specifier == THISCLASS)
15258 spec->name = ReplaceThisClass(thisClass);
15259 spec->symbol = FindClass(spec->name);
15260 ProcessSpecifier(spec, declareStruct);
15267 struct Symbol * symbol = FindType(curContext, spec->name);
15270 DeclareType(symbol->type, 0x1, 0x1);
15271 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15272 DeclareStruct(spec->name, 0x0);
15277 struct Enumerator * e;
15281 for(e = (*spec->list).first; e; e = e->next)
15284 ProcessExpressionType(e->exp);
15292 if(spec->definitions)
15294 struct ClassDef * def;
15295 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15297 ProcessClass(spec->definitions, symbol);
15304 static void ProcessDeclarator(struct Declarator * decl)
15309 if(decl->identifier->classSym)
15311 FreeSpecifier(decl->identifier->_class);
15312 decl->identifier->_class = (((void *)0));
15316 if(decl->array.exp)
15317 ProcessExpressionType(decl->array.exp);
15324 if(decl->declarator)
15325 ProcessDeclarator(decl->declarator);
15326 if(decl->type == 4)
15328 struct Identifier * id = GetDeclId(decl);
15330 if(id && id->_class)
15332 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15334 if(!decl->function.parameters)
15335 decl->function.parameters = MkList();
15336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15337 id->_class = (((void *)0));
15339 if(decl->function.parameters)
15341 struct TypeName * param;
15343 for(param = (*decl->function.parameters).first; param; param = param->next)
15345 if(param->qualifiers && (*param->qualifiers).first)
15347 struct Specifier * spec = (*param->qualifiers).first;
15349 if(spec && spec->specifier == TYPED_OBJECT)
15351 struct Declarator * d = param->declarator;
15352 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);
15354 FreeList(param->qualifiers, FreeSpecifier);
15355 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15356 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15357 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15360 else if(spec && spec->specifier == ANY_OBJECT)
15362 struct Declarator * d = param->declarator;
15364 FreeList(param->qualifiers, FreeSpecifier);
15365 param->qualifiers = MkListOne(MkSpecifier(VOID));
15366 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15368 else if(spec->specifier == THISCLASS)
15373 spec->name = ReplaceThisClass(thisClass);
15374 spec->symbol = FindClass(spec->name);
15375 ProcessSpecifier(spec, 0x0);
15379 if(param->declarator)
15380 ProcessDeclarator(param->declarator);
15388 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15390 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15392 static void ProcessDeclaration(struct Declaration * decl)
15394 yylloc = decl->loc;
15399 unsigned int declareStruct = 0x0;
15401 if(decl->declarators)
15403 struct InitDeclarator * d;
15405 for(d = (*decl->declarators).first; d; d = d->next)
15407 struct Type * type, * subType;
15409 ProcessDeclarator(d->declarator);
15410 type = ProcessType(decl->specifiers, d->declarator);
15413 ProcessInitializer(d->initializer, type);
15414 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15416 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15418 struct Instantiation * inst = d->initializer->exp->instance;
15420 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15421 d->initializer->exp->instance = (((void *)0));
15422 if(decl->specifiers)
15423 FreeList(decl->specifiers, FreeSpecifier);
15424 FreeList(decl->declarators, FreeInitDeclarator);
15431 for(subType = type; subType; )
15433 if(subType->kind == 8)
15435 declareStruct = 0x1;
15438 else if(subType->kind == 13)
15440 else if(subType->kind == 12)
15441 subType = subType->arrayType;
15450 if(decl->specifiers)
15452 struct Specifier * s;
15454 for(s = (*decl->specifiers).first; s; s = s->next)
15456 ProcessSpecifier(s, declareStruct);
15463 ProcessInstantiationType(decl->inst);
15468 struct Specifier * spec;
15469 struct Declarator * d;
15470 unsigned int declareStruct = 0x0;
15472 if(decl->declarators)
15474 for(d = (*decl->declarators).first; d; d = d->next)
15476 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15477 struct Type * subType;
15479 ProcessDeclarator(d);
15480 for(subType = type; subType; )
15482 if(subType->kind == 8)
15484 declareStruct = 0x1;
15487 else if(subType->kind == 13)
15489 else if(subType->kind == 12)
15490 subType = subType->arrayType;
15497 if(decl->specifiers)
15499 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15500 ProcessSpecifier(spec, declareStruct);
15507 static struct FunctionDefinition * curFunction;
15509 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15511 char propName[1024], propNameM[1024];
15512 char getName[1024], setName[1024];
15513 struct __ecereNameSpace__ecere__sys__OldList * args;
15515 DeclareProperty(prop, setName, getName);
15516 strcpy(propName, "__ecereProp_");
15517 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15518 strcat(propName, "_");
15519 FullClassNameCat(propName, prop->name, 0x1);
15520 MangleClassName(propName);
15521 strcpy(propNameM, "__ecerePropM_");
15522 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15523 strcat(propNameM, "_");
15524 FullClassNameCat(propNameM, prop->name, 0x1);
15525 MangleClassName(propNameM);
15526 if(prop->isWatchable)
15529 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15530 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15531 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15533 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15534 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15535 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15539 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15540 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15541 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15543 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15544 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15545 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15547 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15548 curFunction->propSet->fireWatchersDone = 0x1;
15551 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15553 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15555 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15557 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15559 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15561 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15563 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15565 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15567 static void ProcessStatement(struct Statement * stmt)
15569 yylloc = stmt->loc;
15573 ProcessStatement(stmt->labeled.stmt);
15576 if(stmt->caseStmt.exp)
15578 FreeType(stmt->caseStmt.exp->destType);
15579 stmt->caseStmt.exp->destType = curSwitchType;
15581 curSwitchType->refCount++;
15582 ProcessExpressionType(stmt->caseStmt.exp);
15583 ComputeExpression(stmt->caseStmt.exp);
15585 if(stmt->caseStmt.stmt)
15586 ProcessStatement(stmt->caseStmt.stmt);
15590 if(stmt->compound.context)
15592 struct Declaration * decl;
15593 struct Statement * s;
15594 struct Statement * prevCompound = curCompound;
15595 struct Context * prevContext = curContext;
15597 if(!stmt->compound.isSwitch)
15599 curCompound = stmt;
15600 curContext = stmt->compound.context;
15602 if(stmt->compound.declarations)
15604 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15605 ProcessDeclaration(decl);
15607 if(stmt->compound.statements)
15609 for(s = (*stmt->compound.statements).first; s; s = s->next)
15610 ProcessStatement(s);
15612 curContext = prevContext;
15613 curCompound = prevCompound;
15619 struct Expression * exp;
15621 if(stmt->expressions)
15623 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15624 ProcessExpressionType(exp);
15630 struct Expression * exp;
15632 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15633 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15634 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15635 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15637 ProcessExpressionType(exp);
15639 if(stmt->ifStmt.stmt)
15640 ProcessStatement(stmt->ifStmt.stmt);
15641 if(stmt->ifStmt.elseStmt)
15642 ProcessStatement(stmt->ifStmt.elseStmt);
15647 struct Type * oldSwitchType = curSwitchType;
15649 if(stmt->switchStmt.exp)
15651 struct Expression * exp;
15653 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15657 ProcessExpressionType(exp);
15660 curSwitchType = exp->expType;
15663 ProcessStatement(stmt->switchStmt.stmt);
15664 curSwitchType = oldSwitchType;
15669 if(stmt->whileStmt.exp)
15671 struct Expression * exp;
15673 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15674 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15675 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15676 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15678 ProcessExpressionType(exp);
15681 if(stmt->whileStmt.stmt)
15682 ProcessStatement(stmt->whileStmt.stmt);
15687 if(stmt->doWhile.exp)
15689 struct Expression * exp;
15691 if((*stmt->doWhile.exp).last)
15693 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15694 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15695 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15697 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15699 ProcessExpressionType(exp);
15702 if(stmt->doWhile.stmt)
15703 ProcessStatement(stmt->doWhile.stmt);
15708 struct Expression * exp;
15710 if(stmt->forStmt.init)
15711 ProcessStatement(stmt->forStmt.init);
15712 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15714 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15715 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15716 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15718 if(stmt->forStmt.check)
15719 ProcessStatement(stmt->forStmt.check);
15720 if(stmt->forStmt.increment)
15722 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15723 ProcessExpressionType(exp);
15725 if(stmt->forStmt.stmt)
15726 ProcessStatement(stmt->forStmt.stmt);
15731 struct Identifier * id = stmt->forEachStmt.id;
15732 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15733 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15734 struct Statement * block = stmt->forEachStmt.stmt;
15735 char iteratorType[1024];
15736 struct Type * source;
15737 struct Expression * e;
15738 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
15739 struct Expression * arrayExp;
15740 char * typeString = (((void *)0));
15741 int builtinCount = 0;
15743 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15747 FreeType(e->destType);
15748 e->destType = ProcessTypeString("Container", 0x0);
15750 if(!isBuiltin || e->next)
15751 ProcessExpressionType(e);
15753 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15754 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15756 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15757 struct Symbol * symbol;
15758 struct Expression * expIt = (((void *)0));
15759 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15760 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15761 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15762 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15765 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15766 stmt->compound.context->parent = curContext;
15767 curContext = stmt->compound.context;
15768 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15770 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15771 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15773 isCustomAVLTree = 0x1;
15774 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15776 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15779 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15781 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15783 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15786 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15790 struct Declarator * decl;
15791 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15793 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15794 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15795 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15799 struct Type * type = (((void *)0));
15800 char typeStringBuf[1024];
15802 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15803 if(((struct Expression *)(*exp).last)->type == 11)
15805 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15808 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15810 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)
15812 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15814 typeString = templateClass->templateArgs[2].dataTypeString;
15816 else if(arrayExp->list)
15818 struct Expression * e;
15820 for(e = (*arrayExp->list).first; e; e = e->next)
15822 ProcessExpressionType(e);
15832 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15836 e->expType = (((void *)0));
15837 e = (*arrayExp->list).first;
15838 ProcessExpressionType(e);
15841 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15843 FreeType(e->expType);
15844 e->expType = (((void *)0));
15846 type = (((void *)0));
15854 FreeType(e->expType);
15855 e->expType = (((void *)0));
15861 typeStringBuf[0] = '\0';
15862 PrintType(type, typeStringBuf, 0x0, 0x1);
15863 typeString = typeStringBuf;
15869 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15870 struct Declarator * decl;
15871 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15875 struct Expression * e;
15877 builtinCount = (*arrayExp->list).count;
15878 type = ProcessTypeString(typeString, 0x0);
15879 while(e = (*arrayExp->list).first)
15881 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15882 e->destType = type;
15884 ProcessExpressionType(e);
15885 ListAdd(initializers, MkInitializerAssignment(e));
15888 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15890 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15891 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15892 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15893 FreeList(exp, FreeExpression);
15897 arrayExp->expType = ProcessTypeString("Container", 0x0);
15898 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15901 else if(isLinkList && !isList)
15903 struct Declarator * decl;
15904 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15906 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15907 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15908 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15910 else if(_class->templateArgs)
15913 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15915 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15916 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15918 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15919 if(block && block->type == 2 && block->compound.context)
15921 block->compound.context->parent = stmt->compound.context;
15925 block = MkIfStmt(filter, block, (((void *)0)));
15929 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));
15930 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15931 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15932 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15938 sprintf(count, "%d", builtinCount);
15939 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));
15940 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15941 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15942 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15944 else if(isLinkList && !isList)
15946 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15947 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15949 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15951 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));
15955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15956 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15958 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));
15960 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15961 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15962 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15966 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15968 ProcessExpressionType(expIt);
15969 if((*stmt->compound.declarations).first)
15970 ProcessDeclaration((*stmt->compound.declarations).first);
15972 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15973 ProcessStatement(stmt);
15974 curContext = stmt->compound.context->parent;
15979 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15991 struct Expression * exp;
15993 if(stmt->expressions)
15995 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15999 if(curFunction && !curFunction->type)
16000 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
16001 FreeType(exp->destType);
16002 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
16004 exp->destType->refCount++;
16006 ProcessExpressionType(exp);
16013 ProcessDeclaration(stmt->decl);
16018 struct AsmField * field;
16020 if(stmt->asmStmt.inputFields)
16022 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
16023 if(field->expression)
16024 ProcessExpressionType(field->expression);
16026 if(stmt->asmStmt.outputFields)
16028 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
16029 if(field->expression)
16030 ProcessExpressionType(field->expression);
16032 if(stmt->asmStmt.clobberedFields)
16034 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
16036 if(field->expression)
16037 ProcessExpressionType(field->expression);
16044 struct PropertyWatch * propWatch;
16045 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16046 struct Expression * object = stmt->_watch.object;
16047 struct Expression * watcher = stmt->_watch.watcher;
16050 ProcessExpressionType(watcher);
16052 ProcessExpressionType(object);
16055 if(watcher || thisClass)
16057 struct External * external = curExternal;
16058 struct Context * context = curContext;
16061 stmt->expressions = MkList();
16062 curExternal = external->prev;
16063 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16065 struct ClassFunction * func;
16066 char watcherName[1024];
16067 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
16068 struct External * createdExternal;
16069 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
16071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
16072 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
16073 if(propWatch->deleteWatch)
16074 strcat(watcherName, "_delete");
16077 struct Identifier * propID;
16079 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16081 strcat(watcherName, "_");
16082 strcat(watcherName, propID->string);
16085 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
16087 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
16088 ProcessClassFunctionBody(func, propWatch->compound);
16089 propWatch->compound = (((void *)0));
16090 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
16091 createdExternal->symbol->idCode = external->symbol->idCode;
16092 curExternal = createdExternal;
16093 ProcessFunction(createdExternal->function);
16095 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
16097 externalDecl->declaration = decl;
16098 if(decl->symbol && !decl->symbol->pointerExternal)
16099 decl->symbol->pointerExternal = externalDecl;
16101 if(propWatch->deleteWatch)
16103 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16105 ListAdd(args, CopyExpression(object));
16106 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16107 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16108 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16112 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16113 struct Identifier * propID;
16115 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16117 char propName[1024];
16118 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16122 char getName[1024], setName[1024];
16123 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16125 DeclareProperty(prop, setName, getName);
16126 strcpy(propName, "__ecereProp_");
16127 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16128 strcat(propName, "_");
16129 FullClassNameCat(propName, prop->name, 0x1);
16130 ListAdd(args, CopyExpression(object));
16131 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16132 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16133 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16134 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16137 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16142 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16144 curExternal = external;
16145 curContext = context;
16147 FreeExpression(watcher);
16149 FreeExpression(object);
16150 FreeList(watches, FreePropertyWatch);
16153 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16157 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16159 ProcessStatement(propWatch->compound);
16166 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16167 struct Expression * object = stmt->_watch.object;
16168 struct __ecereNameSpace__ecere__com__Class * _class;
16171 ProcessExpressionType(object);
16174 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16177 struct Identifier * propID;
16180 stmt->expressions = MkList();
16181 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16183 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16190 for(propID = (*watches).first; propID; propID = propID->next)
16192 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16196 CreateFireWatcher(prop, object, stmt);
16199 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16204 struct __ecereNameSpace__ecere__com__Property * prop;
16205 struct __ecereNameSpace__ecere__com__Class * base;
16207 for(base = _class; base; base = base->base)
16209 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16211 if(prop->isProperty && prop->isWatchable)
16213 CreateFireWatcher(prop, object, stmt);
16219 FreeExpression(object);
16220 FreeList(watches, FreeIdentifier);
16223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16229 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16230 struct Expression * object = stmt->_watch.object;
16231 struct Expression * watcher = stmt->_watch.watcher;
16232 struct __ecereNameSpace__ecere__com__Class * _class;
16235 ProcessExpressionType(object);
16237 ProcessExpressionType(watcher);
16240 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16241 if(watcher || thisClass)
16245 struct Identifier * propID;
16248 stmt->expressions = MkList();
16251 struct __ecereNameSpace__ecere__sys__OldList * args;
16254 ListAdd(args, CopyExpression(object));
16255 ListAdd(args, MkExpConstant("0"));
16256 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16257 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16261 for(propID = (*watches).first; propID; propID = propID->next)
16263 char propName[1024];
16264 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16268 char getName[1024], setName[1024];
16269 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16271 DeclareProperty(prop, setName, getName);
16272 strcpy(propName, "__ecereProp_");
16273 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16274 strcat(propName, "_");
16275 FullClassNameCat(propName, prop->name, 0x1);
16276 MangleClassName(propName);
16277 ListAdd(args, CopyExpression(object));
16278 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16279 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16280 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16283 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16287 FreeExpression(object);
16289 FreeExpression(watcher);
16290 FreeList(watches, FreeIdentifier);
16293 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16296 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16303 extern struct Expression * QBrackets(struct Expression * exp);
16305 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16307 extern struct Declarator * QMkPtrDecl(char * id);
16309 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16311 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16313 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16315 static void ProcessFunction(struct FunctionDefinition * function)
16317 struct Identifier * id = GetDeclId(function->declarator);
16318 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16319 struct Type * type = symbol ? symbol->type : (((void *)0));
16320 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16321 struct Context * oldTopContext = topContext;
16323 yylloc = function->loc;
16324 if(type && type->thisClass)
16326 struct Symbol * classSym = type->thisClass;
16327 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16328 char className[1024];
16329 char structName[1024];
16330 struct Declarator * funcDecl;
16331 struct Symbol * thisSymbol;
16332 unsigned int typedObject = 0x0;
16334 if(_class && !_class->base)
16336 _class = currentClass;
16337 if(_class && !_class->symbol)
16338 _class->symbol = FindClass(_class->fullName);
16339 classSym = _class ? _class->symbol : (((void *)0));
16342 thisClass = _class;
16343 if(inCompiler && _class)
16345 if(type->kind == 11)
16347 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16349 struct Type * param = symbol->type->params.first;
16351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16354 if(type->classObjectType != 1)
16356 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16357 symbol->type->staticMethod = 0x1;
16358 symbol->type->thisClass = (((void *)0));
16359 symbol->type->extraParam = 0x0;
16362 strcpy(className, "__ecereClass_");
16363 FullClassNameCat(className, _class->fullName, 0x1);
16364 MangleClassName(className);
16365 structName[0] = (char)0;
16366 FullClassNameCat(structName, _class->fullName, 0x0);
16367 funcDecl = GetFuncDecl(function->declarator);
16370 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16372 struct TypeName * param = (*funcDecl->function.parameters).first;
16374 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16376 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16377 FreeTypeName(param);
16380 if(!function->propertyNoThis)
16382 struct TypeName * thisParam;
16384 if(type->classObjectType != 1)
16386 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16387 if(!funcDecl->function.parameters)
16388 funcDecl->function.parameters = MkList();
16389 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16393 if(type->classObjectType != 1)
16395 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16396 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16398 thisParam = __extension__ ({
16399 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16401 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16403 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16407 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16409 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16411 funcDecl = GetFuncDecl(initDecl->declarator);
16414 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16416 struct TypeName * param = (*funcDecl->function.parameters).first;
16418 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16421 FreeTypeName(param);
16424 if(type->classObjectType != 1)
16426 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16428 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16430 if(!funcDecl->function.parameters)
16431 funcDecl->function.parameters = MkList();
16432 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16440 if(type->classObjectType != 1)
16442 thisSymbol = __extension__ ({
16443 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16445 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16447 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16448 if(typedObject && thisSymbol->type)
16450 thisSymbol->type->classObjectType = 2;
16451 thisSymbol->type->byReference = type->byReference;
16455 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16457 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16460 struct __ecereNameSpace__ecere__com__Class * base;
16462 for(base = _class; base && base->type != 1000; base = base->next)
16464 for(member = base->membersAndProperties.first; member; member = member->next)
16465 if(!member->isProperty)
16471 for(member = _class->membersAndProperties.first; member; member = member->next)
16472 if(!member->isProperty)
16476 char pointerName[1024];
16477 struct Declaration * decl;
16478 struct Initializer * initializer;
16479 struct Expression * exp, * bytePtr;
16481 strcpy(pointerName, "__ecerePointer_");
16482 FullClassNameCat(pointerName, _class->fullName, 0x0);
16484 char className[1024];
16486 strcpy(className, "__ecereClass_");
16487 FullClassNameCat(className, classSym->string, 0x1);
16488 MangleClassName(className);
16489 DeclareClass(classSym, className);
16491 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16496 sprintf(string, "%d", _class->offset);
16497 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16501 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16503 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16504 exp->expType = __extension__ ({
16505 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16507 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16508 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16510 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16511 }), __ecereInstance2;
16515 yylloc = function->body->loc;
16516 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16518 struct Context * prevContext = curContext;
16520 curContext = function->body->compound.context;
16521 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16522 curContext = prevContext;
16524 decl->symbol = (((void *)0));
16525 if(!function->body->compound.declarations)
16526 function->body->compound.declarations = MkList();
16527 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16533 thisClass = (((void *)0));
16536 FreeSpecifier(id->_class);
16537 id->_class = (((void *)0));
16538 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16540 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16542 id = GetDeclId(initDecl->declarator);
16543 FreeSpecifier(id->_class);
16544 id->_class = (((void *)0));
16548 topContext = function->body->compound.context;
16550 struct FunctionDefinition * oldFunction = curFunction;
16552 curFunction = function;
16554 ProcessStatement(function->body);
16555 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16557 struct Statement * prevCompound = curCompound;
16558 struct Context * prevContext = curContext;
16559 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16561 if(!function->body->compound.statements)
16562 function->body->compound.statements = MkList();
16563 ListAdd(function->body->compound.statements, fireWatchers);
16564 curCompound = function->body;
16565 curContext = function->body->compound.context;
16566 ProcessStatement(fireWatchers);
16567 curContext = prevContext;
16568 curCompound = prevCompound;
16570 curFunction = oldFunction;
16572 if(function->declarator)
16574 ProcessDeclarator(function->declarator);
16576 topContext = oldTopContext;
16577 thisClass = oldThisClass;
16580 extern void FreeSymbol(struct Symbol * symbol);
16582 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16584 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16586 struct ClassDef * def;
16587 struct External * external = curExternal;
16588 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16590 for(def = definitions->first; def; def = def->next)
16594 if(def->function->declarator)
16595 curExternal = def->function->declarator->symbol->pointerExternal;
16597 curExternal = external;
16598 ProcessFunction((struct FunctionDefinition *)def->function);
16600 else if(def->type == 2)
16602 if(def->decl->type == 2)
16604 thisClass = regClass;
16605 ProcessInstantiationType(def->decl->inst);
16606 thisClass = (((void *)0));
16610 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16613 thisClass = regClass;
16614 ProcessDeclaration(def->decl);
16615 thisClass = backThisClass;
16618 else if(def->type == 1 && def->defProperties)
16620 struct MemberInit * defProperty;
16621 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);
16623 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16624 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16626 thisClass = regClass;
16627 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16628 thisClass = (((void *)0));
16630 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16631 FreeSymbol(thisSymbol);
16633 else if(def->type == 3 && def->propertyDef)
16635 struct PropertyDef * prop = def->propertyDef;
16637 thisClass = regClass;
16642 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16644 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16646 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16647 ProcessStatement(prop->setStmt);
16653 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16655 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16657 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16658 ProcessStatement(prop->getStmt);
16660 if(prop->issetStmt)
16664 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16666 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16668 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16669 ProcessStatement(prop->issetStmt);
16671 thisClass = (((void *)0));
16673 else if(def->type == 4 && def->propertyWatch)
16675 struct PropertyWatch * propertyWatch = def->propertyWatch;
16677 thisClass = regClass;
16678 if(propertyWatch->compound)
16680 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);
16682 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16683 curExternal = (((void *)0));
16684 ProcessStatement(propertyWatch->compound);
16686 thisClass = (((void *)0));
16691 void DeclareFunctionUtil(char * s)
16693 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16700 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16701 strcpy(name, "__ecereFunction_");
16702 FullClassNameCat(name, s, 0x0);
16703 DeclareFunction(function, name);
16707 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16709 void ComputeDataTypes()
16711 struct External * external;
16712 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16713 struct External * after = (((void *)0));
16715 currentClass = (((void *)0));
16716 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16717 for(external = (*ast).first; external; external = external->next)
16719 if(external->type == 1)
16721 struct Declaration * decl = external->declaration;
16725 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16729 struct InitDeclarator * initDecl = (*decls).first;
16733 struct Declarator * declarator = initDecl->declarator;
16735 if(declarator && declarator->type == 1)
16737 struct Identifier * id = declarator->identifier;
16739 if(id && id->string)
16741 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16743 external->symbol->id = -1001, external->symbol->idCode = -1001;
16753 temp->symbol = __extension__ ({
16754 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16756 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16759 curExternal = temp;
16760 DeclareFunctionUtil("eSystem_New");
16761 DeclareFunctionUtil("eSystem_New0");
16762 DeclareFunctionUtil("eSystem_Renew");
16763 DeclareFunctionUtil("eSystem_Renew0");
16764 DeclareFunctionUtil("eClass_GetProperty");
16765 DeclareStruct("ecere::com::Class", 0x0);
16766 DeclareStruct("ecere::com::Instance", 0x0);
16767 DeclareStruct("ecere::com::Property", 0x0);
16768 DeclareStruct("ecere::com::DataMember", 0x0);
16769 DeclareStruct("ecere::com::Method", 0x0);
16770 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16771 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16772 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16773 for(external = (*ast).first; external; external = external->next)
16775 afterExternal = curExternal = external;
16776 if(external->type == 0)
16778 currentClass = external->function->_class;
16779 ProcessFunction(external->function);
16781 else if(external->type == 1)
16783 currentClass = (((void *)0));
16784 ProcessDeclaration(external->declaration);
16786 else if(external->type == 2)
16788 struct ClassDefinition * _class = external->_class;
16790 currentClass = external->symbol->registered;
16791 if(_class->definitions)
16793 ProcessClass(_class->definitions, _class->symbol);
16797 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16798 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16801 else if(external->type == 4)
16803 thisNameSpace = external->id->string;
16806 currentClass = (((void *)0));
16807 thisNameSpace = (((void *)0));
16808 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16809 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16812 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);
16814 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);
16816 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16818 struct __ecereNameSpace__ecere__com__Class * class;
16820 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16821 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16822 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16823 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16824 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16825 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16826 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16827 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16828 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16829 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16830 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16831 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16832 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16833 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16834 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16835 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16836 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16837 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16838 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16839 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16840 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16841 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16842 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16843 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16844 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16845 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16846 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16847 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16848 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16849 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16850 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16851 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16852 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16853 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16854 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16855 __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);
16856 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16857 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16858 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16859 __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);
16860 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16861 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16862 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16863 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16864 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16865 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16866 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16867 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16868 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16869 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16870 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16871 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16872 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16873 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16874 __ecereClass_Conversion = class;
16875 __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);
16876 __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);
16877 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16878 __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);
16879 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16880 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16881 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16882 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16883 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16884 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16885 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16886 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16887 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16888 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16889 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
16890 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16891 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16892 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16893 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16894 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16895 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16896 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16899 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)