2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
14 typedef long long int64;
15 typedef unsigned long long uint64;
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
21 #define __ENDIAN_PAD(x) (8 - (x))
23 #define __ENDIAN_PAD(x) 0
26 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
28 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
30 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
32 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
34 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
36 struct __ecereNameSpace__ecere__sys__BTNode;
38 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
40 struct __ecereNameSpace__ecere__sys__BinaryTree
42 struct __ecereNameSpace__ecere__sys__BTNode * root;
44 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
45 void (* FreeKey)(void * key);
46 } __attribute__ ((gcc_struct));
48 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
50 struct __ecereNameSpace__ecere__sys__OldList
57 } __attribute__ ((gcc_struct));
59 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
61 struct __ecereNameSpace__ecere__com__Method
64 struct __ecereNameSpace__ecere__com__Method * parent;
65 struct __ecereNameSpace__ecere__com__Method * left;
66 struct __ecereNameSpace__ecere__com__Method * right;
71 struct __ecereNameSpace__ecere__com__Class * _class;
73 char * dataTypeString;
74 struct Type * dataType;
76 } __attribute__ ((gcc_struct));
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
80 struct __ecereNameSpace__ecere__com__Property
82 struct __ecereNameSpace__ecere__com__Property * prev;
83 struct __ecereNameSpace__ecere__com__Property * next;
85 unsigned int isProperty;
88 struct __ecereNameSpace__ecere__com__Class * _class;
89 char * dataTypeString;
90 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
91 struct Type * dataType;
94 unsigned int (* IsSet)();
98 unsigned int conversion;
99 unsigned int watcherOffset;
101 unsigned int compiled;
102 unsigned int selfWatchable;
103 unsigned int isWatchable;
104 } __attribute__ ((gcc_struct));
106 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
113 unsigned int included;
114 } __attribute__ ((gcc_struct));
116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
120 struct CodePosition start;
121 struct CodePosition end;
122 } __attribute__ ((gcc_struct));
124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
137 struct Attrib * attr;
138 } __attribute__ ((gcc_struct));
139 } __attribute__ ((gcc_struct));
141 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
143 struct ClassDefinition
145 struct ClassDefinition * prev;
146 struct ClassDefinition * next;
148 struct Specifier * _class;
149 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
150 struct __ecereNameSpace__ecere__sys__OldList * definitions;
151 struct Symbol * symbol;
152 struct Location blockStart;
153 struct Location nameLoc;
156 unsigned int deleteWatchable;
157 } __attribute__ ((gcc_struct));
159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
163 struct Context * parent;
164 struct __ecereNameSpace__ecere__sys__BinaryTree types;
165 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
166 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
167 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
170 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
171 struct ClassDefinition * classDef;
172 unsigned int templateTypesOnly;
173 unsigned int hasNameSpace;
174 } __attribute__ ((gcc_struct));
176 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
180 struct Instantiation * prev;
181 struct Instantiation * next;
183 struct Specifier * _class;
184 struct Expression * exp;
185 struct __ecereNameSpace__ecere__sys__OldList * members;
186 struct Symbol * symbol;
187 unsigned int fullSet;
188 unsigned int isConstant;
189 unsigned char * data;
190 struct Location nameLoc;
191 struct Location insideLoc;
193 } __attribute__ ((gcc_struct));
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
199 struct Declaration * prev;
200 struct Declaration * next;
207 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
208 struct __ecereNameSpace__ecere__sys__OldList * declarators;
209 } __attribute__ ((gcc_struct));
210 struct Instantiation * inst;
213 struct Identifier * id;
214 struct Expression * exp;
215 } __attribute__ ((gcc_struct));
216 } __attribute__ ((gcc_struct));
217 struct Specifier * extStorage;
218 struct Symbol * symbol;
220 } __attribute__ ((gcc_struct));
222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
226 struct Statement * prev;
227 struct Statement * next;
232 struct __ecereNameSpace__ecere__sys__OldList * expressions;
235 struct Identifier * id;
236 struct Statement * stmt;
237 } __attribute__ ((gcc_struct)) labeled;
240 struct Expression * exp;
241 struct Statement * stmt;
242 } __attribute__ ((gcc_struct)) caseStmt;
245 struct __ecereNameSpace__ecere__sys__OldList * declarations;
246 struct __ecereNameSpace__ecere__sys__OldList * statements;
247 struct Context * context;
248 unsigned int isSwitch;
249 } __attribute__ ((gcc_struct)) compound;
252 struct __ecereNameSpace__ecere__sys__OldList * exp;
253 struct Statement * stmt;
254 struct Statement * elseStmt;
255 } __attribute__ ((gcc_struct)) ifStmt;
258 struct __ecereNameSpace__ecere__sys__OldList * exp;
259 struct Statement * stmt;
260 } __attribute__ ((gcc_struct)) switchStmt;
263 struct __ecereNameSpace__ecere__sys__OldList * exp;
264 struct Statement * stmt;
265 } __attribute__ ((gcc_struct)) whileStmt;
268 struct __ecereNameSpace__ecere__sys__OldList * exp;
269 struct Statement * stmt;
270 } __attribute__ ((gcc_struct)) doWhile;
273 struct Statement * init;
274 struct Statement * check;
275 struct __ecereNameSpace__ecere__sys__OldList * increment;
276 struct Statement * stmt;
277 } __attribute__ ((gcc_struct)) forStmt;
280 struct Identifier * id;
281 } __attribute__ ((gcc_struct)) gotoStmt;
284 struct Specifier * spec;
286 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
287 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
288 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
289 } __attribute__ ((gcc_struct)) asmStmt;
292 struct Expression * watcher;
293 struct Expression * object;
294 struct __ecereNameSpace__ecere__sys__OldList * watches;
295 } __attribute__ ((gcc_struct)) _watch;
298 struct Identifier * id;
299 struct __ecereNameSpace__ecere__sys__OldList * exp;
300 struct __ecereNameSpace__ecere__sys__OldList * filter;
301 struct Statement * stmt;
302 } __attribute__ ((gcc_struct)) forEachStmt;
303 struct Declaration * decl;
304 } __attribute__ ((gcc_struct));
305 } __attribute__ ((gcc_struct));
307 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
311 struct TypeName * prev;
312 struct TypeName * next;
314 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
315 struct Declarator * declarator;
317 struct Expression * bitCount;
318 } __attribute__ ((gcc_struct));
320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
324 struct Initializer * prev;
325 struct Initializer * next;
330 struct Expression * exp;
331 struct __ecereNameSpace__ecere__sys__OldList * list;
332 } __attribute__ ((gcc_struct));
333 unsigned int isConstant;
334 } __attribute__ ((gcc_struct));
336 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
338 struct __ecereNameSpace__ecere__com__DataValue
353 } __attribute__ ((gcc_struct));
354 } __attribute__ ((gcc_struct));
356 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
360 struct Expression * prev;
361 struct Expression * next;
369 struct Identifier * identifier;
370 } __attribute__ ((gcc_struct));
371 struct Statement * compound;
372 struct Instantiation * instance;
374 struct __ecereNameSpace__ecere__sys__OldList * list;
377 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
378 struct Declarator * decl;
379 } __attribute__ ((gcc_struct)) _classExp;
382 struct Identifier * id;
383 } __attribute__ ((gcc_struct)) classData;
386 struct Expression * exp;
387 struct __ecereNameSpace__ecere__sys__OldList * arguments;
388 struct Location argLoc;
389 } __attribute__ ((gcc_struct)) call;
392 struct Expression * exp;
393 struct __ecereNameSpace__ecere__sys__OldList * index;
394 } __attribute__ ((gcc_struct)) index;
397 struct Expression * exp;
398 struct Identifier * member;
400 unsigned int thisPtr;
401 } __attribute__ ((gcc_struct)) member;
405 struct Expression * exp1;
406 struct Expression * exp2;
407 } __attribute__ ((gcc_struct)) op;
408 struct TypeName * typeName;
409 struct Specifier * _class;
412 struct TypeName * typeName;
413 struct Expression * exp;
414 } __attribute__ ((gcc_struct)) cast;
417 struct Expression * cond;
418 struct __ecereNameSpace__ecere__sys__OldList * exp;
419 struct Expression * elseExp;
420 } __attribute__ ((gcc_struct)) cond;
423 struct TypeName * typeName;
424 struct Expression * size;
425 } __attribute__ ((gcc_struct)) _new;
428 struct TypeName * typeName;
429 struct Expression * size;
430 struct Expression * exp;
431 } __attribute__ ((gcc_struct)) _renew;
435 struct Identifier * id;
436 } __attribute__ ((gcc_struct)) db;
439 struct Expression * ds;
440 struct Expression * name;
441 } __attribute__ ((gcc_struct)) dbopen;
444 struct TypeName * typeName;
445 struct Initializer * initializer;
446 } __attribute__ ((gcc_struct)) initializer;
449 struct Expression * exp;
450 struct TypeName * typeName;
451 } __attribute__ ((gcc_struct)) vaArg;
452 } __attribute__ ((gcc_struct));
453 unsigned int debugValue;
454 struct __ecereNameSpace__ecere__com__DataValue val;
455 unsigned int address;
456 unsigned int hasAddress;
457 struct Type * expType;
458 struct Type * destType;
461 unsigned int byReference;
462 unsigned int isConstant;
463 unsigned int addedThis;
464 unsigned int needCast;
465 unsigned int thisPtr;
466 } __attribute__ ((gcc_struct));
468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
470 struct TemplateDatatype
472 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
473 struct Declarator * decl;
474 } __attribute__ ((gcc_struct));
476 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
478 struct TemplateArgument;
480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
482 struct TemplateParameter
484 struct TemplateParameter * prev;
485 struct TemplateParameter * next;
488 struct Identifier * identifier;
491 struct TemplateDatatype * dataType;
493 } __attribute__ ((gcc_struct));
494 struct TemplateArgument * defaultArgument;
495 char * dataTypeString;
496 struct Type * baseType;
497 } __attribute__ ((gcc_struct));
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
503 struct Specifier * prev;
504 struct Specifier * next;
512 struct ExtDecl * extDecl;
514 struct Symbol * symbol;
515 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
516 } __attribute__ ((gcc_struct));
519 struct Identifier * id;
520 struct __ecereNameSpace__ecere__sys__OldList * list;
521 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
522 struct __ecereNameSpace__ecere__sys__OldList * definitions;
523 unsigned int addNameSpace;
524 struct Context * ctx;
525 } __attribute__ ((gcc_struct));
526 struct Expression * expression;
527 struct Specifier * _class;
528 struct TemplateParameter * templateParameter;
529 } __attribute__ ((gcc_struct));
530 } __attribute__ ((gcc_struct));
532 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
536 struct Identifier * prev;
537 struct Identifier * next;
539 struct Symbol * classSym;
540 struct Specifier * _class;
542 struct Identifier * badID;
543 } __attribute__ ((gcc_struct));
545 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
553 struct Declarator * prev;
554 struct Declarator * next;
557 struct Symbol * symbol;
558 struct Declarator * declarator;
561 struct Identifier * identifier;
564 struct Expression * exp;
565 struct Expression * posExp;
566 struct Attrib * attrib;
567 } __attribute__ ((gcc_struct)) structDecl;
570 struct Expression * exp;
571 struct Specifier * enumClass;
572 } __attribute__ ((gcc_struct)) array;
575 struct __ecereNameSpace__ecere__sys__OldList * parameters;
576 } __attribute__ ((gcc_struct)) function;
579 struct Pointer * pointer;
580 } __attribute__ ((gcc_struct)) pointer;
583 struct ExtDecl * extended;
584 } __attribute__ ((gcc_struct)) extended;
585 } __attribute__ ((gcc_struct));
586 } __attribute__ ((gcc_struct));
588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
590 struct FunctionDefinition
592 struct FunctionDefinition * prev;
593 struct FunctionDefinition * next;
595 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
596 struct Declarator * declarator;
597 struct __ecereNameSpace__ecere__sys__OldList * declarations;
598 struct Statement * body;
599 struct __ecereNameSpace__ecere__com__Class * _class;
600 struct __ecereNameSpace__ecere__sys__OldList attached;
603 struct Symbol * propSet;
605 unsigned int propertyNoThis;
606 } __attribute__ ((gcc_struct));
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
612 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
616 struct External * prev;
617 struct External * next;
620 struct Symbol * symbol;
623 struct FunctionDefinition * function;
624 struct ClassDefinition * _class;
625 struct Declaration * declaration;
627 struct Identifier * id;
628 struct DBTableDef * table;
629 } __attribute__ ((gcc_struct));
631 } __attribute__ ((gcc_struct));
633 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
637 struct ModuleImport * prev;
638 struct ModuleImport * next;
640 struct __ecereNameSpace__ecere__sys__OldList classes;
641 struct __ecereNameSpace__ecere__sys__OldList functions;
644 } __attribute__ ((gcc_struct));
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
650 struct ClassImport * prev;
651 struct ClassImport * next;
653 struct __ecereNameSpace__ecere__sys__OldList methods;
654 struct __ecereNameSpace__ecere__sys__OldList properties;
656 unsigned int isRemote;
657 } __attribute__ ((gcc_struct));
659 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
664 struct Symbol * parent;
665 struct Symbol * left;
666 struct Symbol * right;
671 struct __ecereNameSpace__ecere__com__Method * method;
672 struct __ecereNameSpace__ecere__com__Property * _property;
673 struct __ecereNameSpace__ecere__com__Class * registered;
674 } __attribute__ ((gcc_struct));
681 struct External * pointerExternal;
682 struct External * structExternal;
683 } __attribute__ ((gcc_struct));
686 struct External * externalGet;
687 struct External * externalSet;
688 struct External * externalPtr;
689 struct External * externalIsSet;
690 } __attribute__ ((gcc_struct));
693 struct External * methodExternal;
694 struct External * methodCodeExternal;
695 } __attribute__ ((gcc_struct));
696 } __attribute__ ((gcc_struct));
697 unsigned int imported;
698 unsigned int declaredStructSym;
699 struct __ecereNameSpace__ecere__com__Class * _class;
700 unsigned int declaredStruct;
701 unsigned int needConstructor;
702 unsigned int needDestructor;
703 char * constructorName;
706 char * destructorName;
707 struct ModuleImport * module;
708 struct ClassImport * _import;
709 struct Location nameLoc;
710 unsigned int isParam;
711 unsigned int isRemote;
712 unsigned int isStruct;
713 unsigned int fireWatchersDone;
715 unsigned int classData;
716 unsigned int isStatic;
718 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
719 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
720 struct Context * ctx;
722 struct Expression * propCategory;
723 } __attribute__ ((gcc_struct));
725 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
734 struct Symbol * _class;
737 struct __ecereNameSpace__ecere__sys__OldList members;
739 } __attribute__ ((gcc_struct));
742 struct Type * returnType;
743 struct __ecereNameSpace__ecere__sys__OldList params;
744 struct Symbol * thisClass;
745 unsigned int staticMethod;
746 struct TemplateParameter * thisClassTemplate;
747 } __attribute__ ((gcc_struct));
750 struct __ecereNameSpace__ecere__com__Method * method;
751 struct __ecereNameSpace__ecere__com__Class * methodClass;
752 struct __ecereNameSpace__ecere__com__Class * usedClass;
753 } __attribute__ ((gcc_struct));
756 struct Type * arrayType;
758 struct Expression * arraySizeExp;
759 unsigned int freeExp;
760 struct Symbol * enumClass;
761 } __attribute__ ((gcc_struct));
763 struct TemplateParameter * templateParameter;
764 } __attribute__ ((gcc_struct));
765 unsigned int isSigned;
767 unsigned int constant;
774 unsigned int byReference;
775 unsigned int extraParam;
777 unsigned int directClassAccess;
778 unsigned int computing;
779 unsigned int dllExport;
781 unsigned int keepCast;
782 unsigned int passAsTemplate;
784 } __attribute__ ((gcc_struct));
786 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
788 struct __ecereNameSpace__ecere__com__Class
790 struct __ecereNameSpace__ecere__com__Class * prev;
791 struct __ecereNameSpace__ecere__com__Class * next;
797 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
798 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
801 struct __ecereNameSpace__ecere__com__Class * base;
802 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
803 struct __ecereNameSpace__ecere__sys__BinaryTree members;
804 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
805 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
806 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
807 struct __ecereNameSpace__ecere__sys__OldList derivatives;
811 struct __ecereNameSpace__ecere__com__Instance * module;
812 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
813 char * dataTypeString;
814 struct Type * dataType;
816 int defaultAlignment;
817 void (* Initialize)();
819 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
820 char * designerClass;
821 unsigned int noExpansion;
822 char * defaultProperty;
823 unsigned int comRedefinition;
825 unsigned int isRemote;
826 unsigned int internalDecl;
828 unsigned int computeSize;
830 int destructionWatchOffset;
832 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
833 int inheritanceAccess;
836 struct __ecereNameSpace__ecere__sys__OldList conversions;
837 struct __ecereNameSpace__ecere__sys__OldList templateParams;
838 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
839 struct __ecereNameSpace__ecere__com__Class * templateClass;
840 struct __ecereNameSpace__ecere__sys__OldList templatized;
842 } __attribute__ ((gcc_struct));
844 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
846 struct __ecereNameSpace__ecere__com__Instance
849 struct __ecereNameSpace__ecere__com__Class * _class;
851 } __attribute__ ((gcc_struct));
853 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
855 struct __ecereNameSpace__ecere__com__DataMember
857 struct __ecereNameSpace__ecere__com__DataMember * prev;
858 struct __ecereNameSpace__ecere__com__DataMember * next;
860 unsigned int isProperty;
863 struct __ecereNameSpace__ecere__com__Class * _class;
864 char * dataTypeString;
865 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
866 struct Type * dataType;
870 struct __ecereNameSpace__ecere__sys__OldList members;
871 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
874 } __attribute__ ((gcc_struct));
876 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
878 struct __ecereNameSpace__ecere__com__SerialBuffer
880 unsigned char * _buffer;
884 } __attribute__ ((gcc_struct));
886 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
888 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
894 char * dataTypeString;
895 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
896 } __attribute__ ((gcc_struct));
897 struct __ecereNameSpace__ecere__com__DataValue expression;
903 struct __ecereNameSpace__ecere__com__DataMember * member;
904 struct __ecereNameSpace__ecere__com__Property * prop;
905 struct __ecereNameSpace__ecere__com__Method * method;
906 } __attribute__ ((gcc_struct));
907 } __attribute__ ((gcc_struct));
908 } __attribute__ ((gcc_struct));
909 } __attribute__ ((gcc_struct));
911 typedef unsigned int size_t;
913 void exit(int status);
915 void * calloc(size_t nmemb, size_t size);
917 void free(void * ptr);
919 void * malloc(size_t size);
921 void * realloc(void * ptr, size_t size);
923 long int strtol(const char * nptr, char ** endptr, int base);
925 long long int strtoll(const char * nptr, char ** endptr, int base);
927 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
931 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
934 typedef union YYSTYPE
939 struct Identifier * id;
940 struct Expression * exp;
941 struct Specifier * specifier;
942 struct __ecereNameSpace__ecere__sys__OldList * list;
943 struct Enumerator * enumerator;
944 struct Declarator * declarator;
945 struct Pointer * pointer;
946 struct Initializer * initializer;
947 struct InitDeclarator * initDeclarator;
948 struct TypeName * typeName;
949 struct Declaration * declaration;
950 struct Statement * stmt;
951 struct FunctionDefinition * function;
952 struct External * external;
953 struct Context * context;
954 struct AsmField * asmField;
955 struct Attrib * attrib;
956 struct ExtDecl * extDecl;
957 struct Attribute * attribute;
958 struct Instantiation * instance;
959 struct MembersInit * membersInit;
960 struct MemberInit * memberInit;
961 struct ClassFunction * classFunction;
962 struct ClassDefinition * _class;
963 struct ClassDef * classDef;
964 struct PropertyDef * prop;
966 struct Symbol * symbol;
967 struct PropertyWatch * propertyWatch;
968 struct TemplateParameter * templateParameter;
969 struct TemplateArgument * templateArgument;
970 struct TemplateDatatype * templateDatatype;
971 struct DBTableEntry * dbtableEntry;
972 struct DBIndexItem * dbindexItem;
973 struct DBTableDef * dbtableDef;
974 } __attribute__ ((gcc_struct)) YYSTYPE;
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
980 struct Enumerator * prev;
981 struct Enumerator * next;
983 struct Identifier * id;
984 struct Expression * exp;
985 } __attribute__ ((gcc_struct));
987 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
989 struct InitDeclarator
991 struct InitDeclarator * prev;
992 struct InitDeclarator * next;
994 struct Declarator * declarator;
995 struct Initializer * initializer;
996 } __attribute__ ((gcc_struct));
998 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1002 struct AsmField * prev;
1003 struct AsmField * next;
1004 struct Location loc;
1006 struct Expression * expression;
1007 } __attribute__ ((gcc_struct));
1009 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1013 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1015 struct ClassFunction
1017 struct ClassFunction * prev;
1018 struct ClassFunction * next;
1019 struct Location loc;
1020 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1021 struct Declarator * declarator;
1022 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1023 struct Statement * body;
1024 struct __ecereNameSpace__ecere__com__Class * _class;
1025 struct __ecereNameSpace__ecere__sys__OldList attached;
1028 struct Symbol * propSet;
1029 unsigned int isVirtual;
1030 unsigned int isConstructor;
1031 unsigned int isDestructor;
1032 unsigned int dontMangle;
1035 } __attribute__ ((gcc_struct));
1037 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1041 struct MembersInit * prev;
1042 struct MembersInit * next;
1043 struct Location loc;
1047 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1048 struct ClassFunction * function;
1049 } __attribute__ ((gcc_struct));
1050 } __attribute__ ((gcc_struct));
1052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1056 struct MemberInit * prev;
1057 struct MemberInit * next;
1058 struct Location loc;
1059 struct Location realLoc;
1060 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1061 struct Initializer * initializer;
1063 unsigned int variable;
1064 unsigned int takeOutExp;
1065 } __attribute__ ((gcc_struct));
1067 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1071 struct PropertyDef * prev;
1072 struct PropertyDef * next;
1073 struct Location loc;
1074 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1075 struct Declarator * declarator;
1076 struct Identifier * id;
1077 struct Statement * getStmt;
1078 struct Statement * setStmt;
1079 struct Statement * issetStmt;
1080 struct Symbol * symbol;
1081 unsigned int conversion;
1082 unsigned int isWatchable;
1083 struct Expression * category;
1084 } __attribute__ ((gcc_struct));
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1088 struct PropertyWatch
1090 struct PropertyWatch * prev;
1091 struct PropertyWatch * next;
1092 struct Location loc;
1093 struct Statement * compound;
1094 struct __ecereNameSpace__ecere__sys__OldList * properties;
1095 unsigned int deleteWatch;
1096 } __attribute__ ((gcc_struct));
1098 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1102 struct ClassDef * prev;
1103 struct ClassDef * next;
1104 struct Location loc;
1108 struct Declaration * decl;
1109 struct ClassFunction * function;
1110 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1111 struct PropertyDef * propertyDef;
1112 struct PropertyWatch * propertyWatch;
1114 struct Identifier * defaultProperty;
1117 struct Identifier * id;
1118 struct Initializer * initializer;
1119 } __attribute__ ((gcc_struct));
1120 } __attribute__ ((gcc_struct));
1123 } __attribute__ ((gcc_struct));
1125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1127 struct DBTableEntry;
1129 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1133 extern YYSTYPE yylval;
1135 extern struct Location yylloc;
1137 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1139 extern int returnCode;
1141 extern struct Expression * parsedExpression;
1143 extern unsigned int yydebug;
1145 void SetYydebug(unsigned int b)
1150 extern unsigned int echoOn;
1152 void resetScanner();
1156 int expression_yyparse();
1158 static struct Statement * curCompound;
1160 struct External * curExternal, * afterExternal;
1162 static struct Type * curSwitchType;
1164 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1166 struct __ecereNameSpace__ecere__com__Class * thisClass;
1168 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1173 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1178 static char * thisNameSpace;
1180 struct __ecereNameSpace__ecere__com__Class * containerClass;
1182 unsigned int thisClassParams = 0x1;
1184 unsigned int internalValueCounter;
1186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1188 struct __ecereNameSpace__ecere__sys__TempFile
1190 char __ecere_padding[24];
1191 } __attribute__ ((gcc_struct));
1193 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1195 extern int strlen(const char * );
1197 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1199 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1201 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1203 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1205 void PrintExpression(struct Expression * exp, char * string)
1208 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1212 OutputExpression(exp, f);
1213 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1214 count = strlen(string);
1215 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);
1216 string[count] = '\0';
1217 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1221 extern int isspace(int c);
1223 long long _strtoi64(char * string, char ** endString, int base)
1225 long long value = 0;
1230 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1242 if(ch == (char)0 && string[c + 1] == 'x')
1255 for(; (ch = string[c]); c++)
1259 else if(ch >= '1' && ch <= '9')
1261 else if(ch >= 'a' && ch <= 'z')
1263 else if(ch >= 'A' && ch <= 'Z')
1268 *endString = string + c;
1279 *endString = string + c;
1283 return sign * value;
1286 uint64 _strtoui64(char * string, char ** endString, int base)
1293 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1305 if(ch == (char)0 && string[c + 1] == 'x')
1318 for(; (ch = string[c]); c++)
1322 else if(ch >= '1' && ch <= '9')
1324 else if(ch >= 'a' && ch <= 'z')
1326 else if(ch >= 'A' && ch <= 'Z')
1331 *endString = string + c;
1342 *endString = string + c;
1346 return sign * value;
1349 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1351 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1353 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1355 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1357 if(!param->baseType)
1359 if(param->dataTypeString)
1360 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1362 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1364 return param->baseType;
1366 return (((void *)0));
1369 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1371 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1373 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1377 if(type1->kind == type2->kind)
1386 if(type1->passAsTemplate && !type2->passAsTemplate)
1388 return type1->isSigned != type2->isSigned;
1390 return type1->_class != type2->_class;
1392 return NeedCast(type1->type, type2->type);
1400 extern int strcmp(const char * , const char * );
1402 extern struct Context * curContext;
1404 extern struct Context * topContext;
1406 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1408 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);
1410 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1412 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);
1414 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);
1416 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1418 struct __ecereNameSpace__ecere__com__ClassProperty
1421 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1422 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1423 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1425 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1426 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1427 char * dataTypeString;
1428 struct Type * dataType;
1429 unsigned int constant;
1430 } __attribute__ ((gcc_struct));
1432 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1434 extern struct Expression * QMkExpId(char * id);
1436 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1438 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1441 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1446 char * dataTypeString;
1448 } __attribute__ ((gcc_struct));
1449 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1451 char __ecere_padding[4];
1452 } __attribute__ ((gcc_struct));
1454 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1456 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1458 extern void FreeIdentifier(struct Identifier * id);
1460 void ProcessExpressionType(struct Expression * exp);
1462 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1464 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1466 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1468 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1470 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1472 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1474 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1476 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1478 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1480 if(exp->type == 0 && exp->identifier)
1482 struct Identifier * id = exp->identifier;
1483 struct Context * ctx;
1484 struct Symbol * symbol = (((void *)0));
1486 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1488 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1490 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1495 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1497 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1498 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1499 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1500 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1504 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1506 if(!prop && !method)
1507 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1508 if(!prop && !method && !member)
1510 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1512 if(prop || method || member || classProp)
1515 exp->member.member = id;
1516 exp->member.memberType = 0;
1517 exp->member.exp = QMkExpId("this");
1518 exp->addedThis = 0x1;
1520 else if(_class && _class->templateParams.first)
1522 struct __ecereNameSpace__ecere__com__Class * sClass;
1524 for(sClass = _class; sClass; sClass = sClass->base)
1526 if(sClass->templateParams.first)
1528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1530 for(param = sClass->templateParams.first; param; param = param->next)
1532 if(param->type == 2 && !strcmp(param->name, id->string))
1534 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1538 struct Declarator * decl;
1539 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1541 FreeIdentifier(exp->member.member);
1542 ProcessExpressionType(argExp);
1543 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1544 exp->expType = ProcessType(specs, decl);
1546 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1557 extern int sprintf(char * , char * , ...);
1559 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1561 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1563 char * PrintInt(long long result)
1567 if(result > (((long long)0x7fffffffffffffffLL)))
1568 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1570 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1571 return __ecereNameSpace__ecere__sys__CopyString(temp);
1574 char * PrintUInt(uint64 result)
1578 if(result > (0xffffffff))
1579 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1580 else if(result > (((int)0x7fffffff)))
1581 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 char * PrintInt64(long long result)
1591 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1592 return __ecereNameSpace__ecere__sys__CopyString(temp);
1595 char * PrintUInt64(uint64 result)
1599 if(result > (((long long)0x7fffffffffffffffLL)))
1600 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1602 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1603 return __ecereNameSpace__ecere__sys__CopyString(temp);
1606 char * PrintHexUInt(uint64 result)
1610 if(result > (0xffffffff))
1611 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1613 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1614 return __ecereNameSpace__ecere__sys__CopyString(temp);
1617 char * PrintHexUInt64(uint64 result)
1621 if(result > (0xffffffff))
1622 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1624 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1625 return __ecereNameSpace__ecere__sys__CopyString(temp);
1628 char * PrintShort(short result)
1632 sprintf(temp, "%d", (unsigned short)result);
1633 return __ecereNameSpace__ecere__sys__CopyString(temp);
1636 char * PrintUShort(unsigned short result)
1640 if(result > (unsigned short)32767)
1641 sprintf(temp, "0x%X", (int)result);
1643 sprintf(temp, "%d", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1647 extern int isprint(int c);
1649 char * PrintChar(char result)
1653 if(result > (char)0 && isprint(result))
1654 sprintf(temp, "'%c'", result);
1655 else if(result < (char)0)
1656 sprintf(temp, "%d", result);
1658 sprintf(temp, "0x%X", (unsigned char)result);
1659 return __ecereNameSpace__ecere__sys__CopyString(temp);
1662 char * PrintUChar(unsigned char result)
1666 sprintf(temp, "0x%X", result);
1667 return __ecereNameSpace__ecere__sys__CopyString(temp);
1670 char * PrintFloat(float result)
1674 sprintf(temp, "%.16ff", result);
1675 return __ecereNameSpace__ecere__sys__CopyString(temp);
1678 char * PrintDouble(double result)
1682 sprintf(temp, "%.16f", result);
1683 return __ecereNameSpace__ecere__sys__CopyString(temp);
1686 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1690 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1691 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1692 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* Neg)(struct Expression *, struct Operand *);
1696 unsigned int (* Inc)(struct Expression *, struct Operand *);
1697 unsigned int (* Dec)(struct Expression *, struct Operand *);
1698 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1699 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1700 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1710 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* Not)(struct Expression *, struct Operand *);
1716 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1725 } __attribute__ ((gcc_struct));
1727 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1733 unsigned int ptrSize;
1749 } __attribute__ ((gcc_struct));
1751 } __attribute__ ((gcc_struct));
1753 struct Operand GetOperand(struct Expression * exp);
1755 unsigned int GetInt(struct Expression * exp, int * value2)
1757 struct Operand op2 = GetOperand(exp);
1759 if(op2.kind == 3 && op2.type->isSigned)
1761 else if(op2.kind == 3)
1762 *value2 = (int)op2.ui;
1763 if(op2.kind == 4 && op2.type->isSigned)
1764 *value2 = (int)op2.i64;
1765 else if(op2.kind == 4)
1766 *value2 = (int)op2.ui64;
1767 else if(op2.kind == 22 && op2.type->isSigned)
1768 *value2 = (int)op2.iptr;
1769 else if(op2.kind == 22)
1770 *value2 = (int)op2.uiptr;
1771 else if(op2.kind == 2 && op2.type->isSigned)
1772 *value2 = (int)op2.s;
1773 else if(op2.kind == 2)
1774 *value2 = (int)op2.us;
1775 else if(op2.kind == 1 && op2.type->isSigned)
1776 *value2 = (int)op2.c;
1777 else if(op2.kind == 1)
1778 *value2 = (int)op2.uc;
1779 else if(op2.kind == 6)
1780 *value2 = (int)op2.f;
1781 else if(op2.kind == 7)
1782 *value2 = (int)op2.d;
1783 else if(op2.kind == 13)
1784 *value2 = (int)op2.ui;
1790 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1792 struct Operand op2 = GetOperand(exp);
1794 if(op2.kind == 3 && op2.type->isSigned)
1795 *value2 = (unsigned int)op2.i;
1796 else if(op2.kind == 3)
1798 if(op2.kind == 4 && op2.type->isSigned)
1799 *value2 = (unsigned int)op2.i64;
1800 else if(op2.kind == 4)
1801 *value2 = (unsigned int)op2.ui64;
1802 else if(op2.kind == 22 && op2.type->isSigned)
1803 *value2 = (unsigned int)op2.iptr;
1804 else if(op2.kind == 22)
1805 *value2 = (unsigned int)op2.uiptr;
1806 else if(op2.kind == 2 && op2.type->isSigned)
1807 *value2 = (unsigned int)op2.s;
1808 else if(op2.kind == 2)
1809 *value2 = (unsigned int)op2.us;
1810 else if(op2.kind == 1 && op2.type->isSigned)
1811 *value2 = (unsigned int)op2.c;
1812 else if(op2.kind == 1)
1813 *value2 = (unsigned int)op2.uc;
1814 else if(op2.kind == 6)
1815 *value2 = (unsigned int)op2.f;
1816 else if(op2.kind == 7)
1817 *value2 = (unsigned int)op2.d;
1818 else if(op2.kind == 13)
1825 unsigned int GetInt64(struct Expression * exp, long long * value2)
1827 struct Operand op2 = GetOperand(exp);
1829 if(op2.kind == 3 && op2.type->isSigned)
1830 *value2 = (long long)op2.i;
1831 else if(op2.kind == 3)
1832 *value2 = (long long)op2.ui;
1833 if(op2.kind == 4 && op2.type->isSigned)
1835 else if(op2.kind == 4)
1836 *value2 = (long long)op2.ui64;
1837 else if(op2.kind == 22 && op2.type->isSigned)
1838 *value2 = (long long)op2.iptr;
1839 else if(op2.kind == 22)
1840 *value2 = (long long)op2.uiptr;
1841 else if(op2.kind == 2 && op2.type->isSigned)
1842 *value2 = (long long)op2.s;
1843 else if(op2.kind == 2)
1844 *value2 = (long long)op2.us;
1845 else if(op2.kind == 1 && op2.type->isSigned)
1846 *value2 = (long long)op2.c;
1847 else if(op2.kind == 1)
1848 *value2 = (long long)op2.uc;
1849 else if(op2.kind == 6)
1850 *value2 = (long long)op2.f;
1851 else if(op2.kind == 7)
1852 *value2 = (long long)op2.d;
1853 else if(op2.kind == 13)
1854 *value2 = (long long)op2.ui;
1860 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1862 struct Operand op2 = GetOperand(exp);
1864 if(op2.kind == 3 && op2.type->isSigned)
1865 *value2 = (uint64)op2.i;
1866 else if(op2.kind == 3)
1867 *value2 = (uint64)op2.ui;
1868 if(op2.kind == 4 && op2.type->isSigned)
1869 *value2 = (uint64)op2.i64;
1870 else if(op2.kind == 4)
1872 else if(op2.kind == 22 && op2.type->isSigned)
1873 *value2 = (uint64)op2.iptr;
1874 else if(op2.kind == 22)
1875 *value2 = (uint64)op2.uiptr;
1876 else if(op2.kind == 2 && op2.type->isSigned)
1877 *value2 = (uint64)op2.s;
1878 else if(op2.kind == 2)
1879 *value2 = (uint64)op2.us;
1880 else if(op2.kind == 1 && op2.type->isSigned)
1881 *value2 = (uint64)op2.c;
1882 else if(op2.kind == 1)
1883 *value2 = (uint64)op2.uc;
1884 else if(op2.kind == 6)
1885 *value2 = (uint64)op2.f;
1886 else if(op2.kind == 7)
1887 *value2 = (uint64)op2.d;
1888 else if(op2.kind == 13)
1889 *value2 = (uint64)op2.ui;
1895 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1897 struct Operand op2 = GetOperand(exp);
1899 if(op2.kind == 3 && op2.type->isSigned)
1900 *value2 = (intptr_t)op2.i;
1901 else if(op2.kind == 3)
1902 *value2 = (intptr_t)op2.ui;
1903 if(op2.kind == 4 && op2.type->isSigned)
1904 *value2 = (intptr_t)op2.i64;
1905 else if(op2.kind == 4)
1906 *value2 = (intptr_t)op2.ui64;
1907 else if(op2.kind == 22 && op2.type->isSigned)
1909 else if(op2.kind == 22)
1910 *value2 = (intptr_t)op2.uiptr;
1911 else if(op2.kind == 2 && op2.type->isSigned)
1912 *value2 = (intptr_t)op2.s;
1913 else if(op2.kind == 2)
1914 *value2 = (intptr_t)op2.us;
1915 else if(op2.kind == 1 && op2.type->isSigned)
1916 *value2 = (intptr_t)op2.c;
1917 else if(op2.kind == 1)
1918 *value2 = (intptr_t)op2.uc;
1919 else if(op2.kind == 6)
1920 *value2 = (intptr_t)op2.f;
1921 else if(op2.kind == 7)
1922 *value2 = (intptr_t)op2.d;
1923 else if(op2.kind == 13)
1924 *value2 = (intptr_t)op2.ui;
1930 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1932 struct Operand op2 = GetOperand(exp);
1934 if(op2.kind == 3 && op2.type->isSigned)
1935 *value2 = (uintptr_t)op2.i;
1936 else if(op2.kind == 3)
1937 *value2 = (uintptr_t)op2.ui;
1938 if(op2.kind == 4 && op2.type->isSigned)
1939 *value2 = (uintptr_t)op2.i64;
1940 else if(op2.kind == 4)
1941 *value2 = (uintptr_t)op2.ui64;
1942 else if(op2.kind == 22 && op2.type->isSigned)
1943 *value2 = (uintptr_t)op2.iptr;
1944 else if(op2.kind == 22)
1945 *value2 = op2.uiptr;
1946 else if(op2.kind == 2 && op2.type->isSigned)
1947 *value2 = (uintptr_t)op2.s;
1948 else if(op2.kind == 2)
1949 *value2 = (uintptr_t)op2.us;
1950 else if(op2.kind == 1 && op2.type->isSigned)
1951 *value2 = (uintptr_t)op2.c;
1952 else if(op2.kind == 1)
1953 *value2 = (uintptr_t)op2.uc;
1954 else if(op2.kind == 6)
1955 *value2 = (uintptr_t)op2.f;
1956 else if(op2.kind == 7)
1957 *value2 = (uintptr_t)op2.d;
1958 else if(op2.kind == 13)
1959 *value2 = (uintptr_t)op2.ui;
1965 unsigned int GetShort(struct Expression * exp, short * value2)
1967 struct Operand op2 = GetOperand(exp);
1969 if(op2.kind == 3 && op2.type->isSigned)
1970 *value2 = (short)op2.i;
1971 else if(op2.kind == 3)
1972 *value2 = (short)op2.ui;
1973 if(op2.kind == 4 && op2.type->isSigned)
1974 *value2 = (short)op2.i64;
1975 else if(op2.kind == 4)
1976 *value2 = (short)op2.ui64;
1977 else if(op2.kind == 22 && op2.type->isSigned)
1978 *value2 = (short)op2.iptr;
1979 else if(op2.kind == 22)
1980 *value2 = (short)op2.uiptr;
1981 else if(op2.kind == 2 && op2.type->isSigned)
1983 else if(op2.kind == 2)
1984 *value2 = (short)op2.us;
1985 else if(op2.kind == 1 && op2.type->isSigned)
1986 *value2 = (short)op2.c;
1987 else if(op2.kind == 1)
1988 *value2 = (short)op2.uc;
1989 else if(op2.kind == 6)
1990 *value2 = (short)op2.f;
1991 else if(op2.kind == 7)
1992 *value2 = (short)op2.d;
1993 else if(op2.kind == 13)
1994 *value2 = (short)op2.ui;
2000 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2002 struct Operand op2 = GetOperand(exp);
2004 if(op2.kind == 3 && op2.type->isSigned)
2005 *value2 = (unsigned short)op2.i;
2006 else if(op2.kind == 3)
2007 *value2 = (unsigned short)op2.ui;
2008 if(op2.kind == 4 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.i64;
2010 else if(op2.kind == 4)
2011 *value2 = (unsigned short)op2.ui64;
2012 else if(op2.kind == 22 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.iptr;
2014 else if(op2.kind == 22)
2015 *value2 = (unsigned short)op2.uiptr;
2016 else if(op2.kind == 2 && op2.type->isSigned)
2017 *value2 = (unsigned short)op2.s;
2018 else if(op2.kind == 2)
2020 else if(op2.kind == 1 && op2.type->isSigned)
2021 *value2 = (unsigned short)op2.c;
2022 else if(op2.kind == 1)
2023 *value2 = (unsigned short)op2.uc;
2024 else if(op2.kind == 6)
2025 *value2 = (unsigned short)op2.f;
2026 else if(op2.kind == 7)
2027 *value2 = (unsigned short)op2.d;
2028 else if(op2.kind == 13)
2029 *value2 = (unsigned short)op2.ui;
2035 unsigned int GetChar(struct Expression * exp, char * value2)
2037 struct Operand op2 = GetOperand(exp);
2039 if(op2.kind == 3 && op2.type->isSigned)
2040 *value2 = (char)op2.i;
2041 else if(op2.kind == 3)
2042 *value2 = (char)op2.ui;
2043 if(op2.kind == 4 && op2.type->isSigned)
2044 *value2 = (char)op2.i64;
2045 else if(op2.kind == 4)
2046 *value2 = (char)op2.ui64;
2047 else if(op2.kind == 22 && op2.type->isSigned)
2048 *value2 = (char)op2.iptr;
2049 else if(op2.kind == 22)
2050 *value2 = (char)op2.uiptr;
2051 else if(op2.kind == 2 && op2.type->isSigned)
2052 *value2 = (char)op2.s;
2053 else if(op2.kind == 2)
2054 *value2 = (char)op2.us;
2055 else if(op2.kind == 1 && op2.type->isSigned)
2057 else if(op2.kind == 1)
2058 *value2 = (char)op2.uc;
2059 else if(op2.kind == 6)
2060 *value2 = (char)op2.f;
2061 else if(op2.kind == 7)
2062 *value2 = (char)op2.d;
2063 else if(op2.kind == 13)
2064 *value2 = (char)op2.ui;
2070 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2072 struct Operand op2 = GetOperand(exp);
2074 if(op2.kind == 3 && op2.type->isSigned)
2075 *value2 = (unsigned char)op2.i;
2076 else if(op2.kind == 3)
2077 *value2 = (unsigned char)op2.ui;
2078 if(op2.kind == 4 && op2.type->isSigned)
2079 *value2 = (unsigned char)op2.i64;
2080 else if(op2.kind == 4)
2081 *value2 = (unsigned char)op2.ui64;
2082 else if(op2.kind == 22 && op2.type->isSigned)
2083 *value2 = (unsigned char)op2.iptr;
2084 else if(op2.kind == 22)
2085 *value2 = (unsigned char)op2.uiptr;
2086 else if(op2.kind == 2 && op2.type->isSigned)
2087 *value2 = (unsigned char)op2.s;
2088 else if(op2.kind == 2)
2089 *value2 = (unsigned char)op2.us;
2090 else if(op2.kind == 1 && op2.type->isSigned)
2091 *value2 = (unsigned char)op2.c;
2092 else if(op2.kind == 1)
2094 else if(op2.kind == 6)
2095 *value2 = (unsigned char)op2.f;
2096 else if(op2.kind == 7)
2097 *value2 = (unsigned char)op2.d;
2098 else if(op2.kind == 13)
2099 *value2 = (unsigned char)op2.ui;
2105 unsigned int GetFloat(struct Expression * exp, float * value2)
2107 struct Operand op2 = GetOperand(exp);
2109 if(op2.kind == 3 && op2.type->isSigned)
2110 *value2 = (float)(float)op2.i;
2111 else if(op2.kind == 3)
2112 *value2 = (float)(float)op2.ui;
2113 if(op2.kind == 4 && op2.type->isSigned)
2114 *value2 = (float)(float)op2.i64;
2115 else if(op2.kind == 4)
2116 *value2 = (float)(float)op2.ui64;
2117 else if(op2.kind == 22 && op2.type->isSigned)
2118 *value2 = (float)op2.iptr;
2119 else if(op2.kind == 22)
2120 *value2 = (float)op2.uiptr;
2121 else if(op2.kind == 2 && op2.type->isSigned)
2122 *value2 = (float)(float)op2.s;
2123 else if(op2.kind == 2)
2124 *value2 = (float)(float)op2.us;
2125 else if(op2.kind == 1 && op2.type->isSigned)
2126 *value2 = (float)(float)op2.c;
2127 else if(op2.kind == 1)
2128 *value2 = (float)(float)op2.uc;
2129 else if(op2.kind == 6)
2130 *value2 = (float)op2.f;
2131 else if(op2.kind == 7)
2132 *value2 = (float)op2.d;
2133 else if(op2.kind == 13)
2134 *value2 = (float)(float)op2.ui;
2140 unsigned int GetDouble(struct Expression * exp, double * value2)
2142 struct Operand op2 = GetOperand(exp);
2144 if(op2.kind == 3 && op2.type->isSigned)
2145 *value2 = (double)(double)op2.i;
2146 else if(op2.kind == 3)
2147 *value2 = (double)(double)op2.ui;
2148 if(op2.kind == 4 && op2.type->isSigned)
2149 *value2 = (double)(double)op2.i64;
2150 else if(op2.kind == 4)
2151 *value2 = (double)(double)op2.ui64;
2152 else if(op2.kind == 22 && op2.type->isSigned)
2153 *value2 = (double)op2.iptr;
2154 else if(op2.kind == 22)
2155 *value2 = (double)op2.uiptr;
2156 else if(op2.kind == 2 && op2.type->isSigned)
2157 *value2 = (double)(double)op2.s;
2158 else if(op2.kind == 2)
2159 *value2 = (double)(double)op2.us;
2160 else if(op2.kind == 1 && op2.type->isSigned)
2161 *value2 = (double)(double)op2.c;
2162 else if(op2.kind == 1)
2163 *value2 = (double)(double)op2.uc;
2164 else if(op2.kind == 6)
2165 *value2 = (double)op2.f;
2166 else if(op2.kind == 7)
2167 *value2 = (double)op2.d;
2168 else if(op2.kind == 13)
2169 *value2 = (double)(double)op2.ui;
2175 void ComputeExpression(struct Expression * exp);
2177 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2179 int ComputeTypeSize(struct Type * type);
2181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2183 struct __ecereNameSpace__ecere__com__BitMember
2185 struct __ecereNameSpace__ecere__com__BitMember * prev;
2186 struct __ecereNameSpace__ecere__com__BitMember * next;
2188 unsigned int isProperty;
2191 struct __ecereNameSpace__ecere__com__Class * _class;
2192 char * dataTypeString;
2193 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2194 struct Type * dataType;
2199 } __attribute__ ((gcc_struct));
2201 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2203 struct __ecereNameSpace__ecere__sys__OldLink
2205 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2206 struct __ecereNameSpace__ecere__sys__OldLink * next;
2208 } __attribute__ ((gcc_struct));
2210 void FinishTemplatesContext(struct Context * context);
2212 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2214 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2215 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2217 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2220 int unionMemberOffset = 0;
2223 if(!member && _class->destructionWatchOffset)
2224 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2226 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2228 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2230 if(!dataMember->isProperty)
2232 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2234 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2240 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2242 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2244 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2246 if(!isMember && _class->type == 2 && dataMember->dataType)
2248 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2252 ComputeTypeSize(dataMember->dataType);
2253 if(bitMember->pos == -1)
2254 bitMember->pos = _class->memberOffset;
2255 if(!bitMember->size)
2256 bitMember->size = dataMember->dataType->size * 8;
2257 _class->memberOffset = bitMember->pos + bitMember->size;
2258 for(d = 0; d < bitMember->size; d++)
2264 bitMember->mask = mask << bitMember->pos;
2266 else if(dataMember->type == 0 && dataMember->dataType)
2271 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2272 ComputeTypeSize(dataMember->dataType);
2273 if(dataMember->dataType->bitFieldCount)
2275 bitFields += dataMember->dataType->bitFieldCount;
2282 int size = (bitFields + 7) / 8;
2286 int __simpleStruct0;
2290 int __simpleStruct0;
2292 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2293 if(member->memberOffset % alignment)
2294 member->memberOffset += alignment - (member->memberOffset % alignment);
2296 dataMember->offset = member->memberOffset;
2297 if(member->type == 1)
2298 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2301 member->memberOffset += size;
2308 int __simpleStruct0;
2310 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2311 if(_class->memberOffset % alignment)
2312 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2314 dataMember->offset = _class->memberOffset;
2315 _class->memberOffset += size;
2319 size = dataMember->dataType->size;
2320 alignment = dataMember->dataType->alignment;
2324 int __simpleStruct0;
2328 int __simpleStruct0;
2330 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2331 if(member->memberOffset % alignment)
2332 member->memberOffset += alignment - (member->memberOffset % alignment);
2334 dataMember->offset = member->memberOffset;
2335 if(member->type == 1)
2336 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2339 member->memberOffset += size;
2346 int __simpleStruct0;
2348 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2349 if(_class->memberOffset % alignment)
2350 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2352 dataMember->offset = _class->memberOffset;
2353 _class->memberOffset += size;
2358 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2361 int __simpleStruct2;
2362 int __simpleStruct0, __simpleStruct1;
2364 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2365 dataMember->offset = member->memberOffset;
2366 if(member->type == 1)
2367 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2369 member->memberOffset += dataMember->memberOffset;
2373 int __simpleStruct0, __simpleStruct1;
2375 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2376 dataMember->offset = _class->memberOffset;
2377 _class->memberOffset += dataMember->memberOffset;
2385 int size = (bitFields + 7) / 8;
2389 int __simpleStruct0;
2393 int __simpleStruct0;
2395 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2396 if(member->memberOffset % alignment)
2397 member->memberOffset += alignment - (member->memberOffset % alignment);
2399 if(member->type == 1)
2400 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2403 member->memberOffset += size;
2410 int __simpleStruct0;
2412 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2413 if(_class->memberOffset % alignment)
2414 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2416 _class->memberOffset += size;
2421 if(member && member->type == 1)
2423 member->memberOffset = unionMemberOffset;
2427 if(_class->type != 2)
2429 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2432 struct __ecereNameSpace__ecere__com__Property * prop;
2434 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2436 if(prop->isProperty && prop->isWatchable)
2438 prop->watcherOffset = _class->structSize;
2439 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2444 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2446 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2448 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2450 if(deriv->computeSize)
2452 deriv->offset = _class->structSize;
2453 deriv->memberOffset = 0;
2454 deriv->structSize = deriv->offset;
2455 ComputeClassMembers(deriv, 0x0);
2463 FinishTemplatesContext(context);
2466 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2468 struct __ecereNameSpace__ecere__com__NameSpace
2471 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2472 struct __ecereNameSpace__ecere__com__NameSpace * left;
2473 struct __ecereNameSpace__ecere__com__NameSpace * right;
2475 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2476 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2477 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2478 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2479 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2480 } __attribute__ ((gcc_struct));
2482 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2484 struct __ecereNameSpace__ecere__com__Module
2486 struct __ecereNameSpace__ecere__com__Instance * application;
2487 struct __ecereNameSpace__ecere__sys__OldList classes;
2488 struct __ecereNameSpace__ecere__sys__OldList defines;
2489 struct __ecereNameSpace__ecere__sys__OldList functions;
2490 struct __ecereNameSpace__ecere__sys__OldList modules;
2491 struct __ecereNameSpace__ecere__com__Instance * prev;
2492 struct __ecereNameSpace__ecere__com__Instance * next;
2498 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2499 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2500 } __attribute__ ((gcc_struct));
2502 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2504 struct __ecereNameSpace__ecere__com__Class * _class;
2505 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2507 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2508 ComputeModuleClasses(subModule->data);
2509 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2510 ComputeClassMembers(_class, 0x0);
2513 extern int targetBits;
2515 extern unsigned int inCompiler;
2517 extern void Compiler_Error(char * format, ...);
2519 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2521 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2523 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2525 int ComputeTypeSize(struct Type * type)
2527 unsigned int size = type ? type->size : 0;
2529 if(!size && type && !type->computing)
2531 type->computing = 0x1;
2535 type->alignment = size = sizeof(char);
2538 type->alignment = size = sizeof(int);
2541 type->alignment = size = sizeof(long long);
2544 type->alignment = size = targetBits / 8;
2547 type->alignment = size = sizeof(long);
2550 type->alignment = size = sizeof(short);
2553 type->alignment = size = sizeof(float);
2556 type->alignment = size = sizeof(double);
2560 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2562 if(_class && _class->type == 1)
2564 ComputeClassMembers(_class, 0x0);
2565 type->alignment = _class->structAlignment;
2566 size = _class->structSize;
2567 if(type->alignment && size % type->alignment)
2568 size += type->alignment - (size % type->alignment);
2570 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2572 if(!_class->dataType)
2573 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2574 size = type->alignment = ComputeTypeSize(_class->dataType);
2577 size = type->alignment = targetBits / 8;
2582 size = type->alignment = targetBits / 8;
2585 if(type->arraySizeExp)
2587 ProcessExpressionType(type->arraySizeExp);
2588 ComputeExpression(type->arraySizeExp);
2589 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)))
2591 struct Location oldLoc = yylloc;
2592 char expression[10240];
2594 expression[0] = '\0';
2595 type->arraySizeExp->expType = (((void *)0));
2596 yylloc = type->arraySizeExp->loc;
2598 PrintExpression(type->arraySizeExp, expression);
2599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2602 GetInt(type->arraySizeExp, &type->arraySize);
2604 else if(type->enumClass)
2606 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2608 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2611 type->arraySize = 0;
2615 type->arraySize = 0;
2617 size = ComputeTypeSize(type->type) * type->arraySize;
2618 type->alignment = type->type->alignment;
2622 struct Type * member;
2624 for(member = type->members.first; member; member = member->next)
2626 int __simpleStruct0, __simpleStruct1;
2627 unsigned int addSize = ComputeTypeSize(member);
2629 member->offset = size;
2630 if(member->alignment && size % member->alignment)
2631 member->offset += member->alignment - (size % member->alignment);
2632 size = member->offset;
2633 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2636 if(type->alignment && size % type->alignment)
2637 size += type->alignment - (size % type->alignment);
2642 struct Type * member;
2644 for(member = type->members.first; member; member = member->next)
2646 int __simpleStruct0, __simpleStruct1;
2647 unsigned int addSize = ComputeTypeSize(member);
2649 member->offset = size;
2650 if(member->alignment && size % member->alignment)
2651 member->offset += member->alignment - (size % member->alignment);
2652 size = member->offset;
2653 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2654 size = ((size > addSize) ? size : addSize);
2656 if(type->alignment && size % type->alignment)
2657 size += type->alignment - (size % type->alignment);
2662 struct TemplateParameter * param = type->templateParameter;
2663 struct Type * baseType = ProcessTemplateParameterType(param);
2666 size = ComputeTypeSize(baseType);
2668 size = sizeof(uint64);
2681 size = targetBits / 8;
2686 type->computing = 0x0;
2691 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2693 extern struct Identifier * MkIdentifier(char * string);
2695 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2697 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2699 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2701 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2703 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2705 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2707 extern void FreeType(struct Type * type);
2709 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2711 extern struct Specifier * MkSpecifier(int specifier);
2713 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2715 extern struct Expression * MkExpConstant(char * string);
2717 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)
2719 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2720 unsigned int totalSize = 0;
2721 unsigned int maxSize = 0;
2722 int alignment, size;
2723 struct __ecereNameSpace__ecere__com__DataMember * member;
2724 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2726 if(!isMember && _class->base)
2728 maxSize = _class->structSize;
2730 if(_class->type == 1 || _class->type == 5)
2731 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2733 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2736 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2738 if(!member->isProperty)
2740 switch(member->type)
2744 if(member->dataTypeString)
2746 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2747 struct Declarator * decl;
2749 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2750 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2751 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2752 if(!member->dataType)
2753 member->dataType = ProcessType(specs, decl);
2754 ReplaceThisClassSpecifiers(specs, topClass);
2756 struct Type * type = ProcessType(specs, decl);
2758 DeclareType(member->dataType, 0x0, 0x0);
2761 ComputeTypeSize(member->dataType);
2762 size = member->dataType->size;
2763 alignment = member->dataType->alignment;
2766 if(totalSize % alignment)
2767 totalSize += alignment - (totalSize % alignment);
2776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2779 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2780 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2781 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2782 alignment = member->structAlignment;
2785 if(totalSize % alignment)
2786 totalSize += alignment - (totalSize % alignment);
2796 unsigned int __simpleStruct0;
2798 if(topMember && topMember->type == 1)
2799 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2801 *retSize += totalSize;
2803 else if(totalSize < maxSize && _class->type != 1000)
2805 char sizeString[50];
2807 sprintf(sizeString, "%d", maxSize - totalSize);
2808 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2811 FinishTemplatesContext(context);
2812 return topMember ? topMember->memberID : _class->memberID;
2815 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2817 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2818 unsigned int totalSize = 0;
2819 struct __ecereNameSpace__ecere__com__DataMember * member;
2820 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2822 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2823 DeclareMembers(_class->base, 0x0);
2824 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2826 if(!member->isProperty)
2828 switch(member->type)
2832 if(!member->dataType && member->dataTypeString)
2833 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2834 if(member->dataType)
2835 DeclareType(member->dataType, 0x0, 0x0);
2841 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2848 FinishTemplatesContext(context);
2849 return topMember ? topMember->memberID : _class->memberID;
2852 extern struct Symbol * FindClass(char * name);
2854 extern char * strchr(char * , int);
2856 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2858 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2860 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2862 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2864 extern char * strcpy(char * , const char * );
2866 extern void MangleClassName(char * className);
2868 extern void DeclareClass(struct Symbol * classSym, char * className);
2870 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2872 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2874 void DeclareStruct(char * name, unsigned int skipNoHead)
2876 struct External * external = (((void *)0));
2877 struct Symbol * classSym = FindClass(name);
2879 if(!inCompiler || !classSym)
2880 return (((void *)0));
2881 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2882 return (((void *)0));
2883 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2885 struct Declaration * decl;
2886 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2887 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2888 char structName[1024];
2890 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2891 classSym->declaring++;
2892 if(strchr(classSym->string, '<'))
2894 if(classSym->registered->templateClass)
2896 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2897 classSym->declaring--;
2899 return (((void *)0));
2901 DeclareMembers(classSym->registered, 0x0);
2902 structName[0] = (char)0;
2903 FullClassNameCat(structName, name, 0x0);
2906 classSym->declaredStructSym = 0x1;
2907 declarations = MkList();
2908 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2909 if(!(*declarations).count)
2911 FreeList(declarations, (((void *)0)));
2912 declarations = (((void *)0));
2915 if(skipNoHead || declarations)
2917 if(external && external->declaration)
2919 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2920 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2922 if(classSym->structExternal)
2923 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2924 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2925 classSym->id = curExternal->symbol->idCode;
2926 classSym->idCode = curExternal->symbol->idCode;
2932 external = MkExternalDeclaration((((void *)0)));
2933 specifiers = MkList();
2934 declarators = MkList();
2935 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2936 external->declaration = decl = MkDeclaration(specifiers, declarators);
2937 if(decl->symbol && !decl->symbol->pointerExternal)
2938 decl->symbol->pointerExternal = external;
2939 if(classSym->registered && classSym->registered->type == 1)
2941 char className[1024];
2943 strcpy(className, "__ecereClass_");
2944 FullClassNameCat(className, classSym->string, 0x1);
2945 MangleClassName(className);
2946 DeclareClass(classSym, className);
2947 external->symbol = classSym;
2948 classSym->pointerExternal = external;
2949 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2950 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2954 char className[1024];
2956 strcpy(className, "__ecereClass_");
2957 FullClassNameCat(className, classSym->string, 0x1);
2958 MangleClassName(className);
2959 classSym->structExternal = external;
2960 DeclareClass(classSym, className);
2961 external->symbol = classSym;
2963 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2966 classSym->declaring--;
2968 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2970 classSym->declaring++;
2972 if(classSym->registered)
2973 DeclareMembers(classSym->registered, 0x0);
2975 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2977 if(classSym->structExternal)
2978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2980 classSym->id = curExternal->symbol->idCode;
2981 classSym->idCode = curExternal->symbol->idCode;
2983 classSym->declaring--;
2987 extern char * strcat(char * , const char * );
2989 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2991 extern struct ModuleImport * mainModule;
2993 extern struct Specifier * MkSpecifierName(char * name);
2995 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2997 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2999 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3001 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3003 extern void FreeDeclarator(struct Declarator * decl);
3005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3007 struct PropertyImport
3009 struct PropertyImport * prev;
3010 struct PropertyImport * next;
3012 unsigned int isVirtual;
3013 unsigned int hasSet;
3014 unsigned int hasGet;
3015 } __attribute__ ((gcc_struct));
3017 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3019 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3021 void * __ecereTemp1;
3022 struct Symbol * symbol = prop->symbol;
3023 char propName[1024];
3025 strcpy(setName, "__ecereProp_");
3026 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3027 strcat(setName, "_Set_");
3028 FullClassNameCat(setName, prop->name, 0x1);
3029 strcpy(getName, "__ecereProp_");
3030 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3031 strcat(getName, "_Get_");
3032 FullClassNameCat(getName, prop->name, 0x1);
3033 strcpy(propName, "__ecereProp_");
3034 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3035 strcat(propName, "_");
3036 FullClassNameCat(propName, prop->name, 0x1);
3037 MangleClassName(getName);
3038 MangleClassName(setName);
3039 MangleClassName(propName);
3040 if(prop->_class->type == 1)
3041 DeclareStruct(prop->_class->fullName, 0x0);
3042 if(!symbol || curExternal->symbol->idCode < symbol->id)
3044 unsigned int imported = 0x0;
3045 unsigned int dllImport = 0x0;
3047 if(!symbol || symbol->_import)
3051 struct Symbol * classSym;
3053 if(!prop->_class->symbol)
3054 prop->_class->symbol = FindClass(prop->_class->fullName);
3055 classSym = prop->_class->symbol;
3056 if(classSym && !classSym->_import)
3058 struct ModuleImport * module;
3060 if(prop->_class->module)
3061 module = FindModule(prop->_class->module);
3063 module = mainModule;
3064 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));
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3067 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3068 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));
3070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3073 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3078 struct Context * context = SetupTemplatesContext(prop->_class);
3080 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3081 FinishTemplatesContext(context);
3085 if(!symbol->externalGet || symbol->externalGet->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;
3094 unsigned int simple = 0x0;
3096 specifiers = MkList();
3097 declarators = MkList();
3099 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3100 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3102 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3104 struct Context * context = SetupTemplatesContext(prop->_class);
3106 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3107 FinishTemplatesContext(context);
3109 for(spec = (*specifiers).first; spec; spec = spec->next)
3113 if((!typeDecl || typeDecl->type == 1))
3115 struct Symbol * classSym = spec->symbol;
3117 symbol->_class = classSym->registered;
3118 if(classSym->registered && classSym->registered->type == 1)
3120 DeclareStruct(spec->name, 0x0);
3127 d = PlugDeclarator(typeDecl, d);
3130 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3131 specifiers = MkList();
3133 d = MkDeclaratorFunction(d, params);
3135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3136 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3139 ListAdd(specifiers, MkSpecifier(VOID));
3140 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3141 decl = MkDeclaration(specifiers, declarators);
3142 external = MkExternalDeclaration(decl);
3143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3144 external->symbol = symbol;
3145 symbol->externalGet = external;
3146 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3148 FreeDeclarator(typeDecl);
3152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3157 if(!symbol->externalSet || symbol->externalSet->type == 0)
3159 struct Declaration * decl;
3160 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3161 struct Declarator * d;
3162 struct __ecereNameSpace__ecere__sys__OldList * params;
3163 struct Specifier * spec;
3164 struct External * external;
3165 struct Declarator * typeDecl;
3167 declarators = MkList();
3169 if(!prop->conversion || prop->_class->type == 1)
3171 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3173 specifiers = MkList();
3175 struct Context * context = SetupTemplatesContext(prop->_class);
3177 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3178 FinishTemplatesContext(context);
3180 ListAdd(params, MkTypeName(specifiers, d));
3181 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3183 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3184 d = MkDeclaratorFunction(d, params);
3185 for(spec = (*specifiers).first; spec; spec = spec->next)
3189 if((!typeDecl || typeDecl->type == 1))
3191 struct Symbol * classSym = spec->symbol;
3193 symbol->_class = classSym->registered;
3194 if(classSym->registered && classSym->registered->type == 1)
3195 DeclareStruct(spec->name, 0x0);
3199 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3200 specifiers = MkList();
3202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3203 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3205 if(!prop->conversion || prop->_class->type == 1)
3206 ListAdd(specifiers, MkSpecifier(VOID));
3208 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3209 decl = MkDeclaration(specifiers, declarators);
3210 external = MkExternalDeclaration(decl);
3211 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3212 external->symbol = symbol;
3213 symbol->externalSet = external;
3214 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3221 if(!symbol->externalPtr)
3223 struct Declaration * decl;
3224 struct External * external;
3225 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3231 ListAdd(specifiers, MkSpecifierName("Property"));
3233 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3235 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3238 strcpy(propName, "__ecerePropM_");
3239 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3240 strcat(propName, "_");
3241 FullClassNameCat(propName, prop->name, 0x1);
3242 MangleClassName(propName);
3243 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3245 decl = MkDeclaration(specifiers, list);
3247 external = MkExternalDeclaration(decl);
3248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3249 external->symbol = symbol;
3250 symbol->externalPtr = external;
3254 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3256 symbol->id = curExternal->symbol->idCode;
3260 struct Type * Dereference(struct Type * source)
3262 void * __ecereTemp1;
3263 struct Type * type = (((void *)0));
3267 if(source->kind == 13 || source->kind == 12)
3269 type = source->type;
3270 source->type->refCount++;
3272 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3274 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3276 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3282 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3287 static struct Type * Reference(struct Type * source)
3289 void * __ecereTemp1;
3290 struct Type * type = (((void *)0));
3294 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));
3300 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);
3302 extern void * memcpy(void * , const void * , unsigned int size);
3304 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3306 extern void FreeExpression(struct Expression * exp);
3308 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3310 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);
3312 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3314 extern struct Type * MkClassType(char * name);
3316 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);
3318 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)
3320 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3321 unsigned int found = 0x0;
3322 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3323 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3324 unsigned int freeType = 0x0;
3326 yylloc = member->loc;
3331 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3335 dataMember = *curMember;
3341 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3342 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3343 int _subMemberStackPos = 0;
3346 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3349 dataMember = thisMember;
3350 if(curMember && thisMember->memberAccess == 1)
3352 *curMember = thisMember;
3353 *curClass = thisMember->_class;
3354 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3355 *subMemberStackPos = _subMemberStackPos;
3361 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3362 if(method && method->type == 1)
3365 method = (((void *)0));
3370 struct Type * type = (((void *)0));
3374 if(!dataMember->dataType && dataMember->dataTypeString)
3376 struct Context * context = SetupTemplatesContext(_class);
3378 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3379 FinishTemplatesContext(context);
3381 type = dataMember->dataType;
3385 if(!method->dataType)
3386 ProcessMethodType(method);
3387 type = method->dataType;
3389 if(ident && ident->next)
3391 for(ident = ident->next; ident && type; ident = ident->next)
3395 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3397 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3399 type = dataMember->dataType;
3401 else if(type->kind == 9 || type->kind == 10)
3403 struct Type * memberType;
3405 for(memberType = type->members.first; memberType; memberType = memberType->next)
3407 if(!strcmp(memberType->name, ident->string))
3416 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3419 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3420 struct __ecereNameSpace__ecere__com__Class * sClass;
3422 for(sClass = _class; sClass; sClass = sClass->base)
3425 if(sClass->templateClass)
3426 sClass = sClass->templateClass;
3427 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3429 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3431 for(sClass = sClass->base; sClass; sClass = sClass->base)
3433 if(sClass->templateClass)
3434 sClass = sClass->templateClass;
3435 id += sClass->templateParams.count;
3446 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3448 if(arg.dataTypeString)
3450 type = ProcessTypeString(arg.dataTypeString, 0x0);
3452 if(type && _class->templateClass)
3453 type->passAsTemplate = 0x1;
3460 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3462 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3463 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3467 char templateString[1024];
3468 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3470 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3471 for(cClass = expClass; cClass; cClass = cClass->base)
3475 if(cClass->templateClass)
3476 cClass = cClass->templateClass;
3477 for(param = cClass->templateParams.first; param; param = param->next)
3480 struct __ecereNameSpace__ecere__com__Class * sClass;
3481 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3483 for(sClass = cClass->base; sClass; sClass = sClass->base)
3485 if(sClass->templateClass)
3486 sClass = sClass->templateClass;
3487 id += sClass->templateParams.count;
3489 arg = expClass->templateArgs[id];
3490 for(sClass = _class; sClass; sClass = sClass->base)
3492 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3494 struct __ecereNameSpace__ecere__com__Class * nextClass;
3496 if(sClass->templateClass)
3497 sClass = sClass->templateClass;
3498 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3500 if(nextClass->templateClass)
3501 nextClass = nextClass->templateClass;
3502 p += nextClass->templateParams.count;
3504 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3506 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3508 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3510 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3511 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3525 char expString[1024];
3526 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3527 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3528 struct Expression * exp;
3529 char * string = PrintHexUInt64(arg.expression.ui64);
3531 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3532 ProcessExpressionType(exp);
3533 ComputeExpression(exp);
3534 expString[0] = '\0';
3535 PrintExpression(exp, expString);
3536 strcat(argument, expString);
3537 FreeExpression(exp);
3542 strcat(argument, arg.member->name);
3547 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3548 strcat(argument, arg.dataTypeString);
3555 strcat(templateString, ", ");
3556 if(lastParam != p - 1)
3558 strcat(templateString, param->name);
3559 strcat(templateString, " = ");
3561 strcat(templateString, argument);
3570 int len = strlen(templateString);
3572 if(templateString[len - 1] == '<')
3576 if(templateString[len - 1] == '>')
3577 templateString[len++] = ' ';
3578 templateString[len++] = '>';
3580 templateString[len++] = '\0';
3583 struct Context * context = SetupTemplatesContext(_class);
3587 type = ProcessTypeString(templateString, 0x0);
3589 FinishTemplatesContext(context);
3592 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3594 ProcessExpressionType(member->initializer->exp);
3595 if(!member->initializer->exp->expType)
3599 char expString[10240];
3601 expString[0] = '\0';
3602 PrintExpression(member->initializer->exp, expString);
3603 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3607 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3609 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3612 else if(member->initializer)
3614 ProcessInitializer(member->initializer, type);
3621 if(_class && _class->type == 3)
3623 if(member->initializer)
3625 struct Type * type = MkClassType(_class->fullName);
3627 ProcessInitializer(member->initializer, type);
3633 if(member->initializer)
3635 ProcessInitializer(member->initializer, (((void *)0)));
3641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3645 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3647 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3651 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3656 extern struct Identifier * GetDeclId(struct Declarator * decl);
3658 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);
3660 extern void FreeSpecifier(struct Specifier * spec);
3662 static void ProcessFunction(struct FunctionDefinition * function);
3664 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3666 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3668 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3670 extern void FreeClassFunction(struct ClassFunction * func);
3672 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3674 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3676 void ProcessInstantiationType(struct Instantiation * inst)
3681 struct MembersInit * members;
3682 struct Symbol * classSym;
3683 struct __ecereNameSpace__ecere__com__Class * _class;
3685 classSym = inst->_class->symbol;
3686 _class = classSym ? classSym->registered : (((void *)0));
3687 if(!_class || _class->type != 5)
3688 DeclareStruct(inst->_class->name, 0x0);
3689 afterExternal = afterExternal ? afterExternal : curExternal;
3691 ProcessExpressionType(inst->exp);
3692 inst->isConstant = 0x1;
3695 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3696 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3697 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3698 int subMemberStackPos = 0;
3700 for(members = (*inst->members).first; members; members = members->next)
3702 switch(members->type)
3707 static unsigned int instMethodID = 0;
3708 struct External * external = curExternal;
3709 struct Context * context = curContext;
3710 struct Declarator * declarator = members->function->declarator;
3711 struct Identifier * nameID = GetDeclId(declarator);
3712 char * unmangled = nameID ? nameID->string : (((void *)0));
3713 struct Expression * exp;
3714 struct External * createdExternal = (((void *)0));
3720 strcpy(name, "__ecereInstMeth_");
3721 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3723 strcat(name, nameID->string);
3725 sprintf(number, "_%08d", instMethodID++);
3726 strcat(name, number);
3727 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3731 struct Symbol * symbol = declarator->symbol;
3732 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3734 if(method && method->type == 1)
3736 symbol->method = method;
3737 ProcessMethodType(method);
3738 if(!symbol->type->thisClass)
3740 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3742 if(!currentClass->symbol)
3743 currentClass->symbol = FindClass(currentClass->fullName);
3744 symbol->type->thisClass = currentClass->symbol;
3749 _class->symbol = FindClass(_class->fullName);
3750 symbol->type->thisClass = _class->symbol;
3753 DeclareType(symbol->type, 0x1, 0x1);
3757 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3760 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3763 FreeSpecifier(nameID->_class);
3764 nameID->_class = (((void *)0));
3768 struct Type * type = declarator->symbol->type;
3769 struct External * oldExternal = curExternal;
3771 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3773 struct External * externalDecl;
3775 externalDecl = MkExternalDeclaration((((void *)0)));
3776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3777 if(createdExternal->function)
3779 ProcessFunction(createdExternal->function);
3781 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3783 externalDecl->declaration = decl;
3784 if(decl->symbol && !decl->symbol->pointerExternal)
3785 decl->symbol->pointerExternal = externalDecl;
3786 declarator->symbol->pointerExternal = externalDecl;
3793 curExternal = declarator->symbol->pointerExternal;
3794 ProcessFunction((struct FunctionDefinition *)members->function);
3796 curExternal = external;
3797 curContext = context;
3800 FreeClassFunction(members->function);
3801 exp = QMkExpId(name);
3803 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3804 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3810 if(members->dataMembers && classSym)
3812 struct MemberInit * member;
3813 struct Location oldyyloc = yylloc;
3815 for(member = (*members->dataMembers).first; member; member = member->next)
3817 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3818 if(member->initializer && !member->initializer->isConstant)
3819 inst->isConstant = 0x0;
3831 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3835 if(type->kind == 11)
3837 struct Type * param;
3841 for(param = type->params.first; param; param = param->next)
3842 DeclareType(param, declarePointers, 0x1);
3844 DeclareType(type->returnType, declarePointers, 0x1);
3846 else if(type->kind == 13 && declarePointers)
3847 DeclareType(type->type, declarePointers, 0x0);
3848 else if(type->kind == 8)
3850 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3851 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3853 else if(type->kind == 9 || type->kind == 10)
3855 struct Type * member;
3857 for(member = type->members.first; member; member = member->next)
3858 DeclareType(member, 0x0, 0x0);
3860 else if(type->kind == 12)
3861 DeclareType(type->arrayType, declarePointers, 0x0);
3865 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3867 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3871 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3872 struct __ecereNameSpace__ecere__com__Class * sClass;
3874 for(sClass = _class; sClass; sClass = sClass->base)
3877 if(sClass->templateClass)
3878 sClass = sClass->templateClass;
3879 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3881 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3883 for(sClass = sClass->base; sClass; sClass = sClass->base)
3885 if(sClass->templateClass)
3886 sClass = sClass->templateClass;
3887 id += sClass->templateParams.count;
3898 arg = &_class->templateArgs[id];
3899 if(arg && param->type == 0)
3900 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3905 extern struct Context * PushContext(void);
3907 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3909 struct TemplatedType
3912 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3913 struct __ecereNameSpace__ecere__sys__BTNode * left;
3914 struct __ecereNameSpace__ecere__sys__BTNode * right;
3916 struct TemplateParameter * param;
3917 } __attribute__ ((gcc_struct));
3919 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3921 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3923 void * __ecereTemp1;
3924 struct Context * context = PushContext();
3926 context->templateTypesOnly = 0x1;
3927 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3929 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3931 for(; param; param = param->next)
3933 if(param->type == 0 && param->identifier)
3935 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3937 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3943 struct __ecereNameSpace__ecere__com__Class * sClass;
3945 for(sClass = _class; sClass; sClass = sClass->base)
3947 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3949 for(p = sClass->templateParams.first; p; p = p->next)
3953 struct TemplateParameter * param = p->param;
3954 struct TemplatedType * type;
3958 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));
3960 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));
3961 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3969 extern void PopContext(struct Context * ctx);
3971 extern void FreeContext(struct Context * context);
3973 void FinishTemplatesContext(struct Context * context)
3975 PopContext(context);
3976 FreeContext(context);
3977 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3980 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3982 if(!method->dataType)
3984 struct Context * context = SetupTemplatesContext(method->_class);
3986 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3987 FinishTemplatesContext(context);
3988 if(method->type != 1 && method->dataType)
3990 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3992 if(!method->_class->symbol)
3993 method->_class->symbol = FindClass(method->_class->fullName);
3994 method->dataType->thisClass = method->_class->symbol;
4000 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4004 struct Context * context = SetupTemplatesContext(prop->_class);
4006 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4007 FinishTemplatesContext(context);
4011 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4013 extern void FreeTypeName(struct TypeName * typeName);
4015 static void ProcessDeclarator(struct Declarator * decl);
4017 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4019 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4023 struct MethodImport * prev;
4024 struct MethodImport * next;
4026 unsigned int isVirtual;
4027 } __attribute__ ((gcc_struct));
4029 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4031 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4033 void * __ecereTemp1;
4034 struct Symbol * symbol = method->symbol;
4036 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4038 unsigned int imported = 0x0;
4039 unsigned int dllImport = 0x0;
4041 if(!method->dataType)
4042 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4043 if(!symbol || symbol->_import || method->type == 1)
4045 if(!symbol || method->type == 1)
4047 struct Symbol * classSym;
4049 if(!method->_class->symbol)
4050 method->_class->symbol = FindClass(method->_class->fullName);
4051 classSym = method->_class->symbol;
4052 if(!classSym->_import)
4054 struct ModuleImport * module;
4056 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4057 module = FindModule(method->_class->module);
4059 module = mainModule;
4060 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));
4061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4065 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4067 if(!symbol->_import)
4069 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));
4070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4074 symbol->type = method->dataType;
4076 symbol->type->refCount++;
4079 if(!method->dataType->dllExport)
4082 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4086 if(method->type != 1 && method->dataType)
4087 DeclareType(method->dataType, 0x1, 0x1);
4088 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4090 struct Declaration * decl;
4091 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4092 struct Declarator * d;
4093 struct Declarator * funcDecl;
4094 struct External * external;
4096 specifiers = MkList();
4097 declarators = MkList();
4099 ListAdd(specifiers, MkSpecifier(EXTERN));
4100 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4101 ListAdd(specifiers, MkSpecifier(STATIC));
4102 if(method->type == 1)
4104 ListAdd(specifiers, MkSpecifier(INT));
4105 d = MkDeclaratorIdentifier(MkIdentifier(name));
4109 d = MkDeclaratorIdentifier(MkIdentifier(name));
4111 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4113 struct Context * context = SetupTemplatesContext(method->_class);
4115 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4116 FinishTemplatesContext(context);
4118 funcDecl = GetFuncDecl(d);
4121 struct Specifier * spec, * next;
4123 for(spec = (*specifiers).first; spec; spec = next)
4128 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4129 FreeSpecifier(spec);
4133 if(method->dataType && !method->dataType->staticMethod)
4135 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4137 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4138 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")));
4139 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4140 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4142 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4144 struct TypeName * param = (*funcDecl->function.parameters).first;
4146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4147 FreeTypeName(param);
4149 if(!funcDecl->function.parameters)
4150 funcDecl->function.parameters = MkList();
4151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4155 ProcessDeclarator(d);
4156 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4157 decl = MkDeclaration(specifiers, declarators);
4158 ReplaceThisClassSpecifiers(specifiers, method->_class);
4159 if(symbol->pointerExternal)
4161 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4164 *functionSymbol = *symbol;
4165 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4166 if(functionSymbol->type)
4167 functionSymbol->type->refCount++;
4169 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4170 symbol->pointerExternal->symbol = functionSymbol;
4172 external = MkExternalDeclaration(decl);
4174 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4175 external->symbol = symbol;
4176 symbol->pointerExternal = external;
4180 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4182 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4186 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4188 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4190 unsigned int first = 0x1;
4192 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4194 char className[1024];
4196 strcpy(className, _class->fullName);
4197 for(param = _class->templateParams.first; param; param = param->next)
4201 strcat(className, "<");
4203 strcat(className, ", ");
4204 if(lastParam + 1 != p)
4206 strcat(className, param->name);
4207 strcat(className, " = ");
4209 strcat(className, param->name);
4217 int len = strlen(className);
4219 if(className[len - 1] == '>')
4220 className[len++] = ' ';
4221 className[len++] = '>';
4222 className[len++] = '\0';
4224 return __ecereNameSpace__ecere__sys__CopyString(className);
4227 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4230 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4232 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4234 unsigned int first = 0x1;
4236 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4238 char className[1024];
4240 strcpy(className, _class->fullName);
4241 for(param = _class->templateParams.first; param; param = param->next)
4245 strcat(className, "<");
4247 strcat(className, ", ");
4248 if(lastParam + 1 != p)
4250 strcat(className, param->name);
4251 strcat(className, " = ");
4253 strcat(className, param->name);
4261 int len = strlen(className);
4263 if(className[len - 1] == '>')
4264 className[len++] = ' ';
4265 className[len++] = '>';
4266 className[len++] = '\0';
4268 return MkClassType(className);
4272 return MkClassType(_class->fullName);
4276 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4278 if(specs != (((void *)0)) && _class)
4280 struct Specifier * spec;
4282 for(spec = specs->first; spec; spec = spec->next)
4284 if(spec->type == 0 && spec->specifier == THISCLASS)
4287 spec->name = ReplaceThisClass(_class);
4288 spec->symbol = FindClass(spec->name);
4294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4296 struct __ecereNameSpace__ecere__com__GlobalFunction
4298 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4299 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4302 struct __ecereNameSpace__ecere__com__Instance * module;
4303 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4304 char * dataTypeString;
4305 struct Type * dataType;
4307 } __attribute__ ((gcc_struct));
4309 extern struct Context * globalContext;
4311 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4313 struct FunctionImport
4315 struct FunctionImport * prev;
4316 struct FunctionImport * next;
4318 } __attribute__ ((gcc_struct));
4320 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4322 void * __ecereTemp1;
4323 struct Symbol * symbol = function->symbol;
4325 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4327 unsigned int imported = 0x0;
4328 unsigned int dllImport = 0x0;
4330 if(!function->dataType)
4332 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4333 if(!function->dataType->thisClass)
4334 function->dataType->staticMethod = 0x1;
4340 struct ModuleImport * module = FindModule(function->module);
4342 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4345 if(!function->dataType->dllExport)
4347 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));
4348 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4352 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4353 if(!symbol->type->thisClass)
4354 symbol->type->staticMethod = 0x1;
4357 imported = symbol->_import ? 0x1 : 0x0;
4358 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4361 DeclareType(function->dataType, 0x1, 0x1);
4364 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4366 struct Declaration * decl;
4367 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4368 struct Declarator * d;
4369 struct Declarator * funcDecl;
4370 struct External * external;
4372 specifiers = MkList();
4373 declarators = MkList();
4374 ListAdd(specifiers, MkSpecifier(EXTERN));
4375 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4377 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4378 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4379 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4381 struct Specifier * spec;
4383 for(spec = (*specifiers).first; spec; spec = spec->next)
4384 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4386 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4387 FreeSpecifier(spec);
4391 funcDecl = GetFuncDecl(d);
4392 if(funcDecl && !funcDecl->function.parameters)
4394 funcDecl->function.parameters = MkList();
4395 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4397 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4399 struct Context * oldCtx = curContext;
4401 curContext = globalContext;
4402 decl = MkDeclaration(specifiers, declarators);
4403 curContext = oldCtx;
4405 if(symbol->pointerExternal)
4407 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4410 *functionSymbol = *symbol;
4411 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4412 if(functionSymbol->type)
4413 functionSymbol->type->refCount++;
4415 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4416 symbol->pointerExternal->symbol = functionSymbol;
4418 external = MkExternalDeclaration(decl);
4420 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4421 external->symbol = symbol;
4422 symbol->pointerExternal = external;
4426 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4429 symbol->id = curExternal->symbol->idCode;
4432 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4435 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4440 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4441 struct __ecereNameSpace__ecere__sys__BTNode * left;
4442 struct __ecereNameSpace__ecere__sys__BTNode * right;
4444 struct __ecereNameSpace__ecere__com__Instance * module;
4445 char * dataTypeString;
4446 struct Type * dataType;
4449 } __attribute__ ((gcc_struct));
4451 void DeclareGlobalData(struct GlobalData * data)
4453 struct Symbol * symbol = data->symbol;
4455 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4460 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4463 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4464 DeclareType(data->dataType, 0x1, 0x1);
4467 if(!symbol->pointerExternal)
4469 struct Declaration * decl;
4470 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4471 struct Declarator * d;
4472 struct External * external;
4474 specifiers = MkList();
4475 declarators = MkList();
4476 ListAdd(specifiers, MkSpecifier(EXTERN));
4477 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4478 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4479 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4480 decl = MkDeclaration(specifiers, declarators);
4481 external = MkExternalDeclaration(decl);
4483 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4484 external->symbol = symbol;
4485 symbol->pointerExternal = external;
4489 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4492 symbol->id = curExternal->symbol->idCode;
4499 struct Conversion * prev, * next;
4500 struct __ecereNameSpace__ecere__com__Property * convert;
4502 struct Type * resultType;
4503 } __attribute__ ((gcc_struct));
4505 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4507 extern void Compiler_Warning(char * format, ...);
4509 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4511 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)
4515 if(source->kind == 20 && dest->kind != 20)
4517 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4522 if(dest->kind == 20 && source->kind != 20)
4524 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4529 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4533 if(source->classObjectType == 3 && dest->classObjectType != 2)
4537 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4539 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4542 if(dest->kind == 14 && source->kind != 0)
4544 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))
4546 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))
4548 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4550 if(source->_class->registered && source->_class->registered->type == 3)
4552 if(conversions != (((void *)0)))
4554 if(source->_class->registered == dest->_class->registered)
4559 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4561 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4563 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4565 if(sourceBase == destBase)
4569 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))
4573 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4575 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4582 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4586 if(source->kind == 8)
4588 struct __ecereNameSpace__ecere__com__Class * _class;
4590 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4592 struct __ecereNameSpace__ecere__com__Property * convert;
4594 for(convert = _class->conversions.first; convert; convert = convert->next)
4596 if(convert->memberAccess == 1 || _class->module == privateModule)
4598 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4600 if(!convert->dataType)
4601 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4602 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4604 if(!conversions && !convert->Get)
4606 else if(conversions != (((void *)0)))
4608 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))
4612 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4614 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4625 struct __ecereNameSpace__ecere__com__Class * _class;
4627 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4629 struct __ecereNameSpace__ecere__com__Property * convert;
4631 for(convert = _class->conversions.first; convert; convert = convert->next)
4633 if(convert->memberAccess == 1 || _class->module == privateModule)
4635 if(!convert->dataType)
4636 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4637 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4639 if(!conversions && !convert->Set)
4641 else if(conversions != (((void *)0)))
4643 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))
4647 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4649 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4657 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4659 if(!dest->_class->registered->dataType)
4660 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4661 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4663 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4670 if(source->kind == 8)
4672 struct __ecereNameSpace__ecere__com__Class * _class;
4674 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4676 struct __ecereNameSpace__ecere__com__Property * convert;
4678 for(convert = _class->conversions.first; convert; convert = convert->next)
4680 if(convert->memberAccess == 1 || _class->module == privateModule)
4682 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4684 if(!convert->dataType)
4685 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4686 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4688 if(!conversions && !convert->Get)
4690 else if(conversions != (((void *)0)))
4692 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))
4696 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4698 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4706 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4708 if(!source->_class->registered->dataType)
4709 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4710 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4717 if(source->kind == 8 || source->kind == 19)
4719 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4721 else if(dest->kind == 7 && source->kind == 6)
4723 else if(dest->kind == 2 && source->kind == 1)
4725 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4727 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4729 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4731 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4733 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4735 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)))
4737 struct Type * paramSource, * paramDest;
4739 if(dest->kind == 16)
4740 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4741 if(source->kind == 16)
4742 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4743 if(dest->kind == 13 && dest->type->kind == 11)
4745 if(source->kind == 13 && source->type->kind == 11)
4746 source = source->type;
4747 if(dest->kind == 16)
4748 dest = dest->method->dataType;
4749 if(source->kind == 16)
4750 source = source->method->dataType;
4751 paramSource = source->params.first;
4752 if(paramSource && paramSource->kind == 0)
4753 paramSource = (((void *)0));
4754 paramDest = dest->params.first;
4755 if(paramDest && paramDest->kind == 0)
4756 paramDest = (((void *)0));
4757 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4759 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))))
4761 if(paramDest && paramDest->kind == 8)
4762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4767 paramDest = paramDest->next;
4769 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4771 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4775 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4777 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4783 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4786 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4788 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4792 paramSource = paramSource->next;
4798 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4800 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4806 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4814 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4816 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4819 for(; paramDest; paramDest = paramDest->next)
4823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4827 struct Type * paramDestType = paramDest;
4828 struct Type * paramSourceType = paramSource;
4829 struct Type * type = paramDestType;
4831 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4834 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4835 struct __ecereNameSpace__ecere__com__Class * sClass;
4837 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4840 if(sClass->templateClass)
4841 sClass = sClass->templateClass;
4842 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4844 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4846 for(sClass = sClass->base; sClass; sClass = sClass->base)
4848 if(sClass->templateClass)
4849 sClass = sClass->templateClass;
4850 id += sClass->templateParams.count;
4861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4863 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4866 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)))
4871 PrintType(paramDest, type, 0x0, 0x1);
4872 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4873 if(paramDestType != paramDest)
4874 FreeType(paramDestType);
4877 if(paramDestType != paramDest)
4878 FreeType(paramDestType);
4880 paramSource = paramSource->next;
4884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4889 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4893 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4895 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4902 static void FreeConvert(struct Conversion * convert)
4904 if(convert->resultType)
4905 FreeType(convert->resultType);
4908 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4910 struct __ecereNameSpace__ecere__com__BTNamedLink
4913 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4914 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4915 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4918 } __attribute__ ((gcc_struct));
4920 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4922 struct __ecereNameSpace__ecere__com__EnumClassData
4924 struct __ecereNameSpace__ecere__sys__OldList values;
4926 } __attribute__ ((gcc_struct));
4928 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4930 struct __ecereNameSpace__ecere__sys__NamedLink
4932 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4933 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4936 } __attribute__ ((gcc_struct));
4938 extern void FreeExpContents(struct Expression * exp);
4940 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4942 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4944 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4946 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4948 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4950 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4952 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4954 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)))
4956 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4958 if(_class->type == 4)
4960 struct __ecereNameSpace__ecere__sys__OldList converts =
4964 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4968 _class->symbol = FindClass(_class->fullName);
4969 type->_class = _class->symbol;
4970 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4972 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4973 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4977 struct __ecereNameSpace__ecere__com__Class * baseClass;
4979 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4981 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4983 for(value = e->values.first; value; value = value->next)
4985 if(!strcmp(value->name, string))
4990 FreeExpContents(sourceExp);
4991 FreeType(sourceExp->expType);
4992 sourceExp->isConstant = 0x1;
4993 sourceExp->expType = MkClassType(baseClass->fullName);
4997 sourceExp->type = 2;
4998 if(!strcmp(baseClass->dataTypeString, "int"))
4999 sprintf(constant, "%d", value->data);
5001 sprintf(constant, "0x%X", value->data);
5002 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5004 while(converts.first)
5006 struct Conversion * convert = converts.first;
5008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5011 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5018 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5019 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5022 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)))
5023 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5028 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5030 struct __ecereNameSpace__ecere__com__SubModule
5032 struct __ecereNameSpace__ecere__com__SubModule * prev;
5033 struct __ecereNameSpace__ecere__com__SubModule * next;
5034 struct __ecereNameSpace__ecere__com__Instance * module;
5036 } __attribute__ ((gcc_struct));
5038 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5040 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5042 if(searchFor == searchIn)
5044 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5046 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5048 if(ModuleVisibility(subModule->module, searchFor))
5055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5057 struct __ecereNameSpace__ecere__com__Application
5062 unsigned int isGUIApp;
5063 struct __ecereNameSpace__ecere__sys__OldList allModules;
5064 char * parsedCommand;
5065 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5066 } __attribute__ ((gcc_struct));
5068 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5070 struct __ecereNameSpace__ecere__com__Instance * module;
5072 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5074 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5076 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5078 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)
5080 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5086 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5088 void ReadString(char * output, char * string);
5090 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5092 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5094 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5096 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5098 void * __ecereTemp1;
5099 struct Type * source = sourceExp->expType;
5100 struct Type * realDest = dest;
5102 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5104 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5106 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5108 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5110 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5112 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5114 if(sourceBase == destBase)
5120 struct __ecereNameSpace__ecere__sys__OldList * specs;
5121 unsigned int flag = 0x0;
5122 long long value = (((int)0x7fffffff));
5126 if(sourceExp->type == 2)
5128 if(source->isSigned)
5129 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5131 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5133 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5135 if(source->isSigned)
5136 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5138 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5140 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5143 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));
5147 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5149 if(_class && _class->type == 3)
5151 if(source->kind != 8)
5153 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5154 struct Type * tempDest, * tempSource;
5156 for(; _class->base->type != 1000; _class = _class->base)
5159 tempDest = tempType;
5162 _class->symbol = FindClass(_class->fullName);
5163 tempType->_class = _class->symbol;
5164 tempType->truth = dest->truth;
5165 if(tempType->_class)
5166 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5167 FreeType(sourceExp->expType);
5168 sourceExp->expType = dest;
5171 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5174 if(_class && _class->type == 2 && source->kind != 8)
5176 if(!dest->_class->registered->dataType)
5177 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5178 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5181 FreeType(sourceExp->expType);
5182 source = sourceExp->expType = MkClassType(dest->_class->string);
5186 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5188 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5189 struct Declarator * decl;
5192 ReadString(string, sourceExp->string);
5193 decl = SpecDeclFromString(string, specs, (((void *)0)));
5194 FreeExpContents(sourceExp);
5195 FreeType(sourceExp->expType);
5196 sourceExp->type = 26;
5197 sourceExp->_classExp.specifiers = specs;
5198 sourceExp->_classExp.decl = decl;
5199 sourceExp->expType = dest;
5206 else if(source->kind == 8)
5208 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5210 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5214 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5215 struct Type * tempDest, * tempSource;
5217 if(!source->_class->registered->dataType)
5218 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5219 for(; _class->base->type != 1000; _class = _class->base)
5222 tempSource = tempType;
5224 tempType->_class = FindClass(_class->fullName);
5225 tempType->truth = source->truth;
5226 tempType->classObjectType = source->classObjectType;
5227 if(tempType->_class)
5228 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5229 if(conversions->last)
5231 ((struct Conversion *)conversions->last)->resultType = dest;
5234 FreeType(sourceExp->expType);
5235 sourceExp->expType = MkClassType(_class->fullName);
5236 sourceExp->expType->truth = source->truth;
5237 sourceExp->expType->classObjectType = source->classObjectType;
5238 if(!sourceExp->destType)
5240 FreeType(sourceExp->destType);
5241 sourceExp->destType = sourceExp->expType;
5242 if(sourceExp->expType)
5243 sourceExp->expType->refCount++;
5245 if(!_class->dataType)
5246 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5248 dest = MkClassType(source->_class->string);
5249 dest->truth = source->truth;
5250 dest->classObjectType = source->classObjectType;
5252 source = _class->dataType;
5254 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5260 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5269 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5271 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5273 if(_class->type == 0 || _class->type == 5)
5275 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5277 *newExp = *sourceExp;
5278 if(sourceExp->destType)
5279 sourceExp->destType->refCount++;
5280 if(sourceExp->expType)
5281 sourceExp->expType->refCount++;
5282 sourceExp->type = 11;
5283 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5284 sourceExp->cast.exp = newExp;
5285 FreeType(sourceExp->expType);
5286 sourceExp->expType = (((void *)0));
5287 ProcessExpressionType(sourceExp);
5290 FreeType(sourceExp->expType);
5291 sourceExp->expType = dest;
5298 if(!_class->dataType)
5299 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5301 dest = _class->dataType;
5304 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5306 specs = MkListOne(MkSpecifier(DOUBLE));
5308 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5310 specs = MkListOne(MkSpecifier(FLOAT));
5312 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5316 ListAdd(specs, MkSpecifier(UNSIGNED));
5317 ListAdd(specs, MkSpecifier(INT64));
5319 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5323 ListAdd(specs, MkSpecifier(UNSIGNED));
5324 ListAdd(specs, MkSpecifier(INT));
5326 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5330 ListAdd(specs, MkSpecifier(UNSIGNED));
5331 ListAdd(specs, MkSpecifier(SHORT));
5333 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5337 ListAdd(specs, MkSpecifier(UNSIGNED));
5338 ListAdd(specs, MkSpecifier(CHAR));
5347 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))
5349 specs = MkListOne(MkSpecifier(DOUBLE));
5351 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5353 specs = MkListOne(MkSpecifier(FLOAT));
5355 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)))
5359 ListAdd(specs, MkSpecifier(UNSIGNED));
5360 ListAdd(specs, MkSpecifier(CHAR));
5362 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)))))
5366 ListAdd(specs, MkSpecifier(UNSIGNED));
5367 ListAdd(specs, MkSpecifier(SHORT));
5369 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5373 ListAdd(specs, MkSpecifier(UNSIGNED));
5374 ListAdd(specs, MkSpecifier(INT));
5376 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5380 ListAdd(specs, MkSpecifier(UNSIGNED));
5381 ListAdd(specs, MkSpecifier(INT64));
5383 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5385 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5395 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5397 *newExp = *sourceExp;
5398 newExp->prev = (((void *)0));
5399 newExp->next = (((void *)0));
5400 if(sourceExp->destType)
5401 sourceExp->destType->refCount++;
5402 if(sourceExp->expType)
5403 sourceExp->expType->refCount++;
5404 sourceExp->type = 11;
5405 if(realDest->kind == 8)
5407 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5408 FreeList(specs, FreeSpecifier);
5411 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5412 if(newExp->type == 4)
5414 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5417 sourceExp->cast.exp = newExp;
5418 FreeType(sourceExp->expType);
5419 sourceExp->expType = (((void *)0));
5420 ProcessExpressionType(sourceExp);
5423 FreeList(specs, FreeSpecifier);
5430 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5431 sourceExp = (*sourceExp->list).last;
5432 if(sourceExp->type == 0)
5434 struct Identifier * id = sourceExp->identifier;
5438 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5440 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5441 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5445 for(; _class && _class->type == 4; _class = _class->base)
5447 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5448 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5450 for(value = e->values.first; value; value = value->next)
5452 if(!strcmp(value->name, id->string))
5457 FreeExpContents(sourceExp);
5458 FreeType(sourceExp->expType);
5459 sourceExp->isConstant = 0x1;
5460 sourceExp->expType = MkClassType(_class->fullName);
5464 sourceExp->type = 2;
5465 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5466 sprintf(constant, "%d", value->data);
5468 sprintf(constant, "0x%X", value->data);
5469 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5477 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5484 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5486 int value2 = op2->i;
5489 exp->string = PrintInt(op1->i + value2);
5492 exp->expType = op1->type;
5494 op1->type->refCount++;
5499 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5501 unsigned int value2 = op2->ui;
5504 exp->string = PrintUInt(op1->ui + value2);
5507 exp->expType = op1->type;
5509 op1->type->refCount++;
5514 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5516 short value2 = op2->s;
5519 exp->string = PrintShort(op1->s + value2);
5522 exp->expType = op1->type;
5524 op1->type->refCount++;
5529 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5531 unsigned short value2 = op2->us;
5534 exp->string = PrintUShort(op1->us + value2);
5537 exp->expType = op1->type;
5539 op1->type->refCount++;
5544 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5546 char value2 = op2->c;
5549 exp->string = PrintChar(op1->c + value2);
5552 exp->expType = op1->type;
5554 op1->type->refCount++;
5559 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5561 unsigned char value2 = op2->uc;
5564 exp->string = PrintUChar(op1->uc + value2);
5567 exp->expType = op1->type;
5569 op1->type->refCount++;
5574 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5576 float value2 = op2->f;
5579 exp->string = PrintFloat(op1->f + value2);
5582 exp->expType = op1->type;
5584 op1->type->refCount++;
5589 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5591 double value2 = op2->d;
5594 exp->string = PrintDouble(op1->d + value2);
5597 exp->expType = op1->type;
5599 op1->type->refCount++;
5604 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5606 int value2 = op2->i;
5609 exp->string = PrintInt(op1->i - value2);
5612 exp->expType = op1->type;
5614 op1->type->refCount++;
5619 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5621 unsigned int value2 = op2->ui;
5624 exp->string = PrintUInt(op1->ui - value2);
5627 exp->expType = op1->type;
5629 op1->type->refCount++;
5634 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5636 short value2 = op2->s;
5639 exp->string = PrintShort(op1->s - value2);
5642 exp->expType = op1->type;
5644 op1->type->refCount++;
5649 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5651 unsigned short value2 = op2->us;
5654 exp->string = PrintUShort(op1->us - value2);
5657 exp->expType = op1->type;
5659 op1->type->refCount++;
5664 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5666 char value2 = op2->c;
5669 exp->string = PrintChar(op1->c - value2);
5672 exp->expType = op1->type;
5674 op1->type->refCount++;
5679 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5681 unsigned char value2 = op2->uc;
5684 exp->string = PrintUChar(op1->uc - value2);
5687 exp->expType = op1->type;
5689 op1->type->refCount++;
5694 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5696 float value2 = op2->f;
5699 exp->string = PrintFloat(op1->f - value2);
5702 exp->expType = op1->type;
5704 op1->type->refCount++;
5709 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5711 double value2 = op2->d;
5714 exp->string = PrintDouble(op1->d - value2);
5717 exp->expType = op1->type;
5719 op1->type->refCount++;
5724 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5726 int value2 = op2->i;
5729 exp->string = PrintInt(op1->i * value2);
5732 exp->expType = op1->type;
5734 op1->type->refCount++;
5739 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5741 unsigned int value2 = op2->ui;
5744 exp->string = PrintUInt(op1->ui * value2);
5747 exp->expType = op1->type;
5749 op1->type->refCount++;
5754 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5756 short value2 = op2->s;
5759 exp->string = PrintShort(op1->s * value2);
5762 exp->expType = op1->type;
5764 op1->type->refCount++;
5769 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5771 unsigned short value2 = op2->us;
5774 exp->string = PrintUShort(op1->us * value2);
5777 exp->expType = op1->type;
5779 op1->type->refCount++;
5784 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5786 char value2 = op2->c;
5789 exp->string = PrintChar(op1->c * value2);
5792 exp->expType = op1->type;
5794 op1->type->refCount++;
5799 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5801 unsigned char value2 = op2->uc;
5804 exp->string = PrintUChar(op1->uc * value2);
5807 exp->expType = op1->type;
5809 op1->type->refCount++;
5814 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5816 float value2 = op2->f;
5819 exp->string = PrintFloat(op1->f * value2);
5822 exp->expType = op1->type;
5824 op1->type->refCount++;
5829 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5831 double value2 = op2->d;
5834 exp->string = PrintDouble(op1->d * value2);
5837 exp->expType = op1->type;
5839 op1->type->refCount++;
5844 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5846 int value2 = op2->i;
5849 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5852 exp->expType = op1->type;
5854 op1->type->refCount++;
5859 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5861 unsigned int value2 = op2->ui;
5864 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5867 exp->expType = op1->type;
5869 op1->type->refCount++;
5874 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5876 short value2 = op2->s;
5879 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5882 exp->expType = op1->type;
5884 op1->type->refCount++;
5889 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5891 unsigned short value2 = op2->us;
5894 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5897 exp->expType = op1->type;
5899 op1->type->refCount++;
5904 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5906 char value2 = op2->c;
5909 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5912 exp->expType = op1->type;
5914 op1->type->refCount++;
5919 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5921 unsigned char value2 = op2->uc;
5924 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5927 exp->expType = op1->type;
5929 op1->type->refCount++;
5934 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5936 float value2 = op2->f;
5939 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5942 exp->expType = op1->type;
5944 op1->type->refCount++;
5949 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5951 double value2 = op2->d;
5954 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5957 exp->expType = op1->type;
5959 op1->type->refCount++;
5964 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5966 int value2 = op2->i;
5969 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5972 exp->expType = op1->type;
5974 op1->type->refCount++;
5979 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5981 unsigned int value2 = op2->ui;
5984 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5987 exp->expType = op1->type;
5989 op1->type->refCount++;
5994 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5996 short value2 = op2->s;
5999 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6002 exp->expType = op1->type;
6004 op1->type->refCount++;
6009 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6011 unsigned short value2 = op2->us;
6014 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6017 exp->expType = op1->type;
6019 op1->type->refCount++;
6024 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6026 char value2 = op2->c;
6029 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6032 exp->expType = op1->type;
6034 op1->type->refCount++;
6039 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6041 unsigned char value2 = op2->uc;
6044 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6047 exp->expType = op1->type;
6049 op1->type->refCount++;
6054 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6057 exp->string = PrintInt(-op1->i);
6060 exp->expType = op1->type;
6062 op1->type->refCount++;
6067 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6070 exp->string = PrintUInt(-op1->ui);
6073 exp->expType = op1->type;
6075 op1->type->refCount++;
6080 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6083 exp->string = PrintShort(-op1->s);
6086 exp->expType = op1->type;
6088 op1->type->refCount++;
6093 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6096 exp->string = PrintUShort(-op1->us);
6099 exp->expType = op1->type;
6101 op1->type->refCount++;
6106 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6109 exp->string = PrintChar(-op1->c);
6112 exp->expType = op1->type;
6114 op1->type->refCount++;
6119 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6122 exp->string = PrintUChar(-op1->uc);
6125 exp->expType = op1->type;
6127 op1->type->refCount++;
6132 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6135 exp->string = PrintFloat(-op1->f);
6138 exp->expType = op1->type;
6140 op1->type->refCount++;
6145 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6148 exp->string = PrintDouble(-op1->d);
6151 exp->expType = op1->type;
6153 op1->type->refCount++;
6158 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6161 exp->string = PrintInt(++op1->i);
6164 exp->expType = op1->type;
6166 op1->type->refCount++;
6171 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6174 exp->string = PrintUInt(++op1->ui);
6177 exp->expType = op1->type;
6179 op1->type->refCount++;
6184 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6187 exp->string = PrintShort(++op1->s);
6190 exp->expType = op1->type;
6192 op1->type->refCount++;
6197 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6200 exp->string = PrintUShort(++op1->us);
6203 exp->expType = op1->type;
6205 op1->type->refCount++;
6210 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6213 exp->string = PrintChar(++op1->c);
6216 exp->expType = op1->type;
6218 op1->type->refCount++;
6223 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6226 exp->string = PrintUChar(++op1->uc);
6229 exp->expType = op1->type;
6231 op1->type->refCount++;
6236 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6239 exp->string = PrintFloat(++op1->f);
6242 exp->expType = op1->type;
6244 op1->type->refCount++;
6249 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6252 exp->string = PrintDouble(++op1->d);
6255 exp->expType = op1->type;
6257 op1->type->refCount++;
6262 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6265 exp->string = PrintInt(--op1->i);
6268 exp->expType = op1->type;
6270 op1->type->refCount++;
6275 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6278 exp->string = PrintUInt(--op1->ui);
6281 exp->expType = op1->type;
6283 op1->type->refCount++;
6288 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6291 exp->string = PrintShort(--op1->s);
6294 exp->expType = op1->type;
6296 op1->type->refCount++;
6301 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6304 exp->string = PrintUShort(--op1->us);
6307 exp->expType = op1->type;
6309 op1->type->refCount++;
6314 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6317 exp->string = PrintChar(--op1->c);
6320 exp->expType = op1->type;
6322 op1->type->refCount++;
6327 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6330 exp->string = PrintUChar(--op1->uc);
6333 exp->expType = op1->type;
6335 op1->type->refCount++;
6340 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6343 exp->string = PrintFloat(--op1->f);
6346 exp->expType = op1->type;
6348 op1->type->refCount++;
6353 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6356 exp->string = PrintDouble(--op1->d);
6359 exp->expType = op1->type;
6361 op1->type->refCount++;
6366 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6368 int value2 = op2->i;
6371 exp->string = PrintInt(op1->i = value2);
6374 exp->expType = op1->type;
6376 op1->type->refCount++;
6381 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6383 unsigned int value2 = op2->ui;
6386 exp->string = PrintUInt(op1->ui = value2);
6389 exp->expType = op1->type;
6391 op1->type->refCount++;
6396 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6398 short value2 = op2->s;
6401 exp->string = PrintShort(op1->s = value2);
6404 exp->expType = op1->type;
6406 op1->type->refCount++;
6411 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6413 unsigned short value2 = op2->us;
6416 exp->string = PrintUShort(op1->us = value2);
6419 exp->expType = op1->type;
6421 op1->type->refCount++;
6426 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6428 char value2 = op2->c;
6431 exp->string = PrintChar(op1->c = value2);
6434 exp->expType = op1->type;
6436 op1->type->refCount++;
6441 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6443 unsigned char value2 = op2->uc;
6446 exp->string = PrintUChar(op1->uc = value2);
6449 exp->expType = op1->type;
6451 op1->type->refCount++;
6456 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6458 float value2 = op2->f;
6461 exp->string = PrintFloat(op1->f = value2);
6464 exp->expType = op1->type;
6466 op1->type->refCount++;
6471 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6473 double value2 = op2->d;
6476 exp->string = PrintDouble(op1->d = value2);
6479 exp->expType = op1->type;
6481 op1->type->refCount++;
6486 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6488 int value2 = op2->i;
6491 exp->string = PrintInt(op1->i += value2);
6494 exp->expType = op1->type;
6496 op1->type->refCount++;
6501 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6503 unsigned int value2 = op2->ui;
6506 exp->string = PrintUInt(op1->ui += value2);
6509 exp->expType = op1->type;
6511 op1->type->refCount++;
6516 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6518 short value2 = op2->s;
6521 exp->string = PrintShort(op1->s += value2);
6524 exp->expType = op1->type;
6526 op1->type->refCount++;
6531 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6533 unsigned short value2 = op2->us;
6536 exp->string = PrintUShort(op1->us += value2);
6539 exp->expType = op1->type;
6541 op1->type->refCount++;
6546 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6548 char value2 = op2->c;
6551 exp->string = PrintChar(op1->c += value2);
6554 exp->expType = op1->type;
6556 op1->type->refCount++;
6561 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6563 unsigned char value2 = op2->uc;
6566 exp->string = PrintUChar(op1->uc += value2);
6569 exp->expType = op1->type;
6571 op1->type->refCount++;
6576 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6578 float value2 = op2->f;
6581 exp->string = PrintFloat(op1->f += value2);
6584 exp->expType = op1->type;
6586 op1->type->refCount++;
6591 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6593 double value2 = op2->d;
6596 exp->string = PrintDouble(op1->d += value2);
6599 exp->expType = op1->type;
6601 op1->type->refCount++;
6606 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6608 int value2 = op2->i;
6611 exp->string = PrintInt(op1->i -= value2);
6614 exp->expType = op1->type;
6616 op1->type->refCount++;
6621 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6623 unsigned int value2 = op2->ui;
6626 exp->string = PrintUInt(op1->ui -= value2);
6629 exp->expType = op1->type;
6631 op1->type->refCount++;
6636 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6638 short value2 = op2->s;
6641 exp->string = PrintShort(op1->s -= value2);
6644 exp->expType = op1->type;
6646 op1->type->refCount++;
6651 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6653 unsigned short value2 = op2->us;
6656 exp->string = PrintUShort(op1->us -= value2);
6659 exp->expType = op1->type;
6661 op1->type->refCount++;
6666 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6668 char value2 = op2->c;
6671 exp->string = PrintChar(op1->c -= value2);
6674 exp->expType = op1->type;
6676 op1->type->refCount++;
6681 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6683 unsigned char value2 = op2->uc;
6686 exp->string = PrintUChar(op1->uc -= value2);
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6698 float value2 = op2->f;
6701 exp->string = PrintFloat(op1->f -= value2);
6704 exp->expType = op1->type;
6706 op1->type->refCount++;
6711 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6713 double value2 = op2->d;
6716 exp->string = PrintDouble(op1->d -= value2);
6719 exp->expType = op1->type;
6721 op1->type->refCount++;
6726 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6728 int value2 = op2->i;
6731 exp->string = PrintInt(op1->i *= value2);
6734 exp->expType = op1->type;
6736 op1->type->refCount++;
6741 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6743 unsigned int value2 = op2->ui;
6746 exp->string = PrintUInt(op1->ui *= value2);
6749 exp->expType = op1->type;
6751 op1->type->refCount++;
6756 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6758 short value2 = op2->s;
6761 exp->string = PrintShort(op1->s *= value2);
6764 exp->expType = op1->type;
6766 op1->type->refCount++;
6771 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6773 unsigned short value2 = op2->us;
6776 exp->string = PrintUShort(op1->us *= value2);
6779 exp->expType = op1->type;
6781 op1->type->refCount++;
6786 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6788 char value2 = op2->c;
6791 exp->string = PrintChar(op1->c *= value2);
6794 exp->expType = op1->type;
6796 op1->type->refCount++;
6801 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6803 unsigned char value2 = op2->uc;
6806 exp->string = PrintUChar(op1->uc *= value2);
6809 exp->expType = op1->type;
6811 op1->type->refCount++;
6816 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6818 float value2 = op2->f;
6821 exp->string = PrintFloat(op1->f *= value2);
6824 exp->expType = op1->type;
6826 op1->type->refCount++;
6831 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6833 double value2 = op2->d;
6836 exp->string = PrintDouble(op1->d *= value2);
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6848 int value2 = op2->i;
6851 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6863 unsigned int value2 = op2->ui;
6866 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6869 exp->expType = op1->type;
6871 op1->type->refCount++;
6876 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6878 short value2 = op2->s;
6881 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6884 exp->expType = op1->type;
6886 op1->type->refCount++;
6891 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6893 unsigned short value2 = op2->us;
6896 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6899 exp->expType = op1->type;
6901 op1->type->refCount++;
6906 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6908 char value2 = op2->c;
6911 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6914 exp->expType = op1->type;
6916 op1->type->refCount++;
6921 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6923 unsigned char value2 = op2->uc;
6926 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6929 exp->expType = op1->type;
6931 op1->type->refCount++;
6936 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6938 float value2 = op2->f;
6941 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6944 exp->expType = op1->type;
6946 op1->type->refCount++;
6951 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6953 double value2 = op2->d;
6956 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6959 exp->expType = op1->type;
6961 op1->type->refCount++;
6966 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6968 int value2 = op2->i;
6971 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6974 exp->expType = op1->type;
6976 op1->type->refCount++;
6981 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6983 unsigned int value2 = op2->ui;
6986 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6989 exp->expType = op1->type;
6991 op1->type->refCount++;
6996 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6998 short value2 = op2->s;
7001 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7004 exp->expType = op1->type;
7006 op1->type->refCount++;
7011 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7013 unsigned short value2 = op2->us;
7016 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7019 exp->expType = op1->type;
7021 op1->type->refCount++;
7026 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7028 char value2 = op2->c;
7031 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7034 exp->expType = op1->type;
7036 op1->type->refCount++;
7041 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7043 unsigned char value2 = op2->uc;
7046 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7049 exp->expType = op1->type;
7051 op1->type->refCount++;
7056 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7058 int value2 = op2->i;
7061 exp->string = PrintInt(op1->i & value2);
7064 exp->expType = op1->type;
7066 op1->type->refCount++;
7071 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7073 unsigned int value2 = op2->ui;
7076 exp->string = PrintUInt(op1->ui & value2);
7079 exp->expType = op1->type;
7081 op1->type->refCount++;
7086 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7088 short value2 = op2->s;
7091 exp->string = PrintShort(op1->s & value2);
7094 exp->expType = op1->type;
7096 op1->type->refCount++;
7101 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7103 unsigned short value2 = op2->us;
7106 exp->string = PrintUShort(op1->us & value2);
7109 exp->expType = op1->type;
7111 op1->type->refCount++;
7116 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7118 char value2 = op2->c;
7121 exp->string = PrintChar(op1->c & value2);
7124 exp->expType = op1->type;
7126 op1->type->refCount++;
7131 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7133 unsigned char value2 = op2->uc;
7136 exp->string = PrintUChar(op1->uc & value2);
7139 exp->expType = op1->type;
7141 op1->type->refCount++;
7146 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7148 int value2 = op2->i;
7151 exp->string = PrintInt(op1->i | value2);
7154 exp->expType = op1->type;
7156 op1->type->refCount++;
7161 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7163 unsigned int value2 = op2->ui;
7166 exp->string = PrintUInt(op1->ui | value2);
7169 exp->expType = op1->type;
7171 op1->type->refCount++;
7176 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7178 short value2 = op2->s;
7181 exp->string = PrintShort(op1->s | value2);
7184 exp->expType = op1->type;
7186 op1->type->refCount++;
7191 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7193 unsigned short value2 = op2->us;
7196 exp->string = PrintUShort(op1->us | value2);
7199 exp->expType = op1->type;
7201 op1->type->refCount++;
7206 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7208 char value2 = op2->c;
7211 exp->string = PrintChar(op1->c | value2);
7214 exp->expType = op1->type;
7216 op1->type->refCount++;
7221 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7223 unsigned char value2 = op2->uc;
7226 exp->string = PrintUChar(op1->uc | value2);
7229 exp->expType = op1->type;
7231 op1->type->refCount++;
7236 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7238 int value2 = op2->i;
7241 exp->string = PrintInt(op1->i ^ value2);
7244 exp->expType = op1->type;
7246 op1->type->refCount++;
7251 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7253 unsigned int value2 = op2->ui;
7256 exp->string = PrintUInt(op1->ui ^ value2);
7259 exp->expType = op1->type;
7261 op1->type->refCount++;
7266 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7268 short value2 = op2->s;
7271 exp->string = PrintShort(op1->s ^ value2);
7274 exp->expType = op1->type;
7276 op1->type->refCount++;
7281 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7283 unsigned short value2 = op2->us;
7286 exp->string = PrintUShort(op1->us ^ value2);
7289 exp->expType = op1->type;
7291 op1->type->refCount++;
7296 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7298 char value2 = op2->c;
7301 exp->string = PrintChar(op1->c ^ value2);
7304 exp->expType = op1->type;
7306 op1->type->refCount++;
7311 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7313 unsigned char value2 = op2->uc;
7316 exp->string = PrintUChar(op1->uc ^ value2);
7319 exp->expType = op1->type;
7321 op1->type->refCount++;
7326 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7328 int value2 = op2->i;
7331 exp->string = PrintInt(op1->i << value2);
7334 exp->expType = op1->type;
7336 op1->type->refCount++;
7341 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7343 unsigned int value2 = op2->ui;
7346 exp->string = PrintUInt(op1->ui << value2);
7349 exp->expType = op1->type;
7351 op1->type->refCount++;
7356 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7358 short value2 = op2->s;
7361 exp->string = PrintShort(op1->s << value2);
7364 exp->expType = op1->type;
7366 op1->type->refCount++;
7371 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7373 unsigned short value2 = op2->us;
7376 exp->string = PrintUShort(op1->us << value2);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7388 char value2 = op2->c;
7391 exp->string = PrintChar(op1->c << value2);
7394 exp->expType = op1->type;
7396 op1->type->refCount++;
7401 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7403 unsigned char value2 = op2->uc;
7406 exp->string = PrintUChar(op1->uc << value2);
7409 exp->expType = op1->type;
7411 op1->type->refCount++;
7416 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7418 int value2 = op2->i;
7421 exp->string = PrintInt(op1->i >> value2);
7424 exp->expType = op1->type;
7426 op1->type->refCount++;
7431 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7433 unsigned int value2 = op2->ui;
7436 exp->string = PrintUInt(op1->ui >> value2);
7439 exp->expType = op1->type;
7441 op1->type->refCount++;
7446 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7448 short value2 = op2->s;
7451 exp->string = PrintShort(op1->s >> value2);
7454 exp->expType = op1->type;
7456 op1->type->refCount++;
7461 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7463 unsigned short value2 = op2->us;
7466 exp->string = PrintUShort(op1->us >> value2);
7469 exp->expType = op1->type;
7471 op1->type->refCount++;
7476 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7478 char value2 = op2->c;
7481 exp->string = PrintChar(op1->c >> value2);
7484 exp->expType = op1->type;
7486 op1->type->refCount++;
7491 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7493 unsigned char value2 = op2->uc;
7496 exp->string = PrintUChar(op1->uc >> value2);
7499 exp->expType = op1->type;
7501 op1->type->refCount++;
7506 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7509 exp->string = PrintInt(~op1->i);
7512 exp->expType = op1->type;
7514 op1->type->refCount++;
7519 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7522 exp->string = PrintUInt(~op1->ui);
7525 exp->expType = op1->type;
7527 op1->type->refCount++;
7532 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7535 exp->string = PrintShort(~op1->s);
7538 exp->expType = op1->type;
7540 op1->type->refCount++;
7545 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7548 exp->string = PrintUShort(~op1->us);
7551 exp->expType = op1->type;
7553 op1->type->refCount++;
7558 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7561 exp->string = PrintChar(~op1->c);
7564 exp->expType = op1->type;
7566 op1->type->refCount++;
7571 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7574 exp->string = PrintUChar(~op1->uc);
7577 exp->expType = op1->type;
7579 op1->type->refCount++;
7584 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7586 int value2 = op2->i;
7589 exp->string = PrintInt(op1->i &= value2);
7592 exp->expType = op1->type;
7594 op1->type->refCount++;
7599 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7601 unsigned int value2 = op2->ui;
7604 exp->string = PrintUInt(op1->ui &= value2);
7607 exp->expType = op1->type;
7609 op1->type->refCount++;
7614 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7616 short value2 = op2->s;
7619 exp->string = PrintShort(op1->s &= value2);
7622 exp->expType = op1->type;
7624 op1->type->refCount++;
7629 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7631 unsigned short value2 = op2->us;
7634 exp->string = PrintUShort(op1->us &= value2);
7637 exp->expType = op1->type;
7639 op1->type->refCount++;
7644 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7646 char value2 = op2->c;
7649 exp->string = PrintChar(op1->c &= value2);
7652 exp->expType = op1->type;
7654 op1->type->refCount++;
7659 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7661 unsigned char value2 = op2->uc;
7664 exp->string = PrintUChar(op1->uc &= value2);
7667 exp->expType = op1->type;
7669 op1->type->refCount++;
7674 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7676 int value2 = op2->i;
7679 exp->string = PrintInt(op1->i |= value2);
7682 exp->expType = op1->type;
7684 op1->type->refCount++;
7689 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7691 unsigned int value2 = op2->ui;
7694 exp->string = PrintUInt(op1->ui |= value2);
7697 exp->expType = op1->type;
7699 op1->type->refCount++;
7704 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7706 short value2 = op2->s;
7709 exp->string = PrintShort(op1->s |= value2);
7712 exp->expType = op1->type;
7714 op1->type->refCount++;
7719 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7721 unsigned short value2 = op2->us;
7724 exp->string = PrintUShort(op1->us |= value2);
7727 exp->expType = op1->type;
7729 op1->type->refCount++;
7734 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7736 char value2 = op2->c;
7739 exp->string = PrintChar(op1->c |= value2);
7742 exp->expType = op1->type;
7744 op1->type->refCount++;
7749 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7751 unsigned char value2 = op2->uc;
7754 exp->string = PrintUChar(op1->uc |= value2);
7757 exp->expType = op1->type;
7759 op1->type->refCount++;
7764 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7766 int value2 = op2->i;
7769 exp->string = PrintInt(op1->i ^= value2);
7772 exp->expType = op1->type;
7774 op1->type->refCount++;
7779 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7781 unsigned int value2 = op2->ui;
7784 exp->string = PrintUInt(op1->ui ^= value2);
7787 exp->expType = op1->type;
7789 op1->type->refCount++;
7794 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7796 short value2 = op2->s;
7799 exp->string = PrintShort(op1->s ^= value2);
7802 exp->expType = op1->type;
7804 op1->type->refCount++;
7809 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7811 unsigned short value2 = op2->us;
7814 exp->string = PrintUShort(op1->us ^= value2);
7817 exp->expType = op1->type;
7819 op1->type->refCount++;
7824 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7826 char value2 = op2->c;
7829 exp->string = PrintChar(op1->c ^= value2);
7832 exp->expType = op1->type;
7834 op1->type->refCount++;
7839 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7841 unsigned char value2 = op2->uc;
7844 exp->string = PrintUChar(op1->uc ^= value2);
7847 exp->expType = op1->type;
7849 op1->type->refCount++;
7854 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7856 int value2 = op2->i;
7859 exp->string = PrintInt(op1->i <<= value2);
7862 exp->expType = op1->type;
7864 op1->type->refCount++;
7869 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7871 unsigned int value2 = op2->ui;
7874 exp->string = PrintUInt(op1->ui <<= value2);
7877 exp->expType = op1->type;
7879 op1->type->refCount++;
7884 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7886 short value2 = op2->s;
7889 exp->string = PrintShort(op1->s <<= value2);
7892 exp->expType = op1->type;
7894 op1->type->refCount++;
7899 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7901 unsigned short value2 = op2->us;
7904 exp->string = PrintUShort(op1->us <<= value2);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7916 char value2 = op2->c;
7919 exp->string = PrintChar(op1->c <<= value2);
7922 exp->expType = op1->type;
7924 op1->type->refCount++;
7929 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7931 unsigned char value2 = op2->uc;
7934 exp->string = PrintUChar(op1->uc <<= value2);
7937 exp->expType = op1->type;
7939 op1->type->refCount++;
7944 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7946 int value2 = op2->i;
7949 exp->string = PrintInt(op1->i >>= value2);
7952 exp->expType = op1->type;
7954 op1->type->refCount++;
7959 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7961 unsigned int value2 = op2->ui;
7964 exp->string = PrintUInt(op1->ui >>= value2);
7967 exp->expType = op1->type;
7969 op1->type->refCount++;
7974 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7976 short value2 = op2->s;
7979 exp->string = PrintShort(op1->s >>= value2);
7982 exp->expType = op1->type;
7984 op1->type->refCount++;
7989 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7991 unsigned short value2 = op2->us;
7994 exp->string = PrintUShort(op1->us >>= value2);
7997 exp->expType = op1->type;
7999 op1->type->refCount++;
8004 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8006 char value2 = op2->c;
8009 exp->string = PrintChar(op1->c >>= value2);
8012 exp->expType = op1->type;
8014 op1->type->refCount++;
8019 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8021 unsigned char value2 = op2->uc;
8024 exp->string = PrintUChar(op1->uc >>= value2);
8027 exp->expType = op1->type;
8029 op1->type->refCount++;
8034 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8037 exp->string = PrintInt(!op1->i);
8040 exp->expType = op1->type;
8042 op1->type->refCount++;
8047 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8050 exp->string = PrintUInt(!op1->ui);
8053 exp->expType = op1->type;
8055 op1->type->refCount++;
8060 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8063 exp->string = PrintShort(!op1->s);
8066 exp->expType = op1->type;
8068 op1->type->refCount++;
8073 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8076 exp->string = PrintUShort(!op1->us);
8079 exp->expType = op1->type;
8081 op1->type->refCount++;
8086 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8089 exp->string = PrintChar(!op1->c);
8092 exp->expType = op1->type;
8094 op1->type->refCount++;
8099 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8102 exp->string = PrintUChar(!op1->uc);
8105 exp->expType = op1->type;
8107 op1->type->refCount++;
8112 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8114 int value2 = op2->i;
8117 exp->string = PrintInt(op1->i == value2);
8120 exp->expType = op1->type;
8122 op1->type->refCount++;
8127 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8129 unsigned int value2 = op2->ui;
8132 exp->string = PrintUInt(op1->ui == value2);
8135 exp->expType = op1->type;
8137 op1->type->refCount++;
8142 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8144 short value2 = op2->s;
8147 exp->string = PrintShort(op1->s == value2);
8150 exp->expType = op1->type;
8152 op1->type->refCount++;
8157 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8159 unsigned short value2 = op2->us;
8162 exp->string = PrintUShort(op1->us == value2);
8165 exp->expType = op1->type;
8167 op1->type->refCount++;
8172 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8174 char value2 = op2->c;
8177 exp->string = PrintChar(op1->c == value2);
8180 exp->expType = op1->type;
8182 op1->type->refCount++;
8187 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8189 unsigned char value2 = op2->uc;
8192 exp->string = PrintUChar(op1->uc == value2);
8195 exp->expType = op1->type;
8197 op1->type->refCount++;
8202 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8204 float value2 = op2->f;
8207 exp->string = PrintFloat(op1->f == value2);
8210 exp->expType = op1->type;
8212 op1->type->refCount++;
8217 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8219 double value2 = op2->d;
8222 exp->string = PrintDouble(op1->d == value2);
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 int value2 = op2->i;
8237 exp->string = PrintInt(op1->i != value2);
8240 exp->expType = op1->type;
8242 op1->type->refCount++;
8247 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 unsigned int value2 = op2->ui;
8252 exp->string = PrintUInt(op1->ui != value2);
8255 exp->expType = op1->type;
8257 op1->type->refCount++;
8262 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 short value2 = op2->s;
8267 exp->string = PrintShort(op1->s != value2);
8270 exp->expType = op1->type;
8272 op1->type->refCount++;
8277 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 unsigned short value2 = op2->us;
8282 exp->string = PrintUShort(op1->us != value2);
8285 exp->expType = op1->type;
8287 op1->type->refCount++;
8292 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 char value2 = op2->c;
8297 exp->string = PrintChar(op1->c != value2);
8300 exp->expType = op1->type;
8302 op1->type->refCount++;
8307 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 unsigned char value2 = op2->uc;
8312 exp->string = PrintUChar(op1->uc != value2);
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 float value2 = op2->f;
8327 exp->string = PrintFloat(op1->f != value2);
8330 exp->expType = op1->type;
8332 op1->type->refCount++;
8337 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 double value2 = op2->d;
8342 exp->string = PrintDouble(op1->d != value2);
8345 exp->expType = op1->type;
8347 op1->type->refCount++;
8352 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 int value2 = op2->i;
8357 exp->string = PrintInt(op1->i && value2);
8360 exp->expType = op1->type;
8362 op1->type->refCount++;
8367 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 unsigned int value2 = op2->ui;
8372 exp->string = PrintUInt(op1->ui && value2);
8375 exp->expType = op1->type;
8377 op1->type->refCount++;
8382 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 short value2 = op2->s;
8387 exp->string = PrintShort(op1->s && value2);
8390 exp->expType = op1->type;
8392 op1->type->refCount++;
8397 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 unsigned short value2 = op2->us;
8402 exp->string = PrintUShort(op1->us && value2);
8405 exp->expType = op1->type;
8407 op1->type->refCount++;
8412 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 char value2 = op2->c;
8417 exp->string = PrintChar(op1->c && value2);
8420 exp->expType = op1->type;
8422 op1->type->refCount++;
8427 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 unsigned char value2 = op2->uc;
8432 exp->string = PrintUChar(op1->uc && value2);
8435 exp->expType = op1->type;
8437 op1->type->refCount++;
8442 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 float value2 = op2->f;
8447 exp->string = PrintFloat(op1->f && value2);
8450 exp->expType = op1->type;
8452 op1->type->refCount++;
8457 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 double value2 = op2->d;
8462 exp->string = PrintDouble(op1->d && value2);
8465 exp->expType = op1->type;
8467 op1->type->refCount++;
8472 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 int value2 = op2->i;
8477 exp->string = PrintInt(op1->i || value2);
8480 exp->expType = op1->type;
8482 op1->type->refCount++;
8487 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 unsigned int value2 = op2->ui;
8492 exp->string = PrintUInt(op1->ui || value2);
8495 exp->expType = op1->type;
8497 op1->type->refCount++;
8502 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 short value2 = op2->s;
8507 exp->string = PrintShort(op1->s || value2);
8510 exp->expType = op1->type;
8512 op1->type->refCount++;
8517 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 unsigned short value2 = op2->us;
8522 exp->string = PrintUShort(op1->us || value2);
8525 exp->expType = op1->type;
8527 op1->type->refCount++;
8532 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 char value2 = op2->c;
8537 exp->string = PrintChar(op1->c || value2);
8540 exp->expType = op1->type;
8542 op1->type->refCount++;
8547 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 unsigned char value2 = op2->uc;
8552 exp->string = PrintUChar(op1->uc || value2);
8555 exp->expType = op1->type;
8557 op1->type->refCount++;
8562 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 float value2 = op2->f;
8567 exp->string = PrintFloat(op1->f || value2);
8570 exp->expType = op1->type;
8572 op1->type->refCount++;
8577 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 double value2 = op2->d;
8582 exp->string = PrintDouble(op1->d || value2);
8585 exp->expType = op1->type;
8587 op1->type->refCount++;
8592 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 int value2 = op2->i;
8597 exp->string = PrintInt(op1->i > value2);
8600 exp->expType = op1->type;
8602 op1->type->refCount++;
8607 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 unsigned int value2 = op2->ui;
8612 exp->string = PrintUInt(op1->ui > value2);
8615 exp->expType = op1->type;
8617 op1->type->refCount++;
8622 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 short value2 = op2->s;
8627 exp->string = PrintShort(op1->s > value2);
8630 exp->expType = op1->type;
8632 op1->type->refCount++;
8637 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 unsigned short value2 = op2->us;
8642 exp->string = PrintUShort(op1->us > value2);
8645 exp->expType = op1->type;
8647 op1->type->refCount++;
8652 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 char value2 = op2->c;
8657 exp->string = PrintChar(op1->c > value2);
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 unsigned char value2 = op2->uc;
8672 exp->string = PrintUChar(op1->uc > value2);
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 float value2 = op2->f;
8687 exp->string = PrintFloat(op1->f > value2);
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 double value2 = op2->d;
8702 exp->string = PrintDouble(op1->d > value2);
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 int value2 = op2->i;
8717 exp->string = PrintInt(op1->i < value2);
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 unsigned int value2 = op2->ui;
8732 exp->string = PrintUInt(op1->ui < value2);
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 short value2 = op2->s;
8747 exp->string = PrintShort(op1->s < value2);
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 unsigned short value2 = op2->us;
8762 exp->string = PrintUShort(op1->us < value2);
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 char value2 = op2->c;
8777 exp->string = PrintChar(op1->c < value2);
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 unsigned char value2 = op2->uc;
8792 exp->string = PrintUChar(op1->uc < value2);
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 float value2 = op2->f;
8807 exp->string = PrintFloat(op1->f < value2);
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 double value2 = op2->d;
8822 exp->string = PrintDouble(op1->d < value2);
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 int value2 = op2->i;
8837 exp->string = PrintInt(op1->i >= value2);
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 unsigned int value2 = op2->ui;
8852 exp->string = PrintUInt(op1->ui >= value2);
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 short value2 = op2->s;
8867 exp->string = PrintShort(op1->s >= value2);
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 unsigned short value2 = op2->us;
8882 exp->string = PrintUShort(op1->us >= value2);
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 char value2 = op2->c;
8897 exp->string = PrintChar(op1->c >= value2);
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 unsigned char value2 = op2->uc;
8912 exp->string = PrintUChar(op1->uc >= value2);
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8924 float value2 = op2->f;
8927 exp->string = PrintFloat(op1->f >= value2);
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8939 double value2 = op2->d;
8942 exp->string = PrintDouble(op1->d >= value2);
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8954 int value2 = op2->i;
8957 exp->string = PrintInt(op1->i <= value2);
8960 exp->expType = op1->type;
8962 op1->type->refCount++;
8967 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8969 unsigned int value2 = op2->ui;
8972 exp->string = PrintUInt(op1->ui <= value2);
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8984 short value2 = op2->s;
8987 exp->string = PrintShort(op1->s <= value2);
8990 exp->expType = op1->type;
8992 op1->type->refCount++;
8997 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8999 unsigned short value2 = op2->us;
9002 exp->string = PrintUShort(op1->us <= value2);
9005 exp->expType = op1->type;
9007 op1->type->refCount++;
9012 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9014 char value2 = op2->c;
9017 exp->string = PrintChar(op1->c <= value2);
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 unsigned char value2 = op2->uc;
9032 exp->string = PrintUChar(op1->uc <= value2);
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 float value2 = op2->f;
9047 exp->string = PrintFloat(op1->f <= value2);
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 double value2 = op2->d;
9062 exp->string = PrintDouble(op1->d <= value2);
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9075 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9078 exp->expType = op1->type;
9080 op1->type->refCount++;
9085 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9088 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9091 exp->expType = op1->type;
9093 op1->type->refCount++;
9098 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9101 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9104 exp->expType = op1->type;
9106 op1->type->refCount++;
9111 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9114 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9117 exp->expType = op1->type;
9119 op1->type->refCount++;
9124 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9127 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9130 exp->expType = op1->type;
9132 op1->type->refCount++;
9137 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9140 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9143 exp->expType = op1->type;
9145 op1->type->refCount++;
9150 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9153 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9156 exp->expType = op1->type;
9158 op1->type->refCount++;
9163 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9166 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9169 exp->expType = op1->type;
9171 op1->type->refCount++;
9176 struct OpTable intOps =
9178 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
9181 struct OpTable uintOps =
9183 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
9186 struct OpTable shortOps =
9188 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
9191 struct OpTable ushortOps =
9193 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
9196 struct OpTable floatOps =
9198 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
9201 struct OpTable doubleOps =
9203 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
9206 struct OpTable charOps =
9208 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
9211 struct OpTable ucharOps =
9213 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
9216 void ReadString(char * output, char * string)
9218 int len = strlen(string);
9220 unsigned int quoted = 0x0, escaped = 0x0;
9222 for(c = 0; c < len; c++)
9224 char ch = string[c];
9280 extern double strtod(char * , char * * );
9282 struct Operand GetOperand(struct Expression * exp)
9288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9291 struct Type * type = exp->expType;
9295 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9297 if(!type->_class->registered->dataType)
9298 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9299 type = type->_class->registered->dataType;
9301 op.kind = type->kind;
9302 op.type = exp->expType;
9303 if(exp->isConstant && exp->type == 2)
9309 if(exp->constant[0] == '\'')
9310 op.c = exp->constant[1];
9311 else if(type->isSigned)
9313 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9318 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9326 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9331 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9339 op.i = strtol(exp->constant, (((void *)0)), 0);
9344 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9352 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9357 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9365 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9370 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9376 op.f = (float)strtod(exp->constant, (((void *)0)));
9380 op.d = (double)strtod(exp->constant, (((void *)0)));
9386 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9396 int __ecereVMethodID_class_OnGetString;
9398 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9400 static void UnusedFunction()
9404 ((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);
9407 extern int __ecereVMethodID_class_OnGetString;
9409 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9411 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9413 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9415 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9416 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9419 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9420 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9422 void * ptr = inst->data + dataMember->offset + offset;
9423 char * result = (((void *)0));
9425 exp->loc = member->loc = inst->loc;
9426 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9427 if(!dataMember->dataType)
9428 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9429 type = dataMember->dataType;
9432 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9434 if(_class->type == 4)
9436 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9440 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9441 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9443 for(item = e->values.first; item; item = item->next)
9445 if((int)item->data == *(int *)ptr)
9447 result = item->name;
9453 exp->identifier = MkIdentifier(result);
9455 exp->destType = MkClassType(_class->fullName);
9456 ProcessExpressionType(exp);
9460 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9462 if(!_class->dataType)
9463 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9464 type = _class->dataType;
9473 FreeExpContents(exp);
9474 exp->constant = PrintFloat(*(float *)ptr);
9480 FreeExpContents(exp);
9481 exp->constant = PrintDouble(*(double *)ptr);
9487 FreeExpContents(exp);
9488 exp->constant = PrintInt(*(int *)ptr);
9494 FreeExpContents(exp);
9495 exp->constant = PrintInt64(*(long long *)ptr);
9501 FreeExpContents(exp);
9502 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9510 ListAdd(memberList, member);
9512 if(parentDataMember->type == 1)
9517 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9519 void PopulateInstance(struct Instantiation * inst)
9521 struct Symbol * classSym = inst->_class->symbol;
9522 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9523 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9524 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9526 inst->members = MkListOne(MkMembersInitList(memberList));
9527 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9529 if(!dataMember->isProperty)
9531 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9532 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9535 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9536 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9538 void * ptr = inst->data + dataMember->offset;
9539 char * result = (((void *)0));
9541 exp->loc = member->loc = inst->loc;
9542 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9543 if(!dataMember->dataType)
9544 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9545 type = dataMember->dataType;
9548 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9550 if(_class->type == 4)
9552 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9556 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9557 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9559 for(item = e->values.first; item; item = item->next)
9561 if((int)item->data == *(int *)ptr)
9563 result = item->name;
9570 exp->identifier = MkIdentifier(result);
9572 exp->destType = MkClassType(_class->fullName);
9573 ProcessExpressionType(exp);
9576 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9578 if(!_class->dataType)
9579 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9580 type = _class->dataType;
9589 exp->constant = PrintFloat(*(float *)ptr);
9595 exp->constant = PrintDouble(*(double *)ptr);
9601 exp->constant = PrintInt(*(int *)ptr);
9607 exp->constant = PrintInt64(*(long long *)ptr);
9613 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9621 ListAdd(memberList, member);
9627 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);
9629 extern void FreeInstance(struct Instantiation * inst);
9631 void ComputeInstantiation(struct Expression * exp)
9633 struct Instantiation * inst = exp->instance;
9634 struct MembersInit * members;
9635 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9636 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9637 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9638 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9639 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9640 int subMemberStackPos = 0;
9643 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9647 if(_class->type == 0 || _class->type == 5)
9648 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9650 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9654 for(members = (*inst->members).first; members; members = members->next)
9656 switch(members->type)
9660 if(members->dataMembers)
9662 struct MemberInit * member;
9664 for(member = (*members->dataMembers).first; member; member = member->next)
9666 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9667 unsigned int found = 0x0;
9668 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9669 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9670 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9671 unsigned int dataMemberOffset;
9675 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9678 if(curMember->isProperty)
9679 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9682 dataMember = curMember;
9683 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9690 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9694 if(prop->memberAccess == 1)
9696 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9697 curClass = prop->_class;
9702 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9703 int _subMemberStackPos = 0;
9705 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9709 if(dataMember->memberAccess == 1)
9711 curMember = dataMember;
9712 curClass = dataMember->_class;
9713 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9714 subMemberStackPos = _subMemberStackPos;
9719 if(found && member->initializer && member->initializer->type == 0)
9721 struct Expression * value = member->initializer->exp;
9722 struct Type * type = (((void *)0));
9726 type = prop->dataType;
9730 if(!dataMember->dataType)
9731 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9732 type = dataMember->dataType;
9734 if(ident && ident->next)
9736 for(ident = ident->next; ident && type; ident = ident->next)
9740 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9742 type = prop->dataType;
9745 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9747 type = dataMember->dataType;
9750 else if(type->kind == 9 || type->kind == 10)
9752 struct Type * memberType;
9754 for(memberType = type->members.first; memberType; memberType = memberType->next)
9756 if(!strcmp(memberType->name, ident->string))
9767 FreeType(value->destType);
9768 value->destType = type;
9771 ComputeExpression(value);
9773 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9777 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9779 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9781 if(!_class->dataType)
9782 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9783 type = _class->dataType;
9788 void * ptr = inst->data + dataMemberOffset;
9790 if(value->type == 2)
9796 GetInt(value, (int *)ptr);
9801 GetInt64(value, (long long *)ptr);
9806 GetIntPtr(value, (intptr_t *)ptr);
9811 GetFloat(value, (float *)ptr);
9816 GetDouble(value, (double *)ptr);
9821 else if(value->type == 1)
9825 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9827 if(_class->type == 1)
9829 ComputeTypeSize(type);
9830 if(value->instance->data)
9831 memcpy(ptr, value->instance->data, type->size);
9838 if(value->type == 1 && value->instance->data)
9840 void (* Set)(void *, void *) = (void *)prop->Set;
9842 Set(inst->data, value->instance->data);
9843 PopulateInstance(inst);
9845 else if(value->type == 2)
9851 void (* Set)(void *, double) = (void *)prop->Set;
9853 Set(inst->data, strtod(value->constant, (((void *)0))));
9858 void (* Set)(void *, float) = (void *)prop->Set;
9860 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9865 void (* Set)(void *, int) = (void *)prop->Set;
9867 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9872 void (* Set)(void *, long long) = (void *)prop->Set;
9874 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9879 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9881 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9886 else if(value->type == 3)
9890 ReadString(temp, value->string);
9891 prop->Set(inst->data, temp);
9895 else if(_class->type == 3)
9899 if(value->type == 2)
9903 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9905 if(_class->type == 3)
9907 if(!_class->dataType)
9908 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9909 type = _class->dataType;
9917 float (* Set)(float) = (void *)prop->Set;
9919 GetFloat(member->initializer->exp, &fValue);
9920 exp->constant = PrintFloat(Set(fValue));
9927 double (* Set)(double) = (void *)prop->Set;
9929 GetDouble(member->initializer->exp, &dValue);
9930 exp->constant = PrintDouble(Set(dValue));
9938 else if(_class->type == 2)
9942 if(value->type == 1 && value->instance->data)
9944 unsigned int (* Set)(void *) = (void *)prop->Set;
9946 bits = Set(value->instance->data);
9948 else if(value->type == 2)
9954 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9958 GetInt(value, &part);
9959 bits = (bits & ~bitMember->mask);
9960 if(!bitMember->dataType)
9961 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9962 type = bitMember->dataType;
9963 if(type->kind == 8 && type->_class && type->_class->registered)
9965 if(!type->_class->registered->dataType)
9966 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9967 type = type->_class->registered->dataType;
9973 bits |= ((char)part << bitMember->pos);
9975 bits |= ((unsigned char)part << bitMember->pos);
9979 bits |= ((short)part << bitMember->pos);
9981 bits |= ((unsigned short)part << bitMember->pos);
9986 bits |= (part << bitMember->pos);
9988 bits |= ((unsigned int)part << bitMember->pos);
9992 bits |= ((long long)part << bitMember->pos);
9994 bits |= ((uint64)part << bitMember->pos);
9998 bits |= ((intptr_t)part << bitMember->pos);
10000 bits |= ((uintptr_t)part << bitMember->pos);
10008 if(_class && _class->type == 3)
10010 ComputeExpression(member->initializer->exp);
10011 exp->constant = member->initializer->exp->constant;
10013 member->initializer->exp->constant = (((void *)0));
10023 if(_class && _class->type == 2)
10025 exp->constant = PrintHexUInt(bits);
10030 FreeInstance(inst);
10034 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10036 if(exp->op.op == SIZEOF)
10038 FreeExpContents(exp);
10040 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10050 struct Expression * exp2 = exp->op.exp2;
10052 exp->op.exp2 = (((void *)0));
10053 FreeExpContents(exp);
10054 FreeType(exp->expType);
10055 FreeType(exp->destType);
10057 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10063 FreeExpContents(exp);
10064 op1->ops.Neg(exp, op1);
10068 if(op1->ops.BitNot)
10070 FreeExpContents(exp);
10071 op1->ops.BitNot(exp, op1);
10077 FreeExpContents(exp);
10078 op1->ops.Not(exp, op1);
10090 FreeExpContents(exp);
10091 op1->ops.Add(exp, op1, op2);
10097 FreeExpContents(exp);
10098 op1->ops.Sub(exp, op1, op2);
10104 FreeExpContents(exp);
10105 op1->ops.Mul(exp, op1, op2);
10111 FreeExpContents(exp);
10112 op1->ops.Div(exp, op1, op2);
10118 FreeExpContents(exp);
10119 op1->ops.Mod(exp, op1, op2);
10125 if(op1->ops.BitAnd)
10127 FreeExpContents(exp);
10128 op1->ops.BitAnd(exp, op1, op2);
10135 FreeExpContents(exp);
10136 op1->ops.BitOr(exp, op1, op2);
10140 if(op1->ops.BitXor)
10142 FreeExpContents(exp);
10143 op1->ops.BitXor(exp, op1, op2);
10147 if(op1->ops.LShift)
10149 FreeExpContents(exp);
10150 op1->ops.LShift(exp, op1, op2);
10154 if(op1->ops.RShift)
10156 FreeExpContents(exp);
10157 op1->ops.RShift(exp, op1, op2);
10163 FreeExpContents(exp);
10164 op1->ops.Equ(exp, op1, op2);
10170 FreeExpContents(exp);
10171 op1->ops.Nqu(exp, op1, op2);
10177 FreeExpContents(exp);
10178 op1->ops.And(exp, op1, op2);
10184 FreeExpContents(exp);
10185 op1->ops.Or(exp, op1, op2);
10191 FreeExpContents(exp);
10192 op1->ops.Grt(exp, op1, op2);
10198 FreeExpContents(exp);
10199 op1->ops.Sma(exp, op1, op2);
10203 if(op1->ops.GrtEqu)
10205 FreeExpContents(exp);
10206 op1->ops.GrtEqu(exp, op1, op2);
10210 if(op1->ops.SmaEqu)
10212 FreeExpContents(exp);
10213 op1->ops.SmaEqu(exp, op1, op2);
10221 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10223 void ComputeExpression(struct Expression * exp)
10225 char expString[10240];
10227 expString[0] = '\0';
10232 ComputeInstantiation(exp);
10237 struct Expression * exp1, * exp2 = (((void *)0));
10238 struct Operand op1 =
10242 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10245 struct Operand op2 =
10249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10254 ComputeExpression(exp->op.exp2);
10257 ComputeExpression(exp->op.exp1);
10258 exp1 = exp->op.exp1;
10259 exp2 = exp->op.exp2;
10260 op1 = GetOperand(exp1);
10262 op1.type->refCount++;
10265 op2 = GetOperand(exp2);
10267 op2.type->refCount++;
10272 exp1 = exp->op.exp2;
10273 op1 = GetOperand(exp1);
10275 op1.type->refCount++;
10277 CallOperator(exp, exp1, exp2, &op1, &op2);
10279 FreeType(op1.type);
10281 FreeType(op2.type);
10287 struct Expression * e, * n;
10289 for(e = (*exp->list).first; e; e = n)
10294 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10296 ComputeExpression(e);
10297 FreeType(exp->expType);
10298 FreeType(exp->destType);
10300 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10301 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10312 struct Expression * memberExp = exp->member.exp;
10313 struct Identifier * memberID = exp->member.member;
10314 struct Type * type;
10316 ComputeExpression(exp->member.exp);
10317 type = exp->member.exp->expType;
10320 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)));
10321 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10322 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10323 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10325 if(type->kind == 19 && exp->member.exp->type == 26)
10326 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10330 struct Symbol * classSym;
10333 PrintType(type, string, 0x0, 0x1);
10334 classSym = FindClass(string);
10335 _class = classSym ? classSym->registered : (((void *)0));
10337 if(exp->member.member)
10339 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10341 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10343 if(!prop && !member && _class && exp->member.member)
10345 struct Symbol * classSym = FindClass(exp->member.member->string);
10347 convertTo = _class;
10348 _class = classSym ? classSym->registered : (((void *)0));
10349 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10355 struct Type * type = prop->dataType;
10357 if(_class->type == 3)
10359 if(type->kind == 8)
10361 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10363 if(_class->type == 3)
10365 if(!_class->dataType)
10366 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10367 type = _class->dataType;
10375 float (* Get)(float) = (void *)prop->Get;
10377 GetFloat(exp->member.exp, &value);
10378 exp->constant = PrintFloat(Get ? Get(value) : value);
10385 double (* Get)(double);
10387 GetDouble(exp->member.exp, &value);
10389 Get = (void *)prop->Set;
10391 Get = (void *)prop->Get;
10392 exp->constant = PrintDouble(Get ? Get(value) : value);
10402 struct Expression * value = exp->member.exp;
10403 struct Type * type;
10405 if(!prop->dataType)
10406 ProcessPropertyType(prop);
10407 type = prop->dataType;
10411 else if(_class->type == 1)
10417 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10419 if(propertyClass->type == 1 && value->type == 1)
10421 void (* Set)(void *, void *) = (void *)prop->Set;
10423 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10424 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10425 exp->instance->_class = MkSpecifierName(_class->fullName);
10426 exp->instance->loc = exp->loc;
10428 Set(exp->instance->data, value->instance->data);
10429 PopulateInstance(exp->instance);
10436 void (* Set)(void *, int) = (void *)prop->Set;
10438 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10439 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10440 exp->instance->_class = MkSpecifierName(_class->fullName);
10441 exp->instance->loc = exp->loc;
10443 GetInt(value, &intValue);
10444 Set(exp->instance->data, intValue);
10445 PopulateInstance(exp->instance);
10450 long long intValue;
10451 void (* Set)(void *, long long) = (void *)prop->Set;
10453 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10454 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10455 exp->instance->_class = MkSpecifierName(_class->fullName);
10456 exp->instance->loc = exp->loc;
10458 GetInt64(value, &intValue);
10459 Set(exp->instance->data, intValue);
10460 PopulateInstance(exp->instance);
10466 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10468 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10469 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10470 exp->instance->_class = MkSpecifierName(_class->fullName);
10471 exp->instance->loc = exp->loc;
10473 GetIntPtr(value, &intValue);
10474 Set(exp->instance->data, intValue);
10475 PopulateInstance(exp->instance);
10480 double doubleValue;
10481 void (* Set)(void *, double) = (void *)prop->Set;
10483 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10484 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10485 exp->instance->_class = MkSpecifierName(_class->fullName);
10486 exp->instance->loc = exp->loc;
10488 GetDouble(value, &doubleValue);
10489 Set(exp->instance->data, doubleValue);
10490 PopulateInstance(exp->instance);
10495 else if(_class->type == 2)
10501 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10503 if(propertyClass->type == 1 && value->instance->data)
10505 unsigned int (* Set)(void *) = (void *)prop->Set;
10506 unsigned int bits = Set(value->instance->data);
10508 exp->constant = PrintHexUInt(bits);
10512 else if(_class->type == 2)
10514 unsigned int value;
10515 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10518 GetUInt(exp->member.exp, &value);
10520 exp->constant = PrintHexUInt(bits);
10529 if(_class->type == 2)
10531 unsigned int value;
10533 GetUInt(exp->member.exp, &value);
10538 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10540 if(_class->type == 1)
10542 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10544 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10545 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10546 exp->instance->_class = MkSpecifierName(_class->fullName);
10547 exp->instance->loc = exp->loc;
10549 Get(value, exp->instance->data);
10550 PopulateInstance(exp->instance);
10552 else if(_class->type == 2)
10554 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10555 uint64 bits = Get(value);
10557 exp->constant = PrintHexUInt64(bits);
10564 else if(_class->type == 1)
10566 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10572 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10574 if(_class->type == 1 && value)
10576 void (* Get)(void *, void *) = (void *)prop->Get;
10578 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10579 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10580 exp->instance->_class = MkSpecifierName(_class->fullName);
10581 exp->instance->loc = exp->loc;
10583 Get(value, exp->instance->data);
10584 PopulateInstance(exp->instance);
10595 exp->isConstant = 0x0;
10604 FreeExpression(memberExp);
10605 FreeIdentifier(memberID);
10611 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10613 FreeExpContents(exp);
10614 exp->constant = PrintUInt(ComputeTypeSize(type));
10621 struct Symbol * classSym = exp->_class->symbol;
10623 if(classSym && classSym->registered)
10625 if(classSym->registered->fixed)
10627 FreeSpecifier(exp->_class);
10628 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10633 char className[1024];
10635 strcpy(className, "__ecereClass_");
10636 FullClassNameCat(className, classSym->string, 0x1);
10637 MangleClassName(className);
10638 FreeExpContents(exp);
10640 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10641 exp->member.member = MkIdentifier("structSize");
10648 struct Type * type;
10649 struct Expression * e = exp;
10651 if(exp->type == 11)
10654 ComputeExpression(exp->cast.exp);
10657 if(e && exp->expType)
10659 type = exp->expType;
10660 if(type->kind == 8)
10662 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10664 if(_class && (_class->type == 3 || _class->type == 2))
10666 if(!_class->dataType)
10667 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10668 type = _class->dataType;
10678 GetChar(e, &value);
10679 FreeExpContents(exp);
10680 exp->constant = PrintChar(value);
10685 unsigned char value;
10687 GetUChar(e, &value);
10688 FreeExpContents(exp);
10689 exp->constant = PrintUChar(value);
10698 GetShort(e, &value);
10699 FreeExpContents(exp);
10700 exp->constant = PrintShort(value);
10705 unsigned short value;
10707 GetUShort(e, &value);
10708 FreeExpContents(exp);
10709 exp->constant = PrintUShort(value);
10719 FreeExpContents(exp);
10720 exp->constant = PrintInt(value);
10725 unsigned int value;
10727 GetUInt(e, &value);
10728 FreeExpContents(exp);
10729 exp->constant = PrintUInt(value);
10738 GetInt64(e, &value);
10739 FreeExpContents(exp);
10740 exp->constant = PrintInt64(value);
10747 GetUInt64(e, &value);
10748 FreeExpContents(exp);
10749 exp->constant = PrintUInt64(value);
10758 GetIntPtr(e, &value);
10759 FreeExpContents(exp);
10760 exp->constant = PrintInt64((long long)value);
10767 GetUIntPtr(e, &value);
10768 FreeExpContents(exp);
10769 exp->constant = PrintUInt64((uint64)value);
10777 GetFloat(e, &value);
10778 FreeExpContents(exp);
10779 exp->constant = PrintFloat(value);
10787 GetDouble(e, &value);
10788 FreeExpContents(exp);
10789 exp->constant = PrintDouble(value);
10799 struct Operand op1 =
10803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10806 struct Operand op2 =
10810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10813 struct Operand op3 =
10817 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10822 ComputeExpression((*exp->cond.exp).last);
10823 if(exp->cond.elseExp)
10824 ComputeExpression(exp->cond.elseExp);
10826 ComputeExpression(exp->cond.cond);
10827 op1 = GetOperand(exp->cond.cond);
10829 op1.type->refCount++;
10830 op2 = GetOperand((*exp->cond.exp).last);
10832 op2.type->refCount++;
10833 op3 = GetOperand(exp->cond.elseExp);
10835 op3.type->refCount++;
10838 FreeExpContents(exp);
10839 op1.ops.Cond(exp, &op1, &op2, &op3);
10842 FreeType(op1.type);
10844 FreeType(op2.type);
10846 FreeType(op3.type);
10852 void ApplyAnyObjectLogic(struct Expression * e);
10854 extern void CopyTypeInto(struct Type * type, struct Type * src);
10856 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10858 unsigned int result = 0x1;
10862 struct __ecereNameSpace__ecere__sys__OldList converts =
10866 struct Conversion * convert;
10868 if(destType->kind == 0)
10870 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10874 for(convert = converts.first; convert; convert = convert->next)
10876 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10880 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10881 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10884 newExp->destType = (((void *)0));
10888 exp->addedThis = 0x1;
10889 exp->member.exp = newExp;
10890 FreeType(exp->member.exp->expType);
10891 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10892 exp->member.exp->expType->classObjectType = objectType;
10893 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10894 exp->member.memberType = 1;
10895 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10896 exp->needCast = 0x1;
10898 exp->expType->refCount++;
10899 ApplyAnyObjectLogic(exp->member.exp);
10905 exp->addedThis = 0x1;
10906 exp->member.exp = newExp;
10907 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10909 newExp->byReference = 0x1;
10911 FreeType(exp->member.exp->expType);
10912 exp->member.exp->expType = (((void *)0));
10913 if(convert->convert->dataType)
10915 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10916 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10917 exp->member.exp->expType->refCount = 1;
10918 exp->member.exp->expType->classObjectType = objectType;
10919 ApplyAnyObjectLogic(exp->member.exp);
10921 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10922 exp->member.memberType = 4;
10923 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10924 exp->needCast = 0x1;
10925 if(convert->resultType)
10926 convert->resultType->refCount++;
10932 FreeType(exp->expType);
10935 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10936 exp->needCast = 0x1;
10938 exp->expType->refCount++;
10942 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10943 exp->needCast = 0x1;
10944 if(convert->resultType)
10945 convert->resultType->refCount++;
10949 if(exp->isConstant && inCompiler)
10950 ComputeExpression(exp);
10951 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10953 if(!result && exp->expType && converts.count)
10955 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10957 if(!result && exp->expType && exp->destType)
10959 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))
10966 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10968 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10970 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10972 void CheckTemplateTypes(struct Expression * exp)
10974 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10976 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10977 struct Statement * compound;
10978 struct Context * context;
10982 exp->destType->refCount++;
10984 exp->expType->refCount++;
10985 newExp->prev = (((void *)0));
10986 newExp->next = (((void *)0));
10987 switch(exp->expType->kind)
10990 if(exp->destType->classObjectType)
10993 exp->destType->refCount--;
10995 exp->expType->refCount--;
10996 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11000 struct __ecereNameSpace__ecere__sys__OldList * specs;
11001 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11002 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11004 context = PushContext();
11005 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11006 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11007 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11009 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11010 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11011 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11012 exp->compound->compound.context = context;
11013 PopContext(context);
11018 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11019 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11023 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11025 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11026 struct Statement * compound;
11027 struct Context * context;
11031 exp->destType->refCount++;
11033 exp->expType->refCount++;
11034 newExp->prev = (((void *)0));
11035 newExp->next = (((void *)0));
11036 switch(exp->expType->kind)
11039 if(exp->destType->classObjectType)
11042 exp->destType->refCount--;
11044 exp->expType->refCount--;
11045 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11049 struct __ecereNameSpace__ecere__sys__OldList * specs;
11050 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11051 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11053 context = PushContext();
11054 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11055 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11056 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11058 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11059 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11060 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11061 exp->compound->compound.context = context;
11062 PopContext(context);
11067 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11070 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11071 ProcessExpressionType((*exp->list).first);
11077 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11078 newExp->needCast = 0x1;
11079 ProcessExpressionType((*exp->list).first);
11085 if(exp->expType->kind == 20)
11087 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11091 FreeType(exp->destType);
11092 FreeType(exp->expType);
11093 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11097 if(newExp->type == 8 && newExp->member.memberType == 3)
11101 exp->op.exp1 = (((void *)0));
11102 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11106 char typeString[1024];
11107 struct Declarator * decl;
11108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11110 typeString[0] = '\0';
11111 PrintType(exp->expType, typeString, 0x0, 0x0);
11112 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11114 exp->cast.typeName = MkTypeName(specs, decl);
11115 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11116 exp->cast.exp->needCast = 0x1;
11124 extern int strncmp(const char * , const char * , int n);
11126 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11128 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11130 int nsLen = strlen(nameSpace);
11131 struct Symbol * symbol;
11133 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)))
11135 char * s = symbol->string;
11137 if(!strncmp(s, nameSpace, nsLen))
11142 for(c = strlen(s) - 1; c >= 0; c--)
11145 namePart = s + c + 1;
11146 if(!strcmp(namePart, name))
11154 return (((void *)0));
11157 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11160 char nameSpace[1024];
11162 unsigned int gotColon = 0x0;
11164 nameSpace[0] = '\0';
11165 for(c = strlen(name) - 1; c >= 0; c--)
11171 namePart = name + c + 1;
11172 while(c >= 0 && name[c] == ':')
11176 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11180 memcpy(nameSpace, name, c + 1);
11181 nameSpace[c + 1] = (char)0;
11182 return ScanWithNameSpace(tree, nameSpace, namePart);
11186 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11192 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11196 return ScanWithNameSpace(tree, "", namePart);
11198 return (((void *)0));
11201 static void ProcessDeclaration(struct Declaration * decl);
11203 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11205 struct Context * ctx;
11206 struct Symbol * symbol = (((void *)0));
11208 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11210 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11212 symbol = (((void *)0));
11215 char curName[1024];
11217 strcpy(curName, thisNameSpace);
11218 strcat(curName, "::");
11219 strcat(curName, name);
11220 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11223 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11226 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11227 if(symbol || ctx == endContext)
11230 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11232 if(symbol->pointerExternal->type == 0)
11234 struct FunctionDefinition * function = symbol->pointerExternal->function;
11235 struct Context * tmpContext = curContext;
11237 curContext = (((void *)0));
11238 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11239 curContext = tmpContext;
11240 symbol->pointerExternal->symbol = symbol;
11241 DeclareType(symbol->type, 0x1, 0x1);
11242 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11243 symbol->id = curExternal->symbol->idCode;
11245 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11247 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11248 symbol->id = curExternal->symbol->idCode;
11254 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11256 if(!type->isSigned && type->kind != 22)
11257 ListAdd(specs, MkSpecifier(UNSIGNED));
11262 if(type->_class->registered)
11264 if(!type->_class->registered->dataType)
11265 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11266 GetTypeSpecs(type->_class->registered->dataType, specs);
11271 ListAdd(specs, MkSpecifier(DOUBLE));
11274 ListAdd(specs, MkSpecifier(FLOAT));
11277 ListAdd(specs, MkSpecifier(CHAR));
11280 ListAdd(specs, MkSpecifier(SHORT));
11283 ListAdd(specs, MkSpecifier(INT64));
11286 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11290 ListAdd(specs, MkSpecifier(INT));
11295 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11297 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11304 if(type->_class && type->_class->string)
11306 if(type->classObjectType == 2)
11307 strcat(string, "typed_object");
11309 strcat(string, type->_class->string);
11312 if(type->_class->registered)
11313 strcat(string, type->_class->registered->name);
11315 strcat(string, type->_class->string);
11322 _PrintType(type->type, string, 0x0, printFunction, fullName);
11323 strcat(string, " *");
11328 strcat(string, "void");
11331 strcat(string, type->isSigned ? "int" : "uint");
11334 strcat(string, type->isSigned ? "int64" : "uint64");
11337 strcat(string, type->isSigned ? "intptr" : "uintptr");
11340 strcat(string, type->isSigned ? "char" : "byte");
11343 strcat(string, type->isSigned ? "short" : "uint16");
11346 strcat(string, "float");
11349 strcat(string, "double");
11354 strcat(string, "struct ");
11355 strcat(string, type->enumName);
11357 else if(type->typeName)
11359 strcat(string, type->typeName);
11363 struct Type * member;
11365 strcat(string, "struct {");
11366 for(member = type->members.first; member; member = member->next)
11368 PrintType(member, string, 0x1, fullName);
11369 strcat(string, "; ");
11371 strcat(string, "}");
11377 strcat(string, "union ");
11378 strcat(string, type->enumName);
11380 else if(type->typeName)
11382 strcat(string, type->typeName);
11386 strcat(string, "union ");
11387 strcat(string, "(unnamed)");
11393 strcat(string, "enum ");
11394 strcat(string, type->enumName);
11396 else if(type->typeName)
11398 strcat(string, type->typeName);
11401 strcat(string, "enum");
11407 if(type->dllExport)
11408 strcat(string, "dllexport ");
11409 PrintType(type->returnType, string, 0x0, fullName);
11410 strcat(string, " ");
11417 strcat(string, type->name);
11420 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11426 strcat(string, name);
11432 struct Type * param;
11434 strcat(string, "(");
11435 for(param = type->params.first; param; param = param->next)
11437 PrintType(param, string, 0x1, fullName);
11439 strcat(string, ", ");
11441 strcat(string, ")");
11448 char baseType[1024], size[256];
11449 struct Type * arrayType = type;
11451 baseType[0] = '\0';
11453 while(arrayType->kind == 12)
11456 if(arrayType->enumClass)
11457 strcat(size, arrayType->enumClass->string);
11458 else if(arrayType->arraySizeExp)
11459 PrintExpression(arrayType->arraySizeExp, size);
11461 arrayType = arrayType->arrayType;
11463 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11464 strcat(string, baseType);
11465 strcat(string, size);
11471 strcat(string, "...");
11474 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11477 strcat(string, "subclass(");
11478 strcat(string, type->_class ? type->_class->string : "int");
11479 strcat(string, ")");
11482 strcat(string, type->templateParameter->identifier->string);
11485 strcat(string, "thisclass");
11488 strcat(string, "__builtin_va_list");
11491 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11493 strcat(string, " ");
11494 strcat(string, type->name);
11499 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11501 struct Type * funcType;
11503 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11505 if(funcType && funcType->kind == 11 && type != funcType)
11507 char typeString[1024];
11508 struct Type * param;
11510 PrintType(funcType->returnType, string, 0x0, fullName);
11511 strcat(string, "(");
11512 _PrintType(type, string, printName, 0x0, fullName);
11513 strcat(string, ")");
11514 strcat(string, "(");
11515 for(param = funcType->params.first; param; param = param->next)
11517 PrintType(param, string, 0x1, fullName);
11519 strcat(string, ", ");
11521 strcat(string, ")");
11524 _PrintType(type, string, printName, 0x1, fullName);
11525 if(type->bitFieldCount)
11529 sprintf(count, ":%d", type->bitFieldCount);
11530 strcat(string, count);
11534 static struct Type * FindMember(struct Type * type, char * string)
11536 struct Type * memberType;
11538 for(memberType = type->members.first; memberType; memberType = memberType->next)
11540 if(!memberType->name)
11542 struct Type * subType = FindMember(memberType, string);
11547 else if(!strcmp(memberType->name, string))
11550 return (((void *)0));
11553 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11555 struct Type * memberType;
11557 for(memberType = type->members.first; memberType; memberType = memberType->next)
11559 if(!memberType->name)
11561 struct Type * subType = FindMember(memberType, string);
11565 *offset += memberType->offset;
11569 else if(!strcmp(memberType->name, string))
11571 *offset += memberType->offset;
11575 return (((void *)0));
11578 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11580 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11582 struct Expression * ParseExpressionString(char * expression)
11584 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11585 ((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));
11586 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11588 parsedExpression = (((void *)0));
11590 expression_yyparse();
11591 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11592 return parsedExpression;
11595 extern char * QMkString(char * source);
11597 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11599 void * __ecereTemp1;
11600 struct Identifier * id = exp->identifier;
11601 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11602 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11603 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11604 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11606 if(_class && _class->type == 4)
11608 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11609 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11613 struct __ecereNameSpace__ecere__com__Class * baseClass;
11615 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11617 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11619 for(value = e->values.first; value; value = value->next)
11621 if(!strcmp(value->name, id->string))
11626 char constant[256];
11628 FreeExpContents(exp);
11630 exp->isConstant = 0x1;
11631 if(!strcmp(baseClass->dataTypeString, "int"))
11632 sprintf(constant, "%d", value->data);
11634 sprintf(constant, "0x%X", value->data);
11635 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11636 exp->expType = MkClassType(baseClass->fullName);
11644 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11646 ProcessMethodType(method);
11647 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));
11650 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11652 if(!prop->dataType)
11653 ProcessPropertyType(prop);
11654 exp->expType = prop->dataType;
11656 prop->dataType->refCount++;
11659 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11661 if(!member->dataType)
11662 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11663 exp->expType = member->dataType;
11664 if(member->dataType)
11665 member->dataType->refCount++;
11668 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11670 if(!classProp->dataType)
11671 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11672 if(classProp->constant)
11674 FreeExpContents(exp);
11675 exp->isConstant = 0x1;
11676 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11679 exp->constant = QMkString((char *)classProp->Get(_class));
11683 char constant[256];
11686 sprintf(constant, "%d", classProp->Get(_class));
11687 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11693 exp->expType = classProp->dataType;
11694 if(classProp->dataType)
11695 classProp->dataType->refCount++;
11701 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11703 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11704 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11705 struct __ecereNameSpace__ecere__com__NameSpace * child;
11709 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)))
11711 data = ScanGlobalData(child, name);
11719 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11721 extern char * strncpy(char * , const char * , int n);
11723 static struct GlobalData * FindGlobalData(char * name)
11726 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11728 nameSpace = globalData;
11729 for(c = 0; name[c]; c++)
11731 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11733 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11734 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11736 strncpy(spaceName, name + start, c - start);
11737 spaceName[c - start] = '\0';
11738 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11739 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11741 return (((void *)0));
11742 nameSpace = newSpace;
11750 return ScanGlobalData(nameSpace, name + start);
11752 return (((void *)0));
11755 static int definedExpStackPos;
11757 static void * definedExpStack[512];
11759 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11761 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11763 FreeExpContents(checkedExp);
11764 FreeType(checkedExp->expType);
11765 FreeType(checkedExp->destType);
11766 *checkedExp = *newExp;
11767 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11768 checkedExp->prev = prev;
11769 checkedExp->next = next;
11772 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11774 extern int printf(char * , ...);
11776 void __ecereMethod_Expression_Clear();
11778 void ApplyAnyObjectLogic(struct Expression * e)
11780 struct Type * destType = e->destType;
11782 if(destType && (destType->classObjectType == 3))
11784 if(e && e->expType)
11786 struct Type * type = e->expType;
11787 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11789 if(type->kind == 8 && type->_class && type->_class->registered)
11791 _class = type->_class->registered;
11793 else if(type->kind == 19)
11795 _class = FindClass("ecere::com::Class")->registered;
11799 char string[1024] = "";
11800 struct Symbol * classSym;
11802 PrintType(type, string, 0x0, 0x1);
11803 classSym = FindClass(string);
11805 _class = classSym->registered;
11807 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)))
11809 if(!_class || strcmp(_class->fullName, "char *"))
11811 struct Expression * checkedExp = e, * newExp;
11813 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11815 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11817 if(checkedExp->type == 25)
11819 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11822 checkedExp = (*checkedExp->list).last;
11824 else if(checkedExp->type == 11)
11825 checkedExp = checkedExp->cast.exp;
11827 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11829 newExp = checkedExp->op.exp2;
11830 checkedExp->op.exp2 = (((void *)0));
11831 FreeExpContents(checkedExp);
11832 if(e->expType && e->expType->passAsTemplate)
11836 ComputeTypeSize(e->expType);
11837 sprintf(size, "%d", e->expType->size);
11838 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))))));
11840 ReplaceExpContents(checkedExp, newExp);
11841 e->byReference = 0x1;
11843 else if(!e->byReference || (_class && _class->type == 5))
11845 struct Expression * checkedExp, * newExp;
11848 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;
11850 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11852 struct Context * context = PushContext();
11853 struct Declarator * decl;
11854 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11855 char typeString[1024];
11856 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11858 typeString[0] = '\0';
11860 newExp->prev = (((void *)0));
11861 newExp->next = (((void *)0));
11862 newExp->expType = (((void *)0));
11863 PrintType(e->expType, typeString, 0x0, 0x1);
11864 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11865 newExp->destType = ProcessType(specs, decl);
11866 curContext = context;
11871 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11873 sprintf(name, "__internalValue%03X", internalValueCounter++);
11874 if(!curCompound->compound.declarations)
11875 curCompound->compound.declarations = MkList();
11876 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11877 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11878 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11879 e->compound = MkCompoundStmt((((void *)0)), stmts);
11882 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11884 struct Type * type = e->destType;
11886 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11887 CopyTypeInto(e->destType, type);
11888 e->destType->refCount = 1;
11889 e->destType->classObjectType = 0;
11892 e->compound->compound.context = context;
11893 PopContext(context);
11894 curContext = context->parent;
11898 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11900 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11902 if(checkedExp->type == 25)
11904 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11907 checkedExp = (*checkedExp->list).last;
11909 else if(checkedExp->type == 11)
11910 checkedExp = checkedExp->cast.exp;
11913 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11915 *operand = *checkedExp;
11916 checkedExp->destType = (((void *)0));
11917 checkedExp->expType = (((void *)0));
11918 __ecereMethod_Expression_Clear(checkedExp);
11919 checkedExp->type = 4;
11920 checkedExp->op.op = '&';
11921 checkedExp->op.exp1 = (((void *)0));
11922 checkedExp->op.exp2 = operand;
11931 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))))
11933 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11939 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11942 thisExp->prev = (((void *)0));
11943 thisExp->next = (((void *)0));
11944 __ecereMethod_Expression_Clear(e);
11946 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11947 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11948 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11950 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11951 CopyTypeInto(e->expType, thisExp->expType);
11952 e->expType->byReference = 0x0;
11953 e->expType->refCount = 1;
11954 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))
11956 e->expType->classObjectType = 0;
11961 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11963 if(destType->kind == 14)
11965 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11967 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11969 unsigned int byReference = e->expType->byReference;
11970 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11971 struct Declarator * decl;
11972 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11973 char typeString[1024];
11974 struct Type * type;
11975 int backupClassObjectType;
11977 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11981 backupClassObjectType = type->classObjectType;
11982 type->classObjectType = 0;
11983 typeString[0] = '\0';
11984 PrintType(type, typeString, 0x0, 0x1);
11985 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11986 type->classObjectType = backupClassObjectType;
11988 thisExp->prev = (((void *)0));
11989 thisExp->next = (((void *)0));
11990 __ecereMethod_Expression_Clear(e);
11991 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)))
11995 e->op.exp1 = (((void *)0));
11996 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12001 e->cast.typeName = MkTypeName(specs, decl);
12002 e->cast.exp = thisExp;
12003 e->byReference = 0x1;
12006 e->destType = destType;
12008 destType->refCount++;
12013 extern char * strstr(char * , const char * );
12015 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12017 struct __ecereNameSpace__ecere__com__DefinedExpression
12019 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12020 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12023 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12024 } __attribute__ ((gcc_struct));
12026 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12028 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12030 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12032 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12034 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12036 extern struct Expression * CopyExpression(struct Expression * exp);
12038 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12040 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12042 static void ProcessStatement(struct Statement * stmt);
12044 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12046 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12048 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12050 extern char * sourceFile;
12052 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12054 void ProcessExpressionType(struct Expression * exp)
12056 void * __ecereTemp2;
12057 void * __ecereTemp1;
12058 unsigned int unresolved = 0x0;
12059 struct Location oldyylloc = yylloc;
12060 unsigned int notByReference = 0x0;
12062 if(!exp || exp->expType)
12069 struct Identifier * id = exp->identifier;
12073 if(id->_class && id->_class->name)
12075 id->classSym = id->_class->symbol;
12077 if(strstr(id->string, "__ecereClass") == id->string)
12079 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12082 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12084 ReplaceClassMembers(exp, thisClass);
12087 ProcessExpressionType(exp);
12090 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12095 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12099 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12105 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12108 ProcessExpressionType(exp);
12112 else if(currentClass && !id->_class)
12114 if(ResolveIdWithClass(exp, currentClass, 0x1))
12117 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12122 struct Type * type = symbol->type;
12123 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12125 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12127 struct Context * context = SetupTemplatesContext(_class);
12129 type = ReplaceThisClassType(_class);
12130 FinishTemplatesContext(context);
12132 type->refCount = 0;
12134 FreeSpecifier(id->_class);
12135 id->_class = (((void *)0));
12136 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12137 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12138 id->classSym = (((void *)0));
12139 exp->expType = type;
12142 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12143 exp->isConstant = 0x1;
12144 if(symbol->isParam || !strcmp(id->string, "this"))
12146 if(_class && _class->type == 1)
12147 exp->byReference = 0x1;
12149 if(symbol->isIterator)
12151 if(symbol->isIterator == 3)
12154 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12155 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12156 exp->expType = (((void *)0));
12157 ProcessExpressionType(exp);
12159 else if(symbol->isIterator != 4)
12162 exp->member.exp = MkExpIdentifier(exp->identifier);
12163 exp->member.exp->expType = exp->expType;
12164 exp->member.member = MkIdentifier("data");
12165 exp->expType = (((void *)0));
12166 ProcessExpressionType(exp);
12173 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12175 if(thisNameSpace && !(id->_class && !id->_class->name))
12179 strcpy(name, thisNameSpace);
12180 strcat(name, "::");
12181 strcat(name, id->string);
12182 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12185 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12190 for(c = 0; c < definedExpStackPos; c++)
12191 if(definedExpStack[c] == definedExp)
12193 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12195 struct Location backupYylloc = yylloc;
12197 definedExpStack[definedExpStackPos++] = definedExp;
12198 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12199 ((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));
12200 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12202 parsedExpression = (((void *)0));
12204 expression_yyparse();
12205 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12206 yylloc = backupYylloc;
12207 if(parsedExpression)
12209 FreeIdentifier(id);
12211 exp->list = MkListOne(parsedExpression);
12212 parsedExpression->loc = yylloc;
12213 ProcessExpressionType(exp);
12214 definedExpStackPos--;
12217 definedExpStackPos--;
12223 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12229 struct GlobalData * data = (((void *)0));
12231 if(thisNameSpace && !(id->_class && !id->_class->name))
12235 strcpy(name, thisNameSpace);
12236 strcat(name, "::");
12237 strcat(name, id->string);
12238 data = FindGlobalData(name);
12241 data = FindGlobalData(id->string);
12244 DeclareGlobalData(data);
12245 exp->expType = data->dataType;
12247 data->dataType->refCount++;
12248 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12249 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12250 FreeSpecifier(id->_class);
12251 id->_class = (((void *)0));
12256 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12258 if(thisNameSpace && !(id->_class && !id->_class->name))
12262 strcpy(name, thisNameSpace);
12263 strcat(name, "::");
12264 strcat(name, id->string);
12265 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12268 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12273 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12274 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12276 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12277 strcpy(name, "__ecereFunction_");
12278 FullClassNameCat(name, id->string, 0x0);
12279 if(DeclareFunction(function, name))
12281 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12282 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12284 exp->expType = function->dataType;
12285 if(function->dataType)
12286 function->dataType->refCount++;
12287 FreeSpecifier(id->_class);
12288 id->_class = (((void *)0));
12300 struct __ecereNameSpace__ecere__com__Class * _class;
12302 if(!exp->instance->_class)
12304 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12306 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12309 ProcessInstantiationType(exp->instance);
12310 exp->isConstant = exp->instance->isConstant;
12311 if(exp->instance->_class)
12313 exp->expType = MkClassType(exp->instance->_class->name);
12321 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12323 exp->expType = type;
12324 if(exp->constant[0] == '\'')
12326 if((int)((unsigned char *)exp->constant)[1] > 127)
12329 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12332 ch = exp->constant[1];
12333 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12334 exp->constant = PrintUInt(ch);
12336 type->_class = FindClass("unichar");
12337 type->isSigned = 0x0;
12342 type->isSigned = 0x1;
12345 else if(strchr(exp->constant, '.'))
12347 char ch = exp->constant[strlen(exp->constant) - 1];
12353 type->isSigned = 0x1;
12357 if(exp->constant[0] == '0' && exp->constant[1])
12358 type->isSigned = 0x0;
12359 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12360 type->isSigned = 0x0;
12361 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12362 type->isSigned = 0x0;
12364 type->isSigned = 0x1;
12367 exp->isConstant = 0x1;
12373 exp->isConstant = 0x1;
12374 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));
12379 ProcessExpressionType(exp->_new.size);
12380 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));
12381 DeclareType(exp->expType->type, 0x0, 0x0);
12385 ProcessExpressionType(exp->_renew.size);
12386 ProcessExpressionType(exp->_renew.exp);
12387 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));
12388 DeclareType(exp->expType->type, 0x0, 0x0);
12392 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12393 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12394 unsigned int useDestType = 0x0, useSideType = 0x0;
12395 struct Location oldyylloc = yylloc;
12396 unsigned int useSideUnit = 0x0;
12397 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12439 if(exp->op.op != '*' || exp->op.exp1)
12446 if(exp->op.op == '&')
12448 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12450 struct Identifier * id = exp->op.exp2->identifier;
12451 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12453 if(symbol && symbol->isIterator == 2)
12456 exp->member.exp = exp->op.exp2;
12457 exp->member.member = MkIdentifier("key");
12458 exp->expType = (((void *)0));
12459 exp->op.exp2->expType = symbol->type;
12460 symbol->type->refCount++;
12461 ProcessExpressionType(exp);
12469 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))
12471 if(exp->op.exp1->destType)
12472 FreeType(exp->op.exp1->destType);
12473 exp->op.exp1->destType = exp->destType;
12475 exp->destType->refCount++;
12479 if(exp->op.exp1->destType)
12480 FreeType(exp->op.exp1->destType);
12481 exp->op.exp1->destType = dummy;
12484 if(exp->op.exp1->destType && exp->op.op != '=')
12485 exp->op.exp1->destType->count++;
12486 ProcessExpressionType(exp->op.exp1);
12487 if(exp->op.exp1->destType && exp->op.op != '=')
12488 exp->op.exp1->destType->count--;
12489 if(exp->op.exp1->destType == dummy)
12492 exp->op.exp1->destType = (((void *)0));
12494 type1 = exp->op.exp1->expType;
12498 char expString[10240];
12500 expString[0] = '\0';
12501 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12505 exp->op.exp2->destType = exp->op.exp1->expType;
12506 if(exp->op.exp1->expType)
12507 exp->op.exp1->expType->refCount++;
12511 exp->op.exp2->destType = exp->destType;
12513 exp->destType->refCount++;
12517 exp->expType = type1;
12522 PrintExpression(exp->op.exp2, expString);
12523 if(type1 && type1->kind == 13)
12525 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)
12526 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12527 else if(exp->op.op == '=')
12529 if(exp->op.exp2->destType)
12530 FreeType(exp->op.exp2->destType);
12531 exp->op.exp2->destType = type1;
12538 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)
12542 if(exp->op.exp2->destType)
12543 FreeType(exp->op.exp2->destType);
12544 exp->op.exp2->destType = type1;
12551 exp->expType = type1;
12553 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)))
12555 if(exp->op.exp2->destType)
12556 FreeType(exp->op.exp2->destType);
12557 exp->op.exp2->destType = exp->destType;
12559 exp->destType->refCount++;
12563 if(exp->op.exp2->destType)
12564 FreeType(exp->op.exp2->destType);
12565 exp->op.exp2->destType = dummy;
12568 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12570 FreeType(exp->op.exp2->destType);
12571 exp->op.exp2->destType = type1;
12574 if(exp->op.exp2->destType && exp->op.op != '=')
12575 exp->op.exp2->destType->count++;
12576 ProcessExpressionType(exp->op.exp2);
12577 if(exp->op.exp2->destType && exp->op.op != '=')
12578 exp->op.exp2->destType->count--;
12579 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12581 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)
12583 if(exp->op.op != '=' && type1->type->kind == 0)
12584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12586 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)))
12588 if(exp->op.op == ADD_ASSIGN)
12589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12591 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))
12593 if(exp->op.op == ADD_ASSIGN)
12594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12596 else if(inCompiler)
12598 char type1String[1024];
12599 char type2String[1024];
12601 type1String[0] = '\0';
12602 type2String[0] = '\0';
12603 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12604 PrintType(type1, type2String, 0x0, 0x1);
12605 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12606 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12609 if(exp->op.exp2->destType == dummy)
12612 exp->op.exp2->destType = (((void *)0));
12614 type2 = exp->op.exp2->expType;
12617 if(exp->op.op == SIZEOF)
12619 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12620 exp->isConstant = 0x1;
12622 else if(exp->op.op == '*' && !exp->op.exp1)
12624 exp->expType = Dereference(type2);
12625 if(type2 && type2->kind == 8)
12626 notByReference = 0x1;
12628 else if(exp->op.op == '&' && !exp->op.exp1)
12629 exp->expType = Reference(type2);
12636 if(exp->op.exp1->destType)
12637 FreeType(exp->op.exp1->destType);
12638 exp->op.exp1->destType = MkClassType("bool");
12639 exp->op.exp1->destType->truth = 0x1;
12640 if(!exp->op.exp1->expType)
12641 ProcessExpressionType(exp->op.exp1);
12643 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12644 FreeType(exp->op.exp1->expType);
12645 exp->op.exp1->expType = MkClassType("bool");
12646 exp->op.exp1->expType->truth = 0x1;
12650 if(exp->op.exp2->destType)
12651 FreeType(exp->op.exp2->destType);
12652 exp->op.exp2->destType = MkClassType("bool");
12653 exp->op.exp2->destType->truth = 0x1;
12654 if(!exp->op.exp2->expType)
12655 ProcessExpressionType(exp->op.exp2);
12657 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12658 FreeType(exp->op.exp2->expType);
12659 exp->op.exp2->expType = MkClassType("bool");
12660 exp->op.exp2->expType->truth = 0x1;
12663 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")))))
12665 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12667 if(exp->op.exp2->destType)
12668 FreeType(exp->op.exp2->destType);
12669 exp->op.exp2->destType = type1;
12671 if(exp->op.exp1->destType)
12672 FreeType(exp->op.exp1->destType);
12673 exp->op.exp1->destType = type2;
12675 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)
12676 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);
12677 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12679 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12683 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12685 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12686 ProcessExpressionType(exp->op.exp1);
12687 if(type2->kind != 13)
12689 ProcessExpressionType(classExp);
12690 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"))))))));
12691 if(!exp->op.exp2->expType)
12692 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12693 ProcessExpressionType(exp->op.exp2);
12697 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)))
12699 if(type1->kind != 8 && type1->type->kind == 0)
12700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12701 exp->expType = type1;
12705 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)))
12707 if(type2->kind != 8 && type2->type->kind == 0)
12708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12709 exp->expType = type2;
12713 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))
12715 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12719 unsigned int success = 0x0;
12721 if(type1->kind == 13 && type2->kind == 13)
12723 if(exp->op.op == '+')
12724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12725 else if(exp->op.op == '-')
12727 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12729 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12731 if(type1->type->kind == 20)
12733 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12737 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12739 ProcessExpressionType(classExp);
12741 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")))))));
12742 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12750 if(!success && exp->op.exp1->type == 2)
12752 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12755 FreeType(exp->expType);
12756 exp->expType = exp->op.exp1->destType;
12757 if(exp->op.exp1->destType)
12758 exp->op.exp1->destType->refCount++;
12761 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12764 FreeType(exp->expType);
12765 exp->expType = exp->op.exp2->destType;
12766 if(exp->op.exp2->destType)
12767 exp->op.exp2->destType->refCount++;
12773 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12776 FreeType(exp->expType);
12777 exp->expType = exp->op.exp2->destType;
12778 if(exp->op.exp2->destType)
12779 exp->op.exp2->destType->refCount++;
12782 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12785 FreeType(exp->expType);
12786 exp->expType = exp->op.exp1->destType;
12787 if(exp->op.exp1->destType)
12788 exp->op.exp1->destType->refCount++;
12794 char expString1[10240];
12795 char expString2[10240];
12799 expString1[0] = '\0';
12800 expString2[0] = '\0';
12805 PrintExpression(exp->op.exp1, expString1);
12806 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12807 PrintExpression(exp->op.exp2, expString2);
12808 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12809 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12810 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12812 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12816 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12818 if(exp->op.exp1->destType)
12819 FreeType(exp->op.exp1->destType);
12820 exp->op.exp1->destType = type2->_class->registered->dataType;
12821 if(type2->_class->registered->dataType)
12822 type2->_class->registered->dataType->refCount++;
12823 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12824 exp->expType = type2;
12828 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12830 if(exp->op.exp2->destType)
12831 FreeType(exp->op.exp2->destType);
12832 exp->op.exp2->destType = type1->_class->registered->dataType;
12833 if(type1->_class->registered->dataType)
12834 type1->_class->registered->dataType->refCount++;
12835 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12836 exp->expType = type1;
12842 unsigned int valid = 0x0;
12844 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12846 if(exp->op.exp2->destType)
12847 FreeType(exp->op.exp2->destType);
12848 if(!type1->_class->registered->dataType)
12849 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12850 exp->op.exp2->destType = type1->_class->registered->dataType;
12851 exp->op.exp2->destType->refCount++;
12852 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12853 type2 = exp->op.exp2->destType;
12854 exp->expType = type2;
12857 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12859 if(exp->op.exp1->destType)
12860 FreeType(exp->op.exp1->destType);
12861 if(!type2->_class->registered->dataType)
12862 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12863 exp->op.exp1->destType = type2->_class->registered->dataType;
12864 exp->op.exp1->destType->refCount++;
12865 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12866 type1 = exp->op.exp1->destType;
12867 exp->expType = type1;
12870 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12872 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12874 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12877 FreeType(exp->expType);
12878 exp->expType = exp->op.exp1->expType;
12879 if(exp->op.exp2->expType)
12880 exp->op.exp1->expType->refCount++;
12884 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12886 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12889 FreeType(exp->expType);
12890 exp->expType = exp->op.exp2->expType;
12891 if(exp->op.exp2->expType)
12892 exp->op.exp2->expType->refCount++;
12899 if(exp->op.exp2->destType)
12900 FreeType(exp->op.exp2->destType);
12901 exp->op.exp2->destType = type1;
12903 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12906 FreeType(exp->expType);
12907 exp->expType = exp->op.exp2->destType;
12908 if(exp->op.exp2->destType)
12909 exp->op.exp2->destType->refCount++;
12911 else if(type1 && type2)
12913 char expString1[10240];
12914 char expString2[10240];
12915 char type1String[1024];
12916 char type2String[1024];
12918 expString1[0] = '\0';
12919 expString2[0] = '\0';
12920 type1String[0] = '\0';
12921 type2String[0] = '\0';
12924 PrintExpression(exp->op.exp1, expString1);
12925 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12926 PrintExpression(exp->op.exp2, expString2);
12927 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12928 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12929 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12931 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12932 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12934 exp->expType = exp->op.exp1->expType;
12935 if(exp->op.exp1->expType)
12936 exp->op.exp1->expType->refCount++;
12938 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12940 exp->expType = exp->op.exp2->expType;
12941 if(exp->op.exp2->expType)
12942 exp->op.exp2->expType->refCount++;
12949 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12951 struct Type * oldType = exp->op.exp1->expType;
12953 exp->op.exp1->expType = (((void *)0));
12954 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12957 exp->op.exp1->expType = oldType;
12959 if(exp->op.exp1->destType)
12960 FreeType(exp->op.exp1->destType);
12961 exp->op.exp1->destType = type2;
12963 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12966 FreeType(exp->expType);
12967 exp->expType = exp->op.exp1->destType;
12968 if(exp->op.exp1->destType)
12969 exp->op.exp1->destType->refCount++;
12973 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12975 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12977 if(exp->op.exp1->destType)
12978 FreeType(exp->op.exp1->destType);
12979 exp->op.exp1->destType = type2->_class->registered->dataType;
12980 if(type2->_class->registered->dataType)
12981 type2->_class->registered->dataType->refCount++;
12982 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12984 if(exp->op.op == '!')
12986 exp->expType = MkClassType("bool");
12987 exp->expType->truth = 0x1;
12991 exp->expType = type2;
12996 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12998 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13000 if(exp->op.exp2->destType)
13001 FreeType(exp->op.exp2->destType);
13002 exp->op.exp2->destType = type1->_class->registered->dataType;
13003 if(type1->_class->registered->dataType)
13004 type1->_class->registered->dataType->refCount++;
13005 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13007 exp->expType = type1;
13013 if(exp->op.exp1 && !exp->op.exp1->expType)
13015 char expString[10000];
13017 expString[0] = '\0';
13020 PrintExpression(exp->op.exp1, expString);
13021 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13024 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13026 if(exp->op.exp2 && !exp->op.exp2->expType)
13028 char expString[10240];
13030 expString[0] = '\0';
13033 PrintExpression(exp->op.exp2, expString);
13034 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13037 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13041 FreeType(exp->expType);
13042 exp->expType = MkClassType("bool");
13043 exp->expType->truth = 0x1;
13045 if(exp->op.op != SIZEOF)
13046 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13047 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13049 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13051 yylloc = oldyylloc;
13058 struct Expression * e;
13060 exp->isConstant = 0x1;
13061 for(e = (*exp->list).first; e; e = e->next)
13063 unsigned int inced = 0x0;
13067 FreeType(e->destType);
13068 e->destType = exp->destType;
13071 exp->destType->refCount++;
13072 e->destType->count++;
13076 ProcessExpressionType(e);
13078 exp->destType->count--;
13079 if(!exp->expType && !e->next)
13081 exp->expType = e->expType;
13083 e->expType->refCount++;
13086 exp->isConstant = 0x0;
13088 e = (*exp->list).first;
13089 if(!e->next && e->type == 8)
13091 struct Expression * next = exp->next, * prev = exp->prev;
13093 FreeType(exp->expType);
13094 FreeType(exp->destType);
13095 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13099 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13100 ProcessExpressionType(exp);
13106 struct Expression * e;
13108 exp->isConstant = 0x1;
13109 ProcessExpressionType(exp->index.exp);
13110 if(!exp->index.exp->isConstant)
13111 exp->isConstant = 0x0;
13112 if(exp->index.exp->expType)
13114 struct Type * source = exp->index.exp->expType;
13116 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)
13118 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13120 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13121 if(exp->index.index && (*exp->index.index).last)
13123 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13127 for(e = (*exp->index.index).first; e; e = e->next)
13129 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13132 FreeType(e->destType);
13133 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13135 ProcessExpressionType(e);
13140 exp->isConstant = 0x0;
13143 exp->expType = Dereference(exp->index.exp->expType);
13145 DeclareType(exp->expType, 0x0, 0x0);
13150 struct Expression * e;
13151 struct Type * functionType;
13152 struct Type * methodType = (((void *)0));
13158 PrintExpression(exp->call.exp, name);
13159 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13161 PrintExpression(exp->call.exp, name);
13164 if(exp->call.exp->type == 0)
13166 struct Expression * idExp = exp->call.exp;
13167 struct Identifier * id = idExp->identifier;
13169 if(!strcmp(id->string, "__ENDIAN_PAD"))
13171 exp->expType = ProcessTypeString("int", 0x1);
13172 if(exp->call.arguments && (*exp->call.arguments).first)
13173 ProcessExpressionType((*exp->call.arguments).first);
13176 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13178 struct Expression * a = (((void *)0));
13179 struct Expression * b = (((void *)0));
13180 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13182 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13184 a = (*exp->call.arguments).first;
13185 b = (*exp->call.arguments).last;
13189 else if((*exp->call.arguments).count == 1)
13191 a = (*exp->call.arguments).first;
13196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13197 idExp->identifier = (((void *)0));
13198 FreeExpContents(exp);
13199 ProcessExpressionType(a);
13201 ProcessExpressionType(b);
13203 exp->list = MkList();
13204 if(a->expType && (!b || b->expType))
13206 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13210 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13211 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13212 struct Declaration * decl;
13213 char temp1[1024], temp2[1024];
13215 GetTypeSpecs(a->expType, specs);
13216 if(a && !a->isConstant && a->type != 0)
13218 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13219 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13220 tempExp1 = QMkExpId(temp1);
13221 tempExp1->expType = a->expType;
13223 a->expType->refCount++;
13224 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13226 if(b && !b->isConstant && b->type != 0)
13228 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13229 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13230 tempExp2 = QMkExpId(temp2);
13231 tempExp2->expType = b->expType;
13233 b->expType->refCount++;
13234 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13236 decl = MkDeclaration(specs, decls);
13237 if(!curCompound->compound.declarations)
13238 curCompound->compound.declarations = MkList();
13239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13243 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13245 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13247 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13248 exp->expType = a->expType;
13250 a->expType->refCount++;
13252 else if(!strcmp(id->string, "Abs"))
13254 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13255 exp->expType = a->expType;
13257 a->expType->refCount++;
13259 else if(!strcmp(id->string, "Sgn"))
13261 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"))))));
13262 exp->expType = ProcessTypeString("int", 0x0);
13264 FreeExpression(tempExp1);
13266 FreeExpression(tempExp2);
13267 FreeIdentifier(id);
13273 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13275 if(!exp->call.exp->destType)
13277 exp->call.exp->destType = dummy;
13280 ProcessExpressionType(exp->call.exp);
13281 if(exp->call.exp->destType == dummy)
13284 exp->call.exp->destType = (((void *)0));
13288 functionType = exp->call.exp->expType;
13289 if(functionType && functionType->kind == 16)
13291 methodType = functionType;
13292 functionType = methodType->method->dataType;
13293 if(exp->call.exp->expType->usedClass)
13295 char typeString[1024];
13297 typeString[0] = '\0';
13298 PrintType(functionType, typeString, 0x1, 0x1);
13299 if(strstr(typeString, "thisclass"))
13301 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13302 struct Declarator * decl;
13305 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13307 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13308 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13309 thisClassParams = 0x0;
13310 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13312 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13314 thisClass = exp->call.exp->expType->usedClass;
13315 ProcessDeclarator(decl);
13316 thisClass = backupThisClass;
13318 thisClassParams = 0x1;
13319 functionType = ProcessType(specs, decl);
13320 functionType->refCount = 0;
13321 FinishTemplatesContext(context);
13323 FreeList(specs, FreeSpecifier);
13324 FreeDeclarator(decl);
13328 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13330 struct Type * type = functionType->type;
13332 if(!functionType->refCount)
13334 functionType->type = (((void *)0));
13335 FreeType(functionType);
13337 functionType = type;
13339 if(functionType && functionType->kind != 11)
13341 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13343 else if(functionType)
13345 unsigned int emptyParams = 0x0, noParams = 0x0;
13346 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13347 struct Type * type = functionType->params.first;
13348 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13350 struct Location oldyylloc = yylloc;
13354 if(functionType->extraParam && e)
13356 e->destType = MkClassType(functionType->thisClass->string);
13359 if(!functionType->staticMethod)
13361 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13363 type = MkClassType(memberExp->member.exp->expType->_class->string);
13366 e->destType = type;
13368 type = functionType->params.first;
13371 type->refCount = 0;
13373 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13375 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13378 e->destType = type;
13380 type = functionType->params.first;
13383 type->refCount = 0;
13386 if(type && type->kind == 0)
13389 if(!type->refCount)
13391 type = (((void *)0));
13393 for(; e; e = e->next)
13395 if(!type && !emptyParams)
13398 if(methodType && methodType->methodClass)
13399 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);
13401 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);
13404 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13406 struct Type * templatedType = (((void *)0));
13407 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13408 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13411 if(_class && _class->templateArgs)
13413 struct __ecereNameSpace__ecere__com__Class * sClass;
13415 for(sClass = _class; sClass; sClass = sClass->base)
13417 if(sClass->templateClass)
13418 sClass = sClass->templateClass;
13420 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13422 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13424 struct __ecereNameSpace__ecere__com__Class * nextClass;
13426 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13428 if(nextClass->templateClass)
13429 nextClass = nextClass->templateClass;
13430 id += nextClass->templateParams.count;
13440 if(curParam && _class->templateArgs[id].dataTypeString)
13442 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13445 struct Context * context = SetupTemplatesContext(_class);
13447 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13448 FinishTemplatesContext(context);
13450 e->destType = templatedType;
13453 templatedType->passAsTemplate = 0x1;
13458 e->destType = type;
13465 e->destType = type;
13469 if(type && type->kind != 14)
13471 struct Type * next = type->next;
13473 if(!type->refCount)
13478 if(type && type->kind != 14)
13480 if(methodType && methodType->methodClass)
13481 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);
13483 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);
13485 yylloc = oldyylloc;
13486 if(type && !type->refCount)
13491 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13492 if(exp->call.exp->type == 0)
13494 char * string = exp->call.exp->identifier->string;
13498 struct Symbol * symbol;
13499 struct Location oldyylloc = yylloc;
13501 yylloc = exp->call.exp->identifier->loc;
13502 if(strstr(string, "__builtin_") == string)
13505 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13506 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));
13507 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13508 if(strstr(symbol->string, "::"))
13509 globalContext->hasNameSpace = 0x1;
13510 yylloc = oldyylloc;
13513 else if(exp->call.exp->type == 8)
13517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13518 if(!functionType->returnType)
13520 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13523 if(functionType && functionType->kind == 11)
13525 exp->expType = functionType->returnType;
13526 if(functionType->returnType)
13527 functionType->returnType->refCount++;
13528 if(!functionType->refCount)
13529 FreeType(functionType);
13531 if(exp->call.arguments)
13533 for(e = (*exp->call.arguments).first; e; e = e->next)
13535 struct Type * destType = e->destType;
13537 ProcessExpressionType(e);
13544 struct Type * type;
13545 struct Location oldyylloc = yylloc;
13546 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13548 exp->thisPtr = thisPtr;
13549 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13551 exp->member.member->classSym = exp->member.member->_class->symbol;
13553 ProcessExpressionType(exp->member.exp);
13554 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)
13556 exp->isConstant = 0x0;
13559 exp->isConstant = exp->member.exp->isConstant;
13560 type = exp->member.exp->expType;
13562 if(type && (type->kind == 20))
13564 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13565 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13569 for(param = _class->templateParams.first; param; param = param->next)
13571 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13575 if(param && param->defaultArg.member)
13577 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13581 struct Expression * expMember = exp->member.exp;
13582 struct Declarator * decl;
13583 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13584 char thisClassTypeString[1024];
13586 FreeIdentifier(exp->member.member);
13587 ProcessExpressionType(argExp);
13589 char * colon = strstr(param->defaultArg.memberString, "::");
13593 char className[1024];
13594 struct __ecereNameSpace__ecere__com__Class * sClass;
13596 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13597 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13600 strcpy(thisClassTypeString, _class->fullName);
13602 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13603 exp->expType = ProcessType(specs, decl);
13604 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13606 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13607 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13609 int paramCount = 0;
13610 int lastParam = -1;
13611 char templateString[1024];
13612 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13614 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13615 for(cClass = expClass; cClass; cClass = cClass->base)
13619 for(param = cClass->templateParams.first; param; param = param->next)
13622 struct __ecereNameSpace__ecere__com__Class * sClass;
13623 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13625 for(sClass = cClass->base; sClass; sClass = sClass->base)
13626 id += sClass->templateParams.count;
13627 arg = expClass->templateArgs[id];
13628 for(sClass = _class; sClass; sClass = sClass->base)
13630 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13632 struct __ecereNameSpace__ecere__com__Class * nextClass;
13634 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13635 p += nextClass->templateParams.count;
13636 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13638 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13640 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13642 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13643 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13650 char argument[256];
13652 argument[0] = '\0';
13653 switch(param->type)
13657 char expString[1024];
13658 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13659 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13660 struct Expression * exp;
13661 char * string = PrintHexUInt64(arg.expression.ui64);
13663 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13664 ProcessExpressionType(exp);
13665 ComputeExpression(exp);
13666 expString[0] = '\0';
13667 PrintExpression(exp, expString);
13668 strcat(argument, expString);
13669 FreeExpression(exp);
13674 strcat(argument, arg.member->name);
13679 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13681 if(!strcmp(arg.dataTypeString, "thisclass"))
13682 strcat(argument, thisClassTypeString);
13684 strcat(argument, arg.dataTypeString);
13692 strcat(templateString, ", ");
13693 if(lastParam != p - 1)
13695 strcat(templateString, param->name);
13696 strcat(templateString, " = ");
13698 strcat(templateString, argument);
13707 int len = strlen(templateString);
13709 if(templateString[len - 1] == '>')
13710 templateString[len++] = ' ';
13711 templateString[len++] = '>';
13712 templateString[len++] = '\0';
13715 struct Context * context = SetupTemplatesContext(_class);
13717 FreeType(exp->expType);
13718 exp->expType = ProcessTypeString(templateString, 0x0);
13719 FinishTemplatesContext(context);
13723 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")))))))));
13726 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13728 type = ProcessTemplateParameterType(type->templateParameter);
13731 if(type && (type->kind == 20))
13733 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13735 struct Identifier * id = exp->member.member;
13736 int typeKind = type->kind;
13737 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));
13739 if(typeKind == 19 && exp->member.exp->type == 26)
13741 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13744 if(id && (typeKind == 3 || typeKind == 15))
13745 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13748 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13749 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13750 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13751 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13752 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13754 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13755 exp->member.memberType = 1;
13756 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13757 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13760 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13762 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13763 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13765 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13767 member = (((void *)0));
13769 if(!member && !prop)
13770 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13771 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13772 exp->member.thisPtr = 0x1;
13778 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13779 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13780 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13782 if(!prop && !member)
13784 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13787 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13788 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13789 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13794 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13795 prop = (((void *)0));
13797 member = (((void *)0));
13801 if(!prop && !member)
13802 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13803 if(!prop && !member && !method)
13807 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13810 exp->member.memberType = 5;
13811 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13815 char structName[1024];
13816 struct Identifier * id = exp->member.member;
13817 struct Expression * classExp = exp->member.exp;
13820 FreeType(classExp->expType);
13821 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13822 strcpy(structName, "__ecereClassData_");
13823 FullClassNameCat(structName, type->_class->string, 0x0);
13825 exp->member.member = id;
13826 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"))))))));
13828 ProcessExpressionType(exp);
13834 struct Symbol * classSym = FindClass(id->string);
13838 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13841 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13847 exp->member.memberType = 1;
13848 if(!prop->dataType)
13849 ProcessPropertyType(prop);
13850 exp->expType = prop->dataType;
13852 prop->dataType->refCount++;
13856 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13858 FreeExpContents(exp);
13860 exp->identifier = MkIdentifier("class");
13861 ProcessExpressionType(exp);
13864 exp->member.memberType = 3;
13865 DeclareStruct(_class->fullName, 0x0);
13866 if(!member->dataType)
13868 struct Context * context = SetupTemplatesContext(_class);
13870 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13871 FinishTemplatesContext(context);
13873 exp->expType = member->dataType;
13874 if(member->dataType)
13875 member->dataType->refCount++;
13877 else if(revConvert)
13879 exp->member.memberType = 4;
13880 exp->expType = MkClassType(revConvert->_class->fullName);
13886 exp->member.memberType = 2;
13888 if(!method->dataType)
13889 ProcessMethodType(method);
13890 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));
13891 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13892 exp->expType->usedClass = _class;
13894 else if(!classProp)
13896 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13898 FreeExpContents(exp);
13900 exp->identifier = MkIdentifier("class");
13901 ProcessExpressionType(exp);
13904 yylloc = exp->member.member->loc;
13905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13907 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13909 if(_class && exp->expType)
13911 struct __ecereNameSpace__ecere__com__Class * tClass;
13914 while(tClass && !tClass->templateClass)
13915 tClass = tClass->base;
13916 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13919 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13920 struct __ecereNameSpace__ecere__com__Class * sClass;
13922 for(sClass = tClass; sClass; sClass = sClass->base)
13925 if(sClass->templateClass)
13926 sClass = sClass->templateClass;
13927 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13929 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13931 for(sClass = sClass->base; sClass; sClass = sClass->base)
13932 id += sClass->templateParams.count;
13940 if(curParam && tClass->templateArgs[id].dataTypeString)
13942 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13943 struct Context * context = SetupTemplatesContext(tClass);
13945 FreeType(exp->expType);
13946 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13949 if(exp->expType->kind == 21)
13951 FreeType(exp->expType);
13952 exp->expType = ReplaceThisClassType(_class);
13954 if(tClass->templateClass)
13955 exp->expType->passAsTemplate = 0x1;
13958 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13959 if(exp->destType->kind == 21)
13961 FreeType(exp->destType);
13962 exp->destType = ReplaceThisClassType(_class);
13966 FinishTemplatesContext(context);
13969 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13972 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13973 struct __ecereNameSpace__ecere__com__Class * sClass;
13975 for(sClass = tClass; sClass; sClass = sClass->base)
13978 if(sClass->templateClass)
13979 sClass = sClass->templateClass;
13980 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13982 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13984 for(sClass = sClass->base; sClass; sClass = sClass->base)
13985 id += sClass->templateParams.count;
13995 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13996 struct Context * context = SetupTemplatesContext(tClass);
13997 struct Type * basicType;
13999 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14002 if(basicType->kind == 21)
14004 FreeType(basicType);
14005 basicType = ReplaceThisClassType(_class);
14007 FreeType(exp->expType);
14008 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));
14011 exp->destType = exp->expType;
14012 exp->destType->refCount++;
14015 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14016 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14017 struct Declarator * decl;
14019 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14022 exp->destType->refCount++;
14024 exp->expType->refCount++;
14026 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14027 exp->cast.exp = newExp;
14030 FinishTemplatesContext(context);
14033 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14035 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14039 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14042 int paramCount = 0;
14043 int lastParam = -1;
14044 char templateString[1024];
14045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14047 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14048 while(cClass != expClass)
14050 struct __ecereNameSpace__ecere__com__Class * sClass;
14052 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14055 for(param = cClass->templateParams.first; param; param = param->next)
14057 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14060 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14061 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14063 while(cClassCur != tClass && !paramCur)
14065 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14067 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14069 cClassCur = sClassCur;
14070 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14072 if(!strcmp(paramCur->name, param->name))
14079 if(paramCur && paramCur->type == 0)
14080 arg = tClass->templateArgs[cp];
14082 arg = expClass->templateArgs[p];
14084 char argument[256];
14086 argument[0] = '\0';
14087 switch(param->type)
14091 char expString[1024];
14092 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14093 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14094 struct Expression * exp;
14095 char * string = PrintHexUInt64(arg.expression.ui64);
14097 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14098 ProcessExpressionType(exp);
14099 ComputeExpression(exp);
14100 expString[0] = '\0';
14101 PrintExpression(exp, expString);
14102 strcat(argument, expString);
14103 FreeExpression(exp);
14108 strcat(argument, arg.member->name);
14113 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14114 strcat(argument, arg.dataTypeString);
14121 strcat(templateString, ", ");
14122 if(lastParam != p - 1)
14124 strcat(templateString, param->name);
14125 strcat(templateString, " = ");
14127 strcat(templateString, argument);
14136 int len = strlen(templateString);
14138 if(templateString[len - 1] == '>')
14139 templateString[len++] = ' ';
14140 templateString[len++] = '>';
14141 templateString[len++] = '\0';
14143 FreeType(exp->expType);
14145 struct Context * context = SetupTemplatesContext(tClass);
14147 exp->expType = ProcessTypeString(templateString, 0x0);
14148 FinishTemplatesContext(context);
14155 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)");
14157 else if(type && (type->kind == 9 || type->kind == 10))
14159 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14163 exp->expType = memberType;
14165 memberType->refCount++;
14170 char expString[10240];
14172 expString[0] = '\0';
14175 PrintExpression(exp, expString);
14176 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14180 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14182 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14184 struct Identifier * id = exp->member.member;
14185 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));
14189 FreeType(exp->expType);
14190 exp->expType = ReplaceThisClassType(_class);
14194 yylloc = oldyylloc;
14199 struct Type * destType = exp->destType;
14201 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14203 exp->member.member->classSym = exp->member.member->_class->symbol;
14205 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14209 ProcessExpressionType(exp);
14216 struct Symbol * classSym = exp->_class->symbol;
14218 if(classSym && classSym->registered)
14220 if(classSym->registered->type == 5)
14225 DeclareStruct(classSym->string, 0x0);
14226 FreeSpecifier(exp->_class);
14228 FullClassNameCat(name, classSym->string, 0x0);
14229 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14233 if(classSym->registered->fixed)
14235 FreeSpecifier(exp->_class);
14236 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14241 char className[1024];
14243 strcpy(className, "__ecereClass_");
14244 FullClassNameCat(className, classSym->string, 0x1);
14245 MangleClassName(className);
14246 DeclareClass(classSym, className);
14247 FreeExpContents(exp);
14249 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14250 exp->member.member = MkIdentifier("structSize");
14254 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14259 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14261 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14262 exp->isConstant = 0x1;
14263 DeclareType(type, 0x0, 0x0);
14269 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14271 type->count = (unsigned int)1;
14272 FreeType(exp->cast.exp->destType);
14273 exp->cast.exp->destType = type;
14275 ProcessExpressionType(exp->cast.exp);
14276 type->count = (unsigned int)0;
14277 exp->expType = type;
14278 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14280 void * prev = exp->prev, * next = exp->next;
14281 struct Type * expType = exp->cast.exp->destType;
14282 struct Expression * castExp = exp->cast.exp;
14283 struct Type * destType = exp->destType;
14286 expType->refCount++;
14287 FreeType(exp->expType);
14288 FreeTypeName(exp->cast.typeName);
14290 FreeType(exp->expType);
14291 FreeType(exp->destType);
14292 exp->expType = expType;
14293 exp->destType = destType;
14294 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14300 exp->isConstant = exp->cast.exp->isConstant;
14306 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14309 exp->expType = type;
14314 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14316 ProcessExpressionType(exp->vaArg.exp);
14318 exp->expType = type;
14323 struct Expression * e;
14325 exp->isConstant = 0x1;
14326 FreeType(exp->cond.cond->destType);
14327 exp->cond.cond->destType = MkClassType("bool");
14328 exp->cond.cond->destType->truth = 0x1;
14329 ProcessExpressionType(exp->cond.cond);
14330 if(!exp->cond.cond->isConstant)
14331 exp->isConstant = 0x0;
14332 for(e = (*exp->cond.exp).first; e; e = e->next)
14336 FreeType(e->destType);
14337 e->destType = exp->destType;
14339 e->destType->refCount++;
14341 ProcessExpressionType(e);
14344 exp->expType = e->expType;
14346 e->expType->refCount++;
14349 exp->isConstant = 0x0;
14351 FreeType(exp->cond.elseExp->destType);
14352 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14353 if(exp->cond.elseExp->destType)
14354 exp->cond.elseExp->destType->refCount++;
14355 ProcessExpressionType(exp->cond.elseExp);
14356 if(!exp->cond.elseExp->isConstant)
14357 exp->isConstant = 0x0;
14362 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14364 struct Statement * last = (*exp->compound->compound.statements).last;
14366 if(last->type == 3 && last->expressions && (*last->expressions).last)
14368 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14370 exp->destType->refCount++;
14372 ProcessStatement(exp->compound);
14373 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14374 if(((struct Expression *)(*last->expressions).last)->expType)
14375 exp->expType->refCount++;
14381 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14383 if(spec && spec->type == 1)
14385 exp->expType = MkClassType(spec->name);
14386 exp->expType->kind = 19;
14387 exp->byReference = 0x1;
14391 exp->expType = MkClassType("ecere::com::Class");
14392 exp->byReference = 0x1;
14398 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14402 struct Identifier * id = exp->classData.id;
14403 char structName[1024];
14404 struct Expression * classExp;
14406 strcpy(structName, "__ecereClassData_");
14407 FullClassNameCat(structName, _class->fullName, 0x0);
14409 exp->member.member = id;
14410 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14411 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14413 classExp = MkExpIdentifier(MkIdentifier("class"));
14414 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"))))))));
14415 ProcessExpressionType(exp);
14422 struct Type * type = (((void *)0));
14423 char * typeString = (((void *)0));
14424 char typeStringBuf[1024];
14426 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))
14428 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14430 typeString = templateClass->templateArgs[2].dataTypeString;
14434 struct Expression * e;
14436 for(e = (*exp->list).first; e; e = e->next)
14438 ProcessExpressionType(e);
14448 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14452 e->expType = (((void *)0));
14453 e = (*exp->list).first;
14454 ProcessExpressionType(e);
14457 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14459 FreeType(e->expType);
14460 e->expType = (((void *)0));
14462 type = (((void *)0));
14470 FreeType(e->expType);
14471 e->expType = (((void *)0));
14477 typeStringBuf[0] = '\0';
14478 PrintType(type, typeStringBuf, 0x0, 0x1);
14479 typeString = typeStringBuf;
14481 type = (((void *)0));
14486 char templateString[1024];
14487 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14488 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14489 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14490 struct Expression * expExt;
14491 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14493 sprintf(templateString, "Container<%s>", typeString);
14496 struct Expression * e;
14498 type = ProcessTypeString(typeString, 0x0);
14499 while(e = (*exp->list).first)
14501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14502 e->destType = type;
14504 ProcessExpressionType(e);
14505 ListAdd(initializers, MkInitializerAssignment(e));
14508 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14510 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14511 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14512 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14517 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14519 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, 0), ((struct Expression *)__ecereTemp1))));
14520 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14521 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14522 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14523 exp->expType = ProcessTypeString(templateString, 0x0);
14525 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14526 ProcessExpressionType(expExt);
14530 exp->expType = ProcessTypeString("Container", 0x0);
14531 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14536 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14538 FreeType(exp->expType);
14539 exp->expType = ReplaceThisClassType(thisClass);
14541 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14543 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14547 if(exp->expType->kind != 15)
14549 struct Type * member;
14550 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14552 FreeType(exp->expType);
14553 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14554 exp->expType->kind = symbol->type->kind;
14555 exp->expType->refCount++;
14556 exp->expType->enumName = enumName;
14557 exp->expType->members = symbol->type->members;
14558 for(member = symbol->type->members.first; member; member = member->next)
14559 member->refCount++;
14563 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14565 for(member = symbol->type->members.first; member; member = member->next)
14567 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14569 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14575 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14577 else if(exp->destType && !exp->destType->keepCast)
14579 if(!CheckExpressionType(exp, exp->destType, 0x0))
14581 if(!exp->destType->count || unresolved)
14586 if(exp->destType->kind != 14)
14593 char expString[10240];
14595 expString[0] = '\0';
14596 PrintType(exp->destType, type2, 0x0, 0x1);
14599 PrintExpression(exp, expString);
14600 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14604 else if(exp->type != 16)
14605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14610 char expString[10240];
14612 expString[0] = '\0';
14615 PrintExpression(exp, expString);
14616 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14619 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14620 else if(exp->type != 16)
14621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14633 PrintType(exp->expType, type1, 0x0, 0x1);
14634 PrintType(exp->destType, type2, 0x0, 0x1);
14636 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)))
14640 char expString[10240];
14642 expString[0] = '\0';
14645 PrintExpression(exp, expString);
14646 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14648 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14649 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14650 FreeType(exp->expType);
14651 exp->destType->refCount++;
14652 exp->expType = exp->destType;
14657 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14659 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14660 char typeString[1024];
14661 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14662 struct Declarator * decl;
14664 typeString[0] = '\0';
14667 exp->expType->refCount++;
14669 exp->expType->refCount++;
14671 newExp->destType = exp->expType;
14672 PrintType(exp->expType, typeString, 0x0, 0x0);
14673 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14674 exp->cast.typeName = MkTypeName(specs, decl);
14675 exp->cast.exp = newExp;
14678 else if(unresolved)
14680 if(exp->identifier->_class && exp->identifier->_class->name)
14681 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14682 else if(exp->identifier->string && exp->identifier->string[0])
14683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14685 else if(!exp->expType && exp->type != 16)
14687 char expString[10240];
14689 expString[0] = '\0';
14692 PrintExpression(exp, expString);
14693 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14695 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14697 ApplyAnyObjectLogic(exp);
14698 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14700 exp->byReference = 0x1;
14702 yylloc = oldyylloc;
14705 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)
14709 *curMember = (*curMember)->next;
14710 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14712 *curMember = subMemberStack[--(*subMemberStackPos)];
14713 *curMember = (*curMember)->next;
14715 while((*curMember) && (*curMember)->isProperty)
14716 *curMember = (*curMember)->next;
14717 if(subMemberStackPos)
14719 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14721 subMemberStack[(*subMemberStackPos)++] = *curMember;
14722 *curMember = (*curMember)->members.first;
14723 while(*curMember && (*curMember)->isProperty)
14724 *curMember = (*curMember)->next;
14732 if(subMemberStackPos && *subMemberStackPos)
14734 *curMember = subMemberStack[--(*subMemberStackPos)];
14735 *curMember = (*curMember)->next;
14739 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14741 if(*curClass == _class)
14743 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14745 *curMember = (*curClass)->membersAndProperties.first;
14747 while((*curMember) && (*curMember)->isProperty)
14748 *curMember = (*curMember)->next;
14749 if(subMemberStackPos)
14751 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14753 subMemberStack[(*subMemberStackPos)++] = *curMember;
14754 *curMember = (*curMember)->members.first;
14755 while(*curMember && (*curMember)->isProperty)
14756 *curMember = (*curMember)->next;
14763 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14768 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14770 if(init->exp && !init->exp->destType)
14772 FreeType(init->exp->destType);
14773 init->exp->destType = type;
14779 ProcessExpressionType(init->exp);
14780 init->isConstant = init->exp->isConstant;
14786 struct Expression * exp = init->exp;
14787 struct Instantiation * inst = exp->instance;
14788 struct MembersInit * members;
14791 init->list = MkList();
14794 for(members = (*inst->members).first; members; members = members->next)
14796 if(members->type == 0)
14798 struct MemberInit * member;
14800 for(member = (*members->dataMembers).first; member; member = member->next)
14802 ListAdd(init->list, member->initializer);
14803 member->initializer = (((void *)0));
14808 FreeExpression(exp);
14812 struct Initializer * i;
14813 struct Type * initializerType = (((void *)0));
14814 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14815 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14816 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14817 int subMemberStackPos = 0;
14819 if(type && type->kind == 12)
14820 initializerType = Dereference(type);
14821 else if(type && (type->kind == 9 || type->kind == 10))
14822 initializerType = type->members.first;
14823 for(i = (*init->list).first; i; i = i->next)
14825 if(type && type->kind == 8 && type->_class && type->_class->registered)
14827 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14830 if(!curMember->dataType)
14831 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14832 initializerType = curMember->dataType;
14835 ProcessInitializer(i, initializerType);
14836 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14837 initializerType = initializerType->next;
14839 init->isConstant = 0x0;
14841 if(type && type->kind == 12)
14842 FreeType(initializerType);
14843 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14845 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14852 extern struct Symbol * FindType(struct Context * ctx, char * name);
14854 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14856 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14862 if(spec->specifier == THISCLASS)
14867 spec->name = ReplaceThisClass(thisClass);
14868 spec->symbol = FindClass(spec->name);
14869 ProcessSpecifier(spec, declareStruct);
14876 struct Symbol * symbol = FindType(curContext, spec->name);
14879 DeclareType(symbol->type, 0x1, 0x1);
14880 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14881 DeclareStruct(spec->name, 0x0);
14886 struct Enumerator * e;
14890 for(e = (*spec->list).first; e; e = e->next)
14893 ProcessExpressionType(e->exp);
14901 if(spec->definitions)
14903 struct ClassDef * def;
14904 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14906 ProcessClass(spec->definitions, symbol);
14913 static void ProcessDeclarator(struct Declarator * decl)
14918 if(decl->identifier->classSym)
14920 FreeSpecifier(decl->identifier->_class);
14921 decl->identifier->_class = (((void *)0));
14925 if(decl->array.exp)
14926 ProcessExpressionType(decl->array.exp);
14933 if(decl->declarator)
14934 ProcessDeclarator(decl->declarator);
14935 if(decl->type == 4)
14937 struct Identifier * id = GetDeclId(decl);
14939 if(id && id->_class)
14941 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14943 if(!decl->function.parameters)
14944 decl->function.parameters = MkList();
14945 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14946 id->_class = (((void *)0));
14948 if(decl->function.parameters)
14950 struct TypeName * param;
14952 for(param = (*decl->function.parameters).first; param; param = param->next)
14954 if(param->qualifiers && (*param->qualifiers).first)
14956 struct Specifier * spec = (*param->qualifiers).first;
14958 if(spec && spec->specifier == TYPED_OBJECT)
14960 struct Declarator * d = param->declarator;
14961 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);
14963 FreeList(param->qualifiers, FreeSpecifier);
14964 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14965 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14966 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14969 else if(spec && spec->specifier == ANY_OBJECT)
14971 struct Declarator * d = param->declarator;
14973 FreeList(param->qualifiers, FreeSpecifier);
14974 param->qualifiers = MkListOne(MkSpecifier(VOID));
14975 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14977 else if(spec->specifier == THISCLASS)
14982 spec->name = ReplaceThisClass(thisClass);
14983 spec->symbol = FindClass(spec->name);
14984 ProcessSpecifier(spec, 0x0);
14988 if(param->declarator)
14989 ProcessDeclarator(param->declarator);
14997 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14999 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15001 static void ProcessDeclaration(struct Declaration * decl)
15003 yylloc = decl->loc;
15008 unsigned int declareStruct = 0x0;
15010 if(decl->declarators)
15012 struct InitDeclarator * d;
15014 for(d = (*decl->declarators).first; d; d = d->next)
15016 struct Type * type, * subType;
15018 ProcessDeclarator(d->declarator);
15019 type = ProcessType(decl->specifiers, d->declarator);
15022 ProcessInitializer(d->initializer, type);
15023 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15025 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15027 struct Instantiation * inst = d->initializer->exp->instance;
15029 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15030 d->initializer->exp->instance = (((void *)0));
15031 if(decl->specifiers)
15032 FreeList(decl->specifiers, FreeSpecifier);
15033 FreeList(decl->declarators, FreeInitDeclarator);
15040 for(subType = type; subType; )
15042 if(subType->kind == 8)
15044 declareStruct = 0x1;
15047 else if(subType->kind == 13)
15049 else if(subType->kind == 12)
15050 subType = subType->arrayType;
15059 if(decl->specifiers)
15061 struct Specifier * s;
15063 for(s = (*decl->specifiers).first; s; s = s->next)
15065 ProcessSpecifier(s, declareStruct);
15072 ProcessInstantiationType(decl->inst);
15077 struct Specifier * spec;
15078 struct Declarator * d;
15079 unsigned int declareStruct = 0x0;
15081 if(decl->declarators)
15083 for(d = (*decl->declarators).first; d; d = d->next)
15085 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15086 struct Type * subType;
15088 ProcessDeclarator(d);
15089 for(subType = type; subType; )
15091 if(subType->kind == 8)
15093 declareStruct = 0x1;
15096 else if(subType->kind == 13)
15098 else if(subType->kind == 12)
15099 subType = subType->arrayType;
15106 if(decl->specifiers)
15108 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15109 ProcessSpecifier(spec, declareStruct);
15116 static struct FunctionDefinition * curFunction;
15118 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15120 char propName[1024], propNameM[1024];
15121 char getName[1024], setName[1024];
15122 struct __ecereNameSpace__ecere__sys__OldList * args;
15124 DeclareProperty(prop, setName, getName);
15125 strcpy(propName, "__ecereProp_");
15126 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15127 strcat(propName, "_");
15128 FullClassNameCat(propName, prop->name, 0x1);
15129 MangleClassName(propName);
15130 strcpy(propNameM, "__ecerePropM_");
15131 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15132 strcat(propNameM, "_");
15133 FullClassNameCat(propNameM, prop->name, 0x1);
15134 MangleClassName(propNameM);
15135 if(prop->isWatchable)
15138 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15139 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15140 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15142 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15143 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15144 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15148 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15149 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15150 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15152 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15153 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15154 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15156 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15157 curFunction->propSet->fireWatchersDone = 0x1;
15160 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15162 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15164 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15166 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15168 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15170 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15172 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15174 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15176 static void ProcessStatement(struct Statement * stmt)
15178 yylloc = stmt->loc;
15182 ProcessStatement(stmt->labeled.stmt);
15185 if(stmt->caseStmt.exp)
15187 FreeType(stmt->caseStmt.exp->destType);
15188 stmt->caseStmt.exp->destType = curSwitchType;
15190 curSwitchType->refCount++;
15191 ProcessExpressionType(stmt->caseStmt.exp);
15192 ComputeExpression(stmt->caseStmt.exp);
15194 if(stmt->caseStmt.stmt)
15195 ProcessStatement(stmt->caseStmt.stmt);
15199 if(stmt->compound.context)
15201 struct Declaration * decl;
15202 struct Statement * s;
15203 struct Statement * prevCompound = curCompound;
15204 struct Context * prevContext = curContext;
15206 if(!stmt->compound.isSwitch)
15208 curCompound = stmt;
15209 curContext = stmt->compound.context;
15211 if(stmt->compound.declarations)
15213 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15214 ProcessDeclaration(decl);
15216 if(stmt->compound.statements)
15218 for(s = (*stmt->compound.statements).first; s; s = s->next)
15219 ProcessStatement(s);
15221 curContext = prevContext;
15222 curCompound = prevCompound;
15228 struct Expression * exp;
15230 if(stmt->expressions)
15232 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15233 ProcessExpressionType(exp);
15239 struct Expression * exp;
15241 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15242 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15243 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15244 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15246 ProcessExpressionType(exp);
15248 if(stmt->ifStmt.stmt)
15249 ProcessStatement(stmt->ifStmt.stmt);
15250 if(stmt->ifStmt.elseStmt)
15251 ProcessStatement(stmt->ifStmt.elseStmt);
15256 struct Type * oldSwitchType = curSwitchType;
15258 if(stmt->switchStmt.exp)
15260 struct Expression * exp;
15262 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15266 ProcessExpressionType(exp);
15269 curSwitchType = exp->expType;
15272 ProcessStatement(stmt->switchStmt.stmt);
15273 curSwitchType = oldSwitchType;
15278 if(stmt->whileStmt.exp)
15280 struct Expression * exp;
15282 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15283 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15284 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15285 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15287 ProcessExpressionType(exp);
15290 if(stmt->whileStmt.stmt)
15291 ProcessStatement(stmt->whileStmt.stmt);
15296 if(stmt->doWhile.exp)
15298 struct Expression * exp;
15300 if((*stmt->doWhile.exp).last)
15302 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15303 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15304 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15306 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15308 ProcessExpressionType(exp);
15311 if(stmt->doWhile.stmt)
15312 ProcessStatement(stmt->doWhile.stmt);
15317 struct Expression * exp;
15319 if(stmt->forStmt.init)
15320 ProcessStatement(stmt->forStmt.init);
15321 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15323 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15324 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15325 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15327 if(stmt->forStmt.check)
15328 ProcessStatement(stmt->forStmt.check);
15329 if(stmt->forStmt.increment)
15331 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15332 ProcessExpressionType(exp);
15334 if(stmt->forStmt.stmt)
15335 ProcessStatement(stmt->forStmt.stmt);
15340 struct Identifier * id = stmt->forEachStmt.id;
15341 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15342 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15343 struct Statement * block = stmt->forEachStmt.stmt;
15344 char iteratorType[1024];
15345 struct Type * source;
15346 struct Expression * e;
15347 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));
15348 struct Expression * arrayExp;
15349 char * typeString = (((void *)0));
15350 int builtinCount = 0;
15352 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15356 FreeType(e->destType);
15357 e->destType = ProcessTypeString("Container", 0x0);
15359 if(!isBuiltin || e->next)
15360 ProcessExpressionType(e);
15362 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15363 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15365 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15366 struct Symbol * symbol;
15367 struct Expression * expIt = (((void *)0));
15368 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15369 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15370 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15371 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15374 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15375 stmt->compound.context->parent = curContext;
15376 curContext = stmt->compound.context;
15377 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15379 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15380 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15382 isCustomAVLTree = 0x1;
15383 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15385 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15388 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15390 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15392 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15395 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15399 struct Declarator * decl;
15400 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15402 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15403 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15404 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15408 struct Type * type = (((void *)0));
15409 char typeStringBuf[1024];
15411 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15412 if(((struct Expression *)(*exp).last)->type == 11)
15414 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15417 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15419 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)
15421 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15423 typeString = templateClass->templateArgs[2].dataTypeString;
15425 else if(arrayExp->list)
15427 struct Expression * e;
15429 for(e = (*arrayExp->list).first; e; e = e->next)
15431 ProcessExpressionType(e);
15441 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15445 e->expType = (((void *)0));
15446 e = (*arrayExp->list).first;
15447 ProcessExpressionType(e);
15450 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15452 FreeType(e->expType);
15453 e->expType = (((void *)0));
15455 type = (((void *)0));
15463 FreeType(e->expType);
15464 e->expType = (((void *)0));
15470 typeStringBuf[0] = '\0';
15471 PrintType(type, typeStringBuf, 0x0, 0x1);
15472 typeString = typeStringBuf;
15478 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15479 struct Declarator * decl;
15480 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15484 struct Expression * e;
15486 builtinCount = (*arrayExp->list).count;
15487 type = ProcessTypeString(typeString, 0x0);
15488 while(e = (*arrayExp->list).first)
15490 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15491 e->destType = type;
15493 ProcessExpressionType(e);
15494 ListAdd(initializers, MkInitializerAssignment(e));
15497 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15499 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15500 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15501 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15502 FreeList(exp, FreeExpression);
15506 arrayExp->expType = ProcessTypeString("Container", 0x0);
15507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15510 else if(isLinkList && !isList)
15512 struct Declarator * decl;
15513 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15515 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15516 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15517 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15519 else if(_class->templateArgs)
15522 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15524 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15525 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15527 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15528 if(block && block->type == 2 && block->compound.context)
15530 block->compound.context->parent = stmt->compound.context;
15534 block = MkIfStmt(filter, block, (((void *)0)));
15538 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));
15539 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15540 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15541 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15547 sprintf(count, "%d", builtinCount);
15548 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));
15549 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15550 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15551 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15553 else if(isLinkList && !isList)
15555 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15556 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15558 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15560 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));
15564 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15565 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15567 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));
15569 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15570 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15571 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15575 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15577 ProcessExpressionType(expIt);
15578 if((*stmt->compound.declarations).first)
15579 ProcessDeclaration((*stmt->compound.declarations).first);
15581 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15582 ProcessStatement(stmt);
15583 curContext = stmt->compound.context->parent;
15588 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15600 struct Expression * exp;
15602 if(stmt->expressions)
15604 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15608 if(curFunction && !curFunction->type)
15609 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15610 FreeType(exp->destType);
15611 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15613 exp->destType->refCount++;
15615 ProcessExpressionType(exp);
15622 ProcessDeclaration(stmt->decl);
15627 struct AsmField * field;
15629 if(stmt->asmStmt.inputFields)
15631 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15632 if(field->expression)
15633 ProcessExpressionType(field->expression);
15635 if(stmt->asmStmt.outputFields)
15637 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15638 if(field->expression)
15639 ProcessExpressionType(field->expression);
15641 if(stmt->asmStmt.clobberedFields)
15643 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15645 if(field->expression)
15646 ProcessExpressionType(field->expression);
15653 struct PropertyWatch * propWatch;
15654 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15655 struct Expression * object = stmt->_watch.object;
15656 struct Expression * watcher = stmt->_watch.watcher;
15659 ProcessExpressionType(watcher);
15661 ProcessExpressionType(object);
15664 if(watcher || thisClass)
15666 struct External * external = curExternal;
15667 struct Context * context = curContext;
15670 stmt->expressions = MkList();
15671 curExternal = external->prev;
15672 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15674 struct ClassFunction * func;
15675 char watcherName[1024];
15676 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15677 struct External * createdExternal;
15678 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15681 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15682 if(propWatch->deleteWatch)
15683 strcat(watcherName, "_delete");
15686 struct Identifier * propID;
15688 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15690 strcat(watcherName, "_");
15691 strcat(watcherName, propID->string);
15694 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15696 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15697 ProcessClassFunctionBody(func, propWatch->compound);
15698 propWatch->compound = (((void *)0));
15699 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15700 createdExternal->symbol->idCode = external->symbol->idCode;
15701 curExternal = createdExternal;
15702 ProcessFunction(createdExternal->function);
15704 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15706 externalDecl->declaration = decl;
15707 if(decl->symbol && !decl->symbol->pointerExternal)
15708 decl->symbol->pointerExternal = externalDecl;
15710 if(propWatch->deleteWatch)
15712 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15714 ListAdd(args, CopyExpression(object));
15715 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15716 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15717 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15721 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15722 struct Identifier * propID;
15724 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15726 char propName[1024];
15727 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15731 char getName[1024], setName[1024];
15732 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15734 DeclareProperty(prop, setName, getName);
15735 strcpy(propName, "__ecereProp_");
15736 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15737 strcat(propName, "_");
15738 FullClassNameCat(propName, prop->name, 0x1);
15739 ListAdd(args, CopyExpression(object));
15740 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15741 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15742 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15743 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15746 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15751 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15753 curExternal = external;
15754 curContext = context;
15756 FreeExpression(watcher);
15758 FreeExpression(object);
15759 FreeList(watches, FreePropertyWatch);
15762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15766 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15768 ProcessStatement(propWatch->compound);
15775 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15776 struct Expression * object = stmt->_watch.object;
15777 struct __ecereNameSpace__ecere__com__Class * _class;
15780 ProcessExpressionType(object);
15783 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15786 struct Identifier * propID;
15789 stmt->expressions = MkList();
15790 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15792 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15799 for(propID = (*watches).first; propID; propID = propID->next)
15801 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15805 CreateFireWatcher(prop, object, stmt);
15808 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15813 struct __ecereNameSpace__ecere__com__Property * prop;
15814 struct __ecereNameSpace__ecere__com__Class * base;
15816 for(base = _class; base; base = base->base)
15818 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15820 if(prop->isProperty && prop->isWatchable)
15822 CreateFireWatcher(prop, object, stmt);
15828 FreeExpression(object);
15829 FreeList(watches, FreeIdentifier);
15832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15838 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15839 struct Expression * object = stmt->_watch.object;
15840 struct Expression * watcher = stmt->_watch.watcher;
15841 struct __ecereNameSpace__ecere__com__Class * _class;
15844 ProcessExpressionType(object);
15846 ProcessExpressionType(watcher);
15849 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15850 if(watcher || thisClass)
15854 struct Identifier * propID;
15857 stmt->expressions = MkList();
15860 struct __ecereNameSpace__ecere__sys__OldList * args;
15863 ListAdd(args, CopyExpression(object));
15864 ListAdd(args, MkExpConstant("0"));
15865 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15866 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15870 for(propID = (*watches).first; propID; propID = propID->next)
15872 char propName[1024];
15873 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15877 char getName[1024], setName[1024];
15878 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15880 DeclareProperty(prop, setName, getName);
15881 strcpy(propName, "__ecereProp_");
15882 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15883 strcat(propName, "_");
15884 FullClassNameCat(propName, prop->name, 0x1);
15885 MangleClassName(propName);
15886 ListAdd(args, CopyExpression(object));
15887 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15888 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15889 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15896 FreeExpression(object);
15898 FreeExpression(watcher);
15899 FreeList(watches, FreeIdentifier);
15902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15912 extern struct Expression * QBrackets(struct Expression * exp);
15914 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15916 extern struct Declarator * QMkPtrDecl(char * id);
15918 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15920 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15922 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15924 static void ProcessFunction(struct FunctionDefinition * function)
15926 void * __ecereTemp2;
15927 void * __ecereTemp1;
15928 struct Identifier * id = GetDeclId(function->declarator);
15929 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15930 struct Type * type = symbol ? symbol->type : (((void *)0));
15931 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15932 struct Context * oldTopContext = topContext;
15934 yylloc = function->loc;
15935 if(type && type->thisClass)
15937 struct Symbol * classSym = type->thisClass;
15938 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15939 char className[1024];
15940 char structName[1024];
15941 struct Declarator * funcDecl;
15942 struct Symbol * thisSymbol;
15943 unsigned int typedObject = 0x0;
15945 if(_class && !_class->base)
15947 _class = currentClass;
15948 if(_class && !_class->symbol)
15949 _class->symbol = FindClass(_class->fullName);
15950 classSym = _class ? _class->symbol : (((void *)0));
15953 thisClass = _class;
15954 if(inCompiler && _class)
15956 if(type->kind == 11)
15958 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15960 struct Type * param = symbol->type->params.first;
15962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15965 if(type->classObjectType != 1)
15967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15968 symbol->type->staticMethod = 0x1;
15969 symbol->type->thisClass = (((void *)0));
15970 symbol->type->extraParam = 0x0;
15973 strcpy(className, "__ecereClass_");
15974 FullClassNameCat(className, _class->fullName, 0x1);
15975 MangleClassName(className);
15976 structName[0] = (char)0;
15977 FullClassNameCat(structName, _class->fullName, 0x0);
15978 funcDecl = GetFuncDecl(function->declarator);
15981 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15983 struct TypeName * param = (*funcDecl->function.parameters).first;
15985 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15987 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15988 FreeTypeName(param);
15991 if(!function->propertyNoThis)
15993 struct TypeName * thisParam;
15995 if(type->classObjectType != 1)
15997 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15998 if(!funcDecl->function.parameters)
15999 funcDecl->function.parameters = MkList();
16000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16004 if(type->classObjectType != 1)
16006 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16007 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16009 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));
16010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16014 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16016 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16018 funcDecl = GetFuncDecl(initDecl->declarator);
16021 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16023 struct TypeName * param = (*funcDecl->function.parameters).first;
16025 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16027 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16028 FreeTypeName(param);
16031 if(type->classObjectType != 1)
16033 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16035 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16037 if(!funcDecl->function.parameters)
16038 funcDecl->function.parameters = MkList();
16039 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16047 if(type->classObjectType != 1)
16049 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));
16050 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16051 if(typedObject && thisSymbol->type)
16053 thisSymbol->type->classObjectType = 2;
16054 thisSymbol->type->byReference = type->byReference;
16058 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16060 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16063 struct __ecereNameSpace__ecere__com__Class * base;
16065 for(base = _class; base && base->type != 1000; base = base->next)
16067 for(member = base->membersAndProperties.first; member; member = member->next)
16068 if(!member->isProperty)
16074 for(member = _class->membersAndProperties.first; member; member = member->next)
16075 if(!member->isProperty)
16079 char pointerName[1024];
16080 struct Declaration * decl;
16081 struct Initializer * initializer;
16082 struct Expression * exp, * bytePtr;
16084 strcpy(pointerName, "__ecerePointer_");
16085 FullClassNameCat(pointerName, _class->fullName, 0x0);
16087 char className[1024];
16089 strcpy(className, "__ecereClass_");
16090 FullClassNameCat(className, classSym->string, 0x1);
16091 MangleClassName(className);
16092 DeclareClass(classSym, className);
16094 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16099 sprintf(string, "%d", _class->offset);
16100 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16104 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16106 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16107 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));
16110 yylloc = function->body->loc;
16111 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16113 struct Context * prevContext = curContext;
16115 curContext = function->body->compound.context;
16116 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16117 curContext = prevContext;
16119 decl->symbol = (((void *)0));
16120 if(!function->body->compound.declarations)
16121 function->body->compound.declarations = MkList();
16122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16128 thisClass = (((void *)0));
16131 FreeSpecifier(id->_class);
16132 id->_class = (((void *)0));
16133 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16135 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16137 id = GetDeclId(initDecl->declarator);
16138 FreeSpecifier(id->_class);
16139 id->_class = (((void *)0));
16143 topContext = function->body->compound.context;
16145 struct FunctionDefinition * oldFunction = curFunction;
16147 curFunction = function;
16149 ProcessStatement(function->body);
16150 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16152 struct Statement * prevCompound = curCompound;
16153 struct Context * prevContext = curContext;
16154 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16156 if(!function->body->compound.statements)
16157 function->body->compound.statements = MkList();
16158 ListAdd(function->body->compound.statements, fireWatchers);
16159 curCompound = function->body;
16160 curContext = function->body->compound.context;
16161 ProcessStatement(fireWatchers);
16162 curContext = prevContext;
16163 curCompound = prevCompound;
16165 curFunction = oldFunction;
16167 if(function->declarator)
16169 ProcessDeclarator(function->declarator);
16171 topContext = oldTopContext;
16172 thisClass = oldThisClass;
16175 extern void FreeSymbol(struct Symbol * symbol);
16177 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16179 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16181 struct ClassDef * def;
16182 struct External * external = curExternal;
16183 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16185 for(def = definitions->first; def; def = def->next)
16189 if(def->function->declarator)
16190 curExternal = def->function->declarator->symbol->pointerExternal;
16192 curExternal = external;
16193 ProcessFunction((struct FunctionDefinition *)def->function);
16195 else if(def->type == 2)
16197 if(def->decl->type == 2)
16199 thisClass = regClass;
16200 ProcessInstantiationType(def->decl->inst);
16201 thisClass = (((void *)0));
16205 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16208 thisClass = regClass;
16209 ProcessDeclaration(def->decl);
16210 thisClass = backThisClass;
16213 else if(def->type == 1 && def->defProperties)
16215 struct MemberInit * defProperty;
16216 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);
16218 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16219 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16221 thisClass = regClass;
16222 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16223 thisClass = (((void *)0));
16225 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16226 FreeSymbol(thisSymbol);
16228 else if(def->type == 3 && def->propertyDef)
16230 struct PropertyDef * prop = def->propertyDef;
16232 thisClass = regClass;
16237 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16239 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16241 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16242 ProcessStatement(prop->setStmt);
16248 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16250 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16252 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16253 ProcessStatement(prop->getStmt);
16255 if(prop->issetStmt)
16259 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16261 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16263 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16264 ProcessStatement(prop->issetStmt);
16266 thisClass = (((void *)0));
16268 else if(def->type == 4 && def->propertyWatch)
16270 struct PropertyWatch * propertyWatch = def->propertyWatch;
16272 thisClass = regClass;
16273 if(propertyWatch->compound)
16275 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);
16277 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16278 curExternal = (((void *)0));
16279 ProcessStatement(propertyWatch->compound);
16281 thisClass = (((void *)0));
16286 void DeclareFunctionUtil(char * s)
16288 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16295 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16296 strcpy(name, "__ecereFunction_");
16297 FullClassNameCat(name, s, 0x0);
16298 DeclareFunction(function, name);
16302 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16304 void ComputeDataTypes()
16306 void * __ecereTemp1;
16307 struct External * external;
16308 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16310 currentClass = (((void *)0));
16311 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16312 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16314 curExternal = temp;
16315 DeclareFunctionUtil("eSystem_New");
16316 DeclareFunctionUtil("eSystem_New0");
16317 DeclareFunctionUtil("eSystem_Renew");
16318 DeclareFunctionUtil("eSystem_Renew0");
16319 DeclareStruct("ecere::com::Class", 0x0);
16320 DeclareStruct("ecere::com::Instance", 0x0);
16321 DeclareStruct("ecere::com::Property", 0x0);
16322 DeclareStruct("ecere::com::DataMember", 0x0);
16323 DeclareStruct("ecere::com::Method", 0x0);
16324 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16325 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16327 for(external = (*ast).first; external; external = external->next)
16329 afterExternal = curExternal = external;
16330 if(external->type == 0)
16332 currentClass = external->function->_class;
16333 ProcessFunction(external->function);
16335 else if(external->type == 1)
16337 currentClass = (((void *)0));
16338 ProcessDeclaration(external->declaration);
16340 else if(external->type == 2)
16342 struct ClassDefinition * _class = external->_class;
16344 currentClass = external->symbol->registered;
16345 if(_class->definitions)
16347 ProcessClass(_class->definitions, _class->symbol);
16351 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16352 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16355 else if(external->type == 4)
16357 thisNameSpace = external->id->string;
16360 currentClass = (((void *)0));
16361 thisNameSpace = (((void *)0));
16362 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16363 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16366 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);
16368 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);
16370 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16372 struct __ecereNameSpace__ecere__com__Class * class;
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16413 __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);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16426 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16427 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16428 __ecereClass_Conversion = class;
16429 __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);
16430 __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);
16431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16432 __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);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16452 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)