1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
55 struct __ecereNameSpace__ecere__sys__BTNode;
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
59 struct __ecereNameSpace__ecere__sys__BinaryTree
61 struct __ecereNameSpace__ecere__sys__BTNode * root;
63 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
64 void (* FreeKey)(void * key);
65 } __attribute__ ((gcc_struct));
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
69 struct __ecereNameSpace__ecere__sys__OldList
76 } __attribute__ ((gcc_struct));
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
80 struct __ecereNameSpace__ecere__com__Method
83 struct __ecereNameSpace__ecere__com__Method * parent;
84 struct __ecereNameSpace__ecere__com__Method * left;
85 struct __ecereNameSpace__ecere__com__Method * right;
90 struct __ecereNameSpace__ecere__com__Class * _class;
92 char * dataTypeString;
93 struct Type * dataType;
95 } __attribute__ ((gcc_struct));
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
99 struct __ecereNameSpace__ecere__com__Property
101 struct __ecereNameSpace__ecere__com__Property * prev;
102 struct __ecereNameSpace__ecere__com__Property * next;
104 unsigned int isProperty;
107 struct __ecereNameSpace__ecere__com__Class * _class;
108 char * dataTypeString;
109 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
110 struct Type * dataType;
111 void (* Set)(void * , int);
112 int (* Get)(void * );
113 unsigned int (* IsSet)(void * );
117 unsigned int conversion;
118 unsigned int watcherOffset;
120 unsigned int compiled;
121 unsigned int selfWatchable;
122 unsigned int isWatchable;
123 } __attribute__ ((gcc_struct));
125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
133 } __attribute__ ((gcc_struct));
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
139 struct CodePosition start;
140 struct CodePosition end;
141 } __attribute__ ((gcc_struct));
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
156 struct Attrib * attr;
157 } __attribute__ ((gcc_struct));
158 } __attribute__ ((gcc_struct));
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
162 struct ClassDefinition
164 struct ClassDefinition * prev;
165 struct ClassDefinition * next;
167 struct Specifier * _class;
168 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
169 struct __ecereNameSpace__ecere__sys__OldList * definitions;
170 struct Symbol * symbol;
171 struct Location blockStart;
172 struct Location nameLoc;
175 unsigned int deleteWatchable;
176 } __attribute__ ((gcc_struct));
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
182 struct Context * parent;
183 struct __ecereNameSpace__ecere__sys__BinaryTree types;
184 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
185 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
186 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
190 struct ClassDefinition * classDef;
191 unsigned int templateTypesOnly;
192 unsigned int hasNameSpace;
193 } __attribute__ ((gcc_struct));
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
199 struct Instantiation * prev;
200 struct Instantiation * next;
202 struct Specifier * _class;
203 struct Expression * exp;
204 struct __ecereNameSpace__ecere__sys__OldList * members;
205 struct Symbol * symbol;
206 unsigned int fullSet;
207 unsigned int isConstant;
208 unsigned char * data;
209 struct Location nameLoc;
210 struct Location insideLoc;
212 } __attribute__ ((gcc_struct));
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
218 struct Declaration * prev;
219 struct Declaration * next;
226 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
227 struct __ecereNameSpace__ecere__sys__OldList * declarators;
228 } __attribute__ ((gcc_struct));
229 struct Instantiation * inst;
232 struct Identifier * id;
233 struct Expression * exp;
234 } __attribute__ ((gcc_struct));
235 } __attribute__ ((gcc_struct));
236 struct Specifier * extStorage;
237 struct Symbol * symbol;
239 } __attribute__ ((gcc_struct));
241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
245 struct Statement * prev;
246 struct Statement * next;
251 struct __ecereNameSpace__ecere__sys__OldList * expressions;
254 struct Identifier * id;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) labeled;
259 struct Expression * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) caseStmt;
264 struct __ecereNameSpace__ecere__sys__OldList * declarations;
265 struct __ecereNameSpace__ecere__sys__OldList * statements;
266 struct Context * context;
267 unsigned int isSwitch;
268 } __attribute__ ((gcc_struct)) compound;
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 struct Statement * elseStmt;
274 } __attribute__ ((gcc_struct)) ifStmt;
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) switchStmt;
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 } __attribute__ ((gcc_struct)) whileStmt;
287 struct __ecereNameSpace__ecere__sys__OldList * exp;
288 struct Statement * stmt;
289 } __attribute__ ((gcc_struct)) doWhile;
292 struct Statement * init;
293 struct Statement * check;
294 struct __ecereNameSpace__ecere__sys__OldList * increment;
295 struct Statement * stmt;
296 } __attribute__ ((gcc_struct)) forStmt;
299 struct Identifier * id;
300 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct Specifier * spec;
305 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
307 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
308 } __attribute__ ((gcc_struct)) asmStmt;
311 struct Expression * watcher;
312 struct Expression * object;
313 struct __ecereNameSpace__ecere__sys__OldList * watches;
314 } __attribute__ ((gcc_struct)) _watch;
317 struct Identifier * id;
318 struct __ecereNameSpace__ecere__sys__OldList * exp;
319 struct __ecereNameSpace__ecere__sys__OldList * filter;
320 struct Statement * stmt;
321 } __attribute__ ((gcc_struct)) forEachStmt;
322 struct Declaration * decl;
323 } __attribute__ ((gcc_struct));
324 } __attribute__ ((gcc_struct));
326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
330 struct TypeName * prev;
331 struct TypeName * next;
333 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
334 struct Declarator * declarator;
336 struct Expression * bitCount;
337 } __attribute__ ((gcc_struct));
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
343 struct Initializer * prev;
344 struct Initializer * next;
349 struct Expression * exp;
350 struct __ecereNameSpace__ecere__sys__OldList * list;
351 } __attribute__ ((gcc_struct));
352 unsigned int isConstant;
353 } __attribute__ ((gcc_struct));
355 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
357 struct __ecereNameSpace__ecere__com__DataValue
372 } __attribute__ ((gcc_struct));
373 } __attribute__ ((gcc_struct));
375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
379 struct Expression * prev;
380 struct Expression * next;
388 struct Identifier * identifier;
389 } __attribute__ ((gcc_struct));
390 struct Statement * compound;
391 struct Instantiation * instance;
393 struct __ecereNameSpace__ecere__sys__OldList * list;
396 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
397 struct Declarator * decl;
398 } __attribute__ ((gcc_struct)) _classExp;
401 struct Identifier * id;
402 } __attribute__ ((gcc_struct)) classData;
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * arguments;
407 struct Location argLoc;
408 } __attribute__ ((gcc_struct)) call;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * index;
413 } __attribute__ ((gcc_struct)) index;
416 struct Expression * exp;
417 struct Identifier * member;
419 unsigned int thisPtr;
420 } __attribute__ ((gcc_struct)) member;
424 struct Expression * exp1;
425 struct Expression * exp2;
426 } __attribute__ ((gcc_struct)) op;
427 struct TypeName * typeName;
428 struct Specifier * _class;
431 struct TypeName * typeName;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) cast;
436 struct Expression * cond;
437 struct __ecereNameSpace__ecere__sys__OldList * exp;
438 struct Expression * elseExp;
439 } __attribute__ ((gcc_struct)) cond;
442 struct TypeName * typeName;
443 struct Expression * size;
444 } __attribute__ ((gcc_struct)) _new;
447 struct TypeName * typeName;
448 struct Expression * size;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) _renew;
454 struct Identifier * id;
455 } __attribute__ ((gcc_struct)) db;
458 struct Expression * ds;
459 struct Expression * name;
460 } __attribute__ ((gcc_struct)) dbopen;
463 struct TypeName * typeName;
464 struct Initializer * initializer;
465 } __attribute__ ((gcc_struct)) initializer;
468 struct Expression * exp;
469 struct TypeName * typeName;
470 } __attribute__ ((gcc_struct)) vaArg;
471 } __attribute__ ((gcc_struct));
472 unsigned int debugValue;
473 struct __ecereNameSpace__ecere__com__DataValue val;
475 unsigned int hasAddress;
476 struct Type * expType;
477 struct Type * destType;
480 unsigned int byReference;
481 unsigned int isConstant;
482 unsigned int addedThis;
483 unsigned int needCast;
484 unsigned int thisPtr;
485 } __attribute__ ((gcc_struct));
487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
489 struct TemplateDatatype
491 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
492 struct Declarator * decl;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
497 struct TemplateArgument;
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
501 struct TemplateParameter
503 struct TemplateParameter * prev;
504 struct TemplateParameter * next;
507 struct Identifier * identifier;
510 struct TemplateDatatype * dataType;
512 } __attribute__ ((gcc_struct));
513 struct TemplateArgument * defaultArgument;
514 char * dataTypeString;
515 struct Type * baseType;
516 } __attribute__ ((gcc_struct));
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
522 struct Specifier * prev;
523 struct Specifier * next;
531 struct ExtDecl * extDecl;
533 struct Symbol * symbol;
534 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
535 } __attribute__ ((gcc_struct));
538 struct Identifier * id;
539 struct __ecereNameSpace__ecere__sys__OldList * list;
540 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
541 struct __ecereNameSpace__ecere__sys__OldList * definitions;
542 unsigned int addNameSpace;
543 struct Context * ctx;
544 struct ExtDecl * extDeclStruct;
545 } __attribute__ ((gcc_struct));
546 struct Expression * expression;
547 struct Specifier * _class;
548 struct TemplateParameter * templateParameter;
549 } __attribute__ ((gcc_struct));
550 } __attribute__ ((gcc_struct));
552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
556 struct Identifier * prev;
557 struct Identifier * next;
559 struct Symbol * classSym;
560 struct Specifier * _class;
562 struct Identifier * badID;
563 } __attribute__ ((gcc_struct));
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
569 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
573 struct Declarator * prev;
574 struct Declarator * next;
577 struct Symbol * symbol;
578 struct Declarator * declarator;
581 struct Identifier * identifier;
584 struct Expression * exp;
585 struct Expression * posExp;
586 struct Attrib * attrib;
587 } __attribute__ ((gcc_struct)) structDecl;
590 struct Expression * exp;
591 struct Specifier * enumClass;
592 } __attribute__ ((gcc_struct)) array;
595 struct __ecereNameSpace__ecere__sys__OldList * parameters;
596 } __attribute__ ((gcc_struct)) function;
599 struct Pointer * pointer;
600 } __attribute__ ((gcc_struct)) pointer;
603 struct ExtDecl * extended;
604 } __attribute__ ((gcc_struct)) extended;
605 } __attribute__ ((gcc_struct));
606 } __attribute__ ((gcc_struct));
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
610 struct FunctionDefinition
612 struct FunctionDefinition * prev;
613 struct FunctionDefinition * next;
615 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
616 struct Declarator * declarator;
617 struct __ecereNameSpace__ecere__sys__OldList * declarations;
618 struct Statement * body;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 struct __ecereNameSpace__ecere__sys__OldList attached;
623 struct Symbol * propSet;
625 unsigned int propertyNoThis;
626 } __attribute__ ((gcc_struct));
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
636 struct External * prev;
637 struct External * next;
640 struct Symbol * symbol;
643 struct FunctionDefinition * function;
644 struct ClassDefinition * _class;
645 struct Declaration * declaration;
647 struct Identifier * id;
648 struct DBTableDef * table;
649 } __attribute__ ((gcc_struct));
651 } __attribute__ ((gcc_struct));
653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
657 struct ModuleImport * prev;
658 struct ModuleImport * next;
660 struct __ecereNameSpace__ecere__sys__OldList classes;
661 struct __ecereNameSpace__ecere__sys__OldList functions;
664 } __attribute__ ((gcc_struct));
666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
670 struct ClassImport * prev;
671 struct ClassImport * next;
673 struct __ecereNameSpace__ecere__sys__OldList methods;
674 struct __ecereNameSpace__ecere__sys__OldList properties;
676 unsigned int isRemote;
677 } __attribute__ ((gcc_struct));
679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
684 struct Symbol * parent;
685 struct Symbol * left;
686 struct Symbol * right;
691 struct __ecereNameSpace__ecere__com__Method * method;
692 struct __ecereNameSpace__ecere__com__Property * _property;
693 struct __ecereNameSpace__ecere__com__Class * registered;
694 } __attribute__ ((gcc_struct));
701 struct External * pointerExternal;
702 struct External * structExternal;
703 } __attribute__ ((gcc_struct));
706 struct External * externalGet;
707 struct External * externalSet;
708 struct External * externalPtr;
709 struct External * externalIsSet;
710 } __attribute__ ((gcc_struct));
713 struct External * methodExternal;
714 struct External * methodCodeExternal;
715 } __attribute__ ((gcc_struct));
716 } __attribute__ ((gcc_struct));
717 unsigned int imported;
718 unsigned int declaredStructSym;
719 struct __ecereNameSpace__ecere__com__Class * _class;
720 unsigned int declaredStruct;
721 unsigned int needConstructor;
722 unsigned int needDestructor;
723 char * constructorName;
726 char * destructorName;
727 struct ModuleImport * module;
728 struct ClassImport * _import;
729 struct Location nameLoc;
730 unsigned int isParam;
731 unsigned int isRemote;
732 unsigned int isStruct;
733 unsigned int fireWatchersDone;
735 unsigned int classData;
736 unsigned int isStatic;
738 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
739 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
740 struct Context * ctx;
742 struct Expression * propCategory;
743 } __attribute__ ((gcc_struct));
745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
754 struct Symbol * _class;
757 struct __ecereNameSpace__ecere__sys__OldList members;
759 } __attribute__ ((gcc_struct));
762 struct Type * returnType;
763 struct __ecereNameSpace__ecere__sys__OldList params;
764 struct Symbol * thisClass;
765 unsigned int staticMethod;
766 struct TemplateParameter * thisClassTemplate;
767 } __attribute__ ((gcc_struct));
770 struct __ecereNameSpace__ecere__com__Method * method;
771 struct __ecereNameSpace__ecere__com__Class * methodClass;
772 struct __ecereNameSpace__ecere__com__Class * usedClass;
773 } __attribute__ ((gcc_struct));
776 struct Type * arrayType;
778 struct Expression * arraySizeExp;
779 unsigned int freeExp;
780 struct Symbol * enumClass;
781 } __attribute__ ((gcc_struct));
783 struct TemplateParameter * templateParameter;
784 } __attribute__ ((gcc_struct));
794 unsigned int isSigned : 1;
795 unsigned int constant : 1;
796 unsigned int truth : 1;
797 unsigned int byReference : 1;
798 unsigned int extraParam : 1;
799 unsigned int directClassAccess : 1;
800 unsigned int computing : 1;
801 unsigned int keepCast : 1;
802 unsigned int passAsTemplate : 1;
803 unsigned int dllExport : 1;
804 unsigned int attrStdcall : 1;
805 unsigned int declaredWithStruct : 1;
806 unsigned int typedByReference : 1;
807 } __attribute__ ((gcc_struct));
809 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
811 struct __ecereNameSpace__ecere__com__Class
813 struct __ecereNameSpace__ecere__com__Class * prev;
814 struct __ecereNameSpace__ecere__com__Class * next;
820 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
824 struct __ecereNameSpace__ecere__com__Class * base;
825 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
826 struct __ecereNameSpace__ecere__sys__BinaryTree members;
827 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
828 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
829 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
830 struct __ecereNameSpace__ecere__sys__OldList derivatives;
834 struct __ecereNameSpace__ecere__com__Instance * module;
835 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
836 char * dataTypeString;
837 struct Type * dataType;
839 int defaultAlignment;
840 void (* Initialize)();
842 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
843 char * designerClass;
844 unsigned int noExpansion;
845 char * defaultProperty;
846 unsigned int comRedefinition;
848 unsigned int isRemote;
849 unsigned int internalDecl;
851 unsigned int computeSize;
853 int destructionWatchOffset;
855 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
856 int inheritanceAccess;
859 struct __ecereNameSpace__ecere__sys__OldList conversions;
860 struct __ecereNameSpace__ecere__sys__OldList templateParams;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
862 struct __ecereNameSpace__ecere__com__Class * templateClass;
863 struct __ecereNameSpace__ecere__sys__OldList templatized;
865 unsigned int isInstanceClass;
866 unsigned int byValueSystemClass;
867 } __attribute__ ((gcc_struct));
869 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
873 struct __ecereNameSpace__ecere__com__Instance
876 struct __ecereNameSpace__ecere__com__Class * _class;
878 } __attribute__ ((gcc_struct));
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
882 struct __ecereNameSpace__ecere__com__DataMember
884 struct __ecereNameSpace__ecere__com__DataMember * prev;
885 struct __ecereNameSpace__ecere__com__DataMember * next;
887 unsigned int isProperty;
890 struct __ecereNameSpace__ecere__com__Class * _class;
891 char * dataTypeString;
892 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
893 struct Type * dataType;
897 struct __ecereNameSpace__ecere__sys__OldList members;
898 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
901 } __attribute__ ((gcc_struct));
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
905 struct __ecereNameSpace__ecere__com__SerialBuffer
907 unsigned char * _buffer;
911 } __attribute__ ((gcc_struct));
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
915 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
921 char * dataTypeString;
922 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
923 } __attribute__ ((gcc_struct));
924 struct __ecereNameSpace__ecere__com__DataValue expression;
930 struct __ecereNameSpace__ecere__com__DataMember * member;
931 struct __ecereNameSpace__ecere__com__Property * prop;
932 struct __ecereNameSpace__ecere__com__Method * method;
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
935 } __attribute__ ((gcc_struct));
936 } __attribute__ ((gcc_struct));
938 void exit(int status);
940 void * calloc(size_t nmemb, size_t size);
942 void free(void * ptr);
944 void * malloc(size_t size);
946 void * realloc(void * ptr, size_t size);
948 long int strtol(const char * nptr, char ** endptr, int base);
950 long long int strtoll(const char * nptr, char ** endptr, int base);
952 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
956 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
959 typedef union YYSTYPE
964 struct Identifier * id;
965 struct Expression * exp;
966 struct Specifier * specifier;
967 struct __ecereNameSpace__ecere__sys__OldList * list;
968 struct Enumerator * enumerator;
969 struct Declarator * declarator;
970 struct Pointer * pointer;
971 struct Initializer * initializer;
972 struct InitDeclarator * initDeclarator;
973 struct TypeName * typeName;
974 struct Declaration * declaration;
975 struct Statement * stmt;
976 struct FunctionDefinition * function;
977 struct External * external;
978 struct Context * context;
979 struct AsmField * asmField;
980 struct Attrib * attrib;
981 struct ExtDecl * extDecl;
982 struct Attribute * attribute;
983 struct Instantiation * instance;
984 struct MembersInit * membersInit;
985 struct MemberInit * memberInit;
986 struct ClassFunction * classFunction;
987 struct ClassDefinition * _class;
988 struct ClassDef * classDef;
989 struct PropertyDef * prop;
991 struct Symbol * symbol;
992 struct PropertyWatch * propertyWatch;
993 struct TemplateParameter * templateParameter;
994 struct TemplateArgument * templateArgument;
995 struct TemplateDatatype * templateDatatype;
996 struct DBTableEntry * dbtableEntry;
997 struct DBIndexItem * dbindexItem;
998 struct DBTableDef * dbtableDef;
999 } __attribute__ ((gcc_struct)) YYSTYPE;
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1005 struct Enumerator * prev;
1006 struct Enumerator * next;
1007 struct Location loc;
1008 struct Identifier * id;
1009 struct Expression * exp;
1010 } __attribute__ ((gcc_struct));
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1014 struct InitDeclarator
1016 struct InitDeclarator * prev;
1017 struct InitDeclarator * next;
1018 struct Location loc;
1019 struct Declarator * declarator;
1020 struct Initializer * initializer;
1021 } __attribute__ ((gcc_struct));
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1027 struct AsmField * prev;
1028 struct AsmField * next;
1029 struct Location loc;
1031 struct Expression * expression;
1032 } __attribute__ ((gcc_struct));
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1038 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1040 struct ClassFunction
1042 struct ClassFunction * prev;
1043 struct ClassFunction * next;
1044 struct Location loc;
1045 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1046 struct Declarator * declarator;
1047 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1048 struct Statement * body;
1049 struct __ecereNameSpace__ecere__com__Class * _class;
1050 struct __ecereNameSpace__ecere__sys__OldList attached;
1053 struct Symbol * propSet;
1054 unsigned int isVirtual;
1055 unsigned int isConstructor;
1056 unsigned int isDestructor;
1057 unsigned int dontMangle;
1060 } __attribute__ ((gcc_struct));
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1066 struct MembersInit * prev;
1067 struct MembersInit * next;
1068 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1073 struct ClassFunction * function;
1074 } __attribute__ ((gcc_struct));
1075 } __attribute__ ((gcc_struct));
1077 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1081 struct MemberInit * prev;
1082 struct MemberInit * next;
1083 struct Location loc;
1084 struct Location realLoc;
1085 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1086 struct Initializer * initializer;
1088 unsigned int variable;
1089 unsigned int takeOutExp;
1090 } __attribute__ ((gcc_struct));
1092 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1096 struct PropertyDef * prev;
1097 struct PropertyDef * next;
1098 struct Location loc;
1099 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1100 struct Declarator * declarator;
1101 struct Identifier * id;
1102 struct Statement * getStmt;
1103 struct Statement * setStmt;
1104 struct Statement * issetStmt;
1105 struct Symbol * symbol;
1106 unsigned int conversion;
1107 unsigned int isWatchable;
1108 struct Expression * category;
1109 } __attribute__ ((gcc_struct));
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1113 struct PropertyWatch
1115 struct PropertyWatch * prev;
1116 struct PropertyWatch * next;
1117 struct Location loc;
1118 struct Statement * compound;
1119 struct __ecereNameSpace__ecere__sys__OldList * properties;
1120 unsigned int deleteWatch;
1121 } __attribute__ ((gcc_struct));
1123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1127 struct ClassDef * prev;
1128 struct ClassDef * next;
1129 struct Location loc;
1133 struct Declaration * decl;
1134 struct ClassFunction * function;
1135 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1136 struct PropertyDef * propertyDef;
1137 struct PropertyWatch * propertyWatch;
1139 struct Identifier * defaultProperty;
1142 struct Identifier * id;
1143 struct Initializer * initializer;
1144 } __attribute__ ((gcc_struct));
1145 } __attribute__ ((gcc_struct));
1148 } __attribute__ ((gcc_struct));
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1152 struct DBTableEntry;
1154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1158 extern YYSTYPE yylval;
1160 extern struct Location yylloc;
1162 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1164 extern int returnCode;
1166 extern struct Expression * parsedExpression;
1168 extern unsigned int yydebug;
1170 void SetYydebug(unsigned int b)
1175 extern unsigned int echoOn;
1177 void resetScanner();
1181 int expression_yyparse();
1183 static struct Statement * curCompound;
1185 struct External * curExternal, * afterExternal;
1187 static struct Type * curSwitchType;
1189 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1191 struct __ecereNameSpace__ecere__com__Class * thisClass;
1193 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1198 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1203 static char * thisNameSpace;
1205 struct __ecereNameSpace__ecere__com__Class * containerClass;
1207 unsigned int thisClassParams = 0x1;
1209 unsigned int internalValueCounter;
1211 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1213 extern size_t strlen(const char * );
1215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1217 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1219 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1221 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1223 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1225 void PrintExpression(struct Expression * exp, char * string)
1228 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1232 OutputExpression(exp, f);
1233 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1234 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1236 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1237 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1238 count = strlen(string);
1239 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1240 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1242 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1243 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1244 string[count] = '\0';
1245 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1249 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1251 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1253 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1255 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1257 if(!param->baseType)
1259 if(param->dataTypeString)
1260 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1262 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1264 return param->baseType;
1266 return (((void *)0));
1269 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1271 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1273 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1277 if(type1->kind == type2->kind)
1287 if(type1->passAsTemplate && !type2->passAsTemplate)
1289 return type1->isSigned != type2->isSigned;
1291 return type1->_class != type2->_class;
1293 return NeedCast(type1->type, type2->type);
1301 extern int strcmp(const char * , const char * );
1303 extern struct Context * curContext;
1305 extern struct Context * topContext;
1307 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1309 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);
1311 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1313 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);
1315 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);
1317 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1319 struct __ecereNameSpace__ecere__com__ClassProperty
1322 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1323 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1324 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1326 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1327 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1328 char * dataTypeString;
1329 struct Type * dataType;
1330 unsigned int constant;
1331 } __attribute__ ((gcc_struct));
1333 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1335 extern struct Expression * QMkExpId(char * id);
1337 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1339 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1341 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1342 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1347 char * dataTypeString;
1349 } __attribute__ ((gcc_struct));
1350 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1352 } __attribute__ ((gcc_struct));
1354 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1356 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1358 extern void FreeIdentifier(struct Identifier * id);
1360 void ProcessExpressionType(struct Expression * exp);
1362 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1364 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1366 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1368 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1370 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1372 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1374 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1376 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1378 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1380 if(exp->type == 0 && exp->identifier)
1382 struct Identifier * id = exp->identifier;
1383 struct Context * ctx;
1384 struct Symbol * symbol = (((void *)0));
1386 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1388 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1390 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1395 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1397 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1398 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1399 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1400 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1404 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1406 if(!prop && !method)
1407 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1408 if(!prop && !method && !member)
1410 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1412 if(prop || method || member || classProp)
1415 exp->member.member = id;
1416 exp->member.memberType = 0;
1417 exp->member.exp = QMkExpId("this");
1418 exp->addedThis = 0x1;
1420 else if(_class && _class->templateParams.first)
1422 struct __ecereNameSpace__ecere__com__Class * sClass;
1424 for(sClass = _class; sClass; sClass = sClass->base)
1426 if(sClass->templateParams.first)
1428 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1430 for(param = sClass->templateParams.first; param; param = param->next)
1432 if(param->type == 2 && !strcmp(param->name, id->string))
1434 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1438 struct Declarator * decl;
1439 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1441 FreeIdentifier(exp->member.member);
1442 ProcessExpressionType(argExp);
1443 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1444 exp->expType = ProcessType(specs, decl);
1446 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1457 extern int sprintf(char * , char * , ...);
1459 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1461 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1463 char * PrintInt(long long result)
1467 if(result > (((long long)0x7fffffffffffffffLL)))
1468 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1471 return __ecereNameSpace__ecere__sys__CopyString(temp);
1474 char * PrintUInt(uint64 result)
1478 if(result > (0xffffffff))
1479 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1480 else if(result > (((int)0x7fffffff)))
1481 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1483 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1484 return __ecereNameSpace__ecere__sys__CopyString(temp);
1487 char * PrintInt64(long long result)
1491 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1492 return __ecereNameSpace__ecere__sys__CopyString(temp);
1495 char * PrintUInt64(uint64 result)
1499 if(result > (((long long)0x7fffffffffffffffLL)))
1500 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1502 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1503 return __ecereNameSpace__ecere__sys__CopyString(temp);
1506 char * PrintHexUInt(uint64 result)
1510 if(result > (0xffffffff))
1511 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1513 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1514 return __ecereNameSpace__ecere__sys__CopyString(temp);
1517 char * PrintHexUInt64(uint64 result)
1521 if(result > (0xffffffff))
1522 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1525 return __ecereNameSpace__ecere__sys__CopyString(temp);
1528 char * PrintShort(short result)
1532 sprintf(temp, "%d", (unsigned short)result);
1533 return __ecereNameSpace__ecere__sys__CopyString(temp);
1536 char * PrintUShort(unsigned short result)
1540 if(result > (unsigned short)32767)
1541 sprintf(temp, "0x%X", (int)result);
1543 sprintf(temp, "%d", (int)result);
1544 return __ecereNameSpace__ecere__sys__CopyString(temp);
1547 extern int isprint(int c);
1549 char * PrintChar(char result)
1553 if(result > (char)0 && isprint(result))
1554 sprintf(temp, "'%c'", result);
1555 else if(result < (char)0)
1556 sprintf(temp, "%d", (int)result);
1558 sprintf(temp, "0x%X", (unsigned char)result);
1559 return __ecereNameSpace__ecere__sys__CopyString(temp);
1562 char * PrintUChar(unsigned char result)
1566 sprintf(temp, "0x%X", result);
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1570 char * PrintFloat(float result)
1574 sprintf(temp, "%.16ff", result);
1575 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 char * PrintDouble(double result)
1582 sprintf(temp, "%.16f", result);
1583 return __ecereNameSpace__ecere__sys__CopyString(temp);
1586 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1590 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* Neg)(struct Expression *, struct Operand *);
1596 unsigned int (* Inc)(struct Expression *, struct Operand *);
1597 unsigned int (* Dec)(struct Expression *, struct Operand *);
1598 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1610 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1612 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (* Not)(struct Expression *, struct Operand *);
1616 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1625 } __attribute__ ((gcc_struct));
1627 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1633 unsigned int ptrSize;
1646 } __attribute__ ((gcc_struct));
1648 } __attribute__ ((gcc_struct));
1650 struct Operand GetOperand(struct Expression * exp);
1652 unsigned int GetInt(struct Expression * exp, int * value2)
1654 struct Operand op2 = GetOperand(exp);
1656 if(op2.kind == 3 && op2.type->isSigned)
1658 else if(op2.kind == 3)
1659 *value2 = (int)op2.ui;
1660 else if(op2.kind == 4 && op2.type->isSigned)
1661 *value2 = (int)op2.i64;
1662 else if(op2.kind == 4)
1663 *value2 = (int)op2.ui64;
1664 else if(op2.kind == 23 && op2.type->isSigned)
1665 *value2 = (int)op2.i64;
1666 else if(op2.kind == 23)
1667 *value2 = (int)op2.ui64;
1668 else if(op2.kind == 22 && op2.type->isSigned)
1669 *value2 = (int)op2.i64;
1670 else if(op2.kind == 22)
1671 *value2 = (int)op2.ui64;
1672 else if(op2.kind == 2 && op2.type->isSigned)
1673 *value2 = (int)op2.s;
1674 else if(op2.kind == 2)
1675 *value2 = (int)op2.us;
1676 else if(op2.kind == 1 && op2.type->isSigned)
1677 *value2 = (int)op2.c;
1678 else if(op2.kind == 1)
1679 *value2 = (int)op2.uc;
1680 else if(op2.kind == 6)
1681 *value2 = (int)op2.f;
1682 else if(op2.kind == 7)
1683 *value2 = (int)op2.d;
1684 else if(op2.kind == 13)
1685 *value2 = (int)op2.ui64;
1691 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1693 struct Operand op2 = GetOperand(exp);
1695 if(op2.kind == 3 && op2.type->isSigned)
1696 *value2 = (unsigned int)op2.i;
1697 else if(op2.kind == 3)
1699 else if(op2.kind == 4 && op2.type->isSigned)
1700 *value2 = (unsigned int)op2.i64;
1701 else if(op2.kind == 4)
1702 *value2 = (unsigned int)op2.ui64;
1703 else if(op2.kind == 23 && op2.type->isSigned)
1704 *value2 = (unsigned int)op2.i64;
1705 else if(op2.kind == 23)
1706 *value2 = (unsigned int)op2.ui64;
1707 else if(op2.kind == 22 && op2.type->isSigned)
1708 *value2 = (unsigned int)op2.i64;
1709 else if(op2.kind == 22)
1710 *value2 = (unsigned int)op2.ui64;
1711 else if(op2.kind == 2 && op2.type->isSigned)
1712 *value2 = (unsigned int)op2.s;
1713 else if(op2.kind == 2)
1714 *value2 = (unsigned int)op2.us;
1715 else if(op2.kind == 1 && op2.type->isSigned)
1716 *value2 = (unsigned int)op2.c;
1717 else if(op2.kind == 1)
1718 *value2 = (unsigned int)op2.uc;
1719 else if(op2.kind == 6)
1720 *value2 = (unsigned int)op2.f;
1721 else if(op2.kind == 7)
1722 *value2 = (unsigned int)op2.d;
1723 else if(op2.kind == 13)
1724 *value2 = (unsigned int)op2.ui64;
1730 unsigned int GetInt64(struct Expression * exp, long long * value2)
1732 struct Operand op2 = GetOperand(exp);
1734 if(op2.kind == 3 && op2.type->isSigned)
1735 *value2 = (long long)op2.i;
1736 else if(op2.kind == 3)
1737 *value2 = (long long)op2.ui;
1738 else if(op2.kind == 4 && op2.type->isSigned)
1740 else if(op2.kind == 4)
1741 *value2 = (long long)op2.ui64;
1742 else if(op2.kind == 23 && op2.type->isSigned)
1744 else if(op2.kind == 23)
1745 *value2 = (long long)op2.ui64;
1746 else if(op2.kind == 22 && op2.type->isSigned)
1748 else if(op2.kind == 22)
1749 *value2 = (long long)op2.ui64;
1750 else if(op2.kind == 2 && op2.type->isSigned)
1751 *value2 = (long long)op2.s;
1752 else if(op2.kind == 2)
1753 *value2 = (long long)op2.us;
1754 else if(op2.kind == 1 && op2.type->isSigned)
1755 *value2 = (long long)op2.c;
1756 else if(op2.kind == 1)
1757 *value2 = (long long)op2.uc;
1758 else if(op2.kind == 6)
1759 *value2 = (long long)op2.f;
1760 else if(op2.kind == 7)
1761 *value2 = (long long)op2.d;
1762 else if(op2.kind == 13)
1763 *value2 = (long long)op2.ui64;
1769 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1771 struct Operand op2 = GetOperand(exp);
1773 if(op2.kind == 3 && op2.type->isSigned)
1774 *value2 = (uint64)op2.i;
1775 else if(op2.kind == 3)
1776 *value2 = (uint64)op2.ui;
1777 else if(op2.kind == 4 && op2.type->isSigned)
1778 *value2 = (uint64)op2.i64;
1779 else if(op2.kind == 4)
1781 else if(op2.kind == 23 && op2.type->isSigned)
1782 *value2 = (uint64)op2.i64;
1783 else if(op2.kind == 23)
1785 else if(op2.kind == 22 && op2.type->isSigned)
1786 *value2 = (uint64)op2.i64;
1787 else if(op2.kind == 22)
1789 else if(op2.kind == 2 && op2.type->isSigned)
1790 *value2 = (uint64)op2.s;
1791 else if(op2.kind == 2)
1792 *value2 = (uint64)op2.us;
1793 else if(op2.kind == 1 && op2.type->isSigned)
1794 *value2 = (uint64)op2.c;
1795 else if(op2.kind == 1)
1796 *value2 = (uint64)op2.uc;
1797 else if(op2.kind == 6)
1798 *value2 = (uint64)op2.f;
1799 else if(op2.kind == 7)
1800 *value2 = (uint64)op2.d;
1801 else if(op2.kind == 13)
1808 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1810 struct Operand op2 = GetOperand(exp);
1812 if(op2.kind == 3 && op2.type->isSigned)
1813 *value2 = (intptr_t)op2.i;
1814 else if(op2.kind == 3)
1815 *value2 = (intptr_t)op2.ui;
1816 else if(op2.kind == 4 && op2.type->isSigned)
1817 *value2 = (intptr_t)op2.i64;
1818 else if(op2.kind == 4)
1819 *value2 = (intptr_t)op2.ui64;
1820 else if(op2.kind == 23 && op2.type->isSigned)
1821 *value2 = (intptr_t)op2.i64;
1822 else if(op2.kind == 23)
1823 *value2 = (intptr_t)op2.ui64;
1824 else if(op2.kind == 22 && op2.type->isSigned)
1825 *value2 = (intptr_t)op2.i64;
1826 else if(op2.kind == 22)
1827 *value2 = (intptr_t)op2.ui64;
1828 else if(op2.kind == 2 && op2.type->isSigned)
1829 *value2 = (intptr_t)op2.s;
1830 else if(op2.kind == 2)
1831 *value2 = (intptr_t)op2.us;
1832 else if(op2.kind == 1 && op2.type->isSigned)
1833 *value2 = (intptr_t)op2.c;
1834 else if(op2.kind == 1)
1835 *value2 = (intptr_t)op2.uc;
1836 else if(op2.kind == 6)
1837 *value2 = (intptr_t)op2.f;
1838 else if(op2.kind == 7)
1839 *value2 = (intptr_t)op2.d;
1840 else if(op2.kind == 13)
1841 *value2 = (intptr_t)op2.ui64;
1847 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1849 struct Operand op2 = GetOperand(exp);
1851 if(op2.kind == 3 && op2.type->isSigned)
1852 *value2 = (uintptr_t)op2.i;
1853 else if(op2.kind == 3)
1854 *value2 = (uintptr_t)op2.ui;
1855 else if(op2.kind == 4 && op2.type->isSigned)
1856 *value2 = (uintptr_t)op2.i64;
1857 else if(op2.kind == 4)
1858 *value2 = (uintptr_t)op2.ui64;
1859 else if(op2.kind == 23 && op2.type->isSigned)
1860 *value2 = (uintptr_t)op2.i64;
1861 else if(op2.kind == 23)
1862 *value2 = (uintptr_t)op2.ui64;
1863 else if(op2.kind == 22 && op2.type->isSigned)
1864 *value2 = (uintptr_t)op2.i64;
1865 else if(op2.kind == 22)
1866 *value2 = (uintptr_t)op2.ui64;
1867 else if(op2.kind == 2 && op2.type->isSigned)
1868 *value2 = (uintptr_t)op2.s;
1869 else if(op2.kind == 2)
1870 *value2 = (uintptr_t)op2.us;
1871 else if(op2.kind == 1 && op2.type->isSigned)
1872 *value2 = (uintptr_t)op2.c;
1873 else if(op2.kind == 1)
1874 *value2 = (uintptr_t)op2.uc;
1875 else if(op2.kind == 6)
1876 *value2 = (uintptr_t)op2.f;
1877 else if(op2.kind == 7)
1878 *value2 = (uintptr_t)op2.d;
1879 else if(op2.kind == 13)
1880 *value2 = (uintptr_t)op2.ui64;
1886 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1888 struct Operand op2 = GetOperand(exp);
1890 if(op2.kind == 3 && op2.type->isSigned)
1891 *value2 = (ssize_t)op2.i;
1892 else if(op2.kind == 3)
1893 *value2 = (ssize_t)op2.ui;
1894 else if(op2.kind == 4 && op2.type->isSigned)
1895 *value2 = (ssize_t)op2.i64;
1896 else if(op2.kind == 4)
1897 *value2 = (ssize_t)op2.ui64;
1898 else if(op2.kind == 23 && op2.type->isSigned)
1899 *value2 = (ssize_t)op2.i64;
1900 else if(op2.kind == 23)
1901 *value2 = (ssize_t)op2.ui64;
1902 else if(op2.kind == 22 && op2.type->isSigned)
1903 *value2 = (ssize_t)op2.i64;
1904 else if(op2.kind == 22)
1905 *value2 = (ssize_t)op2.ui64;
1906 else if(op2.kind == 2 && op2.type->isSigned)
1907 *value2 = (ssize_t)op2.s;
1908 else if(op2.kind == 2)
1909 *value2 = (ssize_t)op2.us;
1910 else if(op2.kind == 1 && op2.type->isSigned)
1911 *value2 = (ssize_t)op2.c;
1912 else if(op2.kind == 1)
1913 *value2 = (ssize_t)op2.uc;
1914 else if(op2.kind == 6)
1915 *value2 = (ssize_t)op2.f;
1916 else if(op2.kind == 7)
1917 *value2 = (ssize_t)op2.d;
1918 else if(op2.kind == 13)
1919 *value2 = (ssize_t)op2.ui64;
1925 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1927 struct Operand op2 = GetOperand(exp);
1929 if(op2.kind == 3 && op2.type->isSigned)
1930 *value2 = (size_t)op2.i;
1931 else if(op2.kind == 3)
1932 *value2 = (size_t)op2.ui;
1933 else if(op2.kind == 4 && op2.type->isSigned)
1934 *value2 = (size_t)op2.i64;
1935 else if(op2.kind == 4)
1936 *value2 = (size_t)op2.ui64;
1937 else if(op2.kind == 23 && op2.type->isSigned)
1938 *value2 = (size_t)op2.i64;
1939 else if(op2.kind == 23)
1940 *value2 = (size_t)op2.ui64;
1941 else if(op2.kind == 22 && op2.type->isSigned)
1942 *value2 = (size_t)op2.i64;
1943 else if(op2.kind == 22)
1944 *value2 = (size_t)op2.ui64;
1945 else if(op2.kind == 2 && op2.type->isSigned)
1946 *value2 = (size_t)op2.s;
1947 else if(op2.kind == 2)
1948 *value2 = (size_t)op2.us;
1949 else if(op2.kind == 1 && op2.type->isSigned)
1950 *value2 = (size_t)op2.c;
1951 else if(op2.kind == 1)
1952 *value2 = (size_t)op2.uc;
1953 else if(op2.kind == 6)
1954 *value2 = (size_t)op2.f;
1955 else if(op2.kind == 7)
1956 *value2 = (size_t)op2.d;
1957 else if(op2.kind == 13)
1958 *value2 = (size_t)op2.ui64;
1964 unsigned int GetShort(struct Expression * exp, short * value2)
1966 struct Operand op2 = GetOperand(exp);
1968 if(op2.kind == 3 && op2.type->isSigned)
1969 *value2 = (short)op2.i;
1970 else if(op2.kind == 3)
1971 *value2 = (short)op2.ui;
1972 else if(op2.kind == 4 && op2.type->isSigned)
1973 *value2 = (short)op2.i64;
1974 else if(op2.kind == 4)
1975 *value2 = (short)op2.ui64;
1976 else if(op2.kind == 23 && op2.type->isSigned)
1977 *value2 = (short)op2.i64;
1978 else if(op2.kind == 23)
1979 *value2 = (short)op2.ui64;
1980 else if(op2.kind == 22 && op2.type->isSigned)
1981 *value2 = (short)op2.i64;
1982 else if(op2.kind == 22)
1983 *value2 = (short)op2.ui64;
1984 else if(op2.kind == 2 && op2.type->isSigned)
1986 else if(op2.kind == 2)
1987 *value2 = (short)op2.us;
1988 else if(op2.kind == 1 && op2.type->isSigned)
1989 *value2 = (short)op2.c;
1990 else if(op2.kind == 1)
1991 *value2 = (short)op2.uc;
1992 else if(op2.kind == 6)
1993 *value2 = (short)op2.f;
1994 else if(op2.kind == 7)
1995 *value2 = (short)op2.d;
1996 else if(op2.kind == 13)
1997 *value2 = (short)op2.ui64;
2003 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2005 struct Operand op2 = GetOperand(exp);
2007 if(op2.kind == 3 && op2.type->isSigned)
2008 *value2 = (unsigned short)op2.i;
2009 else if(op2.kind == 3)
2010 *value2 = (unsigned short)op2.ui;
2011 else if(op2.kind == 4 && op2.type->isSigned)
2012 *value2 = (unsigned short)op2.i64;
2013 else if(op2.kind == 4)
2014 *value2 = (unsigned short)op2.ui64;
2015 else if(op2.kind == 23 && op2.type->isSigned)
2016 *value2 = (unsigned short)op2.i64;
2017 else if(op2.kind == 23)
2018 *value2 = (unsigned short)op2.ui64;
2019 else if(op2.kind == 22 && op2.type->isSigned)
2020 *value2 = (unsigned short)op2.i64;
2021 else if(op2.kind == 22)
2022 *value2 = (unsigned short)op2.ui64;
2023 else if(op2.kind == 2 && op2.type->isSigned)
2024 *value2 = (unsigned short)op2.s;
2025 else if(op2.kind == 2)
2027 else if(op2.kind == 1 && op2.type->isSigned)
2028 *value2 = (unsigned short)op2.c;
2029 else if(op2.kind == 1)
2030 *value2 = (unsigned short)op2.uc;
2031 else if(op2.kind == 6)
2032 *value2 = (unsigned short)op2.f;
2033 else if(op2.kind == 7)
2034 *value2 = (unsigned short)op2.d;
2035 else if(op2.kind == 13)
2036 *value2 = (unsigned short)op2.ui64;
2042 unsigned int GetChar(struct Expression * exp, char * value2)
2044 struct Operand op2 = GetOperand(exp);
2046 if(op2.kind == 3 && op2.type->isSigned)
2047 *value2 = (char)op2.i;
2048 else if(op2.kind == 3)
2049 *value2 = (char)op2.ui;
2050 else if(op2.kind == 4 && op2.type->isSigned)
2051 *value2 = (char)op2.i64;
2052 else if(op2.kind == 4)
2053 *value2 = (char)op2.ui64;
2054 else if(op2.kind == 23 && op2.type->isSigned)
2055 *value2 = (char)op2.i64;
2056 else if(op2.kind == 23)
2057 *value2 = (char)op2.ui64;
2058 else if(op2.kind == 22 && op2.type->isSigned)
2059 *value2 = (char)op2.i64;
2060 else if(op2.kind == 22)
2061 *value2 = (char)op2.ui64;
2062 else if(op2.kind == 2 && op2.type->isSigned)
2063 *value2 = (char)op2.s;
2064 else if(op2.kind == 2)
2065 *value2 = (char)op2.us;
2066 else if(op2.kind == 1 && op2.type->isSigned)
2068 else if(op2.kind == 1)
2069 *value2 = (char)op2.uc;
2070 else if(op2.kind == 6)
2071 *value2 = (char)op2.f;
2072 else if(op2.kind == 7)
2073 *value2 = (char)op2.d;
2074 else if(op2.kind == 13)
2075 *value2 = (char)op2.ui64;
2081 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2083 struct Operand op2 = GetOperand(exp);
2085 if(op2.kind == 3 && op2.type->isSigned)
2086 *value2 = (unsigned char)op2.i;
2087 else if(op2.kind == 3)
2088 *value2 = (unsigned char)op2.ui;
2089 else if(op2.kind == 4 && op2.type->isSigned)
2090 *value2 = (unsigned char)op2.i64;
2091 else if(op2.kind == 4)
2092 *value2 = (unsigned char)op2.ui64;
2093 else if(op2.kind == 23 && op2.type->isSigned)
2094 *value2 = (unsigned char)op2.i64;
2095 else if(op2.kind == 23)
2096 *value2 = (unsigned char)op2.ui64;
2097 else if(op2.kind == 22 && op2.type->isSigned)
2098 *value2 = (unsigned char)op2.i64;
2099 else if(op2.kind == 22)
2100 *value2 = (unsigned char)op2.ui64;
2101 else if(op2.kind == 2 && op2.type->isSigned)
2102 *value2 = (unsigned char)op2.s;
2103 else if(op2.kind == 2)
2104 *value2 = (unsigned char)op2.us;
2105 else if(op2.kind == 1 && op2.type->isSigned)
2106 *value2 = (unsigned char)op2.c;
2107 else if(op2.kind == 1)
2109 else if(op2.kind == 6)
2110 *value2 = (unsigned char)op2.f;
2111 else if(op2.kind == 7)
2112 *value2 = (unsigned char)op2.d;
2113 else if(op2.kind == 13)
2114 *value2 = (unsigned char)op2.ui64;
2120 unsigned int GetFloat(struct Expression * exp, float * value2)
2122 struct Operand op2 = GetOperand(exp);
2124 if(op2.kind == 3 && op2.type->isSigned)
2125 *value2 = (float)(float)op2.i;
2126 else if(op2.kind == 3)
2127 *value2 = (float)(float)op2.ui;
2128 else if(op2.kind == 4 && op2.type->isSigned)
2129 *value2 = (float)(float)op2.i64;
2130 else if(op2.kind == 4)
2131 *value2 = (float)(float)op2.ui64;
2132 else if(op2.kind == 23 && op2.type->isSigned)
2133 *value2 = (float)(float)op2.i64;
2134 else if(op2.kind == 23)
2135 *value2 = (float)(float)op2.ui64;
2136 else if(op2.kind == 22 && op2.type->isSigned)
2137 *value2 = (float)(float)op2.i64;
2138 else if(op2.kind == 22)
2139 *value2 = (float)(float)op2.ui64;
2140 else if(op2.kind == 2 && op2.type->isSigned)
2141 *value2 = (float)(float)op2.s;
2142 else if(op2.kind == 2)
2143 *value2 = (float)(float)op2.us;
2144 else if(op2.kind == 1 && op2.type->isSigned)
2145 *value2 = (float)(float)op2.c;
2146 else if(op2.kind == 1)
2147 *value2 = (float)(float)op2.uc;
2148 else if(op2.kind == 6)
2149 *value2 = (float)op2.f;
2150 else if(op2.kind == 7)
2151 *value2 = (float)op2.d;
2152 else if(op2.kind == 13)
2153 *value2 = (float)(float)op2.ui64;
2159 unsigned int GetDouble(struct Expression * exp, double * value2)
2161 struct Operand op2 = GetOperand(exp);
2163 if(op2.kind == 3 && op2.type->isSigned)
2164 *value2 = (double)(double)op2.i;
2165 else if(op2.kind == 3)
2166 *value2 = (double)(double)op2.ui;
2167 else if(op2.kind == 4 && op2.type->isSigned)
2168 *value2 = (double)(double)op2.i64;
2169 else if(op2.kind == 4)
2170 *value2 = (double)(double)op2.ui64;
2171 else if(op2.kind == 23 && op2.type->isSigned)
2172 *value2 = (double)(double)op2.i64;
2173 else if(op2.kind == 23)
2174 *value2 = (double)(double)op2.ui64;
2175 else if(op2.kind == 22 && op2.type->isSigned)
2176 *value2 = (double)(double)op2.i64;
2177 else if(op2.kind == 22)
2178 *value2 = (double)(double)op2.ui64;
2179 else if(op2.kind == 2 && op2.type->isSigned)
2180 *value2 = (double)(double)op2.s;
2181 else if(op2.kind == 2)
2182 *value2 = (double)(double)op2.us;
2183 else if(op2.kind == 1 && op2.type->isSigned)
2184 *value2 = (double)(double)op2.c;
2185 else if(op2.kind == 1)
2186 *value2 = (double)(double)op2.uc;
2187 else if(op2.kind == 6)
2188 *value2 = (double)op2.f;
2189 else if(op2.kind == 7)
2190 *value2 = (double)op2.d;
2191 else if(op2.kind == 13)
2192 *value2 = (double)(double)op2.ui64;
2198 void ComputeExpression(struct Expression * exp);
2200 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2202 extern int targetBits;
2204 int ComputeTypeSize(struct Type * type);
2206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2208 struct __ecereNameSpace__ecere__com__BitMember
2210 struct __ecereNameSpace__ecere__com__BitMember * prev;
2211 struct __ecereNameSpace__ecere__com__BitMember * next;
2213 unsigned int isProperty;
2216 struct __ecereNameSpace__ecere__com__Class * _class;
2217 char * dataTypeString;
2218 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2219 struct Type * dataType;
2224 } __attribute__ ((gcc_struct));
2226 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2228 struct __ecereNameSpace__ecere__sys__OldLink
2230 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2231 struct __ecereNameSpace__ecere__sys__OldLink * next;
2233 } __attribute__ ((gcc_struct));
2235 void FinishTemplatesContext(struct Context * context);
2237 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2239 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2240 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2242 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))
2245 int unionMemberOffset = 0;
2250 member->memberOffset = 0;
2251 if(targetBits < sizeof(void *) * 8)
2252 member->structAlignment = 0;
2254 else if(targetBits < sizeof(void *) * 8)
2255 _class->structAlignment = 0;
2256 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2257 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2258 if(!member && _class->destructionWatchOffset)
2259 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2261 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2263 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2265 if(!dataMember->isProperty)
2267 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2269 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2275 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2277 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2279 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2281 if(!isMember && _class->type == 2 && dataMember->dataType)
2283 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2287 ComputeTypeSize(dataMember->dataType);
2288 if(bitMember->pos == -1)
2289 bitMember->pos = _class->memberOffset;
2290 if(!bitMember->size)
2291 bitMember->size = dataMember->dataType->size * 8;
2292 _class->memberOffset = bitMember->pos + bitMember->size;
2293 for(d = 0; d < bitMember->size; d++)
2299 bitMember->mask = mask << bitMember->pos;
2301 else if(dataMember->type == 0 && dataMember->dataType)
2306 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2307 ComputeTypeSize(dataMember->dataType);
2308 if(dataMember->dataType->bitFieldCount)
2310 bitFields += dataMember->dataType->bitFieldCount;
2317 int size = (bitFields + 7) / 8;
2321 int __simpleStruct0;
2325 int __simpleStruct0;
2327 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2328 if(member->memberOffset % alignment)
2329 member->memberOffset += alignment - (member->memberOffset % alignment);
2331 dataMember->offset = member->memberOffset;
2332 if(member->type == 1)
2333 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2336 member->memberOffset += size;
2343 int __simpleStruct0;
2345 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2346 if(_class->memberOffset % alignment)
2347 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2349 dataMember->offset = _class->memberOffset;
2350 _class->memberOffset += size;
2354 size = dataMember->dataType->size;
2355 alignment = dataMember->dataType->alignment;
2359 int __simpleStruct0;
2363 int __simpleStruct0;
2365 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2366 if(member->memberOffset % alignment)
2367 member->memberOffset += alignment - (member->memberOffset % alignment);
2369 dataMember->offset = member->memberOffset;
2370 if(member->type == 1)
2371 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2374 member->memberOffset += size;
2381 int __simpleStruct0;
2383 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2384 if(_class->memberOffset % alignment)
2385 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2387 dataMember->offset = _class->memberOffset;
2388 _class->memberOffset += size;
2395 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2396 alignment = dataMember->structAlignment;
2399 int __simpleStruct0;
2403 int __simpleStruct0;
2405 if(member->memberOffset % alignment)
2406 member->memberOffset += alignment - (member->memberOffset % alignment);
2407 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2409 dataMember->offset = member->memberOffset;
2410 if(member->type == 1)
2411 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2413 member->memberOffset += dataMember->memberOffset;
2419 int __simpleStruct0;
2421 if(_class->memberOffset % alignment)
2422 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2423 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2425 dataMember->offset = _class->memberOffset;
2426 _class->memberOffset += dataMember->memberOffset;
2434 int size = (bitFields + 7) / 8;
2438 int __simpleStruct0;
2442 int __simpleStruct0;
2444 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2445 if(member->memberOffset % alignment)
2446 member->memberOffset += alignment - (member->memberOffset % alignment);
2448 if(member->type == 1)
2449 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2452 member->memberOffset += size;
2459 int __simpleStruct0;
2461 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2462 if(_class->memberOffset % alignment)
2463 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2465 _class->memberOffset += size;
2470 if(member && member->type == 1)
2472 member->memberOffset = unionMemberOffset;
2476 if(_class->type != 2)
2480 if(_class->structAlignment)
2482 if(_class->memberOffset % _class->structAlignment)
2483 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2485 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2488 struct __ecereNameSpace__ecere__com__Property * prop;
2490 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2492 if(prop->isProperty && prop->isWatchable)
2494 prop->watcherOffset = _class->structSize;
2495 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2500 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2502 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2504 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2506 if(deriv->computeSize)
2508 deriv->offset = _class->structSize;
2509 deriv->memberOffset = 0;
2510 deriv->structSize = deriv->offset;
2511 ComputeClassMembers(deriv, 0x0);
2519 FinishTemplatesContext(context);
2522 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2524 struct __ecereNameSpace__ecere__com__NameSpace
2527 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2528 struct __ecereNameSpace__ecere__com__NameSpace * left;
2529 struct __ecereNameSpace__ecere__com__NameSpace * right;
2531 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2532 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2533 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2536 } __attribute__ ((gcc_struct));
2538 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2540 struct __ecereNameSpace__ecere__com__Module
2542 struct __ecereNameSpace__ecere__com__Instance * application;
2543 struct __ecereNameSpace__ecere__sys__OldList classes;
2544 struct __ecereNameSpace__ecere__sys__OldList defines;
2545 struct __ecereNameSpace__ecere__sys__OldList functions;
2546 struct __ecereNameSpace__ecere__sys__OldList modules;
2547 struct __ecereNameSpace__ecere__com__Instance * prev;
2548 struct __ecereNameSpace__ecere__com__Instance * next;
2554 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2555 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2556 } __attribute__ ((gcc_struct));
2558 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2560 struct __ecereNameSpace__ecere__com__Class * _class;
2561 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2563 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2564 ComputeModuleClasses(subModule->data);
2565 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2566 ComputeClassMembers(_class, 0x0);
2569 extern unsigned int inCompiler;
2571 extern void Compiler_Error(char * format, ...);
2573 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2575 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2577 int ComputeTypeSize(struct Type * type)
2579 unsigned int size = type ? type->size : 0;
2581 if(!size && type && !type->computing)
2583 type->computing = 0x1;
2587 type->alignment = size = sizeof(char);
2590 type->alignment = size = sizeof(int);
2593 type->alignment = size = sizeof(long long);
2596 type->alignment = size = targetBits / 8;
2599 type->alignment = size = targetBits / 8;
2602 type->alignment = size = sizeof(long);
2605 type->alignment = size = sizeof(short);
2608 type->alignment = size = sizeof(float);
2611 type->alignment = size = sizeof(double);
2615 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2617 if(_class && _class->type == 1)
2619 ComputeClassMembers(_class, 0x0);
2620 type->alignment = _class->structAlignment;
2621 size = _class->structSize;
2622 if(type->alignment && size % type->alignment)
2623 size += type->alignment - (size % type->alignment);
2625 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2627 if(!_class->dataType)
2628 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2629 size = type->alignment = ComputeTypeSize(_class->dataType);
2632 size = type->alignment = targetBits / 8;
2637 size = type->alignment = targetBits / 8;
2640 if(type->arraySizeExp)
2642 ProcessExpressionType(type->arraySizeExp);
2643 ComputeExpression(type->arraySizeExp);
2644 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)))
2646 struct Location oldLoc = yylloc;
2647 char expression[10240];
2649 expression[0] = '\0';
2650 type->arraySizeExp->expType = (((void *)0));
2651 yylloc = type->arraySizeExp->loc;
2653 PrintExpression(type->arraySizeExp, expression);
2654 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2657 GetInt(type->arraySizeExp, &type->arraySize);
2659 else if(type->enumClass)
2661 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2663 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2666 type->arraySize = 0;
2670 type->arraySize = 0;
2672 size = ComputeTypeSize(type->type) * type->arraySize;
2674 type->alignment = type->type->alignment;
2678 struct Type * member;
2680 for(member = type->members.first; member; member = member->next)
2682 int __simpleStruct0, __simpleStruct1;
2683 unsigned int addSize = ComputeTypeSize(member);
2685 member->offset = size;
2686 if(member->alignment && size % member->alignment)
2687 member->offset += member->alignment - (size % member->alignment);
2688 size = member->offset;
2689 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2692 if(type->alignment && size % type->alignment)
2693 size += type->alignment - (size % type->alignment);
2698 struct Type * member;
2700 for(member = type->members.first; member; member = member->next)
2702 int __simpleStruct0, __simpleStruct1;
2703 unsigned int addSize = ComputeTypeSize(member);
2705 member->offset = size;
2706 if(member->alignment && size % member->alignment)
2707 member->offset += member->alignment - (size % member->alignment);
2708 size = member->offset;
2709 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2710 size = ((size > addSize) ? size : addSize);
2712 if(type->alignment && size % type->alignment)
2713 size += type->alignment - (size % type->alignment);
2718 struct TemplateParameter * param = type->templateParameter;
2719 struct Type * baseType = ProcessTemplateParameterType(param);
2723 size = ComputeTypeSize(baseType);
2724 type->alignment = baseType->alignment;
2727 type->alignment = size = sizeof(uint64);
2732 type->alignment = size = sizeof(enum
2740 type->alignment = size = targetBits / 8;
2745 type->computing = 0x0;
2750 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2752 extern struct Identifier * MkIdentifier(char * string);
2754 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2756 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2758 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2760 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2762 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2764 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2766 extern void FreeType(struct Type * type);
2768 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2770 extern struct Specifier * MkSpecifier(int specifier);
2772 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2774 extern struct Expression * MkExpConstant(char * string);
2776 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)
2778 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2779 unsigned int totalSize = 0;
2780 unsigned int maxSize = 0;
2781 int alignment, size;
2782 struct __ecereNameSpace__ecere__com__DataMember * member;
2783 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2786 *addedPadding = 0x0;
2787 if(!isMember && _class->base)
2789 maxSize = _class->structSize;
2791 if(_class->type == 1 || _class->type == 5)
2792 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2795 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2797 if(maxSize > baseSize)
2798 maxSize -= baseSize;
2804 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2806 if(!member->isProperty)
2808 switch(member->type)
2812 if(member->dataTypeString)
2814 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2815 struct Declarator * decl;
2817 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2818 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2819 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2820 if(!member->dataType)
2821 member->dataType = ProcessType(specs, decl);
2822 ReplaceThisClassSpecifiers(specs, topClass);
2824 struct Type * type = ProcessType(specs, decl);
2826 DeclareType(member->dataType, 0x0, 0x0);
2829 ComputeTypeSize(member->dataType);
2830 size = member->dataType->size;
2831 alignment = member->dataType->alignment;
2834 if(totalSize % alignment)
2835 totalSize += alignment - (totalSize % alignment);
2844 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2847 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2848 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2849 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2850 alignment = member->structAlignment;
2853 if(totalSize % alignment)
2854 totalSize += alignment - (totalSize % alignment);
2864 unsigned int __simpleStruct0;
2866 if(topMember && topMember->type == 1)
2867 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2869 *retSize += totalSize;
2871 else if(totalSize < maxSize && _class->type != 1000)
2873 int autoPadding = 0;
2875 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2876 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2877 if(totalSize + autoPadding < maxSize)
2879 char sizeString[50];
2881 sprintf(sizeString, "%d", maxSize - totalSize);
2882 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2884 *addedPadding = 0x1;
2888 FinishTemplatesContext(context);
2889 return topMember ? topMember->memberID : _class->memberID;
2892 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2894 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2895 unsigned int totalSize = 0;
2896 struct __ecereNameSpace__ecere__com__DataMember * member;
2897 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2899 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2900 DeclareMembers(_class->base, 0x0);
2901 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2903 if(!member->isProperty)
2905 switch(member->type)
2909 if(!member->dataType && member->dataTypeString)
2910 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2911 if(member->dataType)
2912 DeclareType(member->dataType, 0x0, 0x0);
2918 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2925 FinishTemplatesContext(context);
2926 return topMember ? topMember->memberID : _class->memberID;
2929 extern struct Symbol * FindClass(char * name);
2931 extern char * strchr(const char * , int);
2933 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2935 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2937 extern void FreeClassDef(struct ClassDef * def);
2939 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2941 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2943 extern char * strcpy(char * , const char * );
2945 extern void MangleClassName(char * className);
2947 extern void DeclareClass(struct Symbol * classSym, char * className);
2949 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2951 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2953 void DeclareStruct(char * name, unsigned int skipNoHead)
2955 struct External * external = (((void *)0));
2956 struct Symbol * classSym = FindClass(name);
2958 if(!inCompiler || !classSym)
2960 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2962 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2964 struct Declaration * decl;
2965 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2966 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2967 char structName[1024];
2969 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2970 classSym->declaring++;
2971 if(strchr(classSym->string, '<'))
2973 if(classSym->registered->templateClass)
2975 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2976 classSym->declaring--;
2980 DeclareMembers(classSym->registered, 0x0);
2981 structName[0] = (char)0;
2982 FullClassNameCat(structName, name, 0x0);
2985 unsigned int addedPadding = 0x0;
2987 classSym->declaredStructSym = 0x1;
2988 declarations = MkList();
2989 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2990 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2992 FreeList(declarations, FreeClassDef);
2993 declarations = (((void *)0));
2996 if(skipNoHead || declarations)
2998 if(external && external->declaration)
3000 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3001 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3003 if(classSym->structExternal)
3004 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3006 classSym->id = curExternal->symbol->idCode;
3007 classSym->idCode = curExternal->symbol->idCode;
3013 external = MkExternalDeclaration((((void *)0)));
3014 specifiers = MkList();
3015 declarators = MkList();
3016 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3017 external->declaration = decl = MkDeclaration(specifiers, declarators);
3018 if(decl->symbol && !decl->symbol->pointerExternal)
3019 decl->symbol->pointerExternal = external;
3020 if(classSym->registered && classSym->registered->type == 1)
3022 char className[1024];
3024 strcpy(className, "__ecereClass_");
3025 FullClassNameCat(className, classSym->string, 0x1);
3026 MangleClassName(className);
3027 DeclareClass(classSym, className);
3028 external->symbol = classSym;
3029 classSym->pointerExternal = external;
3030 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3031 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3035 char className[1024];
3037 strcpy(className, "__ecereClass_");
3038 FullClassNameCat(className, classSym->string, 0x1);
3039 MangleClassName(className);
3040 classSym->structExternal = external;
3041 DeclareClass(classSym, className);
3042 external->symbol = classSym;
3044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3047 classSym->declaring--;
3049 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3051 classSym->declaring++;
3053 if(classSym->registered)
3054 DeclareMembers(classSym->registered, 0x0);
3056 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3058 if(classSym->structExternal)
3059 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3061 classSym->id = curExternal->symbol->idCode;
3062 classSym->idCode = curExternal->symbol->idCode;
3064 classSym->declaring--;
3068 extern char * strcat(char * , const char * );
3070 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3072 extern struct ModuleImport * mainModule;
3074 extern struct Specifier * MkSpecifierName(char * name);
3076 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3078 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3080 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3082 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3084 extern void FreeDeclarator(struct Declarator * decl);
3086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3088 struct PropertyImport
3090 struct PropertyImport * prev;
3091 struct PropertyImport * next;
3093 unsigned int isVirtual;
3094 unsigned int hasSet;
3095 unsigned int hasGet;
3096 } __attribute__ ((gcc_struct));
3098 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3100 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3102 struct Symbol * symbol = prop->symbol;
3103 char propName[1024];
3105 strcpy(setName, "__ecereProp_");
3106 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3107 strcat(setName, "_Set_");
3108 FullClassNameCat(setName, prop->name, 0x1);
3109 strcpy(getName, "__ecereProp_");
3110 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3111 strcat(getName, "_Get_");
3112 FullClassNameCat(getName, prop->name, 0x1);
3113 strcpy(propName, "__ecereProp_");
3114 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3115 strcat(propName, "_");
3116 FullClassNameCat(propName, prop->name, 0x1);
3117 MangleClassName(getName);
3118 MangleClassName(setName);
3119 MangleClassName(propName);
3120 if(prop->_class->type == 1)
3121 DeclareStruct(prop->_class->fullName, 0x0);
3122 if(!symbol || curExternal->symbol->idCode < symbol->id)
3124 unsigned int imported = 0x0;
3125 unsigned int dllImport = 0x0;
3127 if(!symbol || symbol->_import)
3131 struct Symbol * classSym;
3133 if(!prop->_class->symbol)
3134 prop->_class->symbol = FindClass(prop->_class->fullName);
3135 classSym = prop->_class->symbol;
3136 if(classSym && !classSym->_import)
3138 struct ModuleImport * module;
3140 if(prop->_class->module)
3141 module = FindModule(prop->_class->module);
3143 module = mainModule;
3144 classSym->_import = __extension__ ({
3145 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3147 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3151 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3152 symbol->_import = (struct ClassImport *)__extension__ ({
3153 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3155 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3161 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3166 struct Context * context = SetupTemplatesContext(prop->_class);
3168 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3169 FinishTemplatesContext(context);
3173 if(!symbol->externalGet || symbol->externalGet->type == 0)
3175 struct Declaration * decl;
3176 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3177 struct Declarator * d;
3178 struct __ecereNameSpace__ecere__sys__OldList * params;
3179 struct Specifier * spec;
3180 struct External * external;
3181 struct Declarator * typeDecl;
3182 unsigned int simple = 0x0;
3184 specifiers = MkList();
3185 declarators = MkList();
3187 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3188 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3190 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3192 struct Context * context = SetupTemplatesContext(prop->_class);
3194 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3195 FinishTemplatesContext(context);
3197 for(spec = (*specifiers).first; spec; spec = spec->next)
3201 if((!typeDecl || typeDecl->type == 1))
3203 struct Symbol * classSym = spec->symbol;
3205 symbol->_class = classSym->registered;
3206 if(classSym->registered && classSym->registered->type == 1)
3208 DeclareStruct(spec->name, 0x0);
3215 d = PlugDeclarator(typeDecl, d);
3218 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3219 specifiers = MkList();
3221 d = MkDeclaratorFunction(d, params);
3223 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3224 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3227 ListAdd(specifiers, MkSpecifier(VOID));
3228 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3229 decl = MkDeclaration(specifiers, declarators);
3230 external = MkExternalDeclaration(decl);
3231 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3232 external->symbol = symbol;
3233 symbol->externalGet = external;
3234 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3236 FreeDeclarator(typeDecl);
3240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3245 if(!symbol->externalSet || symbol->externalSet->type == 0)
3247 struct Declaration * decl;
3248 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3249 struct Declarator * d;
3250 struct __ecereNameSpace__ecere__sys__OldList * params;
3251 struct Specifier * spec;
3252 struct External * external;
3253 struct Declarator * typeDecl;
3255 declarators = MkList();
3257 if(!prop->conversion || prop->_class->type == 1)
3259 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3261 specifiers = MkList();
3263 struct Context * context = SetupTemplatesContext(prop->_class);
3265 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3266 FinishTemplatesContext(context);
3268 ListAdd(params, MkTypeName(specifiers, d));
3269 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3271 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3272 d = MkDeclaratorFunction(d, params);
3273 for(spec = (*specifiers).first; spec; spec = spec->next)
3277 if((!typeDecl || typeDecl->type == 1))
3279 struct Symbol * classSym = spec->symbol;
3281 symbol->_class = classSym->registered;
3282 if(classSym->registered && classSym->registered->type == 1)
3283 DeclareStruct(spec->name, 0x0);
3287 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3288 specifiers = MkList();
3290 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3291 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3293 if(!prop->conversion || prop->_class->type == 1)
3294 ListAdd(specifiers, MkSpecifier(VOID));
3296 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3297 decl = MkDeclaration(specifiers, declarators);
3298 external = MkExternalDeclaration(decl);
3299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3300 external->symbol = symbol;
3301 symbol->externalSet = external;
3302 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3309 if(!symbol->externalPtr)
3311 struct Declaration * decl;
3312 struct External * external;
3313 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3316 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3319 ListAdd(specifiers, MkSpecifierName("Property"));
3321 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3323 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3326 strcpy(propName, "__ecerePropM_");
3327 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3328 strcat(propName, "_");
3329 FullClassNameCat(propName, prop->name, 0x1);
3330 MangleClassName(propName);
3331 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3333 decl = MkDeclaration(specifiers, list);
3335 external = MkExternalDeclaration(decl);
3336 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3337 external->symbol = symbol;
3338 symbol->externalPtr = external;
3342 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3344 symbol->id = curExternal->symbol->idCode;
3348 struct Type * Dereference(struct Type * source)
3350 struct Type * type = (((void *)0));
3354 if(source->kind == 13 || source->kind == 12)
3356 type = source->type;
3357 source->type->refCount++;
3359 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3361 type = __extension__ ({
3362 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3364 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3367 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3373 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3378 static struct Type * Reference(struct Type * source)
3380 struct Type * type = (((void *)0));
3384 type = __extension__ ({
3385 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3387 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3394 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);
3396 extern void * memcpy(void * , const void * , size_t size);
3398 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3400 extern void FreeExpression(struct Expression * exp);
3402 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3404 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);
3406 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3408 extern struct Type * MkClassType(char * name);
3410 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);
3412 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)
3414 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3415 unsigned int found = 0x0;
3416 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3417 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3418 unsigned int freeType = 0x0;
3420 yylloc = member->loc;
3425 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3429 dataMember = *curMember;
3435 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3436 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3437 int _subMemberStackPos = 0;
3440 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3443 dataMember = thisMember;
3444 if(curMember && thisMember->memberAccess == 1)
3446 *curMember = thisMember;
3447 *curClass = thisMember->_class;
3448 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3449 *subMemberStackPos = _subMemberStackPos;
3455 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3456 if(method && method->type == 1)
3459 method = (((void *)0));
3464 struct Type * type = (((void *)0));
3468 if(!dataMember->dataType && dataMember->dataTypeString)
3470 struct Context * context = SetupTemplatesContext(_class);
3472 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3473 FinishTemplatesContext(context);
3475 type = dataMember->dataType;
3479 if(!method->dataType)
3480 ProcessMethodType(method);
3481 type = method->dataType;
3483 if(ident && ident->next)
3485 for(ident = ident->next; ident && type; ident = ident->next)
3489 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3491 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3493 type = dataMember->dataType;
3495 else if(type->kind == 9 || type->kind == 10)
3497 struct Type * memberType;
3499 for(memberType = type->members.first; memberType; memberType = memberType->next)
3501 if(!strcmp(memberType->name, ident->string))
3510 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3513 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3514 struct __ecereNameSpace__ecere__com__Class * sClass;
3516 for(sClass = _class; sClass; sClass = sClass->base)
3519 if(sClass->templateClass)
3520 sClass = sClass->templateClass;
3521 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3523 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3525 for(sClass = sClass->base; sClass; sClass = sClass->base)
3527 if(sClass->templateClass)
3528 sClass = sClass->templateClass;
3529 id += sClass->templateParams.count;
3540 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3542 if(arg.dataTypeString)
3544 type = ProcessTypeString(arg.dataTypeString, 0x0);
3546 if(type && _class->templateClass)
3547 type->passAsTemplate = 0x1;
3554 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3556 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3557 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3561 char templateString[1024];
3562 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3564 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3565 for(cClass = expClass; cClass; cClass = cClass->base)
3569 if(cClass->templateClass)
3570 cClass = cClass->templateClass;
3571 for(param = cClass->templateParams.first; param; param = param->next)
3574 struct __ecereNameSpace__ecere__com__Class * sClass;
3575 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3577 for(sClass = cClass->base; sClass; sClass = sClass->base)
3579 if(sClass->templateClass)
3580 sClass = sClass->templateClass;
3581 id += sClass->templateParams.count;
3583 arg = expClass->templateArgs[id];
3584 for(sClass = _class; sClass; sClass = sClass->base)
3586 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3588 struct __ecereNameSpace__ecere__com__Class * nextClass;
3590 if(sClass->templateClass)
3591 sClass = sClass->templateClass;
3592 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3594 if(nextClass->templateClass)
3595 nextClass = nextClass->templateClass;
3596 p += nextClass->templateParams.count;
3598 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3600 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3602 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3604 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3605 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3619 char expString[1024];
3620 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3621 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3622 struct Expression * exp;
3623 char * string = PrintHexUInt64(arg.expression.ui64);
3625 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3626 ProcessExpressionType(exp);
3627 ComputeExpression(exp);
3628 expString[0] = '\0';
3629 PrintExpression(exp, expString);
3630 strcat(argument, expString);
3631 FreeExpression(exp);
3636 strcat(argument, arg.member->name);
3641 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3642 strcat(argument, arg.dataTypeString);
3649 strcat(templateString, ", ");
3650 if(lastParam != p - 1)
3652 strcat(templateString, param->name);
3653 strcat(templateString, " = ");
3655 strcat(templateString, argument);
3664 int len = strlen(templateString);
3666 if(templateString[len - 1] == '<')
3670 if(templateString[len - 1] == '>')
3671 templateString[len++] = ' ';
3672 templateString[len++] = '>';
3674 templateString[len++] = '\0';
3677 struct Context * context = SetupTemplatesContext(_class);
3681 type = ProcessTypeString(templateString, 0x0);
3683 FinishTemplatesContext(context);
3686 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3688 ProcessExpressionType(member->initializer->exp);
3689 if(!member->initializer->exp->expType)
3693 char expString[10240];
3695 expString[0] = '\0';
3696 PrintExpression(member->initializer->exp, expString);
3697 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3698 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3701 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3703 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3706 else if(member->initializer)
3708 ProcessInitializer(member->initializer, type);
3715 if(_class && _class->type == 3)
3717 if(member->initializer)
3719 struct Type * type = MkClassType(_class->fullName);
3721 ProcessInitializer(member->initializer, type);
3727 if(member->initializer)
3729 ProcessInitializer(member->initializer, (((void *)0)));
3735 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3741 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3750 extern struct Identifier * GetDeclId(struct Declarator * decl);
3752 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);
3754 extern void FreeSpecifier(struct Specifier * spec);
3756 static void ProcessFunction(struct FunctionDefinition * function);
3758 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3760 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3762 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3764 extern void FreeClassFunction(struct ClassFunction * func);
3766 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3768 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3770 void ProcessInstantiationType(struct Instantiation * inst)
3775 struct MembersInit * members;
3776 struct Symbol * classSym;
3777 struct __ecereNameSpace__ecere__com__Class * _class;
3779 classSym = inst->_class->symbol;
3780 _class = classSym ? classSym->registered : (((void *)0));
3781 if(!_class || _class->type != 5)
3782 DeclareStruct(inst->_class->name, 0x0);
3783 afterExternal = afterExternal ? afterExternal : curExternal;
3785 ProcessExpressionType(inst->exp);
3786 inst->isConstant = 0x1;
3789 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3790 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3791 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3792 int subMemberStackPos = 0;
3794 for(members = (*inst->members).first; members; members = members->next)
3796 switch(members->type)
3801 static unsigned int instMethodID = 0;
3802 struct External * external = curExternal;
3803 struct Context * context = curContext;
3804 struct Declarator * declarator = members->function->declarator;
3805 struct Identifier * nameID = GetDeclId(declarator);
3806 char * unmangled = nameID ? nameID->string : (((void *)0));
3807 struct Expression * exp;
3808 struct External * createdExternal = (((void *)0));
3814 strcpy(name, "__ecereInstMeth_");
3815 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3817 strcat(name, nameID->string);
3819 sprintf(number, "_%08d", instMethodID++);
3820 strcat(name, number);
3821 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3825 struct Symbol * symbol = declarator->symbol;
3826 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3828 if(method && method->type == 1)
3830 symbol->method = method;
3831 ProcessMethodType(method);
3832 if(!symbol->type->thisClass)
3834 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3836 if(!currentClass->symbol)
3837 currentClass->symbol = FindClass(currentClass->fullName);
3838 symbol->type->thisClass = currentClass->symbol;
3843 _class->symbol = FindClass(_class->fullName);
3844 symbol->type->thisClass = _class->symbol;
3847 DeclareType(symbol->type, 0x1, 0x1);
3851 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3854 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3857 FreeSpecifier(nameID->_class);
3858 nameID->_class = (((void *)0));
3862 struct Type * type = declarator->symbol->type;
3863 struct External * oldExternal = curExternal;
3865 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3867 struct External * externalDecl;
3869 externalDecl = MkExternalDeclaration((((void *)0)));
3870 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3871 if(createdExternal->function)
3873 ProcessFunction(createdExternal->function);
3875 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3877 externalDecl->declaration = decl;
3878 if(decl->symbol && !decl->symbol->pointerExternal)
3879 decl->symbol->pointerExternal = externalDecl;
3880 declarator->symbol->pointerExternal = externalDecl;
3887 curExternal = declarator->symbol->pointerExternal;
3888 ProcessFunction((struct FunctionDefinition *)members->function);
3890 curExternal = external;
3891 curContext = context;
3894 FreeClassFunction(members->function);
3895 exp = QMkExpId(name);
3897 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3898 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3904 if(members->dataMembers && classSym)
3906 struct MemberInit * member;
3907 struct Location oldyyloc = yylloc;
3909 for(member = (*members->dataMembers).first; member; member = member->next)
3911 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3912 if(member->initializer && !member->initializer->isConstant)
3913 inst->isConstant = 0x0;
3925 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3929 if(type->kind == 11)
3931 struct Type * param;
3935 for(param = type->params.first; param; param = param->next)
3936 DeclareType(param, declarePointers, 0x1);
3938 DeclareType(type->returnType, declarePointers, 0x1);
3940 else if(type->kind == 13 && declarePointers)
3941 DeclareType(type->type, declarePointers, 0x0);
3942 else if(type->kind == 8)
3944 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3945 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3947 else if(type->kind == 9 || type->kind == 10)
3949 struct Type * member;
3951 for(member = type->members.first; member; member = member->next)
3952 DeclareType(member, 0x0, 0x0);
3954 else if(type->kind == 12)
3955 DeclareType(type->arrayType, declarePointers, 0x0);
3959 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3961 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3963 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3965 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3966 struct __ecereNameSpace__ecere__com__Class * sClass;
3968 for(sClass = _class; sClass; sClass = sClass->base)
3971 if(sClass->templateClass)
3972 sClass = sClass->templateClass;
3973 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3975 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3977 for(sClass = sClass->base; sClass; sClass = sClass->base)
3979 if(sClass->templateClass)
3980 sClass = sClass->templateClass;
3981 id += sClass->templateParams.count;
3992 arg = &_class->templateArgs[id];
3993 if(arg && param->type == 0)
3994 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3999 extern struct Context * PushContext(void);
4001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4003 struct TemplatedType
4006 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4007 struct __ecereNameSpace__ecere__sys__BTNode * left;
4008 struct __ecereNameSpace__ecere__sys__BTNode * right;
4010 struct TemplateParameter * param;
4011 } __attribute__ ((gcc_struct));
4013 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4015 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4017 struct Context * context = PushContext();
4019 context->templateTypesOnly = 0x1;
4020 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4022 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4024 for(; param; param = param->next)
4026 if(param->type == 0 && param->identifier)
4028 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4030 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4036 struct __ecereNameSpace__ecere__com__Class * sClass;
4038 for(sClass = _class; sClass; sClass = sClass->base)
4040 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4042 for(p = sClass->templateParams.first; p; p = p->next)
4046 struct TemplateParameter * param = p->param;
4047 struct TemplatedType * type;
4051 p->param = param = __extension__ ({
4052 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4054 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4057 type = __extension__ ({
4058 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4060 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4062 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4070 extern void PopContext(struct Context * ctx);
4072 extern void FreeContext(struct Context * context);
4074 void FinishTemplatesContext(struct Context * context)
4076 PopContext(context);
4077 FreeContext(context);
4078 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4081 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4083 if(!method->dataType)
4085 struct Context * context = SetupTemplatesContext(method->_class);
4087 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4088 FinishTemplatesContext(context);
4089 if(method->type != 1 && method->dataType)
4091 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4093 if(!method->_class->symbol)
4094 method->_class->symbol = FindClass(method->_class->fullName);
4095 method->dataType->thisClass = method->_class->symbol;
4101 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4105 struct Context * context = SetupTemplatesContext(prop->_class);
4107 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4108 FinishTemplatesContext(context);
4112 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4114 extern void FreeTypeName(struct TypeName * typeName);
4116 static void ProcessDeclarator(struct Declarator * decl);
4118 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4120 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4124 struct MethodImport * prev;
4125 struct MethodImport * next;
4127 unsigned int isVirtual;
4128 } __attribute__ ((gcc_struct));
4130 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4132 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4134 struct Symbol * symbol = method->symbol;
4136 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4138 unsigned int imported = 0x0;
4139 unsigned int dllImport = 0x0;
4141 if(!method->dataType)
4142 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4143 if(!symbol || symbol->_import || method->type == 1)
4145 if(!symbol || method->type == 1)
4147 struct Symbol * classSym;
4149 if(!method->_class->symbol)
4150 method->_class->symbol = FindClass(method->_class->fullName);
4151 classSym = method->_class->symbol;
4152 if(!classSym->_import)
4154 struct ModuleImport * module;
4156 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4157 module = FindModule(method->_class->module);
4159 module = mainModule;
4160 classSym->_import = __extension__ ({
4161 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4163 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4165 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4169 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4171 if(!symbol->_import)
4173 symbol->_import = (struct ClassImport *)__extension__ ({
4174 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4176 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4182 symbol->type = method->dataType;
4184 symbol->type->refCount++;
4187 if(!method->dataType->dllExport)
4190 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4194 if(method->type != 1 && method->dataType)
4195 DeclareType(method->dataType, 0x1, 0x1);
4196 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4198 struct Declaration * decl;
4199 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4200 struct Declarator * d;
4201 struct Declarator * funcDecl;
4202 struct External * external;
4204 specifiers = MkList();
4205 declarators = MkList();
4207 ListAdd(specifiers, MkSpecifier(EXTERN));
4208 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4209 ListAdd(specifiers, MkSpecifier(STATIC));
4210 if(method->type == 1)
4212 ListAdd(specifiers, MkSpecifier(INT));
4213 d = MkDeclaratorIdentifier(MkIdentifier(name));
4217 d = MkDeclaratorIdentifier(MkIdentifier(name));
4219 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4221 struct Context * context = SetupTemplatesContext(method->_class);
4223 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4224 FinishTemplatesContext(context);
4226 funcDecl = GetFuncDecl(d);
4229 struct Specifier * spec, * next;
4231 for(spec = (*specifiers).first; spec; spec = next)
4236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4237 FreeSpecifier(spec);
4241 if(method->dataType && !method->dataType->staticMethod)
4243 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4245 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4246 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")));
4247 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4248 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4250 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4252 struct TypeName * param = (*funcDecl->function.parameters).first;
4254 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4255 FreeTypeName(param);
4257 if(!funcDecl->function.parameters)
4258 funcDecl->function.parameters = MkList();
4259 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4263 ProcessDeclarator(d);
4264 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4265 decl = MkDeclaration(specifiers, declarators);
4266 ReplaceThisClassSpecifiers(specifiers, method->_class);
4267 if(symbol->pointerExternal)
4269 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4272 *functionSymbol = *symbol;
4273 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4274 if(functionSymbol->type)
4275 functionSymbol->type->refCount++;
4277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4278 symbol->pointerExternal->symbol = functionSymbol;
4280 external = MkExternalDeclaration(decl);
4282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4283 external->symbol = symbol;
4284 symbol->pointerExternal = external;
4288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4290 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4294 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4296 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4298 unsigned int first = 0x1;
4300 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4302 char className[1024];
4304 strcpy(className, _class->fullName);
4305 for(param = _class->templateParams.first; param; param = param->next)
4309 strcat(className, "<");
4311 strcat(className, ", ");
4312 if(lastParam + 1 != p)
4314 strcat(className, param->name);
4315 strcat(className, " = ");
4317 strcat(className, param->name);
4325 int len = strlen(className);
4327 if(className[len - 1] == '>')
4328 className[len++] = ' ';
4329 className[len++] = '>';
4330 className[len++] = '\0';
4332 return __ecereNameSpace__ecere__sys__CopyString(className);
4335 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4338 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4340 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4342 unsigned int first = 0x1;
4344 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4346 char className[1024];
4348 strcpy(className, _class->fullName);
4349 for(param = _class->templateParams.first; param; param = param->next)
4353 strcat(className, "<");
4355 strcat(className, ", ");
4356 if(lastParam + 1 != p)
4358 strcat(className, param->name);
4359 strcat(className, " = ");
4361 strcat(className, param->name);
4369 int len = strlen(className);
4371 if(className[len - 1] == '>')
4372 className[len++] = ' ';
4373 className[len++] = '>';
4374 className[len++] = '\0';
4376 return MkClassType(className);
4380 return MkClassType(_class->fullName);
4384 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4386 if(specs != (((void *)0)) && _class)
4388 struct Specifier * spec;
4390 for(spec = specs->first; spec; spec = spec->next)
4392 if(spec->type == 0 && spec->specifier == THISCLASS)
4395 spec->name = ReplaceThisClass(_class);
4396 spec->symbol = FindClass(spec->name);
4402 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4404 struct __ecereNameSpace__ecere__com__GlobalFunction
4406 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4407 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4410 struct __ecereNameSpace__ecere__com__Instance * module;
4411 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4412 char * dataTypeString;
4413 struct Type * dataType;
4415 } __attribute__ ((gcc_struct));
4417 extern struct Context * globalContext;
4419 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4421 struct FunctionImport
4423 struct FunctionImport * prev;
4424 struct FunctionImport * next;
4426 } __attribute__ ((gcc_struct));
4428 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4430 struct Symbol * symbol = function->symbol;
4432 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4434 unsigned int imported = 0x0;
4435 unsigned int dllImport = 0x0;
4437 if(!function->dataType)
4439 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4440 if(!function->dataType->thisClass)
4441 function->dataType->staticMethod = 0x1;
4447 struct ModuleImport * module = FindModule(function->module);
4449 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4452 if(!function->dataType->dllExport)
4454 symbol->_import = (struct ClassImport *)__extension__ ({
4455 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4457 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4459 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4463 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4464 if(!symbol->type->thisClass)
4465 symbol->type->staticMethod = 0x1;
4468 imported = symbol->_import ? 0x1 : 0x0;
4469 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4472 DeclareType(function->dataType, 0x1, 0x1);
4475 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4477 struct Declaration * decl;
4478 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4479 struct Declarator * d;
4480 struct Declarator * funcDecl;
4481 struct External * external;
4483 specifiers = MkList();
4484 declarators = MkList();
4485 ListAdd(specifiers, MkSpecifier(EXTERN));
4486 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4488 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4489 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4490 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4492 struct Specifier * spec;
4494 for(spec = (*specifiers).first; spec; spec = spec->next)
4495 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4498 FreeSpecifier(spec);
4502 funcDecl = GetFuncDecl(d);
4503 if(funcDecl && !funcDecl->function.parameters)
4505 funcDecl->function.parameters = MkList();
4506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4508 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4510 struct Context * oldCtx = curContext;
4512 curContext = globalContext;
4513 decl = MkDeclaration(specifiers, declarators);
4514 curContext = oldCtx;
4516 if(symbol->pointerExternal)
4518 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4521 *functionSymbol = *symbol;
4522 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4523 if(functionSymbol->type)
4524 functionSymbol->type->refCount++;
4526 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4527 symbol->pointerExternal->symbol = functionSymbol;
4529 external = MkExternalDeclaration(decl);
4531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4532 external->symbol = symbol;
4533 symbol->pointerExternal = external;
4537 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4540 symbol->id = curExternal->symbol->idCode;
4543 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4546 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4551 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4552 struct __ecereNameSpace__ecere__sys__BTNode * left;
4553 struct __ecereNameSpace__ecere__sys__BTNode * right;
4555 struct __ecereNameSpace__ecere__com__Instance * module;
4556 char * dataTypeString;
4557 struct Type * dataType;
4560 } __attribute__ ((gcc_struct));
4562 void DeclareGlobalData(struct GlobalData * data)
4564 struct Symbol * symbol = data->symbol;
4566 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4571 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4574 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4575 DeclareType(data->dataType, 0x1, 0x1);
4578 if(!symbol->pointerExternal)
4580 struct Declaration * decl;
4581 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4582 struct Declarator * d;
4583 struct External * external;
4585 specifiers = MkList();
4586 declarators = MkList();
4587 ListAdd(specifiers, MkSpecifier(EXTERN));
4588 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4589 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4590 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4591 decl = MkDeclaration(specifiers, declarators);
4592 external = MkExternalDeclaration(decl);
4594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4595 external->symbol = symbol;
4596 symbol->pointerExternal = external;
4600 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4603 symbol->id = curExternal->symbol->idCode;
4610 struct Conversion * prev, * next;
4611 struct __ecereNameSpace__ecere__com__Property * convert;
4613 struct Type * resultType;
4614 } __attribute__ ((gcc_struct));
4616 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4618 extern void Compiler_Warning(char * format, ...);
4620 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4622 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)
4626 if(source->kind == 20 && dest->kind != 20)
4628 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4633 if(dest->kind == 20 && source->kind != 20)
4635 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4640 if(dest->classObjectType == 2)
4642 if(source->classObjectType != 3)
4646 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4654 if(source->classObjectType == 3)
4656 if(dest->classObjectType == 3 && source->classObjectType != 2)
4659 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4661 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4664 if(dest->kind == 14 && source->kind != 0)
4666 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))
4668 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))
4670 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4672 if(source->_class->registered && source->_class->registered->type == 3)
4674 if(conversions != (((void *)0)))
4676 if(source->_class->registered == dest->_class->registered)
4681 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4683 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4685 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4687 if(sourceBase == destBase)
4691 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))
4695 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4697 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4704 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4708 if(source->kind == 8)
4710 struct __ecereNameSpace__ecere__com__Class * _class;
4712 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4714 struct __ecereNameSpace__ecere__com__Property * convert;
4716 for(convert = _class->conversions.first; convert; convert = convert->next)
4718 if(convert->memberAccess == 1 || _class->module == privateModule)
4720 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4722 if(!convert->dataType)
4723 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4724 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4726 if(!conversions && !convert->Get)
4728 else if(conversions != (((void *)0)))
4730 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))
4734 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4736 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4747 struct __ecereNameSpace__ecere__com__Class * _class;
4749 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4751 struct __ecereNameSpace__ecere__com__Property * convert;
4753 for(convert = _class->conversions.first; convert; convert = convert->next)
4755 if(convert->memberAccess == 1 || _class->module == privateModule)
4757 if(!convert->dataType)
4758 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4759 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4761 if(!conversions && !convert->Set)
4763 else if(conversions != (((void *)0)))
4765 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))
4769 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4779 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4781 if(!dest->_class->registered->dataType)
4782 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4783 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4785 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4792 if(source->kind == 8)
4794 struct __ecereNameSpace__ecere__com__Class * _class;
4796 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4798 struct __ecereNameSpace__ecere__com__Property * convert;
4800 for(convert = _class->conversions.first; convert; convert = convert->next)
4802 if(convert->memberAccess == 1 || _class->module == privateModule)
4804 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4806 if(!convert->dataType)
4807 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4808 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4810 if(!conversions && !convert->Get)
4812 else if(conversions != (((void *)0)))
4814 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))
4818 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4820 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4828 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4830 if(!source->_class->registered->dataType)
4831 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4832 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4839 if(source->kind == 8 || source->kind == 19)
4841 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4843 else if(dest->kind == 7 && source->kind == 6)
4845 else if(dest->kind == 2 && source->kind == 1)
4847 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4849 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4851 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4853 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4855 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))
4857 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))
4859 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)))
4861 struct Type * paramSource, * paramDest;
4863 if(dest->kind == 16)
4864 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4865 if(source->kind == 16)
4866 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4867 if(dest->kind == 13 && dest->type->kind == 11)
4869 if(source->kind == 13 && source->type->kind == 11)
4870 source = source->type;
4871 if(dest->kind == 16)
4872 dest = dest->method->dataType;
4873 if(source->kind == 16)
4874 source = source->method->dataType;
4875 paramSource = source->params.first;
4876 if(paramSource && paramSource->kind == 0)
4877 paramSource = (((void *)0));
4878 paramDest = dest->params.first;
4879 if(paramDest && paramDest->kind == 0)
4880 paramDest = (((void *)0));
4881 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4883 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))))
4885 if(paramDest && paramDest->kind == 8)
4886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4891 paramDest = paramDest->next;
4893 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4895 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4899 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4907 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4910 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4912 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4916 paramSource = paramSource->next;
4922 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4924 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4930 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4938 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4940 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4943 for(; paramDest; paramDest = paramDest->next)
4947 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4951 struct Type * paramDestType = paramDest;
4952 struct Type * paramSourceType = paramSource;
4953 struct Type * type = paramDestType;
4955 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4958 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4959 struct __ecereNameSpace__ecere__com__Class * sClass;
4961 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4964 if(sClass->templateClass)
4965 sClass = sClass->templateClass;
4966 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4968 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4970 for(sClass = sClass->base; sClass; sClass = sClass->base)
4972 if(sClass->templateClass)
4973 sClass = sClass->templateClass;
4974 id += sClass->templateParams.count;
4985 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4987 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4990 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)))
4995 PrintType(paramDest, type, 0x0, 0x1);
4996 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4997 if(paramDestType != paramDest)
4998 FreeType(paramDestType);
5001 if(paramDestType != paramDest)
5002 FreeType(paramDestType);
5004 paramSource = paramSource->next;
5008 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5013 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5017 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5019 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5026 static void FreeConvert(struct Conversion * convert)
5028 if(convert->resultType)
5029 FreeType(convert->resultType);
5032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5034 struct __ecereNameSpace__ecere__com__BTNamedLink
5037 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5038 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5039 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5042 } __attribute__ ((gcc_struct));
5044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5046 struct __ecereNameSpace__ecere__com__EnumClassData
5048 struct __ecereNameSpace__ecere__sys__OldList values;
5050 } __attribute__ ((gcc_struct));
5052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5054 struct __ecereNameSpace__ecere__sys__NamedLink
5056 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5057 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5060 } __attribute__ ((gcc_struct));
5062 extern void FreeExpContents(struct Expression * exp);
5064 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5066 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5068 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5070 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5072 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5074 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5076 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5078 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)))
5080 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5082 if(_class->type == 4)
5084 struct __ecereNameSpace__ecere__sys__OldList converts =
5088 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5092 _class->symbol = FindClass(_class->fullName);
5093 type->_class = _class->symbol;
5094 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5096 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5097 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5101 struct __ecereNameSpace__ecere__com__Class * baseClass;
5103 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5105 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5107 for(value = e->values.first; value; value = value->next)
5109 if(!strcmp(value->name, string))
5114 FreeExpContents(sourceExp);
5115 FreeType(sourceExp->expType);
5116 sourceExp->isConstant = 0x1;
5117 sourceExp->expType = MkClassType(baseClass->fullName);
5121 sourceExp->type = 2;
5122 if(!strcmp(baseClass->dataTypeString, "int"))
5123 sprintf(constant, "%d", (int)value->data);
5125 sprintf(constant, "0x%X", (int)value->data);
5126 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5128 while(converts.first)
5130 struct Conversion * convert = converts.first;
5132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5133 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5135 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5142 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5143 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5146 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)))
5147 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5154 struct __ecereNameSpace__ecere__com__SubModule
5156 struct __ecereNameSpace__ecere__com__SubModule * prev;
5157 struct __ecereNameSpace__ecere__com__SubModule * next;
5158 struct __ecereNameSpace__ecere__com__Instance * module;
5160 } __attribute__ ((gcc_struct));
5162 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5164 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5166 if(searchFor == searchIn)
5168 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5170 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5172 if(ModuleVisibility(subModule->module, searchFor))
5179 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5181 struct __ecereNameSpace__ecere__com__Application
5186 unsigned int isGUIApp;
5187 struct __ecereNameSpace__ecere__sys__OldList allModules;
5188 char * parsedCommand;
5189 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5190 } __attribute__ ((gcc_struct));
5192 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5194 struct __ecereNameSpace__ecere__com__Instance * module;
5196 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))
5198 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))
5200 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))
5202 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)
5204 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5210 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5212 void ReadString(char * output, char * string);
5214 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5216 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5218 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5220 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5222 struct Type * source = sourceExp->expType;
5223 struct Type * realDest = dest;
5224 struct Type * backupSourceExpType = (((void *)0));
5226 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5228 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5230 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5232 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5234 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5236 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5238 if(sourceBase == destBase)
5244 struct __ecereNameSpace__ecere__sys__OldList * specs;
5245 unsigned int flag = 0x0;
5246 long long value = (((int)0x7fffffff));
5250 if(sourceExp->type == 2)
5252 if(source->isSigned)
5253 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5255 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5257 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5259 if(source->isSigned)
5260 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5262 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5264 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5267 source = __extension__ ({
5268 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5270 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5275 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5277 if(_class && _class->type == 3)
5279 if(source->kind != 8)
5281 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5282 struct Type * tempDest, * tempSource;
5284 for(; _class->base->type != 1000; _class = _class->base)
5287 tempDest = tempType;
5290 _class->symbol = FindClass(_class->fullName);
5291 tempType->_class = _class->symbol;
5292 tempType->truth = dest->truth;
5293 if(tempType->_class)
5294 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5295 backupSourceExpType = sourceExp->expType;
5296 sourceExp->expType = dest;
5299 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5302 if(_class && _class->type == 2 && source->kind != 8)
5304 if(!dest->_class->registered->dataType)
5305 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5306 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5309 FreeType(sourceExp->expType);
5310 source = sourceExp->expType = MkClassType(dest->_class->string);
5314 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5316 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5317 struct Declarator * decl;
5320 ReadString(string, sourceExp->string);
5321 decl = SpecDeclFromString(string, specs, (((void *)0)));
5322 FreeExpContents(sourceExp);
5323 FreeType(sourceExp->expType);
5324 sourceExp->type = 26;
5325 sourceExp->_classExp.specifiers = specs;
5326 sourceExp->_classExp.decl = decl;
5327 sourceExp->expType = dest;
5331 if(backupSourceExpType)
5332 FreeType(backupSourceExpType);
5336 else if(source->kind == 8)
5338 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5340 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5344 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5345 struct Type * tempDest, * tempSource;
5347 if(!source->_class->registered->dataType)
5348 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5349 for(; _class->base->type != 1000; _class = _class->base)
5352 tempSource = tempType;
5354 tempType->_class = FindClass(_class->fullName);
5355 tempType->truth = source->truth;
5356 tempType->classObjectType = source->classObjectType;
5357 if(tempType->_class)
5358 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5359 if(conversions->last)
5361 ((struct Conversion *)conversions->last)->resultType = dest;
5364 FreeType(sourceExp->expType);
5365 sourceExp->expType = MkClassType(_class->fullName);
5366 sourceExp->expType->truth = source->truth;
5367 sourceExp->expType->classObjectType = source->classObjectType;
5368 if(!sourceExp->destType)
5370 FreeType(sourceExp->destType);
5371 sourceExp->destType = sourceExp->expType;
5372 if(sourceExp->expType)
5373 sourceExp->expType->refCount++;
5375 if(!_class->dataType)
5376 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5378 dest = MkClassType(source->_class->string);
5379 dest->truth = source->truth;
5380 dest->classObjectType = source->classObjectType;
5382 source = _class->dataType;
5384 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5390 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5399 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5401 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5403 if(_class->type == 0 || _class->type == 5)
5405 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5407 *newExp = *sourceExp;
5408 if(sourceExp->destType)
5409 sourceExp->destType->refCount++;
5410 if(sourceExp->expType)
5411 sourceExp->expType->refCount++;
5412 sourceExp->type = 11;
5413 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5414 sourceExp->cast.exp = newExp;
5415 FreeType(sourceExp->expType);
5416 sourceExp->expType = (((void *)0));
5417 ProcessExpressionType(sourceExp);
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = dest;
5426 if(backupSourceExpType)
5427 FreeType(backupSourceExpType);
5430 if(!_class->dataType)
5431 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5433 dest = _class->dataType;
5436 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5438 specs = MkListOne(MkSpecifier(DOUBLE));
5440 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5442 specs = MkListOne(MkSpecifier(FLOAT));
5444 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5448 ListAdd(specs, MkSpecifier(UNSIGNED));
5449 ListAdd(specs, MkSpecifier(INT64));
5451 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5455 ListAdd(specs, MkSpecifier(UNSIGNED));
5456 ListAdd(specs, MkSpecifier(INT));
5458 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5462 ListAdd(specs, MkSpecifier(UNSIGNED));
5463 ListAdd(specs, MkSpecifier(SHORT));
5465 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5469 ListAdd(specs, MkSpecifier(UNSIGNED));
5470 ListAdd(specs, MkSpecifier(CHAR));
5476 if(backupSourceExpType)
5478 if(sourceExp->expType)
5479 FreeType(sourceExp->expType);
5480 sourceExp->expType = backupSourceExpType;
5485 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))
5487 specs = MkListOne(MkSpecifier(DOUBLE));
5489 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5491 specs = MkListOne(MkSpecifier(FLOAT));
5493 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)))
5497 ListAdd(specs, MkSpecifier(UNSIGNED));
5498 ListAdd(specs, MkSpecifier(CHAR));
5500 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)))))
5504 ListAdd(specs, MkSpecifier(UNSIGNED));
5505 ListAdd(specs, MkSpecifier(SHORT));
5507 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5511 ListAdd(specs, MkSpecifier(UNSIGNED));
5512 ListAdd(specs, MkSpecifier(INT));
5514 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5518 ListAdd(specs, MkSpecifier(UNSIGNED));
5519 ListAdd(specs, MkSpecifier(INT64));
5521 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5523 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5529 if(backupSourceExpType)
5531 if(sourceExp->expType)
5532 FreeType(sourceExp->expType);
5533 sourceExp->expType = backupSourceExpType;
5539 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5541 *newExp = *sourceExp;
5542 newExp->prev = (((void *)0));
5543 newExp->next = (((void *)0));
5544 if(sourceExp->destType)
5545 sourceExp->destType->refCount++;
5546 if(sourceExp->expType)
5547 sourceExp->expType->refCount++;
5548 sourceExp->type = 11;
5549 if(realDest->kind == 8)
5551 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5552 FreeList(specs, FreeSpecifier);
5555 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5556 if(newExp->type == 4)
5558 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5561 sourceExp->cast.exp = newExp;
5562 FreeType(sourceExp->expType);
5563 sourceExp->expType = (((void *)0));
5564 ProcessExpressionType(sourceExp);
5567 FreeList(specs, FreeSpecifier);
5570 if(backupSourceExpType)
5571 FreeType(backupSourceExpType);
5576 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5577 sourceExp = (*sourceExp->list).last;
5578 if(sourceExp->type == 0)
5580 struct Identifier * id = sourceExp->identifier;
5584 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5586 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5587 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5591 for(; _class && _class->type == 4; _class = _class->base)
5593 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5594 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5596 for(value = e->values.first; value; value = value->next)
5598 if(!strcmp(value->name, id->string))
5603 FreeExpContents(sourceExp);
5604 FreeType(sourceExp->expType);
5605 sourceExp->isConstant = 0x1;
5606 sourceExp->expType = MkClassType(_class->fullName);
5610 sourceExp->type = 2;
5611 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5612 sprintf(constant, "%d", (int)value->data);
5614 sprintf(constant, "0x%X", (int)value->data);
5615 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5623 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5630 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5632 int value2 = op2->i;
5635 exp->string = PrintInt(op1->i + value2);
5638 exp->expType = op1->type;
5640 op1->type->refCount++;
5645 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5647 unsigned int value2 = op2->ui;
5650 exp->string = PrintUInt(op1->ui + value2);
5653 exp->expType = op1->type;
5655 op1->type->refCount++;
5660 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5662 short value2 = op2->s;
5665 exp->string = PrintShort(op1->s + value2);
5668 exp->expType = op1->type;
5670 op1->type->refCount++;
5675 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5677 unsigned short value2 = op2->us;
5680 exp->string = PrintUShort(op1->us + value2);
5683 exp->expType = op1->type;
5685 op1->type->refCount++;
5690 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5692 char value2 = op2->c;
5695 exp->string = PrintChar(op1->c + value2);
5698 exp->expType = op1->type;
5700 op1->type->refCount++;
5705 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5707 unsigned char value2 = op2->uc;
5710 exp->string = PrintUChar(op1->uc + value2);
5713 exp->expType = op1->type;
5715 op1->type->refCount++;
5720 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5722 float value2 = op2->f;
5725 exp->string = PrintFloat(op1->f + value2);
5728 exp->expType = op1->type;
5730 op1->type->refCount++;
5735 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5737 double value2 = op2->d;
5740 exp->string = PrintDouble(op1->d + value2);
5743 exp->expType = op1->type;
5745 op1->type->refCount++;
5750 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5752 int value2 = op2->i;
5755 exp->string = PrintInt(op1->i - value2);
5758 exp->expType = op1->type;
5760 op1->type->refCount++;
5765 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5767 unsigned int value2 = op2->ui;
5770 exp->string = PrintUInt(op1->ui - value2);
5773 exp->expType = op1->type;
5775 op1->type->refCount++;
5780 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5782 short value2 = op2->s;
5785 exp->string = PrintShort(op1->s - value2);
5788 exp->expType = op1->type;
5790 op1->type->refCount++;
5795 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5797 unsigned short value2 = op2->us;
5800 exp->string = PrintUShort(op1->us - value2);
5803 exp->expType = op1->type;
5805 op1->type->refCount++;
5810 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5812 char value2 = op2->c;
5815 exp->string = PrintChar(op1->c - value2);
5818 exp->expType = op1->type;
5820 op1->type->refCount++;
5825 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5827 unsigned char value2 = op2->uc;
5830 exp->string = PrintUChar(op1->uc - value2);
5833 exp->expType = op1->type;
5835 op1->type->refCount++;
5840 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5842 float value2 = op2->f;
5845 exp->string = PrintFloat(op1->f - value2);
5848 exp->expType = op1->type;
5850 op1->type->refCount++;
5855 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5857 double value2 = op2->d;
5860 exp->string = PrintDouble(op1->d - value2);
5863 exp->expType = op1->type;
5865 op1->type->refCount++;
5870 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5872 int value2 = op2->i;
5875 exp->string = PrintInt(op1->i * value2);
5878 exp->expType = op1->type;
5880 op1->type->refCount++;
5885 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5887 unsigned int value2 = op2->ui;
5890 exp->string = PrintUInt(op1->ui * value2);
5893 exp->expType = op1->type;
5895 op1->type->refCount++;
5900 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5902 short value2 = op2->s;
5905 exp->string = PrintShort(op1->s * value2);
5908 exp->expType = op1->type;
5910 op1->type->refCount++;
5915 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5917 unsigned short value2 = op2->us;
5920 exp->string = PrintUShort(op1->us * value2);
5923 exp->expType = op1->type;
5925 op1->type->refCount++;
5930 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5932 char value2 = op2->c;
5935 exp->string = PrintChar(op1->c * value2);
5938 exp->expType = op1->type;
5940 op1->type->refCount++;
5945 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5947 unsigned char value2 = op2->uc;
5950 exp->string = PrintUChar(op1->uc * value2);
5953 exp->expType = op1->type;
5955 op1->type->refCount++;
5960 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5962 float value2 = op2->f;
5965 exp->string = PrintFloat(op1->f * value2);
5968 exp->expType = op1->type;
5970 op1->type->refCount++;
5975 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5977 double value2 = op2->d;
5980 exp->string = PrintDouble(op1->d * value2);
5983 exp->expType = op1->type;
5985 op1->type->refCount++;
5990 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5992 int value2 = op2->i;
5995 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5998 exp->expType = op1->type;
6000 op1->type->refCount++;
6005 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6007 unsigned int value2 = op2->ui;
6010 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6013 exp->expType = op1->type;
6015 op1->type->refCount++;
6020 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6022 short value2 = op2->s;
6025 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6028 exp->expType = op1->type;
6030 op1->type->refCount++;
6035 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6037 unsigned short value2 = op2->us;
6040 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6043 exp->expType = op1->type;
6045 op1->type->refCount++;
6050 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6052 char value2 = op2->c;
6055 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6058 exp->expType = op1->type;
6060 op1->type->refCount++;
6065 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6067 unsigned char value2 = op2->uc;
6070 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6073 exp->expType = op1->type;
6075 op1->type->refCount++;
6080 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6082 float value2 = op2->f;
6085 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6088 exp->expType = op1->type;
6090 op1->type->refCount++;
6095 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6097 double value2 = op2->d;
6100 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6103 exp->expType = op1->type;
6105 op1->type->refCount++;
6110 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6112 int value2 = op2->i;
6115 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6118 exp->expType = op1->type;
6120 op1->type->refCount++;
6125 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6127 unsigned int value2 = op2->ui;
6130 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6133 exp->expType = op1->type;
6135 op1->type->refCount++;
6140 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6142 short value2 = op2->s;
6145 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6148 exp->expType = op1->type;
6150 op1->type->refCount++;
6155 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6157 unsigned short value2 = op2->us;
6160 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6163 exp->expType = op1->type;
6165 op1->type->refCount++;
6170 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6172 char value2 = op2->c;
6175 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6178 exp->expType = op1->type;
6180 op1->type->refCount++;
6185 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6187 unsigned char value2 = op2->uc;
6190 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6193 exp->expType = op1->type;
6195 op1->type->refCount++;
6200 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6203 exp->string = PrintInt((-op1->i));
6206 exp->expType = op1->type;
6208 op1->type->refCount++;
6213 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6216 exp->string = PrintUInt((unsigned int)(-op1->ui));
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6229 exp->string = PrintShort((-op1->s));
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6242 exp->string = PrintUShort((unsigned short)(-op1->us));
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6255 exp->string = PrintChar((-op1->c));
6258 exp->expType = op1->type;
6260 op1->type->refCount++;
6265 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6268 exp->string = PrintUChar((unsigned char)(-op1->uc));
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6281 exp->string = PrintFloat((float)(-op1->f));
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6294 exp->string = PrintDouble((double)(-op1->d));
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6307 exp->string = PrintInt((++op1->i));
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6320 exp->string = PrintUInt((++op1->ui));
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6333 exp->string = PrintShort((++op1->s));
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6346 exp->string = PrintUShort((++op1->us));
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6359 exp->string = PrintChar((++op1->c));
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6372 exp->string = PrintUChar((++op1->uc));
6375 exp->expType = op1->type;
6377 op1->type->refCount++;
6382 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6385 exp->string = PrintFloat((float)(++op1->f));
6388 exp->expType = op1->type;
6390 op1->type->refCount++;
6395 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6398 exp->string = PrintDouble((double)(++op1->d));
6401 exp->expType = op1->type;
6403 op1->type->refCount++;
6408 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6411 exp->string = PrintInt((--op1->i));
6414 exp->expType = op1->type;
6416 op1->type->refCount++;
6421 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6424 exp->string = PrintUInt((--op1->ui));
6427 exp->expType = op1->type;
6429 op1->type->refCount++;
6434 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6437 exp->string = PrintShort((--op1->s));
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6450 exp->string = PrintUShort((--op1->us));
6453 exp->expType = op1->type;
6455 op1->type->refCount++;
6460 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6463 exp->string = PrintChar((--op1->c));
6466 exp->expType = op1->type;
6468 op1->type->refCount++;
6473 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6476 exp->string = PrintUChar((--op1->uc));
6479 exp->expType = op1->type;
6481 op1->type->refCount++;
6486 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6489 exp->string = PrintFloat((float)(--op1->f));
6492 exp->expType = op1->type;
6494 op1->type->refCount++;
6499 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6502 exp->string = PrintDouble((double)(--op1->d));
6505 exp->expType = op1->type;
6507 op1->type->refCount++;
6512 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6514 int value2 = op2->i;
6517 exp->string = PrintInt(op1->i = value2);
6520 exp->expType = op1->type;
6522 op1->type->refCount++;
6527 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6529 unsigned int value2 = op2->ui;
6532 exp->string = PrintUInt(op1->ui = value2);
6535 exp->expType = op1->type;
6537 op1->type->refCount++;
6542 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6544 short value2 = op2->s;
6547 exp->string = PrintShort(op1->s = value2);
6550 exp->expType = op1->type;
6552 op1->type->refCount++;
6557 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6559 unsigned short value2 = op2->us;
6562 exp->string = PrintUShort(op1->us = value2);
6565 exp->expType = op1->type;
6567 op1->type->refCount++;
6572 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6574 char value2 = op2->c;
6577 exp->string = PrintChar(op1->c = value2);
6580 exp->expType = op1->type;
6582 op1->type->refCount++;
6587 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6589 unsigned char value2 = op2->uc;
6592 exp->string = PrintUChar(op1->uc = value2);
6595 exp->expType = op1->type;
6597 op1->type->refCount++;
6602 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6604 float value2 = op2->f;
6607 exp->string = PrintFloat(op1->f = value2);
6610 exp->expType = op1->type;
6612 op1->type->refCount++;
6617 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6619 double value2 = op2->d;
6622 exp->string = PrintDouble(op1->d = value2);
6625 exp->expType = op1->type;
6627 op1->type->refCount++;
6632 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6634 int value2 = op2->i;
6637 exp->string = PrintInt(op1->i += value2);
6640 exp->expType = op1->type;
6642 op1->type->refCount++;
6647 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6649 unsigned int value2 = op2->ui;
6652 exp->string = PrintUInt(op1->ui += value2);
6655 exp->expType = op1->type;
6657 op1->type->refCount++;
6662 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6664 short value2 = op2->s;
6667 exp->string = PrintShort(op1->s += value2);
6670 exp->expType = op1->type;
6672 op1->type->refCount++;
6677 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6679 unsigned short value2 = op2->us;
6682 exp->string = PrintUShort(op1->us += value2);
6685 exp->expType = op1->type;
6687 op1->type->refCount++;
6692 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6694 char value2 = op2->c;
6697 exp->string = PrintChar(op1->c += value2);
6700 exp->expType = op1->type;
6702 op1->type->refCount++;
6707 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6709 unsigned char value2 = op2->uc;
6712 exp->string = PrintUChar(op1->uc += value2);
6715 exp->expType = op1->type;
6717 op1->type->refCount++;
6722 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6724 float value2 = op2->f;
6727 exp->string = PrintFloat(op1->f += value2);
6730 exp->expType = op1->type;
6732 op1->type->refCount++;
6737 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6739 double value2 = op2->d;
6742 exp->string = PrintDouble(op1->d += value2);
6745 exp->expType = op1->type;
6747 op1->type->refCount++;
6752 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6754 int value2 = op2->i;
6757 exp->string = PrintInt(op1->i -= value2);
6760 exp->expType = op1->type;
6762 op1->type->refCount++;
6767 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6769 unsigned int value2 = op2->ui;
6772 exp->string = PrintUInt(op1->ui -= value2);
6775 exp->expType = op1->type;
6777 op1->type->refCount++;
6782 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6784 short value2 = op2->s;
6787 exp->string = PrintShort(op1->s -= value2);
6790 exp->expType = op1->type;
6792 op1->type->refCount++;
6797 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6799 unsigned short value2 = op2->us;
6802 exp->string = PrintUShort(op1->us -= value2);
6805 exp->expType = op1->type;
6807 op1->type->refCount++;
6812 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6814 char value2 = op2->c;
6817 exp->string = PrintChar(op1->c -= value2);
6820 exp->expType = op1->type;
6822 op1->type->refCount++;
6827 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6829 unsigned char value2 = op2->uc;
6832 exp->string = PrintUChar(op1->uc -= value2);
6835 exp->expType = op1->type;
6837 op1->type->refCount++;
6842 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6844 float value2 = op2->f;
6847 exp->string = PrintFloat(op1->f -= value2);
6850 exp->expType = op1->type;
6852 op1->type->refCount++;
6857 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6859 double value2 = op2->d;
6862 exp->string = PrintDouble(op1->d -= value2);
6865 exp->expType = op1->type;
6867 op1->type->refCount++;
6872 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6874 int value2 = op2->i;
6877 exp->string = PrintInt(op1->i *= value2);
6880 exp->expType = op1->type;
6882 op1->type->refCount++;
6887 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6889 unsigned int value2 = op2->ui;
6892 exp->string = PrintUInt(op1->ui *= value2);
6895 exp->expType = op1->type;
6897 op1->type->refCount++;
6902 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6904 short value2 = op2->s;
6907 exp->string = PrintShort(op1->s *= value2);
6910 exp->expType = op1->type;
6912 op1->type->refCount++;
6917 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6919 unsigned short value2 = op2->us;
6922 exp->string = PrintUShort(op1->us *= value2);
6925 exp->expType = op1->type;
6927 op1->type->refCount++;
6932 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6934 char value2 = op2->c;
6937 exp->string = PrintChar(op1->c *= value2);
6940 exp->expType = op1->type;
6942 op1->type->refCount++;
6947 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6949 unsigned char value2 = op2->uc;
6952 exp->string = PrintUChar(op1->uc *= value2);
6955 exp->expType = op1->type;
6957 op1->type->refCount++;
6962 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6964 float value2 = op2->f;
6967 exp->string = PrintFloat(op1->f *= value2);
6970 exp->expType = op1->type;
6972 op1->type->refCount++;
6977 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6979 double value2 = op2->d;
6982 exp->string = PrintDouble(op1->d *= value2);
6985 exp->expType = op1->type;
6987 op1->type->refCount++;
6992 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6994 int value2 = op2->i;
6997 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7000 exp->expType = op1->type;
7002 op1->type->refCount++;
7007 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7009 unsigned int value2 = op2->ui;
7012 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7015 exp->expType = op1->type;
7017 op1->type->refCount++;
7022 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7024 short value2 = op2->s;
7027 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7030 exp->expType = op1->type;
7032 op1->type->refCount++;
7037 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7039 unsigned short value2 = op2->us;
7042 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7045 exp->expType = op1->type;
7047 op1->type->refCount++;
7052 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7054 char value2 = op2->c;
7057 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7060 exp->expType = op1->type;
7062 op1->type->refCount++;
7067 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7069 unsigned char value2 = op2->uc;
7072 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7075 exp->expType = op1->type;
7077 op1->type->refCount++;
7082 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7084 float value2 = op2->f;
7087 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7090 exp->expType = op1->type;
7092 op1->type->refCount++;
7097 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7099 double value2 = op2->d;
7102 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7105 exp->expType = op1->type;
7107 op1->type->refCount++;
7112 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7114 int value2 = op2->i;
7117 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7120 exp->expType = op1->type;
7122 op1->type->refCount++;
7127 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7129 unsigned int value2 = op2->ui;
7132 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7135 exp->expType = op1->type;
7137 op1->type->refCount++;
7142 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7144 short value2 = op2->s;
7147 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7150 exp->expType = op1->type;
7152 op1->type->refCount++;
7157 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7159 unsigned short value2 = op2->us;
7162 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7165 exp->expType = op1->type;
7167 op1->type->refCount++;
7172 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7174 char value2 = op2->c;
7177 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7180 exp->expType = op1->type;
7182 op1->type->refCount++;
7187 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7189 unsigned char value2 = op2->uc;
7192 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7195 exp->expType = op1->type;
7197 op1->type->refCount++;
7202 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7204 int value2 = op2->i;
7207 exp->string = PrintInt(op1->i & value2);
7210 exp->expType = op1->type;
7212 op1->type->refCount++;
7217 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7219 unsigned int value2 = op2->ui;
7222 exp->string = PrintUInt(op1->ui & value2);
7225 exp->expType = op1->type;
7227 op1->type->refCount++;
7232 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7234 short value2 = op2->s;
7237 exp->string = PrintShort(op1->s & value2);
7240 exp->expType = op1->type;
7242 op1->type->refCount++;
7247 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7249 unsigned short value2 = op2->us;
7252 exp->string = PrintUShort(op1->us & value2);
7255 exp->expType = op1->type;
7257 op1->type->refCount++;
7262 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7264 char value2 = op2->c;
7267 exp->string = PrintChar(op1->c & value2);
7270 exp->expType = op1->type;
7272 op1->type->refCount++;
7277 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7279 unsigned char value2 = op2->uc;
7282 exp->string = PrintUChar(op1->uc & value2);
7285 exp->expType = op1->type;
7287 op1->type->refCount++;
7292 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7294 int value2 = op2->i;
7297 exp->string = PrintInt(op1->i | value2);
7300 exp->expType = op1->type;
7302 op1->type->refCount++;
7307 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7309 unsigned int value2 = op2->ui;
7312 exp->string = PrintUInt(op1->ui | value2);
7315 exp->expType = op1->type;
7317 op1->type->refCount++;
7322 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7324 short value2 = op2->s;
7327 exp->string = PrintShort(op1->s | value2);
7330 exp->expType = op1->type;
7332 op1->type->refCount++;
7337 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7339 unsigned short value2 = op2->us;
7342 exp->string = PrintUShort(op1->us | value2);
7345 exp->expType = op1->type;
7347 op1->type->refCount++;
7352 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7354 char value2 = op2->c;
7357 exp->string = PrintChar(op1->c | value2);
7360 exp->expType = op1->type;
7362 op1->type->refCount++;
7367 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7369 unsigned char value2 = op2->uc;
7372 exp->string = PrintUChar(op1->uc | value2);
7375 exp->expType = op1->type;
7377 op1->type->refCount++;
7382 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7384 int value2 = op2->i;
7387 exp->string = PrintInt(op1->i ^ value2);
7390 exp->expType = op1->type;
7392 op1->type->refCount++;
7397 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7399 unsigned int value2 = op2->ui;
7402 exp->string = PrintUInt(op1->ui ^ value2);
7405 exp->expType = op1->type;
7407 op1->type->refCount++;
7412 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7414 short value2 = op2->s;
7417 exp->string = PrintShort(op1->s ^ value2);
7420 exp->expType = op1->type;
7422 op1->type->refCount++;
7427 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7429 unsigned short value2 = op2->us;
7432 exp->string = PrintUShort(op1->us ^ value2);
7435 exp->expType = op1->type;
7437 op1->type->refCount++;
7442 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7444 char value2 = op2->c;
7447 exp->string = PrintChar(op1->c ^ value2);
7450 exp->expType = op1->type;
7452 op1->type->refCount++;
7457 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7459 unsigned char value2 = op2->uc;
7462 exp->string = PrintUChar(op1->uc ^ value2);
7465 exp->expType = op1->type;
7467 op1->type->refCount++;
7472 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7474 int value2 = op2->i;
7477 exp->string = PrintInt(op1->i << value2);
7480 exp->expType = op1->type;
7482 op1->type->refCount++;
7487 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7489 unsigned int value2 = op2->ui;
7492 exp->string = PrintUInt(op1->ui << value2);
7495 exp->expType = op1->type;
7497 op1->type->refCount++;
7502 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7504 short value2 = op2->s;
7507 exp->string = PrintShort(op1->s << value2);
7510 exp->expType = op1->type;
7512 op1->type->refCount++;
7517 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7519 unsigned short value2 = op2->us;
7522 exp->string = PrintUShort(op1->us << value2);
7525 exp->expType = op1->type;
7527 op1->type->refCount++;
7532 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7534 char value2 = op2->c;
7537 exp->string = PrintChar(op1->c << value2);
7540 exp->expType = op1->type;
7542 op1->type->refCount++;
7547 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7549 unsigned char value2 = op2->uc;
7552 exp->string = PrintUChar(op1->uc << value2);
7555 exp->expType = op1->type;
7557 op1->type->refCount++;
7562 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7564 int value2 = op2->i;
7567 exp->string = PrintInt(op1->i >> value2);
7570 exp->expType = op1->type;
7572 op1->type->refCount++;
7577 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7579 unsigned int value2 = op2->ui;
7582 exp->string = PrintUInt(op1->ui >> value2);
7585 exp->expType = op1->type;
7587 op1->type->refCount++;
7592 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7594 short value2 = op2->s;
7597 exp->string = PrintShort(op1->s >> value2);
7600 exp->expType = op1->type;
7602 op1->type->refCount++;
7607 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7609 unsigned short value2 = op2->us;
7612 exp->string = PrintUShort(op1->us >> value2);
7615 exp->expType = op1->type;
7617 op1->type->refCount++;
7622 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7624 char value2 = op2->c;
7627 exp->string = PrintChar(op1->c >> value2);
7630 exp->expType = op1->type;
7632 op1->type->refCount++;
7637 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7639 unsigned char value2 = op2->uc;
7642 exp->string = PrintUChar(op1->uc >> value2);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7655 exp->string = PrintInt((~op1->i));
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7668 exp->string = PrintUInt((unsigned int)(~op1->ui));
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7681 exp->string = PrintShort((short)(~op1->s));
7684 exp->expType = op1->type;
7686 op1->type->refCount++;
7691 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7694 exp->string = PrintUShort((unsigned short)(~op1->us));
7697 exp->expType = op1->type;
7699 op1->type->refCount++;
7704 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7707 exp->string = PrintChar((char)(~op1->c));
7710 exp->expType = op1->type;
7712 op1->type->refCount++;
7717 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7720 exp->string = PrintUChar((unsigned char)(~op1->uc));
7723 exp->expType = op1->type;
7725 op1->type->refCount++;
7730 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7732 int value2 = op2->i;
7735 exp->string = PrintInt(op1->i &= value2);
7738 exp->expType = op1->type;
7740 op1->type->refCount++;
7745 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7747 unsigned int value2 = op2->ui;
7750 exp->string = PrintUInt(op1->ui &= value2);
7753 exp->expType = op1->type;
7755 op1->type->refCount++;
7760 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7762 short value2 = op2->s;
7765 exp->string = PrintShort(op1->s &= value2);
7768 exp->expType = op1->type;
7770 op1->type->refCount++;
7775 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7777 unsigned short value2 = op2->us;
7780 exp->string = PrintUShort(op1->us &= value2);
7783 exp->expType = op1->type;
7785 op1->type->refCount++;
7790 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7792 char value2 = op2->c;
7795 exp->string = PrintChar(op1->c &= value2);
7798 exp->expType = op1->type;
7800 op1->type->refCount++;
7805 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7807 unsigned char value2 = op2->uc;
7810 exp->string = PrintUChar(op1->uc &= value2);
7813 exp->expType = op1->type;
7815 op1->type->refCount++;
7820 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7822 int value2 = op2->i;
7825 exp->string = PrintInt(op1->i |= value2);
7828 exp->expType = op1->type;
7830 op1->type->refCount++;
7835 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7837 unsigned int value2 = op2->ui;
7840 exp->string = PrintUInt(op1->ui |= value2);
7843 exp->expType = op1->type;
7845 op1->type->refCount++;
7850 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7852 short value2 = op2->s;
7855 exp->string = PrintShort(op1->s |= value2);
7858 exp->expType = op1->type;
7860 op1->type->refCount++;
7865 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7867 unsigned short value2 = op2->us;
7870 exp->string = PrintUShort(op1->us |= value2);
7873 exp->expType = op1->type;
7875 op1->type->refCount++;
7880 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7882 char value2 = op2->c;
7885 exp->string = PrintChar(op1->c |= value2);
7888 exp->expType = op1->type;
7890 op1->type->refCount++;
7895 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7897 unsigned char value2 = op2->uc;
7900 exp->string = PrintUChar(op1->uc |= value2);
7903 exp->expType = op1->type;
7905 op1->type->refCount++;
7910 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7912 int value2 = op2->i;
7915 exp->string = PrintInt(op1->i ^= value2);
7918 exp->expType = op1->type;
7920 op1->type->refCount++;
7925 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7927 unsigned int value2 = op2->ui;
7930 exp->string = PrintUInt(op1->ui ^= value2);
7933 exp->expType = op1->type;
7935 op1->type->refCount++;
7940 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7942 short value2 = op2->s;
7945 exp->string = PrintShort(op1->s ^= value2);
7948 exp->expType = op1->type;
7950 op1->type->refCount++;
7955 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7957 unsigned short value2 = op2->us;
7960 exp->string = PrintUShort(op1->us ^= value2);
7963 exp->expType = op1->type;
7965 op1->type->refCount++;
7970 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7972 char value2 = op2->c;
7975 exp->string = PrintChar(op1->c ^= value2);
7978 exp->expType = op1->type;
7980 op1->type->refCount++;
7985 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7987 unsigned char value2 = op2->uc;
7990 exp->string = PrintUChar(op1->uc ^= value2);
7993 exp->expType = op1->type;
7995 op1->type->refCount++;
8000 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8002 int value2 = op2->i;
8005 exp->string = PrintInt(op1->i <<= value2);
8008 exp->expType = op1->type;
8010 op1->type->refCount++;
8015 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8017 unsigned int value2 = op2->ui;
8020 exp->string = PrintUInt(op1->ui <<= value2);
8023 exp->expType = op1->type;
8025 op1->type->refCount++;
8030 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 short value2 = op2->s;
8035 exp->string = PrintShort(op1->s <<= value2);
8038 exp->expType = op1->type;
8040 op1->type->refCount++;
8045 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 unsigned short value2 = op2->us;
8050 exp->string = PrintUShort(op1->us <<= value2);
8053 exp->expType = op1->type;
8055 op1->type->refCount++;
8060 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 char value2 = op2->c;
8065 exp->string = PrintChar(op1->c <<= value2);
8068 exp->expType = op1->type;
8070 op1->type->refCount++;
8075 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 unsigned char value2 = op2->uc;
8080 exp->string = PrintUChar(op1->uc <<= value2);
8083 exp->expType = op1->type;
8085 op1->type->refCount++;
8090 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 int value2 = op2->i;
8095 exp->string = PrintInt(op1->i >>= value2);
8098 exp->expType = op1->type;
8100 op1->type->refCount++;
8105 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 unsigned int value2 = op2->ui;
8110 exp->string = PrintUInt(op1->ui >>= value2);
8113 exp->expType = op1->type;
8115 op1->type->refCount++;
8120 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 short value2 = op2->s;
8125 exp->string = PrintShort(op1->s >>= value2);
8128 exp->expType = op1->type;
8130 op1->type->refCount++;
8135 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 unsigned short value2 = op2->us;
8140 exp->string = PrintUShort(op1->us >>= value2);
8143 exp->expType = op1->type;
8145 op1->type->refCount++;
8150 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 char value2 = op2->c;
8155 exp->string = PrintChar(op1->c >>= value2);
8158 exp->expType = op1->type;
8160 op1->type->refCount++;
8165 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 unsigned char value2 = op2->uc;
8170 exp->string = PrintUChar(op1->uc >>= value2);
8173 exp->expType = op1->type;
8175 op1->type->refCount++;
8180 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8183 exp->string = PrintInt((int)(!op1->i));
8186 exp->expType = op1->type;
8188 op1->type->refCount++;
8193 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8196 exp->string = PrintUInt((unsigned int)(!op1->ui));
8199 exp->expType = op1->type;
8201 op1->type->refCount++;
8206 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8209 exp->string = PrintShort((short)(!op1->s));
8212 exp->expType = op1->type;
8214 op1->type->refCount++;
8219 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8222 exp->string = PrintUShort((unsigned short)(!op1->us));
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8235 exp->string = PrintChar((char)(!op1->c));
8238 exp->expType = op1->type;
8240 op1->type->refCount++;
8245 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8248 exp->string = PrintUChar((unsigned char)(!op1->uc));
8251 exp->expType = op1->type;
8253 op1->type->refCount++;
8258 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8260 int value2 = op2->i;
8263 exp->string = PrintInt(op1->i == value2);
8266 exp->expType = op1->type;
8268 op1->type->refCount++;
8273 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8275 unsigned int value2 = op2->ui;
8278 exp->string = PrintUInt(op1->ui == value2);
8281 exp->expType = op1->type;
8283 op1->type->refCount++;
8288 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8290 short value2 = op2->s;
8293 exp->string = PrintShort(op1->s == value2);
8296 exp->expType = op1->type;
8298 op1->type->refCount++;
8303 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8305 unsigned short value2 = op2->us;
8308 exp->string = PrintUShort(op1->us == value2);
8311 exp->expType = op1->type;
8313 op1->type->refCount++;
8318 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8320 char value2 = op2->c;
8323 exp->string = PrintChar(op1->c == value2);
8326 exp->expType = op1->type;
8328 op1->type->refCount++;
8333 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8335 unsigned char value2 = op2->uc;
8338 exp->string = PrintUChar(op1->uc == value2);
8341 exp->expType = op1->type;
8343 op1->type->refCount++;
8348 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8350 float value2 = op2->f;
8353 exp->string = PrintFloat(op1->f == value2);
8356 exp->expType = op1->type;
8358 op1->type->refCount++;
8363 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8365 double value2 = op2->d;
8368 exp->string = PrintDouble(op1->d == value2);
8371 exp->expType = op1->type;
8373 op1->type->refCount++;
8378 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8380 int value2 = op2->i;
8383 exp->string = PrintInt(op1->i != value2);
8386 exp->expType = op1->type;
8388 op1->type->refCount++;
8393 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8395 unsigned int value2 = op2->ui;
8398 exp->string = PrintUInt(op1->ui != value2);
8401 exp->expType = op1->type;
8403 op1->type->refCount++;
8408 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8410 short value2 = op2->s;
8413 exp->string = PrintShort(op1->s != value2);
8416 exp->expType = op1->type;
8418 op1->type->refCount++;
8423 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8425 unsigned short value2 = op2->us;
8428 exp->string = PrintUShort(op1->us != value2);
8431 exp->expType = op1->type;
8433 op1->type->refCount++;
8438 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8440 char value2 = op2->c;
8443 exp->string = PrintChar(op1->c != value2);
8446 exp->expType = op1->type;
8448 op1->type->refCount++;
8453 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8455 unsigned char value2 = op2->uc;
8458 exp->string = PrintUChar(op1->uc != value2);
8461 exp->expType = op1->type;
8463 op1->type->refCount++;
8468 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8470 float value2 = op2->f;
8473 exp->string = PrintFloat(op1->f != value2);
8476 exp->expType = op1->type;
8478 op1->type->refCount++;
8483 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8485 double value2 = op2->d;
8488 exp->string = PrintDouble(op1->d != value2);
8491 exp->expType = op1->type;
8493 op1->type->refCount++;
8498 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8500 int value2 = op2->i;
8503 exp->string = PrintInt(op1->i && value2);
8506 exp->expType = op1->type;
8508 op1->type->refCount++;
8513 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8515 unsigned int value2 = op2->ui;
8518 exp->string = PrintUInt(op1->ui && value2);
8521 exp->expType = op1->type;
8523 op1->type->refCount++;
8528 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8530 short value2 = op2->s;
8533 exp->string = PrintShort(op1->s && value2);
8536 exp->expType = op1->type;
8538 op1->type->refCount++;
8543 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8545 unsigned short value2 = op2->us;
8548 exp->string = PrintUShort(op1->us && value2);
8551 exp->expType = op1->type;
8553 op1->type->refCount++;
8558 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8560 char value2 = op2->c;
8563 exp->string = PrintChar(op1->c && value2);
8566 exp->expType = op1->type;
8568 op1->type->refCount++;
8573 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8575 unsigned char value2 = op2->uc;
8578 exp->string = PrintUChar(op1->uc && value2);
8581 exp->expType = op1->type;
8583 op1->type->refCount++;
8588 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8590 float value2 = op2->f;
8593 exp->string = PrintFloat(op1->f && value2);
8596 exp->expType = op1->type;
8598 op1->type->refCount++;
8603 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8605 double value2 = op2->d;
8608 exp->string = PrintDouble(op1->d && value2);
8611 exp->expType = op1->type;
8613 op1->type->refCount++;
8618 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8620 int value2 = op2->i;
8623 exp->string = PrintInt(op1->i || value2);
8626 exp->expType = op1->type;
8628 op1->type->refCount++;
8633 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8635 unsigned int value2 = op2->ui;
8638 exp->string = PrintUInt(op1->ui || value2);
8641 exp->expType = op1->type;
8643 op1->type->refCount++;
8648 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8650 short value2 = op2->s;
8653 exp->string = PrintShort(op1->s || value2);
8656 exp->expType = op1->type;
8658 op1->type->refCount++;
8663 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8665 unsigned short value2 = op2->us;
8668 exp->string = PrintUShort(op1->us || value2);
8671 exp->expType = op1->type;
8673 op1->type->refCount++;
8678 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8680 char value2 = op2->c;
8683 exp->string = PrintChar(op1->c || value2);
8686 exp->expType = op1->type;
8688 op1->type->refCount++;
8693 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8695 unsigned char value2 = op2->uc;
8698 exp->string = PrintUChar(op1->uc || value2);
8701 exp->expType = op1->type;
8703 op1->type->refCount++;
8708 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8710 float value2 = op2->f;
8713 exp->string = PrintFloat(op1->f || value2);
8716 exp->expType = op1->type;
8718 op1->type->refCount++;
8723 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8725 double value2 = op2->d;
8728 exp->string = PrintDouble(op1->d || value2);
8731 exp->expType = op1->type;
8733 op1->type->refCount++;
8738 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8740 int value2 = op2->i;
8743 exp->string = PrintInt(op1->i > value2);
8746 exp->expType = op1->type;
8748 op1->type->refCount++;
8753 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8755 unsigned int value2 = op2->ui;
8758 exp->string = PrintUInt(op1->ui > value2);
8761 exp->expType = op1->type;
8763 op1->type->refCount++;
8768 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8770 short value2 = op2->s;
8773 exp->string = PrintShort(op1->s > value2);
8776 exp->expType = op1->type;
8778 op1->type->refCount++;
8783 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8785 unsigned short value2 = op2->us;
8788 exp->string = PrintUShort(op1->us > value2);
8791 exp->expType = op1->type;
8793 op1->type->refCount++;
8798 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8800 char value2 = op2->c;
8803 exp->string = PrintChar(op1->c > value2);
8806 exp->expType = op1->type;
8808 op1->type->refCount++;
8813 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8815 unsigned char value2 = op2->uc;
8818 exp->string = PrintUChar(op1->uc > value2);
8821 exp->expType = op1->type;
8823 op1->type->refCount++;
8828 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8830 float value2 = op2->f;
8833 exp->string = PrintFloat(op1->f > value2);
8836 exp->expType = op1->type;
8838 op1->type->refCount++;
8843 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8845 double value2 = op2->d;
8848 exp->string = PrintDouble(op1->d > value2);
8851 exp->expType = op1->type;
8853 op1->type->refCount++;
8858 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8860 int value2 = op2->i;
8863 exp->string = PrintInt(op1->i < value2);
8866 exp->expType = op1->type;
8868 op1->type->refCount++;
8873 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8875 unsigned int value2 = op2->ui;
8878 exp->string = PrintUInt(op1->ui < value2);
8881 exp->expType = op1->type;
8883 op1->type->refCount++;
8888 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8890 short value2 = op2->s;
8893 exp->string = PrintShort(op1->s < value2);
8896 exp->expType = op1->type;
8898 op1->type->refCount++;
8903 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8905 unsigned short value2 = op2->us;
8908 exp->string = PrintUShort(op1->us < value2);
8911 exp->expType = op1->type;
8913 op1->type->refCount++;
8918 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8920 char value2 = op2->c;
8923 exp->string = PrintChar(op1->c < value2);
8926 exp->expType = op1->type;
8928 op1->type->refCount++;
8933 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8935 unsigned char value2 = op2->uc;
8938 exp->string = PrintUChar(op1->uc < value2);
8941 exp->expType = op1->type;
8943 op1->type->refCount++;
8948 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8950 float value2 = op2->f;
8953 exp->string = PrintFloat(op1->f < value2);
8956 exp->expType = op1->type;
8958 op1->type->refCount++;
8963 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8965 double value2 = op2->d;
8968 exp->string = PrintDouble(op1->d < value2);
8971 exp->expType = op1->type;
8973 op1->type->refCount++;
8978 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8980 int value2 = op2->i;
8983 exp->string = PrintInt(op1->i >= value2);
8986 exp->expType = op1->type;
8988 op1->type->refCount++;
8993 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8995 unsigned int value2 = op2->ui;
8998 exp->string = PrintUInt(op1->ui >= value2);
9001 exp->expType = op1->type;
9003 op1->type->refCount++;
9008 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9010 short value2 = op2->s;
9013 exp->string = PrintShort(op1->s >= value2);
9016 exp->expType = op1->type;
9018 op1->type->refCount++;
9023 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9025 unsigned short value2 = op2->us;
9028 exp->string = PrintUShort(op1->us >= value2);
9031 exp->expType = op1->type;
9033 op1->type->refCount++;
9038 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9040 char value2 = op2->c;
9043 exp->string = PrintChar(op1->c >= value2);
9046 exp->expType = op1->type;
9048 op1->type->refCount++;
9053 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9055 unsigned char value2 = op2->uc;
9058 exp->string = PrintUChar(op1->uc >= value2);
9061 exp->expType = op1->type;
9063 op1->type->refCount++;
9068 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9070 float value2 = op2->f;
9073 exp->string = PrintFloat(op1->f >= value2);
9076 exp->expType = op1->type;
9078 op1->type->refCount++;
9083 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9085 double value2 = op2->d;
9088 exp->string = PrintDouble(op1->d >= value2);
9091 exp->expType = op1->type;
9093 op1->type->refCount++;
9098 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9100 int value2 = op2->i;
9103 exp->string = PrintInt(op1->i <= value2);
9106 exp->expType = op1->type;
9108 op1->type->refCount++;
9113 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9115 unsigned int value2 = op2->ui;
9118 exp->string = PrintUInt(op1->ui <= value2);
9121 exp->expType = op1->type;
9123 op1->type->refCount++;
9128 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9130 short value2 = op2->s;
9133 exp->string = PrintShort(op1->s <= value2);
9136 exp->expType = op1->type;
9138 op1->type->refCount++;
9143 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9145 unsigned short value2 = op2->us;
9148 exp->string = PrintUShort(op1->us <= value2);
9151 exp->expType = op1->type;
9153 op1->type->refCount++;
9158 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9160 char value2 = op2->c;
9163 exp->string = PrintChar(op1->c <= value2);
9166 exp->expType = op1->type;
9168 op1->type->refCount++;
9173 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9175 unsigned char value2 = op2->uc;
9178 exp->string = PrintUChar(op1->uc <= value2);
9181 exp->expType = op1->type;
9183 op1->type->refCount++;
9188 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9190 float value2 = op2->f;
9193 exp->string = PrintFloat(op1->f <= value2);
9196 exp->expType = op1->type;
9198 op1->type->refCount++;
9203 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9205 double value2 = op2->d;
9208 exp->string = PrintDouble(op1->d <= value2);
9211 exp->expType = op1->type;
9213 op1->type->refCount++;
9218 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9221 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9224 exp->expType = op1->type;
9226 op1->type->refCount++;
9231 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9234 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9237 exp->expType = op1->type;
9239 op1->type->refCount++;
9244 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9247 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9250 exp->expType = op1->type;
9252 op1->type->refCount++;
9257 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9260 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9263 exp->expType = op1->type;
9265 op1->type->refCount++;
9270 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9273 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9276 exp->expType = op1->type;
9278 op1->type->refCount++;
9283 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9286 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9289 exp->expType = op1->type;
9291 op1->type->refCount++;
9296 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9299 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9302 exp->expType = op1->type;
9304 op1->type->refCount++;
9309 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9312 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9315 exp->expType = op1->type;
9317 op1->type->refCount++;
9322 struct OpTable intOps =
9324 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
9327 struct OpTable uintOps =
9329 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
9332 struct OpTable shortOps =
9334 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
9337 struct OpTable ushortOps =
9339 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
9342 struct OpTable floatOps =
9344 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
9347 struct OpTable doubleOps =
9349 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
9352 struct OpTable charOps =
9354 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
9357 struct OpTable ucharOps =
9359 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
9362 void ReadString(char * output, char * string)
9364 int len = strlen(string);
9366 unsigned int quoted = 0x0, escaped = 0x0;
9368 for(c = 0; c < len; c++)
9370 char ch = string[c];
9426 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9428 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9430 extern double strtod(char * , char * * );
9432 struct Operand GetOperand(struct Expression * exp)
9438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9441 struct Type * type = exp->expType;
9445 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9447 if(!type->_class->registered->dataType)
9448 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9449 type = type->_class->registered->dataType;
9451 op.kind = type->kind;
9452 op.type = exp->expType;
9453 if(exp->isConstant && exp->type == 2)
9459 if(exp->constant[0] == '\'')
9460 op.c = exp->constant[1];
9461 else if(type->isSigned)
9463 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9468 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9476 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9481 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9489 op.i = strtol(exp->constant, (((void *)0)), 0);
9494 op.ui = strtoul(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);
9528 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9533 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9539 op.f = (float)strtod(exp->constant, (((void *)0)));
9543 op.d = (double)strtod(exp->constant, (((void *)0)));
9549 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9559 int __ecereVMethodID_class_OnGetString;
9561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9563 static void UnusedFunction()
9567 ((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);
9570 extern int __ecereVMethodID_class_OnGetString;
9572 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9574 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9576 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9578 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9579 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9582 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9583 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9585 void * ptr = inst->data + dataMember->offset + offset;
9586 char * result = (((void *)0));
9588 exp->loc = member->loc = inst->loc;
9589 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9590 if(!dataMember->dataType)
9591 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9592 type = dataMember->dataType;
9595 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9597 if(_class->type == 4)
9599 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9603 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9604 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9606 for(item = e->values.first; item; item = item->next)
9608 if((int)item->data == *(int *)ptr)
9610 result = item->name;
9616 exp->identifier = MkIdentifier(result);
9618 exp->destType = MkClassType(_class->fullName);
9619 ProcessExpressionType(exp);
9623 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9625 if(!_class->dataType)
9626 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9627 type = _class->dataType;
9636 FreeExpContents(exp);
9637 exp->constant = PrintFloat(*(float *)ptr);
9643 FreeExpContents(exp);
9644 exp->constant = PrintDouble(*(double *)ptr);
9650 FreeExpContents(exp);
9651 exp->constant = PrintInt(*(int *)ptr);
9657 FreeExpContents(exp);
9658 exp->constant = PrintInt64(*(long long *)ptr);
9664 FreeExpContents(exp);
9665 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9671 FreeExpContents(exp);
9672 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9677 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9680 ListAdd(memberList, member);
9682 if(parentDataMember->type == 1)
9687 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9689 void PopulateInstance(struct Instantiation * inst)
9691 struct Symbol * classSym = inst->_class->symbol;
9692 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9693 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9694 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9697 inst->members = MkListOne(MkMembersInitList(memberList));
9699 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
9700 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9702 if(!dataMember->isProperty)
9704 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9705 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9708 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9709 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9711 void * ptr = inst->data + dataMember->offset;
9712 char * result = (((void *)0));
9714 exp->loc = member->loc = inst->loc;
9715 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9716 if(!dataMember->dataType)
9717 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9718 type = dataMember->dataType;
9721 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9723 if(_class->type == 4)
9725 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9729 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9730 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9732 for(item = e->values.first; item; item = item->next)
9734 if((int)item->data == *(int *)ptr)
9736 result = item->name;
9743 exp->identifier = MkIdentifier(result);
9745 exp->destType = MkClassType(_class->fullName);
9746 ProcessExpressionType(exp);
9749 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9751 if(!_class->dataType)
9752 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9753 type = _class->dataType;
9762 exp->constant = PrintFloat(*(float *)ptr);
9768 exp->constant = PrintDouble(*(double *)ptr);
9774 exp->constant = PrintInt(*(int *)ptr);
9780 exp->constant = PrintInt64(*(long long *)ptr);
9786 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9794 ListAdd(memberList, member);
9800 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);
9802 extern void FreeInstance(struct Instantiation * inst);
9804 void ComputeInstantiation(struct Expression * exp)
9806 struct Instantiation * inst = exp->instance;
9807 struct MembersInit * members;
9808 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9809 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9810 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9811 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9812 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9813 int subMemberStackPos = 0;
9816 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9820 if(_class->type == 0 || _class->type == 5)
9822 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9823 if(_class->type == 0)
9824 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
9827 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9831 for(members = (*inst->members).first; members; members = members->next)
9833 switch(members->type)
9837 if(members->dataMembers)
9839 struct MemberInit * member;
9841 for(member = (*members->dataMembers).first; member; member = member->next)
9843 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9844 unsigned int found = 0x0;
9845 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9846 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9847 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9848 unsigned int dataMemberOffset;
9852 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9855 if(curMember->isProperty)
9856 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9859 dataMember = curMember;
9860 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9861 if(_class->type == 0)
9862 dataMemberOffset += _class->base->structSize;
9869 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9873 if(prop->memberAccess == 1)
9875 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9876 curClass = prop->_class;
9881 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9882 int _subMemberStackPos = 0;
9884 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9888 if(dataMember->memberAccess == 1)
9890 curMember = dataMember;
9891 curClass = dataMember->_class;
9892 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
9893 subMemberStackPos = _subMemberStackPos;
9898 if(found && member->initializer && member->initializer->type == 0)
9900 struct Expression * value = member->initializer->exp;
9901 struct Type * type = (((void *)0));
9902 unsigned int deepMember = 0x0;
9906 type = prop->dataType;
9910 if(!dataMember->dataType)
9911 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9912 type = dataMember->dataType;
9914 if(ident && ident->next)
9917 for(ident = ident->next; ident && type; ident = ident->next)
9921 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9923 type = prop->dataType;
9926 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9928 type = dataMember->dataType;
9931 else if(type->kind == 9 || type->kind == 10)
9933 struct Type * memberType;
9935 for(memberType = type->members.first; memberType; memberType = memberType->next)
9937 if(!strcmp(memberType->name, ident->string))
9948 FreeType(value->destType);
9949 value->destType = type;
9952 ComputeExpression(value);
9954 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9958 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9960 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9962 if(!_class->dataType)
9963 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9964 type = _class->dataType;
9969 void * ptr = inst->data + dataMemberOffset;
9971 if(value->type == 2)
9977 GetInt(value, (int *)ptr);
9982 GetInt64(value, (long long *)ptr);
9987 GetIntPtr(value, (intptr_t *)ptr);
9992 GetIntSize(value, (ssize_t *)ptr);
9997 GetFloat(value, (float *)ptr);
10002 GetDouble(value, (double *)ptr);
10007 else if(value->type == 1)
10009 if(type->kind == 8)
10011 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10013 if(_class->type == 1)
10015 ComputeTypeSize(type);
10016 if(value->instance->data)
10017 memcpy(ptr, value->instance->data, type->size);
10024 if(value->type == 1 && value->instance->data)
10026 if(type->kind == 8)
10028 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10030 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)))
10032 void (* Set)(void *, void *) = (void *)prop->Set;
10034 Set(inst->data, value->instance->data);
10035 PopulateInstance(inst);
10039 else if(value->type == 2)
10045 void (* Set)(void *, double) = (void *)prop->Set;
10047 Set(inst->data, strtod(value->constant, (((void *)0))));
10052 void (* Set)(void *, float) = (void *)prop->Set;
10054 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10059 void (* Set)(void *, int) = (void *)prop->Set;
10061 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10066 void (* Set)(void *, long long) = (void *)prop->Set;
10068 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10073 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10075 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10080 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10082 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10087 else if(value->type == 3)
10091 ReadString(temp, value->string);
10092 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10096 else if(!deepMember && type && _class->type == 3)
10100 if(value->type == 2)
10102 if(type->kind == 8)
10104 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10106 if(_class->type == 3)
10108 if(!_class->dataType)
10109 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10110 type = _class->dataType;
10118 float (* Set)(float) = (void *)prop->Set;
10120 GetFloat(member->initializer->exp, &fValue);
10121 exp->constant = PrintFloat(Set(fValue));
10128 double (* Set)(double) = (void *)prop->Set;
10130 GetDouble(member->initializer->exp, &dValue);
10131 exp->constant = PrintDouble(Set(dValue));
10139 else if(!deepMember && type && _class->type == 2)
10143 if(value->type == 1 && value->instance->data)
10145 unsigned int (* Set)(void *) = (void *)prop->Set;
10147 bits = Set(value->instance->data);
10149 else if(value->type == 2)
10153 else if(dataMember)
10155 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10156 struct Type * type;
10159 GetInt(value, &part);
10160 bits = (bits & ~bitMember->mask);
10161 if(!bitMember->dataType)
10162 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10163 type = bitMember->dataType;
10164 if(type->kind == 8 && type->_class && type->_class->registered)
10166 if(!type->_class->registered->dataType)
10167 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10168 type = type->_class->registered->dataType;
10174 bits |= ((char)part << bitMember->pos);
10176 bits |= ((unsigned char)part << bitMember->pos);
10180 bits |= ((short)part << bitMember->pos);
10182 bits |= ((unsigned short)part << bitMember->pos);
10187 bits |= (part << bitMember->pos);
10189 bits |= ((unsigned int)part << bitMember->pos);
10193 bits |= ((long long)part << bitMember->pos);
10195 bits |= ((uint64)part << bitMember->pos);
10200 bits |= ((intptr_t)part << bitMember->pos);
10204 bits |= ((uintptr_t)part << bitMember->pos);
10210 bits |= ((ssize_t)part << bitMember->pos);
10214 bits |= ((size_t)part << bitMember->pos);
10223 if(_class && _class->type == 3)
10225 ComputeExpression(member->initializer->exp);
10226 exp->constant = member->initializer->exp->constant;
10228 member->initializer->exp->constant = (((void *)0));
10238 if(_class && _class->type == 2)
10240 exp->constant = PrintHexUInt(bits);
10245 FreeInstance(inst);
10249 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10251 if(exp->op.op == SIZEOF)
10253 FreeExpContents(exp);
10255 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10265 struct Expression * exp2 = exp->op.exp2;
10267 exp->op.exp2 = (((void *)0));
10268 FreeExpContents(exp);
10269 FreeType(exp->expType);
10270 FreeType(exp->destType);
10272 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10278 FreeExpContents(exp);
10279 op1->ops.Neg(exp, op1);
10283 if(op1->ops.BitNot)
10285 FreeExpContents(exp);
10286 op1->ops.BitNot(exp, op1);
10292 FreeExpContents(exp);
10293 op1->ops.Not(exp, op1);
10305 FreeExpContents(exp);
10306 op1->ops.Add(exp, op1, op2);
10312 FreeExpContents(exp);
10313 op1->ops.Sub(exp, op1, op2);
10319 FreeExpContents(exp);
10320 op1->ops.Mul(exp, op1, op2);
10326 FreeExpContents(exp);
10327 op1->ops.Div(exp, op1, op2);
10333 FreeExpContents(exp);
10334 op1->ops.Mod(exp, op1, op2);
10340 if(op1->ops.BitAnd)
10342 FreeExpContents(exp);
10343 op1->ops.BitAnd(exp, op1, op2);
10350 FreeExpContents(exp);
10351 op1->ops.BitOr(exp, op1, op2);
10355 if(op1->ops.BitXor)
10357 FreeExpContents(exp);
10358 op1->ops.BitXor(exp, op1, op2);
10362 if(op1->ops.LShift)
10364 FreeExpContents(exp);
10365 op1->ops.LShift(exp, op1, op2);
10369 if(op1->ops.RShift)
10371 FreeExpContents(exp);
10372 op1->ops.RShift(exp, op1, op2);
10378 FreeExpContents(exp);
10379 op1->ops.Equ(exp, op1, op2);
10385 FreeExpContents(exp);
10386 op1->ops.Nqu(exp, op1, op2);
10392 FreeExpContents(exp);
10393 op1->ops.And(exp, op1, op2);
10399 FreeExpContents(exp);
10400 op1->ops.Or(exp, op1, op2);
10406 FreeExpContents(exp);
10407 op1->ops.Grt(exp, op1, op2);
10413 FreeExpContents(exp);
10414 op1->ops.Sma(exp, op1, op2);
10418 if(op1->ops.GrtEqu)
10420 FreeExpContents(exp);
10421 op1->ops.GrtEqu(exp, op1, op2);
10425 if(op1->ops.SmaEqu)
10427 FreeExpContents(exp);
10428 op1->ops.SmaEqu(exp, op1, op2);
10436 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
10438 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10440 void ComputeExpression(struct Expression * exp)
10442 char expString[10240];
10444 expString[0] = '\0';
10449 ComputeInstantiation(exp);
10454 struct Expression * exp1, * exp2 = (((void *)0));
10455 struct Operand op1 =
10459 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10462 struct Operand op2 =
10466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10471 ComputeExpression(exp->op.exp2);
10474 ComputeExpression(exp->op.exp1);
10475 exp1 = exp->op.exp1;
10476 exp2 = exp->op.exp2;
10477 op1 = GetOperand(exp1);
10479 op1.type->refCount++;
10482 op2 = GetOperand(exp2);
10484 op2.type->refCount++;
10489 exp1 = exp->op.exp2;
10490 op1 = GetOperand(exp1);
10492 op1.type->refCount++;
10494 CallOperator(exp, exp1, exp2, &op1, &op2);
10496 FreeType(op1.type);
10498 FreeType(op2.type);
10504 struct Expression * e, * n;
10506 for(e = (*exp->list).first; e; e = n)
10511 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10513 ComputeExpression(e);
10514 FreeType(exp->expType);
10515 FreeType(exp->destType);
10517 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10518 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10529 struct Expression * memberExp = exp->member.exp;
10530 struct Identifier * memberID = exp->member.member;
10531 struct Type * type;
10533 ComputeExpression(exp->member.exp);
10534 type = exp->member.exp->expType;
10537 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)));
10538 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10539 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10540 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10542 if(type->kind == 19 && exp->member.exp->type == 26)
10543 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10547 struct Symbol * classSym;
10550 PrintTypeNoConst(type, string, 0x0, 0x1);
10551 classSym = FindClass(string);
10552 _class = classSym ? classSym->registered : (((void *)0));
10554 if(exp->member.member)
10556 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10558 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10560 if(!prop && !member && _class && exp->member.member)
10562 struct Symbol * classSym = FindClass(exp->member.member->string);
10564 convertTo = _class;
10565 _class = classSym ? classSym->registered : (((void *)0));
10566 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10572 struct Type * type = prop->dataType;
10574 if(_class->type == 3)
10576 if(type->kind == 8)
10578 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10580 if(_class->type == 3)
10582 if(!_class->dataType)
10583 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10584 type = _class->dataType;
10592 float (* Get)(float) = (void *)prop->Get;
10594 GetFloat(exp->member.exp, &value);
10595 exp->constant = PrintFloat(Get ? Get(value) : value);
10602 double (* Get)(double);
10604 GetDouble(exp->member.exp, &value);
10606 Get = (void *)prop->Set;
10608 Get = (void *)prop->Get;
10609 exp->constant = PrintDouble(Get ? Get(value) : value);
10619 struct Expression * value = exp->member.exp;
10620 struct Type * type;
10622 if(!prop->dataType)
10623 ProcessPropertyType(prop);
10624 type = prop->dataType;
10628 else if(_class->type == 1)
10634 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10636 if(propertyClass->type == 1 && value->type == 1)
10638 void (* Set)(void *, void *) = (void *)prop->Set;
10640 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10641 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10642 exp->instance->_class = MkSpecifierName(_class->fullName);
10643 exp->instance->loc = exp->loc;
10645 Set(exp->instance->data, value->instance->data);
10646 PopulateInstance(exp->instance);
10653 void (* Set)(void *, int) = (void *)prop->Set;
10655 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10656 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10657 exp->instance->_class = MkSpecifierName(_class->fullName);
10658 exp->instance->loc = exp->loc;
10660 GetInt(value, &intValue);
10661 Set(exp->instance->data, intValue);
10662 PopulateInstance(exp->instance);
10667 long long intValue;
10668 void (* Set)(void *, long long) = (void *)prop->Set;
10670 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10671 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10672 exp->instance->_class = MkSpecifierName(_class->fullName);
10673 exp->instance->loc = exp->loc;
10675 GetInt64(value, &intValue);
10676 Set(exp->instance->data, intValue);
10677 PopulateInstance(exp->instance);
10683 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10685 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10686 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10687 exp->instance->_class = MkSpecifierName(_class->fullName);
10688 exp->instance->loc = exp->loc;
10690 GetIntPtr(value, &intValue);
10691 Set(exp->instance->data, intValue);
10692 PopulateInstance(exp->instance);
10698 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10700 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10701 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10702 exp->instance->_class = MkSpecifierName(_class->fullName);
10703 exp->instance->loc = exp->loc;
10705 GetIntSize(value, &intValue);
10706 Set(exp->instance->data, intValue);
10707 PopulateInstance(exp->instance);
10712 double doubleValue;
10713 void (* Set)(void *, double) = (void *)prop->Set;
10715 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10716 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10717 exp->instance->_class = MkSpecifierName(_class->fullName);
10718 exp->instance->loc = exp->loc;
10720 GetDouble(value, &doubleValue);
10721 Set(exp->instance->data, doubleValue);
10722 PopulateInstance(exp->instance);
10727 else if(_class->type == 2)
10733 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10735 if(propertyClass->type == 1 && value->instance->data)
10737 unsigned int (* Set)(void *) = (void *)prop->Set;
10738 unsigned int bits = Set(value->instance->data);
10740 exp->constant = PrintHexUInt(bits);
10744 else if(_class->type == 2)
10746 unsigned int value;
10747 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10750 GetUInt(exp->member.exp, &value);
10752 exp->constant = PrintHexUInt(bits);
10761 if(_class->type == 2)
10763 unsigned int value;
10765 GetUInt(exp->member.exp, &value);
10770 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10772 if(_class->type == 1)
10774 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10776 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10777 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10778 exp->instance->_class = MkSpecifierName(_class->fullName);
10779 exp->instance->loc = exp->loc;
10781 Get(value, exp->instance->data);
10782 PopulateInstance(exp->instance);
10784 else if(_class->type == 2)
10786 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10787 uint64 bits = Get(value);
10789 exp->constant = PrintHexUInt64(bits);
10796 else if(_class->type == 1)
10798 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10804 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10806 if(_class->type == 1 && value)
10808 void (* Get)(void *, void *) = (void *)prop->Get;
10810 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10811 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10812 exp->instance->_class = MkSpecifierName(_class->fullName);
10813 exp->instance->loc = exp->loc;
10815 Get(value, exp->instance->data);
10816 PopulateInstance(exp->instance);
10827 exp->isConstant = 0x0;
10836 FreeExpression(memberExp);
10837 FreeIdentifier(memberID);
10843 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10845 FreeExpContents(exp);
10846 exp->constant = PrintUInt(ComputeTypeSize(type));
10853 struct Symbol * classSym = exp->_class->symbol;
10855 if(classSym && classSym->registered)
10857 if(classSym->registered->fixed)
10859 FreeSpecifier(exp->_class);
10860 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10865 char className[1024];
10867 strcpy(className, "__ecereClass_");
10868 FullClassNameCat(className, classSym->string, 0x1);
10869 MangleClassName(className);
10870 DeclareClass(classSym, className);
10871 FreeExpContents(exp);
10873 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10874 exp->member.member = MkIdentifier("structSize");
10881 struct Type * type;
10882 struct Expression * e = exp;
10884 if(exp->type == 11)
10887 ComputeExpression(exp->cast.exp);
10890 if(e && exp->expType)
10892 type = exp->expType;
10893 if(type->kind == 8)
10895 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10897 if(_class && (_class->type == 3 || _class->type == 2))
10899 if(!_class->dataType)
10900 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10901 type = _class->dataType;
10911 GetChar(e, &value);
10912 FreeExpContents(exp);
10913 exp->constant = PrintChar(value);
10918 unsigned char value;
10920 GetUChar(e, &value);
10921 FreeExpContents(exp);
10922 exp->constant = PrintUChar(value);
10931 GetShort(e, &value);
10932 FreeExpContents(exp);
10933 exp->constant = PrintShort(value);
10938 unsigned short value;
10940 GetUShort(e, &value);
10941 FreeExpContents(exp);
10942 exp->constant = PrintUShort(value);
10952 FreeExpContents(exp);
10953 exp->constant = PrintInt(value);
10958 unsigned int value;
10960 GetUInt(e, &value);
10961 FreeExpContents(exp);
10962 exp->constant = PrintUInt(value);
10971 GetInt64(e, &value);
10972 FreeExpContents(exp);
10973 exp->constant = PrintInt64(value);
10980 GetUInt64(e, &value);
10981 FreeExpContents(exp);
10982 exp->constant = PrintUInt64(value);
10991 GetIntPtr(e, &value);
10992 FreeExpContents(exp);
10993 exp->constant = PrintInt64((long long)value);
11000 GetUIntPtr(e, &value);
11001 FreeExpContents(exp);
11002 exp->constant = PrintUInt64((uint64)value);
11011 GetIntSize(e, &value);
11012 FreeExpContents(exp);
11013 exp->constant = PrintInt64((long long)value);
11020 GetUIntSize(e, &value);
11021 FreeExpContents(exp);
11022 exp->constant = PrintUInt64((uint64)value);
11030 GetFloat(e, &value);
11031 FreeExpContents(exp);
11032 exp->constant = PrintFloat(value);
11040 GetDouble(e, &value);
11041 FreeExpContents(exp);
11042 exp->constant = PrintDouble(value);
11052 struct Operand op1 =
11056 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11059 struct Operand op2 =
11063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11066 struct Operand op3 =
11070 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11075 ComputeExpression((*exp->cond.exp).last);
11076 if(exp->cond.elseExp)
11077 ComputeExpression(exp->cond.elseExp);
11079 ComputeExpression(exp->cond.cond);
11080 op1 = GetOperand(exp->cond.cond);
11082 op1.type->refCount++;
11083 op2 = GetOperand((*exp->cond.exp).last);
11085 op2.type->refCount++;
11086 op3 = GetOperand(exp->cond.elseExp);
11088 op3.type->refCount++;
11091 FreeExpContents(exp);
11092 op1.ops.Cond(exp, &op1, &op2, &op3);
11095 FreeType(op1.type);
11097 FreeType(op2.type);
11099 FreeType(op3.type);
11105 void ApplyAnyObjectLogic(struct Expression * e);
11107 extern void CopyTypeInto(struct Type * type, struct Type * src);
11109 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11111 unsigned int result = 0x1;
11115 struct __ecereNameSpace__ecere__sys__OldList converts =
11119 struct Conversion * convert;
11121 if(destType->kind == 0)
11123 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11127 for(convert = converts.first; convert; convert = convert->next)
11129 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11133 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11134 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11137 newExp->destType = (((void *)0));
11141 exp->addedThis = 0x1;
11142 exp->member.exp = newExp;
11143 FreeType(exp->member.exp->expType);
11144 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11145 exp->member.exp->expType->classObjectType = objectType;
11146 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11147 exp->member.memberType = 1;
11148 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11149 exp->needCast = 0x1;
11151 exp->expType->refCount++;
11152 ApplyAnyObjectLogic(exp->member.exp);
11158 exp->addedThis = 0x1;
11159 exp->member.exp = newExp;
11160 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11162 newExp->byReference = 0x1;
11164 FreeType(exp->member.exp->expType);
11165 exp->member.exp->expType = (((void *)0));
11166 if(convert->convert->dataType)
11168 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11169 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11170 exp->member.exp->expType->refCount = 1;
11171 exp->member.exp->expType->classObjectType = objectType;
11172 ApplyAnyObjectLogic(exp->member.exp);
11174 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11175 exp->member.memberType = 4;
11176 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11177 exp->needCast = 0x1;
11178 if(convert->resultType)
11179 convert->resultType->refCount++;
11185 FreeType(exp->expType);
11188 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11189 exp->needCast = 0x1;
11191 exp->expType->refCount++;
11195 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11196 exp->needCast = 0x1;
11197 if(convert->resultType)
11198 convert->resultType->refCount++;
11202 if(exp->isConstant && inCompiler)
11203 ComputeExpression(exp);
11204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11206 if(!result && exp->expType && converts.count)
11208 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11210 if(!result && exp->expType && exp->destType)
11212 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))
11219 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11221 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11223 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11225 void CheckTemplateTypes(struct Expression * exp)
11227 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11229 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11230 struct Statement * compound;
11231 struct Context * context;
11235 exp->destType->refCount++;
11237 exp->expType->refCount++;
11238 newExp->prev = (((void *)0));
11239 newExp->next = (((void *)0));
11240 switch(exp->expType->kind)
11243 if(exp->destType->classObjectType)
11246 exp->destType->refCount--;
11248 exp->expType->refCount--;
11249 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11253 struct __ecereNameSpace__ecere__sys__OldList * specs;
11254 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11255 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11257 context = PushContext();
11258 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11259 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11260 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11262 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11263 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11264 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11265 exp->compound->compound.context = context;
11266 PopContext(context);
11271 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11272 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11276 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11278 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11279 struct Statement * compound;
11280 struct Context * context;
11284 exp->destType->refCount++;
11286 exp->expType->refCount++;
11287 newExp->prev = (((void *)0));
11288 newExp->next = (((void *)0));
11289 switch(exp->expType->kind)
11292 if(exp->destType->classObjectType)
11295 exp->destType->refCount--;
11297 exp->expType->refCount--;
11298 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11302 struct __ecereNameSpace__ecere__sys__OldList * specs;
11303 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11304 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11306 context = PushContext();
11307 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11308 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11309 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11311 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11312 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11313 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11314 exp->compound->compound.context = context;
11315 PopContext(context);
11320 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11323 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11324 ProcessExpressionType((*exp->list).first);
11330 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11331 newExp->needCast = 0x1;
11332 ProcessExpressionType((*exp->list).first);
11338 if(exp->expType->kind == 20)
11340 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11344 FreeType(exp->destType);
11345 FreeType(exp->expType);
11346 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11350 if(newExp->type == 8 && newExp->member.memberType == 3)
11354 exp->op.exp1 = (((void *)0));
11355 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11359 char typeString[1024];
11360 struct Declarator * decl;
11361 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11363 typeString[0] = '\0';
11364 PrintType(exp->expType, typeString, 0x0, 0x0);
11365 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11367 exp->cast.typeName = MkTypeName(specs, decl);
11368 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11369 exp->cast.exp->needCast = 0x1;
11377 extern int strncmp(const char * , const char * , size_t n);
11379 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11381 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11383 int nsLen = strlen(nameSpace);
11384 struct Symbol * symbol;
11386 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)))
11388 char * s = symbol->string;
11390 if(!strncmp(s, nameSpace, nsLen))
11395 for(c = strlen(s) - 1; c >= 0; c--)
11398 namePart = s + c + 1;
11399 if(!strcmp(namePart, name))
11407 return (((void *)0));
11410 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11413 char nameSpace[1024];
11415 unsigned int gotColon = 0x0;
11417 nameSpace[0] = '\0';
11418 for(c = strlen(name) - 1; c >= 0; c--)
11424 namePart = name + c + 1;
11425 while(c >= 0 && name[c] == ':')
11429 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11433 memcpy(nameSpace, name, c + 1);
11434 nameSpace[c + 1] = (char)0;
11435 return ScanWithNameSpace(tree, nameSpace, namePart);
11439 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11445 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11449 return ScanWithNameSpace(tree, "", namePart);
11451 return (((void *)0));
11454 static void ProcessDeclaration(struct Declaration * decl);
11456 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11458 struct Context * ctx;
11459 struct Symbol * symbol = (((void *)0));
11461 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11463 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11465 symbol = (((void *)0));
11468 char curName[1024];
11470 strcpy(curName, thisNameSpace);
11471 strcat(curName, "::");
11472 strcat(curName, name);
11473 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11476 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11479 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11480 if(symbol || ctx == endContext)
11483 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11485 if(symbol->pointerExternal->type == 0)
11487 struct FunctionDefinition * function = symbol->pointerExternal->function;
11488 struct Context * tmpContext = curContext;
11490 curContext = (((void *)0));
11491 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11492 curContext = tmpContext;
11493 symbol->pointerExternal->symbol = symbol;
11494 DeclareType(symbol->type, 0x1, 0x1);
11495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11496 symbol->id = curExternal->symbol->idCode;
11498 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11501 symbol->id = curExternal->symbol->idCode;
11507 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11509 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11510 ListAdd(specs, MkSpecifier(UNSIGNED));
11515 if(type->_class->registered)
11517 if(!type->_class->registered->dataType)
11518 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11519 GetTypeSpecs(type->_class->registered->dataType, specs);
11524 ListAdd(specs, MkSpecifier(DOUBLE));
11527 ListAdd(specs, MkSpecifier(FLOAT));
11530 ListAdd(specs, MkSpecifier(CHAR));
11533 ListAdd(specs, MkSpecifier(SHORT));
11536 ListAdd(specs, MkSpecifier(INT64));
11539 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11542 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11546 ListAdd(specs, MkSpecifier(INT));
11551 static void PrintArraySize(struct Type * arrayType, char * string)
11557 if(arrayType->enumClass)
11558 strcat(size, arrayType->enumClass->string);
11559 else if(arrayType->arraySizeExp)
11560 PrintExpression(arrayType->arraySizeExp, size);
11562 strcat(string, size);
11565 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
11569 if(printConst && type->constant)
11570 strcat(string, "const ");
11575 struct Symbol * c = type->_class;
11577 if(type->classObjectType == 2)
11578 strcat(string, "typed_object");
11579 else if(type->classObjectType == 3)
11580 strcat(string, "any_object");
11584 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
11586 if(type->byReference)
11587 strcat(string, " &");
11591 strcat(string, "void");
11594 strcat(string, type->isSigned ? "int" : "uint");
11597 strcat(string, type->isSigned ? "int64" : "uint64");
11600 strcat(string, type->isSigned ? "intptr" : "uintptr");
11603 strcat(string, type->isSigned ? "intsize" : "uintsize");
11606 strcat(string, type->isSigned ? "char" : "byte");
11609 strcat(string, type->isSigned ? "short" : "uint16");
11612 strcat(string, "float");
11615 strcat(string, "double");
11620 strcat(string, "struct ");
11621 strcat(string, type->enumName);
11623 else if(type->typeName)
11624 strcat(string, type->typeName);
11627 struct Type * member;
11629 strcat(string, "struct { ");
11630 for(member = type->members.first; member; member = member->next)
11632 PrintType(member, string, 0x1, fullName);
11633 strcat(string, "; ");
11635 strcat(string, "}");
11641 strcat(string, "union ");
11642 strcat(string, type->enumName);
11644 else if(type->typeName)
11645 strcat(string, type->typeName);
11648 strcat(string, "union ");
11649 strcat(string, "(unnamed)");
11655 strcat(string, "enum ");
11656 strcat(string, type->enumName);
11658 else if(type->typeName)
11659 strcat(string, type->typeName);
11661 strcat(string, "int");
11664 strcat(string, "...");
11667 strcat(string, "subclass(");
11668 strcat(string, type->_class ? type->_class->string : "int");
11669 strcat(string, ")");
11672 strcat(string, type->templateParameter->identifier->string);
11675 strcat(string, "thisclass");
11678 strcat(string, "__builtin_va_list");
11684 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11686 static void PrintName(struct Type * type, char * string, unsigned int fullName)
11688 if(type->name && type->name[0])
11691 strcat(string, type->name);
11694 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11700 strcat(string, name);
11705 static void PrintAttribs(struct Type * type, char * string)
11709 if(type->dllExport)
11710 strcat(string, "dllexport ");
11711 if(type->attrStdcall)
11712 strcat(string, "stdcall ");
11716 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
11718 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11720 struct Type * attrType = (((void *)0));
11722 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
11723 PrintAttribs(type, string);
11724 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
11725 strcat(string, " const");
11726 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
11727 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11728 strcat(string, " (");
11729 if(type->kind == 13)
11731 if(type->type->kind == 11 || type->type->kind == 16)
11732 PrintAttribs(type->type, string);
11734 if(type->kind == 13)
11736 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
11737 strcat(string, "*");
11739 strcat(string, " *");
11741 if(printConst && type->constant && type->kind == 13)
11742 strcat(string, " const");
11745 PrintTypeSpecs(type, string, fullName, printConst);
11748 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
11750 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11751 strcat(string, ")");
11752 if(type->kind == 12)
11753 PrintArraySize(type, string);
11754 else if(type->kind == 11)
11756 struct Type * param;
11758 strcat(string, "(");
11759 for(param = type->params.first; param; param = param->next)
11761 PrintType(param, string, 0x1, fullName);
11763 strcat(string, ", ");
11765 strcat(string, ")");
11767 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11768 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
11771 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
11773 PrePrintType(type, string, fullName, (((void *)0)), printConst);
11774 if(type->thisClass || (printName && type->name && type->name[0]))
11775 strcat(string, " ");
11776 if((type->thisClass || type->staticMethod))
11778 struct Symbol * _class = type->thisClass;
11780 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
11782 if(type->classObjectType == 1)
11783 strcat(string, "class");
11785 strcat(string, type->byReference ? "typed_object&" : "typed_object");
11787 else if(_class && _class->string)
11789 char * s = _class->string;
11795 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
11801 strcat(string, name);
11804 strcat(string, "::");
11806 if(printName && type->name)
11807 PrintName(type, string, fullName);
11808 PostPrintType(type, string, fullName);
11809 if(type->bitFieldCount)
11813 sprintf(count, ":%d", type->bitFieldCount);
11814 strcat(string, count);
11818 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11820 _PrintType(type, string, printName, fullName, 0x1);
11823 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11825 _PrintType(type, string, printName, fullName, 0x0);
11828 static struct Type * FindMember(struct Type * type, char * string)
11830 struct Type * memberType;
11832 for(memberType = type->members.first; memberType; memberType = memberType->next)
11834 if(!memberType->name)
11836 struct Type * subType = FindMember(memberType, string);
11841 else if(!strcmp(memberType->name, string))
11844 return (((void *)0));
11847 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11849 struct Type * memberType;
11851 for(memberType = type->members.first; memberType; memberType = memberType->next)
11853 if(!memberType->name)
11855 struct Type * subType = FindMember(memberType, string);
11859 *offset += memberType->offset;
11863 else if(!strcmp(memberType->name, string))
11865 *offset += memberType->offset;
11869 return (((void *)0));
11872 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11874 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11876 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
11878 struct Expression * ParseExpressionString(char * expression)
11880 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11881 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
11882 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
11884 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
11885 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11886 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
11887 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
11889 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
11890 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11892 parsedExpression = (((void *)0));
11894 expression_yyparse();
11895 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11896 return parsedExpression;
11899 extern char * QMkString(char * source);
11901 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11903 struct Identifier * id = exp->identifier;
11904 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11905 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11906 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11907 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11909 if(_class && _class->type == 4)
11911 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11912 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11916 struct __ecereNameSpace__ecere__com__Class * baseClass;
11918 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11920 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11922 for(value = e->values.first; value; value = value->next)
11924 if(!strcmp(value->name, id->string))
11929 char constant[256];
11931 FreeExpContents(exp);
11933 exp->isConstant = 0x1;
11934 if(!strcmp(baseClass->dataTypeString, "int"))
11935 sprintf(constant, "%d", (int)value->data);
11937 sprintf(constant, "0x%X", (int)value->data);
11938 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11939 exp->expType = MkClassType(baseClass->fullName);
11947 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11949 ProcessMethodType(method);
11950 exp->expType = __extension__ ({
11951 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11953 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11957 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11959 if(!prop->dataType)
11960 ProcessPropertyType(prop);
11961 exp->expType = prop->dataType;
11963 prop->dataType->refCount++;
11966 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11968 if(!member->dataType)
11969 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11970 exp->expType = member->dataType;
11971 if(member->dataType)
11972 member->dataType->refCount++;
11975 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11977 if(!classProp->dataType)
11978 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11979 if(classProp->constant)
11981 FreeExpContents(exp);
11982 exp->isConstant = 0x1;
11983 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11986 exp->constant = QMkString((char *)classProp->Get(_class));
11990 char constant[256];
11993 sprintf(constant, "%d", (int)classProp->Get(_class));
11994 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12000 exp->expType = classProp->dataType;
12001 if(classProp->dataType)
12002 classProp->dataType->refCount++;
12008 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
12010 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
12011 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
12012 struct __ecereNameSpace__ecere__com__NameSpace * child;
12016 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)))
12018 data = ScanGlobalData(child, name);
12026 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
12028 extern char * strncpy(char * , const char * , size_t n);
12030 static struct GlobalData * FindGlobalData(char * name)
12033 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12035 nameSpace = globalData;
12036 for(c = 0; name[c]; c++)
12038 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
12040 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
12041 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
12043 strncpy(spaceName, name + start, c - start);
12044 spaceName[c - start] = '\0';
12045 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
12046 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
12048 return (((void *)0));
12049 nameSpace = newSpace;
12057 return ScanGlobalData(nameSpace, name + start);
12059 return (((void *)0));
12062 static int definedExpStackPos;
12064 static void * definedExpStack[512];
12066 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
12068 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
12070 FreeExpContents(checkedExp);
12071 FreeType(checkedExp->expType);
12072 FreeType(checkedExp->destType);
12073 *checkedExp = *newExp;
12074 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12075 checkedExp->prev = prev;
12076 checkedExp->next = next;
12079 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
12081 extern int printf(char * , ...);
12083 void __ecereMethod_Expression_Clear();
12085 void ApplyAnyObjectLogic(struct Expression * e)
12087 struct Type * destType = e->destType;
12089 if(destType && (destType->classObjectType == 3))
12091 if(e && e->expType)
12093 struct Type * type = e->expType;
12094 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12096 if(type->kind == 8 && type->_class && type->_class->registered)
12098 _class = type->_class->registered;
12100 else if(type->kind == 19)
12102 _class = FindClass("ecere::com::Class")->registered;
12106 char string[1024] = "";
12107 struct Symbol * classSym;
12109 PrintTypeNoConst(type, string, 0x0, 0x1);
12110 classSym = FindClass(string);
12112 _class = classSym->registered;
12114 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
12116 if(!_class || strcmp(_class->fullName, "char *"))
12118 struct Expression * checkedExp = e, * newExp;
12120 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12122 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12124 if(checkedExp->type == 25)
12126 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12129 checkedExp = (*checkedExp->list).last;
12131 else if(checkedExp->type == 11)
12132 checkedExp = checkedExp->cast.exp;
12134 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12136 newExp = checkedExp->op.exp2;
12137 checkedExp->op.exp2 = (((void *)0));
12138 FreeExpContents(checkedExp);
12139 if(e->expType && e->expType->passAsTemplate)
12143 ComputeTypeSize(e->expType);
12144 sprintf(size, "%d", e->expType->size);
12145 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))))));
12147 ReplaceExpContents(checkedExp, newExp);
12148 e->byReference = 0x1;
12150 else if(!e->byReference || (_class && _class->type == 5))
12152 struct Expression * checkedExp, * newExp;
12155 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;
12157 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12159 struct Context * context = PushContext();
12160 struct Declarator * decl;
12161 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12162 char typeString[1024];
12163 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12165 typeString[0] = '\0';
12167 newExp->prev = (((void *)0));
12168 newExp->next = (((void *)0));
12169 newExp->expType = (((void *)0));
12170 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
12171 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12172 newExp->destType = ProcessType(specs, decl);
12173 curContext = context;
12177 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12180 sprintf(name, "__internalValue%03X", internalValueCounter++);
12181 if(!curCompound->compound.declarations)
12182 curCompound->compound.declarations = MkList();
12183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12184 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12185 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12186 e->compound = MkCompoundStmt((((void *)0)), stmts);
12189 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12191 struct Type * type = e->destType;
12193 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12194 CopyTypeInto(e->destType, type);
12195 e->destType->refCount = 1;
12196 e->destType->classObjectType = 0;
12199 e->compound->compound.context = context;
12200 PopContext(context);
12201 curContext = context->parent;
12205 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12207 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12209 if(checkedExp->type == 25)
12211 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12214 checkedExp = (*checkedExp->list).last;
12216 else if(checkedExp->type == 11)
12217 checkedExp = checkedExp->cast.exp;
12220 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12222 *operand = *checkedExp;
12223 checkedExp->destType = (((void *)0));
12224 checkedExp->expType = (((void *)0));
12225 __ecereMethod_Expression_Clear(checkedExp);
12226 checkedExp->type = 4;
12227 checkedExp->op.op = '&';
12228 checkedExp->op.exp1 = (((void *)0));
12229 checkedExp->op.exp2 = operand;
12238 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))))
12240 if(e->expType->classObjectType && destType && destType->classObjectType)
12246 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12249 thisExp->prev = (((void *)0));
12250 thisExp->next = (((void *)0));
12251 __ecereMethod_Expression_Clear(e);
12253 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12254 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12255 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12257 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12258 CopyTypeInto(e->expType, thisExp->expType);
12259 e->expType->byReference = 0x0;
12260 e->expType->refCount = 1;
12261 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))
12263 e->expType->classObjectType = 0;
12268 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12270 if(destType->kind == 14)
12272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12274 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12276 unsigned int byReference = e->expType->byReference;
12277 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12278 struct Declarator * decl;
12279 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12280 char typeString[1024];
12281 struct Type * type;
12282 int backupClassObjectType;
12283 unsigned int backupByReference;
12285 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12289 backupClassObjectType = type->classObjectType;
12290 backupByReference = type->byReference;
12291 type->classObjectType = 0;
12292 type->byReference = 0x0;
12293 typeString[0] = '\0';
12294 PrintType(type, typeString, 0x0, 0x1);
12295 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12296 type->classObjectType = backupClassObjectType;
12297 type->byReference = backupByReference;
12299 thisExp->prev = (((void *)0));
12300 thisExp->next = (((void *)0));
12301 __ecereMethod_Expression_Clear(e);
12302 if((type->kind == 8 && type->_class && type->_class->registered && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12306 e->op.exp1 = (((void *)0));
12307 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12308 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12309 CopyTypeInto(e->expType, type);
12310 e->expType->byReference = 0x0;
12311 e->expType->refCount = 1;
12316 e->cast.typeName = MkTypeName(specs, decl);
12317 e->cast.exp = thisExp;
12318 e->byReference = 0x1;
12322 e->destType = destType;
12323 destType->refCount++;
12328 extern char * strstr(const char * , const char * );
12330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12332 struct __ecereNameSpace__ecere__com__DefinedExpression
12334 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12335 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12338 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12339 } __attribute__ ((gcc_struct));
12341 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12343 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12345 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12347 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12349 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12351 extern struct Expression * CopyExpression(struct Expression * exp);
12353 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12355 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12357 static void ProcessStatement(struct Statement * stmt);
12359 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12361 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12363 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12365 extern char * sourceFile;
12367 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12369 void ProcessExpressionType(struct Expression * exp)
12371 unsigned int unresolved = 0x0;
12372 struct Location oldyylloc = yylloc;
12373 unsigned int notByReference = 0x0;
12375 if(!exp || exp->expType)
12382 struct Identifier * id = exp->identifier;
12386 if(id->_class && id->_class->name)
12388 id->classSym = id->_class->symbol;
12390 if(strstr(id->string, "__ecereClass") == id->string)
12392 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12395 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12397 ReplaceClassMembers(exp, thisClass);
12400 ProcessExpressionType(exp);
12403 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12408 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12412 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12418 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12421 ProcessExpressionType(exp);
12425 else if(currentClass && !id->_class)
12427 if(ResolveIdWithClass(exp, currentClass, 0x1))
12430 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12435 struct Type * type = symbol->type;
12436 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12438 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12440 struct Context * context = SetupTemplatesContext(_class);
12442 type = ReplaceThisClassType(_class);
12443 FinishTemplatesContext(context);
12445 type->refCount = 0;
12447 FreeSpecifier(id->_class);
12448 id->_class = (((void *)0));
12449 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12450 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12451 id->classSym = (((void *)0));
12452 exp->expType = type;
12455 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12456 exp->isConstant = 0x1;
12457 if(symbol->isParam || !strcmp(id->string, "this"))
12459 if(_class && _class->type == 1 && !type->declaredWithStruct)
12460 exp->byReference = 0x1;
12462 if(symbol->isIterator)
12464 if(symbol->isIterator == 3)
12467 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12468 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12469 exp->expType = (((void *)0));
12470 ProcessExpressionType(exp);
12472 else if(symbol->isIterator != 4)
12475 exp->member.exp = MkExpIdentifier(exp->identifier);
12476 exp->member.exp->expType = exp->expType;
12477 exp->member.member = MkIdentifier("data");
12478 exp->expType = (((void *)0));
12479 ProcessExpressionType(exp);
12486 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12488 if(thisNameSpace && !(id->_class && !id->_class->name))
12492 strcpy(name, thisNameSpace);
12493 strcat(name, "::");
12494 strcat(name, id->string);
12495 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12498 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12503 for(c = 0; c < definedExpStackPos; c++)
12504 if(definedExpStack[c] == definedExp)
12506 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12508 struct Location backupYylloc = yylloc;
12510 definedExpStack[definedExpStackPos++] = definedExp;
12511 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12512 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
12513 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12515 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12516 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12517 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12518 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12520 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12521 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12523 parsedExpression = (((void *)0));
12525 expression_yyparse();
12526 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12527 yylloc = backupYylloc;
12528 if(parsedExpression)
12530 FreeIdentifier(id);
12532 exp->list = MkListOne(parsedExpression);
12533 parsedExpression->loc = yylloc;
12534 ProcessExpressionType(exp);
12535 definedExpStackPos--;
12538 definedExpStackPos--;
12544 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12550 struct GlobalData * data = (((void *)0));
12552 if(thisNameSpace && !(id->_class && !id->_class->name))
12556 strcpy(name, thisNameSpace);
12557 strcat(name, "::");
12558 strcat(name, id->string);
12559 data = FindGlobalData(name);
12562 data = FindGlobalData(id->string);
12565 DeclareGlobalData(data);
12566 exp->expType = data->dataType;
12568 data->dataType->refCount++;
12569 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12570 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12571 FreeSpecifier(id->_class);
12572 id->_class = (((void *)0));
12577 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12579 if(thisNameSpace && !(id->_class && !id->_class->name))
12583 strcpy(name, thisNameSpace);
12584 strcat(name, "::");
12585 strcat(name, id->string);
12586 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12589 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12594 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12595 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12597 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12598 strcpy(name, "__ecereFunction_");
12599 FullClassNameCat(name, id->string, 0x0);
12600 if(DeclareFunction(function, name))
12602 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12603 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12605 exp->expType = function->dataType;
12606 if(function->dataType)
12607 function->dataType->refCount++;
12608 FreeSpecifier(id->_class);
12609 id->_class = (((void *)0));
12621 struct __ecereNameSpace__ecere__com__Class * _class;
12623 if(!exp->instance->_class)
12625 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12627 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12630 ProcessInstantiationType(exp->instance);
12631 exp->isConstant = exp->instance->isConstant;
12632 if(exp->instance->_class)
12634 exp->expType = MkClassType(exp->instance->_class->name);
12642 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12644 exp->expType = type;
12645 if(exp->constant[0] == '\'')
12647 if((int)((unsigned char *)exp->constant)[1] > 127)
12650 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12653 ch = exp->constant[1];
12654 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12655 exp->constant = PrintUInt(ch);
12657 type->_class = FindClass("unichar");
12658 type->isSigned = 0x0;
12663 type->isSigned = 0x1;
12666 else if(strchr(exp->constant, '.'))
12668 char ch = exp->constant[strlen(exp->constant) - 1];
12674 type->isSigned = 0x1;
12678 if(exp->constant[0] == '0' && exp->constant[1])
12679 type->isSigned = 0x0;
12680 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12681 type->isSigned = 0x0;
12682 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12683 type->isSigned = 0x0;
12685 type->isSigned = 0x1;
12688 exp->isConstant = 0x1;
12689 if(exp->destType && exp->destType->kind == 7)
12691 else if(exp->destType && exp->destType->kind == 6)
12693 else if(exp->destType && exp->destType->kind == 4)
12700 exp->isConstant = 0x1;
12701 exp->expType = __extension__ ({
12702 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12704 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12705 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12707 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
12708 }), __ecereInstance2;
12714 ProcessExpressionType(exp->_new.size);
12715 exp->expType = __extension__ ({
12716 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12718 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12720 DeclareType(exp->expType->type, 0x0, 0x0);
12724 ProcessExpressionType(exp->_renew.size);
12725 ProcessExpressionType(exp->_renew.exp);
12726 exp->expType = __extension__ ({
12727 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12729 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12731 DeclareType(exp->expType->type, 0x0, 0x0);
12735 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12736 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12737 unsigned int useDestType = 0x0, useSideType = 0x0;
12738 struct Location oldyylloc = yylloc;
12739 unsigned int useSideUnit = 0x0;
12740 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
12782 if(exp->op.op != '*' || exp->op.exp1)
12789 if(exp->op.op == '&')
12791 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12793 struct Identifier * id = exp->op.exp2->identifier;
12794 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12796 if(symbol && symbol->isIterator == 2)
12799 exp->member.exp = exp->op.exp2;
12800 exp->member.member = MkIdentifier("key");
12801 exp->expType = (((void *)0));
12802 exp->op.exp2->expType = symbol->type;
12803 symbol->type->refCount++;
12804 ProcessExpressionType(exp);
12812 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))
12814 if(exp->op.exp1->destType)
12815 FreeType(exp->op.exp1->destType);
12816 exp->op.exp1->destType = exp->destType;
12818 exp->destType->refCount++;
12822 if(exp->op.exp1->destType)
12823 FreeType(exp->op.exp1->destType);
12824 exp->op.exp1->destType = dummy;
12827 if(exp->op.exp1->destType && exp->op.op != '=')
12828 exp->op.exp1->destType->count++;
12829 ProcessExpressionType(exp->op.exp1);
12830 if(exp->op.exp1->destType && exp->op.op != '=')
12831 exp->op.exp1->destType->count--;
12832 if(exp->op.exp1->destType == dummy)
12835 exp->op.exp1->destType = (((void *)0));
12837 type1 = exp->op.exp1->expType;
12841 char expString[10240];
12843 expString[0] = '\0';
12844 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12848 exp->op.exp2->destType = exp->op.exp1->expType;
12849 if(exp->op.exp1->expType)
12850 exp->op.exp1->expType->refCount++;
12854 exp->op.exp2->destType = exp->destType;
12856 exp->destType->refCount++;
12860 exp->expType = type1;
12865 PrintExpression(exp->op.exp2, expString);
12866 if(type1 && type1->kind == 13)
12868 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)
12869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12870 else if(exp->op.op == '=')
12872 if(exp->op.exp2->destType)
12873 FreeType(exp->op.exp2->destType);
12874 exp->op.exp2->destType = type1;
12881 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)
12885 if(exp->op.exp2->destType)
12886 FreeType(exp->op.exp2->destType);
12887 exp->op.exp2->destType = type1;
12894 exp->expType = type1;
12896 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)))
12898 if(exp->op.exp2->destType)
12899 FreeType(exp->op.exp2->destType);
12900 exp->op.exp2->destType = exp->destType;
12902 exp->destType->refCount++;
12906 if(exp->op.exp2->destType)
12907 FreeType(exp->op.exp2->destType);
12908 exp->op.exp2->destType = dummy;
12911 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12913 FreeType(exp->op.exp2->destType);
12914 exp->op.exp2->destType = type1;
12917 if(exp->op.exp2->destType && exp->op.op != '=')
12918 exp->op.exp2->destType->count++;
12919 ProcessExpressionType(exp->op.exp2);
12920 if(exp->op.exp2->destType && exp->op.op != '=')
12921 exp->op.exp2->destType->count--;
12922 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12924 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)
12926 if(exp->op.op != '=' && type1->type->kind == 0)
12927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12929 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)))
12931 if(exp->op.op == ADD_ASSIGN)
12932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12934 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))
12936 if(exp->op.op == ADD_ASSIGN)
12937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12939 else if(inCompiler)
12941 char type1String[1024];
12942 char type2String[1024];
12944 type1String[0] = '\0';
12945 type2String[0] = '\0';
12946 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12947 PrintType(type1, type2String, 0x0, 0x1);
12948 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12949 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12952 if(exp->op.exp2->destType == dummy)
12955 exp->op.exp2->destType = (((void *)0));
12957 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
12959 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12960 type2->refCount = 1;
12961 CopyTypeInto(type2, exp->op.exp2->expType);
12962 type2->isSigned = 0x1;
12964 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
12966 type2 = __extension__ ({
12967 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12969 __ecereInstance1->kind = 3, __ecereInstance1;
12971 type2->refCount = 1;
12972 type2->isSigned = 0x1;
12975 type2 = exp->op.exp2->expType;
12978 if(exp->op.op == SIZEOF)
12980 exp->expType = __extension__ ({
12981 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12983 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
12985 exp->isConstant = 0x1;
12987 else if(exp->op.op == '*' && !exp->op.exp1)
12989 exp->expType = Dereference(type2);
12990 if(type2 && type2->kind == 8)
12991 notByReference = 0x1;
12993 else if(exp->op.op == '&' && !exp->op.exp1)
12994 exp->expType = Reference(type2);
13001 if(exp->op.exp1->destType)
13002 FreeType(exp->op.exp1->destType);
13003 exp->op.exp1->destType = MkClassType("bool");
13004 exp->op.exp1->destType->truth = 0x1;
13005 if(!exp->op.exp1->expType)
13006 ProcessExpressionType(exp->op.exp1);
13008 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13009 FreeType(exp->op.exp1->expType);
13010 exp->op.exp1->expType = MkClassType("bool");
13011 exp->op.exp1->expType->truth = 0x1;
13015 if(exp->op.exp2->destType)
13016 FreeType(exp->op.exp2->destType);
13017 exp->op.exp2->destType = MkClassType("bool");
13018 exp->op.exp2->destType->truth = 0x1;
13019 if(!exp->op.exp2->expType)
13020 ProcessExpressionType(exp->op.exp2);
13022 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13023 FreeType(exp->op.exp2->expType);
13024 exp->op.exp2->expType = MkClassType("bool");
13025 exp->op.exp2->expType->truth = 0x1;
13028 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")))))
13030 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
13032 if(exp->op.exp2->destType)
13033 FreeType(exp->op.exp2->destType);
13034 exp->op.exp2->destType = type1;
13036 if(exp->op.exp1->destType)
13037 FreeType(exp->op.exp1->destType);
13038 exp->op.exp1->destType = type2;
13040 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)
13041 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);
13042 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
13044 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13048 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13050 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
13051 ProcessExpressionType(exp->op.exp1);
13052 if(type2->kind != 13)
13054 ProcessExpressionType(classExp);
13055 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"))))))));
13056 if(!exp->op.exp2->expType)
13057 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
13058 ProcessExpressionType(exp->op.exp2);
13062 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)))
13064 if(type1->kind != 8 && type1->type->kind == 0)
13065 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13066 exp->expType = type1;
13070 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)))
13072 if(type2->kind != 8 && type2->type->kind == 0)
13073 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13074 exp->expType = type2;
13078 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))
13080 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
13084 unsigned int success = 0x0;
13086 if(type1->kind == 13 && type2->kind == 13)
13088 if(exp->op.op == '+')
13089 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
13090 else if(exp->op.op == '-')
13092 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
13094 exp->expType = __extension__ ({
13095 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13097 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
13100 if(type1->type->kind == 20)
13102 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13106 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13108 ProcessExpressionType(classExp);
13110 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")))))));
13111 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
13119 if(!success && exp->op.exp1->type == 2)
13121 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13124 FreeType(exp->expType);
13125 exp->expType = exp->op.exp1->destType;
13126 if(exp->op.exp1->destType)
13127 exp->op.exp1->destType->refCount++;
13130 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13133 FreeType(exp->expType);
13134 exp->expType = exp->op.exp2->destType;
13135 if(exp->op.exp2->destType)
13136 exp->op.exp2->destType->refCount++;
13142 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13145 FreeType(exp->expType);
13146 exp->expType = exp->op.exp2->destType;
13147 if(exp->op.exp2->destType)
13148 exp->op.exp2->destType->refCount++;
13151 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13154 FreeType(exp->expType);
13155 exp->expType = exp->op.exp1->destType;
13156 if(exp->op.exp1->destType)
13157 exp->op.exp1->destType->refCount++;
13163 char expString1[10240];
13164 char expString2[10240];
13168 expString1[0] = '\0';
13169 expString2[0] = '\0';
13174 PrintExpression(exp->op.exp1, expString1);
13175 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13176 PrintExpression(exp->op.exp2, expString2);
13177 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13178 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13179 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13181 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13185 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13187 if(exp->op.exp1->destType)
13188 FreeType(exp->op.exp1->destType);
13189 exp->op.exp1->destType = type2->_class->registered->dataType;
13190 if(type2->_class->registered->dataType)
13191 type2->_class->registered->dataType->refCount++;
13192 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13193 exp->expType = type2;
13197 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13199 if(exp->op.exp2->destType)
13200 FreeType(exp->op.exp2->destType);
13201 exp->op.exp2->destType = type1->_class->registered->dataType;
13202 if(type1->_class->registered->dataType)
13203 type1->_class->registered->dataType->refCount++;
13204 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13205 exp->expType = type1;
13211 unsigned int valid = 0x0;
13213 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13215 if(exp->op.exp2->destType)
13216 FreeType(exp->op.exp2->destType);
13217 if(!type1->_class->registered->dataType)
13218 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13219 exp->op.exp2->destType = type1->_class->registered->dataType;
13220 exp->op.exp2->destType->refCount++;
13221 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13222 type2 = exp->op.exp2->destType;
13223 exp->expType = type2;
13226 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13228 if(exp->op.exp1->destType)
13229 FreeType(exp->op.exp1->destType);
13230 if(!type2->_class->registered->dataType)
13231 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13232 exp->op.exp1->destType = type2->_class->registered->dataType;
13233 exp->op.exp1->destType->refCount++;
13234 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13235 type1 = exp->op.exp1->destType;
13236 exp->expType = type1;
13239 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13241 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13243 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13246 FreeType(exp->expType);
13247 exp->expType = exp->op.exp1->expType;
13248 if(exp->op.exp2->expType)
13249 exp->op.exp1->expType->refCount++;
13253 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13255 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13258 FreeType(exp->expType);
13259 exp->expType = exp->op.exp2->expType;
13260 if(exp->op.exp2->expType)
13261 exp->op.exp2->expType->refCount++;
13268 if(exp->op.exp2->destType)
13269 FreeType(exp->op.exp2->destType);
13270 exp->op.exp2->destType = type1;
13272 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13275 FreeType(exp->expType);
13276 exp->expType = exp->op.exp2->destType;
13277 if(exp->op.exp2->destType)
13278 exp->op.exp2->destType->refCount++;
13280 else if(type1 && type2)
13282 char expString1[10240];
13283 char expString2[10240];
13284 char type1String[1024];
13285 char type2String[1024];
13287 expString1[0] = '\0';
13288 expString2[0] = '\0';
13289 type1String[0] = '\0';
13290 type2String[0] = '\0';
13293 PrintExpression(exp->op.exp1, expString1);
13294 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13295 PrintExpression(exp->op.exp2, expString2);
13296 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13297 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13298 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13300 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13301 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13303 exp->expType = exp->op.exp1->expType;
13304 if(exp->op.exp1->expType)
13305 exp->op.exp1->expType->refCount++;
13307 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13309 exp->expType = exp->op.exp2->expType;
13310 if(exp->op.exp2->expType)
13311 exp->op.exp2->expType->refCount++;
13318 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13320 struct Type * oldType = exp->op.exp1->expType;
13322 exp->op.exp1->expType = (((void *)0));
13323 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13326 exp->op.exp1->expType = oldType;
13328 if(exp->op.exp1->destType)
13329 FreeType(exp->op.exp1->destType);
13330 exp->op.exp1->destType = type2;
13332 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13335 FreeType(exp->expType);
13336 exp->expType = exp->op.exp1->destType;
13337 if(exp->op.exp1->destType)
13338 exp->op.exp1->destType->refCount++;
13342 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13344 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13346 if(exp->op.exp1->destType)
13347 FreeType(exp->op.exp1->destType);
13348 exp->op.exp1->destType = type2->_class->registered->dataType;
13349 if(type2->_class->registered->dataType)
13350 type2->_class->registered->dataType->refCount++;
13351 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13353 if(exp->op.op == '!')
13355 exp->expType = MkClassType("bool");
13356 exp->expType->truth = 0x1;
13360 exp->expType = type2;
13365 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13367 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13369 if(exp->op.exp2->destType)
13370 FreeType(exp->op.exp2->destType);
13371 exp->op.exp2->destType = type1->_class->registered->dataType;
13372 if(type1->_class->registered->dataType)
13373 type1->_class->registered->dataType->refCount++;
13374 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13376 exp->expType = type1;
13382 if(exp->op.exp1 && !exp->op.exp1->expType)
13384 char expString[10000];
13386 expString[0] = '\0';
13389 PrintExpression(exp->op.exp1, expString);
13390 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13393 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13395 if(exp->op.exp2 && !exp->op.exp2->expType)
13397 char expString[10240];
13399 expString[0] = '\0';
13402 PrintExpression(exp->op.exp2, expString);
13403 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13406 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13410 FreeType(exp->expType);
13411 exp->expType = MkClassType("bool");
13412 exp->expType->truth = 0x1;
13414 if(exp->op.op != SIZEOF)
13415 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13416 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13418 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13420 yylloc = oldyylloc;
13427 struct Expression * e;
13429 exp->isConstant = 0x1;
13430 for(e = (*exp->list).first; e; e = e->next)
13432 unsigned int inced = 0x0;
13436 FreeType(e->destType);
13437 e->destType = exp->destType;
13440 exp->destType->refCount++;
13441 e->destType->count++;
13445 ProcessExpressionType(e);
13447 exp->destType->count--;
13448 if(!exp->expType && !e->next)
13450 exp->expType = e->expType;
13452 e->expType->refCount++;
13455 exp->isConstant = 0x0;
13457 e = (*exp->list).first;
13458 if(!e->next && e->type == 8)
13460 struct Expression * next = exp->next, * prev = exp->prev;
13462 FreeType(exp->expType);
13463 FreeType(exp->destType);
13464 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13468 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13469 ProcessExpressionType(exp);
13475 struct Expression * e;
13477 exp->isConstant = 0x1;
13478 ProcessExpressionType(exp->index.exp);
13479 if(!exp->index.exp->isConstant)
13480 exp->isConstant = 0x0;
13481 if(exp->index.exp->expType)
13483 struct Type * source = exp->index.exp->expType;
13485 if(source->kind == 8 && source->_class && source->_class->registered)
13487 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13488 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
13490 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
13492 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13493 if(exp->index.index && (*exp->index.index).last)
13495 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13500 for(e = (*exp->index.index).first; e; e = e->next)
13502 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13505 FreeType(e->destType);
13506 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13508 ProcessExpressionType(e);
13513 exp->isConstant = 0x0;
13516 exp->expType = Dereference(exp->index.exp->expType);
13518 DeclareType(exp->expType, 0x0, 0x0);
13523 struct Expression * e;
13524 struct Type * functionType;
13525 struct Type * methodType = (((void *)0));
13531 PrintExpression(exp->call.exp, name);
13532 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13534 PrintExpression(exp->call.exp, name);
13537 if(exp->call.exp->type == 0)
13539 struct Expression * idExp = exp->call.exp;
13540 struct Identifier * id = idExp->identifier;
13542 if(!strcmp(id->string, "__builtin_frame_address"))
13544 exp->expType = ProcessTypeString("void *", 0x1);
13545 if(exp->call.arguments && (*exp->call.arguments).first)
13546 ProcessExpressionType((*exp->call.arguments).first);
13549 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13551 exp->expType = ProcessTypeString("int", 0x1);
13552 if(exp->call.arguments && (*exp->call.arguments).first)
13553 ProcessExpressionType((*exp->call.arguments).first);
13556 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13558 struct Expression * a = (((void *)0));
13559 struct Expression * b = (((void *)0));
13560 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13562 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13564 a = (*exp->call.arguments).first;
13565 b = (*exp->call.arguments).last;
13569 else if((*exp->call.arguments).count == 1)
13571 a = (*exp->call.arguments).first;
13576 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13577 idExp->identifier = (((void *)0));
13578 FreeExpContents(exp);
13579 ProcessExpressionType(a);
13581 ProcessExpressionType(b);
13583 exp->list = MkList();
13584 if(a->expType && (!b || b->expType))
13586 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13590 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13591 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13592 struct Declaration * decl;
13593 char temp1[1024], temp2[1024];
13595 GetTypeSpecs(a->expType, specs);
13596 if(a && !a->isConstant && a->type != 0)
13598 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13599 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13600 tempExp1 = QMkExpId(temp1);
13601 tempExp1->expType = a->expType;
13603 a->expType->refCount++;
13604 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13606 if(b && !b->isConstant && b->type != 0)
13608 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13609 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13610 tempExp2 = QMkExpId(temp2);
13611 tempExp2->expType = b->expType;
13613 b->expType->refCount++;
13614 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13616 decl = MkDeclaration(specs, decls);
13617 if(!curCompound->compound.declarations)
13618 curCompound->compound.declarations = MkList();
13619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13623 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13625 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13627 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13628 exp->expType = a->expType;
13630 a->expType->refCount++;
13632 else if(!strcmp(id->string, "Abs"))
13634 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13635 exp->expType = a->expType;
13637 a->expType->refCount++;
13639 else if(!strcmp(id->string, "Sgn"))
13641 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"))))));
13642 exp->expType = ProcessTypeString("int", 0x0);
13644 FreeExpression(tempExp1);
13646 FreeExpression(tempExp2);
13647 FreeIdentifier(id);
13653 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13655 if(!exp->call.exp->destType)
13657 exp->call.exp->destType = dummy;
13660 ProcessExpressionType(exp->call.exp);
13661 if(exp->call.exp->destType == dummy)
13664 exp->call.exp->destType = (((void *)0));
13668 functionType = exp->call.exp->expType;
13669 if(functionType && functionType->kind == 16)
13671 methodType = functionType;
13672 functionType = methodType->method->dataType;
13673 if(exp->call.exp->expType->usedClass)
13675 char typeString[1024];
13677 typeString[0] = '\0';
13679 struct Symbol * back = functionType->thisClass;
13681 functionType->thisClass = (((void *)0));
13682 PrintType(functionType, typeString, 0x1, 0x1);
13683 functionType->thisClass = back;
13685 if(strstr(typeString, "thisclass"))
13687 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13688 struct Declarator * decl;
13691 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13693 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13694 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13695 thisClassParams = 0x0;
13696 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13698 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13700 thisClass = exp->call.exp->expType->usedClass;
13701 ProcessDeclarator(decl);
13702 thisClass = backupThisClass;
13704 thisClassParams = 0x1;
13705 functionType = ProcessType(specs, decl);
13706 functionType->refCount = 0;
13707 FinishTemplatesContext(context);
13709 FreeList(specs, FreeSpecifier);
13710 FreeDeclarator(decl);
13714 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13716 struct Type * type = functionType->type;
13718 if(!functionType->refCount)
13720 functionType->type = (((void *)0));
13721 FreeType(functionType);
13723 functionType = type;
13725 if(functionType && functionType->kind != 11)
13727 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13729 else if(functionType)
13731 unsigned int emptyParams = 0x0, noParams = 0x0;
13732 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13733 struct Type * type = functionType->params.first;
13734 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13736 struct Location oldyylloc = yylloc;
13740 if(functionType->extraParam && e && functionType->thisClass)
13742 e->destType = MkClassType(functionType->thisClass->string);
13745 if(!functionType->staticMethod && !functionType->extraParam)
13747 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13749 type = MkClassType(memberExp->member.exp->expType->_class->string);
13752 e->destType = type;
13754 type = functionType->params.first;
13757 type->refCount = 0;
13759 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13761 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13762 type->byReference = functionType->byReference;
13763 type->typedByReference = functionType->typedByReference;
13766 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
13768 e->destType = type;
13770 type = functionType->params.first;
13773 type->refCount = 0;
13776 if(type && type->kind == 0)
13779 if(!type->refCount)
13781 type = (((void *)0));
13783 for(; e; e = e->next)
13785 if(!type && !emptyParams)
13788 if(methodType && methodType->methodClass)
13789 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);
13791 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);
13794 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13796 struct Type * templatedType = (((void *)0));
13797 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13798 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13801 if(_class && _class->templateArgs)
13803 struct __ecereNameSpace__ecere__com__Class * sClass;
13805 for(sClass = _class; sClass; sClass = sClass->base)
13807 if(sClass->templateClass)
13808 sClass = sClass->templateClass;
13810 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13812 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13814 struct __ecereNameSpace__ecere__com__Class * nextClass;
13816 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13818 if(nextClass->templateClass)
13819 nextClass = nextClass->templateClass;
13820 id += nextClass->templateParams.count;
13830 if(curParam && _class->templateArgs[id].dataTypeString)
13832 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13835 struct Context * context = SetupTemplatesContext(_class);
13837 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13838 FinishTemplatesContext(context);
13840 e->destType = templatedType;
13843 templatedType->passAsTemplate = 0x1;
13848 e->destType = type;
13855 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13857 e->destType = type->prev;
13858 e->destType->refCount++;
13862 e->destType = type;
13867 if(type && type->kind != 14)
13869 struct Type * next = type->next;
13871 if(!type->refCount)
13876 if(type && type->kind != 14)
13878 if(methodType && methodType->methodClass)
13879 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);
13881 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);
13883 yylloc = oldyylloc;
13884 if(type && !type->refCount)
13889 functionType = __extension__ ({
13890 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13892 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13894 if(exp->call.exp->type == 0)
13896 char * string = exp->call.exp->identifier->string;
13900 struct Symbol * symbol;
13901 struct Location oldyylloc = yylloc;
13903 yylloc = exp->call.exp->identifier->loc;
13904 if(strstr(string, "__builtin_") == string)
13908 functionType->returnType = exp->destType;
13909 exp->destType->refCount++;
13913 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13914 symbol = __extension__ ({
13915 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13917 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13919 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13920 if(strstr(symbol->string, "::"))
13921 globalContext->hasNameSpace = 0x1;
13922 yylloc = oldyylloc;
13925 else if(exp->call.exp->type == 8)
13929 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13930 if(!functionType->returnType)
13932 functionType->returnType = __extension__ ({
13933 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13935 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13939 if(functionType && functionType->kind == 11)
13941 exp->expType = functionType->returnType;
13942 if(functionType->returnType)
13943 functionType->returnType->refCount++;
13944 if(!functionType->refCount)
13945 FreeType(functionType);
13947 if(exp->call.arguments)
13949 for(e = (*exp->call.arguments).first; e; e = e->next)
13951 struct Type * destType = e->destType;
13953 ProcessExpressionType(e);
13960 struct Type * type;
13961 struct Location oldyylloc = yylloc;
13962 unsigned int thisPtr;
13963 struct Expression * checkExp = exp->member.exp;
13967 if(checkExp->type == 11)
13968 checkExp = checkExp->cast.exp;
13969 else if(checkExp->type == 5)
13970 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
13974 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
13975 exp->thisPtr = thisPtr;
13976 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13978 exp->member.member->classSym = exp->member.member->_class->symbol;
13980 ProcessExpressionType(exp->member.exp);
13981 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)
13983 exp->isConstant = 0x0;
13986 exp->isConstant = exp->member.exp->isConstant;
13987 type = exp->member.exp->expType;
13989 if(type && (type->kind == 20))
13991 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13992 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13996 for(param = _class->templateParams.first; param; param = param->next)
13998 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
14002 if(param && param->defaultArg.member)
14004 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
14008 struct Expression * expMember = exp->member.exp;
14009 struct Declarator * decl;
14010 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14011 char thisClassTypeString[1024];
14013 FreeIdentifier(exp->member.member);
14014 ProcessExpressionType(argExp);
14016 char * colon = strstr(param->defaultArg.memberString, "::");
14020 char className[1024];
14021 struct __ecereNameSpace__ecere__com__Class * sClass;
14023 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
14024 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
14027 strcpy(thisClassTypeString, _class->fullName);
14029 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
14030 exp->expType = ProcessType(specs, decl);
14031 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
14033 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14034 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14036 int paramCount = 0;
14037 int lastParam = -1;
14038 char templateString[1024];
14039 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14041 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14042 for(cClass = expClass; cClass; cClass = cClass->base)
14046 for(param = cClass->templateParams.first; param; param = param->next)
14049 struct __ecereNameSpace__ecere__com__Class * sClass;
14050 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14052 for(sClass = cClass->base; sClass; sClass = sClass->base)
14053 id += sClass->templateParams.count;
14054 arg = expClass->templateArgs[id];
14055 for(sClass = _class; sClass; sClass = sClass->base)
14057 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
14059 struct __ecereNameSpace__ecere__com__Class * nextClass;
14061 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14062 p += nextClass->templateParams.count;
14063 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
14065 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
14067 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14069 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
14070 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
14077 char argument[256];
14079 argument[0] = '\0';
14080 switch(param->type)
14084 char expString[1024];
14085 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14086 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14087 struct Expression * exp;
14088 char * string = PrintHexUInt64(arg.expression.ui64);
14090 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14091 ProcessExpressionType(exp);
14092 ComputeExpression(exp);
14093 expString[0] = '\0';
14094 PrintExpression(exp, expString);
14095 strcat(argument, expString);
14096 FreeExpression(exp);
14101 strcat(argument, arg.member->name);
14106 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14108 if(!strcmp(arg.dataTypeString, "thisclass"))
14109 strcat(argument, thisClassTypeString);
14111 strcat(argument, arg.dataTypeString);
14119 strcat(templateString, ", ");
14120 if(lastParam != p - 1)
14122 strcat(templateString, param->name);
14123 strcat(templateString, " = ");
14125 strcat(templateString, argument);
14134 int len = strlen(templateString);
14136 if(templateString[len - 1] == '>')
14137 templateString[len++] = ' ';
14138 templateString[len++] = '>';
14139 templateString[len++] = '\0';
14142 struct Context * context = SetupTemplatesContext(_class);
14144 FreeType(exp->expType);
14145 exp->expType = ProcessTypeString(templateString, 0x0);
14146 FinishTemplatesContext(context);
14150 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")))))))));
14153 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
14155 type = ProcessTemplateParameterType(type->templateParameter);
14158 if(type && (type->kind == 20))
14160 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 || (type->kind == 13 && type->type->kind == 1)))
14162 struct Identifier * id = exp->member.member;
14163 int typeKind = type->kind;
14164 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));
14166 if(typeKind == 19 && exp->member.exp->type == 26)
14168 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14173 if(typeKind == 3 || typeKind == 15)
14174 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14177 if(type->kind == 8 && type->_class && type->_class->registered)
14179 _class = type->_class->registered;
14181 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
14183 _class = FindClass("char *")->registered;
14185 else if(type->kind == 13)
14187 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
14188 FreeType(exp->expType);
14189 exp->expType = ProcessTypeString("uintptr", 0x0);
14190 exp->byReference = 0x1;
14194 char string[1024] = "";
14195 struct Symbol * classSym;
14197 PrintTypeNoConst(type, string, 0x0, 0x1);
14198 classSym = FindClass(string);
14200 _class = classSym->registered;
14206 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14207 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14208 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14209 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14210 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14212 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14213 exp->member.memberType = 1;
14214 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14215 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14218 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14220 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14221 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14223 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14225 member = (((void *)0));
14227 if(!member && !prop)
14228 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14229 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14230 exp->member.thisPtr = 0x1;
14236 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14237 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14238 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14240 if(!prop && !member)
14242 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14245 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14246 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14247 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14252 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14253 prop = (((void *)0));
14255 member = (((void *)0));
14259 if(!prop && !member && !method)
14260 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14261 if(!prop && !member && !method)
14265 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14268 exp->member.memberType = 5;
14269 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14273 char structName[1024];
14274 struct Identifier * id = exp->member.member;
14275 struct Expression * classExp = exp->member.exp;
14278 FreeType(classExp->expType);
14279 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14280 strcpy(structName, "__ecereClassData_");
14281 FullClassNameCat(structName, type->_class->string, 0x0);
14283 exp->member.member = id;
14284 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"))))))));
14286 ProcessExpressionType(exp);
14292 struct Symbol * classSym = FindClass(id->string);
14296 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14299 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14305 exp->member.memberType = 1;
14306 if(!prop->dataType)
14307 ProcessPropertyType(prop);
14308 exp->expType = prop->dataType;
14310 prop->dataType->refCount++;
14314 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14316 FreeExpContents(exp);
14318 exp->identifier = MkIdentifier("class");
14319 ProcessExpressionType(exp);
14322 exp->member.memberType = 3;
14323 DeclareStruct(_class->fullName, 0x0);
14324 if(!member->dataType)
14326 struct Context * context = SetupTemplatesContext(_class);
14328 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14329 FinishTemplatesContext(context);
14331 exp->expType = member->dataType;
14332 if(member->dataType)
14333 member->dataType->refCount++;
14335 else if(revConvert)
14337 exp->member.memberType = 4;
14338 exp->expType = MkClassType(revConvert->_class->fullName);
14343 exp->member.memberType = 2;
14345 if(!method->dataType)
14346 ProcessMethodType(method);
14347 exp->expType = __extension__ ({
14348 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14350 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14352 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14353 exp->expType->usedClass = _class;
14355 else if(!classProp)
14357 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14359 FreeExpContents(exp);
14361 exp->identifier = MkIdentifier("class");
14362 ProcessExpressionType(exp);
14365 yylloc = exp->member.member->loc;
14366 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14368 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14370 if(_class && exp->expType)
14372 struct __ecereNameSpace__ecere__com__Class * tClass;
14375 while(tClass && !tClass->templateClass)
14376 tClass = tClass->base;
14377 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14380 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14381 struct __ecereNameSpace__ecere__com__Class * sClass;
14383 for(sClass = tClass; sClass; sClass = sClass->base)
14386 if(sClass->templateClass)
14387 sClass = sClass->templateClass;
14388 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14390 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14392 for(sClass = sClass->base; sClass; sClass = sClass->base)
14393 id += sClass->templateParams.count;
14401 if(curParam && tClass->templateArgs[id].dataTypeString)
14403 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14404 struct Context * context = SetupTemplatesContext(tClass);
14406 FreeType(exp->expType);
14407 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14410 if(exp->expType->kind == 21)
14412 FreeType(exp->expType);
14413 exp->expType = ReplaceThisClassType(_class);
14415 if(tClass->templateClass)
14416 exp->expType->passAsTemplate = 0x1;
14419 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14420 if(exp->destType->kind == 21)
14422 FreeType(exp->destType);
14423 exp->destType = ReplaceThisClassType(_class);
14427 FinishTemplatesContext(context);
14430 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14433 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14434 struct __ecereNameSpace__ecere__com__Class * sClass;
14436 for(sClass = tClass; sClass; sClass = sClass->base)
14439 if(sClass->templateClass)
14440 sClass = sClass->templateClass;
14441 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14443 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14445 for(sClass = sClass->base; sClass; sClass = sClass->base)
14446 id += sClass->templateParams.count;
14456 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14457 struct Context * context = SetupTemplatesContext(tClass);
14458 struct Type * basicType;
14460 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14463 if(basicType->kind == 21)
14465 FreeType(basicType);
14466 basicType = ReplaceThisClassType(_class);
14468 FreeType(exp->expType);
14469 exp->expType = __extension__ ({
14470 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14472 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14476 exp->destType = exp->expType;
14477 exp->destType->refCount++;
14480 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14481 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14482 struct Declarator * decl;
14484 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14487 exp->destType->refCount++;
14489 exp->expType->refCount++;
14491 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14492 exp->cast.exp = newExp;
14495 FinishTemplatesContext(context);
14498 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14500 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14504 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14507 int paramCount = 0;
14508 int lastParam = -1;
14509 char templateString[1024];
14510 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14512 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14513 while(cClass != expClass)
14515 struct __ecereNameSpace__ecere__com__Class * sClass;
14517 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14520 for(param = cClass->templateParams.first; param; param = param->next)
14522 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14525 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14526 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14528 while(cClassCur != tClass && !paramCur)
14530 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14532 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14534 cClassCur = sClassCur;
14535 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14537 if(!strcmp(paramCur->name, param->name))
14544 if(paramCur && paramCur->type == 0)
14545 arg = tClass->templateArgs[cp];
14547 arg = expClass->templateArgs[p];
14549 char argument[256];
14551 argument[0] = '\0';
14552 switch(param->type)
14556 char expString[1024];
14557 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14558 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14559 struct Expression * exp;
14560 char * string = PrintHexUInt64(arg.expression.ui64);
14562 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14563 ProcessExpressionType(exp);
14564 ComputeExpression(exp);
14565 expString[0] = '\0';
14566 PrintExpression(exp, expString);
14567 strcat(argument, expString);
14568 FreeExpression(exp);
14573 strcat(argument, arg.member->name);
14578 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14579 strcat(argument, arg.dataTypeString);
14586 strcat(templateString, ", ");
14587 if(lastParam != p - 1)
14589 strcat(templateString, param->name);
14590 strcat(templateString, " = ");
14592 strcat(templateString, argument);
14601 int len = strlen(templateString);
14603 if(templateString[len - 1] == '>')
14604 templateString[len++] = ' ';
14605 templateString[len++] = '>';
14606 templateString[len++] = '\0';
14608 FreeType(exp->expType);
14610 struct Context * context = SetupTemplatesContext(tClass);
14612 exp->expType = ProcessTypeString(templateString, 0x0);
14613 FinishTemplatesContext(context);
14620 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)");
14622 else if(type && (type->kind == 9 || type->kind == 10))
14624 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14628 exp->expType = memberType;
14630 memberType->refCount++;
14635 char expString[10240];
14637 expString[0] = '\0';
14640 PrintExpression(exp, expString);
14641 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14645 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14647 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14649 struct Identifier * id = exp->member.member;
14650 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));
14654 FreeType(exp->expType);
14655 exp->expType = ReplaceThisClassType(_class);
14659 yylloc = oldyylloc;
14664 struct Type * destType = exp->destType;
14666 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14668 exp->member.member->classSym = exp->member.member->_class->symbol;
14670 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14674 ProcessExpressionType(exp);
14681 struct Symbol * classSym = exp->_class->symbol;
14683 if(classSym && classSym->registered)
14685 if(classSym->registered->type == 5)
14690 DeclareStruct(classSym->string, 0x0);
14691 FreeSpecifier(exp->_class);
14693 FullClassNameCat(name, classSym->string, 0x0);
14694 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14698 if(classSym->registered->fixed)
14700 FreeSpecifier(exp->_class);
14701 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14706 char className[1024];
14708 strcpy(className, "__ecereClass_");
14709 FullClassNameCat(className, classSym->string, 0x1);
14710 MangleClassName(className);
14711 DeclareClass(classSym, className);
14712 FreeExpContents(exp);
14714 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14715 exp->member.member = MkIdentifier("structSize");
14719 exp->expType = __extension__ ({
14720 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14722 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14728 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14730 exp->expType = __extension__ ({
14731 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14733 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14735 exp->isConstant = 0x1;
14736 DeclareType(type, 0x0, 0x0);
14742 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14745 FreeType(exp->cast.exp->destType);
14746 exp->cast.exp->destType = type;
14748 ProcessExpressionType(exp->cast.exp);
14750 exp->expType = type;
14751 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14753 void * prev = exp->prev, * next = exp->next;
14754 struct Type * expType = exp->cast.exp->destType;
14755 struct Expression * castExp = exp->cast.exp;
14756 struct Type * destType = exp->destType;
14759 expType->refCount++;
14760 FreeType(exp->expType);
14761 FreeTypeName(exp->cast.typeName);
14763 FreeType(exp->expType);
14764 FreeType(exp->destType);
14765 exp->expType = expType;
14766 exp->destType = destType;
14767 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14773 exp->isConstant = exp->cast.exp->isConstant;
14779 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14781 exp->expType = type;
14786 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14788 ProcessExpressionType(exp->vaArg.exp);
14789 exp->expType = type;
14794 struct Expression * e;
14796 exp->isConstant = 0x1;
14797 FreeType(exp->cond.cond->destType);
14798 exp->cond.cond->destType = MkClassType("bool");
14799 exp->cond.cond->destType->truth = 0x1;
14800 ProcessExpressionType(exp->cond.cond);
14801 if(!exp->cond.cond->isConstant)
14802 exp->isConstant = 0x0;
14803 for(e = (*exp->cond.exp).first; e; e = e->next)
14807 FreeType(e->destType);
14808 e->destType = exp->destType;
14810 e->destType->refCount++;
14812 ProcessExpressionType(e);
14815 exp->expType = e->expType;
14817 e->expType->refCount++;
14820 exp->isConstant = 0x0;
14822 FreeType(exp->cond.elseExp->destType);
14823 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14824 if(exp->cond.elseExp->destType)
14825 exp->cond.elseExp->destType->refCount++;
14826 ProcessExpressionType(exp->cond.elseExp);
14827 if(!exp->cond.elseExp->isConstant)
14828 exp->isConstant = 0x0;
14833 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14835 struct Statement * last = (*exp->compound->compound.statements).last;
14837 if(last->type == 3 && last->expressions && (*last->expressions).last)
14839 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14841 exp->destType->refCount++;
14843 ProcessStatement(exp->compound);
14844 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14846 exp->expType->refCount++;
14852 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14854 if(spec && spec->type == 1)
14856 exp->expType = MkClassType(spec->name);
14857 exp->expType->kind = 19;
14858 exp->byReference = 0x1;
14862 exp->expType = MkClassType("ecere::com::Class");
14863 exp->byReference = 0x1;
14869 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14873 struct Identifier * id = exp->classData.id;
14874 char structName[1024];
14875 struct Expression * classExp;
14877 strcpy(structName, "__ecereClassData_");
14878 FullClassNameCat(structName, _class->fullName, 0x0);
14880 exp->member.member = id;
14881 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14882 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14884 classExp = MkExpIdentifier(MkIdentifier("class"));
14885 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"))))))));
14886 ProcessExpressionType(exp);
14893 struct Type * type = (((void *)0));
14894 char * typeString = (((void *)0));
14895 char typeStringBuf[1024];
14897 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))
14899 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14901 typeString = templateClass->templateArgs[2].dataTypeString;
14905 struct Expression * e;
14907 for(e = (*exp->list).first; e; e = e->next)
14909 ProcessExpressionType(e);
14919 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14923 e->expType = (((void *)0));
14924 e = (*exp->list).first;
14925 ProcessExpressionType(e);
14928 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14930 FreeType(e->expType);
14931 e->expType = (((void *)0));
14933 type = (((void *)0));
14941 FreeType(e->expType);
14942 e->expType = (((void *)0));
14948 typeStringBuf[0] = '\0';
14949 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
14950 typeString = typeStringBuf;
14952 type = (((void *)0));
14957 char templateString[1024];
14958 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14959 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14960 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14961 struct Expression * expExt;
14962 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14964 sprintf(templateString, "Container<%s>", typeString);
14967 struct Expression * e;
14969 type = ProcessTypeString(typeString, 0x0);
14970 while(e = (*exp->list).first)
14972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14973 e->destType = type;
14975 ProcessExpressionType(e);
14976 ListAdd(initializers, MkInitializerAssignment(e));
14979 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14981 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14982 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14983 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14984 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14985 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14986 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14987 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14988 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14989 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14990 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
14991 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14993 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
14995 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14996 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14997 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14998 exp->expType = ProcessTypeString(templateString, 0x0);
15000 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
15001 ProcessExpressionType(expExt);
15005 exp->expType = ProcessTypeString("Container", 0x0);
15006 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15011 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
15013 FreeType(exp->expType);
15014 exp->expType = ReplaceThisClassType(thisClass);
15016 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
15018 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
15022 if(exp->expType->kind != 15)
15024 struct Type * member;
15025 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
15027 FreeType(exp->expType);
15028 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15029 exp->expType->kind = symbol->type->kind;
15030 exp->expType->refCount++;
15031 exp->expType->enumName = enumName;
15032 exp->expType->members = symbol->type->members;
15033 for(member = symbol->type->members.first; member; member = member->next)
15034 member->refCount++;
15038 struct __ecereNameSpace__ecere__sys__NamedLink * member;
15040 for(member = symbol->type->members.first; member; member = member->next)
15042 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
15044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
15050 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
15052 else if(exp->destType && !exp->destType->keepCast)
15054 if(!CheckExpressionType(exp, exp->destType, 0x0))
15056 if(!exp->destType->count || unresolved)
15061 if(exp->destType->kind != 14)
15068 char expString[10240];
15070 expString[0] = '\0';
15071 PrintType(exp->destType, type2, 0x0, 0x1);
15074 PrintExpression(exp, expString);
15075 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15078 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
15079 else if(exp->type != 16)
15080 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
15085 char expString[10240];
15087 expString[0] = '\0';
15090 PrintExpression(exp, expString);
15091 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
15095 else if(exp->type != 16)
15096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15108 PrintType(exp->expType, type1, 0x0, 0x1);
15109 PrintType(exp->destType, type2, 0x0, 0x1);
15111 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)))
15115 char expString[10240];
15117 expString[0] = '\0';
15120 PrintExpression(exp, expString);
15121 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15123 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
15124 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
15125 FreeType(exp->expType);
15126 exp->destType->refCount++;
15127 exp->expType = exp->destType;
15132 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
15134 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15135 char typeString[1024];
15136 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15137 struct Declarator * decl;
15139 typeString[0] = '\0';
15142 exp->expType->refCount++;
15144 exp->expType->refCount++;
15146 newExp->destType = exp->expType;
15147 PrintType(exp->expType, typeString, 0x0, 0x0);
15148 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15149 exp->cast.typeName = MkTypeName(specs, decl);
15150 exp->cast.exp = newExp;
15153 else if(unresolved)
15155 if(exp->identifier->_class && exp->identifier->_class->name)
15156 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
15157 else if(exp->identifier->string && exp->identifier->string[0])
15158 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
15160 else if(!exp->expType && exp->type != 16)
15162 char expString[10240];
15164 expString[0] = '\0';
15167 PrintExpression(exp, expString);
15168 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15173 ApplyAnyObjectLogic(exp);
15174 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)))
15176 exp->byReference = 0x1;
15178 yylloc = oldyylloc;
15181 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)
15185 *curMember = (*curMember)->next;
15186 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
15188 *curMember = subMemberStack[--(*subMemberStackPos)];
15189 *curMember = (*curMember)->next;
15191 while((*curMember) && (*curMember)->isProperty)
15192 *curMember = (*curMember)->next;
15193 if(subMemberStackPos)
15195 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15197 subMemberStack[(*subMemberStackPos)++] = *curMember;
15198 *curMember = (*curMember)->members.first;
15199 while(*curMember && (*curMember)->isProperty)
15200 *curMember = (*curMember)->next;
15208 if(subMemberStackPos && *subMemberStackPos)
15210 *curMember = subMemberStack[--(*subMemberStackPos)];
15211 *curMember = (*curMember)->next;
15215 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15217 if(*curClass == _class)
15219 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15221 *curMember = (*curClass)->membersAndProperties.first;
15223 while((*curMember) && (*curMember)->isProperty)
15224 *curMember = (*curMember)->next;
15225 if(subMemberStackPos)
15227 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15229 subMemberStack[(*subMemberStackPos)++] = *curMember;
15230 *curMember = (*curMember)->members.first;
15231 while(*curMember && (*curMember)->isProperty)
15232 *curMember = (*curMember)->next;
15239 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15244 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15246 if(init->exp && !init->exp->destType)
15248 FreeType(init->exp->destType);
15249 init->exp->destType = type;
15255 ProcessExpressionType(init->exp);
15256 init->isConstant = init->exp->isConstant;
15262 struct Expression * exp = init->exp;
15263 struct Instantiation * inst = exp->instance;
15264 struct MembersInit * members;
15267 init->list = MkList();
15270 for(members = (*inst->members).first; members; members = members->next)
15272 if(members->type == 0)
15274 struct MemberInit * member;
15276 for(member = (*members->dataMembers).first; member; member = member->next)
15278 ListAdd(init->list, member->initializer);
15279 member->initializer = (((void *)0));
15284 FreeExpression(exp);
15288 struct Initializer * i;
15289 struct Type * initializerType = (((void *)0));
15290 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15291 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15292 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15293 int subMemberStackPos = 0;
15295 if(type && type->kind == 12)
15296 initializerType = Dereference(type);
15297 else if(type && (type->kind == 9 || type->kind == 10))
15298 initializerType = type->members.first;
15299 for(i = (*init->list).first; i; i = i->next)
15301 if(type && type->kind == 8 && type->_class && type->_class->registered)
15303 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15306 if(!curMember->dataType)
15307 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15308 initializerType = curMember->dataType;
15311 ProcessInitializer(i, initializerType);
15312 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15313 initializerType = initializerType->next;
15315 init->isConstant = 0x0;
15317 if(type && type->kind == 12)
15318 FreeType(initializerType);
15319 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15321 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15328 extern struct Symbol * FindType(struct Context * ctx, char * name);
15330 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15332 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15338 if(spec->specifier == THISCLASS)
15343 spec->name = ReplaceThisClass(thisClass);
15344 spec->symbol = FindClass(spec->name);
15345 ProcessSpecifier(spec, declareStruct);
15352 struct Symbol * symbol = FindType(curContext, spec->name);
15355 DeclareType(symbol->type, 0x1, 0x1);
15356 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15357 DeclareStruct(spec->name, 0x0);
15362 struct Enumerator * e;
15366 for(e = (*spec->list).first; e; e = e->next)
15369 ProcessExpressionType(e->exp);
15377 if(spec->definitions)
15379 struct ClassDef * def;
15380 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15382 ProcessClass(spec->definitions, symbol);
15389 static void ProcessDeclarator(struct Declarator * decl)
15394 if(decl->identifier->classSym)
15396 FreeSpecifier(decl->identifier->_class);
15397 decl->identifier->_class = (((void *)0));
15401 if(decl->array.exp)
15402 ProcessExpressionType(decl->array.exp);
15409 if(decl->declarator)
15410 ProcessDeclarator(decl->declarator);
15411 if(decl->type == 4)
15413 struct Identifier * id = GetDeclId(decl);
15415 if(id && id->_class)
15417 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15419 if(!decl->function.parameters)
15420 decl->function.parameters = MkList();
15421 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15422 id->_class = (((void *)0));
15424 if(decl->function.parameters)
15426 struct TypeName * param;
15428 for(param = (*decl->function.parameters).first; param; param = param->next)
15430 if(param->qualifiers && (*param->qualifiers).first)
15432 struct Specifier * spec = (*param->qualifiers).first;
15434 if(spec && spec->specifier == TYPED_OBJECT)
15436 struct Declarator * d = param->declarator;
15437 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);
15439 FreeList(param->qualifiers, FreeSpecifier);
15440 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15441 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15445 else if(spec && spec->specifier == ANY_OBJECT)
15447 struct Declarator * d = param->declarator;
15449 FreeList(param->qualifiers, FreeSpecifier);
15450 param->qualifiers = MkListOne(MkSpecifier(VOID));
15451 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15453 else if(spec->specifier == THISCLASS)
15458 spec->name = ReplaceThisClass(thisClass);
15459 spec->symbol = FindClass(spec->name);
15460 ProcessSpecifier(spec, 0x0);
15464 if(param->declarator)
15465 ProcessDeclarator(param->declarator);
15473 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15475 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15477 static void ProcessDeclaration(struct Declaration * decl)
15479 yylloc = decl->loc;
15484 unsigned int declareStruct = 0x0;
15486 if(decl->declarators)
15488 struct InitDeclarator * d;
15490 for(d = (*decl->declarators).first; d; d = d->next)
15492 struct Type * type, * subType;
15494 ProcessDeclarator(d->declarator);
15495 type = ProcessType(decl->specifiers, d->declarator);
15498 ProcessInitializer(d->initializer, type);
15499 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15501 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15503 struct Instantiation * inst = d->initializer->exp->instance;
15505 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15506 d->initializer->exp->instance = (((void *)0));
15507 if(decl->specifiers)
15508 FreeList(decl->specifiers, FreeSpecifier);
15509 FreeList(decl->declarators, FreeInitDeclarator);
15516 for(subType = type; subType; )
15518 if(subType->kind == 8)
15520 declareStruct = 0x1;
15523 else if(subType->kind == 13)
15525 else if(subType->kind == 12)
15526 subType = subType->arrayType;
15535 if(decl->specifiers)
15537 struct Specifier * s;
15539 for(s = (*decl->specifiers).first; s; s = s->next)
15541 ProcessSpecifier(s, declareStruct);
15548 ProcessInstantiationType(decl->inst);
15553 struct Specifier * spec;
15554 struct Declarator * d;
15555 unsigned int declareStruct = 0x0;
15557 if(decl->declarators)
15559 for(d = (*decl->declarators).first; d; d = d->next)
15561 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15562 struct Type * subType;
15564 ProcessDeclarator(d);
15565 for(subType = type; subType; )
15567 if(subType->kind == 8)
15569 declareStruct = 0x1;
15572 else if(subType->kind == 13)
15574 else if(subType->kind == 12)
15575 subType = subType->arrayType;
15582 if(decl->specifiers)
15584 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15585 ProcessSpecifier(spec, declareStruct);
15592 static struct FunctionDefinition * curFunction;
15594 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15596 char propName[1024], propNameM[1024];
15597 char getName[1024], setName[1024];
15598 struct __ecereNameSpace__ecere__sys__OldList * args;
15600 DeclareProperty(prop, setName, getName);
15601 strcpy(propName, "__ecereProp_");
15602 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15603 strcat(propName, "_");
15604 FullClassNameCat(propName, prop->name, 0x1);
15605 MangleClassName(propName);
15606 strcpy(propNameM, "__ecerePropM_");
15607 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15608 strcat(propNameM, "_");
15609 FullClassNameCat(propNameM, prop->name, 0x1);
15610 MangleClassName(propNameM);
15611 if(prop->isWatchable)
15614 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15615 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15616 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15618 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15619 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15620 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15624 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15625 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15626 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15628 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15629 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15630 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15632 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15633 curFunction->propSet->fireWatchersDone = 0x1;
15636 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15638 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15640 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15642 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15644 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15646 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15648 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15650 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15652 static void ProcessStatement(struct Statement * stmt)
15654 yylloc = stmt->loc;
15658 ProcessStatement(stmt->labeled.stmt);
15661 if(stmt->caseStmt.exp)
15663 FreeType(stmt->caseStmt.exp->destType);
15664 stmt->caseStmt.exp->destType = curSwitchType;
15666 curSwitchType->refCount++;
15667 ProcessExpressionType(stmt->caseStmt.exp);
15668 ComputeExpression(stmt->caseStmt.exp);
15670 if(stmt->caseStmt.stmt)
15671 ProcessStatement(stmt->caseStmt.stmt);
15675 if(stmt->compound.context)
15677 struct Declaration * decl;
15678 struct Statement * s;
15679 struct Statement * prevCompound = curCompound;
15680 struct Context * prevContext = curContext;
15682 if(!stmt->compound.isSwitch)
15684 curCompound = stmt;
15685 curContext = stmt->compound.context;
15687 if(stmt->compound.declarations)
15689 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15690 ProcessDeclaration(decl);
15692 if(stmt->compound.statements)
15694 for(s = (*stmt->compound.statements).first; s; s = s->next)
15695 ProcessStatement(s);
15697 curContext = prevContext;
15698 curCompound = prevCompound;
15704 struct Expression * exp;
15706 if(stmt->expressions)
15708 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15709 ProcessExpressionType(exp);
15715 struct Expression * exp;
15717 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15718 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15719 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15720 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15722 ProcessExpressionType(exp);
15724 if(stmt->ifStmt.stmt)
15725 ProcessStatement(stmt->ifStmt.stmt);
15726 if(stmt->ifStmt.elseStmt)
15727 ProcessStatement(stmt->ifStmt.elseStmt);
15732 struct Type * oldSwitchType = curSwitchType;
15734 if(stmt->switchStmt.exp)
15736 struct Expression * exp;
15738 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15742 ProcessExpressionType(exp);
15745 curSwitchType = exp->expType;
15748 ProcessStatement(stmt->switchStmt.stmt);
15749 curSwitchType = oldSwitchType;
15754 if(stmt->whileStmt.exp)
15756 struct Expression * exp;
15758 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15759 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15760 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15761 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15763 ProcessExpressionType(exp);
15766 if(stmt->whileStmt.stmt)
15767 ProcessStatement(stmt->whileStmt.stmt);
15772 if(stmt->doWhile.exp)
15774 struct Expression * exp;
15776 if((*stmt->doWhile.exp).last)
15778 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15779 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15780 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15782 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15784 ProcessExpressionType(exp);
15787 if(stmt->doWhile.stmt)
15788 ProcessStatement(stmt->doWhile.stmt);
15793 struct Expression * exp;
15795 if(stmt->forStmt.init)
15796 ProcessStatement(stmt->forStmt.init);
15797 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15799 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15800 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15801 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15803 if(stmt->forStmt.check)
15804 ProcessStatement(stmt->forStmt.check);
15805 if(stmt->forStmt.increment)
15807 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15808 ProcessExpressionType(exp);
15810 if(stmt->forStmt.stmt)
15811 ProcessStatement(stmt->forStmt.stmt);
15816 struct Identifier * id = stmt->forEachStmt.id;
15817 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15818 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15819 struct Statement * block = stmt->forEachStmt.stmt;
15820 char iteratorType[1024];
15821 struct Type * source;
15822 struct Expression * e;
15823 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));
15824 struct Expression * arrayExp;
15825 char * typeString = (((void *)0));
15826 int builtinCount = 0;
15828 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15832 FreeType(e->destType);
15833 e->destType = ProcessTypeString("Container", 0x0);
15835 if(!isBuiltin || e->next)
15836 ProcessExpressionType(e);
15838 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15839 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15841 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15842 struct Symbol * symbol;
15843 struct Expression * expIt = (((void *)0));
15844 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15845 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15846 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15847 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15850 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15851 stmt->compound.context->parent = curContext;
15852 curContext = stmt->compound.context;
15853 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15855 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15856 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15858 isCustomAVLTree = 0x1;
15859 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15861 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15864 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15866 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15868 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15871 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15875 struct Declarator * decl;
15876 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15878 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15879 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15880 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15884 struct Type * type = (((void *)0));
15885 char typeStringBuf[1024];
15887 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15888 if(((struct Expression *)(*exp).last)->type == 11)
15890 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15893 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15895 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)
15897 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15899 typeString = templateClass->templateArgs[2].dataTypeString;
15901 else if(arrayExp->list)
15903 struct Expression * e;
15905 for(e = (*arrayExp->list).first; e; e = e->next)
15907 ProcessExpressionType(e);
15917 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15921 e->expType = (((void *)0));
15922 e = (*arrayExp->list).first;
15923 ProcessExpressionType(e);
15926 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15928 FreeType(e->expType);
15929 e->expType = (((void *)0));
15931 type = (((void *)0));
15939 FreeType(e->expType);
15940 e->expType = (((void *)0));
15946 typeStringBuf[0] = '\0';
15947 PrintType(type, typeStringBuf, 0x0, 0x1);
15948 typeString = typeStringBuf;
15954 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15955 struct Declarator * decl;
15956 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15960 struct Expression * e;
15962 builtinCount = (*arrayExp->list).count;
15963 type = ProcessTypeString(typeString, 0x0);
15964 while(e = (*arrayExp->list).first)
15966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15967 e->destType = type;
15969 ProcessExpressionType(e);
15970 ListAdd(initializers, MkInitializerAssignment(e));
15973 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15975 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15976 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15977 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15978 FreeList(exp, FreeExpression);
15982 arrayExp->expType = ProcessTypeString("Container", 0x0);
15983 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15986 else if(isLinkList && !isList)
15988 struct Declarator * decl;
15989 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15991 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15992 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15993 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15995 else if(_class->templateArgs)
15998 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
16000 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
16001 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
16003 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
16004 if(block && block->type == 2 && block->compound.context)
16006 block->compound.context->parent = stmt->compound.context;
16010 block = MkIfStmt(filter, block, (((void *)0)));
16014 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));
16015 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16016 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16017 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16023 sprintf(count, "%d", builtinCount);
16024 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));
16025 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16026 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16027 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16029 else if(isLinkList && !isList)
16031 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
16032 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
16034 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
16036 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));
16040 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16041 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
16043 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));
16045 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16046 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16047 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16051 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
16053 ProcessExpressionType(expIt);
16054 if((*stmt->compound.declarations).first)
16055 ProcessDeclaration((*stmt->compound.declarations).first);
16057 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
16058 ProcessStatement(stmt);
16059 curContext = stmt->compound.context->parent;
16064 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
16076 struct Expression * exp;
16078 if(stmt->expressions)
16080 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16084 if(curFunction && !curFunction->type)
16085 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
16086 FreeType(exp->destType);
16087 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
16089 exp->destType->refCount++;
16091 ProcessExpressionType(exp);
16098 ProcessDeclaration(stmt->decl);
16103 struct AsmField * field;
16105 if(stmt->asmStmt.inputFields)
16107 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
16108 if(field->expression)
16109 ProcessExpressionType(field->expression);
16111 if(stmt->asmStmt.outputFields)
16113 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
16114 if(field->expression)
16115 ProcessExpressionType(field->expression);
16117 if(stmt->asmStmt.clobberedFields)
16119 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
16121 if(field->expression)
16122 ProcessExpressionType(field->expression);
16129 struct PropertyWatch * propWatch;
16130 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16131 struct Expression * object = stmt->_watch.object;
16132 struct Expression * watcher = stmt->_watch.watcher;
16135 ProcessExpressionType(watcher);
16137 ProcessExpressionType(object);
16140 if(watcher || thisClass)
16142 struct External * external = curExternal;
16143 struct Context * context = curContext;
16146 stmt->expressions = MkList();
16147 curExternal = external->prev;
16148 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16150 struct ClassFunction * func;
16151 char watcherName[1024];
16152 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
16153 struct External * createdExternal;
16154 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
16156 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
16157 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
16158 if(propWatch->deleteWatch)
16159 strcat(watcherName, "_delete");
16162 struct Identifier * propID;
16164 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16166 strcat(watcherName, "_");
16167 strcat(watcherName, propID->string);
16170 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
16172 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
16173 ProcessClassFunctionBody(func, propWatch->compound);
16174 propWatch->compound = (((void *)0));
16175 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
16176 createdExternal->symbol->idCode = external->symbol->idCode;
16177 curExternal = createdExternal;
16178 ProcessFunction(createdExternal->function);
16180 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
16182 externalDecl->declaration = decl;
16183 if(decl->symbol && !decl->symbol->pointerExternal)
16184 decl->symbol->pointerExternal = externalDecl;
16186 if(propWatch->deleteWatch)
16188 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16190 ListAdd(args, CopyExpression(object));
16191 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16192 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16193 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16197 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16198 struct Identifier * propID;
16200 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16202 char propName[1024];
16203 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16207 char getName[1024], setName[1024];
16208 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16210 DeclareProperty(prop, setName, getName);
16211 strcpy(propName, "__ecereProp_");
16212 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16213 strcat(propName, "_");
16214 FullClassNameCat(propName, prop->name, 0x1);
16215 ListAdd(args, CopyExpression(object));
16216 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16217 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16218 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16219 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16222 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16227 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16229 curExternal = external;
16230 curContext = context;
16232 FreeExpression(watcher);
16234 FreeExpression(object);
16235 FreeList(watches, FreePropertyWatch);
16238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16242 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16244 ProcessStatement(propWatch->compound);
16251 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16252 struct Expression * object = stmt->_watch.object;
16253 struct __ecereNameSpace__ecere__com__Class * _class;
16256 ProcessExpressionType(object);
16259 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16262 struct Identifier * propID;
16265 stmt->expressions = MkList();
16266 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16268 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16275 for(propID = (*watches).first; propID; propID = propID->next)
16277 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16281 CreateFireWatcher(prop, object, stmt);
16284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16289 struct __ecereNameSpace__ecere__com__Property * prop;
16290 struct __ecereNameSpace__ecere__com__Class * base;
16292 for(base = _class; base; base = base->base)
16294 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16296 if(prop->isProperty && prop->isWatchable)
16298 CreateFireWatcher(prop, object, stmt);
16304 FreeExpression(object);
16305 FreeList(watches, FreeIdentifier);
16308 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16314 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16315 struct Expression * object = stmt->_watch.object;
16316 struct Expression * watcher = stmt->_watch.watcher;
16317 struct __ecereNameSpace__ecere__com__Class * _class;
16320 ProcessExpressionType(object);
16322 ProcessExpressionType(watcher);
16325 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16326 if(watcher || thisClass)
16330 struct Identifier * propID;
16333 stmt->expressions = MkList();
16336 struct __ecereNameSpace__ecere__sys__OldList * args;
16339 ListAdd(args, CopyExpression(object));
16340 ListAdd(args, MkExpConstant("0"));
16341 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16342 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16346 for(propID = (*watches).first; propID; propID = propID->next)
16348 char propName[1024];
16349 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16353 char getName[1024], setName[1024];
16354 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16356 DeclareProperty(prop, setName, getName);
16357 strcpy(propName, "__ecereProp_");
16358 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16359 strcat(propName, "_");
16360 FullClassNameCat(propName, prop->name, 0x1);
16361 MangleClassName(propName);
16362 ListAdd(args, CopyExpression(object));
16363 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16364 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16365 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16368 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16372 FreeExpression(object);
16374 FreeExpression(watcher);
16375 FreeList(watches, FreeIdentifier);
16378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16381 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16388 extern struct Expression * QBrackets(struct Expression * exp);
16390 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16392 extern struct Declarator * QMkPtrDecl(char * id);
16394 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16396 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16398 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16400 static void ProcessFunction(struct FunctionDefinition * function)
16402 struct Identifier * id = GetDeclId(function->declarator);
16403 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16404 struct Type * type = symbol ? symbol->type : (((void *)0));
16405 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16406 struct Context * oldTopContext = topContext;
16408 yylloc = function->loc;
16409 if(type && type->thisClass)
16411 struct Symbol * classSym = type->thisClass;
16412 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16413 char className[1024];
16414 char structName[1024];
16415 struct Declarator * funcDecl;
16416 struct Symbol * thisSymbol;
16417 unsigned int typedObject = 0x0;
16419 if(_class && !_class->base)
16421 _class = currentClass;
16422 if(_class && !_class->symbol)
16423 _class->symbol = FindClass(_class->fullName);
16424 classSym = _class ? _class->symbol : (((void *)0));
16427 thisClass = _class;
16428 if(inCompiler && _class)
16430 if(type->kind == 11)
16432 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16434 struct Type * param = symbol->type->params.first;
16436 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16439 if(type->classObjectType != 1)
16441 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16442 symbol->type->staticMethod = 0x1;
16443 symbol->type->thisClass = (((void *)0));
16444 symbol->type->extraParam = 0x0;
16447 strcpy(className, "__ecereClass_");
16448 FullClassNameCat(className, _class->fullName, 0x1);
16449 MangleClassName(className);
16450 structName[0] = (char)0;
16451 FullClassNameCat(structName, _class->fullName, 0x0);
16452 funcDecl = GetFuncDecl(function->declarator);
16455 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16457 struct TypeName * param = (*funcDecl->function.parameters).first;
16459 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16462 FreeTypeName(param);
16465 if(!function->propertyNoThis)
16467 struct TypeName * thisParam;
16469 if(type->classObjectType != 1)
16471 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16472 if(!funcDecl->function.parameters)
16473 funcDecl->function.parameters = MkList();
16474 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16478 if(type->classObjectType != 1)
16480 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16481 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16483 thisParam = __extension__ ({
16484 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16486 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16488 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16492 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16494 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16496 funcDecl = GetFuncDecl(initDecl->declarator);
16499 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16501 struct TypeName * param = (*funcDecl->function.parameters).first;
16503 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16506 FreeTypeName(param);
16509 if(type->classObjectType != 1)
16511 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16513 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16515 if(!funcDecl->function.parameters)
16516 funcDecl->function.parameters = MkList();
16517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16525 if(type->classObjectType != 1)
16527 thisSymbol = __extension__ ({
16528 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16530 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16532 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16533 if(typedObject && thisSymbol->type)
16535 thisSymbol->type->classObjectType = 2;
16536 thisSymbol->type->byReference = type->byReference;
16537 thisSymbol->type->typedByReference = type->byReference;
16541 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16543 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16546 struct __ecereNameSpace__ecere__com__Class * base;
16548 for(base = _class; base && base->type != 1000; base = base->next)
16550 for(member = base->membersAndProperties.first; member; member = member->next)
16551 if(!member->isProperty)
16557 for(member = _class->membersAndProperties.first; member; member = member->next)
16558 if(!member->isProperty)
16562 char pointerName[1024];
16563 struct Declaration * decl;
16564 struct Initializer * initializer;
16565 struct Expression * exp, * bytePtr;
16567 strcpy(pointerName, "__ecerePointer_");
16568 FullClassNameCat(pointerName, _class->fullName, 0x0);
16570 char className[1024];
16572 strcpy(className, "__ecereClass_");
16573 FullClassNameCat(className, classSym->string, 0x1);
16574 MangleClassName(className);
16575 DeclareClass(classSym, className);
16577 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16582 sprintf(string, "%d", _class->offset);
16583 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16587 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16589 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16590 exp->expType = __extension__ ({
16591 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16593 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16594 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16596 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16597 }), __ecereInstance2;
16601 yylloc = function->body->loc;
16602 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16604 struct Context * prevContext = curContext;
16606 curContext = function->body->compound.context;
16607 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16608 curContext = prevContext;
16610 decl->symbol = (((void *)0));
16611 if(!function->body->compound.declarations)
16612 function->body->compound.declarations = MkList();
16613 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16619 thisClass = (((void *)0));
16622 FreeSpecifier(id->_class);
16623 id->_class = (((void *)0));
16624 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16626 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16628 id = GetDeclId(initDecl->declarator);
16629 FreeSpecifier(id->_class);
16630 id->_class = (((void *)0));
16634 topContext = function->body->compound.context;
16636 struct FunctionDefinition * oldFunction = curFunction;
16638 curFunction = function;
16640 ProcessStatement(function->body);
16641 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16643 struct Statement * prevCompound = curCompound;
16644 struct Context * prevContext = curContext;
16645 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16647 if(!function->body->compound.statements)
16648 function->body->compound.statements = MkList();
16649 ListAdd(function->body->compound.statements, fireWatchers);
16650 curCompound = function->body;
16651 curContext = function->body->compound.context;
16652 ProcessStatement(fireWatchers);
16653 curContext = prevContext;
16654 curCompound = prevCompound;
16656 curFunction = oldFunction;
16658 if(function->declarator)
16660 ProcessDeclarator(function->declarator);
16662 topContext = oldTopContext;
16663 thisClass = oldThisClass;
16666 extern void FreeSymbol(struct Symbol * symbol);
16668 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16670 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16672 struct ClassDef * def;
16673 struct External * external = curExternal;
16674 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16676 for(def = definitions->first; def; def = def->next)
16680 if(def->function->declarator)
16681 curExternal = def->function->declarator->symbol->pointerExternal;
16683 curExternal = external;
16684 ProcessFunction((struct FunctionDefinition *)def->function);
16686 else if(def->type == 2)
16688 if(def->decl->type == 2)
16690 thisClass = regClass;
16691 ProcessInstantiationType(def->decl->inst);
16692 thisClass = (((void *)0));
16696 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16699 thisClass = regClass;
16700 ProcessDeclaration(def->decl);
16701 thisClass = backThisClass;
16704 else if(def->type == 1 && def->defProperties)
16706 struct MemberInit * defProperty;
16707 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);
16709 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16710 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16712 thisClass = regClass;
16713 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16714 thisClass = (((void *)0));
16716 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16717 FreeSymbol(thisSymbol);
16719 else if(def->type == 3 && def->propertyDef)
16721 struct PropertyDef * prop = def->propertyDef;
16723 thisClass = regClass;
16728 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16730 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16732 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16733 ProcessStatement(prop->setStmt);
16739 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16741 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16743 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16744 ProcessStatement(prop->getStmt);
16746 if(prop->issetStmt)
16750 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16752 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16754 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16755 ProcessStatement(prop->issetStmt);
16757 thisClass = (((void *)0));
16759 else if(def->type == 4 && def->propertyWatch)
16761 struct PropertyWatch * propertyWatch = def->propertyWatch;
16763 thisClass = regClass;
16764 if(propertyWatch->compound)
16766 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);
16768 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16769 curExternal = (((void *)0));
16770 ProcessStatement(propertyWatch->compound);
16772 thisClass = (((void *)0));
16777 void DeclareFunctionUtil(char * s)
16779 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16786 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16787 strcpy(name, "__ecereFunction_");
16788 FullClassNameCat(name, s, 0x0);
16789 DeclareFunction(function, name);
16793 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16795 void ComputeDataTypes()
16797 struct External * external;
16798 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16799 struct External * after = (((void *)0));
16801 currentClass = (((void *)0));
16802 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16803 for(external = (*ast).first; external; external = external->next)
16805 if(external->type == 1)
16807 struct Declaration * decl = external->declaration;
16811 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16815 struct InitDeclarator * initDecl = (*decls).first;
16819 struct Declarator * declarator = initDecl->declarator;
16821 if(declarator && declarator->type == 1)
16823 struct Identifier * id = declarator->identifier;
16825 if(id && id->string)
16827 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16829 external->symbol->id = -1001, external->symbol->idCode = -1001;
16839 temp->symbol = __extension__ ({
16840 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16842 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16844 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16845 curExternal = temp;
16846 DeclareFunctionUtil("eSystem_New");
16847 DeclareFunctionUtil("eSystem_New0");
16848 DeclareFunctionUtil("eSystem_Renew");
16849 DeclareFunctionUtil("eSystem_Renew0");
16850 DeclareFunctionUtil("eClass_GetProperty");
16851 DeclareStruct("ecere::com::Class", 0x0);
16852 DeclareStruct("ecere::com::Instance", 0x0);
16853 DeclareStruct("ecere::com::Property", 0x0);
16854 DeclareStruct("ecere::com::DataMember", 0x0);
16855 DeclareStruct("ecere::com::Method", 0x0);
16856 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16857 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16858 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16859 for(external = (*ast).first; external; external = external->next)
16861 afterExternal = curExternal = external;
16862 if(external->type == 0)
16864 currentClass = external->function->_class;
16865 ProcessFunction(external->function);
16867 else if(external->type == 1)
16869 currentClass = (((void *)0));
16870 ProcessDeclaration(external->declaration);
16872 else if(external->type == 2)
16874 struct ClassDefinition * _class = external->_class;
16876 currentClass = external->symbol->registered;
16877 if(_class->definitions)
16879 ProcessClass(_class->definitions, _class->symbol);
16883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16884 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16887 else if(external->type == 4)
16889 thisNameSpace = external->id->string;
16892 currentClass = (((void *)0));
16893 thisNameSpace = (((void *)0));
16894 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16895 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16898 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);
16900 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);
16902 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16904 struct __ecereNameSpace__ecere__com__Class * class;
16906 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16907 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16908 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16909 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16910 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16911 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16912 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16913 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16914 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16915 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16916 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16917 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16918 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16919 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16920 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16921 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16922 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16923 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16924 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16925 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16926 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16927 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16928 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16929 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16930 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16931 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16932 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16933 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16934 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16935 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16936 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16937 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16938 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16939 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16940 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16941 __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);
16942 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16943 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16944 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16945 __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);
16946 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16947 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16948 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16949 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16950 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16951 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16952 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16953 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16954 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16955 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16958 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16959 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16960 __ecereClass_Conversion = class;
16961 __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);
16962 __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);
16963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16964 __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);
16965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
16976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16985 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)