2 typedef long long int64;
3 typedef unsigned long long uint64;
7 #elif defined(__TINYC__)
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
19 typedef long long int64;
20 typedef unsigned long long uint64;
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
26 #define __ENDIAN_PAD(x) (8 - (x))
28 #define __ENDIAN_PAD(x) 0
32 typedef unsigned long long int uintptr_t;
33 typedef long long int intptr_t;
35 typedef unsigned int uintptr_t;
41 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
43 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
45 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
49 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
51 struct __ecereNameSpace__ecere__sys__BTNode;
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
55 struct __ecereNameSpace__ecere__sys__BinaryTree
57 struct __ecereNameSpace__ecere__sys__BTNode * root;
59 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
60 void (* FreeKey)(void * key);
61 } __attribute__ ((gcc_struct));
63 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
65 struct __ecereNameSpace__ecere__sys__OldList
72 } __attribute__ ((gcc_struct));
74 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
76 struct __ecereNameSpace__ecere__com__Method
79 struct __ecereNameSpace__ecere__com__Method * parent;
80 struct __ecereNameSpace__ecere__com__Method * left;
81 struct __ecereNameSpace__ecere__com__Method * right;
86 struct __ecereNameSpace__ecere__com__Class * _class;
88 char * dataTypeString;
89 struct Type * dataType;
91 } __attribute__ ((gcc_struct));
93 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
95 struct __ecereNameSpace__ecere__com__Property
97 struct __ecereNameSpace__ecere__com__Property * prev;
98 struct __ecereNameSpace__ecere__com__Property * next;
100 unsigned int isProperty;
103 struct __ecereNameSpace__ecere__com__Class * _class;
104 char * dataTypeString;
105 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
106 struct Type * dataType;
107 void (* Set)(void * , int);
108 int (* Get)(void * );
109 unsigned int (* IsSet)(void * );
113 unsigned int conversion;
114 unsigned int watcherOffset;
116 unsigned int compiled;
117 unsigned int selfWatchable;
118 unsigned int isWatchable;
119 } __attribute__ ((gcc_struct));
121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128 unsigned int included;
129 } __attribute__ ((gcc_struct));
131 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
135 struct CodePosition start;
136 struct CodePosition end;
137 } __attribute__ ((gcc_struct));
139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
152 struct Attrib * attr;
153 } __attribute__ ((gcc_struct));
154 } __attribute__ ((gcc_struct));
156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
158 struct ClassDefinition
160 struct ClassDefinition * prev;
161 struct ClassDefinition * next;
163 struct Specifier * _class;
164 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
165 struct __ecereNameSpace__ecere__sys__OldList * definitions;
166 struct Symbol * symbol;
167 struct Location blockStart;
168 struct Location nameLoc;
171 unsigned int deleteWatchable;
172 } __attribute__ ((gcc_struct));
174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
178 struct Context * parent;
179 struct __ecereNameSpace__ecere__sys__BinaryTree types;
180 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
181 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
182 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
185 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
186 struct ClassDefinition * classDef;
187 unsigned int templateTypesOnly;
188 unsigned int hasNameSpace;
189 } __attribute__ ((gcc_struct));
191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
195 struct Instantiation * prev;
196 struct Instantiation * next;
198 struct Specifier * _class;
199 struct Expression * exp;
200 struct __ecereNameSpace__ecere__sys__OldList * members;
201 struct Symbol * symbol;
202 unsigned int fullSet;
203 unsigned int isConstant;
204 unsigned char * data;
205 struct Location nameLoc;
206 struct Location insideLoc;
208 } __attribute__ ((gcc_struct));
210 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
214 struct Declaration * prev;
215 struct Declaration * next;
222 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
223 struct __ecereNameSpace__ecere__sys__OldList * declarators;
224 } __attribute__ ((gcc_struct));
225 struct Instantiation * inst;
228 struct Identifier * id;
229 struct Expression * exp;
230 } __attribute__ ((gcc_struct));
231 } __attribute__ ((gcc_struct));
232 struct Specifier * extStorage;
233 struct Symbol * symbol;
235 } __attribute__ ((gcc_struct));
237 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
241 struct Statement * prev;
242 struct Statement * next;
247 struct __ecereNameSpace__ecere__sys__OldList * expressions;
250 struct Identifier * id;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) labeled;
255 struct Expression * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) caseStmt;
260 struct __ecereNameSpace__ecere__sys__OldList * declarations;
261 struct __ecereNameSpace__ecere__sys__OldList * statements;
262 struct Context * context;
263 unsigned int isSwitch;
264 } __attribute__ ((gcc_struct)) compound;
267 struct __ecereNameSpace__ecere__sys__OldList * exp;
268 struct Statement * stmt;
269 struct Statement * elseStmt;
270 } __attribute__ ((gcc_struct)) ifStmt;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 } __attribute__ ((gcc_struct)) switchStmt;
278 struct __ecereNameSpace__ecere__sys__OldList * exp;
279 struct Statement * stmt;
280 } __attribute__ ((gcc_struct)) whileStmt;
283 struct __ecereNameSpace__ecere__sys__OldList * exp;
284 struct Statement * stmt;
285 } __attribute__ ((gcc_struct)) doWhile;
288 struct Statement * init;
289 struct Statement * check;
290 struct __ecereNameSpace__ecere__sys__OldList * increment;
291 struct Statement * stmt;
292 } __attribute__ ((gcc_struct)) forStmt;
295 struct Identifier * id;
296 } __attribute__ ((gcc_struct)) gotoStmt;
299 struct Specifier * spec;
301 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
302 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
303 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
304 } __attribute__ ((gcc_struct)) asmStmt;
307 struct Expression * watcher;
308 struct Expression * object;
309 struct __ecereNameSpace__ecere__sys__OldList * watches;
310 } __attribute__ ((gcc_struct)) _watch;
313 struct Identifier * id;
314 struct __ecereNameSpace__ecere__sys__OldList * exp;
315 struct __ecereNameSpace__ecere__sys__OldList * filter;
316 struct Statement * stmt;
317 } __attribute__ ((gcc_struct)) forEachStmt;
318 struct Declaration * decl;
319 } __attribute__ ((gcc_struct));
320 } __attribute__ ((gcc_struct));
322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
326 struct TypeName * prev;
327 struct TypeName * next;
329 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
330 struct Declarator * declarator;
332 struct Expression * bitCount;
333 } __attribute__ ((gcc_struct));
335 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
339 struct Initializer * prev;
340 struct Initializer * next;
345 struct Expression * exp;
346 struct __ecereNameSpace__ecere__sys__OldList * list;
347 } __attribute__ ((gcc_struct));
348 unsigned int isConstant;
349 } __attribute__ ((gcc_struct));
351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
353 struct __ecereNameSpace__ecere__com__DataValue
368 } __attribute__ ((gcc_struct));
369 } __attribute__ ((gcc_struct));
371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
375 struct Expression * prev;
376 struct Expression * next;
384 struct Identifier * identifier;
385 } __attribute__ ((gcc_struct));
386 struct Statement * compound;
387 struct Instantiation * instance;
389 struct __ecereNameSpace__ecere__sys__OldList * list;
392 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
393 struct Declarator * decl;
394 } __attribute__ ((gcc_struct)) _classExp;
397 struct Identifier * id;
398 } __attribute__ ((gcc_struct)) classData;
401 struct Expression * exp;
402 struct __ecereNameSpace__ecere__sys__OldList * arguments;
403 struct Location argLoc;
404 } __attribute__ ((gcc_struct)) call;
407 struct Expression * exp;
408 struct __ecereNameSpace__ecere__sys__OldList * index;
409 } __attribute__ ((gcc_struct)) index;
412 struct Expression * exp;
413 struct Identifier * member;
415 unsigned int thisPtr;
416 } __attribute__ ((gcc_struct)) member;
420 struct Expression * exp1;
421 struct Expression * exp2;
422 } __attribute__ ((gcc_struct)) op;
423 struct TypeName * typeName;
424 struct Specifier * _class;
427 struct TypeName * typeName;
428 struct Expression * exp;
429 } __attribute__ ((gcc_struct)) cast;
432 struct Expression * cond;
433 struct __ecereNameSpace__ecere__sys__OldList * exp;
434 struct Expression * elseExp;
435 } __attribute__ ((gcc_struct)) cond;
438 struct TypeName * typeName;
439 struct Expression * size;
440 } __attribute__ ((gcc_struct)) _new;
443 struct TypeName * typeName;
444 struct Expression * size;
445 struct Expression * exp;
446 } __attribute__ ((gcc_struct)) _renew;
450 struct Identifier * id;
451 } __attribute__ ((gcc_struct)) db;
454 struct Expression * ds;
455 struct Expression * name;
456 } __attribute__ ((gcc_struct)) dbopen;
459 struct TypeName * typeName;
460 struct Initializer * initializer;
461 } __attribute__ ((gcc_struct)) initializer;
464 struct Expression * exp;
465 struct TypeName * typeName;
466 } __attribute__ ((gcc_struct)) vaArg;
467 } __attribute__ ((gcc_struct));
468 unsigned int debugValue;
469 struct __ecereNameSpace__ecere__com__DataValue val;
471 unsigned int hasAddress;
472 struct Type * expType;
473 struct Type * destType;
476 unsigned int byReference;
477 unsigned int isConstant;
478 unsigned int addedThis;
479 unsigned int needCast;
480 unsigned int thisPtr;
481 } __attribute__ ((gcc_struct));
483 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
485 struct TemplateDatatype
487 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
488 struct Declarator * decl;
489 } __attribute__ ((gcc_struct));
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
493 struct TemplateArgument;
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
497 struct TemplateParameter
499 struct TemplateParameter * prev;
500 struct TemplateParameter * next;
503 struct Identifier * identifier;
506 struct TemplateDatatype * dataType;
508 } __attribute__ ((gcc_struct));
509 struct TemplateArgument * defaultArgument;
510 char * dataTypeString;
511 struct Type * baseType;
512 } __attribute__ ((gcc_struct));
514 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
518 struct Specifier * prev;
519 struct Specifier * next;
527 struct ExtDecl * extDecl;
529 struct Symbol * symbol;
530 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
531 } __attribute__ ((gcc_struct));
534 struct Identifier * id;
535 struct __ecereNameSpace__ecere__sys__OldList * list;
536 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
537 struct __ecereNameSpace__ecere__sys__OldList * definitions;
538 unsigned int addNameSpace;
539 struct Context * ctx;
540 struct ExtDecl * extDeclStruct;
541 } __attribute__ ((gcc_struct));
542 struct Expression * expression;
543 struct Specifier * _class;
544 struct TemplateParameter * templateParameter;
545 } __attribute__ ((gcc_struct));
546 } __attribute__ ((gcc_struct));
548 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
552 struct Identifier * prev;
553 struct Identifier * next;
555 struct Symbol * classSym;
556 struct Specifier * _class;
558 struct Identifier * badID;
559 } __attribute__ ((gcc_struct));
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
569 struct Declarator * prev;
570 struct Declarator * next;
573 struct Symbol * symbol;
574 struct Declarator * declarator;
577 struct Identifier * identifier;
580 struct Expression * exp;
581 struct Expression * posExp;
582 struct Attrib * attrib;
583 } __attribute__ ((gcc_struct)) structDecl;
586 struct Expression * exp;
587 struct Specifier * enumClass;
588 } __attribute__ ((gcc_struct)) array;
591 struct __ecereNameSpace__ecere__sys__OldList * parameters;
592 } __attribute__ ((gcc_struct)) function;
595 struct Pointer * pointer;
596 } __attribute__ ((gcc_struct)) pointer;
599 struct ExtDecl * extended;
600 } __attribute__ ((gcc_struct)) extended;
601 } __attribute__ ((gcc_struct));
602 } __attribute__ ((gcc_struct));
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
606 struct FunctionDefinition
608 struct FunctionDefinition * prev;
609 struct FunctionDefinition * next;
611 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
612 struct Declarator * declarator;
613 struct __ecereNameSpace__ecere__sys__OldList * declarations;
614 struct Statement * body;
615 struct __ecereNameSpace__ecere__com__Class * _class;
616 struct __ecereNameSpace__ecere__sys__OldList attached;
619 struct Symbol * propSet;
621 unsigned int propertyNoThis;
622 } __attribute__ ((gcc_struct));
624 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
632 struct External * prev;
633 struct External * next;
636 struct Symbol * symbol;
639 struct FunctionDefinition * function;
640 struct ClassDefinition * _class;
641 struct Declaration * declaration;
643 struct Identifier * id;
644 struct DBTableDef * table;
645 } __attribute__ ((gcc_struct));
647 } __attribute__ ((gcc_struct));
649 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
653 struct ModuleImport * prev;
654 struct ModuleImport * next;
656 struct __ecereNameSpace__ecere__sys__OldList classes;
657 struct __ecereNameSpace__ecere__sys__OldList functions;
660 } __attribute__ ((gcc_struct));
662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
666 struct ClassImport * prev;
667 struct ClassImport * next;
669 struct __ecereNameSpace__ecere__sys__OldList methods;
670 struct __ecereNameSpace__ecere__sys__OldList properties;
672 unsigned int isRemote;
673 } __attribute__ ((gcc_struct));
675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
680 struct Symbol * parent;
681 struct Symbol * left;
682 struct Symbol * right;
687 struct __ecereNameSpace__ecere__com__Method * method;
688 struct __ecereNameSpace__ecere__com__Property * _property;
689 struct __ecereNameSpace__ecere__com__Class * registered;
690 } __attribute__ ((gcc_struct));
697 struct External * pointerExternal;
698 struct External * structExternal;
699 } __attribute__ ((gcc_struct));
702 struct External * externalGet;
703 struct External * externalSet;
704 struct External * externalPtr;
705 struct External * externalIsSet;
706 } __attribute__ ((gcc_struct));
709 struct External * methodExternal;
710 struct External * methodCodeExternal;
711 } __attribute__ ((gcc_struct));
712 } __attribute__ ((gcc_struct));
713 unsigned int imported;
714 unsigned int declaredStructSym;
715 struct __ecereNameSpace__ecere__com__Class * _class;
716 unsigned int declaredStruct;
717 unsigned int needConstructor;
718 unsigned int needDestructor;
719 char * constructorName;
722 char * destructorName;
723 struct ModuleImport * module;
724 struct ClassImport * _import;
725 struct Location nameLoc;
726 unsigned int isParam;
727 unsigned int isRemote;
728 unsigned int isStruct;
729 unsigned int fireWatchersDone;
731 unsigned int classData;
732 unsigned int isStatic;
734 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
735 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
736 struct Context * ctx;
738 struct Expression * propCategory;
739 } __attribute__ ((gcc_struct));
741 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
750 struct Symbol * _class;
753 struct __ecereNameSpace__ecere__sys__OldList members;
755 } __attribute__ ((gcc_struct));
758 struct Type * returnType;
759 struct __ecereNameSpace__ecere__sys__OldList params;
760 struct Symbol * thisClass;
761 unsigned int staticMethod;
762 struct TemplateParameter * thisClassTemplate;
763 } __attribute__ ((gcc_struct));
766 struct __ecereNameSpace__ecere__com__Method * method;
767 struct __ecereNameSpace__ecere__com__Class * methodClass;
768 struct __ecereNameSpace__ecere__com__Class * usedClass;
769 } __attribute__ ((gcc_struct));
772 struct Type * arrayType;
774 struct Expression * arraySizeExp;
775 unsigned int freeExp;
776 struct Symbol * enumClass;
777 } __attribute__ ((gcc_struct));
779 struct TemplateParameter * templateParameter;
780 } __attribute__ ((gcc_struct));
781 unsigned int isSigned;
783 unsigned int constant;
790 unsigned int byReference;
791 unsigned int extraParam;
793 unsigned int directClassAccess;
794 unsigned int computing;
795 unsigned int dllExport;
797 unsigned int keepCast;
798 unsigned int passAsTemplate;
800 } __attribute__ ((gcc_struct));
802 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
804 struct __ecereNameSpace__ecere__com__Class
806 struct __ecereNameSpace__ecere__com__Class * prev;
807 struct __ecereNameSpace__ecere__com__Class * next;
813 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
814 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
817 struct __ecereNameSpace__ecere__com__Class * base;
818 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
819 struct __ecereNameSpace__ecere__sys__BinaryTree members;
820 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
821 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
822 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
823 struct __ecereNameSpace__ecere__sys__OldList derivatives;
827 struct __ecereNameSpace__ecere__com__Instance * module;
828 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
829 char * dataTypeString;
830 struct Type * dataType;
832 int defaultAlignment;
833 void (* Initialize)();
835 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
836 char * designerClass;
837 unsigned int noExpansion;
838 char * defaultProperty;
839 unsigned int comRedefinition;
841 unsigned int isRemote;
842 unsigned int internalDecl;
844 unsigned int computeSize;
846 int destructionWatchOffset;
848 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
849 int inheritanceAccess;
852 struct __ecereNameSpace__ecere__sys__OldList conversions;
853 struct __ecereNameSpace__ecere__sys__OldList templateParams;
854 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
855 struct __ecereNameSpace__ecere__com__Class * templateClass;
856 struct __ecereNameSpace__ecere__sys__OldList templatized;
858 } __attribute__ ((gcc_struct));
860 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
862 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
864 struct __ecereNameSpace__ecere__com__Instance
867 struct __ecereNameSpace__ecere__com__Class * _class;
869 } __attribute__ ((gcc_struct));
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
873 struct __ecereNameSpace__ecere__com__DataMember
875 struct __ecereNameSpace__ecere__com__DataMember * prev;
876 struct __ecereNameSpace__ecere__com__DataMember * next;
878 unsigned int isProperty;
881 struct __ecereNameSpace__ecere__com__Class * _class;
882 char * dataTypeString;
883 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
884 struct Type * dataType;
888 struct __ecereNameSpace__ecere__sys__OldList members;
889 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
892 } __attribute__ ((gcc_struct));
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
896 struct __ecereNameSpace__ecere__com__SerialBuffer
898 unsigned char * _buffer;
902 } __attribute__ ((gcc_struct));
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
906 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
912 char * dataTypeString;
913 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
914 } __attribute__ ((gcc_struct));
915 struct __ecereNameSpace__ecere__com__DataValue expression;
921 struct __ecereNameSpace__ecere__com__DataMember * member;
922 struct __ecereNameSpace__ecere__com__Property * prop;
923 struct __ecereNameSpace__ecere__com__Method * method;
924 } __attribute__ ((gcc_struct));
925 } __attribute__ ((gcc_struct));
926 } __attribute__ ((gcc_struct));
927 } __attribute__ ((gcc_struct));
929 typedef uintptr_t size_t;
931 void exit(int status);
933 void * calloc(size_t nmemb, size_t size);
935 void free(void * ptr);
937 void * malloc(size_t size);
939 void * realloc(void * ptr, size_t size);
941 long int strtol(const char * nptr, char ** endptr, int base);
943 long long int strtoll(const char * nptr, char ** endptr, int base);
945 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
949 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
952 typedef union YYSTYPE
957 struct Identifier * id;
958 struct Expression * exp;
959 struct Specifier * specifier;
960 struct __ecereNameSpace__ecere__sys__OldList * list;
961 struct Enumerator * enumerator;
962 struct Declarator * declarator;
963 struct Pointer * pointer;
964 struct Initializer * initializer;
965 struct InitDeclarator * initDeclarator;
966 struct TypeName * typeName;
967 struct Declaration * declaration;
968 struct Statement * stmt;
969 struct FunctionDefinition * function;
970 struct External * external;
971 struct Context * context;
972 struct AsmField * asmField;
973 struct Attrib * attrib;
974 struct ExtDecl * extDecl;
975 struct Attribute * attribute;
976 struct Instantiation * instance;
977 struct MembersInit * membersInit;
978 struct MemberInit * memberInit;
979 struct ClassFunction * classFunction;
980 struct ClassDefinition * _class;
981 struct ClassDef * classDef;
982 struct PropertyDef * prop;
984 struct Symbol * symbol;
985 struct PropertyWatch * propertyWatch;
986 struct TemplateParameter * templateParameter;
987 struct TemplateArgument * templateArgument;
988 struct TemplateDatatype * templateDatatype;
989 struct DBTableEntry * dbtableEntry;
990 struct DBIndexItem * dbindexItem;
991 struct DBTableDef * dbtableDef;
992 } __attribute__ ((gcc_struct)) YYSTYPE;
994 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
998 struct Enumerator * prev;
999 struct Enumerator * next;
1000 struct Location loc;
1001 struct Identifier * id;
1002 struct Expression * exp;
1003 } __attribute__ ((gcc_struct));
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1007 struct InitDeclarator
1009 struct InitDeclarator * prev;
1010 struct InitDeclarator * next;
1011 struct Location loc;
1012 struct Declarator * declarator;
1013 struct Initializer * initializer;
1014 } __attribute__ ((gcc_struct));
1016 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1020 struct AsmField * prev;
1021 struct AsmField * next;
1022 struct Location loc;
1024 struct Expression * expression;
1025 } __attribute__ ((gcc_struct));
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1033 struct ClassFunction
1035 struct ClassFunction * prev;
1036 struct ClassFunction * next;
1037 struct Location loc;
1038 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1039 struct Declarator * declarator;
1040 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1041 struct Statement * body;
1042 struct __ecereNameSpace__ecere__com__Class * _class;
1043 struct __ecereNameSpace__ecere__sys__OldList attached;
1046 struct Symbol * propSet;
1047 unsigned int isVirtual;
1048 unsigned int isConstructor;
1049 unsigned int isDestructor;
1050 unsigned int dontMangle;
1053 } __attribute__ ((gcc_struct));
1055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1059 struct MembersInit * prev;
1060 struct MembersInit * next;
1061 struct Location loc;
1065 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1066 struct ClassFunction * function;
1067 } __attribute__ ((gcc_struct));
1068 } __attribute__ ((gcc_struct));
1070 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1074 struct MemberInit * prev;
1075 struct MemberInit * next;
1076 struct Location loc;
1077 struct Location realLoc;
1078 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1079 struct Initializer * initializer;
1081 unsigned int variable;
1082 unsigned int takeOutExp;
1083 } __attribute__ ((gcc_struct));
1085 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1089 struct PropertyDef * prev;
1090 struct PropertyDef * next;
1091 struct Location loc;
1092 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1093 struct Declarator * declarator;
1094 struct Identifier * id;
1095 struct Statement * getStmt;
1096 struct Statement * setStmt;
1097 struct Statement * issetStmt;
1098 struct Symbol * symbol;
1099 unsigned int conversion;
1100 unsigned int isWatchable;
1101 struct Expression * category;
1102 } __attribute__ ((gcc_struct));
1104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1106 struct PropertyWatch
1108 struct PropertyWatch * prev;
1109 struct PropertyWatch * next;
1110 struct Location loc;
1111 struct Statement * compound;
1112 struct __ecereNameSpace__ecere__sys__OldList * properties;
1113 unsigned int deleteWatch;
1114 } __attribute__ ((gcc_struct));
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1120 struct ClassDef * prev;
1121 struct ClassDef * next;
1122 struct Location loc;
1126 struct Declaration * decl;
1127 struct ClassFunction * function;
1128 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1129 struct PropertyDef * propertyDef;
1130 struct PropertyWatch * propertyWatch;
1132 struct Identifier * defaultProperty;
1135 struct Identifier * id;
1136 struct Initializer * initializer;
1137 } __attribute__ ((gcc_struct));
1138 } __attribute__ ((gcc_struct));
1141 } __attribute__ ((gcc_struct));
1143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1145 struct DBTableEntry;
1147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1151 extern YYSTYPE yylval;
1153 extern struct Location yylloc;
1155 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1157 extern int returnCode;
1159 extern struct Expression * parsedExpression;
1161 extern unsigned int yydebug;
1163 void SetYydebug(unsigned int b)
1168 extern unsigned int echoOn;
1170 void resetScanner();
1174 int expression_yyparse();
1176 static struct Statement * curCompound;
1178 struct External * curExternal, * afterExternal;
1180 static struct Type * curSwitchType;
1182 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1184 struct __ecereNameSpace__ecere__com__Class * thisClass;
1186 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1191 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1196 static char * thisNameSpace;
1198 struct __ecereNameSpace__ecere__com__Class * containerClass;
1200 unsigned int thisClassParams = 0x1;
1202 unsigned int internalValueCounter;
1204 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1206 extern int strlen(const char * );
1208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1210 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1212 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1214 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1216 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1218 void PrintExpression(struct Expression * exp, char * string)
1221 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1225 OutputExpression(exp, f);
1226 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1227 count = strlen(string);
1228 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1229 string[count] = '\0';
1230 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1234 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1236 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1238 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1240 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1242 if(!param->baseType)
1244 if(param->dataTypeString)
1245 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1247 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1249 return param->baseType;
1251 return (((void *)0));
1254 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1256 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1258 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1262 if(type1->kind == type2->kind)
1271 if(type1->passAsTemplate && !type2->passAsTemplate)
1273 return type1->isSigned != type2->isSigned;
1275 return type1->_class != type2->_class;
1277 return NeedCast(type1->type, type2->type);
1285 extern int strcmp(const char * , const char * );
1287 extern struct Context * curContext;
1289 extern struct Context * topContext;
1291 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1293 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);
1295 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1297 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);
1299 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);
1301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1303 struct __ecereNameSpace__ecere__com__ClassProperty
1306 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1307 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1308 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1310 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1311 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1312 char * dataTypeString;
1313 struct Type * dataType;
1314 unsigned int constant;
1315 } __attribute__ ((gcc_struct));
1317 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1319 extern struct Expression * QMkExpId(char * id);
1321 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1323 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1325 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1326 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1331 char * dataTypeString;
1333 } __attribute__ ((gcc_struct));
1334 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1336 } __attribute__ ((gcc_struct));
1338 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1340 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1342 extern void FreeIdentifier(struct Identifier * id);
1344 void ProcessExpressionType(struct Expression * exp);
1346 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1348 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1350 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1352 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1354 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1356 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1358 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1360 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1362 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1364 if(exp->type == 0 && exp->identifier)
1366 struct Identifier * id = exp->identifier;
1367 struct Context * ctx;
1368 struct Symbol * symbol = (((void *)0));
1370 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1372 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1374 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1379 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1381 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1382 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1383 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1384 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1388 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1390 if(!prop && !method)
1391 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1392 if(!prop && !method && !member)
1394 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1396 if(prop || method || member || classProp)
1399 exp->member.member = id;
1400 exp->member.memberType = 0;
1401 exp->member.exp = QMkExpId("this");
1402 exp->addedThis = 0x1;
1404 else if(_class && _class->templateParams.first)
1406 struct __ecereNameSpace__ecere__com__Class * sClass;
1408 for(sClass = _class; sClass; sClass = sClass->base)
1410 if(sClass->templateParams.first)
1412 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1414 for(param = sClass->templateParams.first; param; param = param->next)
1416 if(param->type == 2 && !strcmp(param->name, id->string))
1418 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1422 struct Declarator * decl;
1423 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1425 FreeIdentifier(exp->member.member);
1426 ProcessExpressionType(argExp);
1427 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1428 exp->expType = ProcessType(specs, decl);
1430 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1441 extern int sprintf(char * , char * , ...);
1443 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1445 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1447 char * PrintInt(long long result)
1451 if(result > (((long long)0x7fffffffffffffffLL)))
1452 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1454 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1455 return __ecereNameSpace__ecere__sys__CopyString(temp);
1458 char * PrintUInt(uint64 result)
1462 if(result > (0xffffffff))
1463 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1464 else if(result > (((int)0x7fffffff)))
1465 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1467 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1468 return __ecereNameSpace__ecere__sys__CopyString(temp);
1471 char * PrintInt64(long long result)
1475 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1476 return __ecereNameSpace__ecere__sys__CopyString(temp);
1479 char * PrintUInt64(uint64 result)
1483 if(result > (((long long)0x7fffffffffffffffLL)))
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1487 return __ecereNameSpace__ecere__sys__CopyString(temp);
1490 char * PrintHexUInt(uint64 result)
1494 if(result > (0xffffffff))
1495 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1498 return __ecereNameSpace__ecere__sys__CopyString(temp);
1501 char * PrintHexUInt64(uint64 result)
1505 if(result > (0xffffffff))
1506 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1508 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1509 return __ecereNameSpace__ecere__sys__CopyString(temp);
1512 char * PrintShort(short result)
1516 sprintf(temp, "%d", (unsigned short)result);
1517 return __ecereNameSpace__ecere__sys__CopyString(temp);
1520 char * PrintUShort(unsigned short result)
1524 if(result > (unsigned short)32767)
1525 sprintf(temp, "0x%X", (int)result);
1527 sprintf(temp, "%d", result);
1528 return __ecereNameSpace__ecere__sys__CopyString(temp);
1531 extern int isprint(int c);
1533 char * PrintChar(char result)
1537 if(result > (char)0 && isprint(result))
1538 sprintf(temp, "'%c'", result);
1539 else if(result < (char)0)
1540 sprintf(temp, "%d", result);
1542 sprintf(temp, "0x%X", (unsigned char)result);
1543 return __ecereNameSpace__ecere__sys__CopyString(temp);
1546 char * PrintUChar(unsigned char result)
1550 sprintf(temp, "0x%X", result);
1551 return __ecereNameSpace__ecere__sys__CopyString(temp);
1554 char * PrintFloat(float result)
1558 sprintf(temp, "%.16ff", result);
1559 return __ecereNameSpace__ecere__sys__CopyString(temp);
1562 char * PrintDouble(double result)
1566 sprintf(temp, "%.16f", result);
1567 return __ecereNameSpace__ecere__sys__CopyString(temp);
1570 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1574 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1575 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1576 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1577 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1578 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1579 unsigned int (* Neg)(struct Expression *, struct Operand *);
1580 unsigned int (* Inc)(struct Expression *, struct Operand *);
1581 unsigned int (* Dec)(struct Expression *, struct Operand *);
1582 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1583 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1584 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1585 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1586 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1587 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1594 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (* Not)(struct Expression *, struct Operand *);
1600 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1609 } __attribute__ ((gcc_struct));
1611 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1617 unsigned int ptrSize;
1630 } __attribute__ ((gcc_struct));
1632 } __attribute__ ((gcc_struct));
1634 struct Operand GetOperand(struct Expression * exp);
1636 unsigned int GetInt(struct Expression * exp, int * value2)
1638 struct Operand op2 = GetOperand(exp);
1640 if(op2.kind == 3 && op2.type->isSigned)
1642 else if(op2.kind == 3)
1643 *value2 = (int)op2.ui;
1644 if(op2.kind == 4 && op2.type->isSigned)
1645 *value2 = (int)op2.i64;
1646 else if(op2.kind == 4)
1647 *value2 = (int)op2.ui64;
1648 else if(op2.kind == 22 && op2.type->isSigned)
1649 *value2 = (int)op2.i64;
1650 else if(op2.kind == 22)
1651 *value2 = (int)op2.ui64;
1652 else if(op2.kind == 2 && op2.type->isSigned)
1653 *value2 = (int)op2.s;
1654 else if(op2.kind == 2)
1655 *value2 = (int)op2.us;
1656 else if(op2.kind == 1 && op2.type->isSigned)
1657 *value2 = (int)op2.c;
1658 else if(op2.kind == 1)
1659 *value2 = (int)op2.uc;
1660 else if(op2.kind == 6)
1661 *value2 = (int)op2.f;
1662 else if(op2.kind == 7)
1663 *value2 = (int)op2.d;
1664 else if(op2.kind == 13)
1665 *value2 = (int)op2.ui64;
1671 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1673 struct Operand op2 = GetOperand(exp);
1675 if(op2.kind == 3 && op2.type->isSigned)
1676 *value2 = (unsigned int)op2.i;
1677 else if(op2.kind == 3)
1679 if(op2.kind == 4 && op2.type->isSigned)
1680 *value2 = (unsigned int)op2.i64;
1681 else if(op2.kind == 4)
1682 *value2 = (unsigned int)op2.ui64;
1683 else if(op2.kind == 22 && op2.type->isSigned)
1684 *value2 = (unsigned int)op2.i64;
1685 else if(op2.kind == 22)
1686 *value2 = (unsigned int)op2.ui64;
1687 else if(op2.kind == 2 && op2.type->isSigned)
1688 *value2 = (unsigned int)op2.s;
1689 else if(op2.kind == 2)
1690 *value2 = (unsigned int)op2.us;
1691 else if(op2.kind == 1 && op2.type->isSigned)
1692 *value2 = (unsigned int)op2.c;
1693 else if(op2.kind == 1)
1694 *value2 = (unsigned int)op2.uc;
1695 else if(op2.kind == 6)
1696 *value2 = (unsigned int)op2.f;
1697 else if(op2.kind == 7)
1698 *value2 = (unsigned int)op2.d;
1699 else if(op2.kind == 13)
1700 *value2 = (unsigned int)op2.ui64;
1706 unsigned int GetInt64(struct Expression * exp, long long * value2)
1708 struct Operand op2 = GetOperand(exp);
1710 if(op2.kind == 3 && op2.type->isSigned)
1711 *value2 = (long long)op2.i;
1712 else if(op2.kind == 3)
1713 *value2 = (long long)op2.ui;
1714 if(op2.kind == 4 && op2.type->isSigned)
1716 else if(op2.kind == 4)
1717 *value2 = (long long)op2.ui64;
1718 else if(op2.kind == 22 && op2.type->isSigned)
1720 else if(op2.kind == 22)
1721 *value2 = (long long)op2.ui64;
1722 else if(op2.kind == 2 && op2.type->isSigned)
1723 *value2 = (long long)op2.s;
1724 else if(op2.kind == 2)
1725 *value2 = (long long)op2.us;
1726 else if(op2.kind == 1 && op2.type->isSigned)
1727 *value2 = (long long)op2.c;
1728 else if(op2.kind == 1)
1729 *value2 = (long long)op2.uc;
1730 else if(op2.kind == 6)
1731 *value2 = (long long)op2.f;
1732 else if(op2.kind == 7)
1733 *value2 = (long long)op2.d;
1734 else if(op2.kind == 13)
1735 *value2 = (long long)op2.ui64;
1741 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1743 struct Operand op2 = GetOperand(exp);
1745 if(op2.kind == 3 && op2.type->isSigned)
1746 *value2 = (uint64)op2.i;
1747 else if(op2.kind == 3)
1748 *value2 = (uint64)op2.ui;
1749 if(op2.kind == 4 && op2.type->isSigned)
1750 *value2 = (uint64)op2.i64;
1751 else if(op2.kind == 4)
1753 else if(op2.kind == 22 && op2.type->isSigned)
1754 *value2 = (uint64)op2.i64;
1755 else if(op2.kind == 22)
1757 else if(op2.kind == 2 && op2.type->isSigned)
1758 *value2 = (uint64)op2.s;
1759 else if(op2.kind == 2)
1760 *value2 = (uint64)op2.us;
1761 else if(op2.kind == 1 && op2.type->isSigned)
1762 *value2 = (uint64)op2.c;
1763 else if(op2.kind == 1)
1764 *value2 = (uint64)op2.uc;
1765 else if(op2.kind == 6)
1766 *value2 = (uint64)op2.f;
1767 else if(op2.kind == 7)
1768 *value2 = (uint64)op2.d;
1769 else if(op2.kind == 13)
1776 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1778 struct Operand op2 = GetOperand(exp);
1780 if(op2.kind == 3 && op2.type->isSigned)
1781 *value2 = (intptr_t)op2.i;
1782 else if(op2.kind == 3)
1783 *value2 = (intptr_t)op2.ui;
1784 if(op2.kind == 4 && op2.type->isSigned)
1785 *value2 = (intptr_t)op2.i64;
1786 else if(op2.kind == 4)
1787 *value2 = (intptr_t)op2.ui64;
1788 else if(op2.kind == 22 && op2.type->isSigned)
1789 *value2 = (intptr_t)op2.i64;
1790 else if(op2.kind == 22)
1791 *value2 = (intptr_t)op2.ui64;
1792 else if(op2.kind == 2 && op2.type->isSigned)
1793 *value2 = (intptr_t)op2.s;
1794 else if(op2.kind == 2)
1795 *value2 = (intptr_t)op2.us;
1796 else if(op2.kind == 1 && op2.type->isSigned)
1797 *value2 = (intptr_t)op2.c;
1798 else if(op2.kind == 1)
1799 *value2 = (intptr_t)op2.uc;
1800 else if(op2.kind == 6)
1801 *value2 = (intptr_t)op2.f;
1802 else if(op2.kind == 7)
1803 *value2 = (intptr_t)op2.d;
1804 else if(op2.kind == 13)
1805 *value2 = (intptr_t)op2.ui64;
1811 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1813 struct Operand op2 = GetOperand(exp);
1815 if(op2.kind == 3 && op2.type->isSigned)
1816 *value2 = (uintptr_t)op2.i;
1817 else if(op2.kind == 3)
1818 *value2 = (uintptr_t)op2.ui;
1819 if(op2.kind == 4 && op2.type->isSigned)
1820 *value2 = (uintptr_t)op2.i64;
1821 else if(op2.kind == 4)
1822 *value2 = (uintptr_t)op2.ui64;
1823 else if(op2.kind == 22 && op2.type->isSigned)
1824 *value2 = (uintptr_t)op2.i64;
1825 else if(op2.kind == 22)
1826 *value2 = (uintptr_t)op2.ui64;
1827 else if(op2.kind == 2 && op2.type->isSigned)
1828 *value2 = (uintptr_t)op2.s;
1829 else if(op2.kind == 2)
1830 *value2 = (uintptr_t)op2.us;
1831 else if(op2.kind == 1 && op2.type->isSigned)
1832 *value2 = (uintptr_t)op2.c;
1833 else if(op2.kind == 1)
1834 *value2 = (uintptr_t)op2.uc;
1835 else if(op2.kind == 6)
1836 *value2 = (uintptr_t)op2.f;
1837 else if(op2.kind == 7)
1838 *value2 = (uintptr_t)op2.d;
1839 else if(op2.kind == 13)
1840 *value2 = (uintptr_t)op2.ui64;
1846 unsigned int GetShort(struct Expression * exp, short * value2)
1848 struct Operand op2 = GetOperand(exp);
1850 if(op2.kind == 3 && op2.type->isSigned)
1851 *value2 = (short)op2.i;
1852 else if(op2.kind == 3)
1853 *value2 = (short)op2.ui;
1854 if(op2.kind == 4 && op2.type->isSigned)
1855 *value2 = (short)op2.i64;
1856 else if(op2.kind == 4)
1857 *value2 = (short)op2.ui64;
1858 else if(op2.kind == 22 && op2.type->isSigned)
1859 *value2 = (short)op2.i64;
1860 else if(op2.kind == 22)
1861 *value2 = (short)op2.ui64;
1862 else if(op2.kind == 2 && op2.type->isSigned)
1864 else if(op2.kind == 2)
1865 *value2 = (short)op2.us;
1866 else if(op2.kind == 1 && op2.type->isSigned)
1867 *value2 = (short)op2.c;
1868 else if(op2.kind == 1)
1869 *value2 = (short)op2.uc;
1870 else if(op2.kind == 6)
1871 *value2 = (short)op2.f;
1872 else if(op2.kind == 7)
1873 *value2 = (short)op2.d;
1874 else if(op2.kind == 13)
1875 *value2 = (short)op2.ui64;
1881 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1883 struct Operand op2 = GetOperand(exp);
1885 if(op2.kind == 3 && op2.type->isSigned)
1886 *value2 = (unsigned short)op2.i;
1887 else if(op2.kind == 3)
1888 *value2 = (unsigned short)op2.ui;
1889 if(op2.kind == 4 && op2.type->isSigned)
1890 *value2 = (unsigned short)op2.i64;
1891 else if(op2.kind == 4)
1892 *value2 = (unsigned short)op2.ui64;
1893 else if(op2.kind == 22 && op2.type->isSigned)
1894 *value2 = (unsigned short)op2.i64;
1895 else if(op2.kind == 22)
1896 *value2 = (unsigned short)op2.ui64;
1897 else if(op2.kind == 2 && op2.type->isSigned)
1898 *value2 = (unsigned short)op2.s;
1899 else if(op2.kind == 2)
1901 else if(op2.kind == 1 && op2.type->isSigned)
1902 *value2 = (unsigned short)op2.c;
1903 else if(op2.kind == 1)
1904 *value2 = (unsigned short)op2.uc;
1905 else if(op2.kind == 6)
1906 *value2 = (unsigned short)op2.f;
1907 else if(op2.kind == 7)
1908 *value2 = (unsigned short)op2.d;
1909 else if(op2.kind == 13)
1910 *value2 = (unsigned short)op2.ui64;
1916 unsigned int GetChar(struct Expression * exp, char * value2)
1918 struct Operand op2 = GetOperand(exp);
1920 if(op2.kind == 3 && op2.type->isSigned)
1921 *value2 = (char)op2.i;
1922 else if(op2.kind == 3)
1923 *value2 = (char)op2.ui;
1924 if(op2.kind == 4 && op2.type->isSigned)
1925 *value2 = (char)op2.i64;
1926 else if(op2.kind == 4)
1927 *value2 = (char)op2.ui64;
1928 else if(op2.kind == 22 && op2.type->isSigned)
1929 *value2 = (char)op2.i64;
1930 else if(op2.kind == 22)
1931 *value2 = (char)op2.ui64;
1932 else if(op2.kind == 2 && op2.type->isSigned)
1933 *value2 = (char)op2.s;
1934 else if(op2.kind == 2)
1935 *value2 = (char)op2.us;
1936 else if(op2.kind == 1 && op2.type->isSigned)
1938 else if(op2.kind == 1)
1939 *value2 = (char)op2.uc;
1940 else if(op2.kind == 6)
1941 *value2 = (char)op2.f;
1942 else if(op2.kind == 7)
1943 *value2 = (char)op2.d;
1944 else if(op2.kind == 13)
1945 *value2 = (char)op2.ui64;
1951 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1953 struct Operand op2 = GetOperand(exp);
1955 if(op2.kind == 3 && op2.type->isSigned)
1956 *value2 = (unsigned char)op2.i;
1957 else if(op2.kind == 3)
1958 *value2 = (unsigned char)op2.ui;
1959 if(op2.kind == 4 && op2.type->isSigned)
1960 *value2 = (unsigned char)op2.i64;
1961 else if(op2.kind == 4)
1962 *value2 = (unsigned char)op2.ui64;
1963 else if(op2.kind == 22 && op2.type->isSigned)
1964 *value2 = (unsigned char)op2.i64;
1965 else if(op2.kind == 22)
1966 *value2 = (unsigned char)op2.ui64;
1967 else if(op2.kind == 2 && op2.type->isSigned)
1968 *value2 = (unsigned char)op2.s;
1969 else if(op2.kind == 2)
1970 *value2 = (unsigned char)op2.us;
1971 else if(op2.kind == 1 && op2.type->isSigned)
1972 *value2 = (unsigned char)op2.c;
1973 else if(op2.kind == 1)
1975 else if(op2.kind == 6)
1976 *value2 = (unsigned char)op2.f;
1977 else if(op2.kind == 7)
1978 *value2 = (unsigned char)op2.d;
1979 else if(op2.kind == 13)
1980 *value2 = (unsigned char)op2.ui64;
1986 unsigned int GetFloat(struct Expression * exp, float * value2)
1988 struct Operand op2 = GetOperand(exp);
1990 if(op2.kind == 3 && op2.type->isSigned)
1991 *value2 = (float)(float)op2.i;
1992 else if(op2.kind == 3)
1993 *value2 = (float)(float)op2.ui;
1994 if(op2.kind == 4 && op2.type->isSigned)
1995 *value2 = (float)(float)op2.i64;
1996 else if(op2.kind == 4)
1997 *value2 = (float)(float)op2.ui64;
1998 else if(op2.kind == 22 && op2.type->isSigned)
1999 *value2 = (float)(float)op2.i64;
2000 else if(op2.kind == 22)
2001 *value2 = (float)(float)op2.ui64;
2002 else if(op2.kind == 2 && op2.type->isSigned)
2003 *value2 = (float)(float)op2.s;
2004 else if(op2.kind == 2)
2005 *value2 = (float)(float)op2.us;
2006 else if(op2.kind == 1 && op2.type->isSigned)
2007 *value2 = (float)(float)op2.c;
2008 else if(op2.kind == 1)
2009 *value2 = (float)(float)op2.uc;
2010 else if(op2.kind == 6)
2011 *value2 = (float)op2.f;
2012 else if(op2.kind == 7)
2013 *value2 = (float)op2.d;
2014 else if(op2.kind == 13)
2015 *value2 = (float)(float)op2.ui64;
2021 unsigned int GetDouble(struct Expression * exp, double * value2)
2023 struct Operand op2 = GetOperand(exp);
2025 if(op2.kind == 3 && op2.type->isSigned)
2026 *value2 = (double)(double)op2.i;
2027 else if(op2.kind == 3)
2028 *value2 = (double)(double)op2.ui;
2029 if(op2.kind == 4 && op2.type->isSigned)
2030 *value2 = (double)(double)op2.i64;
2031 else if(op2.kind == 4)
2032 *value2 = (double)(double)op2.ui64;
2033 else if(op2.kind == 22 && op2.type->isSigned)
2034 *value2 = (double)(double)op2.i64;
2035 else if(op2.kind == 22)
2036 *value2 = (double)(double)op2.ui64;
2037 else if(op2.kind == 2 && op2.type->isSigned)
2038 *value2 = (double)(double)op2.s;
2039 else if(op2.kind == 2)
2040 *value2 = (double)(double)op2.us;
2041 else if(op2.kind == 1 && op2.type->isSigned)
2042 *value2 = (double)(double)op2.c;
2043 else if(op2.kind == 1)
2044 *value2 = (double)(double)op2.uc;
2045 else if(op2.kind == 6)
2046 *value2 = (double)op2.f;
2047 else if(op2.kind == 7)
2048 *value2 = (double)op2.d;
2049 else if(op2.kind == 13)
2050 *value2 = (double)(double)op2.ui64;
2056 void ComputeExpression(struct Expression * exp);
2058 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2060 extern int targetBits;
2062 int ComputeTypeSize(struct Type * type);
2064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2066 struct __ecereNameSpace__ecere__com__BitMember
2068 struct __ecereNameSpace__ecere__com__BitMember * prev;
2069 struct __ecereNameSpace__ecere__com__BitMember * next;
2071 unsigned int isProperty;
2074 struct __ecereNameSpace__ecere__com__Class * _class;
2075 char * dataTypeString;
2076 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2077 struct Type * dataType;
2082 } __attribute__ ((gcc_struct));
2084 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2086 struct __ecereNameSpace__ecere__sys__OldLink
2088 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2089 struct __ecereNameSpace__ecere__sys__OldLink * next;
2091 } __attribute__ ((gcc_struct));
2093 void FinishTemplatesContext(struct Context * context);
2095 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2097 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2098 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2100 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))
2103 int unionMemberOffset = 0;
2108 member->memberOffset = 0;
2109 if(targetBits < sizeof(void *) * 8)
2110 member->structAlignment = 0;
2112 else if(targetBits < sizeof(void *) * 8)
2113 _class->structAlignment = 0;
2114 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2115 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2116 if(!member && _class->destructionWatchOffset)
2117 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2119 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2121 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2123 if(!dataMember->isProperty)
2125 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2127 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2133 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2135 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2137 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2139 if(!isMember && _class->type == 2 && dataMember->dataType)
2141 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2145 ComputeTypeSize(dataMember->dataType);
2146 if(bitMember->pos == -1)
2147 bitMember->pos = _class->memberOffset;
2148 if(!bitMember->size)
2149 bitMember->size = dataMember->dataType->size * 8;
2150 _class->memberOffset = bitMember->pos + bitMember->size;
2151 for(d = 0; d < bitMember->size; d++)
2157 bitMember->mask = mask << bitMember->pos;
2159 else if(dataMember->type == 0 && dataMember->dataType)
2164 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2165 ComputeTypeSize(dataMember->dataType);
2166 if(dataMember->dataType->bitFieldCount)
2168 bitFields += dataMember->dataType->bitFieldCount;
2175 int size = (bitFields + 7) / 8;
2179 int __simpleStruct0;
2183 int __simpleStruct0;
2185 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2186 if(member->memberOffset % alignment)
2187 member->memberOffset += alignment - (member->memberOffset % alignment);
2189 dataMember->offset = member->memberOffset;
2190 if(member->type == 1)
2191 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2194 member->memberOffset += size;
2201 int __simpleStruct0;
2203 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2204 if(_class->memberOffset % alignment)
2205 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2207 dataMember->offset = _class->memberOffset;
2208 _class->memberOffset += size;
2212 size = dataMember->dataType->size;
2213 alignment = dataMember->dataType->alignment;
2217 int __simpleStruct0;
2221 int __simpleStruct0;
2223 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2224 if(member->memberOffset % alignment)
2225 member->memberOffset += alignment - (member->memberOffset % alignment);
2227 dataMember->offset = member->memberOffset;
2228 if(member->type == 1)
2229 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2232 member->memberOffset += size;
2239 int __simpleStruct0;
2241 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2242 if(_class->memberOffset % alignment)
2243 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2245 dataMember->offset = _class->memberOffset;
2246 _class->memberOffset += size;
2253 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2254 alignment = dataMember->structAlignment;
2257 int __simpleStruct0;
2261 int __simpleStruct0;
2263 if(member->memberOffset % alignment)
2264 member->memberOffset += alignment - (member->memberOffset % alignment);
2265 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2267 dataMember->offset = member->memberOffset;
2268 if(member->type == 1)
2269 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2271 member->memberOffset += dataMember->memberOffset;
2277 int __simpleStruct0;
2279 if(_class->memberOffset % alignment)
2280 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2281 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2283 dataMember->offset = _class->memberOffset;
2284 _class->memberOffset += dataMember->memberOffset;
2292 int size = (bitFields + 7) / 8;
2296 int __simpleStruct0;
2300 int __simpleStruct0;
2302 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2303 if(member->memberOffset % alignment)
2304 member->memberOffset += alignment - (member->memberOffset % alignment);
2306 if(member->type == 1)
2307 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2310 member->memberOffset += size;
2317 int __simpleStruct0;
2319 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2320 if(_class->memberOffset % alignment)
2321 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2323 _class->memberOffset += size;
2328 if(member && member->type == 1)
2330 member->memberOffset = unionMemberOffset;
2334 if(_class->type != 2)
2338 if(_class->structAlignment)
2340 if(_class->memberOffset % _class->structAlignment)
2341 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2343 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2346 struct __ecereNameSpace__ecere__com__Property * prop;
2348 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2350 if(prop->isProperty && prop->isWatchable)
2352 prop->watcherOffset = _class->structSize;
2353 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2358 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2360 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2362 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2364 if(deriv->computeSize)
2366 deriv->offset = _class->structSize;
2367 deriv->memberOffset = 0;
2368 deriv->structSize = deriv->offset;
2369 ComputeClassMembers(deriv, 0x0);
2377 FinishTemplatesContext(context);
2380 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2382 struct __ecereNameSpace__ecere__com__NameSpace
2385 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2386 struct __ecereNameSpace__ecere__com__NameSpace * left;
2387 struct __ecereNameSpace__ecere__com__NameSpace * right;
2389 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2390 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2391 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2392 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2393 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2394 } __attribute__ ((gcc_struct));
2396 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2398 struct __ecereNameSpace__ecere__com__Module
2400 struct __ecereNameSpace__ecere__com__Instance * application;
2401 struct __ecereNameSpace__ecere__sys__OldList classes;
2402 struct __ecereNameSpace__ecere__sys__OldList defines;
2403 struct __ecereNameSpace__ecere__sys__OldList functions;
2404 struct __ecereNameSpace__ecere__sys__OldList modules;
2405 struct __ecereNameSpace__ecere__com__Instance * prev;
2406 struct __ecereNameSpace__ecere__com__Instance * next;
2412 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2413 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2414 } __attribute__ ((gcc_struct));
2416 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2418 struct __ecereNameSpace__ecere__com__Class * _class;
2419 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2421 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2422 ComputeModuleClasses(subModule->data);
2423 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2424 ComputeClassMembers(_class, 0x0);
2427 extern unsigned int inCompiler;
2429 extern void Compiler_Error(char * format, ...);
2431 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2433 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2435 int ComputeTypeSize(struct Type * type)
2437 unsigned int size = type ? type->size : 0;
2439 if(!size && type && !type->computing)
2441 type->computing = 0x1;
2445 type->alignment = size = sizeof(char);
2448 type->alignment = size = sizeof(int);
2451 type->alignment = size = sizeof(long long);
2454 type->alignment = size = targetBits / 8;
2457 type->alignment = size = sizeof(long);
2460 type->alignment = size = sizeof(short);
2463 type->alignment = size = sizeof(float);
2466 type->alignment = size = sizeof(double);
2470 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2472 if(_class && _class->type == 1)
2474 ComputeClassMembers(_class, 0x0);
2475 type->alignment = _class->structAlignment;
2476 size = _class->structSize;
2477 if(type->alignment && size % type->alignment)
2478 size += type->alignment - (size % type->alignment);
2480 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2482 if(!_class->dataType)
2483 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2484 size = type->alignment = ComputeTypeSize(_class->dataType);
2487 size = type->alignment = targetBits / 8;
2492 size = type->alignment = targetBits / 8;
2495 if(type->arraySizeExp)
2497 ProcessExpressionType(type->arraySizeExp);
2498 ComputeExpression(type->arraySizeExp);
2499 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)))
2501 struct Location oldLoc = yylloc;
2502 char expression[10240];
2504 expression[0] = '\0';
2505 type->arraySizeExp->expType = (((void *)0));
2506 yylloc = type->arraySizeExp->loc;
2508 PrintExpression(type->arraySizeExp, expression);
2509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2512 GetInt(type->arraySizeExp, &type->arraySize);
2514 else if(type->enumClass)
2516 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2518 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2521 type->arraySize = 0;
2525 type->arraySize = 0;
2527 size = ComputeTypeSize(type->type) * type->arraySize;
2528 type->alignment = type->type->alignment;
2532 struct Type * member;
2534 for(member = type->members.first; member; member = member->next)
2536 int __simpleStruct0, __simpleStruct1;
2537 unsigned int addSize = ComputeTypeSize(member);
2539 member->offset = size;
2540 if(member->alignment && size % member->alignment)
2541 member->offset += member->alignment - (size % member->alignment);
2542 size = member->offset;
2543 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2546 if(type->alignment && size % type->alignment)
2547 size += type->alignment - (size % type->alignment);
2552 struct Type * member;
2554 for(member = type->members.first; member; member = member->next)
2556 int __simpleStruct0, __simpleStruct1;
2557 unsigned int addSize = ComputeTypeSize(member);
2559 member->offset = size;
2560 if(member->alignment && size % member->alignment)
2561 member->offset += member->alignment - (size % member->alignment);
2562 size = member->offset;
2563 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2564 size = ((size > addSize) ? size : addSize);
2566 if(type->alignment && size % type->alignment)
2567 size += type->alignment - (size % type->alignment);
2572 struct TemplateParameter * param = type->templateParameter;
2573 struct Type * baseType = ProcessTemplateParameterType(param);
2577 size = ComputeTypeSize(baseType);
2578 type->alignment = baseType->alignment;
2581 type->alignment = size = sizeof(uint64);
2586 type->alignment = size = sizeof(enum
2594 type->alignment = size = targetBits / 8;
2599 type->computing = 0x0;
2604 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2606 extern struct Identifier * MkIdentifier(char * string);
2608 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2610 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2612 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2614 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2616 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2618 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2620 extern void FreeType(struct Type * type);
2622 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2624 extern struct Specifier * MkSpecifier(int specifier);
2626 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2628 extern struct Expression * MkExpConstant(char * string);
2630 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)
2632 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2633 unsigned int totalSize = 0;
2634 unsigned int maxSize = 0;
2635 int alignment, size;
2636 struct __ecereNameSpace__ecere__com__DataMember * member;
2637 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2640 *addedPadding = 0x0;
2641 if(!isMember && _class->base)
2643 maxSize = _class->structSize;
2645 if(_class->type == 1 || _class->type == 5)
2646 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2648 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2651 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2653 if(!member->isProperty)
2655 switch(member->type)
2659 if(member->dataTypeString)
2661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2662 struct Declarator * decl;
2664 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2665 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2666 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2667 if(!member->dataType)
2668 member->dataType = ProcessType(specs, decl);
2669 ReplaceThisClassSpecifiers(specs, topClass);
2671 struct Type * type = ProcessType(specs, decl);
2673 DeclareType(member->dataType, 0x0, 0x0);
2676 ComputeTypeSize(member->dataType);
2677 size = member->dataType->size;
2678 alignment = member->dataType->alignment;
2681 if(totalSize % alignment)
2682 totalSize += alignment - (totalSize % alignment);
2691 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2694 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2695 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2696 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2697 alignment = member->structAlignment;
2700 if(totalSize % alignment)
2701 totalSize += alignment - (totalSize % alignment);
2711 unsigned int __simpleStruct0;
2713 if(topMember && topMember->type == 1)
2714 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2716 *retSize += totalSize;
2718 else if(totalSize < maxSize && _class->type != 1000)
2720 int autoPadding = 0;
2722 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2723 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2724 if(totalSize + autoPadding < maxSize)
2726 char sizeString[50];
2728 sprintf(sizeString, "%d", maxSize - totalSize);
2729 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2731 *addedPadding = 0x1;
2735 FinishTemplatesContext(context);
2736 return topMember ? topMember->memberID : _class->memberID;
2739 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2741 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2742 unsigned int totalSize = 0;
2743 struct __ecereNameSpace__ecere__com__DataMember * member;
2744 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2746 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2747 DeclareMembers(_class->base, 0x0);
2748 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2750 if(!member->isProperty)
2752 switch(member->type)
2756 if(!member->dataType && member->dataTypeString)
2757 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2758 if(member->dataType)
2759 DeclareType(member->dataType, 0x0, 0x0);
2765 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2772 FinishTemplatesContext(context);
2773 return topMember ? topMember->memberID : _class->memberID;
2776 extern struct Symbol * FindClass(char * name);
2778 extern char * strchr(char * , int);
2780 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2782 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2784 extern void FreeClassDef(struct ClassDef * def);
2786 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2788 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2790 extern char * strcpy(char * , const char * );
2792 extern void MangleClassName(char * className);
2794 extern void DeclareClass(struct Symbol * classSym, char * className);
2796 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2798 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2800 void DeclareStruct(char * name, unsigned int skipNoHead)
2802 struct External * external = (((void *)0));
2803 struct Symbol * classSym = FindClass(name);
2805 if(!inCompiler || !classSym)
2807 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2809 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2811 struct Declaration * decl;
2812 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2813 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2814 char structName[1024];
2816 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2817 classSym->declaring++;
2818 if(strchr(classSym->string, '<'))
2820 if(classSym->registered->templateClass)
2822 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2823 classSym->declaring--;
2827 DeclareMembers(classSym->registered, 0x0);
2828 structName[0] = (char)0;
2829 FullClassNameCat(structName, name, 0x0);
2832 unsigned int addedPadding = 0x0;
2834 classSym->declaredStructSym = 0x1;
2835 declarations = MkList();
2836 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2837 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2839 FreeList(declarations, FreeClassDef);
2840 declarations = (((void *)0));
2843 if(skipNoHead || declarations)
2845 if(external && external->declaration)
2847 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2848 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2850 if(classSym->structExternal)
2851 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2853 classSym->id = curExternal->symbol->idCode;
2854 classSym->idCode = curExternal->symbol->idCode;
2860 external = MkExternalDeclaration((((void *)0)));
2861 specifiers = MkList();
2862 declarators = MkList();
2863 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2864 external->declaration = decl = MkDeclaration(specifiers, declarators);
2865 if(decl->symbol && !decl->symbol->pointerExternal)
2866 decl->symbol->pointerExternal = external;
2867 if(classSym->registered && classSym->registered->type == 1)
2869 char className[1024];
2871 strcpy(className, "__ecereClass_");
2872 FullClassNameCat(className, classSym->string, 0x1);
2873 MangleClassName(className);
2874 DeclareClass(classSym, className);
2875 external->symbol = classSym;
2876 classSym->pointerExternal = external;
2877 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2878 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2882 char className[1024];
2884 strcpy(className, "__ecereClass_");
2885 FullClassNameCat(className, classSym->string, 0x1);
2886 MangleClassName(className);
2887 classSym->structExternal = external;
2888 DeclareClass(classSym, className);
2889 external->symbol = classSym;
2891 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2894 classSym->declaring--;
2896 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2898 classSym->declaring++;
2900 if(classSym->registered)
2901 DeclareMembers(classSym->registered, 0x0);
2903 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2905 if(classSym->structExternal)
2906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2908 classSym->id = curExternal->symbol->idCode;
2909 classSym->idCode = curExternal->symbol->idCode;
2911 classSym->declaring--;
2915 extern char * strcat(char * , const char * );
2917 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2919 extern struct ModuleImport * mainModule;
2921 extern struct Specifier * MkSpecifierName(char * name);
2923 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2925 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2927 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2929 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2931 extern void FreeDeclarator(struct Declarator * decl);
2933 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2935 struct PropertyImport
2937 struct PropertyImport * prev;
2938 struct PropertyImport * next;
2940 unsigned int isVirtual;
2941 unsigned int hasSet;
2942 unsigned int hasGet;
2943 } __attribute__ ((gcc_struct));
2945 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2947 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2949 void * __ecereTemp1;
2950 struct Symbol * symbol = prop->symbol;
2951 char propName[1024];
2953 strcpy(setName, "__ecereProp_");
2954 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2955 strcat(setName, "_Set_");
2956 FullClassNameCat(setName, prop->name, 0x1);
2957 strcpy(getName, "__ecereProp_");
2958 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2959 strcat(getName, "_Get_");
2960 FullClassNameCat(getName, prop->name, 0x1);
2961 strcpy(propName, "__ecereProp_");
2962 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2963 strcat(propName, "_");
2964 FullClassNameCat(propName, prop->name, 0x1);
2965 MangleClassName(getName);
2966 MangleClassName(setName);
2967 MangleClassName(propName);
2968 if(prop->_class->type == 1)
2969 DeclareStruct(prop->_class->fullName, 0x0);
2970 if(!symbol || curExternal->symbol->idCode < symbol->id)
2972 unsigned int imported = 0x0;
2973 unsigned int dllImport = 0x0;
2975 if(!symbol || symbol->_import)
2979 struct Symbol * classSym;
2981 if(!prop->_class->symbol)
2982 prop->_class->symbol = FindClass(prop->_class->fullName);
2983 classSym = prop->_class->symbol;
2984 if(classSym && !classSym->_import)
2986 struct ModuleImport * module;
2988 if(prop->_class->module)
2989 module = FindModule(prop->_class->module);
2991 module = mainModule;
2992 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
2993 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2995 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2996 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
2998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3001 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3006 struct Context * context = SetupTemplatesContext(prop->_class);
3008 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3009 FinishTemplatesContext(context);
3013 if(!symbol->externalGet || symbol->externalGet->type == 0)
3015 struct Declaration * decl;
3016 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3017 struct Declarator * d;
3018 struct __ecereNameSpace__ecere__sys__OldList * params;
3019 struct Specifier * spec;
3020 struct External * external;
3021 struct Declarator * typeDecl;
3022 unsigned int simple = 0x0;
3024 specifiers = MkList();
3025 declarators = MkList();
3027 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3028 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3030 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3032 struct Context * context = SetupTemplatesContext(prop->_class);
3034 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3035 FinishTemplatesContext(context);
3037 for(spec = (*specifiers).first; spec; spec = spec->next)
3041 if((!typeDecl || typeDecl->type == 1))
3043 struct Symbol * classSym = spec->symbol;
3045 symbol->_class = classSym->registered;
3046 if(classSym->registered && classSym->registered->type == 1)
3048 DeclareStruct(spec->name, 0x0);
3055 d = PlugDeclarator(typeDecl, d);
3058 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3059 specifiers = MkList();
3061 d = MkDeclaratorFunction(d, params);
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3064 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3067 ListAdd(specifiers, MkSpecifier(VOID));
3068 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3069 decl = MkDeclaration(specifiers, declarators);
3070 external = MkExternalDeclaration(decl);
3071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3072 external->symbol = symbol;
3073 symbol->externalGet = external;
3074 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3076 FreeDeclarator(typeDecl);
3080 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3085 if(!symbol->externalSet || symbol->externalSet->type == 0)
3087 struct Declaration * decl;
3088 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3089 struct Declarator * d;
3090 struct __ecereNameSpace__ecere__sys__OldList * params;
3091 struct Specifier * spec;
3092 struct External * external;
3093 struct Declarator * typeDecl;
3095 declarators = MkList();
3097 if(!prop->conversion || prop->_class->type == 1)
3099 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3101 specifiers = MkList();
3103 struct Context * context = SetupTemplatesContext(prop->_class);
3105 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3106 FinishTemplatesContext(context);
3108 ListAdd(params, MkTypeName(specifiers, d));
3109 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3111 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3112 d = MkDeclaratorFunction(d, params);
3113 for(spec = (*specifiers).first; spec; spec = spec->next)
3117 if((!typeDecl || typeDecl->type == 1))
3119 struct Symbol * classSym = spec->symbol;
3121 symbol->_class = classSym->registered;
3122 if(classSym->registered && classSym->registered->type == 1)
3123 DeclareStruct(spec->name, 0x0);
3127 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3128 specifiers = MkList();
3130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3131 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3133 if(!prop->conversion || prop->_class->type == 1)
3134 ListAdd(specifiers, MkSpecifier(VOID));
3136 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3137 decl = MkDeclaration(specifiers, declarators);
3138 external = MkExternalDeclaration(decl);
3139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3140 external->symbol = symbol;
3141 symbol->externalSet = external;
3142 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3149 if(!symbol->externalPtr)
3151 struct Declaration * decl;
3152 struct External * external;
3153 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3156 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3159 ListAdd(specifiers, MkSpecifierName("Property"));
3161 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3163 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3166 strcpy(propName, "__ecerePropM_");
3167 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3168 strcat(propName, "_");
3169 FullClassNameCat(propName, prop->name, 0x1);
3170 MangleClassName(propName);
3171 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3173 decl = MkDeclaration(specifiers, list);
3175 external = MkExternalDeclaration(decl);
3176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3177 external->symbol = symbol;
3178 symbol->externalPtr = external;
3182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3184 symbol->id = curExternal->symbol->idCode;
3188 struct Type * Dereference(struct Type * source)
3190 void * __ecereTemp1;
3191 struct Type * type = (((void *)0));
3195 if(source->kind == 13 || source->kind == 12)
3197 type = source->type;
3198 source->type->refCount++;
3200 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3202 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3204 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3210 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3215 static struct Type * Reference(struct Type * source)
3217 void * __ecereTemp1;
3218 struct Type * type = (((void *)0));
3222 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3228 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);
3230 extern void * memcpy(void * , const void * , unsigned int size);
3232 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3234 extern void FreeExpression(struct Expression * exp);
3236 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3238 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);
3240 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3242 extern struct Type * MkClassType(char * name);
3244 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);
3246 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)
3248 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3249 unsigned int found = 0x0;
3250 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3251 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3252 unsigned int freeType = 0x0;
3254 yylloc = member->loc;
3259 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3263 dataMember = *curMember;
3269 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3270 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3271 int _subMemberStackPos = 0;
3274 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3277 dataMember = thisMember;
3278 if(curMember && thisMember->memberAccess == 1)
3280 *curMember = thisMember;
3281 *curClass = thisMember->_class;
3282 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3283 *subMemberStackPos = _subMemberStackPos;
3289 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3290 if(method && method->type == 1)
3293 method = (((void *)0));
3298 struct Type * type = (((void *)0));
3302 if(!dataMember->dataType && dataMember->dataTypeString)
3304 struct Context * context = SetupTemplatesContext(_class);
3306 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3307 FinishTemplatesContext(context);
3309 type = dataMember->dataType;
3313 if(!method->dataType)
3314 ProcessMethodType(method);
3315 type = method->dataType;
3317 if(ident && ident->next)
3319 for(ident = ident->next; ident && type; ident = ident->next)
3323 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3325 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3327 type = dataMember->dataType;
3329 else if(type->kind == 9 || type->kind == 10)
3331 struct Type * memberType;
3333 for(memberType = type->members.first; memberType; memberType = memberType->next)
3335 if(!strcmp(memberType->name, ident->string))
3344 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3348 struct __ecereNameSpace__ecere__com__Class * sClass;
3350 for(sClass = _class; sClass; sClass = sClass->base)
3353 if(sClass->templateClass)
3354 sClass = sClass->templateClass;
3355 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3357 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3359 for(sClass = sClass->base; sClass; sClass = sClass->base)
3361 if(sClass->templateClass)
3362 sClass = sClass->templateClass;
3363 id += sClass->templateParams.count;
3374 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3376 if(arg.dataTypeString)
3378 type = ProcessTypeString(arg.dataTypeString, 0x0);
3380 if(type && _class->templateClass)
3381 type->passAsTemplate = 0x1;
3388 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3390 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3391 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3395 char templateString[1024];
3396 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3398 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3399 for(cClass = expClass; cClass; cClass = cClass->base)
3403 if(cClass->templateClass)
3404 cClass = cClass->templateClass;
3405 for(param = cClass->templateParams.first; param; param = param->next)
3408 struct __ecereNameSpace__ecere__com__Class * sClass;
3409 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3411 for(sClass = cClass->base; sClass; sClass = sClass->base)
3413 if(sClass->templateClass)
3414 sClass = sClass->templateClass;
3415 id += sClass->templateParams.count;
3417 arg = expClass->templateArgs[id];
3418 for(sClass = _class; sClass; sClass = sClass->base)
3420 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3422 struct __ecereNameSpace__ecere__com__Class * nextClass;
3424 if(sClass->templateClass)
3425 sClass = sClass->templateClass;
3426 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3428 if(nextClass->templateClass)
3429 nextClass = nextClass->templateClass;
3430 p += nextClass->templateParams.count;
3432 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3434 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3436 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3438 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3439 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3453 char expString[1024];
3454 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3455 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3456 struct Expression * exp;
3457 char * string = PrintHexUInt64(arg.expression.ui64);
3459 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3460 ProcessExpressionType(exp);
3461 ComputeExpression(exp);
3462 expString[0] = '\0';
3463 PrintExpression(exp, expString);
3464 strcat(argument, expString);
3465 FreeExpression(exp);
3470 strcat(argument, arg.member->name);
3475 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3476 strcat(argument, arg.dataTypeString);
3483 strcat(templateString, ", ");
3484 if(lastParam != p - 1)
3486 strcat(templateString, param->name);
3487 strcat(templateString, " = ");
3489 strcat(templateString, argument);
3498 int len = strlen(templateString);
3500 if(templateString[len - 1] == '<')
3504 if(templateString[len - 1] == '>')
3505 templateString[len++] = ' ';
3506 templateString[len++] = '>';
3508 templateString[len++] = '\0';
3511 struct Context * context = SetupTemplatesContext(_class);
3515 type = ProcessTypeString(templateString, 0x0);
3517 FinishTemplatesContext(context);
3520 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3522 ProcessExpressionType(member->initializer->exp);
3523 if(!member->initializer->exp->expType)
3527 char expString[10240];
3529 expString[0] = '\0';
3530 PrintExpression(member->initializer->exp, expString);
3531 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3532 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3535 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3537 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3540 else if(member->initializer)
3542 ProcessInitializer(member->initializer, type);
3549 if(_class && _class->type == 3)
3551 if(member->initializer)
3553 struct Type * type = MkClassType(_class->fullName);
3555 ProcessInitializer(member->initializer, type);
3561 if(member->initializer)
3563 ProcessInitializer(member->initializer, (((void *)0)));
3569 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3573 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3575 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3579 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3584 extern struct Identifier * GetDeclId(struct Declarator * decl);
3586 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);
3588 extern void FreeSpecifier(struct Specifier * spec);
3590 static void ProcessFunction(struct FunctionDefinition * function);
3592 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3594 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3596 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3598 extern void FreeClassFunction(struct ClassFunction * func);
3600 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3602 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3604 void ProcessInstantiationType(struct Instantiation * inst)
3609 struct MembersInit * members;
3610 struct Symbol * classSym;
3611 struct __ecereNameSpace__ecere__com__Class * _class;
3613 classSym = inst->_class->symbol;
3614 _class = classSym ? classSym->registered : (((void *)0));
3615 if(!_class || _class->type != 5)
3616 DeclareStruct(inst->_class->name, 0x0);
3617 afterExternal = afterExternal ? afterExternal : curExternal;
3619 ProcessExpressionType(inst->exp);
3620 inst->isConstant = 0x1;
3623 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3624 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3625 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3626 int subMemberStackPos = 0;
3628 for(members = (*inst->members).first; members; members = members->next)
3630 switch(members->type)
3635 static unsigned int instMethodID = 0;
3636 struct External * external = curExternal;
3637 struct Context * context = curContext;
3638 struct Declarator * declarator = members->function->declarator;
3639 struct Identifier * nameID = GetDeclId(declarator);
3640 char * unmangled = nameID ? nameID->string : (((void *)0));
3641 struct Expression * exp;
3642 struct External * createdExternal = (((void *)0));
3648 strcpy(name, "__ecereInstMeth_");
3649 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3651 strcat(name, nameID->string);
3653 sprintf(number, "_%08d", instMethodID++);
3654 strcat(name, number);
3655 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3659 struct Symbol * symbol = declarator->symbol;
3660 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3662 if(method && method->type == 1)
3664 symbol->method = method;
3665 ProcessMethodType(method);
3666 if(!symbol->type->thisClass)
3668 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3670 if(!currentClass->symbol)
3671 currentClass->symbol = FindClass(currentClass->fullName);
3672 symbol->type->thisClass = currentClass->symbol;
3677 _class->symbol = FindClass(_class->fullName);
3678 symbol->type->thisClass = _class->symbol;
3681 DeclareType(symbol->type, 0x1, 0x1);
3685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3688 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3691 FreeSpecifier(nameID->_class);
3692 nameID->_class = (((void *)0));
3696 struct Type * type = declarator->symbol->type;
3697 struct External * oldExternal = curExternal;
3699 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3701 struct External * externalDecl;
3703 externalDecl = MkExternalDeclaration((((void *)0)));
3704 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3705 if(createdExternal->function)
3707 ProcessFunction(createdExternal->function);
3709 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3711 externalDecl->declaration = decl;
3712 if(decl->symbol && !decl->symbol->pointerExternal)
3713 decl->symbol->pointerExternal = externalDecl;
3714 declarator->symbol->pointerExternal = externalDecl;
3721 curExternal = declarator->symbol->pointerExternal;
3722 ProcessFunction((struct FunctionDefinition *)members->function);
3724 curExternal = external;
3725 curContext = context;
3728 FreeClassFunction(members->function);
3729 exp = QMkExpId(name);
3731 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3732 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3738 if(members->dataMembers && classSym)
3740 struct MemberInit * member;
3741 struct Location oldyyloc = yylloc;
3743 for(member = (*members->dataMembers).first; member; member = member->next)
3745 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3746 if(member->initializer && !member->initializer->isConstant)
3747 inst->isConstant = 0x0;
3759 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3763 if(type->kind == 11)
3765 struct Type * param;
3769 for(param = type->params.first; param; param = param->next)
3770 DeclareType(param, declarePointers, 0x1);
3772 DeclareType(type->returnType, declarePointers, 0x1);
3774 else if(type->kind == 13 && declarePointers)
3775 DeclareType(type->type, declarePointers, 0x0);
3776 else if(type->kind == 8)
3778 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3779 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3781 else if(type->kind == 9 || type->kind == 10)
3783 struct Type * member;
3785 for(member = type->members.first; member; member = member->next)
3786 DeclareType(member, 0x0, 0x0);
3788 else if(type->kind == 12)
3789 DeclareType(type->arrayType, declarePointers, 0x0);
3793 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3795 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3797 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3799 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3800 struct __ecereNameSpace__ecere__com__Class * sClass;
3802 for(sClass = _class; sClass; sClass = sClass->base)
3805 if(sClass->templateClass)
3806 sClass = sClass->templateClass;
3807 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3809 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3811 for(sClass = sClass->base; sClass; sClass = sClass->base)
3813 if(sClass->templateClass)
3814 sClass = sClass->templateClass;
3815 id += sClass->templateParams.count;
3826 arg = &_class->templateArgs[id];
3827 if(arg && param->type == 0)
3828 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3833 extern struct Context * PushContext(void);
3835 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3837 struct TemplatedType
3840 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3841 struct __ecereNameSpace__ecere__sys__BTNode * left;
3842 struct __ecereNameSpace__ecere__sys__BTNode * right;
3844 struct TemplateParameter * param;
3845 } __attribute__ ((gcc_struct));
3847 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3849 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3851 void * __ecereTemp1;
3852 struct Context * context = PushContext();
3854 context->templateTypesOnly = 0x1;
3855 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3857 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3859 for(; param; param = param->next)
3861 if(param->type == 0 && param->identifier)
3863 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3865 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3871 struct __ecereNameSpace__ecere__com__Class * sClass;
3873 for(sClass = _class; sClass; sClass = sClass->base)
3875 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3877 for(p = sClass->templateParams.first; p; p = p->next)
3881 struct TemplateParameter * param = p->param;
3882 struct TemplatedType * type;
3886 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
3888 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3889 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3897 extern void PopContext(struct Context * ctx);
3899 extern void FreeContext(struct Context * context);
3901 void FinishTemplatesContext(struct Context * context)
3903 PopContext(context);
3904 FreeContext(context);
3905 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3908 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3910 if(!method->dataType)
3912 struct Context * context = SetupTemplatesContext(method->_class);
3914 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3915 FinishTemplatesContext(context);
3916 if(method->type != 1 && method->dataType)
3918 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3920 if(!method->_class->symbol)
3921 method->_class->symbol = FindClass(method->_class->fullName);
3922 method->dataType->thisClass = method->_class->symbol;
3928 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3932 struct Context * context = SetupTemplatesContext(prop->_class);
3934 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3935 FinishTemplatesContext(context);
3939 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3941 extern void FreeTypeName(struct TypeName * typeName);
3943 static void ProcessDeclarator(struct Declarator * decl);
3945 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3951 struct MethodImport * prev;
3952 struct MethodImport * next;
3954 unsigned int isVirtual;
3955 } __attribute__ ((gcc_struct));
3957 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3959 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3961 void * __ecereTemp1;
3962 struct Symbol * symbol = method->symbol;
3964 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3966 unsigned int imported = 0x0;
3967 unsigned int dllImport = 0x0;
3969 if(!method->dataType)
3970 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3971 if(!symbol || symbol->_import || method->type == 1)
3973 if(!symbol || method->type == 1)
3975 struct Symbol * classSym;
3977 if(!method->_class->symbol)
3978 method->_class->symbol = FindClass(method->_class->fullName);
3979 classSym = method->_class->symbol;
3980 if(!classSym->_import)
3982 struct ModuleImport * module;
3984 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3985 module = FindModule(method->_class->module);
3987 module = mainModule;
3988 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3993 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3995 if(!symbol->_import)
3997 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
3998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4002 symbol->type = method->dataType;
4004 symbol->type->refCount++;
4007 if(!method->dataType->dllExport)
4010 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4014 if(method->type != 1 && method->dataType)
4015 DeclareType(method->dataType, 0x1, 0x1);
4016 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4018 struct Declaration * decl;
4019 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4020 struct Declarator * d;
4021 struct Declarator * funcDecl;
4022 struct External * external;
4024 specifiers = MkList();
4025 declarators = MkList();
4027 ListAdd(specifiers, MkSpecifier(EXTERN));
4028 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4029 ListAdd(specifiers, MkSpecifier(STATIC));
4030 if(method->type == 1)
4032 ListAdd(specifiers, MkSpecifier(INT));
4033 d = MkDeclaratorIdentifier(MkIdentifier(name));
4037 d = MkDeclaratorIdentifier(MkIdentifier(name));
4039 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4041 struct Context * context = SetupTemplatesContext(method->_class);
4043 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4044 FinishTemplatesContext(context);
4046 funcDecl = GetFuncDecl(d);
4049 struct Specifier * spec, * next;
4051 for(spec = (*specifiers).first; spec; spec = next)
4056 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4057 FreeSpecifier(spec);
4061 if(method->dataType && !method->dataType->staticMethod)
4063 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4065 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4066 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")));
4067 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4068 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4070 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4072 struct TypeName * param = (*funcDecl->function.parameters).first;
4074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4075 FreeTypeName(param);
4077 if(!funcDecl->function.parameters)
4078 funcDecl->function.parameters = MkList();
4079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4083 ProcessDeclarator(d);
4084 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4085 decl = MkDeclaration(specifiers, declarators);
4086 ReplaceThisClassSpecifiers(specifiers, method->_class);
4087 if(symbol->pointerExternal)
4089 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4092 *functionSymbol = *symbol;
4093 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4094 if(functionSymbol->type)
4095 functionSymbol->type->refCount++;
4097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4098 symbol->pointerExternal->symbol = functionSymbol;
4100 external = MkExternalDeclaration(decl);
4102 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4103 external->symbol = symbol;
4104 symbol->pointerExternal = external;
4108 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4110 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4114 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4116 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4118 unsigned int first = 0x1;
4120 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4122 char className[1024];
4124 strcpy(className, _class->fullName);
4125 for(param = _class->templateParams.first; param; param = param->next)
4129 strcat(className, "<");
4131 strcat(className, ", ");
4132 if(lastParam + 1 != p)
4134 strcat(className, param->name);
4135 strcat(className, " = ");
4137 strcat(className, param->name);
4145 int len = strlen(className);
4147 if(className[len - 1] == '>')
4148 className[len++] = ' ';
4149 className[len++] = '>';
4150 className[len++] = '\0';
4152 return __ecereNameSpace__ecere__sys__CopyString(className);
4155 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4158 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4160 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4162 unsigned int first = 0x1;
4164 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4166 char className[1024];
4168 strcpy(className, _class->fullName);
4169 for(param = _class->templateParams.first; param; param = param->next)
4173 strcat(className, "<");
4175 strcat(className, ", ");
4176 if(lastParam + 1 != p)
4178 strcat(className, param->name);
4179 strcat(className, " = ");
4181 strcat(className, param->name);
4189 int len = strlen(className);
4191 if(className[len - 1] == '>')
4192 className[len++] = ' ';
4193 className[len++] = '>';
4194 className[len++] = '\0';
4196 return MkClassType(className);
4200 return MkClassType(_class->fullName);
4204 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4206 if(specs != (((void *)0)) && _class)
4208 struct Specifier * spec;
4210 for(spec = specs->first; spec; spec = spec->next)
4212 if(spec->type == 0 && spec->specifier == THISCLASS)
4215 spec->name = ReplaceThisClass(_class);
4216 spec->symbol = FindClass(spec->name);
4222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4224 struct __ecereNameSpace__ecere__com__GlobalFunction
4226 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4227 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4230 struct __ecereNameSpace__ecere__com__Instance * module;
4231 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4232 char * dataTypeString;
4233 struct Type * dataType;
4235 } __attribute__ ((gcc_struct));
4237 extern struct Context * globalContext;
4239 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4241 struct FunctionImport
4243 struct FunctionImport * prev;
4244 struct FunctionImport * next;
4246 } __attribute__ ((gcc_struct));
4248 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4250 void * __ecereTemp1;
4251 struct Symbol * symbol = function->symbol;
4253 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4255 unsigned int imported = 0x0;
4256 unsigned int dllImport = 0x0;
4258 if(!function->dataType)
4260 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4261 if(!function->dataType->thisClass)
4262 function->dataType->staticMethod = 0x1;
4268 struct ModuleImport * module = FindModule(function->module);
4270 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4273 if(!function->dataType->dllExport)
4275 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4280 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4281 if(!symbol->type->thisClass)
4282 symbol->type->staticMethod = 0x1;
4285 imported = symbol->_import ? 0x1 : 0x0;
4286 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4289 DeclareType(function->dataType, 0x1, 0x1);
4292 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4294 struct Declaration * decl;
4295 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4296 struct Declarator * d;
4297 struct Declarator * funcDecl;
4298 struct External * external;
4300 specifiers = MkList();
4301 declarators = MkList();
4302 ListAdd(specifiers, MkSpecifier(EXTERN));
4303 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4305 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4306 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4307 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4309 struct Specifier * spec;
4311 for(spec = (*specifiers).first; spec; spec = spec->next)
4312 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4315 FreeSpecifier(spec);
4319 funcDecl = GetFuncDecl(d);
4320 if(funcDecl && !funcDecl->function.parameters)
4322 funcDecl->function.parameters = MkList();
4323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4325 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4327 struct Context * oldCtx = curContext;
4329 curContext = globalContext;
4330 decl = MkDeclaration(specifiers, declarators);
4331 curContext = oldCtx;
4333 if(symbol->pointerExternal)
4335 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4338 *functionSymbol = *symbol;
4339 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4340 if(functionSymbol->type)
4341 functionSymbol->type->refCount++;
4343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4344 symbol->pointerExternal->symbol = functionSymbol;
4346 external = MkExternalDeclaration(decl);
4348 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4349 external->symbol = symbol;
4350 symbol->pointerExternal = external;
4354 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4357 symbol->id = curExternal->symbol->idCode;
4360 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4363 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4368 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4369 struct __ecereNameSpace__ecere__sys__BTNode * left;
4370 struct __ecereNameSpace__ecere__sys__BTNode * right;
4372 struct __ecereNameSpace__ecere__com__Instance * module;
4373 char * dataTypeString;
4374 struct Type * dataType;
4377 } __attribute__ ((gcc_struct));
4379 void DeclareGlobalData(struct GlobalData * data)
4381 struct Symbol * symbol = data->symbol;
4383 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4388 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4391 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4392 DeclareType(data->dataType, 0x1, 0x1);
4395 if(!symbol->pointerExternal)
4397 struct Declaration * decl;
4398 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4399 struct Declarator * d;
4400 struct External * external;
4402 specifiers = MkList();
4403 declarators = MkList();
4404 ListAdd(specifiers, MkSpecifier(EXTERN));
4405 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4406 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4407 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4408 decl = MkDeclaration(specifiers, declarators);
4409 external = MkExternalDeclaration(decl);
4411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4412 external->symbol = symbol;
4413 symbol->pointerExternal = external;
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4420 symbol->id = curExternal->symbol->idCode;
4427 struct Conversion * prev, * next;
4428 struct __ecereNameSpace__ecere__com__Property * convert;
4430 struct Type * resultType;
4431 } __attribute__ ((gcc_struct));
4433 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4435 extern void Compiler_Warning(char * format, ...);
4437 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4439 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)
4443 if(source->kind == 20 && dest->kind != 20)
4445 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4450 if(dest->kind == 20 && source->kind != 20)
4452 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4457 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4461 if(source->classObjectType == 3 && dest->classObjectType != 2)
4465 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4467 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4470 if(dest->kind == 14 && source->kind != 0)
4472 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))
4474 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))
4476 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4478 if(source->_class->registered && source->_class->registered->type == 3)
4480 if(conversions != (((void *)0)))
4482 if(source->_class->registered == dest->_class->registered)
4487 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4489 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4491 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4493 if(sourceBase == destBase)
4497 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))
4501 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4503 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4510 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4514 if(source->kind == 8)
4516 struct __ecereNameSpace__ecere__com__Class * _class;
4518 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4520 struct __ecereNameSpace__ecere__com__Property * convert;
4522 for(convert = _class->conversions.first; convert; convert = convert->next)
4524 if(convert->memberAccess == 1 || _class->module == privateModule)
4526 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4528 if(!convert->dataType)
4529 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4530 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4532 if(!conversions && !convert->Get)
4534 else if(conversions != (((void *)0)))
4536 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))
4540 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4553 struct __ecereNameSpace__ecere__com__Class * _class;
4555 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4557 struct __ecereNameSpace__ecere__com__Property * convert;
4559 for(convert = _class->conversions.first; convert; convert = convert->next)
4561 if(convert->memberAccess == 1 || _class->module == privateModule)
4563 if(!convert->dataType)
4564 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4565 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4567 if(!conversions && !convert->Set)
4569 else if(conversions != (((void *)0)))
4571 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))
4575 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4577 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4585 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4587 if(!dest->_class->registered->dataType)
4588 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4589 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4591 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4598 if(source->kind == 8)
4600 struct __ecereNameSpace__ecere__com__Class * _class;
4602 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4604 struct __ecereNameSpace__ecere__com__Property * convert;
4606 for(convert = _class->conversions.first; convert; convert = convert->next)
4608 if(convert->memberAccess == 1 || _class->module == privateModule)
4610 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4612 if(!convert->dataType)
4613 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4614 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4616 if(!conversions && !convert->Get)
4618 else if(conversions != (((void *)0)))
4620 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))
4624 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4634 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4636 if(!source->_class->registered->dataType)
4637 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4638 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4645 if(source->kind == 8 || source->kind == 19)
4647 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4649 else if(dest->kind == 7 && source->kind == 6)
4651 else if(dest->kind == 2 && source->kind == 1)
4653 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4655 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4657 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4659 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4661 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4663 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)))
4665 struct Type * paramSource, * paramDest;
4667 if(dest->kind == 16)
4668 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4669 if(source->kind == 16)
4670 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4671 if(dest->kind == 13 && dest->type->kind == 11)
4673 if(source->kind == 13 && source->type->kind == 11)
4674 source = source->type;
4675 if(dest->kind == 16)
4676 dest = dest->method->dataType;
4677 if(source->kind == 16)
4678 source = source->method->dataType;
4679 paramSource = source->params.first;
4680 if(paramSource && paramSource->kind == 0)
4681 paramSource = (((void *)0));
4682 paramDest = dest->params.first;
4683 if(paramDest && paramDest->kind == 0)
4684 paramDest = (((void *)0));
4685 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4687 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))))
4689 if(paramDest && paramDest->kind == 8)
4690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4692 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4695 paramDest = paramDest->next;
4697 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4699 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4703 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4705 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4711 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4714 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4720 paramSource = paramSource->next;
4726 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4734 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4736 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4742 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4744 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4747 for(; paramDest; paramDest = paramDest->next)
4751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4755 struct Type * paramDestType = paramDest;
4756 struct Type * paramSourceType = paramSource;
4757 struct Type * type = paramDestType;
4759 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4762 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4763 struct __ecereNameSpace__ecere__com__Class * sClass;
4765 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4768 if(sClass->templateClass)
4769 sClass = sClass->templateClass;
4770 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4772 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4774 for(sClass = sClass->base; sClass; sClass = sClass->base)
4776 if(sClass->templateClass)
4777 sClass = sClass->templateClass;
4778 id += sClass->templateParams.count;
4789 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4791 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4794 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)))
4799 PrintType(paramDest, type, 0x0, 0x1);
4800 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4801 if(paramDestType != paramDest)
4802 FreeType(paramDestType);
4805 if(paramDestType != paramDest)
4806 FreeType(paramDestType);
4808 paramSource = paramSource->next;
4812 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4817 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4821 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4823 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4830 static void FreeConvert(struct Conversion * convert)
4832 if(convert->resultType)
4833 FreeType(convert->resultType);
4836 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4838 struct __ecereNameSpace__ecere__com__BTNamedLink
4841 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4842 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4843 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4846 } __attribute__ ((gcc_struct));
4848 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4850 struct __ecereNameSpace__ecere__com__EnumClassData
4852 struct __ecereNameSpace__ecere__sys__OldList values;
4854 } __attribute__ ((gcc_struct));
4856 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4858 struct __ecereNameSpace__ecere__sys__NamedLink
4860 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4861 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4864 } __attribute__ ((gcc_struct));
4866 extern void FreeExpContents(struct Expression * exp);
4868 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4870 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4872 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4874 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4876 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4878 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4880 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4882 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)))
4884 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4886 if(_class->type == 4)
4888 struct __ecereNameSpace__ecere__sys__OldList converts =
4892 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4896 _class->symbol = FindClass(_class->fullName);
4897 type->_class = _class->symbol;
4898 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4900 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4901 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4905 struct __ecereNameSpace__ecere__com__Class * baseClass;
4907 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4909 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4911 for(value = e->values.first; value; value = value->next)
4913 if(!strcmp(value->name, string))
4918 FreeExpContents(sourceExp);
4919 FreeType(sourceExp->expType);
4920 sourceExp->isConstant = 0x1;
4921 sourceExp->expType = MkClassType(baseClass->fullName);
4925 sourceExp->type = 2;
4926 if(!strcmp(baseClass->dataTypeString, "int"))
4927 sprintf(constant, "%d", value->data);
4929 sprintf(constant, "0x%X", value->data);
4930 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4932 while(converts.first)
4934 struct Conversion * convert = converts.first;
4936 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4937 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4939 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4946 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4947 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4950 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)))
4951 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4956 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4958 struct __ecereNameSpace__ecere__com__SubModule
4960 struct __ecereNameSpace__ecere__com__SubModule * prev;
4961 struct __ecereNameSpace__ecere__com__SubModule * next;
4962 struct __ecereNameSpace__ecere__com__Instance * module;
4964 } __attribute__ ((gcc_struct));
4966 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4968 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4970 if(searchFor == searchIn)
4972 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4974 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4976 if(ModuleVisibility(subModule->module, searchFor))
4983 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4985 struct __ecereNameSpace__ecere__com__Application
4990 unsigned int isGUIApp;
4991 struct __ecereNameSpace__ecere__sys__OldList allModules;
4992 char * parsedCommand;
4993 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4994 } __attribute__ ((gcc_struct));
4996 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4998 struct __ecereNameSpace__ecere__com__Instance * module;
5000 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5002 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5004 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5006 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
5008 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5014 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5016 void ReadString(char * output, char * string);
5018 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5020 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5022 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5024 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5026 void * __ecereTemp1;
5027 struct Type * source = sourceExp->expType;
5028 struct Type * realDest = dest;
5030 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5032 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5034 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5036 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5038 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5040 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5042 if(sourceBase == destBase)
5048 struct __ecereNameSpace__ecere__sys__OldList * specs;
5049 unsigned int flag = 0x0;
5050 long long value = (((int)0x7fffffff));
5054 if(sourceExp->type == 2)
5056 if(source->isSigned)
5057 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5059 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5061 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5063 if(source->isSigned)
5064 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5066 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5068 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5071 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5075 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5077 if(_class && _class->type == 3)
5079 if(source->kind != 8)
5081 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5082 struct Type * tempDest, * tempSource;
5084 for(; _class->base->type != 1000; _class = _class->base)
5087 tempDest = tempType;
5090 _class->symbol = FindClass(_class->fullName);
5091 tempType->_class = _class->symbol;
5092 tempType->truth = dest->truth;
5093 if(tempType->_class)
5094 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5095 FreeType(sourceExp->expType);
5096 sourceExp->expType = dest;
5099 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5102 if(_class && _class->type == 2 && source->kind != 8)
5104 if(!dest->_class->registered->dataType)
5105 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5106 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5109 FreeType(sourceExp->expType);
5110 source = sourceExp->expType = MkClassType(dest->_class->string);
5114 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5116 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5117 struct Declarator * decl;
5120 ReadString(string, sourceExp->string);
5121 decl = SpecDeclFromString(string, specs, (((void *)0)));
5122 FreeExpContents(sourceExp);
5123 FreeType(sourceExp->expType);
5124 sourceExp->type = 26;
5125 sourceExp->_classExp.specifiers = specs;
5126 sourceExp->_classExp.decl = decl;
5127 sourceExp->expType = dest;
5134 else if(source->kind == 8)
5136 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5138 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5142 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5143 struct Type * tempDest, * tempSource;
5145 if(!source->_class->registered->dataType)
5146 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5147 for(; _class->base->type != 1000; _class = _class->base)
5150 tempSource = tempType;
5152 tempType->_class = FindClass(_class->fullName);
5153 tempType->truth = source->truth;
5154 tempType->classObjectType = source->classObjectType;
5155 if(tempType->_class)
5156 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5157 if(conversions->last)
5159 ((struct Conversion *)conversions->last)->resultType = dest;
5162 FreeType(sourceExp->expType);
5163 sourceExp->expType = MkClassType(_class->fullName);
5164 sourceExp->expType->truth = source->truth;
5165 sourceExp->expType->classObjectType = source->classObjectType;
5166 if(!sourceExp->destType)
5168 FreeType(sourceExp->destType);
5169 sourceExp->destType = sourceExp->expType;
5170 if(sourceExp->expType)
5171 sourceExp->expType->refCount++;
5173 if(!_class->dataType)
5174 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5176 dest = MkClassType(source->_class->string);
5177 dest->truth = source->truth;
5178 dest->classObjectType = source->classObjectType;
5180 source = _class->dataType;
5182 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5188 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5197 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5199 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5201 if(_class->type == 0 || _class->type == 5)
5203 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5205 *newExp = *sourceExp;
5206 if(sourceExp->destType)
5207 sourceExp->destType->refCount++;
5208 if(sourceExp->expType)
5209 sourceExp->expType->refCount++;
5210 sourceExp->type = 11;
5211 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5212 sourceExp->cast.exp = newExp;
5213 FreeType(sourceExp->expType);
5214 sourceExp->expType = (((void *)0));
5215 ProcessExpressionType(sourceExp);
5218 FreeType(sourceExp->expType);
5219 sourceExp->expType = dest;
5226 if(!_class->dataType)
5227 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5229 dest = _class->dataType;
5232 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5234 specs = MkListOne(MkSpecifier(DOUBLE));
5236 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5238 specs = MkListOne(MkSpecifier(FLOAT));
5240 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5244 ListAdd(specs, MkSpecifier(UNSIGNED));
5245 ListAdd(specs, MkSpecifier(INT64));
5247 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5251 ListAdd(specs, MkSpecifier(UNSIGNED));
5252 ListAdd(specs, MkSpecifier(INT));
5254 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5258 ListAdd(specs, MkSpecifier(UNSIGNED));
5259 ListAdd(specs, MkSpecifier(SHORT));
5261 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5265 ListAdd(specs, MkSpecifier(UNSIGNED));
5266 ListAdd(specs, MkSpecifier(CHAR));
5275 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))
5277 specs = MkListOne(MkSpecifier(DOUBLE));
5279 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5281 specs = MkListOne(MkSpecifier(FLOAT));
5283 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)))
5287 ListAdd(specs, MkSpecifier(UNSIGNED));
5288 ListAdd(specs, MkSpecifier(CHAR));
5290 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)))))
5294 ListAdd(specs, MkSpecifier(UNSIGNED));
5295 ListAdd(specs, MkSpecifier(SHORT));
5297 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5301 ListAdd(specs, MkSpecifier(UNSIGNED));
5302 ListAdd(specs, MkSpecifier(INT));
5304 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5308 ListAdd(specs, MkSpecifier(UNSIGNED));
5309 ListAdd(specs, MkSpecifier(INT64));
5311 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5313 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5323 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5325 *newExp = *sourceExp;
5326 newExp->prev = (((void *)0));
5327 newExp->next = (((void *)0));
5328 if(sourceExp->destType)
5329 sourceExp->destType->refCount++;
5330 if(sourceExp->expType)
5331 sourceExp->expType->refCount++;
5332 sourceExp->type = 11;
5333 if(realDest->kind == 8)
5335 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5336 FreeList(specs, FreeSpecifier);
5339 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5340 if(newExp->type == 4)
5342 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5345 sourceExp->cast.exp = newExp;
5346 FreeType(sourceExp->expType);
5347 sourceExp->expType = (((void *)0));
5348 ProcessExpressionType(sourceExp);
5351 FreeList(specs, FreeSpecifier);
5358 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5359 sourceExp = (*sourceExp->list).last;
5360 if(sourceExp->type == 0)
5362 struct Identifier * id = sourceExp->identifier;
5366 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5368 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5369 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5373 for(; _class && _class->type == 4; _class = _class->base)
5375 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5376 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5378 for(value = e->values.first; value; value = value->next)
5380 if(!strcmp(value->name, id->string))
5385 FreeExpContents(sourceExp);
5386 FreeType(sourceExp->expType);
5387 sourceExp->isConstant = 0x1;
5388 sourceExp->expType = MkClassType(_class->fullName);
5392 sourceExp->type = 2;
5393 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5394 sprintf(constant, "%d", value->data);
5396 sprintf(constant, "0x%X", value->data);
5397 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5405 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5412 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5414 int value2 = op2->i;
5417 exp->string = PrintInt(op1->i + value2);
5420 exp->expType = op1->type;
5422 op1->type->refCount++;
5427 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5429 unsigned int value2 = op2->ui;
5432 exp->string = PrintUInt(op1->ui + value2);
5435 exp->expType = op1->type;
5437 op1->type->refCount++;
5442 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5444 short value2 = op2->s;
5447 exp->string = PrintShort(op1->s + value2);
5450 exp->expType = op1->type;
5452 op1->type->refCount++;
5457 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5459 unsigned short value2 = op2->us;
5462 exp->string = PrintUShort(op1->us + value2);
5465 exp->expType = op1->type;
5467 op1->type->refCount++;
5472 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5474 char value2 = op2->c;
5477 exp->string = PrintChar(op1->c + value2);
5480 exp->expType = op1->type;
5482 op1->type->refCount++;
5487 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5489 unsigned char value2 = op2->uc;
5492 exp->string = PrintUChar(op1->uc + value2);
5495 exp->expType = op1->type;
5497 op1->type->refCount++;
5502 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5504 float value2 = op2->f;
5507 exp->string = PrintFloat(op1->f + value2);
5510 exp->expType = op1->type;
5512 op1->type->refCount++;
5517 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5519 double value2 = op2->d;
5522 exp->string = PrintDouble(op1->d + value2);
5525 exp->expType = op1->type;
5527 op1->type->refCount++;
5532 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5534 int value2 = op2->i;
5537 exp->string = PrintInt(op1->i - value2);
5540 exp->expType = op1->type;
5542 op1->type->refCount++;
5547 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5549 unsigned int value2 = op2->ui;
5552 exp->string = PrintUInt(op1->ui - value2);
5555 exp->expType = op1->type;
5557 op1->type->refCount++;
5562 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5564 short value2 = op2->s;
5567 exp->string = PrintShort(op1->s - value2);
5570 exp->expType = op1->type;
5572 op1->type->refCount++;
5577 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5579 unsigned short value2 = op2->us;
5582 exp->string = PrintUShort(op1->us - value2);
5585 exp->expType = op1->type;
5587 op1->type->refCount++;
5592 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5594 char value2 = op2->c;
5597 exp->string = PrintChar(op1->c - value2);
5600 exp->expType = op1->type;
5602 op1->type->refCount++;
5607 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5609 unsigned char value2 = op2->uc;
5612 exp->string = PrintUChar(op1->uc - value2);
5615 exp->expType = op1->type;
5617 op1->type->refCount++;
5622 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5624 float value2 = op2->f;
5627 exp->string = PrintFloat(op1->f - value2);
5630 exp->expType = op1->type;
5632 op1->type->refCount++;
5637 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5639 double value2 = op2->d;
5642 exp->string = PrintDouble(op1->d - value2);
5645 exp->expType = op1->type;
5647 op1->type->refCount++;
5652 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5654 int value2 = op2->i;
5657 exp->string = PrintInt(op1->i * value2);
5660 exp->expType = op1->type;
5662 op1->type->refCount++;
5667 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5669 unsigned int value2 = op2->ui;
5672 exp->string = PrintUInt(op1->ui * value2);
5675 exp->expType = op1->type;
5677 op1->type->refCount++;
5682 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5684 short value2 = op2->s;
5687 exp->string = PrintShort(op1->s * value2);
5690 exp->expType = op1->type;
5692 op1->type->refCount++;
5697 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5699 unsigned short value2 = op2->us;
5702 exp->string = PrintUShort(op1->us * value2);
5705 exp->expType = op1->type;
5707 op1->type->refCount++;
5712 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5714 char value2 = op2->c;
5717 exp->string = PrintChar(op1->c * value2);
5720 exp->expType = op1->type;
5722 op1->type->refCount++;
5727 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5729 unsigned char value2 = op2->uc;
5732 exp->string = PrintUChar(op1->uc * value2);
5735 exp->expType = op1->type;
5737 op1->type->refCount++;
5742 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5744 float value2 = op2->f;
5747 exp->string = PrintFloat(op1->f * value2);
5750 exp->expType = op1->type;
5752 op1->type->refCount++;
5757 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5759 double value2 = op2->d;
5762 exp->string = PrintDouble(op1->d * value2);
5765 exp->expType = op1->type;
5767 op1->type->refCount++;
5772 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5774 int value2 = op2->i;
5777 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5780 exp->expType = op1->type;
5782 op1->type->refCount++;
5787 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5789 unsigned int value2 = op2->ui;
5792 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5795 exp->expType = op1->type;
5797 op1->type->refCount++;
5802 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5804 short value2 = op2->s;
5807 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5810 exp->expType = op1->type;
5812 op1->type->refCount++;
5817 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5819 unsigned short value2 = op2->us;
5822 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5825 exp->expType = op1->type;
5827 op1->type->refCount++;
5832 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5834 char value2 = op2->c;
5837 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5840 exp->expType = op1->type;
5842 op1->type->refCount++;
5847 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5849 unsigned char value2 = op2->uc;
5852 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5855 exp->expType = op1->type;
5857 op1->type->refCount++;
5862 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5864 float value2 = op2->f;
5867 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5870 exp->expType = op1->type;
5872 op1->type->refCount++;
5877 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5879 double value2 = op2->d;
5882 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5885 exp->expType = op1->type;
5887 op1->type->refCount++;
5892 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5894 int value2 = op2->i;
5897 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5900 exp->expType = op1->type;
5902 op1->type->refCount++;
5907 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5909 unsigned int value2 = op2->ui;
5912 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5915 exp->expType = op1->type;
5917 op1->type->refCount++;
5922 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5924 short value2 = op2->s;
5927 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5930 exp->expType = op1->type;
5932 op1->type->refCount++;
5937 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5939 unsigned short value2 = op2->us;
5942 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5945 exp->expType = op1->type;
5947 op1->type->refCount++;
5952 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5954 char value2 = op2->c;
5957 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5960 exp->expType = op1->type;
5962 op1->type->refCount++;
5967 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5969 unsigned char value2 = op2->uc;
5972 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5975 exp->expType = op1->type;
5977 op1->type->refCount++;
5982 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5985 exp->string = PrintInt(-op1->i);
5988 exp->expType = op1->type;
5990 op1->type->refCount++;
5995 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5998 exp->string = PrintUInt(-op1->ui);
6001 exp->expType = op1->type;
6003 op1->type->refCount++;
6008 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6011 exp->string = PrintShort(-op1->s);
6014 exp->expType = op1->type;
6016 op1->type->refCount++;
6021 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6024 exp->string = PrintUShort(-op1->us);
6027 exp->expType = op1->type;
6029 op1->type->refCount++;
6034 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6037 exp->string = PrintChar(-op1->c);
6040 exp->expType = op1->type;
6042 op1->type->refCount++;
6047 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6050 exp->string = PrintUChar(-op1->uc);
6053 exp->expType = op1->type;
6055 op1->type->refCount++;
6060 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6063 exp->string = PrintFloat(-op1->f);
6066 exp->expType = op1->type;
6068 op1->type->refCount++;
6073 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6076 exp->string = PrintDouble(-op1->d);
6079 exp->expType = op1->type;
6081 op1->type->refCount++;
6086 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6089 exp->string = PrintInt(++op1->i);
6092 exp->expType = op1->type;
6094 op1->type->refCount++;
6099 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6102 exp->string = PrintUInt(++op1->ui);
6105 exp->expType = op1->type;
6107 op1->type->refCount++;
6112 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6115 exp->string = PrintShort(++op1->s);
6118 exp->expType = op1->type;
6120 op1->type->refCount++;
6125 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6128 exp->string = PrintUShort(++op1->us);
6131 exp->expType = op1->type;
6133 op1->type->refCount++;
6138 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6141 exp->string = PrintChar(++op1->c);
6144 exp->expType = op1->type;
6146 op1->type->refCount++;
6151 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6154 exp->string = PrintUChar(++op1->uc);
6157 exp->expType = op1->type;
6159 op1->type->refCount++;
6164 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6167 exp->string = PrintFloat(++op1->f);
6170 exp->expType = op1->type;
6172 op1->type->refCount++;
6177 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6180 exp->string = PrintDouble(++op1->d);
6183 exp->expType = op1->type;
6185 op1->type->refCount++;
6190 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6193 exp->string = PrintInt(--op1->i);
6196 exp->expType = op1->type;
6198 op1->type->refCount++;
6203 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6206 exp->string = PrintUInt(--op1->ui);
6209 exp->expType = op1->type;
6211 op1->type->refCount++;
6216 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6219 exp->string = PrintShort(--op1->s);
6222 exp->expType = op1->type;
6224 op1->type->refCount++;
6229 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6232 exp->string = PrintUShort(--op1->us);
6235 exp->expType = op1->type;
6237 op1->type->refCount++;
6242 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6245 exp->string = PrintChar(--op1->c);
6248 exp->expType = op1->type;
6250 op1->type->refCount++;
6255 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6258 exp->string = PrintUChar(--op1->uc);
6261 exp->expType = op1->type;
6263 op1->type->refCount++;
6268 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6271 exp->string = PrintFloat(--op1->f);
6274 exp->expType = op1->type;
6276 op1->type->refCount++;
6281 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6284 exp->string = PrintDouble(--op1->d);
6287 exp->expType = op1->type;
6289 op1->type->refCount++;
6294 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6296 int value2 = op2->i;
6299 exp->string = PrintInt(op1->i = value2);
6302 exp->expType = op1->type;
6304 op1->type->refCount++;
6309 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6311 unsigned int value2 = op2->ui;
6314 exp->string = PrintUInt(op1->ui = value2);
6317 exp->expType = op1->type;
6319 op1->type->refCount++;
6324 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6326 short value2 = op2->s;
6329 exp->string = PrintShort(op1->s = value2);
6332 exp->expType = op1->type;
6334 op1->type->refCount++;
6339 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6341 unsigned short value2 = op2->us;
6344 exp->string = PrintUShort(op1->us = value2);
6347 exp->expType = op1->type;
6349 op1->type->refCount++;
6354 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6356 char value2 = op2->c;
6359 exp->string = PrintChar(op1->c = value2);
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6371 unsigned char value2 = op2->uc;
6374 exp->string = PrintUChar(op1->uc = value2);
6377 exp->expType = op1->type;
6379 op1->type->refCount++;
6384 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6386 float value2 = op2->f;
6389 exp->string = PrintFloat(op1->f = value2);
6392 exp->expType = op1->type;
6394 op1->type->refCount++;
6399 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6401 double value2 = op2->d;
6404 exp->string = PrintDouble(op1->d = value2);
6407 exp->expType = op1->type;
6409 op1->type->refCount++;
6414 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6416 int value2 = op2->i;
6419 exp->string = PrintInt(op1->i += value2);
6422 exp->expType = op1->type;
6424 op1->type->refCount++;
6429 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6431 unsigned int value2 = op2->ui;
6434 exp->string = PrintUInt(op1->ui += value2);
6437 exp->expType = op1->type;
6439 op1->type->refCount++;
6444 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6446 short value2 = op2->s;
6449 exp->string = PrintShort(op1->s += value2);
6452 exp->expType = op1->type;
6454 op1->type->refCount++;
6459 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6461 unsigned short value2 = op2->us;
6464 exp->string = PrintUShort(op1->us += value2);
6467 exp->expType = op1->type;
6469 op1->type->refCount++;
6474 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6476 char value2 = op2->c;
6479 exp->string = PrintChar(op1->c += value2);
6482 exp->expType = op1->type;
6484 op1->type->refCount++;
6489 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6491 unsigned char value2 = op2->uc;
6494 exp->string = PrintUChar(op1->uc += value2);
6497 exp->expType = op1->type;
6499 op1->type->refCount++;
6504 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6506 float value2 = op2->f;
6509 exp->string = PrintFloat(op1->f += value2);
6512 exp->expType = op1->type;
6514 op1->type->refCount++;
6519 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6521 double value2 = op2->d;
6524 exp->string = PrintDouble(op1->d += value2);
6527 exp->expType = op1->type;
6529 op1->type->refCount++;
6534 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6536 int value2 = op2->i;
6539 exp->string = PrintInt(op1->i -= value2);
6542 exp->expType = op1->type;
6544 op1->type->refCount++;
6549 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6551 unsigned int value2 = op2->ui;
6554 exp->string = PrintUInt(op1->ui -= value2);
6557 exp->expType = op1->type;
6559 op1->type->refCount++;
6564 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6566 short value2 = op2->s;
6569 exp->string = PrintShort(op1->s -= value2);
6572 exp->expType = op1->type;
6574 op1->type->refCount++;
6579 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6581 unsigned short value2 = op2->us;
6584 exp->string = PrintUShort(op1->us -= value2);
6587 exp->expType = op1->type;
6589 op1->type->refCount++;
6594 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6596 char value2 = op2->c;
6599 exp->string = PrintChar(op1->c -= value2);
6602 exp->expType = op1->type;
6604 op1->type->refCount++;
6609 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6611 unsigned char value2 = op2->uc;
6614 exp->string = PrintUChar(op1->uc -= value2);
6617 exp->expType = op1->type;
6619 op1->type->refCount++;
6624 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6626 float value2 = op2->f;
6629 exp->string = PrintFloat(op1->f -= value2);
6632 exp->expType = op1->type;
6634 op1->type->refCount++;
6639 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6641 double value2 = op2->d;
6644 exp->string = PrintDouble(op1->d -= value2);
6647 exp->expType = op1->type;
6649 op1->type->refCount++;
6654 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6656 int value2 = op2->i;
6659 exp->string = PrintInt(op1->i *= value2);
6662 exp->expType = op1->type;
6664 op1->type->refCount++;
6669 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6671 unsigned int value2 = op2->ui;
6674 exp->string = PrintUInt(op1->ui *= value2);
6677 exp->expType = op1->type;
6679 op1->type->refCount++;
6684 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6686 short value2 = op2->s;
6689 exp->string = PrintShort(op1->s *= value2);
6692 exp->expType = op1->type;
6694 op1->type->refCount++;
6699 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6701 unsigned short value2 = op2->us;
6704 exp->string = PrintUShort(op1->us *= value2);
6707 exp->expType = op1->type;
6709 op1->type->refCount++;
6714 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6716 char value2 = op2->c;
6719 exp->string = PrintChar(op1->c *= value2);
6722 exp->expType = op1->type;
6724 op1->type->refCount++;
6729 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6731 unsigned char value2 = op2->uc;
6734 exp->string = PrintUChar(op1->uc *= value2);
6737 exp->expType = op1->type;
6739 op1->type->refCount++;
6744 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6746 float value2 = op2->f;
6749 exp->string = PrintFloat(op1->f *= value2);
6752 exp->expType = op1->type;
6754 op1->type->refCount++;
6759 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6761 double value2 = op2->d;
6764 exp->string = PrintDouble(op1->d *= value2);
6767 exp->expType = op1->type;
6769 op1->type->refCount++;
6774 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6776 int value2 = op2->i;
6779 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6782 exp->expType = op1->type;
6784 op1->type->refCount++;
6789 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6791 unsigned int value2 = op2->ui;
6794 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6797 exp->expType = op1->type;
6799 op1->type->refCount++;
6804 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6806 short value2 = op2->s;
6809 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6812 exp->expType = op1->type;
6814 op1->type->refCount++;
6819 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6821 unsigned short value2 = op2->us;
6824 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6827 exp->expType = op1->type;
6829 op1->type->refCount++;
6834 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6836 char value2 = op2->c;
6839 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6842 exp->expType = op1->type;
6844 op1->type->refCount++;
6849 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6851 unsigned char value2 = op2->uc;
6854 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6857 exp->expType = op1->type;
6859 op1->type->refCount++;
6864 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6866 float value2 = op2->f;
6869 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6872 exp->expType = op1->type;
6874 op1->type->refCount++;
6879 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6881 double value2 = op2->d;
6884 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6887 exp->expType = op1->type;
6889 op1->type->refCount++;
6894 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6896 int value2 = op2->i;
6899 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6902 exp->expType = op1->type;
6904 op1->type->refCount++;
6909 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6911 unsigned int value2 = op2->ui;
6914 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6917 exp->expType = op1->type;
6919 op1->type->refCount++;
6924 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6926 short value2 = op2->s;
6929 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6932 exp->expType = op1->type;
6934 op1->type->refCount++;
6939 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6941 unsigned short value2 = op2->us;
6944 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6947 exp->expType = op1->type;
6949 op1->type->refCount++;
6954 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6956 char value2 = op2->c;
6959 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6962 exp->expType = op1->type;
6964 op1->type->refCount++;
6969 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6971 unsigned char value2 = op2->uc;
6974 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6977 exp->expType = op1->type;
6979 op1->type->refCount++;
6984 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6986 int value2 = op2->i;
6989 exp->string = PrintInt(op1->i & value2);
6992 exp->expType = op1->type;
6994 op1->type->refCount++;
6999 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7001 unsigned int value2 = op2->ui;
7004 exp->string = PrintUInt(op1->ui & value2);
7007 exp->expType = op1->type;
7009 op1->type->refCount++;
7014 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7016 short value2 = op2->s;
7019 exp->string = PrintShort(op1->s & value2);
7022 exp->expType = op1->type;
7024 op1->type->refCount++;
7029 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7031 unsigned short value2 = op2->us;
7034 exp->string = PrintUShort(op1->us & value2);
7037 exp->expType = op1->type;
7039 op1->type->refCount++;
7044 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7046 char value2 = op2->c;
7049 exp->string = PrintChar(op1->c & value2);
7052 exp->expType = op1->type;
7054 op1->type->refCount++;
7059 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7061 unsigned char value2 = op2->uc;
7064 exp->string = PrintUChar(op1->uc & value2);
7067 exp->expType = op1->type;
7069 op1->type->refCount++;
7074 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7076 int value2 = op2->i;
7079 exp->string = PrintInt(op1->i | value2);
7082 exp->expType = op1->type;
7084 op1->type->refCount++;
7089 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7091 unsigned int value2 = op2->ui;
7094 exp->string = PrintUInt(op1->ui | value2);
7097 exp->expType = op1->type;
7099 op1->type->refCount++;
7104 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7106 short value2 = op2->s;
7109 exp->string = PrintShort(op1->s | value2);
7112 exp->expType = op1->type;
7114 op1->type->refCount++;
7119 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7121 unsigned short value2 = op2->us;
7124 exp->string = PrintUShort(op1->us | value2);
7127 exp->expType = op1->type;
7129 op1->type->refCount++;
7134 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7136 char value2 = op2->c;
7139 exp->string = PrintChar(op1->c | value2);
7142 exp->expType = op1->type;
7144 op1->type->refCount++;
7149 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7151 unsigned char value2 = op2->uc;
7154 exp->string = PrintUChar(op1->uc | value2);
7157 exp->expType = op1->type;
7159 op1->type->refCount++;
7164 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7166 int value2 = op2->i;
7169 exp->string = PrintInt(op1->i ^ value2);
7172 exp->expType = op1->type;
7174 op1->type->refCount++;
7179 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7181 unsigned int value2 = op2->ui;
7184 exp->string = PrintUInt(op1->ui ^ value2);
7187 exp->expType = op1->type;
7189 op1->type->refCount++;
7194 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7196 short value2 = op2->s;
7199 exp->string = PrintShort(op1->s ^ value2);
7202 exp->expType = op1->type;
7204 op1->type->refCount++;
7209 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7211 unsigned short value2 = op2->us;
7214 exp->string = PrintUShort(op1->us ^ value2);
7217 exp->expType = op1->type;
7219 op1->type->refCount++;
7224 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7226 char value2 = op2->c;
7229 exp->string = PrintChar(op1->c ^ value2);
7232 exp->expType = op1->type;
7234 op1->type->refCount++;
7239 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7241 unsigned char value2 = op2->uc;
7244 exp->string = PrintUChar(op1->uc ^ value2);
7247 exp->expType = op1->type;
7249 op1->type->refCount++;
7254 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7256 int value2 = op2->i;
7259 exp->string = PrintInt(op1->i << value2);
7262 exp->expType = op1->type;
7264 op1->type->refCount++;
7269 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7271 unsigned int value2 = op2->ui;
7274 exp->string = PrintUInt(op1->ui << value2);
7277 exp->expType = op1->type;
7279 op1->type->refCount++;
7284 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7286 short value2 = op2->s;
7289 exp->string = PrintShort(op1->s << value2);
7292 exp->expType = op1->type;
7294 op1->type->refCount++;
7299 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7301 unsigned short value2 = op2->us;
7304 exp->string = PrintUShort(op1->us << value2);
7307 exp->expType = op1->type;
7309 op1->type->refCount++;
7314 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7316 char value2 = op2->c;
7319 exp->string = PrintChar(op1->c << value2);
7322 exp->expType = op1->type;
7324 op1->type->refCount++;
7329 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7331 unsigned char value2 = op2->uc;
7334 exp->string = PrintUChar(op1->uc << value2);
7337 exp->expType = op1->type;
7339 op1->type->refCount++;
7344 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7346 int value2 = op2->i;
7349 exp->string = PrintInt(op1->i >> value2);
7352 exp->expType = op1->type;
7354 op1->type->refCount++;
7359 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7361 unsigned int value2 = op2->ui;
7364 exp->string = PrintUInt(op1->ui >> value2);
7367 exp->expType = op1->type;
7369 op1->type->refCount++;
7374 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7376 short value2 = op2->s;
7379 exp->string = PrintShort(op1->s >> value2);
7382 exp->expType = op1->type;
7384 op1->type->refCount++;
7389 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7391 unsigned short value2 = op2->us;
7394 exp->string = PrintUShort(op1->us >> value2);
7397 exp->expType = op1->type;
7399 op1->type->refCount++;
7404 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7406 char value2 = op2->c;
7409 exp->string = PrintChar(op1->c >> value2);
7412 exp->expType = op1->type;
7414 op1->type->refCount++;
7419 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7421 unsigned char value2 = op2->uc;
7424 exp->string = PrintUChar(op1->uc >> value2);
7427 exp->expType = op1->type;
7429 op1->type->refCount++;
7434 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7437 exp->string = PrintInt(~op1->i);
7440 exp->expType = op1->type;
7442 op1->type->refCount++;
7447 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7450 exp->string = PrintUInt(~op1->ui);
7453 exp->expType = op1->type;
7455 op1->type->refCount++;
7460 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7463 exp->string = PrintShort(~op1->s);
7466 exp->expType = op1->type;
7468 op1->type->refCount++;
7473 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7476 exp->string = PrintUShort(~op1->us);
7479 exp->expType = op1->type;
7481 op1->type->refCount++;
7486 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7489 exp->string = PrintChar(~op1->c);
7492 exp->expType = op1->type;
7494 op1->type->refCount++;
7499 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7502 exp->string = PrintUChar(~op1->uc);
7505 exp->expType = op1->type;
7507 op1->type->refCount++;
7512 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7514 int value2 = op2->i;
7517 exp->string = PrintInt(op1->i &= value2);
7520 exp->expType = op1->type;
7522 op1->type->refCount++;
7527 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7529 unsigned int value2 = op2->ui;
7532 exp->string = PrintUInt(op1->ui &= value2);
7535 exp->expType = op1->type;
7537 op1->type->refCount++;
7542 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7544 short value2 = op2->s;
7547 exp->string = PrintShort(op1->s &= value2);
7550 exp->expType = op1->type;
7552 op1->type->refCount++;
7557 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7559 unsigned short value2 = op2->us;
7562 exp->string = PrintUShort(op1->us &= value2);
7565 exp->expType = op1->type;
7567 op1->type->refCount++;
7572 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7574 char value2 = op2->c;
7577 exp->string = PrintChar(op1->c &= value2);
7580 exp->expType = op1->type;
7582 op1->type->refCount++;
7587 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7589 unsigned char value2 = op2->uc;
7592 exp->string = PrintUChar(op1->uc &= value2);
7595 exp->expType = op1->type;
7597 op1->type->refCount++;
7602 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7604 int value2 = op2->i;
7607 exp->string = PrintInt(op1->i |= value2);
7610 exp->expType = op1->type;
7612 op1->type->refCount++;
7617 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7619 unsigned int value2 = op2->ui;
7622 exp->string = PrintUInt(op1->ui |= value2);
7625 exp->expType = op1->type;
7627 op1->type->refCount++;
7632 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7634 short value2 = op2->s;
7637 exp->string = PrintShort(op1->s |= value2);
7640 exp->expType = op1->type;
7642 op1->type->refCount++;
7647 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7649 unsigned short value2 = op2->us;
7652 exp->string = PrintUShort(op1->us |= value2);
7655 exp->expType = op1->type;
7657 op1->type->refCount++;
7662 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7664 char value2 = op2->c;
7667 exp->string = PrintChar(op1->c |= value2);
7670 exp->expType = op1->type;
7672 op1->type->refCount++;
7677 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7679 unsigned char value2 = op2->uc;
7682 exp->string = PrintUChar(op1->uc |= value2);
7685 exp->expType = op1->type;
7687 op1->type->refCount++;
7692 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7694 int value2 = op2->i;
7697 exp->string = PrintInt(op1->i ^= value2);
7700 exp->expType = op1->type;
7702 op1->type->refCount++;
7707 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7709 unsigned int value2 = op2->ui;
7712 exp->string = PrintUInt(op1->ui ^= value2);
7715 exp->expType = op1->type;
7717 op1->type->refCount++;
7722 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7724 short value2 = op2->s;
7727 exp->string = PrintShort(op1->s ^= value2);
7730 exp->expType = op1->type;
7732 op1->type->refCount++;
7737 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7739 unsigned short value2 = op2->us;
7742 exp->string = PrintUShort(op1->us ^= value2);
7745 exp->expType = op1->type;
7747 op1->type->refCount++;
7752 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7754 char value2 = op2->c;
7757 exp->string = PrintChar(op1->c ^= value2);
7760 exp->expType = op1->type;
7762 op1->type->refCount++;
7767 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7769 unsigned char value2 = op2->uc;
7772 exp->string = PrintUChar(op1->uc ^= value2);
7775 exp->expType = op1->type;
7777 op1->type->refCount++;
7782 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7784 int value2 = op2->i;
7787 exp->string = PrintInt(op1->i <<= value2);
7790 exp->expType = op1->type;
7792 op1->type->refCount++;
7797 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7799 unsigned int value2 = op2->ui;
7802 exp->string = PrintUInt(op1->ui <<= value2);
7805 exp->expType = op1->type;
7807 op1->type->refCount++;
7812 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7814 short value2 = op2->s;
7817 exp->string = PrintShort(op1->s <<= value2);
7820 exp->expType = op1->type;
7822 op1->type->refCount++;
7827 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7829 unsigned short value2 = op2->us;
7832 exp->string = PrintUShort(op1->us <<= value2);
7835 exp->expType = op1->type;
7837 op1->type->refCount++;
7842 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7844 char value2 = op2->c;
7847 exp->string = PrintChar(op1->c <<= value2);
7850 exp->expType = op1->type;
7852 op1->type->refCount++;
7857 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7859 unsigned char value2 = op2->uc;
7862 exp->string = PrintUChar(op1->uc <<= value2);
7865 exp->expType = op1->type;
7867 op1->type->refCount++;
7872 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7874 int value2 = op2->i;
7877 exp->string = PrintInt(op1->i >>= value2);
7880 exp->expType = op1->type;
7882 op1->type->refCount++;
7887 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7889 unsigned int value2 = op2->ui;
7892 exp->string = PrintUInt(op1->ui >>= value2);
7895 exp->expType = op1->type;
7897 op1->type->refCount++;
7902 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7904 short value2 = op2->s;
7907 exp->string = PrintShort(op1->s >>= value2);
7910 exp->expType = op1->type;
7912 op1->type->refCount++;
7917 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7919 unsigned short value2 = op2->us;
7922 exp->string = PrintUShort(op1->us >>= value2);
7925 exp->expType = op1->type;
7927 op1->type->refCount++;
7932 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7934 char value2 = op2->c;
7937 exp->string = PrintChar(op1->c >>= value2);
7940 exp->expType = op1->type;
7942 op1->type->refCount++;
7947 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7949 unsigned char value2 = op2->uc;
7952 exp->string = PrintUChar(op1->uc >>= value2);
7955 exp->expType = op1->type;
7957 op1->type->refCount++;
7962 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7965 exp->string = PrintInt(!op1->i);
7968 exp->expType = op1->type;
7970 op1->type->refCount++;
7975 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7978 exp->string = PrintUInt(!op1->ui);
7981 exp->expType = op1->type;
7983 op1->type->refCount++;
7988 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7991 exp->string = PrintShort(!op1->s);
7994 exp->expType = op1->type;
7996 op1->type->refCount++;
8001 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8004 exp->string = PrintUShort(!op1->us);
8007 exp->expType = op1->type;
8009 op1->type->refCount++;
8014 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8017 exp->string = PrintChar(!op1->c);
8020 exp->expType = op1->type;
8022 op1->type->refCount++;
8027 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8030 exp->string = PrintUChar(!op1->uc);
8033 exp->expType = op1->type;
8035 op1->type->refCount++;
8040 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8042 int value2 = op2->i;
8045 exp->string = PrintInt(op1->i == value2);
8048 exp->expType = op1->type;
8050 op1->type->refCount++;
8055 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8057 unsigned int value2 = op2->ui;
8060 exp->string = PrintUInt(op1->ui == value2);
8063 exp->expType = op1->type;
8065 op1->type->refCount++;
8070 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8072 short value2 = op2->s;
8075 exp->string = PrintShort(op1->s == value2);
8078 exp->expType = op1->type;
8080 op1->type->refCount++;
8085 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8087 unsigned short value2 = op2->us;
8090 exp->string = PrintUShort(op1->us == value2);
8093 exp->expType = op1->type;
8095 op1->type->refCount++;
8100 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8102 char value2 = op2->c;
8105 exp->string = PrintChar(op1->c == value2);
8108 exp->expType = op1->type;
8110 op1->type->refCount++;
8115 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8117 unsigned char value2 = op2->uc;
8120 exp->string = PrintUChar(op1->uc == value2);
8123 exp->expType = op1->type;
8125 op1->type->refCount++;
8130 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8132 float value2 = op2->f;
8135 exp->string = PrintFloat(op1->f == value2);
8138 exp->expType = op1->type;
8140 op1->type->refCount++;
8145 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8147 double value2 = op2->d;
8150 exp->string = PrintDouble(op1->d == value2);
8153 exp->expType = op1->type;
8155 op1->type->refCount++;
8160 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8162 int value2 = op2->i;
8165 exp->string = PrintInt(op1->i != value2);
8168 exp->expType = op1->type;
8170 op1->type->refCount++;
8175 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8177 unsigned int value2 = op2->ui;
8180 exp->string = PrintUInt(op1->ui != value2);
8183 exp->expType = op1->type;
8185 op1->type->refCount++;
8190 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8192 short value2 = op2->s;
8195 exp->string = PrintShort(op1->s != value2);
8198 exp->expType = op1->type;
8200 op1->type->refCount++;
8205 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8207 unsigned short value2 = op2->us;
8210 exp->string = PrintUShort(op1->us != value2);
8213 exp->expType = op1->type;
8215 op1->type->refCount++;
8220 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8222 char value2 = op2->c;
8225 exp->string = PrintChar(op1->c != value2);
8228 exp->expType = op1->type;
8230 op1->type->refCount++;
8235 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8237 unsigned char value2 = op2->uc;
8240 exp->string = PrintUChar(op1->uc != value2);
8243 exp->expType = op1->type;
8245 op1->type->refCount++;
8250 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8252 float value2 = op2->f;
8255 exp->string = PrintFloat(op1->f != value2);
8258 exp->expType = op1->type;
8260 op1->type->refCount++;
8265 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8267 double value2 = op2->d;
8270 exp->string = PrintDouble(op1->d != value2);
8273 exp->expType = op1->type;
8275 op1->type->refCount++;
8280 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8282 int value2 = op2->i;
8285 exp->string = PrintInt(op1->i && value2);
8288 exp->expType = op1->type;
8290 op1->type->refCount++;
8295 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8297 unsigned int value2 = op2->ui;
8300 exp->string = PrintUInt(op1->ui && value2);
8303 exp->expType = op1->type;
8305 op1->type->refCount++;
8310 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8312 short value2 = op2->s;
8315 exp->string = PrintShort(op1->s && value2);
8318 exp->expType = op1->type;
8320 op1->type->refCount++;
8325 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8327 unsigned short value2 = op2->us;
8330 exp->string = PrintUShort(op1->us && value2);
8333 exp->expType = op1->type;
8335 op1->type->refCount++;
8340 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8342 char value2 = op2->c;
8345 exp->string = PrintChar(op1->c && value2);
8348 exp->expType = op1->type;
8350 op1->type->refCount++;
8355 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8357 unsigned char value2 = op2->uc;
8360 exp->string = PrintUChar(op1->uc && value2);
8363 exp->expType = op1->type;
8365 op1->type->refCount++;
8370 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8372 float value2 = op2->f;
8375 exp->string = PrintFloat(op1->f && value2);
8378 exp->expType = op1->type;
8380 op1->type->refCount++;
8385 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8387 double value2 = op2->d;
8390 exp->string = PrintDouble(op1->d && value2);
8393 exp->expType = op1->type;
8395 op1->type->refCount++;
8400 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8402 int value2 = op2->i;
8405 exp->string = PrintInt(op1->i || value2);
8408 exp->expType = op1->type;
8410 op1->type->refCount++;
8415 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8417 unsigned int value2 = op2->ui;
8420 exp->string = PrintUInt(op1->ui || value2);
8423 exp->expType = op1->type;
8425 op1->type->refCount++;
8430 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8432 short value2 = op2->s;
8435 exp->string = PrintShort(op1->s || value2);
8438 exp->expType = op1->type;
8440 op1->type->refCount++;
8445 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8447 unsigned short value2 = op2->us;
8450 exp->string = PrintUShort(op1->us || value2);
8453 exp->expType = op1->type;
8455 op1->type->refCount++;
8460 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8462 char value2 = op2->c;
8465 exp->string = PrintChar(op1->c || value2);
8468 exp->expType = op1->type;
8470 op1->type->refCount++;
8475 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8477 unsigned char value2 = op2->uc;
8480 exp->string = PrintUChar(op1->uc || value2);
8483 exp->expType = op1->type;
8485 op1->type->refCount++;
8490 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8492 float value2 = op2->f;
8495 exp->string = PrintFloat(op1->f || value2);
8498 exp->expType = op1->type;
8500 op1->type->refCount++;
8505 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8507 double value2 = op2->d;
8510 exp->string = PrintDouble(op1->d || value2);
8513 exp->expType = op1->type;
8515 op1->type->refCount++;
8520 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8522 int value2 = op2->i;
8525 exp->string = PrintInt(op1->i > value2);
8528 exp->expType = op1->type;
8530 op1->type->refCount++;
8535 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8537 unsigned int value2 = op2->ui;
8540 exp->string = PrintUInt(op1->ui > value2);
8543 exp->expType = op1->type;
8545 op1->type->refCount++;
8550 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8552 short value2 = op2->s;
8555 exp->string = PrintShort(op1->s > value2);
8558 exp->expType = op1->type;
8560 op1->type->refCount++;
8565 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8567 unsigned short value2 = op2->us;
8570 exp->string = PrintUShort(op1->us > value2);
8573 exp->expType = op1->type;
8575 op1->type->refCount++;
8580 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8582 char value2 = op2->c;
8585 exp->string = PrintChar(op1->c > value2);
8588 exp->expType = op1->type;
8590 op1->type->refCount++;
8595 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8597 unsigned char value2 = op2->uc;
8600 exp->string = PrintUChar(op1->uc > value2);
8603 exp->expType = op1->type;
8605 op1->type->refCount++;
8610 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8612 float value2 = op2->f;
8615 exp->string = PrintFloat(op1->f > value2);
8618 exp->expType = op1->type;
8620 op1->type->refCount++;
8625 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8627 double value2 = op2->d;
8630 exp->string = PrintDouble(op1->d > value2);
8633 exp->expType = op1->type;
8635 op1->type->refCount++;
8640 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8642 int value2 = op2->i;
8645 exp->string = PrintInt(op1->i < value2);
8648 exp->expType = op1->type;
8650 op1->type->refCount++;
8655 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8657 unsigned int value2 = op2->ui;
8660 exp->string = PrintUInt(op1->ui < value2);
8663 exp->expType = op1->type;
8665 op1->type->refCount++;
8670 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8672 short value2 = op2->s;
8675 exp->string = PrintShort(op1->s < value2);
8678 exp->expType = op1->type;
8680 op1->type->refCount++;
8685 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8687 unsigned short value2 = op2->us;
8690 exp->string = PrintUShort(op1->us < value2);
8693 exp->expType = op1->type;
8695 op1->type->refCount++;
8700 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8702 char value2 = op2->c;
8705 exp->string = PrintChar(op1->c < value2);
8708 exp->expType = op1->type;
8710 op1->type->refCount++;
8715 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8717 unsigned char value2 = op2->uc;
8720 exp->string = PrintUChar(op1->uc < value2);
8723 exp->expType = op1->type;
8725 op1->type->refCount++;
8730 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8732 float value2 = op2->f;
8735 exp->string = PrintFloat(op1->f < value2);
8738 exp->expType = op1->type;
8740 op1->type->refCount++;
8745 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8747 double value2 = op2->d;
8750 exp->string = PrintDouble(op1->d < value2);
8753 exp->expType = op1->type;
8755 op1->type->refCount++;
8760 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8762 int value2 = op2->i;
8765 exp->string = PrintInt(op1->i >= value2);
8768 exp->expType = op1->type;
8770 op1->type->refCount++;
8775 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8777 unsigned int value2 = op2->ui;
8780 exp->string = PrintUInt(op1->ui >= value2);
8783 exp->expType = op1->type;
8785 op1->type->refCount++;
8790 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8792 short value2 = op2->s;
8795 exp->string = PrintShort(op1->s >= value2);
8798 exp->expType = op1->type;
8800 op1->type->refCount++;
8805 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8807 unsigned short value2 = op2->us;
8810 exp->string = PrintUShort(op1->us >= value2);
8813 exp->expType = op1->type;
8815 op1->type->refCount++;
8820 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8822 char value2 = op2->c;
8825 exp->string = PrintChar(op1->c >= value2);
8828 exp->expType = op1->type;
8830 op1->type->refCount++;
8835 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8837 unsigned char value2 = op2->uc;
8840 exp->string = PrintUChar(op1->uc >= value2);
8843 exp->expType = op1->type;
8845 op1->type->refCount++;
8850 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8852 float value2 = op2->f;
8855 exp->string = PrintFloat(op1->f >= value2);
8858 exp->expType = op1->type;
8860 op1->type->refCount++;
8865 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8867 double value2 = op2->d;
8870 exp->string = PrintDouble(op1->d >= value2);
8873 exp->expType = op1->type;
8875 op1->type->refCount++;
8880 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8882 int value2 = op2->i;
8885 exp->string = PrintInt(op1->i <= value2);
8888 exp->expType = op1->type;
8890 op1->type->refCount++;
8895 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8897 unsigned int value2 = op2->ui;
8900 exp->string = PrintUInt(op1->ui <= value2);
8903 exp->expType = op1->type;
8905 op1->type->refCount++;
8910 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8912 short value2 = op2->s;
8915 exp->string = PrintShort(op1->s <= value2);
8918 exp->expType = op1->type;
8920 op1->type->refCount++;
8925 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8927 unsigned short value2 = op2->us;
8930 exp->string = PrintUShort(op1->us <= value2);
8933 exp->expType = op1->type;
8935 op1->type->refCount++;
8940 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8942 char value2 = op2->c;
8945 exp->string = PrintChar(op1->c <= value2);
8948 exp->expType = op1->type;
8950 op1->type->refCount++;
8955 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8957 unsigned char value2 = op2->uc;
8960 exp->string = PrintUChar(op1->uc <= value2);
8963 exp->expType = op1->type;
8965 op1->type->refCount++;
8970 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8972 float value2 = op2->f;
8975 exp->string = PrintFloat(op1->f <= value2);
8978 exp->expType = op1->type;
8980 op1->type->refCount++;
8985 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8987 double value2 = op2->d;
8990 exp->string = PrintDouble(op1->d <= value2);
8993 exp->expType = op1->type;
8995 op1->type->refCount++;
9000 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9003 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9016 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9019 exp->expType = op1->type;
9021 op1->type->refCount++;
9026 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9029 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9032 exp->expType = op1->type;
9034 op1->type->refCount++;
9039 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9042 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9045 exp->expType = op1->type;
9047 op1->type->refCount++;
9052 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9055 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9058 exp->expType = op1->type;
9060 op1->type->refCount++;
9065 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9068 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9071 exp->expType = op1->type;
9073 op1->type->refCount++;
9078 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9081 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9084 exp->expType = op1->type;
9086 op1->type->refCount++;
9091 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9094 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9097 exp->expType = op1->type;
9099 op1->type->refCount++;
9104 struct OpTable intOps =
9106 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
9109 struct OpTable uintOps =
9111 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
9114 struct OpTable shortOps =
9116 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
9119 struct OpTable ushortOps =
9121 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
9124 struct OpTable floatOps =
9126 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
9129 struct OpTable doubleOps =
9131 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
9134 struct OpTable charOps =
9136 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
9139 struct OpTable ucharOps =
9141 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
9144 void ReadString(char * output, char * string)
9146 int len = strlen(string);
9148 unsigned int quoted = 0x0, escaped = 0x0;
9150 for(c = 0; c < len; c++)
9152 char ch = string[c];
9208 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9210 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9212 extern double strtod(char * , char * * );
9214 struct Operand GetOperand(struct Expression * exp)
9220 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9223 struct Type * type = exp->expType;
9227 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9229 if(!type->_class->registered->dataType)
9230 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9231 type = type->_class->registered->dataType;
9233 op.kind = type->kind;
9234 op.type = exp->expType;
9235 if(exp->isConstant && exp->type == 2)
9241 if(exp->constant[0] == '\'')
9242 op.c = exp->constant[1];
9243 else if(type->isSigned)
9245 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9250 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9258 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9263 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9271 op.i = strtol(exp->constant, (((void *)0)), 0);
9276 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9284 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9289 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9297 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9302 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9308 op.f = (float)strtod(exp->constant, (((void *)0)));
9312 op.d = (double)strtod(exp->constant, (((void *)0)));
9318 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9328 int __ecereVMethodID_class_OnGetString;
9330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9332 static void UnusedFunction()
9336 ((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);
9339 extern int __ecereVMethodID_class_OnGetString;
9341 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9343 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9345 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9347 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9348 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9351 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9352 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9354 void * ptr = inst->data + dataMember->offset + offset;
9355 char * result = (((void *)0));
9357 exp->loc = member->loc = inst->loc;
9358 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9359 if(!dataMember->dataType)
9360 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9361 type = dataMember->dataType;
9364 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9366 if(_class->type == 4)
9368 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9372 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9373 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9375 for(item = e->values.first; item; item = item->next)
9377 if((int)item->data == *(int *)ptr)
9379 result = item->name;
9385 exp->identifier = MkIdentifier(result);
9387 exp->destType = MkClassType(_class->fullName);
9388 ProcessExpressionType(exp);
9392 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9394 if(!_class->dataType)
9395 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9396 type = _class->dataType;
9405 FreeExpContents(exp);
9406 exp->constant = PrintFloat(*(float *)ptr);
9412 FreeExpContents(exp);
9413 exp->constant = PrintDouble(*(double *)ptr);
9419 FreeExpContents(exp);
9420 exp->constant = PrintInt(*(int *)ptr);
9426 FreeExpContents(exp);
9427 exp->constant = PrintInt64(*(long long *)ptr);
9433 FreeExpContents(exp);
9434 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9439 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9442 ListAdd(memberList, member);
9444 if(parentDataMember->type == 1)
9449 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9451 void PopulateInstance(struct Instantiation * inst)
9453 struct Symbol * classSym = inst->_class->symbol;
9454 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9455 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9456 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9458 inst->members = MkListOne(MkMembersInitList(memberList));
9459 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9461 if(!dataMember->isProperty)
9463 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9464 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9467 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9468 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9470 void * ptr = inst->data + dataMember->offset;
9471 char * result = (((void *)0));
9473 exp->loc = member->loc = inst->loc;
9474 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9475 if(!dataMember->dataType)
9476 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9477 type = dataMember->dataType;
9480 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9482 if(_class->type == 4)
9484 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9488 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9489 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9491 for(item = e->values.first; item; item = item->next)
9493 if((int)item->data == *(int *)ptr)
9495 result = item->name;
9502 exp->identifier = MkIdentifier(result);
9504 exp->destType = MkClassType(_class->fullName);
9505 ProcessExpressionType(exp);
9508 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9510 if(!_class->dataType)
9511 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9512 type = _class->dataType;
9521 exp->constant = PrintFloat(*(float *)ptr);
9527 exp->constant = PrintDouble(*(double *)ptr);
9533 exp->constant = PrintInt(*(int *)ptr);
9539 exp->constant = PrintInt64(*(long long *)ptr);
9545 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9550 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9553 ListAdd(memberList, member);
9559 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);
9561 extern void FreeInstance(struct Instantiation * inst);
9563 void ComputeInstantiation(struct Expression * exp)
9565 struct Instantiation * inst = exp->instance;
9566 struct MembersInit * members;
9567 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9568 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9569 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9570 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9571 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9572 int subMemberStackPos = 0;
9575 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9579 if(_class->type == 0 || _class->type == 5)
9580 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9582 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9586 for(members = (*inst->members).first; members; members = members->next)
9588 switch(members->type)
9592 if(members->dataMembers)
9594 struct MemberInit * member;
9596 for(member = (*members->dataMembers).first; member; member = member->next)
9598 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9599 unsigned int found = 0x0;
9600 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9601 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9602 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9603 unsigned int dataMemberOffset;
9607 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9610 if(curMember->isProperty)
9611 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9614 dataMember = curMember;
9615 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9622 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9626 if(prop->memberAccess == 1)
9628 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9629 curClass = prop->_class;
9634 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9635 int _subMemberStackPos = 0;
9637 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9641 if(dataMember->memberAccess == 1)
9643 curMember = dataMember;
9644 curClass = dataMember->_class;
9645 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9646 subMemberStackPos = _subMemberStackPos;
9651 if(found && member->initializer && member->initializer->type == 0)
9653 struct Expression * value = member->initializer->exp;
9654 struct Type * type = (((void *)0));
9658 type = prop->dataType;
9662 if(!dataMember->dataType)
9663 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9664 type = dataMember->dataType;
9666 if(ident && ident->next)
9668 for(ident = ident->next; ident && type; ident = ident->next)
9672 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9674 type = prop->dataType;
9677 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9679 type = dataMember->dataType;
9682 else if(type->kind == 9 || type->kind == 10)
9684 struct Type * memberType;
9686 for(memberType = type->members.first; memberType; memberType = memberType->next)
9688 if(!strcmp(memberType->name, ident->string))
9699 FreeType(value->destType);
9700 value->destType = type;
9703 ComputeExpression(value);
9705 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9709 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9711 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9713 if(!_class->dataType)
9714 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9715 type = _class->dataType;
9720 void * ptr = inst->data + dataMemberOffset;
9722 if(value->type == 2)
9728 GetInt(value, (int *)ptr);
9733 GetInt64(value, (long long *)ptr);
9738 GetIntPtr(value, (intptr_t *)ptr);
9743 GetFloat(value, (float *)ptr);
9748 GetDouble(value, (double *)ptr);
9753 else if(value->type == 1)
9757 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9759 if(_class->type == 1)
9761 ComputeTypeSize(type);
9762 if(value->instance->data)
9763 memcpy(ptr, value->instance->data, type->size);
9770 if(value->type == 1 && value->instance->data)
9772 void (* Set)(void *, void *) = (void *)prop->Set;
9774 Set(inst->data, value->instance->data);
9775 PopulateInstance(inst);
9777 else if(value->type == 2)
9783 void (* Set)(void *, double) = (void *)prop->Set;
9785 Set(inst->data, strtod(value->constant, (((void *)0))));
9790 void (* Set)(void *, float) = (void *)prop->Set;
9792 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9797 void (* Set)(void *, int) = (void *)prop->Set;
9799 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9804 void (* Set)(void *, long long) = (void *)prop->Set;
9806 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9811 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9813 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9818 else if(value->type == 3)
9822 ReadString(temp, value->string);
9823 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
9827 else if(_class->type == 3)
9831 if(value->type == 2)
9835 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9837 if(_class->type == 3)
9839 if(!_class->dataType)
9840 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9841 type = _class->dataType;
9849 float (* Set)(float) = (void *)prop->Set;
9851 GetFloat(member->initializer->exp, &fValue);
9852 exp->constant = PrintFloat(Set(fValue));
9859 double (* Set)(double) = (void *)prop->Set;
9861 GetDouble(member->initializer->exp, &dValue);
9862 exp->constant = PrintDouble(Set(dValue));
9870 else if(_class->type == 2)
9874 if(value->type == 1 && value->instance->data)
9876 unsigned int (* Set)(void *) = (void *)prop->Set;
9878 bits = Set(value->instance->data);
9880 else if(value->type == 2)
9886 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9890 GetInt(value, &part);
9891 bits = (bits & ~bitMember->mask);
9892 if(!bitMember->dataType)
9893 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9894 type = bitMember->dataType;
9895 if(type->kind == 8 && type->_class && type->_class->registered)
9897 if(!type->_class->registered->dataType)
9898 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9899 type = type->_class->registered->dataType;
9905 bits |= ((char)part << bitMember->pos);
9907 bits |= ((unsigned char)part << bitMember->pos);
9911 bits |= ((short)part << bitMember->pos);
9913 bits |= ((unsigned short)part << bitMember->pos);
9918 bits |= (part << bitMember->pos);
9920 bits |= ((unsigned int)part << bitMember->pos);
9924 bits |= ((long long)part << bitMember->pos);
9926 bits |= ((uint64)part << bitMember->pos);
9930 bits |= ((intptr_t)part << bitMember->pos);
9932 bits |= ((uintptr_t)part << bitMember->pos);
9940 if(_class && _class->type == 3)
9942 ComputeExpression(member->initializer->exp);
9943 exp->constant = member->initializer->exp->constant;
9945 member->initializer->exp->constant = (((void *)0));
9955 if(_class && _class->type == 2)
9957 exp->constant = PrintHexUInt(bits);
9966 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9968 if(exp->op.op == SIZEOF)
9970 FreeExpContents(exp);
9972 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9982 struct Expression * exp2 = exp->op.exp2;
9984 exp->op.exp2 = (((void *)0));
9985 FreeExpContents(exp);
9986 FreeType(exp->expType);
9987 FreeType(exp->destType);
9989 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9995 FreeExpContents(exp);
9996 op1->ops.Neg(exp, op1);
10000 if(op1->ops.BitNot)
10002 FreeExpContents(exp);
10003 op1->ops.BitNot(exp, op1);
10009 FreeExpContents(exp);
10010 op1->ops.Not(exp, op1);
10022 FreeExpContents(exp);
10023 op1->ops.Add(exp, op1, op2);
10029 FreeExpContents(exp);
10030 op1->ops.Sub(exp, op1, op2);
10036 FreeExpContents(exp);
10037 op1->ops.Mul(exp, op1, op2);
10043 FreeExpContents(exp);
10044 op1->ops.Div(exp, op1, op2);
10050 FreeExpContents(exp);
10051 op1->ops.Mod(exp, op1, op2);
10057 if(op1->ops.BitAnd)
10059 FreeExpContents(exp);
10060 op1->ops.BitAnd(exp, op1, op2);
10067 FreeExpContents(exp);
10068 op1->ops.BitOr(exp, op1, op2);
10072 if(op1->ops.BitXor)
10074 FreeExpContents(exp);
10075 op1->ops.BitXor(exp, op1, op2);
10079 if(op1->ops.LShift)
10081 FreeExpContents(exp);
10082 op1->ops.LShift(exp, op1, op2);
10086 if(op1->ops.RShift)
10088 FreeExpContents(exp);
10089 op1->ops.RShift(exp, op1, op2);
10095 FreeExpContents(exp);
10096 op1->ops.Equ(exp, op1, op2);
10102 FreeExpContents(exp);
10103 op1->ops.Nqu(exp, op1, op2);
10109 FreeExpContents(exp);
10110 op1->ops.And(exp, op1, op2);
10116 FreeExpContents(exp);
10117 op1->ops.Or(exp, op1, op2);
10123 FreeExpContents(exp);
10124 op1->ops.Grt(exp, op1, op2);
10130 FreeExpContents(exp);
10131 op1->ops.Sma(exp, op1, op2);
10135 if(op1->ops.GrtEqu)
10137 FreeExpContents(exp);
10138 op1->ops.GrtEqu(exp, op1, op2);
10142 if(op1->ops.SmaEqu)
10144 FreeExpContents(exp);
10145 op1->ops.SmaEqu(exp, op1, op2);
10153 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10155 void ComputeExpression(struct Expression * exp)
10157 char expString[10240];
10159 expString[0] = '\0';
10164 ComputeInstantiation(exp);
10169 struct Expression * exp1, * exp2 = (((void *)0));
10170 struct Operand op1 =
10174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10177 struct Operand op2 =
10181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10186 ComputeExpression(exp->op.exp2);
10189 ComputeExpression(exp->op.exp1);
10190 exp1 = exp->op.exp1;
10191 exp2 = exp->op.exp2;
10192 op1 = GetOperand(exp1);
10194 op1.type->refCount++;
10197 op2 = GetOperand(exp2);
10199 op2.type->refCount++;
10204 exp1 = exp->op.exp2;
10205 op1 = GetOperand(exp1);
10207 op1.type->refCount++;
10209 CallOperator(exp, exp1, exp2, &op1, &op2);
10211 FreeType(op1.type);
10213 FreeType(op2.type);
10219 struct Expression * e, * n;
10221 for(e = (*exp->list).first; e; e = n)
10226 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10228 ComputeExpression(e);
10229 FreeType(exp->expType);
10230 FreeType(exp->destType);
10232 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10233 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10244 struct Expression * memberExp = exp->member.exp;
10245 struct Identifier * memberID = exp->member.member;
10246 struct Type * type;
10248 ComputeExpression(exp->member.exp);
10249 type = exp->member.exp->expType;
10252 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)));
10253 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10254 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10255 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10257 if(type->kind == 19 && exp->member.exp->type == 26)
10258 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10262 struct Symbol * classSym;
10265 PrintType(type, string, 0x0, 0x1);
10266 classSym = FindClass(string);
10267 _class = classSym ? classSym->registered : (((void *)0));
10269 if(exp->member.member)
10271 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10273 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10275 if(!prop && !member && _class && exp->member.member)
10277 struct Symbol * classSym = FindClass(exp->member.member->string);
10279 convertTo = _class;
10280 _class = classSym ? classSym->registered : (((void *)0));
10281 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10287 struct Type * type = prop->dataType;
10289 if(_class->type == 3)
10291 if(type->kind == 8)
10293 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10295 if(_class->type == 3)
10297 if(!_class->dataType)
10298 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10299 type = _class->dataType;
10307 float (* Get)(float) = (void *)prop->Get;
10309 GetFloat(exp->member.exp, &value);
10310 exp->constant = PrintFloat(Get ? Get(value) : value);
10317 double (* Get)(double);
10319 GetDouble(exp->member.exp, &value);
10321 Get = (void *)prop->Set;
10323 Get = (void *)prop->Get;
10324 exp->constant = PrintDouble(Get ? Get(value) : value);
10334 struct Expression * value = exp->member.exp;
10335 struct Type * type;
10337 if(!prop->dataType)
10338 ProcessPropertyType(prop);
10339 type = prop->dataType;
10343 else if(_class->type == 1)
10349 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10351 if(propertyClass->type == 1 && value->type == 1)
10353 void (* Set)(void *, void *) = (void *)prop->Set;
10355 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10356 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10357 exp->instance->_class = MkSpecifierName(_class->fullName);
10358 exp->instance->loc = exp->loc;
10360 Set(exp->instance->data, value->instance->data);
10361 PopulateInstance(exp->instance);
10368 void (* Set)(void *, int) = (void *)prop->Set;
10370 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10371 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10372 exp->instance->_class = MkSpecifierName(_class->fullName);
10373 exp->instance->loc = exp->loc;
10375 GetInt(value, &intValue);
10376 Set(exp->instance->data, intValue);
10377 PopulateInstance(exp->instance);
10382 long long intValue;
10383 void (* Set)(void *, long long) = (void *)prop->Set;
10385 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10386 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10387 exp->instance->_class = MkSpecifierName(_class->fullName);
10388 exp->instance->loc = exp->loc;
10390 GetInt64(value, &intValue);
10391 Set(exp->instance->data, intValue);
10392 PopulateInstance(exp->instance);
10398 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10400 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10401 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10402 exp->instance->_class = MkSpecifierName(_class->fullName);
10403 exp->instance->loc = exp->loc;
10405 GetIntPtr(value, &intValue);
10406 Set(exp->instance->data, intValue);
10407 PopulateInstance(exp->instance);
10412 double doubleValue;
10413 void (* Set)(void *, double) = (void *)prop->Set;
10415 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10416 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10417 exp->instance->_class = MkSpecifierName(_class->fullName);
10418 exp->instance->loc = exp->loc;
10420 GetDouble(value, &doubleValue);
10421 Set(exp->instance->data, doubleValue);
10422 PopulateInstance(exp->instance);
10427 else if(_class->type == 2)
10433 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10435 if(propertyClass->type == 1 && value->instance->data)
10437 unsigned int (* Set)(void *) = (void *)prop->Set;
10438 unsigned int bits = Set(value->instance->data);
10440 exp->constant = PrintHexUInt(bits);
10444 else if(_class->type == 2)
10446 unsigned int value;
10447 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10450 GetUInt(exp->member.exp, &value);
10452 exp->constant = PrintHexUInt(bits);
10461 if(_class->type == 2)
10463 unsigned int value;
10465 GetUInt(exp->member.exp, &value);
10470 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10472 if(_class->type == 1)
10474 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10476 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10477 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10478 exp->instance->_class = MkSpecifierName(_class->fullName);
10479 exp->instance->loc = exp->loc;
10481 Get(value, exp->instance->data);
10482 PopulateInstance(exp->instance);
10484 else if(_class->type == 2)
10486 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10487 uint64 bits = Get(value);
10489 exp->constant = PrintHexUInt64(bits);
10496 else if(_class->type == 1)
10498 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10504 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10506 if(_class->type == 1 && value)
10508 void (* Get)(void *, void *) = (void *)prop->Get;
10510 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10511 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10512 exp->instance->_class = MkSpecifierName(_class->fullName);
10513 exp->instance->loc = exp->loc;
10515 Get(value, exp->instance->data);
10516 PopulateInstance(exp->instance);
10527 exp->isConstant = 0x0;
10536 FreeExpression(memberExp);
10537 FreeIdentifier(memberID);
10543 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10545 FreeExpContents(exp);
10546 exp->constant = PrintUInt(ComputeTypeSize(type));
10553 struct Symbol * classSym = exp->_class->symbol;
10555 if(classSym && classSym->registered)
10557 if(classSym->registered->fixed)
10559 FreeSpecifier(exp->_class);
10560 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10565 char className[1024];
10567 strcpy(className, "__ecereClass_");
10568 FullClassNameCat(className, classSym->string, 0x1);
10569 MangleClassName(className);
10570 FreeExpContents(exp);
10572 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10573 exp->member.member = MkIdentifier("structSize");
10580 struct Type * type;
10581 struct Expression * e = exp;
10583 if(exp->type == 11)
10586 ComputeExpression(exp->cast.exp);
10589 if(e && exp->expType)
10591 type = exp->expType;
10592 if(type->kind == 8)
10594 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10596 if(_class && (_class->type == 3 || _class->type == 2))
10598 if(!_class->dataType)
10599 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10600 type = _class->dataType;
10610 GetChar(e, &value);
10611 FreeExpContents(exp);
10612 exp->constant = PrintChar(value);
10617 unsigned char value;
10619 GetUChar(e, &value);
10620 FreeExpContents(exp);
10621 exp->constant = PrintUChar(value);
10630 GetShort(e, &value);
10631 FreeExpContents(exp);
10632 exp->constant = PrintShort(value);
10637 unsigned short value;
10639 GetUShort(e, &value);
10640 FreeExpContents(exp);
10641 exp->constant = PrintUShort(value);
10651 FreeExpContents(exp);
10652 exp->constant = PrintInt(value);
10657 unsigned int value;
10659 GetUInt(e, &value);
10660 FreeExpContents(exp);
10661 exp->constant = PrintUInt(value);
10670 GetInt64(e, &value);
10671 FreeExpContents(exp);
10672 exp->constant = PrintInt64(value);
10679 GetUInt64(e, &value);
10680 FreeExpContents(exp);
10681 exp->constant = PrintUInt64(value);
10690 GetIntPtr(e, &value);
10691 FreeExpContents(exp);
10692 exp->constant = PrintInt64((long long)value);
10699 GetUIntPtr(e, &value);
10700 FreeExpContents(exp);
10701 exp->constant = PrintUInt64((uint64)value);
10709 GetFloat(e, &value);
10710 FreeExpContents(exp);
10711 exp->constant = PrintFloat(value);
10719 GetDouble(e, &value);
10720 FreeExpContents(exp);
10721 exp->constant = PrintDouble(value);
10731 struct Operand op1 =
10735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10738 struct Operand op2 =
10742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10745 struct Operand op3 =
10749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10754 ComputeExpression((*exp->cond.exp).last);
10755 if(exp->cond.elseExp)
10756 ComputeExpression(exp->cond.elseExp);
10758 ComputeExpression(exp->cond.cond);
10759 op1 = GetOperand(exp->cond.cond);
10761 op1.type->refCount++;
10762 op2 = GetOperand((*exp->cond.exp).last);
10764 op2.type->refCount++;
10765 op3 = GetOperand(exp->cond.elseExp);
10767 op3.type->refCount++;
10770 FreeExpContents(exp);
10771 op1.ops.Cond(exp, &op1, &op2, &op3);
10774 FreeType(op1.type);
10776 FreeType(op2.type);
10778 FreeType(op3.type);
10784 void ApplyAnyObjectLogic(struct Expression * e);
10786 extern void CopyTypeInto(struct Type * type, struct Type * src);
10788 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10790 unsigned int result = 0x1;
10794 struct __ecereNameSpace__ecere__sys__OldList converts =
10798 struct Conversion * convert;
10800 if(destType->kind == 0)
10802 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10806 for(convert = converts.first; convert; convert = convert->next)
10808 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10812 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10813 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10816 newExp->destType = (((void *)0));
10820 exp->addedThis = 0x1;
10821 exp->member.exp = newExp;
10822 FreeType(exp->member.exp->expType);
10823 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10824 exp->member.exp->expType->classObjectType = objectType;
10825 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10826 exp->member.memberType = 1;
10827 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10828 exp->needCast = 0x1;
10830 exp->expType->refCount++;
10831 ApplyAnyObjectLogic(exp->member.exp);
10837 exp->addedThis = 0x1;
10838 exp->member.exp = newExp;
10839 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10841 newExp->byReference = 0x1;
10843 FreeType(exp->member.exp->expType);
10844 exp->member.exp->expType = (((void *)0));
10845 if(convert->convert->dataType)
10847 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10848 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10849 exp->member.exp->expType->refCount = 1;
10850 exp->member.exp->expType->classObjectType = objectType;
10851 ApplyAnyObjectLogic(exp->member.exp);
10853 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10854 exp->member.memberType = 4;
10855 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10856 exp->needCast = 0x1;
10857 if(convert->resultType)
10858 convert->resultType->refCount++;
10864 FreeType(exp->expType);
10867 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10868 exp->needCast = 0x1;
10870 exp->expType->refCount++;
10874 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10875 exp->needCast = 0x1;
10876 if(convert->resultType)
10877 convert->resultType->refCount++;
10881 if(exp->isConstant && inCompiler)
10882 ComputeExpression(exp);
10883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10885 if(!result && exp->expType && converts.count)
10887 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10889 if(!result && exp->expType && exp->destType)
10891 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))
10898 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10900 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10902 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10904 void CheckTemplateTypes(struct Expression * exp)
10906 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10908 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10909 struct Statement * compound;
10910 struct Context * context;
10914 exp->destType->refCount++;
10916 exp->expType->refCount++;
10917 newExp->prev = (((void *)0));
10918 newExp->next = (((void *)0));
10919 switch(exp->expType->kind)
10922 if(exp->destType->classObjectType)
10925 exp->destType->refCount--;
10927 exp->expType->refCount--;
10928 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10932 struct __ecereNameSpace__ecere__sys__OldList * specs;
10933 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10934 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10936 context = PushContext();
10937 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10938 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10939 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10941 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10942 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10943 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10944 exp->compound->compound.context = context;
10945 PopContext(context);
10950 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10951 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10955 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10957 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10958 struct Statement * compound;
10959 struct Context * context;
10963 exp->destType->refCount++;
10965 exp->expType->refCount++;
10966 newExp->prev = (((void *)0));
10967 newExp->next = (((void *)0));
10968 switch(exp->expType->kind)
10971 if(exp->destType->classObjectType)
10974 exp->destType->refCount--;
10976 exp->expType->refCount--;
10977 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10981 struct __ecereNameSpace__ecere__sys__OldList * specs;
10982 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10983 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10985 context = PushContext();
10986 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10987 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10988 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10990 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10991 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10992 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10993 exp->compound->compound.context = context;
10994 PopContext(context);
10999 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11002 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11003 ProcessExpressionType((*exp->list).first);
11009 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11010 newExp->needCast = 0x1;
11011 ProcessExpressionType((*exp->list).first);
11017 if(exp->expType->kind == 20)
11019 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11023 FreeType(exp->destType);
11024 FreeType(exp->expType);
11025 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11029 if(newExp->type == 8 && newExp->member.memberType == 3)
11033 exp->op.exp1 = (((void *)0));
11034 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11038 char typeString[1024];
11039 struct Declarator * decl;
11040 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11042 typeString[0] = '\0';
11043 PrintType(exp->expType, typeString, 0x0, 0x0);
11044 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11046 exp->cast.typeName = MkTypeName(specs, decl);
11047 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11048 exp->cast.exp->needCast = 0x1;
11056 extern int strncmp(const char * , const char * , int n);
11058 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11060 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11062 int nsLen = strlen(nameSpace);
11063 struct Symbol * symbol;
11065 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)))
11067 char * s = symbol->string;
11069 if(!strncmp(s, nameSpace, nsLen))
11074 for(c = strlen(s) - 1; c >= 0; c--)
11077 namePart = s + c + 1;
11078 if(!strcmp(namePart, name))
11086 return (((void *)0));
11089 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11092 char nameSpace[1024];
11094 unsigned int gotColon = 0x0;
11096 nameSpace[0] = '\0';
11097 for(c = strlen(name) - 1; c >= 0; c--)
11103 namePart = name + c + 1;
11104 while(c >= 0 && name[c] == ':')
11108 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11112 memcpy(nameSpace, name, c + 1);
11113 nameSpace[c + 1] = (char)0;
11114 return ScanWithNameSpace(tree, nameSpace, namePart);
11118 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11124 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11128 return ScanWithNameSpace(tree, "", namePart);
11130 return (((void *)0));
11133 static void ProcessDeclaration(struct Declaration * decl);
11135 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11137 struct Context * ctx;
11138 struct Symbol * symbol = (((void *)0));
11140 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11142 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11144 symbol = (((void *)0));
11147 char curName[1024];
11149 strcpy(curName, thisNameSpace);
11150 strcat(curName, "::");
11151 strcat(curName, name);
11152 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11155 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11158 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11159 if(symbol || ctx == endContext)
11162 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11164 if(symbol->pointerExternal->type == 0)
11166 struct FunctionDefinition * function = symbol->pointerExternal->function;
11167 struct Context * tmpContext = curContext;
11169 curContext = (((void *)0));
11170 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11171 curContext = tmpContext;
11172 symbol->pointerExternal->symbol = symbol;
11173 DeclareType(symbol->type, 0x1, 0x1);
11174 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11175 symbol->id = curExternal->symbol->idCode;
11177 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11179 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11180 symbol->id = curExternal->symbol->idCode;
11186 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11188 if(!type->isSigned && type->kind != 22)
11189 ListAdd(specs, MkSpecifier(UNSIGNED));
11194 if(type->_class->registered)
11196 if(!type->_class->registered->dataType)
11197 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11198 GetTypeSpecs(type->_class->registered->dataType, specs);
11203 ListAdd(specs, MkSpecifier(DOUBLE));
11206 ListAdd(specs, MkSpecifier(FLOAT));
11209 ListAdd(specs, MkSpecifier(CHAR));
11212 ListAdd(specs, MkSpecifier(SHORT));
11215 ListAdd(specs, MkSpecifier(INT64));
11218 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11222 ListAdd(specs, MkSpecifier(INT));
11227 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11229 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11236 if(type->_class && type->_class->string)
11238 if(type->classObjectType == 2)
11239 strcat(string, "typed_object");
11241 strcat(string, type->_class->string);
11244 if(type->_class->registered)
11245 strcat(string, type->_class->registered->name);
11247 strcat(string, type->_class->string);
11254 _PrintType(type->type, string, 0x0, printFunction, fullName);
11255 strcat(string, " *");
11260 strcat(string, "void");
11263 strcat(string, type->isSigned ? "int" : "uint");
11266 strcat(string, type->isSigned ? "int64" : "uint64");
11269 strcat(string, type->isSigned ? "intptr" : "uintptr");
11272 strcat(string, type->isSigned ? "char" : "byte");
11275 strcat(string, type->isSigned ? "short" : "uint16");
11278 strcat(string, "float");
11281 strcat(string, "double");
11286 strcat(string, "struct ");
11287 strcat(string, type->enumName);
11289 else if(type->typeName)
11291 strcat(string, type->typeName);
11295 struct Type * member;
11297 strcat(string, "struct {");
11298 for(member = type->members.first; member; member = member->next)
11300 PrintType(member, string, 0x1, fullName);
11301 strcat(string, "; ");
11303 strcat(string, "}");
11309 strcat(string, "union ");
11310 strcat(string, type->enumName);
11312 else if(type->typeName)
11314 strcat(string, type->typeName);
11318 strcat(string, "union ");
11319 strcat(string, "(unnamed)");
11325 strcat(string, "enum ");
11326 strcat(string, type->enumName);
11328 else if(type->typeName)
11330 strcat(string, type->typeName);
11333 strcat(string, "enum");
11339 if(type->dllExport)
11340 strcat(string, "dllexport ");
11341 PrintType(type->returnType, string, 0x0, fullName);
11342 strcat(string, " ");
11349 strcat(string, type->name);
11352 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11358 strcat(string, name);
11364 struct Type * param;
11366 strcat(string, "(");
11367 for(param = type->params.first; param; param = param->next)
11369 PrintType(param, string, 0x1, fullName);
11371 strcat(string, ", ");
11373 strcat(string, ")");
11380 char baseType[1024], size[256];
11381 struct Type * arrayType = type;
11383 baseType[0] = '\0';
11385 while(arrayType->kind == 12)
11388 if(arrayType->enumClass)
11389 strcat(size, arrayType->enumClass->string);
11390 else if(arrayType->arraySizeExp)
11391 PrintExpression(arrayType->arraySizeExp, size);
11393 arrayType = arrayType->arrayType;
11395 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11396 strcat(string, baseType);
11397 strcat(string, size);
11403 strcat(string, "...");
11406 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11409 strcat(string, "subclass(");
11410 strcat(string, type->_class ? type->_class->string : "int");
11411 strcat(string, ")");
11414 strcat(string, type->templateParameter->identifier->string);
11417 strcat(string, "thisclass");
11420 strcat(string, "__builtin_va_list");
11423 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11425 strcat(string, " ");
11426 strcat(string, type->name);
11431 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11433 struct Type * funcType;
11435 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11437 if(funcType && funcType->kind == 11 && type != funcType)
11439 char typeString[1024];
11440 struct Type * param;
11442 PrintType(funcType->returnType, string, 0x0, fullName);
11443 strcat(string, "(");
11444 _PrintType(type, string, printName, 0x0, fullName);
11445 strcat(string, ")");
11446 strcat(string, "(");
11447 for(param = funcType->params.first; param; param = param->next)
11449 PrintType(param, string, 0x1, fullName);
11451 strcat(string, ", ");
11453 strcat(string, ")");
11456 _PrintType(type, string, printName, 0x1, fullName);
11457 if(type->bitFieldCount)
11461 sprintf(count, ":%d", type->bitFieldCount);
11462 strcat(string, count);
11466 static struct Type * FindMember(struct Type * type, char * string)
11468 struct Type * memberType;
11470 for(memberType = type->members.first; memberType; memberType = memberType->next)
11472 if(!memberType->name)
11474 struct Type * subType = FindMember(memberType, string);
11479 else if(!strcmp(memberType->name, string))
11482 return (((void *)0));
11485 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11487 struct Type * memberType;
11489 for(memberType = type->members.first; memberType; memberType = memberType->next)
11491 if(!memberType->name)
11493 struct Type * subType = FindMember(memberType, string);
11497 *offset += memberType->offset;
11501 else if(!strcmp(memberType->name, string))
11503 *offset += memberType->offset;
11507 return (((void *)0));
11510 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11512 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11514 struct Expression * ParseExpressionString(char * expression)
11516 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11517 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11518 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11520 parsedExpression = (((void *)0));
11522 expression_yyparse();
11523 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11524 return parsedExpression;
11527 extern char * QMkString(char * source);
11529 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11531 void * __ecereTemp1;
11532 struct Identifier * id = exp->identifier;
11533 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11534 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11535 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11536 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11538 if(_class && _class->type == 4)
11540 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11541 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11545 struct __ecereNameSpace__ecere__com__Class * baseClass;
11547 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11549 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11551 for(value = e->values.first; value; value = value->next)
11553 if(!strcmp(value->name, id->string))
11558 char constant[256];
11560 FreeExpContents(exp);
11562 exp->isConstant = 0x1;
11563 if(!strcmp(baseClass->dataTypeString, "int"))
11564 sprintf(constant, "%d", value->data);
11566 sprintf(constant, "0x%X", value->data);
11567 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11568 exp->expType = MkClassType(baseClass->fullName);
11576 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11578 ProcessMethodType(method);
11579 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11582 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11584 if(!prop->dataType)
11585 ProcessPropertyType(prop);
11586 exp->expType = prop->dataType;
11588 prop->dataType->refCount++;
11591 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11593 if(!member->dataType)
11594 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11595 exp->expType = member->dataType;
11596 if(member->dataType)
11597 member->dataType->refCount++;
11600 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11602 if(!classProp->dataType)
11603 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11604 if(classProp->constant)
11606 FreeExpContents(exp);
11607 exp->isConstant = 0x1;
11608 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11611 exp->constant = QMkString((char *)classProp->Get(_class));
11615 char constant[256];
11618 sprintf(constant, "%d", (int)classProp->Get(_class));
11619 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11625 exp->expType = classProp->dataType;
11626 if(classProp->dataType)
11627 classProp->dataType->refCount++;
11633 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11635 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11636 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11637 struct __ecereNameSpace__ecere__com__NameSpace * child;
11641 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)))
11643 data = ScanGlobalData(child, name);
11651 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11653 extern char * strncpy(char * , const char * , int n);
11655 static struct GlobalData * FindGlobalData(char * name)
11658 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11660 nameSpace = globalData;
11661 for(c = 0; name[c]; c++)
11663 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11665 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11666 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11668 strncpy(spaceName, name + start, c - start);
11669 spaceName[c - start] = '\0';
11670 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11671 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11673 return (((void *)0));
11674 nameSpace = newSpace;
11682 return ScanGlobalData(nameSpace, name + start);
11684 return (((void *)0));
11687 static int definedExpStackPos;
11689 static void * definedExpStack[512];
11691 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11693 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11695 FreeExpContents(checkedExp);
11696 FreeType(checkedExp->expType);
11697 FreeType(checkedExp->destType);
11698 *checkedExp = *newExp;
11699 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11700 checkedExp->prev = prev;
11701 checkedExp->next = next;
11704 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11706 extern int printf(char * , ...);
11708 void __ecereMethod_Expression_Clear();
11710 void ApplyAnyObjectLogic(struct Expression * e)
11712 struct Type * destType = e->destType;
11714 if(destType && (destType->classObjectType == 3))
11716 if(e && e->expType)
11718 struct Type * type = e->expType;
11719 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11721 if(type->kind == 8 && type->_class && type->_class->registered)
11723 _class = type->_class->registered;
11725 else if(type->kind == 19)
11727 _class = FindClass("ecere::com::Class")->registered;
11731 char string[1024] = "";
11732 struct Symbol * classSym;
11734 PrintType(type, string, 0x0, 0x1);
11735 classSym = FindClass(string);
11737 _class = classSym->registered;
11739 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11741 if(!_class || strcmp(_class->fullName, "char *"))
11743 struct Expression * checkedExp = e, * newExp;
11745 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11747 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11749 if(checkedExp->type == 25)
11751 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11754 checkedExp = (*checkedExp->list).last;
11756 else if(checkedExp->type == 11)
11757 checkedExp = checkedExp->cast.exp;
11759 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11761 newExp = checkedExp->op.exp2;
11762 checkedExp->op.exp2 = (((void *)0));
11763 FreeExpContents(checkedExp);
11764 if(e->expType && e->expType->passAsTemplate)
11768 ComputeTypeSize(e->expType);
11769 sprintf(size, "%d", e->expType->size);
11770 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))))));
11772 ReplaceExpContents(checkedExp, newExp);
11773 e->byReference = 0x1;
11775 else if(!e->byReference || (_class && _class->type == 5))
11777 struct Expression * checkedExp, * newExp;
11780 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;
11782 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11784 struct Context * context = PushContext();
11785 struct Declarator * decl;
11786 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11787 char typeString[1024];
11788 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11790 typeString[0] = '\0';
11792 newExp->prev = (((void *)0));
11793 newExp->next = (((void *)0));
11794 newExp->expType = (((void *)0));
11795 PrintType(e->expType, typeString, 0x0, 0x1);
11796 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11797 newExp->destType = ProcessType(specs, decl);
11798 curContext = context;
11803 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11805 sprintf(name, "__internalValue%03X", internalValueCounter++);
11806 if(!curCompound->compound.declarations)
11807 curCompound->compound.declarations = MkList();
11808 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11809 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11810 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11811 e->compound = MkCompoundStmt((((void *)0)), stmts);
11814 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11816 struct Type * type = e->destType;
11818 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11819 CopyTypeInto(e->destType, type);
11820 e->destType->refCount = 1;
11821 e->destType->classObjectType = 0;
11824 e->compound->compound.context = context;
11825 PopContext(context);
11826 curContext = context->parent;
11830 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11832 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11834 if(checkedExp->type == 25)
11836 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11839 checkedExp = (*checkedExp->list).last;
11841 else if(checkedExp->type == 11)
11842 checkedExp = checkedExp->cast.exp;
11845 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11847 *operand = *checkedExp;
11848 checkedExp->destType = (((void *)0));
11849 checkedExp->expType = (((void *)0));
11850 __ecereMethod_Expression_Clear(checkedExp);
11851 checkedExp->type = 4;
11852 checkedExp->op.op = '&';
11853 checkedExp->op.exp1 = (((void *)0));
11854 checkedExp->op.exp2 = operand;
11863 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))))
11865 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11871 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11874 thisExp->prev = (((void *)0));
11875 thisExp->next = (((void *)0));
11876 __ecereMethod_Expression_Clear(e);
11878 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11879 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11880 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11882 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11883 CopyTypeInto(e->expType, thisExp->expType);
11884 e->expType->byReference = 0x0;
11885 e->expType->refCount = 1;
11886 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))
11888 e->expType->classObjectType = 0;
11893 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11895 if(destType->kind == 14)
11897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11899 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11901 unsigned int byReference = e->expType->byReference;
11902 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11903 struct Declarator * decl;
11904 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11905 char typeString[1024];
11906 struct Type * type;
11907 int backupClassObjectType;
11909 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11913 backupClassObjectType = type->classObjectType;
11914 type->classObjectType = 0;
11915 typeString[0] = '\0';
11916 PrintType(type, typeString, 0x0, 0x1);
11917 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11918 type->classObjectType = backupClassObjectType;
11920 thisExp->prev = (((void *)0));
11921 thisExp->next = (((void *)0));
11922 __ecereMethod_Expression_Clear(e);
11923 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
11927 e->op.exp1 = (((void *)0));
11928 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11933 e->cast.typeName = MkTypeName(specs, decl);
11934 e->cast.exp = thisExp;
11935 e->byReference = 0x1;
11938 e->destType = destType;
11940 destType->refCount++;
11945 extern char * strstr(char * , const char * );
11947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11949 struct __ecereNameSpace__ecere__com__DefinedExpression
11951 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11952 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11955 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11956 } __attribute__ ((gcc_struct));
11958 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11960 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11962 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11964 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11966 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11968 extern struct Expression * CopyExpression(struct Expression * exp);
11970 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11972 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11974 static void ProcessStatement(struct Statement * stmt);
11976 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
11978 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11980 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
11982 extern char * sourceFile;
11984 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11986 void ProcessExpressionType(struct Expression * exp)
11988 void * __ecereTemp2;
11989 void * __ecereTemp1;
11990 unsigned int unresolved = 0x0;
11991 struct Location oldyylloc = yylloc;
11992 unsigned int notByReference = 0x0;
11994 if(!exp || exp->expType)
12001 struct Identifier * id = exp->identifier;
12005 if(id->_class && id->_class->name)
12007 id->classSym = id->_class->symbol;
12009 if(strstr(id->string, "__ecereClass") == id->string)
12011 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12014 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12016 ReplaceClassMembers(exp, thisClass);
12019 ProcessExpressionType(exp);
12022 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12027 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12031 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12037 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12040 ProcessExpressionType(exp);
12044 else if(currentClass && !id->_class)
12046 if(ResolveIdWithClass(exp, currentClass, 0x1))
12049 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12054 struct Type * type = symbol->type;
12055 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12057 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12059 struct Context * context = SetupTemplatesContext(_class);
12061 type = ReplaceThisClassType(_class);
12062 FinishTemplatesContext(context);
12064 type->refCount = 0;
12066 FreeSpecifier(id->_class);
12067 id->_class = (((void *)0));
12068 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12069 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12070 id->classSym = (((void *)0));
12071 exp->expType = type;
12074 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12075 exp->isConstant = 0x1;
12076 if(symbol->isParam || !strcmp(id->string, "this"))
12078 if(_class && _class->type == 1)
12079 exp->byReference = 0x1;
12081 if(symbol->isIterator)
12083 if(symbol->isIterator == 3)
12086 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12087 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12088 exp->expType = (((void *)0));
12089 ProcessExpressionType(exp);
12091 else if(symbol->isIterator != 4)
12094 exp->member.exp = MkExpIdentifier(exp->identifier);
12095 exp->member.exp->expType = exp->expType;
12096 exp->member.member = MkIdentifier("data");
12097 exp->expType = (((void *)0));
12098 ProcessExpressionType(exp);
12105 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12107 if(thisNameSpace && !(id->_class && !id->_class->name))
12111 strcpy(name, thisNameSpace);
12112 strcat(name, "::");
12113 strcat(name, id->string);
12114 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12117 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12122 for(c = 0; c < definedExpStackPos; c++)
12123 if(definedExpStack[c] == definedExp)
12125 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12127 struct Location backupYylloc = yylloc;
12129 definedExpStack[definedExpStackPos++] = definedExp;
12130 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12131 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12132 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12134 parsedExpression = (((void *)0));
12136 expression_yyparse();
12137 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12138 yylloc = backupYylloc;
12139 if(parsedExpression)
12141 FreeIdentifier(id);
12143 exp->list = MkListOne(parsedExpression);
12144 parsedExpression->loc = yylloc;
12145 ProcessExpressionType(exp);
12146 definedExpStackPos--;
12149 definedExpStackPos--;
12155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12161 struct GlobalData * data = (((void *)0));
12163 if(thisNameSpace && !(id->_class && !id->_class->name))
12167 strcpy(name, thisNameSpace);
12168 strcat(name, "::");
12169 strcat(name, id->string);
12170 data = FindGlobalData(name);
12173 data = FindGlobalData(id->string);
12176 DeclareGlobalData(data);
12177 exp->expType = data->dataType;
12179 data->dataType->refCount++;
12180 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12181 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12182 FreeSpecifier(id->_class);
12183 id->_class = (((void *)0));
12188 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12190 if(thisNameSpace && !(id->_class && !id->_class->name))
12194 strcpy(name, thisNameSpace);
12195 strcat(name, "::");
12196 strcat(name, id->string);
12197 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12200 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12205 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12206 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12208 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12209 strcpy(name, "__ecereFunction_");
12210 FullClassNameCat(name, id->string, 0x0);
12211 if(DeclareFunction(function, name))
12213 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12214 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12216 exp->expType = function->dataType;
12217 if(function->dataType)
12218 function->dataType->refCount++;
12219 FreeSpecifier(id->_class);
12220 id->_class = (((void *)0));
12232 struct __ecereNameSpace__ecere__com__Class * _class;
12234 if(!exp->instance->_class)
12236 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12238 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12241 ProcessInstantiationType(exp->instance);
12242 exp->isConstant = exp->instance->isConstant;
12243 if(exp->instance->_class)
12245 exp->expType = MkClassType(exp->instance->_class->name);
12253 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12255 exp->expType = type;
12256 if(exp->constant[0] == '\'')
12258 if((int)((unsigned char *)exp->constant)[1] > 127)
12261 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12264 ch = exp->constant[1];
12265 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12266 exp->constant = PrintUInt(ch);
12268 type->_class = FindClass("unichar");
12269 type->isSigned = 0x0;
12274 type->isSigned = 0x1;
12277 else if(strchr(exp->constant, '.'))
12279 char ch = exp->constant[strlen(exp->constant) - 1];
12285 type->isSigned = 0x1;
12289 if(exp->constant[0] == '0' && exp->constant[1])
12290 type->isSigned = 0x0;
12291 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12292 type->isSigned = 0x0;
12293 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12294 type->isSigned = 0x0;
12296 type->isSigned = 0x1;
12299 exp->isConstant = 0x1;
12305 exp->isConstant = 0x1;
12306 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12311 ProcessExpressionType(exp->_new.size);
12312 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12313 DeclareType(exp->expType->type, 0x0, 0x0);
12317 ProcessExpressionType(exp->_renew.size);
12318 ProcessExpressionType(exp->_renew.exp);
12319 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12320 DeclareType(exp->expType->type, 0x0, 0x0);
12324 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12325 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12326 unsigned int useDestType = 0x0, useSideType = 0x0;
12327 struct Location oldyylloc = yylloc;
12328 unsigned int useSideUnit = 0x0;
12329 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12371 if(exp->op.op != '*' || exp->op.exp1)
12378 if(exp->op.op == '&')
12380 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12382 struct Identifier * id = exp->op.exp2->identifier;
12383 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12385 if(symbol && symbol->isIterator == 2)
12388 exp->member.exp = exp->op.exp2;
12389 exp->member.member = MkIdentifier("key");
12390 exp->expType = (((void *)0));
12391 exp->op.exp2->expType = symbol->type;
12392 symbol->type->refCount++;
12393 ProcessExpressionType(exp);
12401 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))
12403 if(exp->op.exp1->destType)
12404 FreeType(exp->op.exp1->destType);
12405 exp->op.exp1->destType = exp->destType;
12407 exp->destType->refCount++;
12411 if(exp->op.exp1->destType)
12412 FreeType(exp->op.exp1->destType);
12413 exp->op.exp1->destType = dummy;
12416 if(exp->op.exp1->destType && exp->op.op != '=')
12417 exp->op.exp1->destType->count++;
12418 ProcessExpressionType(exp->op.exp1);
12419 if(exp->op.exp1->destType && exp->op.op != '=')
12420 exp->op.exp1->destType->count--;
12421 if(exp->op.exp1->destType == dummy)
12424 exp->op.exp1->destType = (((void *)0));
12426 type1 = exp->op.exp1->expType;
12430 char expString[10240];
12432 expString[0] = '\0';
12433 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12437 exp->op.exp2->destType = exp->op.exp1->expType;
12438 if(exp->op.exp1->expType)
12439 exp->op.exp1->expType->refCount++;
12443 exp->op.exp2->destType = exp->destType;
12445 exp->destType->refCount++;
12449 exp->expType = type1;
12454 PrintExpression(exp->op.exp2, expString);
12455 if(type1 && type1->kind == 13)
12457 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)
12458 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12459 else if(exp->op.op == '=')
12461 if(exp->op.exp2->destType)
12462 FreeType(exp->op.exp2->destType);
12463 exp->op.exp2->destType = type1;
12470 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)
12474 if(exp->op.exp2->destType)
12475 FreeType(exp->op.exp2->destType);
12476 exp->op.exp2->destType = type1;
12483 exp->expType = type1;
12485 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)))
12487 if(exp->op.exp2->destType)
12488 FreeType(exp->op.exp2->destType);
12489 exp->op.exp2->destType = exp->destType;
12491 exp->destType->refCount++;
12495 if(exp->op.exp2->destType)
12496 FreeType(exp->op.exp2->destType);
12497 exp->op.exp2->destType = dummy;
12500 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12502 FreeType(exp->op.exp2->destType);
12503 exp->op.exp2->destType = type1;
12506 if(exp->op.exp2->destType && exp->op.op != '=')
12507 exp->op.exp2->destType->count++;
12508 ProcessExpressionType(exp->op.exp2);
12509 if(exp->op.exp2->destType && exp->op.op != '=')
12510 exp->op.exp2->destType->count--;
12511 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12513 if(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)
12515 if(exp->op.op != '=' && type1->type->kind == 0)
12516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12518 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)))
12520 if(exp->op.op == ADD_ASSIGN)
12521 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12523 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))
12525 if(exp->op.op == ADD_ASSIGN)
12526 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12528 else if(inCompiler)
12530 char type1String[1024];
12531 char type2String[1024];
12533 type1String[0] = '\0';
12534 type2String[0] = '\0';
12535 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12536 PrintType(type1, type2String, 0x0, 0x1);
12537 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12538 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12541 if(exp->op.exp2->destType == dummy)
12544 exp->op.exp2->destType = (((void *)0));
12546 type2 = exp->op.exp2->expType;
12549 if(exp->op.op == SIZEOF)
12551 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12552 exp->isConstant = 0x1;
12554 else if(exp->op.op == '*' && !exp->op.exp1)
12556 exp->expType = Dereference(type2);
12557 if(type2 && type2->kind == 8)
12558 notByReference = 0x1;
12560 else if(exp->op.op == '&' && !exp->op.exp1)
12561 exp->expType = Reference(type2);
12568 if(exp->op.exp1->destType)
12569 FreeType(exp->op.exp1->destType);
12570 exp->op.exp1->destType = MkClassType("bool");
12571 exp->op.exp1->destType->truth = 0x1;
12572 if(!exp->op.exp1->expType)
12573 ProcessExpressionType(exp->op.exp1);
12575 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12576 FreeType(exp->op.exp1->expType);
12577 exp->op.exp1->expType = MkClassType("bool");
12578 exp->op.exp1->expType->truth = 0x1;
12582 if(exp->op.exp2->destType)
12583 FreeType(exp->op.exp2->destType);
12584 exp->op.exp2->destType = MkClassType("bool");
12585 exp->op.exp2->destType->truth = 0x1;
12586 if(!exp->op.exp2->expType)
12587 ProcessExpressionType(exp->op.exp2);
12589 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12590 FreeType(exp->op.exp2->expType);
12591 exp->op.exp2->expType = MkClassType("bool");
12592 exp->op.exp2->expType->truth = 0x1;
12595 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")))))
12597 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12599 if(exp->op.exp2->destType)
12600 FreeType(exp->op.exp2->destType);
12601 exp->op.exp2->destType = type1;
12603 if(exp->op.exp1->destType)
12604 FreeType(exp->op.exp1->destType);
12605 exp->op.exp1->destType = type2;
12607 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)
12608 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);
12609 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12611 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12615 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12617 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12618 ProcessExpressionType(exp->op.exp1);
12619 if(type2->kind != 13)
12621 ProcessExpressionType(classExp);
12622 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"))))))));
12623 if(!exp->op.exp2->expType)
12624 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12625 ProcessExpressionType(exp->op.exp2);
12629 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12631 if(type1->kind != 8 && type1->type->kind == 0)
12632 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12633 exp->expType = type1;
12637 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12639 if(type2->kind != 8 && type2->type->kind == 0)
12640 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12641 exp->expType = type2;
12645 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))
12647 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12651 unsigned int success = 0x0;
12653 if(type1->kind == 13 && type2->kind == 13)
12655 if(exp->op.op == '+')
12656 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12657 else if(exp->op.op == '-')
12659 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12661 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12663 if(type1->type->kind == 20)
12665 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12669 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12671 ProcessExpressionType(classExp);
12673 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")))))));
12674 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12682 if(!success && exp->op.exp1->type == 2)
12684 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12687 FreeType(exp->expType);
12688 exp->expType = exp->op.exp1->destType;
12689 if(exp->op.exp1->destType)
12690 exp->op.exp1->destType->refCount++;
12693 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12696 FreeType(exp->expType);
12697 exp->expType = exp->op.exp2->destType;
12698 if(exp->op.exp2->destType)
12699 exp->op.exp2->destType->refCount++;
12705 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12708 FreeType(exp->expType);
12709 exp->expType = exp->op.exp2->destType;
12710 if(exp->op.exp2->destType)
12711 exp->op.exp2->destType->refCount++;
12714 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12717 FreeType(exp->expType);
12718 exp->expType = exp->op.exp1->destType;
12719 if(exp->op.exp1->destType)
12720 exp->op.exp1->destType->refCount++;
12726 char expString1[10240];
12727 char expString2[10240];
12731 expString1[0] = '\0';
12732 expString2[0] = '\0';
12737 PrintExpression(exp->op.exp1, expString1);
12738 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12739 PrintExpression(exp->op.exp2, expString2);
12740 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12741 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12742 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12744 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12748 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12750 if(exp->op.exp1->destType)
12751 FreeType(exp->op.exp1->destType);
12752 exp->op.exp1->destType = type2->_class->registered->dataType;
12753 if(type2->_class->registered->dataType)
12754 type2->_class->registered->dataType->refCount++;
12755 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12756 exp->expType = type2;
12760 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12762 if(exp->op.exp2->destType)
12763 FreeType(exp->op.exp2->destType);
12764 exp->op.exp2->destType = type1->_class->registered->dataType;
12765 if(type1->_class->registered->dataType)
12766 type1->_class->registered->dataType->refCount++;
12767 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12768 exp->expType = type1;
12774 unsigned int valid = 0x0;
12776 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12778 if(exp->op.exp2->destType)
12779 FreeType(exp->op.exp2->destType);
12780 if(!type1->_class->registered->dataType)
12781 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12782 exp->op.exp2->destType = type1->_class->registered->dataType;
12783 exp->op.exp2->destType->refCount++;
12784 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12785 type2 = exp->op.exp2->destType;
12786 exp->expType = type2;
12789 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12791 if(exp->op.exp1->destType)
12792 FreeType(exp->op.exp1->destType);
12793 if(!type2->_class->registered->dataType)
12794 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12795 exp->op.exp1->destType = type2->_class->registered->dataType;
12796 exp->op.exp1->destType->refCount++;
12797 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12798 type1 = exp->op.exp1->destType;
12799 exp->expType = type1;
12802 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12804 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12806 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12809 FreeType(exp->expType);
12810 exp->expType = exp->op.exp1->expType;
12811 if(exp->op.exp2->expType)
12812 exp->op.exp1->expType->refCount++;
12816 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12818 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12821 FreeType(exp->expType);
12822 exp->expType = exp->op.exp2->expType;
12823 if(exp->op.exp2->expType)
12824 exp->op.exp2->expType->refCount++;
12831 if(exp->op.exp2->destType)
12832 FreeType(exp->op.exp2->destType);
12833 exp->op.exp2->destType = type1;
12835 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12838 FreeType(exp->expType);
12839 exp->expType = exp->op.exp2->destType;
12840 if(exp->op.exp2->destType)
12841 exp->op.exp2->destType->refCount++;
12843 else if(type1 && type2)
12845 char expString1[10240];
12846 char expString2[10240];
12847 char type1String[1024];
12848 char type2String[1024];
12850 expString1[0] = '\0';
12851 expString2[0] = '\0';
12852 type1String[0] = '\0';
12853 type2String[0] = '\0';
12856 PrintExpression(exp->op.exp1, expString1);
12857 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12858 PrintExpression(exp->op.exp2, expString2);
12859 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12860 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12861 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12863 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12864 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12866 exp->expType = exp->op.exp1->expType;
12867 if(exp->op.exp1->expType)
12868 exp->op.exp1->expType->refCount++;
12870 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12872 exp->expType = exp->op.exp2->expType;
12873 if(exp->op.exp2->expType)
12874 exp->op.exp2->expType->refCount++;
12881 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12883 struct Type * oldType = exp->op.exp1->expType;
12885 exp->op.exp1->expType = (((void *)0));
12886 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12889 exp->op.exp1->expType = oldType;
12891 if(exp->op.exp1->destType)
12892 FreeType(exp->op.exp1->destType);
12893 exp->op.exp1->destType = type2;
12895 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12898 FreeType(exp->expType);
12899 exp->expType = exp->op.exp1->destType;
12900 if(exp->op.exp1->destType)
12901 exp->op.exp1->destType->refCount++;
12905 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12907 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12909 if(exp->op.exp1->destType)
12910 FreeType(exp->op.exp1->destType);
12911 exp->op.exp1->destType = type2->_class->registered->dataType;
12912 if(type2->_class->registered->dataType)
12913 type2->_class->registered->dataType->refCount++;
12914 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12916 if(exp->op.op == '!')
12918 exp->expType = MkClassType("bool");
12919 exp->expType->truth = 0x1;
12923 exp->expType = type2;
12928 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12930 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12932 if(exp->op.exp2->destType)
12933 FreeType(exp->op.exp2->destType);
12934 exp->op.exp2->destType = type1->_class->registered->dataType;
12935 if(type1->_class->registered->dataType)
12936 type1->_class->registered->dataType->refCount++;
12937 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12939 exp->expType = type1;
12945 if(exp->op.exp1 && !exp->op.exp1->expType)
12947 char expString[10000];
12949 expString[0] = '\0';
12952 PrintExpression(exp->op.exp1, expString);
12953 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12958 if(exp->op.exp2 && !exp->op.exp2->expType)
12960 char expString[10240];
12962 expString[0] = '\0';
12965 PrintExpression(exp->op.exp2, expString);
12966 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12969 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12973 FreeType(exp->expType);
12974 exp->expType = MkClassType("bool");
12975 exp->expType->truth = 0x1;
12977 if(exp->op.op != SIZEOF)
12978 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12979 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12981 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12983 yylloc = oldyylloc;
12990 struct Expression * e;
12992 exp->isConstant = 0x1;
12993 for(e = (*exp->list).first; e; e = e->next)
12995 unsigned int inced = 0x0;
12999 FreeType(e->destType);
13000 e->destType = exp->destType;
13003 exp->destType->refCount++;
13004 e->destType->count++;
13008 ProcessExpressionType(e);
13010 exp->destType->count--;
13011 if(!exp->expType && !e->next)
13013 exp->expType = e->expType;
13015 e->expType->refCount++;
13018 exp->isConstant = 0x0;
13020 e = (*exp->list).first;
13021 if(!e->next && e->type == 8)
13023 struct Expression * next = exp->next, * prev = exp->prev;
13025 FreeType(exp->expType);
13026 FreeType(exp->destType);
13027 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13031 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13032 ProcessExpressionType(exp);
13038 struct Expression * e;
13040 exp->isConstant = 0x1;
13041 ProcessExpressionType(exp->index.exp);
13042 if(!exp->index.exp->isConstant)
13043 exp->isConstant = 0x0;
13044 if(exp->index.exp->expType)
13046 struct Type * source = exp->index.exp->expType;
13048 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13050 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13052 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13053 if(exp->index.index && (*exp->index.index).last)
13055 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13059 for(e = (*exp->index.index).first; e; e = e->next)
13061 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13064 FreeType(e->destType);
13065 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13067 ProcessExpressionType(e);
13072 exp->isConstant = 0x0;
13075 exp->expType = Dereference(exp->index.exp->expType);
13077 DeclareType(exp->expType, 0x0, 0x0);
13082 struct Expression * e;
13083 struct Type * functionType;
13084 struct Type * methodType = (((void *)0));
13090 PrintExpression(exp->call.exp, name);
13091 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13093 PrintExpression(exp->call.exp, name);
13096 if(exp->call.exp->type == 0)
13098 struct Expression * idExp = exp->call.exp;
13099 struct Identifier * id = idExp->identifier;
13101 if(!strcmp(id->string, "__builtin_frame_address"))
13103 exp->expType = ProcessTypeString("void *", 0x1);
13104 if(exp->call.arguments && (*exp->call.arguments).first)
13105 ProcessExpressionType((*exp->call.arguments).first);
13108 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13110 exp->expType = ProcessTypeString("int", 0x1);
13111 if(exp->call.arguments && (*exp->call.arguments).first)
13112 ProcessExpressionType((*exp->call.arguments).first);
13115 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13117 struct Expression * a = (((void *)0));
13118 struct Expression * b = (((void *)0));
13119 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13121 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13123 a = (*exp->call.arguments).first;
13124 b = (*exp->call.arguments).last;
13128 else if((*exp->call.arguments).count == 1)
13130 a = (*exp->call.arguments).first;
13135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13136 idExp->identifier = (((void *)0));
13137 FreeExpContents(exp);
13138 ProcessExpressionType(a);
13140 ProcessExpressionType(b);
13142 exp->list = MkList();
13143 if(a->expType && (!b || b->expType))
13145 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13149 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13150 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13151 struct Declaration * decl;
13152 char temp1[1024], temp2[1024];
13154 GetTypeSpecs(a->expType, specs);
13155 if(a && !a->isConstant && a->type != 0)
13157 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13158 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13159 tempExp1 = QMkExpId(temp1);
13160 tempExp1->expType = a->expType;
13162 a->expType->refCount++;
13163 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13165 if(b && !b->isConstant && b->type != 0)
13167 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13168 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13169 tempExp2 = QMkExpId(temp2);
13170 tempExp2->expType = b->expType;
13172 b->expType->refCount++;
13173 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13175 decl = MkDeclaration(specs, decls);
13176 if(!curCompound->compound.declarations)
13177 curCompound->compound.declarations = MkList();
13178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13182 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13184 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13186 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13187 exp->expType = a->expType;
13189 a->expType->refCount++;
13191 else if(!strcmp(id->string, "Abs"))
13193 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13194 exp->expType = a->expType;
13196 a->expType->refCount++;
13198 else if(!strcmp(id->string, "Sgn"))
13200 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"))))));
13201 exp->expType = ProcessTypeString("int", 0x0);
13203 FreeExpression(tempExp1);
13205 FreeExpression(tempExp2);
13206 FreeIdentifier(id);
13212 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13214 if(!exp->call.exp->destType)
13216 exp->call.exp->destType = dummy;
13219 ProcessExpressionType(exp->call.exp);
13220 if(exp->call.exp->destType == dummy)
13223 exp->call.exp->destType = (((void *)0));
13227 functionType = exp->call.exp->expType;
13228 if(functionType && functionType->kind == 16)
13230 methodType = functionType;
13231 functionType = methodType->method->dataType;
13232 if(exp->call.exp->expType->usedClass)
13234 char typeString[1024];
13236 typeString[0] = '\0';
13237 PrintType(functionType, typeString, 0x1, 0x1);
13238 if(strstr(typeString, "thisclass"))
13240 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13241 struct Declarator * decl;
13244 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13246 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13247 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13248 thisClassParams = 0x0;
13249 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13251 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13253 thisClass = exp->call.exp->expType->usedClass;
13254 ProcessDeclarator(decl);
13255 thisClass = backupThisClass;
13257 thisClassParams = 0x1;
13258 functionType = ProcessType(specs, decl);
13259 functionType->refCount = 0;
13260 FinishTemplatesContext(context);
13262 FreeList(specs, FreeSpecifier);
13263 FreeDeclarator(decl);
13267 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13269 struct Type * type = functionType->type;
13271 if(!functionType->refCount)
13273 functionType->type = (((void *)0));
13274 FreeType(functionType);
13276 functionType = type;
13278 if(functionType && functionType->kind != 11)
13280 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13282 else if(functionType)
13284 unsigned int emptyParams = 0x0, noParams = 0x0;
13285 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13286 struct Type * type = functionType->params.first;
13287 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13289 struct Location oldyylloc = yylloc;
13293 if(functionType->extraParam && e)
13295 e->destType = MkClassType(functionType->thisClass->string);
13298 if(!functionType->staticMethod)
13300 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13302 type = MkClassType(memberExp->member.exp->expType->_class->string);
13305 e->destType = type;
13307 type = functionType->params.first;
13310 type->refCount = 0;
13312 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13314 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13317 e->destType = type;
13319 type = functionType->params.first;
13322 type->refCount = 0;
13325 if(type && type->kind == 0)
13328 if(!type->refCount)
13330 type = (((void *)0));
13332 for(; e; e = e->next)
13334 if(!type && !emptyParams)
13337 if(methodType && methodType->methodClass)
13338 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);
13340 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);
13343 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13345 struct Type * templatedType = (((void *)0));
13346 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13350 if(_class && _class->templateArgs)
13352 struct __ecereNameSpace__ecere__com__Class * sClass;
13354 for(sClass = _class; sClass; sClass = sClass->base)
13356 if(sClass->templateClass)
13357 sClass = sClass->templateClass;
13359 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13361 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13363 struct __ecereNameSpace__ecere__com__Class * nextClass;
13365 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13367 if(nextClass->templateClass)
13368 nextClass = nextClass->templateClass;
13369 id += nextClass->templateParams.count;
13379 if(curParam && _class->templateArgs[id].dataTypeString)
13381 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13384 struct Context * context = SetupTemplatesContext(_class);
13386 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13387 FinishTemplatesContext(context);
13389 e->destType = templatedType;
13392 templatedType->passAsTemplate = 0x1;
13397 e->destType = type;
13404 e->destType = type;
13408 if(type && type->kind != 14)
13410 struct Type * next = type->next;
13412 if(!type->refCount)
13417 if(type && type->kind != 14)
13419 if(methodType && methodType->methodClass)
13420 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);
13422 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);
13424 yylloc = oldyylloc;
13425 if(type && !type->refCount)
13430 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13431 if(exp->call.exp->type == 0)
13433 char * string = exp->call.exp->identifier->string;
13437 struct Symbol * symbol;
13438 struct Location oldyylloc = yylloc;
13440 yylloc = exp->call.exp->identifier->loc;
13441 if(strstr(string, "__builtin_") == string)
13444 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13445 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13446 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13447 if(strstr(symbol->string, "::"))
13448 globalContext->hasNameSpace = 0x1;
13449 yylloc = oldyylloc;
13452 else if(exp->call.exp->type == 8)
13456 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13457 if(!functionType->returnType)
13459 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13462 if(functionType && functionType->kind == 11)
13464 exp->expType = functionType->returnType;
13465 if(functionType->returnType)
13466 functionType->returnType->refCount++;
13467 if(!functionType->refCount)
13468 FreeType(functionType);
13470 if(exp->call.arguments)
13472 for(e = (*exp->call.arguments).first; e; e = e->next)
13474 struct Type * destType = e->destType;
13476 ProcessExpressionType(e);
13483 struct Type * type;
13484 struct Location oldyylloc = yylloc;
13485 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13487 exp->thisPtr = thisPtr;
13488 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13490 exp->member.member->classSym = exp->member.member->_class->symbol;
13492 ProcessExpressionType(exp->member.exp);
13493 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)
13495 exp->isConstant = 0x0;
13498 exp->isConstant = exp->member.exp->isConstant;
13499 type = exp->member.exp->expType;
13501 if(type && (type->kind == 20))
13503 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13504 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13508 for(param = _class->templateParams.first; param; param = param->next)
13510 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13514 if(param && param->defaultArg.member)
13516 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13520 struct Expression * expMember = exp->member.exp;
13521 struct Declarator * decl;
13522 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13523 char thisClassTypeString[1024];
13525 FreeIdentifier(exp->member.member);
13526 ProcessExpressionType(argExp);
13528 char * colon = strstr(param->defaultArg.memberString, "::");
13532 char className[1024];
13533 struct __ecereNameSpace__ecere__com__Class * sClass;
13535 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13536 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13539 strcpy(thisClassTypeString, _class->fullName);
13541 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13542 exp->expType = ProcessType(specs, decl);
13543 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13545 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13546 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13548 int paramCount = 0;
13549 int lastParam = -1;
13550 char templateString[1024];
13551 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13553 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13554 for(cClass = expClass; cClass; cClass = cClass->base)
13558 for(param = cClass->templateParams.first; param; param = param->next)
13561 struct __ecereNameSpace__ecere__com__Class * sClass;
13562 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13564 for(sClass = cClass->base; sClass; sClass = sClass->base)
13565 id += sClass->templateParams.count;
13566 arg = expClass->templateArgs[id];
13567 for(sClass = _class; sClass; sClass = sClass->base)
13569 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13571 struct __ecereNameSpace__ecere__com__Class * nextClass;
13573 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13574 p += nextClass->templateParams.count;
13575 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13577 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13579 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13581 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13582 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13589 char argument[256];
13591 argument[0] = '\0';
13592 switch(param->type)
13596 char expString[1024];
13597 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13598 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13599 struct Expression * exp;
13600 char * string = PrintHexUInt64(arg.expression.ui64);
13602 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13603 ProcessExpressionType(exp);
13604 ComputeExpression(exp);
13605 expString[0] = '\0';
13606 PrintExpression(exp, expString);
13607 strcat(argument, expString);
13608 FreeExpression(exp);
13613 strcat(argument, arg.member->name);
13618 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13620 if(!strcmp(arg.dataTypeString, "thisclass"))
13621 strcat(argument, thisClassTypeString);
13623 strcat(argument, arg.dataTypeString);
13631 strcat(templateString, ", ");
13632 if(lastParam != p - 1)
13634 strcat(templateString, param->name);
13635 strcat(templateString, " = ");
13637 strcat(templateString, argument);
13646 int len = strlen(templateString);
13648 if(templateString[len - 1] == '>')
13649 templateString[len++] = ' ';
13650 templateString[len++] = '>';
13651 templateString[len++] = '\0';
13654 struct Context * context = SetupTemplatesContext(_class);
13656 FreeType(exp->expType);
13657 exp->expType = ProcessTypeString(templateString, 0x0);
13658 FinishTemplatesContext(context);
13662 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")))))))));
13665 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13667 type = ProcessTemplateParameterType(type->templateParameter);
13670 if(type && (type->kind == 20))
13672 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13674 struct Identifier * id = exp->member.member;
13675 int typeKind = type->kind;
13676 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));
13678 if(typeKind == 19 && exp->member.exp->type == 26)
13680 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13683 if(id && (typeKind == 3 || typeKind == 15))
13684 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13687 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13688 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13689 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13690 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13691 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13693 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13694 exp->member.memberType = 1;
13695 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13696 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13699 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13701 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13702 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13704 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13706 member = (((void *)0));
13708 if(!member && !prop)
13709 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13710 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13711 exp->member.thisPtr = 0x1;
13717 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13718 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13719 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13721 if(!prop && !member)
13723 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13726 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13727 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13728 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13733 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13734 prop = (((void *)0));
13736 member = (((void *)0));
13740 if(!prop && !member)
13741 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13742 if(!prop && !member && !method)
13746 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13749 exp->member.memberType = 5;
13750 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13754 char structName[1024];
13755 struct Identifier * id = exp->member.member;
13756 struct Expression * classExp = exp->member.exp;
13759 FreeType(classExp->expType);
13760 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13761 strcpy(structName, "__ecereClassData_");
13762 FullClassNameCat(structName, type->_class->string, 0x0);
13764 exp->member.member = id;
13765 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"))))))));
13767 ProcessExpressionType(exp);
13773 struct Symbol * classSym = FindClass(id->string);
13777 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13780 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13786 exp->member.memberType = 1;
13787 if(!prop->dataType)
13788 ProcessPropertyType(prop);
13789 exp->expType = prop->dataType;
13791 prop->dataType->refCount++;
13795 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13797 FreeExpContents(exp);
13799 exp->identifier = MkIdentifier("class");
13800 ProcessExpressionType(exp);
13803 exp->member.memberType = 3;
13804 DeclareStruct(_class->fullName, 0x0);
13805 if(!member->dataType)
13807 struct Context * context = SetupTemplatesContext(_class);
13809 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13810 FinishTemplatesContext(context);
13812 exp->expType = member->dataType;
13813 if(member->dataType)
13814 member->dataType->refCount++;
13816 else if(revConvert)
13818 exp->member.memberType = 4;
13819 exp->expType = MkClassType(revConvert->_class->fullName);
13825 exp->member.memberType = 2;
13827 if(!method->dataType)
13828 ProcessMethodType(method);
13829 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
13830 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13831 exp->expType->usedClass = _class;
13833 else if(!classProp)
13835 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13837 FreeExpContents(exp);
13839 exp->identifier = MkIdentifier("class");
13840 ProcessExpressionType(exp);
13843 yylloc = exp->member.member->loc;
13844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13846 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13848 if(_class && exp->expType)
13850 struct __ecereNameSpace__ecere__com__Class * tClass;
13853 while(tClass && !tClass->templateClass)
13854 tClass = tClass->base;
13855 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13858 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13859 struct __ecereNameSpace__ecere__com__Class * sClass;
13861 for(sClass = tClass; sClass; sClass = sClass->base)
13864 if(sClass->templateClass)
13865 sClass = sClass->templateClass;
13866 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13868 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13870 for(sClass = sClass->base; sClass; sClass = sClass->base)
13871 id += sClass->templateParams.count;
13879 if(curParam && tClass->templateArgs[id].dataTypeString)
13881 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13882 struct Context * context = SetupTemplatesContext(tClass);
13884 FreeType(exp->expType);
13885 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13888 if(exp->expType->kind == 21)
13890 FreeType(exp->expType);
13891 exp->expType = ReplaceThisClassType(_class);
13893 if(tClass->templateClass)
13894 exp->expType->passAsTemplate = 0x1;
13897 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13898 if(exp->destType->kind == 21)
13900 FreeType(exp->destType);
13901 exp->destType = ReplaceThisClassType(_class);
13905 FinishTemplatesContext(context);
13908 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13911 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13912 struct __ecereNameSpace__ecere__com__Class * sClass;
13914 for(sClass = tClass; sClass; sClass = sClass->base)
13917 if(sClass->templateClass)
13918 sClass = sClass->templateClass;
13919 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13921 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13923 for(sClass = sClass->base; sClass; sClass = sClass->base)
13924 id += sClass->templateParams.count;
13934 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13935 struct Context * context = SetupTemplatesContext(tClass);
13936 struct Type * basicType;
13938 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13941 if(basicType->kind == 21)
13943 FreeType(basicType);
13944 basicType = ReplaceThisClassType(_class);
13946 FreeType(exp->expType);
13947 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
13950 exp->destType = exp->expType;
13951 exp->destType->refCount++;
13954 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13955 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13956 struct Declarator * decl;
13958 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13961 exp->destType->refCount++;
13963 exp->expType->refCount++;
13965 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13966 exp->cast.exp = newExp;
13969 FinishTemplatesContext(context);
13972 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13974 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13978 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13981 int paramCount = 0;
13982 int lastParam = -1;
13983 char templateString[1024];
13984 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13986 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13987 while(cClass != expClass)
13989 struct __ecereNameSpace__ecere__com__Class * sClass;
13991 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13994 for(param = cClass->templateParams.first; param; param = param->next)
13996 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13999 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14000 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14002 while(cClassCur != tClass && !paramCur)
14004 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14006 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14008 cClassCur = sClassCur;
14009 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14011 if(!strcmp(paramCur->name, param->name))
14018 if(paramCur && paramCur->type == 0)
14019 arg = tClass->templateArgs[cp];
14021 arg = expClass->templateArgs[p];
14023 char argument[256];
14025 argument[0] = '\0';
14026 switch(param->type)
14030 char expString[1024];
14031 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14032 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14033 struct Expression * exp;
14034 char * string = PrintHexUInt64(arg.expression.ui64);
14036 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14037 ProcessExpressionType(exp);
14038 ComputeExpression(exp);
14039 expString[0] = '\0';
14040 PrintExpression(exp, expString);
14041 strcat(argument, expString);
14042 FreeExpression(exp);
14047 strcat(argument, arg.member->name);
14052 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14053 strcat(argument, arg.dataTypeString);
14060 strcat(templateString, ", ");
14061 if(lastParam != p - 1)
14063 strcat(templateString, param->name);
14064 strcat(templateString, " = ");
14066 strcat(templateString, argument);
14075 int len = strlen(templateString);
14077 if(templateString[len - 1] == '>')
14078 templateString[len++] = ' ';
14079 templateString[len++] = '>';
14080 templateString[len++] = '\0';
14082 FreeType(exp->expType);
14084 struct Context * context = SetupTemplatesContext(tClass);
14086 exp->expType = ProcessTypeString(templateString, 0x0);
14087 FinishTemplatesContext(context);
14094 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)");
14096 else if(type && (type->kind == 9 || type->kind == 10))
14098 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14102 exp->expType = memberType;
14104 memberType->refCount++;
14109 char expString[10240];
14111 expString[0] = '\0';
14114 PrintExpression(exp, expString);
14115 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14117 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14119 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14121 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14123 struct Identifier * id = exp->member.member;
14124 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));
14128 FreeType(exp->expType);
14129 exp->expType = ReplaceThisClassType(_class);
14133 yylloc = oldyylloc;
14138 struct Type * destType = exp->destType;
14140 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14142 exp->member.member->classSym = exp->member.member->_class->symbol;
14144 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14148 ProcessExpressionType(exp);
14155 struct Symbol * classSym = exp->_class->symbol;
14157 if(classSym && classSym->registered)
14159 if(classSym->registered->type == 5)
14164 DeclareStruct(classSym->string, 0x0);
14165 FreeSpecifier(exp->_class);
14167 FullClassNameCat(name, classSym->string, 0x0);
14168 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14172 if(classSym->registered->fixed)
14174 FreeSpecifier(exp->_class);
14175 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14180 char className[1024];
14182 strcpy(className, "__ecereClass_");
14183 FullClassNameCat(className, classSym->string, 0x1);
14184 MangleClassName(className);
14185 DeclareClass(classSym, className);
14186 FreeExpContents(exp);
14188 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14189 exp->member.member = MkIdentifier("structSize");
14193 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14198 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14200 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14201 exp->isConstant = 0x1;
14202 DeclareType(type, 0x0, 0x0);
14208 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14210 type->count = (unsigned int)1;
14211 FreeType(exp->cast.exp->destType);
14212 exp->cast.exp->destType = type;
14214 ProcessExpressionType(exp->cast.exp);
14215 type->count = (unsigned int)0;
14216 exp->expType = type;
14217 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14219 void * prev = exp->prev, * next = exp->next;
14220 struct Type * expType = exp->cast.exp->destType;
14221 struct Expression * castExp = exp->cast.exp;
14222 struct Type * destType = exp->destType;
14225 expType->refCount++;
14226 FreeType(exp->expType);
14227 FreeTypeName(exp->cast.typeName);
14229 FreeType(exp->expType);
14230 FreeType(exp->destType);
14231 exp->expType = expType;
14232 exp->destType = destType;
14233 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14239 exp->isConstant = exp->cast.exp->isConstant;
14245 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14248 exp->expType = type;
14253 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14255 ProcessExpressionType(exp->vaArg.exp);
14257 exp->expType = type;
14262 struct Expression * e;
14264 exp->isConstant = 0x1;
14265 FreeType(exp->cond.cond->destType);
14266 exp->cond.cond->destType = MkClassType("bool");
14267 exp->cond.cond->destType->truth = 0x1;
14268 ProcessExpressionType(exp->cond.cond);
14269 if(!exp->cond.cond->isConstant)
14270 exp->isConstant = 0x0;
14271 for(e = (*exp->cond.exp).first; e; e = e->next)
14275 FreeType(e->destType);
14276 e->destType = exp->destType;
14278 e->destType->refCount++;
14280 ProcessExpressionType(e);
14283 exp->expType = e->expType;
14285 e->expType->refCount++;
14288 exp->isConstant = 0x0;
14290 FreeType(exp->cond.elseExp->destType);
14291 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14292 if(exp->cond.elseExp->destType)
14293 exp->cond.elseExp->destType->refCount++;
14294 ProcessExpressionType(exp->cond.elseExp);
14295 if(!exp->cond.elseExp->isConstant)
14296 exp->isConstant = 0x0;
14301 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14303 struct Statement * last = (*exp->compound->compound.statements).last;
14305 if(last->type == 3 && last->expressions && (*last->expressions).last)
14307 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14309 exp->destType->refCount++;
14311 ProcessStatement(exp->compound);
14312 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14313 if(((struct Expression *)(*last->expressions).last)->expType)
14314 exp->expType->refCount++;
14320 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14322 if(spec && spec->type == 1)
14324 exp->expType = MkClassType(spec->name);
14325 exp->expType->kind = 19;
14326 exp->byReference = 0x1;
14330 exp->expType = MkClassType("ecere::com::Class");
14331 exp->byReference = 0x1;
14337 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14341 struct Identifier * id = exp->classData.id;
14342 char structName[1024];
14343 struct Expression * classExp;
14345 strcpy(structName, "__ecereClassData_");
14346 FullClassNameCat(structName, _class->fullName, 0x0);
14348 exp->member.member = id;
14349 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14350 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14352 classExp = MkExpIdentifier(MkIdentifier("class"));
14353 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"))))))));
14354 ProcessExpressionType(exp);
14361 struct Type * type = (((void *)0));
14362 char * typeString = (((void *)0));
14363 char typeStringBuf[1024];
14365 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))
14367 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14369 typeString = templateClass->templateArgs[2].dataTypeString;
14373 struct Expression * e;
14375 for(e = (*exp->list).first; e; e = e->next)
14377 ProcessExpressionType(e);
14387 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14391 e->expType = (((void *)0));
14392 e = (*exp->list).first;
14393 ProcessExpressionType(e);
14396 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14398 FreeType(e->expType);
14399 e->expType = (((void *)0));
14401 type = (((void *)0));
14409 FreeType(e->expType);
14410 e->expType = (((void *)0));
14416 typeStringBuf[0] = '\0';
14417 PrintType(type, typeStringBuf, 0x0, 0x1);
14418 typeString = typeStringBuf;
14420 type = (((void *)0));
14425 char templateString[1024];
14426 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14427 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14428 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14429 struct Expression * expExt;
14430 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14432 sprintf(templateString, "Container<%s>", typeString);
14435 struct Expression * e;
14437 type = ProcessTypeString(typeString, 0x0);
14438 while(e = (*exp->list).first)
14440 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14441 e->destType = type;
14443 ProcessExpressionType(e);
14444 ListAdd(initializers, MkInitializerAssignment(e));
14447 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14449 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14450 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14451 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14452 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14453 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14454 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14455 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14456 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14457 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14458 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
14459 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14460 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14461 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14462 exp->expType = ProcessTypeString(templateString, 0x0);
14464 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14465 ProcessExpressionType(expExt);
14469 exp->expType = ProcessTypeString("Container", 0x0);
14470 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14475 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14477 FreeType(exp->expType);
14478 exp->expType = ReplaceThisClassType(thisClass);
14480 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14482 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14486 if(exp->expType->kind != 15)
14488 struct Type * member;
14489 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14491 FreeType(exp->expType);
14492 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14493 exp->expType->kind = symbol->type->kind;
14494 exp->expType->refCount++;
14495 exp->expType->enumName = enumName;
14496 exp->expType->members = symbol->type->members;
14497 for(member = symbol->type->members.first; member; member = member->next)
14498 member->refCount++;
14502 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14504 for(member = symbol->type->members.first; member; member = member->next)
14506 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14508 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14514 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14516 else if(exp->destType && !exp->destType->keepCast)
14518 if(!CheckExpressionType(exp, exp->destType, 0x0))
14520 if(!exp->destType->count || unresolved)
14525 if(exp->destType->kind != 14)
14532 char expString[10240];
14534 expString[0] = '\0';
14535 PrintType(exp->destType, type2, 0x0, 0x1);
14538 PrintExpression(exp, expString);
14539 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14542 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14543 else if(exp->type != 16)
14544 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14549 char expString[10240];
14551 expString[0] = '\0';
14554 PrintExpression(exp, expString);
14555 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14558 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14559 else if(exp->type != 16)
14560 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14572 PrintType(exp->expType, type1, 0x0, 0x1);
14573 PrintType(exp->destType, type2, 0x0, 0x1);
14575 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)))
14579 char expString[10240];
14581 expString[0] = '\0';
14584 PrintExpression(exp, expString);
14585 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14587 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14588 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14589 FreeType(exp->expType);
14590 exp->destType->refCount++;
14591 exp->expType = exp->destType;
14596 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14598 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14599 char typeString[1024];
14600 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14601 struct Declarator * decl;
14603 typeString[0] = '\0';
14606 exp->expType->refCount++;
14608 exp->expType->refCount++;
14610 newExp->destType = exp->expType;
14611 PrintType(exp->expType, typeString, 0x0, 0x0);
14612 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14613 exp->cast.typeName = MkTypeName(specs, decl);
14614 exp->cast.exp = newExp;
14617 else if(unresolved)
14619 if(exp->identifier->_class && exp->identifier->_class->name)
14620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14621 else if(exp->identifier->string && exp->identifier->string[0])
14622 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14624 else if(!exp->expType && exp->type != 16)
14626 char expString[10240];
14628 expString[0] = '\0';
14631 PrintExpression(exp, expString);
14632 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14636 ApplyAnyObjectLogic(exp);
14637 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14639 exp->byReference = 0x1;
14641 yylloc = oldyylloc;
14644 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)
14648 *curMember = (*curMember)->next;
14649 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14651 *curMember = subMemberStack[--(*subMemberStackPos)];
14652 *curMember = (*curMember)->next;
14654 while((*curMember) && (*curMember)->isProperty)
14655 *curMember = (*curMember)->next;
14656 if(subMemberStackPos)
14658 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14660 subMemberStack[(*subMemberStackPos)++] = *curMember;
14661 *curMember = (*curMember)->members.first;
14662 while(*curMember && (*curMember)->isProperty)
14663 *curMember = (*curMember)->next;
14671 if(subMemberStackPos && *subMemberStackPos)
14673 *curMember = subMemberStack[--(*subMemberStackPos)];
14674 *curMember = (*curMember)->next;
14678 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14680 if(*curClass == _class)
14682 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14684 *curMember = (*curClass)->membersAndProperties.first;
14686 while((*curMember) && (*curMember)->isProperty)
14687 *curMember = (*curMember)->next;
14688 if(subMemberStackPos)
14690 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14692 subMemberStack[(*subMemberStackPos)++] = *curMember;
14693 *curMember = (*curMember)->members.first;
14694 while(*curMember && (*curMember)->isProperty)
14695 *curMember = (*curMember)->next;
14702 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14707 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14709 if(init->exp && !init->exp->destType)
14711 FreeType(init->exp->destType);
14712 init->exp->destType = type;
14718 ProcessExpressionType(init->exp);
14719 init->isConstant = init->exp->isConstant;
14725 struct Expression * exp = init->exp;
14726 struct Instantiation * inst = exp->instance;
14727 struct MembersInit * members;
14730 init->list = MkList();
14733 for(members = (*inst->members).first; members; members = members->next)
14735 if(members->type == 0)
14737 struct MemberInit * member;
14739 for(member = (*members->dataMembers).first; member; member = member->next)
14741 ListAdd(init->list, member->initializer);
14742 member->initializer = (((void *)0));
14747 FreeExpression(exp);
14751 struct Initializer * i;
14752 struct Type * initializerType = (((void *)0));
14753 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14754 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14755 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14756 int subMemberStackPos = 0;
14758 if(type && type->kind == 12)
14759 initializerType = Dereference(type);
14760 else if(type && (type->kind == 9 || type->kind == 10))
14761 initializerType = type->members.first;
14762 for(i = (*init->list).first; i; i = i->next)
14764 if(type && type->kind == 8 && type->_class && type->_class->registered)
14766 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14769 if(!curMember->dataType)
14770 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14771 initializerType = curMember->dataType;
14774 ProcessInitializer(i, initializerType);
14775 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14776 initializerType = initializerType->next;
14778 init->isConstant = 0x0;
14780 if(type && type->kind == 12)
14781 FreeType(initializerType);
14782 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14784 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14791 extern struct Symbol * FindType(struct Context * ctx, char * name);
14793 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14795 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14801 if(spec->specifier == THISCLASS)
14806 spec->name = ReplaceThisClass(thisClass);
14807 spec->symbol = FindClass(spec->name);
14808 ProcessSpecifier(spec, declareStruct);
14815 struct Symbol * symbol = FindType(curContext, spec->name);
14818 DeclareType(symbol->type, 0x1, 0x1);
14819 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14820 DeclareStruct(spec->name, 0x0);
14825 struct Enumerator * e;
14829 for(e = (*spec->list).first; e; e = e->next)
14832 ProcessExpressionType(e->exp);
14840 if(spec->definitions)
14842 struct ClassDef * def;
14843 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14845 ProcessClass(spec->definitions, symbol);
14852 static void ProcessDeclarator(struct Declarator * decl)
14857 if(decl->identifier->classSym)
14859 FreeSpecifier(decl->identifier->_class);
14860 decl->identifier->_class = (((void *)0));
14864 if(decl->array.exp)
14865 ProcessExpressionType(decl->array.exp);
14872 if(decl->declarator)
14873 ProcessDeclarator(decl->declarator);
14874 if(decl->type == 4)
14876 struct Identifier * id = GetDeclId(decl);
14878 if(id && id->_class)
14880 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14882 if(!decl->function.parameters)
14883 decl->function.parameters = MkList();
14884 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14885 id->_class = (((void *)0));
14887 if(decl->function.parameters)
14889 struct TypeName * param;
14891 for(param = (*decl->function.parameters).first; param; param = param->next)
14893 if(param->qualifiers && (*param->qualifiers).first)
14895 struct Specifier * spec = (*param->qualifiers).first;
14897 if(spec && spec->specifier == TYPED_OBJECT)
14899 struct Declarator * d = param->declarator;
14900 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);
14902 FreeList(param->qualifiers, FreeSpecifier);
14903 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14904 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14905 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14908 else if(spec && spec->specifier == ANY_OBJECT)
14910 struct Declarator * d = param->declarator;
14912 FreeList(param->qualifiers, FreeSpecifier);
14913 param->qualifiers = MkListOne(MkSpecifier(VOID));
14914 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14916 else if(spec->specifier == THISCLASS)
14921 spec->name = ReplaceThisClass(thisClass);
14922 spec->symbol = FindClass(spec->name);
14923 ProcessSpecifier(spec, 0x0);
14927 if(param->declarator)
14928 ProcessDeclarator(param->declarator);
14936 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14938 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14940 static void ProcessDeclaration(struct Declaration * decl)
14942 yylloc = decl->loc;
14947 unsigned int declareStruct = 0x0;
14949 if(decl->declarators)
14951 struct InitDeclarator * d;
14953 for(d = (*decl->declarators).first; d; d = d->next)
14955 struct Type * type, * subType;
14957 ProcessDeclarator(d->declarator);
14958 type = ProcessType(decl->specifiers, d->declarator);
14961 ProcessInitializer(d->initializer, type);
14962 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14964 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14966 struct Instantiation * inst = d->initializer->exp->instance;
14968 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14969 d->initializer->exp->instance = (((void *)0));
14970 if(decl->specifiers)
14971 FreeList(decl->specifiers, FreeSpecifier);
14972 FreeList(decl->declarators, FreeInitDeclarator);
14979 for(subType = type; subType; )
14981 if(subType->kind == 8)
14983 declareStruct = 0x1;
14986 else if(subType->kind == 13)
14988 else if(subType->kind == 12)
14989 subType = subType->arrayType;
14998 if(decl->specifiers)
15000 struct Specifier * s;
15002 for(s = (*decl->specifiers).first; s; s = s->next)
15004 ProcessSpecifier(s, declareStruct);
15011 ProcessInstantiationType(decl->inst);
15016 struct Specifier * spec;
15017 struct Declarator * d;
15018 unsigned int declareStruct = 0x0;
15020 if(decl->declarators)
15022 for(d = (*decl->declarators).first; d; d = d->next)
15024 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15025 struct Type * subType;
15027 ProcessDeclarator(d);
15028 for(subType = type; subType; )
15030 if(subType->kind == 8)
15032 declareStruct = 0x1;
15035 else if(subType->kind == 13)
15037 else if(subType->kind == 12)
15038 subType = subType->arrayType;
15045 if(decl->specifiers)
15047 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15048 ProcessSpecifier(spec, declareStruct);
15055 static struct FunctionDefinition * curFunction;
15057 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15059 char propName[1024], propNameM[1024];
15060 char getName[1024], setName[1024];
15061 struct __ecereNameSpace__ecere__sys__OldList * args;
15063 DeclareProperty(prop, setName, getName);
15064 strcpy(propName, "__ecereProp_");
15065 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15066 strcat(propName, "_");
15067 FullClassNameCat(propName, prop->name, 0x1);
15068 MangleClassName(propName);
15069 strcpy(propNameM, "__ecerePropM_");
15070 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15071 strcat(propNameM, "_");
15072 FullClassNameCat(propNameM, prop->name, 0x1);
15073 MangleClassName(propNameM);
15074 if(prop->isWatchable)
15077 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15078 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15079 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15081 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15082 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15083 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15087 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15088 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15089 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15091 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15092 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15093 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15095 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15096 curFunction->propSet->fireWatchersDone = 0x1;
15099 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15101 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15103 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15105 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15107 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15109 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15111 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15113 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15115 static void ProcessStatement(struct Statement * stmt)
15117 yylloc = stmt->loc;
15121 ProcessStatement(stmt->labeled.stmt);
15124 if(stmt->caseStmt.exp)
15126 FreeType(stmt->caseStmt.exp->destType);
15127 stmt->caseStmt.exp->destType = curSwitchType;
15129 curSwitchType->refCount++;
15130 ProcessExpressionType(stmt->caseStmt.exp);
15131 ComputeExpression(stmt->caseStmt.exp);
15133 if(stmt->caseStmt.stmt)
15134 ProcessStatement(stmt->caseStmt.stmt);
15138 if(stmt->compound.context)
15140 struct Declaration * decl;
15141 struct Statement * s;
15142 struct Statement * prevCompound = curCompound;
15143 struct Context * prevContext = curContext;
15145 if(!stmt->compound.isSwitch)
15147 curCompound = stmt;
15148 curContext = stmt->compound.context;
15150 if(stmt->compound.declarations)
15152 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15153 ProcessDeclaration(decl);
15155 if(stmt->compound.statements)
15157 for(s = (*stmt->compound.statements).first; s; s = s->next)
15158 ProcessStatement(s);
15160 curContext = prevContext;
15161 curCompound = prevCompound;
15167 struct Expression * exp;
15169 if(stmt->expressions)
15171 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15172 ProcessExpressionType(exp);
15178 struct Expression * exp;
15180 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15181 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15182 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15183 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15185 ProcessExpressionType(exp);
15187 if(stmt->ifStmt.stmt)
15188 ProcessStatement(stmt->ifStmt.stmt);
15189 if(stmt->ifStmt.elseStmt)
15190 ProcessStatement(stmt->ifStmt.elseStmt);
15195 struct Type * oldSwitchType = curSwitchType;
15197 if(stmt->switchStmt.exp)
15199 struct Expression * exp;
15201 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15205 ProcessExpressionType(exp);
15208 curSwitchType = exp->expType;
15211 ProcessStatement(stmt->switchStmt.stmt);
15212 curSwitchType = oldSwitchType;
15217 if(stmt->whileStmt.exp)
15219 struct Expression * exp;
15221 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15222 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15223 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15224 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15226 ProcessExpressionType(exp);
15229 if(stmt->whileStmt.stmt)
15230 ProcessStatement(stmt->whileStmt.stmt);
15235 if(stmt->doWhile.exp)
15237 struct Expression * exp;
15239 if((*stmt->doWhile.exp).last)
15241 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15242 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15243 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15245 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15247 ProcessExpressionType(exp);
15250 if(stmt->doWhile.stmt)
15251 ProcessStatement(stmt->doWhile.stmt);
15256 struct Expression * exp;
15258 if(stmt->forStmt.init)
15259 ProcessStatement(stmt->forStmt.init);
15260 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15262 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15263 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15264 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15266 if(stmt->forStmt.check)
15267 ProcessStatement(stmt->forStmt.check);
15268 if(stmt->forStmt.increment)
15270 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15271 ProcessExpressionType(exp);
15273 if(stmt->forStmt.stmt)
15274 ProcessStatement(stmt->forStmt.stmt);
15279 struct Identifier * id = stmt->forEachStmt.id;
15280 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15281 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15282 struct Statement * block = stmt->forEachStmt.stmt;
15283 char iteratorType[1024];
15284 struct Type * source;
15285 struct Expression * e;
15286 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));
15287 struct Expression * arrayExp;
15288 char * typeString = (((void *)0));
15289 int builtinCount = 0;
15291 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15295 FreeType(e->destType);
15296 e->destType = ProcessTypeString("Container", 0x0);
15298 if(!isBuiltin || e->next)
15299 ProcessExpressionType(e);
15301 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15302 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15304 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15305 struct Symbol * symbol;
15306 struct Expression * expIt = (((void *)0));
15307 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15308 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15309 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15310 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15313 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15314 stmt->compound.context->parent = curContext;
15315 curContext = stmt->compound.context;
15316 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15318 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15319 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15321 isCustomAVLTree = 0x1;
15322 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15324 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15327 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15329 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15331 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15334 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15338 struct Declarator * decl;
15339 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15341 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15342 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15343 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15347 struct Type * type = (((void *)0));
15348 char typeStringBuf[1024];
15350 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15351 if(((struct Expression *)(*exp).last)->type == 11)
15353 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15356 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15358 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)
15360 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15362 typeString = templateClass->templateArgs[2].dataTypeString;
15364 else if(arrayExp->list)
15366 struct Expression * e;
15368 for(e = (*arrayExp->list).first; e; e = e->next)
15370 ProcessExpressionType(e);
15380 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15384 e->expType = (((void *)0));
15385 e = (*arrayExp->list).first;
15386 ProcessExpressionType(e);
15389 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15391 FreeType(e->expType);
15392 e->expType = (((void *)0));
15394 type = (((void *)0));
15402 FreeType(e->expType);
15403 e->expType = (((void *)0));
15409 typeStringBuf[0] = '\0';
15410 PrintType(type, typeStringBuf, 0x0, 0x1);
15411 typeString = typeStringBuf;
15417 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15418 struct Declarator * decl;
15419 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15423 struct Expression * e;
15425 builtinCount = (*arrayExp->list).count;
15426 type = ProcessTypeString(typeString, 0x0);
15427 while(e = (*arrayExp->list).first)
15429 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15430 e->destType = type;
15432 ProcessExpressionType(e);
15433 ListAdd(initializers, MkInitializerAssignment(e));
15436 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15438 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15439 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15440 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15441 FreeList(exp, FreeExpression);
15445 arrayExp->expType = ProcessTypeString("Container", 0x0);
15446 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15449 else if(isLinkList && !isList)
15451 struct Declarator * decl;
15452 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15454 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15455 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15456 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15458 else if(_class->templateArgs)
15461 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15463 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15464 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15466 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15467 if(block && block->type == 2 && block->compound.context)
15469 block->compound.context->parent = stmt->compound.context;
15473 block = MkIfStmt(filter, block, (((void *)0)));
15477 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));
15478 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15479 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15480 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15486 sprintf(count, "%d", builtinCount);
15487 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));
15488 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15489 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15490 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15492 else if(isLinkList && !isList)
15494 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15495 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15497 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15499 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));
15503 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15504 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15506 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));
15508 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15509 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15510 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15514 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15516 ProcessExpressionType(expIt);
15517 if((*stmt->compound.declarations).first)
15518 ProcessDeclaration((*stmt->compound.declarations).first);
15520 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15521 ProcessStatement(stmt);
15522 curContext = stmt->compound.context->parent;
15527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15539 struct Expression * exp;
15541 if(stmt->expressions)
15543 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15547 if(curFunction && !curFunction->type)
15548 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15549 FreeType(exp->destType);
15550 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15552 exp->destType->refCount++;
15554 ProcessExpressionType(exp);
15561 ProcessDeclaration(stmt->decl);
15566 struct AsmField * field;
15568 if(stmt->asmStmt.inputFields)
15570 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15571 if(field->expression)
15572 ProcessExpressionType(field->expression);
15574 if(stmt->asmStmt.outputFields)
15576 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15577 if(field->expression)
15578 ProcessExpressionType(field->expression);
15580 if(stmt->asmStmt.clobberedFields)
15582 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15584 if(field->expression)
15585 ProcessExpressionType(field->expression);
15592 struct PropertyWatch * propWatch;
15593 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15594 struct Expression * object = stmt->_watch.object;
15595 struct Expression * watcher = stmt->_watch.watcher;
15598 ProcessExpressionType(watcher);
15600 ProcessExpressionType(object);
15603 if(watcher || thisClass)
15605 struct External * external = curExternal;
15606 struct Context * context = curContext;
15609 stmt->expressions = MkList();
15610 curExternal = external->prev;
15611 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15613 struct ClassFunction * func;
15614 char watcherName[1024];
15615 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15616 struct External * createdExternal;
15617 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15620 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15621 if(propWatch->deleteWatch)
15622 strcat(watcherName, "_delete");
15625 struct Identifier * propID;
15627 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15629 strcat(watcherName, "_");
15630 strcat(watcherName, propID->string);
15633 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15635 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15636 ProcessClassFunctionBody(func, propWatch->compound);
15637 propWatch->compound = (((void *)0));
15638 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15639 createdExternal->symbol->idCode = external->symbol->idCode;
15640 curExternal = createdExternal;
15641 ProcessFunction(createdExternal->function);
15643 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15645 externalDecl->declaration = decl;
15646 if(decl->symbol && !decl->symbol->pointerExternal)
15647 decl->symbol->pointerExternal = externalDecl;
15649 if(propWatch->deleteWatch)
15651 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15653 ListAdd(args, CopyExpression(object));
15654 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15655 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15656 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15660 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15661 struct Identifier * propID;
15663 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15665 char propName[1024];
15666 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15670 char getName[1024], setName[1024];
15671 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15673 DeclareProperty(prop, setName, getName);
15674 strcpy(propName, "__ecereProp_");
15675 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15676 strcat(propName, "_");
15677 FullClassNameCat(propName, prop->name, 0x1);
15678 ListAdd(args, CopyExpression(object));
15679 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15680 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15681 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15682 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15690 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15692 curExternal = external;
15693 curContext = context;
15695 FreeExpression(watcher);
15697 FreeExpression(object);
15698 FreeList(watches, FreePropertyWatch);
15701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15705 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15707 ProcessStatement(propWatch->compound);
15714 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15715 struct Expression * object = stmt->_watch.object;
15716 struct __ecereNameSpace__ecere__com__Class * _class;
15719 ProcessExpressionType(object);
15722 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15725 struct Identifier * propID;
15728 stmt->expressions = MkList();
15729 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15731 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15738 for(propID = (*watches).first; propID; propID = propID->next)
15740 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15744 CreateFireWatcher(prop, object, stmt);
15747 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15752 struct __ecereNameSpace__ecere__com__Property * prop;
15753 struct __ecereNameSpace__ecere__com__Class * base;
15755 for(base = _class; base; base = base->base)
15757 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15759 if(prop->isProperty && prop->isWatchable)
15761 CreateFireWatcher(prop, object, stmt);
15767 FreeExpression(object);
15768 FreeList(watches, FreeIdentifier);
15771 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15777 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15778 struct Expression * object = stmt->_watch.object;
15779 struct Expression * watcher = stmt->_watch.watcher;
15780 struct __ecereNameSpace__ecere__com__Class * _class;
15783 ProcessExpressionType(object);
15785 ProcessExpressionType(watcher);
15788 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15789 if(watcher || thisClass)
15793 struct Identifier * propID;
15796 stmt->expressions = MkList();
15799 struct __ecereNameSpace__ecere__sys__OldList * args;
15802 ListAdd(args, CopyExpression(object));
15803 ListAdd(args, MkExpConstant("0"));
15804 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15805 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15809 for(propID = (*watches).first; propID; propID = propID->next)
15811 char propName[1024];
15812 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15816 char getName[1024], setName[1024];
15817 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15819 DeclareProperty(prop, setName, getName);
15820 strcpy(propName, "__ecereProp_");
15821 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15822 strcat(propName, "_");
15823 FullClassNameCat(propName, prop->name, 0x1);
15824 MangleClassName(propName);
15825 ListAdd(args, CopyExpression(object));
15826 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15827 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15828 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15835 FreeExpression(object);
15837 FreeExpression(watcher);
15838 FreeList(watches, FreeIdentifier);
15841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15851 extern struct Expression * QBrackets(struct Expression * exp);
15853 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15855 extern struct Declarator * QMkPtrDecl(char * id);
15857 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15859 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15861 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15863 static void ProcessFunction(struct FunctionDefinition * function)
15865 void * __ecereTemp2;
15866 void * __ecereTemp1;
15867 struct Identifier * id = GetDeclId(function->declarator);
15868 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15869 struct Type * type = symbol ? symbol->type : (((void *)0));
15870 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15871 struct Context * oldTopContext = topContext;
15873 yylloc = function->loc;
15874 if(type && type->thisClass)
15876 struct Symbol * classSym = type->thisClass;
15877 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15878 char className[1024];
15879 char structName[1024];
15880 struct Declarator * funcDecl;
15881 struct Symbol * thisSymbol;
15882 unsigned int typedObject = 0x0;
15884 if(_class && !_class->base)
15886 _class = currentClass;
15887 if(_class && !_class->symbol)
15888 _class->symbol = FindClass(_class->fullName);
15889 classSym = _class ? _class->symbol : (((void *)0));
15892 thisClass = _class;
15893 if(inCompiler && _class)
15895 if(type->kind == 11)
15897 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15899 struct Type * param = symbol->type->params.first;
15901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15904 if(type->classObjectType != 1)
15906 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15907 symbol->type->staticMethod = 0x1;
15908 symbol->type->thisClass = (((void *)0));
15909 symbol->type->extraParam = 0x0;
15912 strcpy(className, "__ecereClass_");
15913 FullClassNameCat(className, _class->fullName, 0x1);
15914 MangleClassName(className);
15915 structName[0] = (char)0;
15916 FullClassNameCat(structName, _class->fullName, 0x0);
15917 funcDecl = GetFuncDecl(function->declarator);
15920 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15922 struct TypeName * param = (*funcDecl->function.parameters).first;
15924 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15927 FreeTypeName(param);
15930 if(!function->propertyNoThis)
15932 struct TypeName * thisParam;
15934 if(type->classObjectType != 1)
15936 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15937 if(!funcDecl->function.parameters)
15938 funcDecl->function.parameters = MkList();
15939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15943 if(type->classObjectType != 1)
15945 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15946 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15948 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
15949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15953 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15955 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15957 funcDecl = GetFuncDecl(initDecl->declarator);
15960 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15962 struct TypeName * param = (*funcDecl->function.parameters).first;
15964 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15967 FreeTypeName(param);
15970 if(type->classObjectType != 1)
15972 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15974 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15976 if(!funcDecl->function.parameters)
15977 funcDecl->function.parameters = MkList();
15978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15986 if(type->classObjectType != 1)
15988 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
15989 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15990 if(typedObject && thisSymbol->type)
15992 thisSymbol->type->classObjectType = 2;
15993 thisSymbol->type->byReference = type->byReference;
15997 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15999 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16002 struct __ecereNameSpace__ecere__com__Class * base;
16004 for(base = _class; base && base->type != 1000; base = base->next)
16006 for(member = base->membersAndProperties.first; member; member = member->next)
16007 if(!member->isProperty)
16013 for(member = _class->membersAndProperties.first; member; member = member->next)
16014 if(!member->isProperty)
16018 char pointerName[1024];
16019 struct Declaration * decl;
16020 struct Initializer * initializer;
16021 struct Expression * exp, * bytePtr;
16023 strcpy(pointerName, "__ecerePointer_");
16024 FullClassNameCat(pointerName, _class->fullName, 0x0);
16026 char className[1024];
16028 strcpy(className, "__ecereClass_");
16029 FullClassNameCat(className, classSym->string, 0x1);
16030 MangleClassName(className);
16031 DeclareClass(classSym, className);
16033 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16038 sprintf(string, "%d", _class->offset);
16039 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16043 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16045 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16046 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
16049 yylloc = function->body->loc;
16050 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16052 struct Context * prevContext = curContext;
16054 curContext = function->body->compound.context;
16055 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16056 curContext = prevContext;
16058 decl->symbol = (((void *)0));
16059 if(!function->body->compound.declarations)
16060 function->body->compound.declarations = MkList();
16061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16067 thisClass = (((void *)0));
16070 FreeSpecifier(id->_class);
16071 id->_class = (((void *)0));
16072 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16074 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16076 id = GetDeclId(initDecl->declarator);
16077 FreeSpecifier(id->_class);
16078 id->_class = (((void *)0));
16082 topContext = function->body->compound.context;
16084 struct FunctionDefinition * oldFunction = curFunction;
16086 curFunction = function;
16088 ProcessStatement(function->body);
16089 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16091 struct Statement * prevCompound = curCompound;
16092 struct Context * prevContext = curContext;
16093 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16095 if(!function->body->compound.statements)
16096 function->body->compound.statements = MkList();
16097 ListAdd(function->body->compound.statements, fireWatchers);
16098 curCompound = function->body;
16099 curContext = function->body->compound.context;
16100 ProcessStatement(fireWatchers);
16101 curContext = prevContext;
16102 curCompound = prevCompound;
16104 curFunction = oldFunction;
16106 if(function->declarator)
16108 ProcessDeclarator(function->declarator);
16110 topContext = oldTopContext;
16111 thisClass = oldThisClass;
16114 extern void FreeSymbol(struct Symbol * symbol);
16116 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16118 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16120 struct ClassDef * def;
16121 struct External * external = curExternal;
16122 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16124 for(def = definitions->first; def; def = def->next)
16128 if(def->function->declarator)
16129 curExternal = def->function->declarator->symbol->pointerExternal;
16131 curExternal = external;
16132 ProcessFunction((struct FunctionDefinition *)def->function);
16134 else if(def->type == 2)
16136 if(def->decl->type == 2)
16138 thisClass = regClass;
16139 ProcessInstantiationType(def->decl->inst);
16140 thisClass = (((void *)0));
16144 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16147 thisClass = regClass;
16148 ProcessDeclaration(def->decl);
16149 thisClass = backThisClass;
16152 else if(def->type == 1 && def->defProperties)
16154 struct MemberInit * defProperty;
16155 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);
16157 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16158 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16160 thisClass = regClass;
16161 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16162 thisClass = (((void *)0));
16164 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16165 FreeSymbol(thisSymbol);
16167 else if(def->type == 3 && def->propertyDef)
16169 struct PropertyDef * prop = def->propertyDef;
16171 thisClass = regClass;
16176 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16178 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16180 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16181 ProcessStatement(prop->setStmt);
16187 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16189 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16191 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16192 ProcessStatement(prop->getStmt);
16194 if(prop->issetStmt)
16198 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16200 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16202 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16203 ProcessStatement(prop->issetStmt);
16205 thisClass = (((void *)0));
16207 else if(def->type == 4 && def->propertyWatch)
16209 struct PropertyWatch * propertyWatch = def->propertyWatch;
16211 thisClass = regClass;
16212 if(propertyWatch->compound)
16214 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);
16216 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16217 curExternal = (((void *)0));
16218 ProcessStatement(propertyWatch->compound);
16220 thisClass = (((void *)0));
16225 void DeclareFunctionUtil(char * s)
16227 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16234 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16235 strcpy(name, "__ecereFunction_");
16236 FullClassNameCat(name, s, 0x0);
16237 DeclareFunction(function, name);
16241 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16243 void ComputeDataTypes()
16245 void * __ecereTemp1;
16246 struct External * external;
16247 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16249 currentClass = (((void *)0));
16250 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16251 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16253 curExternal = temp;
16254 DeclareFunctionUtil("eSystem_New");
16255 DeclareFunctionUtil("eSystem_New0");
16256 DeclareFunctionUtil("eSystem_Renew");
16257 DeclareFunctionUtil("eSystem_Renew0");
16258 DeclareFunctionUtil("eClass_GetProperty");
16259 DeclareStruct("ecere::com::Class", 0x0);
16260 DeclareStruct("ecere::com::Instance", 0x0);
16261 DeclareStruct("ecere::com::Property", 0x0);
16262 DeclareStruct("ecere::com::DataMember", 0x0);
16263 DeclareStruct("ecere::com::Method", 0x0);
16264 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16265 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16267 for(external = (*ast).first; external; external = external->next)
16269 afterExternal = curExternal = external;
16270 if(external->type == 0)
16272 currentClass = external->function->_class;
16273 ProcessFunction(external->function);
16275 else if(external->type == 1)
16277 currentClass = (((void *)0));
16278 ProcessDeclaration(external->declaration);
16280 else if(external->type == 2)
16282 struct ClassDefinition * _class = external->_class;
16284 currentClass = external->symbol->registered;
16285 if(_class->definitions)
16287 ProcessClass(_class->definitions, _class->symbol);
16291 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16292 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16295 else if(external->type == 4)
16297 thisNameSpace = external->id->string;
16300 currentClass = (((void *)0));
16301 thisNameSpace = (((void *)0));
16302 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16303 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16306 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);
16308 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16310 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16312 struct __ecereNameSpace__ecere__com__Class * class;
16314 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16315 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16316 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16317 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16318 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16319 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16320 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16321 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16322 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16323 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16324 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16325 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16326 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16327 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16328 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16329 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16330 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16331 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16332 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16333 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16334 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16335 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16336 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16337 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16338 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16339 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16340 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16347 __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);
16348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16351 __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);
16352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16364 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16365 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16366 __ecereClass_Conversion = class;
16367 __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);
16368 __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);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16370 __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);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16390 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)