2 typedef long long int64;
3 typedef unsigned long long uint64;
7 #elif defined(__TINYC__)
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
19 typedef long long int64;
20 typedef unsigned long long uint64;
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
26 #define __ENDIAN_PAD(x) (8 - (x))
28 #define __ENDIAN_PAD(x) 0
31 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
33 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
35 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
37 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
39 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
41 struct __ecereNameSpace__ecere__sys__BTNode;
43 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
45 struct __ecereNameSpace__ecere__sys__BinaryTree
47 struct __ecereNameSpace__ecere__sys__BTNode * root;
49 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
50 void (* FreeKey)(void * key);
51 } __attribute__ ((gcc_struct));
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
55 struct __ecereNameSpace__ecere__sys__OldList
62 } __attribute__ ((gcc_struct));
64 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
66 struct __ecereNameSpace__ecere__com__Method
69 struct __ecereNameSpace__ecere__com__Method * parent;
70 struct __ecereNameSpace__ecere__com__Method * left;
71 struct __ecereNameSpace__ecere__com__Method * right;
76 struct __ecereNameSpace__ecere__com__Class * _class;
78 char * dataTypeString;
79 struct Type * dataType;
81 } __attribute__ ((gcc_struct));
83 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
85 struct __ecereNameSpace__ecere__com__Property
87 struct __ecereNameSpace__ecere__com__Property * prev;
88 struct __ecereNameSpace__ecere__com__Property * next;
90 unsigned int isProperty;
93 struct __ecereNameSpace__ecere__com__Class * _class;
94 char * dataTypeString;
95 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
96 struct Type * dataType;
97 void (* Set)(void * , int);
99 unsigned int (* IsSet)(void * );
103 unsigned int conversion;
104 unsigned int watcherOffset;
106 unsigned int compiled;
107 unsigned int selfWatchable;
108 unsigned int isWatchable;
109 } __attribute__ ((gcc_struct));
111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
118 unsigned int included;
119 } __attribute__ ((gcc_struct));
121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
125 struct CodePosition start;
126 struct CodePosition end;
127 } __attribute__ ((gcc_struct));
129 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
142 struct Attrib * attr;
143 } __attribute__ ((gcc_struct));
144 } __attribute__ ((gcc_struct));
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
148 struct ClassDefinition
150 struct ClassDefinition * prev;
151 struct ClassDefinition * next;
153 struct Specifier * _class;
154 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
155 struct __ecereNameSpace__ecere__sys__OldList * definitions;
156 struct Symbol * symbol;
157 struct Location blockStart;
158 struct Location nameLoc;
161 unsigned int deleteWatchable;
162 } __attribute__ ((gcc_struct));
164 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
168 struct Context * parent;
169 struct __ecereNameSpace__ecere__sys__BinaryTree types;
170 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
171 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
172 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
175 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
176 struct ClassDefinition * classDef;
177 unsigned int templateTypesOnly;
178 unsigned int hasNameSpace;
179 } __attribute__ ((gcc_struct));
181 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
185 struct Instantiation * prev;
186 struct Instantiation * next;
188 struct Specifier * _class;
189 struct Expression * exp;
190 struct __ecereNameSpace__ecere__sys__OldList * members;
191 struct Symbol * symbol;
192 unsigned int fullSet;
193 unsigned int isConstant;
194 unsigned char * data;
195 struct Location nameLoc;
196 struct Location insideLoc;
198 } __attribute__ ((gcc_struct));
200 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
204 struct Declaration * prev;
205 struct Declaration * next;
212 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
213 struct __ecereNameSpace__ecere__sys__OldList * declarators;
214 } __attribute__ ((gcc_struct));
215 struct Instantiation * inst;
218 struct Identifier * id;
219 struct Expression * exp;
220 } __attribute__ ((gcc_struct));
221 } __attribute__ ((gcc_struct));
222 struct Specifier * extStorage;
223 struct Symbol * symbol;
225 } __attribute__ ((gcc_struct));
227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
231 struct Statement * prev;
232 struct Statement * next;
237 struct __ecereNameSpace__ecere__sys__OldList * expressions;
240 struct Identifier * id;
241 struct Statement * stmt;
242 } __attribute__ ((gcc_struct)) labeled;
245 struct Expression * exp;
246 struct Statement * stmt;
247 } __attribute__ ((gcc_struct)) caseStmt;
250 struct __ecereNameSpace__ecere__sys__OldList * declarations;
251 struct __ecereNameSpace__ecere__sys__OldList * statements;
252 struct Context * context;
253 unsigned int isSwitch;
254 } __attribute__ ((gcc_struct)) compound;
257 struct __ecereNameSpace__ecere__sys__OldList * exp;
258 struct Statement * stmt;
259 struct Statement * elseStmt;
260 } __attribute__ ((gcc_struct)) ifStmt;
263 struct __ecereNameSpace__ecere__sys__OldList * exp;
264 struct Statement * stmt;
265 } __attribute__ ((gcc_struct)) switchStmt;
268 struct __ecereNameSpace__ecere__sys__OldList * exp;
269 struct Statement * stmt;
270 } __attribute__ ((gcc_struct)) whileStmt;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 } __attribute__ ((gcc_struct)) doWhile;
278 struct Statement * init;
279 struct Statement * check;
280 struct __ecereNameSpace__ecere__sys__OldList * increment;
281 struct Statement * stmt;
282 } __attribute__ ((gcc_struct)) forStmt;
285 struct Identifier * id;
286 } __attribute__ ((gcc_struct)) gotoStmt;
289 struct Specifier * spec;
291 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
292 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
293 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
294 } __attribute__ ((gcc_struct)) asmStmt;
297 struct Expression * watcher;
298 struct Expression * object;
299 struct __ecereNameSpace__ecere__sys__OldList * watches;
300 } __attribute__ ((gcc_struct)) _watch;
303 struct Identifier * id;
304 struct __ecereNameSpace__ecere__sys__OldList * exp;
305 struct __ecereNameSpace__ecere__sys__OldList * filter;
306 struct Statement * stmt;
307 } __attribute__ ((gcc_struct)) forEachStmt;
308 struct Declaration * decl;
309 } __attribute__ ((gcc_struct));
310 } __attribute__ ((gcc_struct));
312 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
316 struct TypeName * prev;
317 struct TypeName * next;
319 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
320 struct Declarator * declarator;
322 struct Expression * bitCount;
323 } __attribute__ ((gcc_struct));
325 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
329 struct Initializer * prev;
330 struct Initializer * next;
335 struct Expression * exp;
336 struct __ecereNameSpace__ecere__sys__OldList * list;
337 } __attribute__ ((gcc_struct));
338 unsigned int isConstant;
339 } __attribute__ ((gcc_struct));
341 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
343 struct __ecereNameSpace__ecere__com__DataValue
358 } __attribute__ ((gcc_struct));
359 } __attribute__ ((gcc_struct));
361 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
365 struct Expression * prev;
366 struct Expression * next;
374 struct Identifier * identifier;
375 } __attribute__ ((gcc_struct));
376 struct Statement * compound;
377 struct Instantiation * instance;
379 struct __ecereNameSpace__ecere__sys__OldList * list;
382 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
383 struct Declarator * decl;
384 } __attribute__ ((gcc_struct)) _classExp;
387 struct Identifier * id;
388 } __attribute__ ((gcc_struct)) classData;
391 struct Expression * exp;
392 struct __ecereNameSpace__ecere__sys__OldList * arguments;
393 struct Location argLoc;
394 } __attribute__ ((gcc_struct)) call;
397 struct Expression * exp;
398 struct __ecereNameSpace__ecere__sys__OldList * index;
399 } __attribute__ ((gcc_struct)) index;
402 struct Expression * exp;
403 struct Identifier * member;
405 unsigned int thisPtr;
406 } __attribute__ ((gcc_struct)) member;
410 struct Expression * exp1;
411 struct Expression * exp2;
412 } __attribute__ ((gcc_struct)) op;
413 struct TypeName * typeName;
414 struct Specifier * _class;
417 struct TypeName * typeName;
418 struct Expression * exp;
419 } __attribute__ ((gcc_struct)) cast;
422 struct Expression * cond;
423 struct __ecereNameSpace__ecere__sys__OldList * exp;
424 struct Expression * elseExp;
425 } __attribute__ ((gcc_struct)) cond;
428 struct TypeName * typeName;
429 struct Expression * size;
430 } __attribute__ ((gcc_struct)) _new;
433 struct TypeName * typeName;
434 struct Expression * size;
435 struct Expression * exp;
436 } __attribute__ ((gcc_struct)) _renew;
440 struct Identifier * id;
441 } __attribute__ ((gcc_struct)) db;
444 struct Expression * ds;
445 struct Expression * name;
446 } __attribute__ ((gcc_struct)) dbopen;
449 struct TypeName * typeName;
450 struct Initializer * initializer;
451 } __attribute__ ((gcc_struct)) initializer;
454 struct Expression * exp;
455 struct TypeName * typeName;
456 } __attribute__ ((gcc_struct)) vaArg;
457 } __attribute__ ((gcc_struct));
458 unsigned int debugValue;
459 struct __ecereNameSpace__ecere__com__DataValue val;
461 unsigned int hasAddress;
462 struct Type * expType;
463 struct Type * destType;
466 unsigned int byReference;
467 unsigned int isConstant;
468 unsigned int addedThis;
469 unsigned int needCast;
470 unsigned int thisPtr;
471 } __attribute__ ((gcc_struct));
473 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
475 struct TemplateDatatype
477 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
478 struct Declarator * decl;
479 } __attribute__ ((gcc_struct));
481 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
483 struct TemplateArgument;
485 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
487 struct TemplateParameter
489 struct TemplateParameter * prev;
490 struct TemplateParameter * next;
493 struct Identifier * identifier;
496 struct TemplateDatatype * dataType;
498 } __attribute__ ((gcc_struct));
499 struct TemplateArgument * defaultArgument;
500 char * dataTypeString;
501 struct Type * baseType;
502 } __attribute__ ((gcc_struct));
504 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
508 struct Specifier * prev;
509 struct Specifier * next;
517 struct ExtDecl * extDecl;
519 struct Symbol * symbol;
520 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
521 } __attribute__ ((gcc_struct));
524 struct Identifier * id;
525 struct __ecereNameSpace__ecere__sys__OldList * list;
526 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
527 struct __ecereNameSpace__ecere__sys__OldList * definitions;
528 unsigned int addNameSpace;
529 struct Context * ctx;
530 struct ExtDecl * extDeclStruct;
531 } __attribute__ ((gcc_struct));
532 struct Expression * expression;
533 struct Specifier * _class;
534 struct TemplateParameter * templateParameter;
535 } __attribute__ ((gcc_struct));
536 } __attribute__ ((gcc_struct));
538 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
542 struct Identifier * prev;
543 struct Identifier * next;
545 struct Symbol * classSym;
546 struct Specifier * _class;
548 struct Identifier * badID;
549 } __attribute__ ((gcc_struct));
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
555 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
559 struct Declarator * prev;
560 struct Declarator * next;
563 struct Symbol * symbol;
564 struct Declarator * declarator;
567 struct Identifier * identifier;
570 struct Expression * exp;
571 struct Expression * posExp;
572 struct Attrib * attrib;
573 } __attribute__ ((gcc_struct)) structDecl;
576 struct Expression * exp;
577 struct Specifier * enumClass;
578 } __attribute__ ((gcc_struct)) array;
581 struct __ecereNameSpace__ecere__sys__OldList * parameters;
582 } __attribute__ ((gcc_struct)) function;
585 struct Pointer * pointer;
586 } __attribute__ ((gcc_struct)) pointer;
589 struct ExtDecl * extended;
590 } __attribute__ ((gcc_struct)) extended;
591 } __attribute__ ((gcc_struct));
592 } __attribute__ ((gcc_struct));
594 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
596 struct FunctionDefinition
598 struct FunctionDefinition * prev;
599 struct FunctionDefinition * next;
601 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
602 struct Declarator * declarator;
603 struct __ecereNameSpace__ecere__sys__OldList * declarations;
604 struct Statement * body;
605 struct __ecereNameSpace__ecere__com__Class * _class;
606 struct __ecereNameSpace__ecere__sys__OldList attached;
609 struct Symbol * propSet;
611 unsigned int propertyNoThis;
612 } __attribute__ ((gcc_struct));
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
618 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
622 struct External * prev;
623 struct External * next;
626 struct Symbol * symbol;
629 struct FunctionDefinition * function;
630 struct ClassDefinition * _class;
631 struct Declaration * declaration;
633 struct Identifier * id;
634 struct DBTableDef * table;
635 } __attribute__ ((gcc_struct));
637 } __attribute__ ((gcc_struct));
639 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
643 struct ModuleImport * prev;
644 struct ModuleImport * next;
646 struct __ecereNameSpace__ecere__sys__OldList classes;
647 struct __ecereNameSpace__ecere__sys__OldList functions;
650 } __attribute__ ((gcc_struct));
652 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
656 struct ClassImport * prev;
657 struct ClassImport * next;
659 struct __ecereNameSpace__ecere__sys__OldList methods;
660 struct __ecereNameSpace__ecere__sys__OldList properties;
662 unsigned int isRemote;
663 } __attribute__ ((gcc_struct));
665 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
670 struct Symbol * parent;
671 struct Symbol * left;
672 struct Symbol * right;
677 struct __ecereNameSpace__ecere__com__Method * method;
678 struct __ecereNameSpace__ecere__com__Property * _property;
679 struct __ecereNameSpace__ecere__com__Class * registered;
680 } __attribute__ ((gcc_struct));
687 struct External * pointerExternal;
688 struct External * structExternal;
689 } __attribute__ ((gcc_struct));
692 struct External * externalGet;
693 struct External * externalSet;
694 struct External * externalPtr;
695 struct External * externalIsSet;
696 } __attribute__ ((gcc_struct));
699 struct External * methodExternal;
700 struct External * methodCodeExternal;
701 } __attribute__ ((gcc_struct));
702 } __attribute__ ((gcc_struct));
703 unsigned int imported;
704 unsigned int declaredStructSym;
705 struct __ecereNameSpace__ecere__com__Class * _class;
706 unsigned int declaredStruct;
707 unsigned int needConstructor;
708 unsigned int needDestructor;
709 char * constructorName;
712 char * destructorName;
713 struct ModuleImport * module;
714 struct ClassImport * _import;
715 struct Location nameLoc;
716 unsigned int isParam;
717 unsigned int isRemote;
718 unsigned int isStruct;
719 unsigned int fireWatchersDone;
721 unsigned int classData;
722 unsigned int isStatic;
724 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
725 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
726 struct Context * ctx;
728 struct Expression * propCategory;
729 } __attribute__ ((gcc_struct));
731 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
740 struct Symbol * _class;
743 struct __ecereNameSpace__ecere__sys__OldList members;
745 } __attribute__ ((gcc_struct));
748 struct Type * returnType;
749 struct __ecereNameSpace__ecere__sys__OldList params;
750 struct Symbol * thisClass;
751 unsigned int staticMethod;
752 struct TemplateParameter * thisClassTemplate;
753 } __attribute__ ((gcc_struct));
756 struct __ecereNameSpace__ecere__com__Method * method;
757 struct __ecereNameSpace__ecere__com__Class * methodClass;
758 struct __ecereNameSpace__ecere__com__Class * usedClass;
759 } __attribute__ ((gcc_struct));
762 struct Type * arrayType;
764 struct Expression * arraySizeExp;
765 unsigned int freeExp;
766 struct Symbol * enumClass;
767 } __attribute__ ((gcc_struct));
769 struct TemplateParameter * templateParameter;
770 } __attribute__ ((gcc_struct));
771 unsigned int isSigned;
773 unsigned int constant;
780 unsigned int byReference;
781 unsigned int extraParam;
783 unsigned int directClassAccess;
784 unsigned int computing;
785 unsigned int dllExport;
787 unsigned int keepCast;
788 unsigned int passAsTemplate;
790 } __attribute__ ((gcc_struct));
792 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
794 struct __ecereNameSpace__ecere__com__Class
796 struct __ecereNameSpace__ecere__com__Class * prev;
797 struct __ecereNameSpace__ecere__com__Class * next;
803 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
804 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
807 struct __ecereNameSpace__ecere__com__Class * base;
808 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
809 struct __ecereNameSpace__ecere__sys__BinaryTree members;
810 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
811 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
812 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
813 struct __ecereNameSpace__ecere__sys__OldList derivatives;
817 struct __ecereNameSpace__ecere__com__Instance * module;
818 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
819 char * dataTypeString;
820 struct Type * dataType;
822 int defaultAlignment;
823 void (* Initialize)();
825 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
826 char * designerClass;
827 unsigned int noExpansion;
828 char * defaultProperty;
829 unsigned int comRedefinition;
831 unsigned int isRemote;
832 unsigned int internalDecl;
834 unsigned int computeSize;
836 int destructionWatchOffset;
838 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
839 int inheritanceAccess;
842 struct __ecereNameSpace__ecere__sys__OldList conversions;
843 struct __ecereNameSpace__ecere__sys__OldList templateParams;
844 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
845 struct __ecereNameSpace__ecere__com__Class * templateClass;
846 struct __ecereNameSpace__ecere__sys__OldList templatized;
848 } __attribute__ ((gcc_struct));
850 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
852 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
854 struct __ecereNameSpace__ecere__com__Instance
857 struct __ecereNameSpace__ecere__com__Class * _class;
859 } __attribute__ ((gcc_struct));
861 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
863 struct __ecereNameSpace__ecere__com__DataMember
865 struct __ecereNameSpace__ecere__com__DataMember * prev;
866 struct __ecereNameSpace__ecere__com__DataMember * next;
868 unsigned int isProperty;
871 struct __ecereNameSpace__ecere__com__Class * _class;
872 char * dataTypeString;
873 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
874 struct Type * dataType;
878 struct __ecereNameSpace__ecere__sys__OldList members;
879 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
882 } __attribute__ ((gcc_struct));
884 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
886 struct __ecereNameSpace__ecere__com__SerialBuffer
888 unsigned char * _buffer;
892 } __attribute__ ((gcc_struct));
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
896 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
902 char * dataTypeString;
903 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
904 } __attribute__ ((gcc_struct));
905 struct __ecereNameSpace__ecere__com__DataValue expression;
911 struct __ecereNameSpace__ecere__com__DataMember * member;
912 struct __ecereNameSpace__ecere__com__Property * prop;
913 struct __ecereNameSpace__ecere__com__Method * method;
914 } __attribute__ ((gcc_struct));
915 } __attribute__ ((gcc_struct));
916 } __attribute__ ((gcc_struct));
917 } __attribute__ ((gcc_struct));
919 typedef uintptr_t size_t;
921 void exit(int status);
923 void * calloc(size_t nmemb, size_t size);
925 void free(void * ptr);
927 void * malloc(size_t size);
929 void * realloc(void * ptr, size_t size);
931 long int strtol(const char * nptr, char ** endptr, int base);
933 long long int strtoll(const char * nptr, char ** endptr, int base);
935 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
939 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
942 typedef union YYSTYPE
947 struct Identifier * id;
948 struct Expression * exp;
949 struct Specifier * specifier;
950 struct __ecereNameSpace__ecere__sys__OldList * list;
951 struct Enumerator * enumerator;
952 struct Declarator * declarator;
953 struct Pointer * pointer;
954 struct Initializer * initializer;
955 struct InitDeclarator * initDeclarator;
956 struct TypeName * typeName;
957 struct Declaration * declaration;
958 struct Statement * stmt;
959 struct FunctionDefinition * function;
960 struct External * external;
961 struct Context * context;
962 struct AsmField * asmField;
963 struct Attrib * attrib;
964 struct ExtDecl * extDecl;
965 struct Attribute * attribute;
966 struct Instantiation * instance;
967 struct MembersInit * membersInit;
968 struct MemberInit * memberInit;
969 struct ClassFunction * classFunction;
970 struct ClassDefinition * _class;
971 struct ClassDef * classDef;
972 struct PropertyDef * prop;
974 struct Symbol * symbol;
975 struct PropertyWatch * propertyWatch;
976 struct TemplateParameter * templateParameter;
977 struct TemplateArgument * templateArgument;
978 struct TemplateDatatype * templateDatatype;
979 struct DBTableEntry * dbtableEntry;
980 struct DBIndexItem * dbindexItem;
981 struct DBTableDef * dbtableDef;
982 } __attribute__ ((gcc_struct)) YYSTYPE;
984 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
988 struct Enumerator * prev;
989 struct Enumerator * next;
991 struct Identifier * id;
992 struct Expression * exp;
993 } __attribute__ ((gcc_struct));
995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
997 struct InitDeclarator
999 struct InitDeclarator * prev;
1000 struct InitDeclarator * next;
1001 struct Location loc;
1002 struct Declarator * declarator;
1003 struct Initializer * initializer;
1004 } __attribute__ ((gcc_struct));
1006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1010 struct AsmField * prev;
1011 struct AsmField * next;
1012 struct Location loc;
1014 struct Expression * expression;
1015 } __attribute__ ((gcc_struct));
1017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1023 struct ClassFunction
1025 struct ClassFunction * prev;
1026 struct ClassFunction * next;
1027 struct Location loc;
1028 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1029 struct Declarator * declarator;
1030 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1031 struct Statement * body;
1032 struct __ecereNameSpace__ecere__com__Class * _class;
1033 struct __ecereNameSpace__ecere__sys__OldList attached;
1036 struct Symbol * propSet;
1037 unsigned int isVirtual;
1038 unsigned int isConstructor;
1039 unsigned int isDestructor;
1040 unsigned int dontMangle;
1043 } __attribute__ ((gcc_struct));
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1049 struct MembersInit * prev;
1050 struct MembersInit * next;
1051 struct Location loc;
1055 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1056 struct ClassFunction * function;
1057 } __attribute__ ((gcc_struct));
1058 } __attribute__ ((gcc_struct));
1060 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1064 struct MemberInit * prev;
1065 struct MemberInit * next;
1066 struct Location loc;
1067 struct Location realLoc;
1068 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1069 struct Initializer * initializer;
1071 unsigned int variable;
1072 unsigned int takeOutExp;
1073 } __attribute__ ((gcc_struct));
1075 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1079 struct PropertyDef * prev;
1080 struct PropertyDef * next;
1081 struct Location loc;
1082 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1083 struct Declarator * declarator;
1084 struct Identifier * id;
1085 struct Statement * getStmt;
1086 struct Statement * setStmt;
1087 struct Statement * issetStmt;
1088 struct Symbol * symbol;
1089 unsigned int conversion;
1090 unsigned int isWatchable;
1091 struct Expression * category;
1092 } __attribute__ ((gcc_struct));
1094 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1096 struct PropertyWatch
1098 struct PropertyWatch * prev;
1099 struct PropertyWatch * next;
1100 struct Location loc;
1101 struct Statement * compound;
1102 struct __ecereNameSpace__ecere__sys__OldList * properties;
1103 unsigned int deleteWatch;
1104 } __attribute__ ((gcc_struct));
1106 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1110 struct ClassDef * prev;
1111 struct ClassDef * next;
1112 struct Location loc;
1116 struct Declaration * decl;
1117 struct ClassFunction * function;
1118 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1119 struct PropertyDef * propertyDef;
1120 struct PropertyWatch * propertyWatch;
1122 struct Identifier * defaultProperty;
1125 struct Identifier * id;
1126 struct Initializer * initializer;
1127 } __attribute__ ((gcc_struct));
1128 } __attribute__ ((gcc_struct));
1131 } __attribute__ ((gcc_struct));
1133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1135 struct DBTableEntry;
1137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1141 extern YYSTYPE yylval;
1143 extern struct Location yylloc;
1145 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1147 extern int returnCode;
1149 extern struct Expression * parsedExpression;
1151 extern unsigned int yydebug;
1153 void SetYydebug(unsigned int b)
1158 extern unsigned int echoOn;
1160 void resetScanner();
1164 int expression_yyparse();
1166 static struct Statement * curCompound;
1168 struct External * curExternal, * afterExternal;
1170 static struct Type * curSwitchType;
1172 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1174 struct __ecereNameSpace__ecere__com__Class * thisClass;
1176 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1181 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1186 static char * thisNameSpace;
1188 struct __ecereNameSpace__ecere__com__Class * containerClass;
1190 unsigned int thisClassParams = 0x1;
1192 unsigned int internalValueCounter;
1194 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1196 extern int strlen(const char * );
1198 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1200 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1202 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1204 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1206 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1208 void PrintExpression(struct Expression * exp, char * string)
1211 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1215 OutputExpression(exp, f);
1216 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1217 count = strlen(string);
1218 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);
1219 string[count] = '\0';
1220 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1224 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1226 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1228 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1230 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1232 if(!param->baseType)
1234 if(param->dataTypeString)
1235 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1237 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1239 return param->baseType;
1241 return (((void *)0));
1244 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1246 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1248 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1252 if(type1->kind == type2->kind)
1261 if(type1->passAsTemplate && !type2->passAsTemplate)
1263 return type1->isSigned != type2->isSigned;
1265 return type1->_class != type2->_class;
1267 return NeedCast(type1->type, type2->type);
1275 extern int strcmp(const char * , const char * );
1277 extern struct Context * curContext;
1279 extern struct Context * topContext;
1281 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1283 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);
1285 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1287 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);
1289 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);
1291 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1293 struct __ecereNameSpace__ecere__com__ClassProperty
1296 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1297 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1298 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1300 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1301 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1302 char * dataTypeString;
1303 struct Type * dataType;
1304 unsigned int constant;
1305 } __attribute__ ((gcc_struct));
1307 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1309 extern struct Expression * QMkExpId(char * id);
1311 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1313 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1315 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1321 char * dataTypeString;
1323 } __attribute__ ((gcc_struct));
1324 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1326 } __attribute__ ((gcc_struct));
1328 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1330 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1332 extern void FreeIdentifier(struct Identifier * id);
1334 void ProcessExpressionType(struct Expression * exp);
1336 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1338 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1340 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1342 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1344 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1346 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1348 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1350 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1352 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1354 if(exp->type == 0 && exp->identifier)
1356 struct Identifier * id = exp->identifier;
1357 struct Context * ctx;
1358 struct Symbol * symbol = (((void *)0));
1360 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1362 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1364 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1369 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1371 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1372 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1373 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1374 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1378 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1380 if(!prop && !method)
1381 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1382 if(!prop && !method && !member)
1384 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1386 if(prop || method || member || classProp)
1389 exp->member.member = id;
1390 exp->member.memberType = 0;
1391 exp->member.exp = QMkExpId("this");
1392 exp->addedThis = 0x1;
1394 else if(_class && _class->templateParams.first)
1396 struct __ecereNameSpace__ecere__com__Class * sClass;
1398 for(sClass = _class; sClass; sClass = sClass->base)
1400 if(sClass->templateParams.first)
1402 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1404 for(param = sClass->templateParams.first; param; param = param->next)
1406 if(param->type == 2 && !strcmp(param->name, id->string))
1408 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1412 struct Declarator * decl;
1413 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1415 FreeIdentifier(exp->member.member);
1416 ProcessExpressionType(argExp);
1417 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1418 exp->expType = ProcessType(specs, decl);
1420 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1431 extern int sprintf(char * , char * , ...);
1433 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1435 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1437 char * PrintInt(long long result)
1441 if(result > (((long long)0x7fffffffffffffffLL)))
1442 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1444 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1445 return __ecereNameSpace__ecere__sys__CopyString(temp);
1448 char * PrintUInt(uint64 result)
1452 if(result > (0xffffffff))
1453 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1454 else if(result > (((int)0x7fffffff)))
1455 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1457 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1458 return __ecereNameSpace__ecere__sys__CopyString(temp);
1461 char * PrintInt64(long long result)
1465 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1466 return __ecereNameSpace__ecere__sys__CopyString(temp);
1469 char * PrintUInt64(uint64 result)
1473 if(result > (((long long)0x7fffffffffffffffLL)))
1474 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1476 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1477 return __ecereNameSpace__ecere__sys__CopyString(temp);
1480 char * PrintHexUInt(uint64 result)
1484 if(result > (0xffffffff))
1485 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1487 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1488 return __ecereNameSpace__ecere__sys__CopyString(temp);
1491 char * PrintHexUInt64(uint64 result)
1495 if(result > (0xffffffff))
1496 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1498 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1499 return __ecereNameSpace__ecere__sys__CopyString(temp);
1502 char * PrintShort(short result)
1506 sprintf(temp, "%d", (unsigned short)result);
1507 return __ecereNameSpace__ecere__sys__CopyString(temp);
1510 char * PrintUShort(unsigned short result)
1514 if(result > (unsigned short)32767)
1515 sprintf(temp, "0x%X", (int)result);
1517 sprintf(temp, "%d", result);
1518 return __ecereNameSpace__ecere__sys__CopyString(temp);
1521 extern int isprint(int c);
1523 char * PrintChar(char result)
1527 if(result > (char)0 && isprint(result))
1528 sprintf(temp, "'%c'", result);
1529 else if(result < (char)0)
1530 sprintf(temp, "%d", result);
1532 sprintf(temp, "0x%X", (unsigned char)result);
1533 return __ecereNameSpace__ecere__sys__CopyString(temp);
1536 char * PrintUChar(unsigned char result)
1540 sprintf(temp, "0x%X", result);
1541 return __ecereNameSpace__ecere__sys__CopyString(temp);
1544 char * PrintFloat(float result)
1548 sprintf(temp, "%.16ff", result);
1549 return __ecereNameSpace__ecere__sys__CopyString(temp);
1552 char * PrintDouble(double result)
1556 sprintf(temp, "%.16f", result);
1557 return __ecereNameSpace__ecere__sys__CopyString(temp);
1560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1564 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1565 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1566 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1567 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1568 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1569 unsigned int (* Neg)(struct Expression *, struct Operand *);
1570 unsigned int (* Inc)(struct Expression *, struct Operand *);
1571 unsigned int (* Dec)(struct Expression *, struct Operand *);
1572 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1573 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1574 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1575 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1576 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1577 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1578 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1579 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1580 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1581 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1582 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1583 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1584 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1585 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1586 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1587 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* Not)(struct Expression *, struct Operand *);
1590 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1599 } __attribute__ ((gcc_struct));
1601 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1607 unsigned int ptrSize;
1620 } __attribute__ ((gcc_struct));
1622 } __attribute__ ((gcc_struct));
1624 struct Operand GetOperand(struct Expression * exp);
1626 unsigned int GetInt(struct Expression * exp, int * value2)
1628 struct Operand op2 = GetOperand(exp);
1630 if(op2.kind == 3 && op2.type->isSigned)
1632 else if(op2.kind == 3)
1633 *value2 = (int)op2.ui;
1634 if(op2.kind == 4 && op2.type->isSigned)
1635 *value2 = (int)op2.i64;
1636 else if(op2.kind == 4)
1637 *value2 = (int)op2.ui64;
1638 else if(op2.kind == 22 && op2.type->isSigned)
1639 *value2 = (int)op2.i64;
1640 else if(op2.kind == 22)
1641 *value2 = (int)op2.ui64;
1642 else if(op2.kind == 2 && op2.type->isSigned)
1643 *value2 = (int)op2.s;
1644 else if(op2.kind == 2)
1645 *value2 = (int)op2.us;
1646 else if(op2.kind == 1 && op2.type->isSigned)
1647 *value2 = (int)op2.c;
1648 else if(op2.kind == 1)
1649 *value2 = (int)op2.uc;
1650 else if(op2.kind == 6)
1651 *value2 = (int)op2.f;
1652 else if(op2.kind == 7)
1653 *value2 = (int)op2.d;
1654 else if(op2.kind == 13)
1655 *value2 = (int)op2.ui64;
1661 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1663 struct Operand op2 = GetOperand(exp);
1665 if(op2.kind == 3 && op2.type->isSigned)
1666 *value2 = (unsigned int)op2.i;
1667 else if(op2.kind == 3)
1669 if(op2.kind == 4 && op2.type->isSigned)
1670 *value2 = (unsigned int)op2.i64;
1671 else if(op2.kind == 4)
1672 *value2 = (unsigned int)op2.ui64;
1673 else if(op2.kind == 22 && op2.type->isSigned)
1674 *value2 = (unsigned int)op2.i64;
1675 else if(op2.kind == 22)
1676 *value2 = (unsigned int)op2.ui64;
1677 else if(op2.kind == 2 && op2.type->isSigned)
1678 *value2 = (unsigned int)op2.s;
1679 else if(op2.kind == 2)
1680 *value2 = (unsigned int)op2.us;
1681 else if(op2.kind == 1 && op2.type->isSigned)
1682 *value2 = (unsigned int)op2.c;
1683 else if(op2.kind == 1)
1684 *value2 = (unsigned int)op2.uc;
1685 else if(op2.kind == 6)
1686 *value2 = (unsigned int)op2.f;
1687 else if(op2.kind == 7)
1688 *value2 = (unsigned int)op2.d;
1689 else if(op2.kind == 13)
1690 *value2 = (unsigned int)op2.ui64;
1696 unsigned int GetInt64(struct Expression * exp, long long * value2)
1698 struct Operand op2 = GetOperand(exp);
1700 if(op2.kind == 3 && op2.type->isSigned)
1701 *value2 = (long long)op2.i;
1702 else if(op2.kind == 3)
1703 *value2 = (long long)op2.ui;
1704 if(op2.kind == 4 && op2.type->isSigned)
1706 else if(op2.kind == 4)
1707 *value2 = (long long)op2.ui64;
1708 else if(op2.kind == 22 && op2.type->isSigned)
1710 else if(op2.kind == 22)
1711 *value2 = (long long)op2.ui64;
1712 else if(op2.kind == 2 && op2.type->isSigned)
1713 *value2 = (long long)op2.s;
1714 else if(op2.kind == 2)
1715 *value2 = (long long)op2.us;
1716 else if(op2.kind == 1 && op2.type->isSigned)
1717 *value2 = (long long)op2.c;
1718 else if(op2.kind == 1)
1719 *value2 = (long long)op2.uc;
1720 else if(op2.kind == 6)
1721 *value2 = (long long)op2.f;
1722 else if(op2.kind == 7)
1723 *value2 = (long long)op2.d;
1724 else if(op2.kind == 13)
1725 *value2 = (long long)op2.ui64;
1731 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1733 struct Operand op2 = GetOperand(exp);
1735 if(op2.kind == 3 && op2.type->isSigned)
1736 *value2 = (uint64)op2.i;
1737 else if(op2.kind == 3)
1738 *value2 = (uint64)op2.ui;
1739 if(op2.kind == 4 && op2.type->isSigned)
1740 *value2 = (uint64)op2.i64;
1741 else if(op2.kind == 4)
1743 else if(op2.kind == 22 && op2.type->isSigned)
1744 *value2 = (uint64)op2.i64;
1745 else if(op2.kind == 22)
1747 else if(op2.kind == 2 && op2.type->isSigned)
1748 *value2 = (uint64)op2.s;
1749 else if(op2.kind == 2)
1750 *value2 = (uint64)op2.us;
1751 else if(op2.kind == 1 && op2.type->isSigned)
1752 *value2 = (uint64)op2.c;
1753 else if(op2.kind == 1)
1754 *value2 = (uint64)op2.uc;
1755 else if(op2.kind == 6)
1756 *value2 = (uint64)op2.f;
1757 else if(op2.kind == 7)
1758 *value2 = (uint64)op2.d;
1759 else if(op2.kind == 13)
1766 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1768 struct Operand op2 = GetOperand(exp);
1770 if(op2.kind == 3 && op2.type->isSigned)
1771 *value2 = (intptr_t)op2.i;
1772 else if(op2.kind == 3)
1773 *value2 = (intptr_t)op2.ui;
1774 if(op2.kind == 4 && op2.type->isSigned)
1775 *value2 = (intptr_t)op2.i64;
1776 else if(op2.kind == 4)
1777 *value2 = (intptr_t)op2.ui64;
1778 else if(op2.kind == 22 && op2.type->isSigned)
1779 *value2 = (intptr_t)op2.i64;
1780 else if(op2.kind == 22)
1781 *value2 = (intptr_t)op2.ui64;
1782 else if(op2.kind == 2 && op2.type->isSigned)
1783 *value2 = (intptr_t)op2.s;
1784 else if(op2.kind == 2)
1785 *value2 = (intptr_t)op2.us;
1786 else if(op2.kind == 1 && op2.type->isSigned)
1787 *value2 = (intptr_t)op2.c;
1788 else if(op2.kind == 1)
1789 *value2 = (intptr_t)op2.uc;
1790 else if(op2.kind == 6)
1791 *value2 = (intptr_t)op2.f;
1792 else if(op2.kind == 7)
1793 *value2 = (intptr_t)op2.d;
1794 else if(op2.kind == 13)
1795 *value2 = (intptr_t)op2.ui64;
1801 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1803 struct Operand op2 = GetOperand(exp);
1805 if(op2.kind == 3 && op2.type->isSigned)
1806 *value2 = (uintptr_t)op2.i;
1807 else if(op2.kind == 3)
1808 *value2 = (uintptr_t)op2.ui;
1809 if(op2.kind == 4 && op2.type->isSigned)
1810 *value2 = (uintptr_t)op2.i64;
1811 else if(op2.kind == 4)
1812 *value2 = (uintptr_t)op2.ui64;
1813 else if(op2.kind == 22 && op2.type->isSigned)
1814 *value2 = (uintptr_t)op2.i64;
1815 else if(op2.kind == 22)
1816 *value2 = (uintptr_t)op2.ui64;
1817 else if(op2.kind == 2 && op2.type->isSigned)
1818 *value2 = (uintptr_t)op2.s;
1819 else if(op2.kind == 2)
1820 *value2 = (uintptr_t)op2.us;
1821 else if(op2.kind == 1 && op2.type->isSigned)
1822 *value2 = (uintptr_t)op2.c;
1823 else if(op2.kind == 1)
1824 *value2 = (uintptr_t)op2.uc;
1825 else if(op2.kind == 6)
1826 *value2 = (uintptr_t)op2.f;
1827 else if(op2.kind == 7)
1828 *value2 = (uintptr_t)op2.d;
1829 else if(op2.kind == 13)
1830 *value2 = (uintptr_t)op2.ui64;
1836 unsigned int GetShort(struct Expression * exp, short * value2)
1838 struct Operand op2 = GetOperand(exp);
1840 if(op2.kind == 3 && op2.type->isSigned)
1841 *value2 = (short)op2.i;
1842 else if(op2.kind == 3)
1843 *value2 = (short)op2.ui;
1844 if(op2.kind == 4 && op2.type->isSigned)
1845 *value2 = (short)op2.i64;
1846 else if(op2.kind == 4)
1847 *value2 = (short)op2.ui64;
1848 else if(op2.kind == 22 && op2.type->isSigned)
1849 *value2 = (short)op2.i64;
1850 else if(op2.kind == 22)
1851 *value2 = (short)op2.ui64;
1852 else if(op2.kind == 2 && op2.type->isSigned)
1854 else if(op2.kind == 2)
1855 *value2 = (short)op2.us;
1856 else if(op2.kind == 1 && op2.type->isSigned)
1857 *value2 = (short)op2.c;
1858 else if(op2.kind == 1)
1859 *value2 = (short)op2.uc;
1860 else if(op2.kind == 6)
1861 *value2 = (short)op2.f;
1862 else if(op2.kind == 7)
1863 *value2 = (short)op2.d;
1864 else if(op2.kind == 13)
1865 *value2 = (short)op2.ui64;
1871 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1873 struct Operand op2 = GetOperand(exp);
1875 if(op2.kind == 3 && op2.type->isSigned)
1876 *value2 = (unsigned short)op2.i;
1877 else if(op2.kind == 3)
1878 *value2 = (unsigned short)op2.ui;
1879 if(op2.kind == 4 && op2.type->isSigned)
1880 *value2 = (unsigned short)op2.i64;
1881 else if(op2.kind == 4)
1882 *value2 = (unsigned short)op2.ui64;
1883 else if(op2.kind == 22 && op2.type->isSigned)
1884 *value2 = (unsigned short)op2.i64;
1885 else if(op2.kind == 22)
1886 *value2 = (unsigned short)op2.ui64;
1887 else if(op2.kind == 2 && op2.type->isSigned)
1888 *value2 = (unsigned short)op2.s;
1889 else if(op2.kind == 2)
1891 else if(op2.kind == 1 && op2.type->isSigned)
1892 *value2 = (unsigned short)op2.c;
1893 else if(op2.kind == 1)
1894 *value2 = (unsigned short)op2.uc;
1895 else if(op2.kind == 6)
1896 *value2 = (unsigned short)op2.f;
1897 else if(op2.kind == 7)
1898 *value2 = (unsigned short)op2.d;
1899 else if(op2.kind == 13)
1900 *value2 = (unsigned short)op2.ui64;
1906 unsigned int GetChar(struct Expression * exp, char * value2)
1908 struct Operand op2 = GetOperand(exp);
1910 if(op2.kind == 3 && op2.type->isSigned)
1911 *value2 = (char)op2.i;
1912 else if(op2.kind == 3)
1913 *value2 = (char)op2.ui;
1914 if(op2.kind == 4 && op2.type->isSigned)
1915 *value2 = (char)op2.i64;
1916 else if(op2.kind == 4)
1917 *value2 = (char)op2.ui64;
1918 else if(op2.kind == 22 && op2.type->isSigned)
1919 *value2 = (char)op2.i64;
1920 else if(op2.kind == 22)
1921 *value2 = (char)op2.ui64;
1922 else if(op2.kind == 2 && op2.type->isSigned)
1923 *value2 = (char)op2.s;
1924 else if(op2.kind == 2)
1925 *value2 = (char)op2.us;
1926 else if(op2.kind == 1 && op2.type->isSigned)
1928 else if(op2.kind == 1)
1929 *value2 = (char)op2.uc;
1930 else if(op2.kind == 6)
1931 *value2 = (char)op2.f;
1932 else if(op2.kind == 7)
1933 *value2 = (char)op2.d;
1934 else if(op2.kind == 13)
1935 *value2 = (char)op2.ui64;
1941 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1943 struct Operand op2 = GetOperand(exp);
1945 if(op2.kind == 3 && op2.type->isSigned)
1946 *value2 = (unsigned char)op2.i;
1947 else if(op2.kind == 3)
1948 *value2 = (unsigned char)op2.ui;
1949 if(op2.kind == 4 && op2.type->isSigned)
1950 *value2 = (unsigned char)op2.i64;
1951 else if(op2.kind == 4)
1952 *value2 = (unsigned char)op2.ui64;
1953 else if(op2.kind == 22 && op2.type->isSigned)
1954 *value2 = (unsigned char)op2.i64;
1955 else if(op2.kind == 22)
1956 *value2 = (unsigned char)op2.ui64;
1957 else if(op2.kind == 2 && op2.type->isSigned)
1958 *value2 = (unsigned char)op2.s;
1959 else if(op2.kind == 2)
1960 *value2 = (unsigned char)op2.us;
1961 else if(op2.kind == 1 && op2.type->isSigned)
1962 *value2 = (unsigned char)op2.c;
1963 else if(op2.kind == 1)
1965 else if(op2.kind == 6)
1966 *value2 = (unsigned char)op2.f;
1967 else if(op2.kind == 7)
1968 *value2 = (unsigned char)op2.d;
1969 else if(op2.kind == 13)
1970 *value2 = (unsigned char)op2.ui64;
1976 unsigned int GetFloat(struct Expression * exp, float * value2)
1978 struct Operand op2 = GetOperand(exp);
1980 if(op2.kind == 3 && op2.type->isSigned)
1981 *value2 = (float)(float)op2.i;
1982 else if(op2.kind == 3)
1983 *value2 = (float)(float)op2.ui;
1984 if(op2.kind == 4 && op2.type->isSigned)
1985 *value2 = (float)(float)op2.i64;
1986 else if(op2.kind == 4)
1987 *value2 = (float)(float)op2.ui64;
1988 else if(op2.kind == 22 && op2.type->isSigned)
1989 *value2 = (float)(float)op2.i64;
1990 else if(op2.kind == 22)
1991 *value2 = (float)(float)op2.ui64;
1992 else if(op2.kind == 2 && op2.type->isSigned)
1993 *value2 = (float)(float)op2.s;
1994 else if(op2.kind == 2)
1995 *value2 = (float)(float)op2.us;
1996 else if(op2.kind == 1 && op2.type->isSigned)
1997 *value2 = (float)(float)op2.c;
1998 else if(op2.kind == 1)
1999 *value2 = (float)(float)op2.uc;
2000 else if(op2.kind == 6)
2001 *value2 = (float)op2.f;
2002 else if(op2.kind == 7)
2003 *value2 = (float)op2.d;
2004 else if(op2.kind == 13)
2005 *value2 = (float)(float)op2.ui64;
2011 unsigned int GetDouble(struct Expression * exp, double * value2)
2013 struct Operand op2 = GetOperand(exp);
2015 if(op2.kind == 3 && op2.type->isSigned)
2016 *value2 = (double)(double)op2.i;
2017 else if(op2.kind == 3)
2018 *value2 = (double)(double)op2.ui;
2019 if(op2.kind == 4 && op2.type->isSigned)
2020 *value2 = (double)(double)op2.i64;
2021 else if(op2.kind == 4)
2022 *value2 = (double)(double)op2.ui64;
2023 else if(op2.kind == 22 && op2.type->isSigned)
2024 *value2 = (double)(double)op2.i64;
2025 else if(op2.kind == 22)
2026 *value2 = (double)(double)op2.ui64;
2027 else if(op2.kind == 2 && op2.type->isSigned)
2028 *value2 = (double)(double)op2.s;
2029 else if(op2.kind == 2)
2030 *value2 = (double)(double)op2.us;
2031 else if(op2.kind == 1 && op2.type->isSigned)
2032 *value2 = (double)(double)op2.c;
2033 else if(op2.kind == 1)
2034 *value2 = (double)(double)op2.uc;
2035 else if(op2.kind == 6)
2036 *value2 = (double)op2.f;
2037 else if(op2.kind == 7)
2038 *value2 = (double)op2.d;
2039 else if(op2.kind == 13)
2040 *value2 = (double)(double)op2.ui64;
2046 void ComputeExpression(struct Expression * exp);
2048 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2050 extern int targetBits;
2052 int ComputeTypeSize(struct Type * type);
2054 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2056 struct __ecereNameSpace__ecere__com__BitMember
2058 struct __ecereNameSpace__ecere__com__BitMember * prev;
2059 struct __ecereNameSpace__ecere__com__BitMember * next;
2061 unsigned int isProperty;
2064 struct __ecereNameSpace__ecere__com__Class * _class;
2065 char * dataTypeString;
2066 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2067 struct Type * dataType;
2072 } __attribute__ ((gcc_struct));
2074 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2076 struct __ecereNameSpace__ecere__sys__OldLink
2078 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2079 struct __ecereNameSpace__ecere__sys__OldLink * next;
2081 } __attribute__ ((gcc_struct));
2083 void FinishTemplatesContext(struct Context * context);
2085 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2087 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2088 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2090 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2093 int unionMemberOffset = 0;
2098 member->memberOffset = 0;
2099 if(targetBits < sizeof(void *) * 8)
2100 member->structAlignment = 0;
2102 else if(targetBits < sizeof(void *) * 8)
2103 _class->structAlignment = 0;
2104 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2105 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2106 if(!member && _class->destructionWatchOffset)
2107 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2109 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2111 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2113 if(!dataMember->isProperty)
2115 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2117 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2123 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2125 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2127 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2129 if(!isMember && _class->type == 2 && dataMember->dataType)
2131 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2135 ComputeTypeSize(dataMember->dataType);
2136 if(bitMember->pos == -1)
2137 bitMember->pos = _class->memberOffset;
2138 if(!bitMember->size)
2139 bitMember->size = dataMember->dataType->size * 8;
2140 _class->memberOffset = bitMember->pos + bitMember->size;
2141 for(d = 0; d < bitMember->size; d++)
2147 bitMember->mask = mask << bitMember->pos;
2149 else if(dataMember->type == 0 && dataMember->dataType)
2154 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2155 ComputeTypeSize(dataMember->dataType);
2156 if(dataMember->dataType->bitFieldCount)
2158 bitFields += dataMember->dataType->bitFieldCount;
2165 int size = (bitFields + 7) / 8;
2169 int __simpleStruct0;
2173 int __simpleStruct0;
2175 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2176 if(member->memberOffset % alignment)
2177 member->memberOffset += alignment - (member->memberOffset % alignment);
2179 dataMember->offset = member->memberOffset;
2180 if(member->type == 1)
2181 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2184 member->memberOffset += size;
2191 int __simpleStruct0;
2193 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2194 if(_class->memberOffset % alignment)
2195 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2197 dataMember->offset = _class->memberOffset;
2198 _class->memberOffset += size;
2202 size = dataMember->dataType->size;
2203 alignment = dataMember->dataType->alignment;
2207 int __simpleStruct0;
2211 int __simpleStruct0;
2213 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2214 if(member->memberOffset % alignment)
2215 member->memberOffset += alignment - (member->memberOffset % alignment);
2217 dataMember->offset = member->memberOffset;
2218 if(member->type == 1)
2219 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2222 member->memberOffset += size;
2229 int __simpleStruct0;
2231 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2232 if(_class->memberOffset % alignment)
2233 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2235 dataMember->offset = _class->memberOffset;
2236 _class->memberOffset += size;
2243 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2244 alignment = dataMember->structAlignment;
2247 int __simpleStruct0;
2251 int __simpleStruct0;
2253 if(member->memberOffset % alignment)
2254 member->memberOffset += alignment - (member->memberOffset % alignment);
2255 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2257 dataMember->offset = member->memberOffset;
2258 if(member->type == 1)
2259 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2261 member->memberOffset += dataMember->memberOffset;
2267 int __simpleStruct0;
2269 if(_class->memberOffset % alignment)
2270 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2271 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2273 dataMember->offset = _class->memberOffset;
2274 _class->memberOffset += dataMember->memberOffset;
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 if(member->type == 1)
2297 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2300 member->memberOffset += size;
2307 int __simpleStruct0;
2309 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2310 if(_class->memberOffset % alignment)
2311 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2313 _class->memberOffset += size;
2318 if(member && member->type == 1)
2320 member->memberOffset = unionMemberOffset;
2324 if(_class->type != 2)
2328 if(_class->structAlignment)
2330 if(_class->memberOffset % _class->structAlignment)
2331 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2333 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2336 struct __ecereNameSpace__ecere__com__Property * prop;
2338 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2340 if(prop->isProperty && prop->isWatchable)
2342 prop->watcherOffset = _class->structSize;
2343 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2348 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2350 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2352 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2354 if(deriv->computeSize)
2356 deriv->offset = _class->structSize;
2357 deriv->memberOffset = 0;
2358 deriv->structSize = deriv->offset;
2359 ComputeClassMembers(deriv, 0x0);
2367 FinishTemplatesContext(context);
2370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2372 struct __ecereNameSpace__ecere__com__NameSpace
2375 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2376 struct __ecereNameSpace__ecere__com__NameSpace * left;
2377 struct __ecereNameSpace__ecere__com__NameSpace * right;
2379 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2380 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2381 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2382 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2383 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2384 } __attribute__ ((gcc_struct));
2386 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2388 struct __ecereNameSpace__ecere__com__Module
2390 struct __ecereNameSpace__ecere__com__Instance * application;
2391 struct __ecereNameSpace__ecere__sys__OldList classes;
2392 struct __ecereNameSpace__ecere__sys__OldList defines;
2393 struct __ecereNameSpace__ecere__sys__OldList functions;
2394 struct __ecereNameSpace__ecere__sys__OldList modules;
2395 struct __ecereNameSpace__ecere__com__Instance * prev;
2396 struct __ecereNameSpace__ecere__com__Instance * next;
2402 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2403 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2404 } __attribute__ ((gcc_struct));
2406 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2408 struct __ecereNameSpace__ecere__com__Class * _class;
2409 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2411 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2412 ComputeModuleClasses(subModule->data);
2413 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2414 ComputeClassMembers(_class, 0x0);
2417 extern unsigned int inCompiler;
2419 extern void Compiler_Error(char * format, ...);
2421 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2423 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2425 int ComputeTypeSize(struct Type * type)
2427 unsigned int size = type ? type->size : 0;
2429 if(!size && type && !type->computing)
2431 type->computing = 0x1;
2435 type->alignment = size = sizeof(char);
2438 type->alignment = size = sizeof(int);
2441 type->alignment = size = sizeof(long long);
2444 type->alignment = size = targetBits / 8;
2447 type->alignment = size = sizeof(long);
2450 type->alignment = size = sizeof(short);
2453 type->alignment = size = sizeof(float);
2456 type->alignment = size = sizeof(double);
2460 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2462 if(_class && _class->type == 1)
2464 ComputeClassMembers(_class, 0x0);
2465 type->alignment = _class->structAlignment;
2466 size = _class->structSize;
2467 if(type->alignment && size % type->alignment)
2468 size += type->alignment - (size % type->alignment);
2470 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2472 if(!_class->dataType)
2473 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2474 size = type->alignment = ComputeTypeSize(_class->dataType);
2477 size = type->alignment = targetBits / 8;
2482 size = type->alignment = targetBits / 8;
2485 if(type->arraySizeExp)
2487 ProcessExpressionType(type->arraySizeExp);
2488 ComputeExpression(type->arraySizeExp);
2489 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)))
2491 struct Location oldLoc = yylloc;
2492 char expression[10240];
2494 expression[0] = '\0';
2495 type->arraySizeExp->expType = (((void *)0));
2496 yylloc = type->arraySizeExp->loc;
2498 PrintExpression(type->arraySizeExp, expression);
2499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2502 GetInt(type->arraySizeExp, &type->arraySize);
2504 else if(type->enumClass)
2506 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2508 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2511 type->arraySize = 0;
2515 type->arraySize = 0;
2517 size = ComputeTypeSize(type->type) * type->arraySize;
2518 type->alignment = type->type->alignment;
2522 struct Type * member;
2524 for(member = type->members.first; member; member = member->next)
2526 int __simpleStruct0, __simpleStruct1;
2527 unsigned int addSize = ComputeTypeSize(member);
2529 member->offset = size;
2530 if(member->alignment && size % member->alignment)
2531 member->offset += member->alignment - (size % member->alignment);
2532 size = member->offset;
2533 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2536 if(type->alignment && size % type->alignment)
2537 size += type->alignment - (size % type->alignment);
2542 struct Type * member;
2544 for(member = type->members.first; member; member = member->next)
2546 int __simpleStruct0, __simpleStruct1;
2547 unsigned int addSize = ComputeTypeSize(member);
2549 member->offset = size;
2550 if(member->alignment && size % member->alignment)
2551 member->offset += member->alignment - (size % member->alignment);
2552 size = member->offset;
2553 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2554 size = ((size > addSize) ? size : addSize);
2556 if(type->alignment && size % type->alignment)
2557 size += type->alignment - (size % type->alignment);
2562 struct TemplateParameter * param = type->templateParameter;
2563 struct Type * baseType = ProcessTemplateParameterType(param);
2567 size = ComputeTypeSize(baseType);
2568 type->alignment = baseType->alignment;
2571 type->alignment = size = sizeof(uint64);
2576 type->alignment = size = sizeof(enum
2584 type->alignment = size = targetBits / 8;
2589 type->computing = 0x0;
2594 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2596 extern struct Identifier * MkIdentifier(char * string);
2598 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2600 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2602 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2604 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2606 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2608 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2610 extern void FreeType(struct Type * type);
2612 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2614 extern struct Specifier * MkSpecifier(int specifier);
2616 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2618 extern struct Expression * MkExpConstant(char * string);
2620 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding)
2622 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2623 unsigned int totalSize = 0;
2624 unsigned int maxSize = 0;
2625 int alignment, size;
2626 struct __ecereNameSpace__ecere__com__DataMember * member;
2627 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2630 *addedPadding = 0x0;
2631 if(!isMember && _class->base)
2633 maxSize = _class->structSize;
2635 if(_class->type == 1 || _class->type == 5)
2636 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2638 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2641 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2643 if(!member->isProperty)
2645 switch(member->type)
2649 if(member->dataTypeString)
2651 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2652 struct Declarator * decl;
2654 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2655 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2656 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2657 if(!member->dataType)
2658 member->dataType = ProcessType(specs, decl);
2659 ReplaceThisClassSpecifiers(specs, topClass);
2661 struct Type * type = ProcessType(specs, decl);
2663 DeclareType(member->dataType, 0x0, 0x0);
2666 ComputeTypeSize(member->dataType);
2667 size = member->dataType->size;
2668 alignment = member->dataType->alignment;
2671 if(totalSize % alignment)
2672 totalSize += alignment - (totalSize % alignment);
2681 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2684 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2685 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2686 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2687 alignment = member->structAlignment;
2690 if(totalSize % alignment)
2691 totalSize += alignment - (totalSize % alignment);
2701 unsigned int __simpleStruct0;
2703 if(topMember && topMember->type == 1)
2704 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2706 *retSize += totalSize;
2708 else if(totalSize < maxSize && _class->type != 1000)
2710 int autoPadding = 0;
2712 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2713 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2714 if(totalSize + autoPadding < maxSize)
2716 char sizeString[50];
2718 sprintf(sizeString, "%d", maxSize - totalSize);
2719 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2721 *addedPadding = 0x1;
2725 FinishTemplatesContext(context);
2726 return topMember ? topMember->memberID : _class->memberID;
2729 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2731 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2732 unsigned int totalSize = 0;
2733 struct __ecereNameSpace__ecere__com__DataMember * member;
2734 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2736 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2737 DeclareMembers(_class->base, 0x0);
2738 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2740 if(!member->isProperty)
2742 switch(member->type)
2746 if(!member->dataType && member->dataTypeString)
2747 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2748 if(member->dataType)
2749 DeclareType(member->dataType, 0x0, 0x0);
2755 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2762 FinishTemplatesContext(context);
2763 return topMember ? topMember->memberID : _class->memberID;
2766 extern struct Symbol * FindClass(char * name);
2768 extern char * strchr(char * , int);
2770 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2772 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2774 extern void FreeClassDef(struct ClassDef * def);
2776 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2778 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2780 extern char * strcpy(char * , const char * );
2782 extern void MangleClassName(char * className);
2784 extern void DeclareClass(struct Symbol * classSym, char * className);
2786 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2788 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2790 void DeclareStruct(char * name, unsigned int skipNoHead)
2792 struct External * external = (((void *)0));
2793 struct Symbol * classSym = FindClass(name);
2795 if(!inCompiler || !classSym)
2797 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2799 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2801 struct Declaration * decl;
2802 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2803 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2804 char structName[1024];
2806 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2807 classSym->declaring++;
2808 if(strchr(classSym->string, '<'))
2810 if(classSym->registered->templateClass)
2812 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2813 classSym->declaring--;
2817 DeclareMembers(classSym->registered, 0x0);
2818 structName[0] = (char)0;
2819 FullClassNameCat(structName, name, 0x0);
2822 unsigned int addedPadding = 0x0;
2824 classSym->declaredStructSym = 0x1;
2825 declarations = MkList();
2826 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2827 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2829 FreeList(declarations, FreeClassDef);
2830 declarations = (((void *)0));
2833 if(skipNoHead || declarations)
2835 if(external && external->declaration)
2837 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2838 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2840 if(classSym->structExternal)
2841 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2843 classSym->id = curExternal->symbol->idCode;
2844 classSym->idCode = curExternal->symbol->idCode;
2850 external = MkExternalDeclaration((((void *)0)));
2851 specifiers = MkList();
2852 declarators = MkList();
2853 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2854 external->declaration = decl = MkDeclaration(specifiers, declarators);
2855 if(decl->symbol && !decl->symbol->pointerExternal)
2856 decl->symbol->pointerExternal = external;
2857 if(classSym->registered && classSym->registered->type == 1)
2859 char className[1024];
2861 strcpy(className, "__ecereClass_");
2862 FullClassNameCat(className, classSym->string, 0x1);
2863 MangleClassName(className);
2864 DeclareClass(classSym, className);
2865 external->symbol = classSym;
2866 classSym->pointerExternal = external;
2867 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2868 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2872 char className[1024];
2874 strcpy(className, "__ecereClass_");
2875 FullClassNameCat(className, classSym->string, 0x1);
2876 MangleClassName(className);
2877 classSym->structExternal = external;
2878 DeclareClass(classSym, className);
2879 external->symbol = classSym;
2881 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2884 classSym->declaring--;
2886 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2888 classSym->declaring++;
2890 if(classSym->registered)
2891 DeclareMembers(classSym->registered, 0x0);
2893 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2895 if(classSym->structExternal)
2896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2898 classSym->id = curExternal->symbol->idCode;
2899 classSym->idCode = curExternal->symbol->idCode;
2901 classSym->declaring--;
2905 extern char * strcat(char * , const char * );
2907 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2909 extern struct ModuleImport * mainModule;
2911 extern struct Specifier * MkSpecifierName(char * name);
2913 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2915 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2917 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2919 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2921 extern void FreeDeclarator(struct Declarator * decl);
2923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2925 struct PropertyImport
2927 struct PropertyImport * prev;
2928 struct PropertyImport * next;
2930 unsigned int isVirtual;
2931 unsigned int hasSet;
2932 unsigned int hasGet;
2933 } __attribute__ ((gcc_struct));
2935 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2937 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2939 void * __ecereTemp1;
2940 struct Symbol * symbol = prop->symbol;
2941 char propName[1024];
2943 strcpy(setName, "__ecereProp_");
2944 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2945 strcat(setName, "_Set_");
2946 FullClassNameCat(setName, prop->name, 0x1);
2947 strcpy(getName, "__ecereProp_");
2948 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2949 strcat(getName, "_Get_");
2950 FullClassNameCat(getName, prop->name, 0x1);
2951 strcpy(propName, "__ecereProp_");
2952 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2953 strcat(propName, "_");
2954 FullClassNameCat(propName, prop->name, 0x1);
2955 MangleClassName(getName);
2956 MangleClassName(setName);
2957 MangleClassName(propName);
2958 if(prop->_class->type == 1)
2959 DeclareStruct(prop->_class->fullName, 0x0);
2960 if(!symbol || curExternal->symbol->idCode < symbol->id)
2962 unsigned int imported = 0x0;
2963 unsigned int dllImport = 0x0;
2965 if(!symbol || symbol->_import)
2969 struct Symbol * classSym;
2971 if(!prop->_class->symbol)
2972 prop->_class->symbol = FindClass(prop->_class->fullName);
2973 classSym = prop->_class->symbol;
2974 if(classSym && !classSym->_import)
2976 struct ModuleImport * module;
2978 if(prop->_class->module)
2979 module = FindModule(prop->_class->module);
2981 module = mainModule;
2982 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));
2983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2985 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2986 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));
2988 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2991 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2996 struct Context * context = SetupTemplatesContext(prop->_class);
2998 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2999 FinishTemplatesContext(context);
3003 if(!symbol->externalGet || symbol->externalGet->type == 0)
3005 struct Declaration * decl;
3006 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3007 struct Declarator * d;
3008 struct __ecereNameSpace__ecere__sys__OldList * params;
3009 struct Specifier * spec;
3010 struct External * external;
3011 struct Declarator * typeDecl;
3012 unsigned int simple = 0x0;
3014 specifiers = MkList();
3015 declarators = MkList();
3017 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3018 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3020 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3022 struct Context * context = SetupTemplatesContext(prop->_class);
3024 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3025 FinishTemplatesContext(context);
3027 for(spec = (*specifiers).first; spec; spec = spec->next)
3031 if((!typeDecl || typeDecl->type == 1))
3033 struct Symbol * classSym = spec->symbol;
3035 symbol->_class = classSym->registered;
3036 if(classSym->registered && classSym->registered->type == 1)
3038 DeclareStruct(spec->name, 0x0);
3045 d = PlugDeclarator(typeDecl, d);
3048 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3049 specifiers = MkList();
3051 d = MkDeclaratorFunction(d, params);
3053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3054 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3057 ListAdd(specifiers, MkSpecifier(VOID));
3058 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3059 decl = MkDeclaration(specifiers, declarators);
3060 external = MkExternalDeclaration(decl);
3061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3062 external->symbol = symbol;
3063 symbol->externalGet = external;
3064 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3066 FreeDeclarator(typeDecl);
3070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3075 if(!symbol->externalSet || symbol->externalSet->type == 0)
3077 struct Declaration * decl;
3078 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3079 struct Declarator * d;
3080 struct __ecereNameSpace__ecere__sys__OldList * params;
3081 struct Specifier * spec;
3082 struct External * external;
3083 struct Declarator * typeDecl;
3085 declarators = MkList();
3087 if(!prop->conversion || prop->_class->type == 1)
3089 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3091 specifiers = MkList();
3093 struct Context * context = SetupTemplatesContext(prop->_class);
3095 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3096 FinishTemplatesContext(context);
3098 ListAdd(params, MkTypeName(specifiers, d));
3099 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3101 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3102 d = MkDeclaratorFunction(d, params);
3103 for(spec = (*specifiers).first; spec; spec = spec->next)
3107 if((!typeDecl || typeDecl->type == 1))
3109 struct Symbol * classSym = spec->symbol;
3111 symbol->_class = classSym->registered;
3112 if(classSym->registered && classSym->registered->type == 1)
3113 DeclareStruct(spec->name, 0x0);
3117 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3118 specifiers = MkList();
3120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3121 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3123 if(!prop->conversion || prop->_class->type == 1)
3124 ListAdd(specifiers, MkSpecifier(VOID));
3126 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3127 decl = MkDeclaration(specifiers, declarators);
3128 external = MkExternalDeclaration(decl);
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3130 external->symbol = symbol;
3131 symbol->externalSet = external;
3132 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3139 if(!symbol->externalPtr)
3141 struct Declaration * decl;
3142 struct External * external;
3143 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3149 ListAdd(specifiers, MkSpecifierName("Property"));
3151 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3153 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3156 strcpy(propName, "__ecerePropM_");
3157 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3158 strcat(propName, "_");
3159 FullClassNameCat(propName, prop->name, 0x1);
3160 MangleClassName(propName);
3161 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3163 decl = MkDeclaration(specifiers, list);
3165 external = MkExternalDeclaration(decl);
3166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3167 external->symbol = symbol;
3168 symbol->externalPtr = external;
3172 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3174 symbol->id = curExternal->symbol->idCode;
3178 struct Type * Dereference(struct Type * source)
3180 void * __ecereTemp1;
3181 struct Type * type = (((void *)0));
3185 if(source->kind == 13 || source->kind == 12)
3187 type = source->type;
3188 source->type->refCount++;
3190 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3192 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3194 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3200 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3205 static struct Type * Reference(struct Type * source)
3207 void * __ecereTemp1;
3208 struct Type * type = (((void *)0));
3212 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));
3218 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);
3220 extern void * memcpy(void * , const void * , unsigned int size);
3222 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3224 extern void FreeExpression(struct Expression * exp);
3226 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3228 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);
3230 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3232 extern struct Type * MkClassType(char * name);
3234 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);
3236 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)
3238 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3239 unsigned int found = 0x0;
3240 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3241 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3242 unsigned int freeType = 0x0;
3244 yylloc = member->loc;
3249 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3253 dataMember = *curMember;
3259 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3260 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3261 int _subMemberStackPos = 0;
3264 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3267 dataMember = thisMember;
3268 if(curMember && thisMember->memberAccess == 1)
3270 *curMember = thisMember;
3271 *curClass = thisMember->_class;
3272 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3273 *subMemberStackPos = _subMemberStackPos;
3279 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3280 if(method && method->type == 1)
3283 method = (((void *)0));
3288 struct Type * type = (((void *)0));
3292 if(!dataMember->dataType && dataMember->dataTypeString)
3294 struct Context * context = SetupTemplatesContext(_class);
3296 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3297 FinishTemplatesContext(context);
3299 type = dataMember->dataType;
3303 if(!method->dataType)
3304 ProcessMethodType(method);
3305 type = method->dataType;
3307 if(ident && ident->next)
3309 for(ident = ident->next; ident && type; ident = ident->next)
3313 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3315 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3317 type = dataMember->dataType;
3319 else if(type->kind == 9 || type->kind == 10)
3321 struct Type * memberType;
3323 for(memberType = type->members.first; memberType; memberType = memberType->next)
3325 if(!strcmp(memberType->name, ident->string))
3334 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3337 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3338 struct __ecereNameSpace__ecere__com__Class * sClass;
3340 for(sClass = _class; sClass; sClass = sClass->base)
3343 if(sClass->templateClass)
3344 sClass = sClass->templateClass;
3345 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3347 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3349 for(sClass = sClass->base; sClass; sClass = sClass->base)
3351 if(sClass->templateClass)
3352 sClass = sClass->templateClass;
3353 id += sClass->templateParams.count;
3364 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3366 if(arg.dataTypeString)
3368 type = ProcessTypeString(arg.dataTypeString, 0x0);
3370 if(type && _class->templateClass)
3371 type->passAsTemplate = 0x1;
3378 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3380 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3381 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3385 char templateString[1024];
3386 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3388 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3389 for(cClass = expClass; cClass; cClass = cClass->base)
3393 if(cClass->templateClass)
3394 cClass = cClass->templateClass;
3395 for(param = cClass->templateParams.first; param; param = param->next)
3398 struct __ecereNameSpace__ecere__com__Class * sClass;
3399 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3401 for(sClass = cClass->base; sClass; sClass = sClass->base)
3403 if(sClass->templateClass)
3404 sClass = sClass->templateClass;
3405 id += sClass->templateParams.count;
3407 arg = expClass->templateArgs[id];
3408 for(sClass = _class; sClass; sClass = sClass->base)
3410 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3412 struct __ecereNameSpace__ecere__com__Class * nextClass;
3414 if(sClass->templateClass)
3415 sClass = sClass->templateClass;
3416 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3418 if(nextClass->templateClass)
3419 nextClass = nextClass->templateClass;
3420 p += nextClass->templateParams.count;
3422 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3424 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3426 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3428 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3429 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3443 char expString[1024];
3444 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3445 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3446 struct Expression * exp;
3447 char * string = PrintHexUInt64(arg.expression.ui64);
3449 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3450 ProcessExpressionType(exp);
3451 ComputeExpression(exp);
3452 expString[0] = '\0';
3453 PrintExpression(exp, expString);
3454 strcat(argument, expString);
3455 FreeExpression(exp);
3460 strcat(argument, arg.member->name);
3465 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3466 strcat(argument, arg.dataTypeString);
3473 strcat(templateString, ", ");
3474 if(lastParam != p - 1)
3476 strcat(templateString, param->name);
3477 strcat(templateString, " = ");
3479 strcat(templateString, argument);
3488 int len = strlen(templateString);
3490 if(templateString[len - 1] == '<')
3494 if(templateString[len - 1] == '>')
3495 templateString[len++] = ' ';
3496 templateString[len++] = '>';
3498 templateString[len++] = '\0';
3501 struct Context * context = SetupTemplatesContext(_class);
3505 type = ProcessTypeString(templateString, 0x0);
3507 FinishTemplatesContext(context);
3510 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3512 ProcessExpressionType(member->initializer->exp);
3513 if(!member->initializer->exp->expType)
3517 char expString[10240];
3519 expString[0] = '\0';
3520 PrintExpression(member->initializer->exp, expString);
3521 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3522 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3525 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3527 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3530 else if(member->initializer)
3532 ProcessInitializer(member->initializer, type);
3539 if(_class && _class->type == 3)
3541 if(member->initializer)
3543 struct Type * type = MkClassType(_class->fullName);
3545 ProcessInitializer(member->initializer, type);
3551 if(member->initializer)
3553 ProcessInitializer(member->initializer, (((void *)0)));
3559 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3563 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3565 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3569 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3574 extern struct Identifier * GetDeclId(struct Declarator * decl);
3576 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);
3578 extern void FreeSpecifier(struct Specifier * spec);
3580 static void ProcessFunction(struct FunctionDefinition * function);
3582 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3584 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3586 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3588 extern void FreeClassFunction(struct ClassFunction * func);
3590 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3592 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3594 void ProcessInstantiationType(struct Instantiation * inst)
3599 struct MembersInit * members;
3600 struct Symbol * classSym;
3601 struct __ecereNameSpace__ecere__com__Class * _class;
3603 classSym = inst->_class->symbol;
3604 _class = classSym ? classSym->registered : (((void *)0));
3605 if(!_class || _class->type != 5)
3606 DeclareStruct(inst->_class->name, 0x0);
3607 afterExternal = afterExternal ? afterExternal : curExternal;
3609 ProcessExpressionType(inst->exp);
3610 inst->isConstant = 0x1;
3613 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3614 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3615 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3616 int subMemberStackPos = 0;
3618 for(members = (*inst->members).first; members; members = members->next)
3620 switch(members->type)
3625 static unsigned int instMethodID = 0;
3626 struct External * external = curExternal;
3627 struct Context * context = curContext;
3628 struct Declarator * declarator = members->function->declarator;
3629 struct Identifier * nameID = GetDeclId(declarator);
3630 char * unmangled = nameID ? nameID->string : (((void *)0));
3631 struct Expression * exp;
3632 struct External * createdExternal = (((void *)0));
3638 strcpy(name, "__ecereInstMeth_");
3639 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3641 strcat(name, nameID->string);
3643 sprintf(number, "_%08d", instMethodID++);
3644 strcat(name, number);
3645 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3649 struct Symbol * symbol = declarator->symbol;
3650 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3652 if(method && method->type == 1)
3654 symbol->method = method;
3655 ProcessMethodType(method);
3656 if(!symbol->type->thisClass)
3658 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3660 if(!currentClass->symbol)
3661 currentClass->symbol = FindClass(currentClass->fullName);
3662 symbol->type->thisClass = currentClass->symbol;
3667 _class->symbol = FindClass(_class->fullName);
3668 symbol->type->thisClass = _class->symbol;
3671 DeclareType(symbol->type, 0x1, 0x1);
3675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3678 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3681 FreeSpecifier(nameID->_class);
3682 nameID->_class = (((void *)0));
3686 struct Type * type = declarator->symbol->type;
3687 struct External * oldExternal = curExternal;
3689 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3691 struct External * externalDecl;
3693 externalDecl = MkExternalDeclaration((((void *)0)));
3694 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3695 if(createdExternal->function)
3697 ProcessFunction(createdExternal->function);
3699 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3701 externalDecl->declaration = decl;
3702 if(decl->symbol && !decl->symbol->pointerExternal)
3703 decl->symbol->pointerExternal = externalDecl;
3704 declarator->symbol->pointerExternal = externalDecl;
3711 curExternal = declarator->symbol->pointerExternal;
3712 ProcessFunction((struct FunctionDefinition *)members->function);
3714 curExternal = external;
3715 curContext = context;
3718 FreeClassFunction(members->function);
3719 exp = QMkExpId(name);
3721 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3722 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3728 if(members->dataMembers && classSym)
3730 struct MemberInit * member;
3731 struct Location oldyyloc = yylloc;
3733 for(member = (*members->dataMembers).first; member; member = member->next)
3735 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3736 if(member->initializer && !member->initializer->isConstant)
3737 inst->isConstant = 0x0;
3749 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3753 if(type->kind == 11)
3755 struct Type * param;
3759 for(param = type->params.first; param; param = param->next)
3760 DeclareType(param, declarePointers, 0x1);
3762 DeclareType(type->returnType, declarePointers, 0x1);
3764 else if(type->kind == 13 && declarePointers)
3765 DeclareType(type->type, declarePointers, 0x0);
3766 else if(type->kind == 8)
3768 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3769 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3771 else if(type->kind == 9 || type->kind == 10)
3773 struct Type * member;
3775 for(member = type->members.first; member; member = member->next)
3776 DeclareType(member, 0x0, 0x0);
3778 else if(type->kind == 12)
3779 DeclareType(type->arrayType, declarePointers, 0x0);
3783 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3785 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3787 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3789 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3790 struct __ecereNameSpace__ecere__com__Class * sClass;
3792 for(sClass = _class; sClass; sClass = sClass->base)
3795 if(sClass->templateClass)
3796 sClass = sClass->templateClass;
3797 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3799 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3801 for(sClass = sClass->base; sClass; sClass = sClass->base)
3803 if(sClass->templateClass)
3804 sClass = sClass->templateClass;
3805 id += sClass->templateParams.count;
3816 arg = &_class->templateArgs[id];
3817 if(arg && param->type == 0)
3818 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3823 extern struct Context * PushContext(void);
3825 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3827 struct TemplatedType
3830 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3831 struct __ecereNameSpace__ecere__sys__BTNode * left;
3832 struct __ecereNameSpace__ecere__sys__BTNode * right;
3834 struct TemplateParameter * param;
3835 } __attribute__ ((gcc_struct));
3837 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3839 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3841 void * __ecereTemp1;
3842 struct Context * context = PushContext();
3844 context->templateTypesOnly = 0x1;
3845 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3847 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3849 for(; param; param = param->next)
3851 if(param->type == 0 && param->identifier)
3853 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3855 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3861 struct __ecereNameSpace__ecere__com__Class * sClass;
3863 for(sClass = _class; sClass; sClass = sClass->base)
3865 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3867 for(p = sClass->templateParams.first; p; p = p->next)
3871 struct TemplateParameter * param = p->param;
3872 struct TemplatedType * type;
3876 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));
3878 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));
3879 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3887 extern void PopContext(struct Context * ctx);
3889 extern void FreeContext(struct Context * context);
3891 void FinishTemplatesContext(struct Context * context)
3893 PopContext(context);
3894 FreeContext(context);
3895 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3898 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3900 if(!method->dataType)
3902 struct Context * context = SetupTemplatesContext(method->_class);
3904 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3905 FinishTemplatesContext(context);
3906 if(method->type != 1 && method->dataType)
3908 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3910 if(!method->_class->symbol)
3911 method->_class->symbol = FindClass(method->_class->fullName);
3912 method->dataType->thisClass = method->_class->symbol;
3918 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3922 struct Context * context = SetupTemplatesContext(prop->_class);
3924 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3925 FinishTemplatesContext(context);
3929 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3931 extern void FreeTypeName(struct TypeName * typeName);
3933 static void ProcessDeclarator(struct Declarator * decl);
3935 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3941 struct MethodImport * prev;
3942 struct MethodImport * next;
3944 unsigned int isVirtual;
3945 } __attribute__ ((gcc_struct));
3947 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3949 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3951 void * __ecereTemp1;
3952 struct Symbol * symbol = method->symbol;
3954 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3956 unsigned int imported = 0x0;
3957 unsigned int dllImport = 0x0;
3959 if(!method->dataType)
3960 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3961 if(!symbol || symbol->_import || method->type == 1)
3963 if(!symbol || method->type == 1)
3965 struct Symbol * classSym;
3967 if(!method->_class->symbol)
3968 method->_class->symbol = FindClass(method->_class->fullName);
3969 classSym = method->_class->symbol;
3970 if(!classSym->_import)
3972 struct ModuleImport * module;
3974 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3975 module = FindModule(method->_class->module);
3977 module = mainModule;
3978 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));
3979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3983 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3985 if(!symbol->_import)
3987 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));
3988 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3992 symbol->type = method->dataType;
3994 symbol->type->refCount++;
3997 if(!method->dataType->dllExport)
4000 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4004 if(method->type != 1 && method->dataType)
4005 DeclareType(method->dataType, 0x1, 0x1);
4006 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4008 struct Declaration * decl;
4009 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4010 struct Declarator * d;
4011 struct Declarator * funcDecl;
4012 struct External * external;
4014 specifiers = MkList();
4015 declarators = MkList();
4017 ListAdd(specifiers, MkSpecifier(EXTERN));
4018 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4019 ListAdd(specifiers, MkSpecifier(STATIC));
4020 if(method->type == 1)
4022 ListAdd(specifiers, MkSpecifier(INT));
4023 d = MkDeclaratorIdentifier(MkIdentifier(name));
4027 d = MkDeclaratorIdentifier(MkIdentifier(name));
4029 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4031 struct Context * context = SetupTemplatesContext(method->_class);
4033 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4034 FinishTemplatesContext(context);
4036 funcDecl = GetFuncDecl(d);
4039 struct Specifier * spec, * next;
4041 for(spec = (*specifiers).first; spec; spec = next)
4046 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4047 FreeSpecifier(spec);
4051 if(method->dataType && !method->dataType->staticMethod)
4053 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4055 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4056 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")));
4057 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4058 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4060 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4062 struct TypeName * param = (*funcDecl->function.parameters).first;
4064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4065 FreeTypeName(param);
4067 if(!funcDecl->function.parameters)
4068 funcDecl->function.parameters = MkList();
4069 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4073 ProcessDeclarator(d);
4074 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4075 decl = MkDeclaration(specifiers, declarators);
4076 ReplaceThisClassSpecifiers(specifiers, method->_class);
4077 if(symbol->pointerExternal)
4079 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4082 *functionSymbol = *symbol;
4083 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4084 if(functionSymbol->type)
4085 functionSymbol->type->refCount++;
4087 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4088 symbol->pointerExternal->symbol = functionSymbol;
4090 external = MkExternalDeclaration(decl);
4092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4093 external->symbol = symbol;
4094 symbol->pointerExternal = external;
4098 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4100 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4104 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4106 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4108 unsigned int first = 0x1;
4110 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4112 char className[1024];
4114 strcpy(className, _class->fullName);
4115 for(param = _class->templateParams.first; param; param = param->next)
4119 strcat(className, "<");
4121 strcat(className, ", ");
4122 if(lastParam + 1 != p)
4124 strcat(className, param->name);
4125 strcat(className, " = ");
4127 strcat(className, param->name);
4135 int len = strlen(className);
4137 if(className[len - 1] == '>')
4138 className[len++] = ' ';
4139 className[len++] = '>';
4140 className[len++] = '\0';
4142 return __ecereNameSpace__ecere__sys__CopyString(className);
4145 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4148 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4150 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4152 unsigned int first = 0x1;
4154 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4156 char className[1024];
4158 strcpy(className, _class->fullName);
4159 for(param = _class->templateParams.first; param; param = param->next)
4163 strcat(className, "<");
4165 strcat(className, ", ");
4166 if(lastParam + 1 != p)
4168 strcat(className, param->name);
4169 strcat(className, " = ");
4171 strcat(className, param->name);
4179 int len = strlen(className);
4181 if(className[len - 1] == '>')
4182 className[len++] = ' ';
4183 className[len++] = '>';
4184 className[len++] = '\0';
4186 return MkClassType(className);
4190 return MkClassType(_class->fullName);
4194 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4196 if(specs != (((void *)0)) && _class)
4198 struct Specifier * spec;
4200 for(spec = specs->first; spec; spec = spec->next)
4202 if(spec->type == 0 && spec->specifier == THISCLASS)
4205 spec->name = ReplaceThisClass(_class);
4206 spec->symbol = FindClass(spec->name);
4212 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4214 struct __ecereNameSpace__ecere__com__GlobalFunction
4216 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4217 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4220 struct __ecereNameSpace__ecere__com__Instance * module;
4221 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4222 char * dataTypeString;
4223 struct Type * dataType;
4225 } __attribute__ ((gcc_struct));
4227 extern struct Context * globalContext;
4229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4231 struct FunctionImport
4233 struct FunctionImport * prev;
4234 struct FunctionImport * next;
4236 } __attribute__ ((gcc_struct));
4238 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4240 void * __ecereTemp1;
4241 struct Symbol * symbol = function->symbol;
4243 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4245 unsigned int imported = 0x0;
4246 unsigned int dllImport = 0x0;
4248 if(!function->dataType)
4250 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4251 if(!function->dataType->thisClass)
4252 function->dataType->staticMethod = 0x1;
4258 struct ModuleImport * module = FindModule(function->module);
4260 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4263 if(!function->dataType->dllExport)
4265 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));
4266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4270 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4271 if(!symbol->type->thisClass)
4272 symbol->type->staticMethod = 0x1;
4275 imported = symbol->_import ? 0x1 : 0x0;
4276 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4279 DeclareType(function->dataType, 0x1, 0x1);
4282 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4284 struct Declaration * decl;
4285 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4286 struct Declarator * d;
4287 struct Declarator * funcDecl;
4288 struct External * external;
4290 specifiers = MkList();
4291 declarators = MkList();
4292 ListAdd(specifiers, MkSpecifier(EXTERN));
4293 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4295 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4296 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4297 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4299 struct Specifier * spec;
4301 for(spec = (*specifiers).first; spec; spec = spec->next)
4302 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4305 FreeSpecifier(spec);
4309 funcDecl = GetFuncDecl(d);
4310 if(funcDecl && !funcDecl->function.parameters)
4312 funcDecl->function.parameters = MkList();
4313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4315 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4317 struct Context * oldCtx = curContext;
4319 curContext = globalContext;
4320 decl = MkDeclaration(specifiers, declarators);
4321 curContext = oldCtx;
4323 if(symbol->pointerExternal)
4325 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4328 *functionSymbol = *symbol;
4329 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4330 if(functionSymbol->type)
4331 functionSymbol->type->refCount++;
4333 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4334 symbol->pointerExternal->symbol = functionSymbol;
4336 external = MkExternalDeclaration(decl);
4338 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4339 external->symbol = symbol;
4340 symbol->pointerExternal = external;
4344 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4347 symbol->id = curExternal->symbol->idCode;
4350 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4353 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4358 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4359 struct __ecereNameSpace__ecere__sys__BTNode * left;
4360 struct __ecereNameSpace__ecere__sys__BTNode * right;
4362 struct __ecereNameSpace__ecere__com__Instance * module;
4363 char * dataTypeString;
4364 struct Type * dataType;
4367 } __attribute__ ((gcc_struct));
4369 void DeclareGlobalData(struct GlobalData * data)
4371 struct Symbol * symbol = data->symbol;
4373 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4378 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4381 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4382 DeclareType(data->dataType, 0x1, 0x1);
4385 if(!symbol->pointerExternal)
4387 struct Declaration * decl;
4388 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4389 struct Declarator * d;
4390 struct External * external;
4392 specifiers = MkList();
4393 declarators = MkList();
4394 ListAdd(specifiers, MkSpecifier(EXTERN));
4395 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4396 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4397 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4398 decl = MkDeclaration(specifiers, declarators);
4399 external = MkExternalDeclaration(decl);
4401 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4402 external->symbol = symbol;
4403 symbol->pointerExternal = external;
4407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4410 symbol->id = curExternal->symbol->idCode;
4417 struct Conversion * prev, * next;
4418 struct __ecereNameSpace__ecere__com__Property * convert;
4420 struct Type * resultType;
4421 } __attribute__ ((gcc_struct));
4423 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4425 extern void Compiler_Warning(char * format, ...);
4427 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4429 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)
4433 if(source->kind == 20 && dest->kind != 20)
4435 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4440 if(dest->kind == 20 && source->kind != 20)
4442 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4447 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4451 if(source->classObjectType == 3 && dest->classObjectType != 2)
4455 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4457 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4460 if(dest->kind == 14 && source->kind != 0)
4462 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))
4464 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))
4466 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4468 if(source->_class->registered && source->_class->registered->type == 3)
4470 if(conversions != (((void *)0)))
4472 if(source->_class->registered == dest->_class->registered)
4477 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4479 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4481 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4483 if(sourceBase == destBase)
4487 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))
4491 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4493 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4500 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4504 if(source->kind == 8)
4506 struct __ecereNameSpace__ecere__com__Class * _class;
4508 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4510 struct __ecereNameSpace__ecere__com__Property * convert;
4512 for(convert = _class->conversions.first; convert; convert = convert->next)
4514 if(convert->memberAccess == 1 || _class->module == privateModule)
4516 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4518 if(!convert->dataType)
4519 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4520 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4522 if(!conversions && !convert->Get)
4524 else if(conversions != (((void *)0)))
4526 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))
4530 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4543 struct __ecereNameSpace__ecere__com__Class * _class;
4545 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4547 struct __ecereNameSpace__ecere__com__Property * convert;
4549 for(convert = _class->conversions.first; convert; convert = convert->next)
4551 if(convert->memberAccess == 1 || _class->module == privateModule)
4553 if(!convert->dataType)
4554 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4555 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4557 if(!conversions && !convert->Set)
4559 else if(conversions != (((void *)0)))
4561 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))
4565 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4567 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4575 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4577 if(!dest->_class->registered->dataType)
4578 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4579 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4581 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4588 if(source->kind == 8)
4590 struct __ecereNameSpace__ecere__com__Class * _class;
4592 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4594 struct __ecereNameSpace__ecere__com__Property * convert;
4596 for(convert = _class->conversions.first; convert; convert = convert->next)
4598 if(convert->memberAccess == 1 || _class->module == privateModule)
4600 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4602 if(!convert->dataType)
4603 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4604 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4606 if(!conversions && !convert->Get)
4608 else if(conversions != (((void *)0)))
4610 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))
4614 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4616 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4624 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4626 if(!source->_class->registered->dataType)
4627 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4628 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4635 if(source->kind == 8 || source->kind == 19)
4637 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4639 else if(dest->kind == 7 && source->kind == 6)
4641 else if(dest->kind == 2 && source->kind == 1)
4643 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4645 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4647 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4649 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4651 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4653 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)))
4655 struct Type * paramSource, * paramDest;
4657 if(dest->kind == 16)
4658 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4659 if(source->kind == 16)
4660 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4661 if(dest->kind == 13 && dest->type->kind == 11)
4663 if(source->kind == 13 && source->type->kind == 11)
4664 source = source->type;
4665 if(dest->kind == 16)
4666 dest = dest->method->dataType;
4667 if(source->kind == 16)
4668 source = source->method->dataType;
4669 paramSource = source->params.first;
4670 if(paramSource && paramSource->kind == 0)
4671 paramSource = (((void *)0));
4672 paramDest = dest->params.first;
4673 if(paramDest && paramDest->kind == 0)
4674 paramDest = (((void *)0));
4675 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4677 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))))
4679 if(paramDest && paramDest->kind == 8)
4680 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4682 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4685 paramDest = paramDest->next;
4687 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4689 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4693 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4695 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4701 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4710 paramSource = paramSource->next;
4716 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4718 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4724 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4732 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4734 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4737 for(; paramDest; paramDest = paramDest->next)
4741 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4745 struct Type * paramDestType = paramDest;
4746 struct Type * paramSourceType = paramSource;
4747 struct Type * type = paramDestType;
4749 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4752 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4753 struct __ecereNameSpace__ecere__com__Class * sClass;
4755 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4758 if(sClass->templateClass)
4759 sClass = sClass->templateClass;
4760 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4762 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4764 for(sClass = sClass->base; sClass; sClass = sClass->base)
4766 if(sClass->templateClass)
4767 sClass = sClass->templateClass;
4768 id += sClass->templateParams.count;
4779 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4781 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4784 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)))
4789 PrintType(paramDest, type, 0x0, 0x1);
4790 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4791 if(paramDestType != paramDest)
4792 FreeType(paramDestType);
4795 if(paramDestType != paramDest)
4796 FreeType(paramDestType);
4798 paramSource = paramSource->next;
4802 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4807 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4811 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4813 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4820 static void FreeConvert(struct Conversion * convert)
4822 if(convert->resultType)
4823 FreeType(convert->resultType);
4826 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4828 struct __ecereNameSpace__ecere__com__BTNamedLink
4831 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4832 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4833 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4836 } __attribute__ ((gcc_struct));
4838 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4840 struct __ecereNameSpace__ecere__com__EnumClassData
4842 struct __ecereNameSpace__ecere__sys__OldList values;
4844 } __attribute__ ((gcc_struct));
4846 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4848 struct __ecereNameSpace__ecere__sys__NamedLink
4850 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4851 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4854 } __attribute__ ((gcc_struct));
4856 extern void FreeExpContents(struct Expression * exp);
4858 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4860 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4862 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4864 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4866 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4868 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4870 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4872 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)))
4874 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4876 if(_class->type == 4)
4878 struct __ecereNameSpace__ecere__sys__OldList converts =
4882 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4886 _class->symbol = FindClass(_class->fullName);
4887 type->_class = _class->symbol;
4888 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4890 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4891 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4895 struct __ecereNameSpace__ecere__com__Class * baseClass;
4897 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4899 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4901 for(value = e->values.first; value; value = value->next)
4903 if(!strcmp(value->name, string))
4908 FreeExpContents(sourceExp);
4909 FreeType(sourceExp->expType);
4910 sourceExp->isConstant = 0x1;
4911 sourceExp->expType = MkClassType(baseClass->fullName);
4915 sourceExp->type = 2;
4916 if(!strcmp(baseClass->dataTypeString, "int"))
4917 sprintf(constant, "%d", value->data);
4919 sprintf(constant, "0x%X", value->data);
4920 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4922 while(converts.first)
4924 struct Conversion * convert = converts.first;
4926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4927 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4929 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4936 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4937 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4940 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)))
4941 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4948 struct __ecereNameSpace__ecere__com__SubModule
4950 struct __ecereNameSpace__ecere__com__SubModule * prev;
4951 struct __ecereNameSpace__ecere__com__SubModule * next;
4952 struct __ecereNameSpace__ecere__com__Instance * module;
4954 } __attribute__ ((gcc_struct));
4956 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4958 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4960 if(searchFor == searchIn)
4962 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4964 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4966 if(ModuleVisibility(subModule->module, searchFor))
4973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4975 struct __ecereNameSpace__ecere__com__Application
4980 unsigned int isGUIApp;
4981 struct __ecereNameSpace__ecere__sys__OldList allModules;
4982 char * parsedCommand;
4983 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4984 } __attribute__ ((gcc_struct));
4986 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4988 struct __ecereNameSpace__ecere__com__Instance * module;
4990 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
4992 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4994 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4996 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)
4998 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5004 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5006 void ReadString(char * output, char * string);
5008 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5010 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5012 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5014 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5016 void * __ecereTemp1;
5017 struct Type * source = sourceExp->expType;
5018 struct Type * realDest = dest;
5020 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5022 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5024 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5026 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5028 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5030 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5032 if(sourceBase == destBase)
5038 struct __ecereNameSpace__ecere__sys__OldList * specs;
5039 unsigned int flag = 0x0;
5040 long long value = (((int)0x7fffffff));
5044 if(sourceExp->type == 2)
5046 if(source->isSigned)
5047 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5049 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5051 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5053 if(source->isSigned)
5054 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5056 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5058 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5061 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));
5065 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5067 if(_class && _class->type == 3)
5069 if(source->kind != 8)
5071 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5072 struct Type * tempDest, * tempSource;
5074 for(; _class->base->type != 1000; _class = _class->base)
5077 tempDest = tempType;
5080 _class->symbol = FindClass(_class->fullName);
5081 tempType->_class = _class->symbol;
5082 tempType->truth = dest->truth;
5083 if(tempType->_class)
5084 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5085 FreeType(sourceExp->expType);
5086 sourceExp->expType = dest;
5089 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5092 if(_class && _class->type == 2 && source->kind != 8)
5094 if(!dest->_class->registered->dataType)
5095 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5096 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5099 FreeType(sourceExp->expType);
5100 source = sourceExp->expType = MkClassType(dest->_class->string);
5104 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5106 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5107 struct Declarator * decl;
5110 ReadString(string, sourceExp->string);
5111 decl = SpecDeclFromString(string, specs, (((void *)0)));
5112 FreeExpContents(sourceExp);
5113 FreeType(sourceExp->expType);
5114 sourceExp->type = 26;
5115 sourceExp->_classExp.specifiers = specs;
5116 sourceExp->_classExp.decl = decl;
5117 sourceExp->expType = dest;
5124 else if(source->kind == 8)
5126 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5128 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5132 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5133 struct Type * tempDest, * tempSource;
5135 if(!source->_class->registered->dataType)
5136 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5137 for(; _class->base->type != 1000; _class = _class->base)
5140 tempSource = tempType;
5142 tempType->_class = FindClass(_class->fullName);
5143 tempType->truth = source->truth;
5144 tempType->classObjectType = source->classObjectType;
5145 if(tempType->_class)
5146 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5147 if(conversions->last)
5149 ((struct Conversion *)conversions->last)->resultType = dest;
5152 FreeType(sourceExp->expType);
5153 sourceExp->expType = MkClassType(_class->fullName);
5154 sourceExp->expType->truth = source->truth;
5155 sourceExp->expType->classObjectType = source->classObjectType;
5156 if(!sourceExp->destType)
5158 FreeType(sourceExp->destType);
5159 sourceExp->destType = sourceExp->expType;
5160 if(sourceExp->expType)
5161 sourceExp->expType->refCount++;
5163 if(!_class->dataType)
5164 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5166 dest = MkClassType(source->_class->string);
5167 dest->truth = source->truth;
5168 dest->classObjectType = source->classObjectType;
5170 source = _class->dataType;
5172 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5178 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5187 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5189 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5191 if(_class->type == 0 || _class->type == 5)
5193 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5195 *newExp = *sourceExp;
5196 if(sourceExp->destType)
5197 sourceExp->destType->refCount++;
5198 if(sourceExp->expType)
5199 sourceExp->expType->refCount++;
5200 sourceExp->type = 11;
5201 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5202 sourceExp->cast.exp = newExp;
5203 FreeType(sourceExp->expType);
5204 sourceExp->expType = (((void *)0));
5205 ProcessExpressionType(sourceExp);
5208 FreeType(sourceExp->expType);
5209 sourceExp->expType = dest;
5216 if(!_class->dataType)
5217 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5219 dest = _class->dataType;
5222 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5224 specs = MkListOne(MkSpecifier(DOUBLE));
5226 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5228 specs = MkListOne(MkSpecifier(FLOAT));
5230 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5234 ListAdd(specs, MkSpecifier(UNSIGNED));
5235 ListAdd(specs, MkSpecifier(INT64));
5237 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5241 ListAdd(specs, MkSpecifier(UNSIGNED));
5242 ListAdd(specs, MkSpecifier(INT));
5244 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5248 ListAdd(specs, MkSpecifier(UNSIGNED));
5249 ListAdd(specs, MkSpecifier(SHORT));
5251 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5255 ListAdd(specs, MkSpecifier(UNSIGNED));
5256 ListAdd(specs, MkSpecifier(CHAR));
5265 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))
5267 specs = MkListOne(MkSpecifier(DOUBLE));
5269 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5271 specs = MkListOne(MkSpecifier(FLOAT));
5273 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)))
5277 ListAdd(specs, MkSpecifier(UNSIGNED));
5278 ListAdd(specs, MkSpecifier(CHAR));
5280 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)))))
5284 ListAdd(specs, MkSpecifier(UNSIGNED));
5285 ListAdd(specs, MkSpecifier(SHORT));
5287 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5291 ListAdd(specs, MkSpecifier(UNSIGNED));
5292 ListAdd(specs, MkSpecifier(INT));
5294 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5298 ListAdd(specs, MkSpecifier(UNSIGNED));
5299 ListAdd(specs, MkSpecifier(INT64));
5301 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5303 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5313 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5315 *newExp = *sourceExp;
5316 newExp->prev = (((void *)0));
5317 newExp->next = (((void *)0));
5318 if(sourceExp->destType)
5319 sourceExp->destType->refCount++;
5320 if(sourceExp->expType)
5321 sourceExp->expType->refCount++;
5322 sourceExp->type = 11;
5323 if(realDest->kind == 8)
5325 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5326 FreeList(specs, FreeSpecifier);
5329 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5330 if(newExp->type == 4)
5332 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5335 sourceExp->cast.exp = newExp;
5336 FreeType(sourceExp->expType);
5337 sourceExp->expType = (((void *)0));
5338 ProcessExpressionType(sourceExp);
5341 FreeList(specs, FreeSpecifier);
5348 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5349 sourceExp = (*sourceExp->list).last;
5350 if(sourceExp->type == 0)
5352 struct Identifier * id = sourceExp->identifier;
5356 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5358 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5359 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5363 for(; _class && _class->type == 4; _class = _class->base)
5365 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5366 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5368 for(value = e->values.first; value; value = value->next)
5370 if(!strcmp(value->name, id->string))
5375 FreeExpContents(sourceExp);
5376 FreeType(sourceExp->expType);
5377 sourceExp->isConstant = 0x1;
5378 sourceExp->expType = MkClassType(_class->fullName);
5382 sourceExp->type = 2;
5383 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5384 sprintf(constant, "%d", value->data);
5386 sprintf(constant, "0x%X", value->data);
5387 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5395 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5402 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5404 int value2 = op2->i;
5407 exp->string = PrintInt(op1->i + value2);
5410 exp->expType = op1->type;
5412 op1->type->refCount++;
5417 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5419 unsigned int value2 = op2->ui;
5422 exp->string = PrintUInt(op1->ui + value2);
5425 exp->expType = op1->type;
5427 op1->type->refCount++;
5432 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5434 short value2 = op2->s;
5437 exp->string = PrintShort(op1->s + value2);
5440 exp->expType = op1->type;
5442 op1->type->refCount++;
5447 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5449 unsigned short value2 = op2->us;
5452 exp->string = PrintUShort(op1->us + value2);
5455 exp->expType = op1->type;
5457 op1->type->refCount++;
5462 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5464 char value2 = op2->c;
5467 exp->string = PrintChar(op1->c + value2);
5470 exp->expType = op1->type;
5472 op1->type->refCount++;
5477 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5479 unsigned char value2 = op2->uc;
5482 exp->string = PrintUChar(op1->uc + value2);
5485 exp->expType = op1->type;
5487 op1->type->refCount++;
5492 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5494 float value2 = op2->f;
5497 exp->string = PrintFloat(op1->f + value2);
5500 exp->expType = op1->type;
5502 op1->type->refCount++;
5507 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5509 double value2 = op2->d;
5512 exp->string = PrintDouble(op1->d + value2);
5515 exp->expType = op1->type;
5517 op1->type->refCount++;
5522 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5524 int value2 = op2->i;
5527 exp->string = PrintInt(op1->i - value2);
5530 exp->expType = op1->type;
5532 op1->type->refCount++;
5537 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5539 unsigned int value2 = op2->ui;
5542 exp->string = PrintUInt(op1->ui - value2);
5545 exp->expType = op1->type;
5547 op1->type->refCount++;
5552 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5554 short value2 = op2->s;
5557 exp->string = PrintShort(op1->s - value2);
5560 exp->expType = op1->type;
5562 op1->type->refCount++;
5567 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5569 unsigned short value2 = op2->us;
5572 exp->string = PrintUShort(op1->us - value2);
5575 exp->expType = op1->type;
5577 op1->type->refCount++;
5582 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5584 char value2 = op2->c;
5587 exp->string = PrintChar(op1->c - value2);
5590 exp->expType = op1->type;
5592 op1->type->refCount++;
5597 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5599 unsigned char value2 = op2->uc;
5602 exp->string = PrintUChar(op1->uc - value2);
5605 exp->expType = op1->type;
5607 op1->type->refCount++;
5612 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5614 float value2 = op2->f;
5617 exp->string = PrintFloat(op1->f - value2);
5620 exp->expType = op1->type;
5622 op1->type->refCount++;
5627 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5629 double value2 = op2->d;
5632 exp->string = PrintDouble(op1->d - value2);
5635 exp->expType = op1->type;
5637 op1->type->refCount++;
5642 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5644 int value2 = op2->i;
5647 exp->string = PrintInt(op1->i * value2);
5650 exp->expType = op1->type;
5652 op1->type->refCount++;
5657 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5659 unsigned int value2 = op2->ui;
5662 exp->string = PrintUInt(op1->ui * value2);
5665 exp->expType = op1->type;
5667 op1->type->refCount++;
5672 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5674 short value2 = op2->s;
5677 exp->string = PrintShort(op1->s * value2);
5680 exp->expType = op1->type;
5682 op1->type->refCount++;
5687 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5689 unsigned short value2 = op2->us;
5692 exp->string = PrintUShort(op1->us * value2);
5695 exp->expType = op1->type;
5697 op1->type->refCount++;
5702 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5704 char value2 = op2->c;
5707 exp->string = PrintChar(op1->c * value2);
5710 exp->expType = op1->type;
5712 op1->type->refCount++;
5717 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5719 unsigned char value2 = op2->uc;
5722 exp->string = PrintUChar(op1->uc * value2);
5725 exp->expType = op1->type;
5727 op1->type->refCount++;
5732 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5734 float value2 = op2->f;
5737 exp->string = PrintFloat(op1->f * value2);
5740 exp->expType = op1->type;
5742 op1->type->refCount++;
5747 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5749 double value2 = op2->d;
5752 exp->string = PrintDouble(op1->d * value2);
5755 exp->expType = op1->type;
5757 op1->type->refCount++;
5762 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5764 int value2 = op2->i;
5767 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5770 exp->expType = op1->type;
5772 op1->type->refCount++;
5777 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5779 unsigned int value2 = op2->ui;
5782 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5785 exp->expType = op1->type;
5787 op1->type->refCount++;
5792 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5794 short value2 = op2->s;
5797 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5800 exp->expType = op1->type;
5802 op1->type->refCount++;
5807 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5809 unsigned short value2 = op2->us;
5812 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5815 exp->expType = op1->type;
5817 op1->type->refCount++;
5822 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5824 char value2 = op2->c;
5827 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5830 exp->expType = op1->type;
5832 op1->type->refCount++;
5837 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5839 unsigned char value2 = op2->uc;
5842 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5845 exp->expType = op1->type;
5847 op1->type->refCount++;
5852 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5854 float value2 = op2->f;
5857 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5860 exp->expType = op1->type;
5862 op1->type->refCount++;
5867 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5869 double value2 = op2->d;
5872 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5875 exp->expType = op1->type;
5877 op1->type->refCount++;
5882 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5884 int value2 = op2->i;
5887 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5890 exp->expType = op1->type;
5892 op1->type->refCount++;
5897 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5899 unsigned int value2 = op2->ui;
5902 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5905 exp->expType = op1->type;
5907 op1->type->refCount++;
5912 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5914 short value2 = op2->s;
5917 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5920 exp->expType = op1->type;
5922 op1->type->refCount++;
5927 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5929 unsigned short value2 = op2->us;
5932 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5935 exp->expType = op1->type;
5937 op1->type->refCount++;
5942 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5944 char value2 = op2->c;
5947 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5950 exp->expType = op1->type;
5952 op1->type->refCount++;
5957 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5959 unsigned char value2 = op2->uc;
5962 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5965 exp->expType = op1->type;
5967 op1->type->refCount++;
5972 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5975 exp->string = PrintInt(-op1->i);
5978 exp->expType = op1->type;
5980 op1->type->refCount++;
5985 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5988 exp->string = PrintUInt(-op1->ui);
5991 exp->expType = op1->type;
5993 op1->type->refCount++;
5998 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6001 exp->string = PrintShort(-op1->s);
6004 exp->expType = op1->type;
6006 op1->type->refCount++;
6011 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6014 exp->string = PrintUShort(-op1->us);
6017 exp->expType = op1->type;
6019 op1->type->refCount++;
6024 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6027 exp->string = PrintChar(-op1->c);
6030 exp->expType = op1->type;
6032 op1->type->refCount++;
6037 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6040 exp->string = PrintUChar(-op1->uc);
6043 exp->expType = op1->type;
6045 op1->type->refCount++;
6050 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6053 exp->string = PrintFloat(-op1->f);
6056 exp->expType = op1->type;
6058 op1->type->refCount++;
6063 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6066 exp->string = PrintDouble(-op1->d);
6069 exp->expType = op1->type;
6071 op1->type->refCount++;
6076 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6079 exp->string = PrintInt(++op1->i);
6082 exp->expType = op1->type;
6084 op1->type->refCount++;
6089 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6092 exp->string = PrintUInt(++op1->ui);
6095 exp->expType = op1->type;
6097 op1->type->refCount++;
6102 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6105 exp->string = PrintShort(++op1->s);
6108 exp->expType = op1->type;
6110 op1->type->refCount++;
6115 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6118 exp->string = PrintUShort(++op1->us);
6121 exp->expType = op1->type;
6123 op1->type->refCount++;
6128 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6131 exp->string = PrintChar(++op1->c);
6134 exp->expType = op1->type;
6136 op1->type->refCount++;
6141 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6144 exp->string = PrintUChar(++op1->uc);
6147 exp->expType = op1->type;
6149 op1->type->refCount++;
6154 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6157 exp->string = PrintFloat(++op1->f);
6160 exp->expType = op1->type;
6162 op1->type->refCount++;
6167 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6170 exp->string = PrintDouble(++op1->d);
6173 exp->expType = op1->type;
6175 op1->type->refCount++;
6180 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6183 exp->string = PrintInt(--op1->i);
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6196 exp->string = PrintUInt(--op1->ui);
6199 exp->expType = op1->type;
6201 op1->type->refCount++;
6206 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6209 exp->string = PrintShort(--op1->s);
6212 exp->expType = op1->type;
6214 op1->type->refCount++;
6219 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6222 exp->string = PrintUShort(--op1->us);
6225 exp->expType = op1->type;
6227 op1->type->refCount++;
6232 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6235 exp->string = PrintChar(--op1->c);
6238 exp->expType = op1->type;
6240 op1->type->refCount++;
6245 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6248 exp->string = PrintUChar(--op1->uc);
6251 exp->expType = op1->type;
6253 op1->type->refCount++;
6258 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6261 exp->string = PrintFloat(--op1->f);
6264 exp->expType = op1->type;
6266 op1->type->refCount++;
6271 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6274 exp->string = PrintDouble(--op1->d);
6277 exp->expType = op1->type;
6279 op1->type->refCount++;
6284 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 int value2 = op2->i;
6289 exp->string = PrintInt(op1->i = value2);
6292 exp->expType = op1->type;
6294 op1->type->refCount++;
6299 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 unsigned int value2 = op2->ui;
6304 exp->string = PrintUInt(op1->ui = value2);
6307 exp->expType = op1->type;
6309 op1->type->refCount++;
6314 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 short value2 = op2->s;
6319 exp->string = PrintShort(op1->s = value2);
6322 exp->expType = op1->type;
6324 op1->type->refCount++;
6329 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 unsigned short value2 = op2->us;
6334 exp->string = PrintUShort(op1->us = value2);
6337 exp->expType = op1->type;
6339 op1->type->refCount++;
6344 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 char value2 = op2->c;
6349 exp->string = PrintChar(op1->c = value2);
6352 exp->expType = op1->type;
6354 op1->type->refCount++;
6359 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6361 unsigned char value2 = op2->uc;
6364 exp->string = PrintUChar(op1->uc = value2);
6367 exp->expType = op1->type;
6369 op1->type->refCount++;
6374 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6376 float value2 = op2->f;
6379 exp->string = PrintFloat(op1->f = value2);
6382 exp->expType = op1->type;
6384 op1->type->refCount++;
6389 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6391 double value2 = op2->d;
6394 exp->string = PrintDouble(op1->d = value2);
6397 exp->expType = op1->type;
6399 op1->type->refCount++;
6404 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6406 int value2 = op2->i;
6409 exp->string = PrintInt(op1->i += value2);
6412 exp->expType = op1->type;
6414 op1->type->refCount++;
6419 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6421 unsigned int value2 = op2->ui;
6424 exp->string = PrintUInt(op1->ui += value2);
6427 exp->expType = op1->type;
6429 op1->type->refCount++;
6434 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6436 short value2 = op2->s;
6439 exp->string = PrintShort(op1->s += value2);
6442 exp->expType = op1->type;
6444 op1->type->refCount++;
6449 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6451 unsigned short value2 = op2->us;
6454 exp->string = PrintUShort(op1->us += value2);
6457 exp->expType = op1->type;
6459 op1->type->refCount++;
6464 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6466 char value2 = op2->c;
6469 exp->string = PrintChar(op1->c += value2);
6472 exp->expType = op1->type;
6474 op1->type->refCount++;
6479 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6481 unsigned char value2 = op2->uc;
6484 exp->string = PrintUChar(op1->uc += value2);
6487 exp->expType = op1->type;
6489 op1->type->refCount++;
6494 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6496 float value2 = op2->f;
6499 exp->string = PrintFloat(op1->f += value2);
6502 exp->expType = op1->type;
6504 op1->type->refCount++;
6509 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6511 double value2 = op2->d;
6514 exp->string = PrintDouble(op1->d += value2);
6517 exp->expType = op1->type;
6519 op1->type->refCount++;
6524 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6526 int value2 = op2->i;
6529 exp->string = PrintInt(op1->i -= value2);
6532 exp->expType = op1->type;
6534 op1->type->refCount++;
6539 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6541 unsigned int value2 = op2->ui;
6544 exp->string = PrintUInt(op1->ui -= value2);
6547 exp->expType = op1->type;
6549 op1->type->refCount++;
6554 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6556 short value2 = op2->s;
6559 exp->string = PrintShort(op1->s -= value2);
6562 exp->expType = op1->type;
6564 op1->type->refCount++;
6569 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6571 unsigned short value2 = op2->us;
6574 exp->string = PrintUShort(op1->us -= value2);
6577 exp->expType = op1->type;
6579 op1->type->refCount++;
6584 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6586 char value2 = op2->c;
6589 exp->string = PrintChar(op1->c -= value2);
6592 exp->expType = op1->type;
6594 op1->type->refCount++;
6599 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6601 unsigned char value2 = op2->uc;
6604 exp->string = PrintUChar(op1->uc -= value2);
6607 exp->expType = op1->type;
6609 op1->type->refCount++;
6614 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6616 float value2 = op2->f;
6619 exp->string = PrintFloat(op1->f -= value2);
6622 exp->expType = op1->type;
6624 op1->type->refCount++;
6629 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6631 double value2 = op2->d;
6634 exp->string = PrintDouble(op1->d -= value2);
6637 exp->expType = op1->type;
6639 op1->type->refCount++;
6644 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6646 int value2 = op2->i;
6649 exp->string = PrintInt(op1->i *= value2);
6652 exp->expType = op1->type;
6654 op1->type->refCount++;
6659 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6661 unsigned int value2 = op2->ui;
6664 exp->string = PrintUInt(op1->ui *= value2);
6667 exp->expType = op1->type;
6669 op1->type->refCount++;
6674 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6676 short value2 = op2->s;
6679 exp->string = PrintShort(op1->s *= value2);
6682 exp->expType = op1->type;
6684 op1->type->refCount++;
6689 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6691 unsigned short value2 = op2->us;
6694 exp->string = PrintUShort(op1->us *= value2);
6697 exp->expType = op1->type;
6699 op1->type->refCount++;
6704 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6706 char value2 = op2->c;
6709 exp->string = PrintChar(op1->c *= value2);
6712 exp->expType = op1->type;
6714 op1->type->refCount++;
6719 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6721 unsigned char value2 = op2->uc;
6724 exp->string = PrintUChar(op1->uc *= value2);
6727 exp->expType = op1->type;
6729 op1->type->refCount++;
6734 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6736 float value2 = op2->f;
6739 exp->string = PrintFloat(op1->f *= value2);
6742 exp->expType = op1->type;
6744 op1->type->refCount++;
6749 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 double value2 = op2->d;
6754 exp->string = PrintDouble(op1->d *= value2);
6757 exp->expType = op1->type;
6759 op1->type->refCount++;
6764 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 int value2 = op2->i;
6769 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6772 exp->expType = op1->type;
6774 op1->type->refCount++;
6779 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 unsigned int value2 = op2->ui;
6784 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6787 exp->expType = op1->type;
6789 op1->type->refCount++;
6794 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 short value2 = op2->s;
6799 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6802 exp->expType = op1->type;
6804 op1->type->refCount++;
6809 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 unsigned short value2 = op2->us;
6814 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6817 exp->expType = op1->type;
6819 op1->type->refCount++;
6824 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 char value2 = op2->c;
6829 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6832 exp->expType = op1->type;
6834 op1->type->refCount++;
6839 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 unsigned char value2 = op2->uc;
6844 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6847 exp->expType = op1->type;
6849 op1->type->refCount++;
6854 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 float value2 = op2->f;
6859 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6862 exp->expType = op1->type;
6864 op1->type->refCount++;
6869 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 double value2 = op2->d;
6874 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6877 exp->expType = op1->type;
6879 op1->type->refCount++;
6884 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 int value2 = op2->i;
6889 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6892 exp->expType = op1->type;
6894 op1->type->refCount++;
6899 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 unsigned int value2 = op2->ui;
6904 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6907 exp->expType = op1->type;
6909 op1->type->refCount++;
6914 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 short value2 = op2->s;
6919 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6922 exp->expType = op1->type;
6924 op1->type->refCount++;
6929 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 unsigned short value2 = op2->us;
6934 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6937 exp->expType = op1->type;
6939 op1->type->refCount++;
6944 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 char value2 = op2->c;
6949 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6952 exp->expType = op1->type;
6954 op1->type->refCount++;
6959 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 unsigned char value2 = op2->uc;
6964 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6967 exp->expType = op1->type;
6969 op1->type->refCount++;
6974 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 int value2 = op2->i;
6979 exp->string = PrintInt(op1->i & value2);
6982 exp->expType = op1->type;
6984 op1->type->refCount++;
6989 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 unsigned int value2 = op2->ui;
6994 exp->string = PrintUInt(op1->ui & value2);
6997 exp->expType = op1->type;
6999 op1->type->refCount++;
7004 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 short value2 = op2->s;
7009 exp->string = PrintShort(op1->s & value2);
7012 exp->expType = op1->type;
7014 op1->type->refCount++;
7019 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 unsigned short value2 = op2->us;
7024 exp->string = PrintUShort(op1->us & value2);
7027 exp->expType = op1->type;
7029 op1->type->refCount++;
7034 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 char value2 = op2->c;
7039 exp->string = PrintChar(op1->c & value2);
7042 exp->expType = op1->type;
7044 op1->type->refCount++;
7049 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 unsigned char value2 = op2->uc;
7054 exp->string = PrintUChar(op1->uc & value2);
7057 exp->expType = op1->type;
7059 op1->type->refCount++;
7064 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 int value2 = op2->i;
7069 exp->string = PrintInt(op1->i | value2);
7072 exp->expType = op1->type;
7074 op1->type->refCount++;
7079 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 unsigned int value2 = op2->ui;
7084 exp->string = PrintUInt(op1->ui | value2);
7087 exp->expType = op1->type;
7089 op1->type->refCount++;
7094 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 short value2 = op2->s;
7099 exp->string = PrintShort(op1->s | value2);
7102 exp->expType = op1->type;
7104 op1->type->refCount++;
7109 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 unsigned short value2 = op2->us;
7114 exp->string = PrintUShort(op1->us | value2);
7117 exp->expType = op1->type;
7119 op1->type->refCount++;
7124 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 char value2 = op2->c;
7129 exp->string = PrintChar(op1->c | value2);
7132 exp->expType = op1->type;
7134 op1->type->refCount++;
7139 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 unsigned char value2 = op2->uc;
7144 exp->string = PrintUChar(op1->uc | value2);
7147 exp->expType = op1->type;
7149 op1->type->refCount++;
7154 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 int value2 = op2->i;
7159 exp->string = PrintInt(op1->i ^ value2);
7162 exp->expType = op1->type;
7164 op1->type->refCount++;
7169 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 unsigned int value2 = op2->ui;
7174 exp->string = PrintUInt(op1->ui ^ value2);
7177 exp->expType = op1->type;
7179 op1->type->refCount++;
7184 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 short value2 = op2->s;
7189 exp->string = PrintShort(op1->s ^ value2);
7192 exp->expType = op1->type;
7194 op1->type->refCount++;
7199 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 unsigned short value2 = op2->us;
7204 exp->string = PrintUShort(op1->us ^ value2);
7207 exp->expType = op1->type;
7209 op1->type->refCount++;
7214 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 char value2 = op2->c;
7219 exp->string = PrintChar(op1->c ^ value2);
7222 exp->expType = op1->type;
7224 op1->type->refCount++;
7229 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 unsigned char value2 = op2->uc;
7234 exp->string = PrintUChar(op1->uc ^ value2);
7237 exp->expType = op1->type;
7239 op1->type->refCount++;
7244 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 int value2 = op2->i;
7249 exp->string = PrintInt(op1->i << value2);
7252 exp->expType = op1->type;
7254 op1->type->refCount++;
7259 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 unsigned int value2 = op2->ui;
7264 exp->string = PrintUInt(op1->ui << value2);
7267 exp->expType = op1->type;
7269 op1->type->refCount++;
7274 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 short value2 = op2->s;
7279 exp->string = PrintShort(op1->s << value2);
7282 exp->expType = op1->type;
7284 op1->type->refCount++;
7289 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 unsigned short value2 = op2->us;
7294 exp->string = PrintUShort(op1->us << value2);
7297 exp->expType = op1->type;
7299 op1->type->refCount++;
7304 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 char value2 = op2->c;
7309 exp->string = PrintChar(op1->c << value2);
7312 exp->expType = op1->type;
7314 op1->type->refCount++;
7319 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 unsigned char value2 = op2->uc;
7324 exp->string = PrintUChar(op1->uc << value2);
7327 exp->expType = op1->type;
7329 op1->type->refCount++;
7334 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7336 int value2 = op2->i;
7339 exp->string = PrintInt(op1->i >> value2);
7342 exp->expType = op1->type;
7344 op1->type->refCount++;
7349 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7351 unsigned int value2 = op2->ui;
7354 exp->string = PrintUInt(op1->ui >> value2);
7357 exp->expType = op1->type;
7359 op1->type->refCount++;
7364 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7366 short value2 = op2->s;
7369 exp->string = PrintShort(op1->s >> value2);
7372 exp->expType = op1->type;
7374 op1->type->refCount++;
7379 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7381 unsigned short value2 = op2->us;
7384 exp->string = PrintUShort(op1->us >> value2);
7387 exp->expType = op1->type;
7389 op1->type->refCount++;
7394 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7396 char value2 = op2->c;
7399 exp->string = PrintChar(op1->c >> value2);
7402 exp->expType = op1->type;
7404 op1->type->refCount++;
7409 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7411 unsigned char value2 = op2->uc;
7414 exp->string = PrintUChar(op1->uc >> value2);
7417 exp->expType = op1->type;
7419 op1->type->refCount++;
7424 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7427 exp->string = PrintInt(~op1->i);
7430 exp->expType = op1->type;
7432 op1->type->refCount++;
7437 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7440 exp->string = PrintUInt(~op1->ui);
7443 exp->expType = op1->type;
7445 op1->type->refCount++;
7450 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7453 exp->string = PrintShort(~op1->s);
7456 exp->expType = op1->type;
7458 op1->type->refCount++;
7463 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7466 exp->string = PrintUShort(~op1->us);
7469 exp->expType = op1->type;
7471 op1->type->refCount++;
7476 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7479 exp->string = PrintChar(~op1->c);
7482 exp->expType = op1->type;
7484 op1->type->refCount++;
7489 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7492 exp->string = PrintUChar(~op1->uc);
7495 exp->expType = op1->type;
7497 op1->type->refCount++;
7502 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7504 int value2 = op2->i;
7507 exp->string = PrintInt(op1->i &= value2);
7510 exp->expType = op1->type;
7512 op1->type->refCount++;
7517 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7519 unsigned int value2 = op2->ui;
7522 exp->string = PrintUInt(op1->ui &= value2);
7525 exp->expType = op1->type;
7527 op1->type->refCount++;
7532 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7534 short value2 = op2->s;
7537 exp->string = PrintShort(op1->s &= value2);
7540 exp->expType = op1->type;
7542 op1->type->refCount++;
7547 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7549 unsigned short value2 = op2->us;
7552 exp->string = PrintUShort(op1->us &= value2);
7555 exp->expType = op1->type;
7557 op1->type->refCount++;
7562 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7564 char value2 = op2->c;
7567 exp->string = PrintChar(op1->c &= value2);
7570 exp->expType = op1->type;
7572 op1->type->refCount++;
7577 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7579 unsigned char value2 = op2->uc;
7582 exp->string = PrintUChar(op1->uc &= value2);
7585 exp->expType = op1->type;
7587 op1->type->refCount++;
7592 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7594 int value2 = op2->i;
7597 exp->string = PrintInt(op1->i |= value2);
7600 exp->expType = op1->type;
7602 op1->type->refCount++;
7607 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7609 unsigned int value2 = op2->ui;
7612 exp->string = PrintUInt(op1->ui |= value2);
7615 exp->expType = op1->type;
7617 op1->type->refCount++;
7622 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7624 short value2 = op2->s;
7627 exp->string = PrintShort(op1->s |= value2);
7630 exp->expType = op1->type;
7632 op1->type->refCount++;
7637 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7639 unsigned short value2 = op2->us;
7642 exp->string = PrintUShort(op1->us |= value2);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7654 char value2 = op2->c;
7657 exp->string = PrintChar(op1->c |= value2);
7660 exp->expType = op1->type;
7662 op1->type->refCount++;
7667 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7669 unsigned char value2 = op2->uc;
7672 exp->string = PrintUChar(op1->uc |= value2);
7675 exp->expType = op1->type;
7677 op1->type->refCount++;
7682 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7684 int value2 = op2->i;
7687 exp->string = PrintInt(op1->i ^= value2);
7690 exp->expType = op1->type;
7692 op1->type->refCount++;
7697 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7699 unsigned int value2 = op2->ui;
7702 exp->string = PrintUInt(op1->ui ^= value2);
7705 exp->expType = op1->type;
7707 op1->type->refCount++;
7712 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7714 short value2 = op2->s;
7717 exp->string = PrintShort(op1->s ^= value2);
7720 exp->expType = op1->type;
7722 op1->type->refCount++;
7727 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7729 unsigned short value2 = op2->us;
7732 exp->string = PrintUShort(op1->us ^= value2);
7735 exp->expType = op1->type;
7737 op1->type->refCount++;
7742 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7744 char value2 = op2->c;
7747 exp->string = PrintChar(op1->c ^= value2);
7750 exp->expType = op1->type;
7752 op1->type->refCount++;
7757 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7759 unsigned char value2 = op2->uc;
7762 exp->string = PrintUChar(op1->uc ^= value2);
7765 exp->expType = op1->type;
7767 op1->type->refCount++;
7772 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7774 int value2 = op2->i;
7777 exp->string = PrintInt(op1->i <<= value2);
7780 exp->expType = op1->type;
7782 op1->type->refCount++;
7787 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7789 unsigned int value2 = op2->ui;
7792 exp->string = PrintUInt(op1->ui <<= value2);
7795 exp->expType = op1->type;
7797 op1->type->refCount++;
7802 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7804 short value2 = op2->s;
7807 exp->string = PrintShort(op1->s <<= value2);
7810 exp->expType = op1->type;
7812 op1->type->refCount++;
7817 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7819 unsigned short value2 = op2->us;
7822 exp->string = PrintUShort(op1->us <<= value2);
7825 exp->expType = op1->type;
7827 op1->type->refCount++;
7832 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7834 char value2 = op2->c;
7837 exp->string = PrintChar(op1->c <<= value2);
7840 exp->expType = op1->type;
7842 op1->type->refCount++;
7847 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7849 unsigned char value2 = op2->uc;
7852 exp->string = PrintUChar(op1->uc <<= value2);
7855 exp->expType = op1->type;
7857 op1->type->refCount++;
7862 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7864 int value2 = op2->i;
7867 exp->string = PrintInt(op1->i >>= value2);
7870 exp->expType = op1->type;
7872 op1->type->refCount++;
7877 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7879 unsigned int value2 = op2->ui;
7882 exp->string = PrintUInt(op1->ui >>= value2);
7885 exp->expType = op1->type;
7887 op1->type->refCount++;
7892 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7894 short value2 = op2->s;
7897 exp->string = PrintShort(op1->s >>= value2);
7900 exp->expType = op1->type;
7902 op1->type->refCount++;
7907 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7909 unsigned short value2 = op2->us;
7912 exp->string = PrintUShort(op1->us >>= value2);
7915 exp->expType = op1->type;
7917 op1->type->refCount++;
7922 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7924 char value2 = op2->c;
7927 exp->string = PrintChar(op1->c >>= value2);
7930 exp->expType = op1->type;
7932 op1->type->refCount++;
7937 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7939 unsigned char value2 = op2->uc;
7942 exp->string = PrintUChar(op1->uc >>= value2);
7945 exp->expType = op1->type;
7947 op1->type->refCount++;
7952 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7955 exp->string = PrintInt(!op1->i);
7958 exp->expType = op1->type;
7960 op1->type->refCount++;
7965 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7968 exp->string = PrintUInt(!op1->ui);
7971 exp->expType = op1->type;
7973 op1->type->refCount++;
7978 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7981 exp->string = PrintShort(!op1->s);
7984 exp->expType = op1->type;
7986 op1->type->refCount++;
7991 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7994 exp->string = PrintUShort(!op1->us);
7997 exp->expType = op1->type;
7999 op1->type->refCount++;
8004 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8007 exp->string = PrintChar(!op1->c);
8010 exp->expType = op1->type;
8012 op1->type->refCount++;
8017 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8020 exp->string = PrintUChar(!op1->uc);
8023 exp->expType = op1->type;
8025 op1->type->refCount++;
8030 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 int value2 = op2->i;
8035 exp->string = PrintInt(op1->i == value2);
8038 exp->expType = op1->type;
8040 op1->type->refCount++;
8045 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 unsigned int value2 = op2->ui;
8050 exp->string = PrintUInt(op1->ui == value2);
8053 exp->expType = op1->type;
8055 op1->type->refCount++;
8060 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 short value2 = op2->s;
8065 exp->string = PrintShort(op1->s == value2);
8068 exp->expType = op1->type;
8070 op1->type->refCount++;
8075 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 unsigned short value2 = op2->us;
8080 exp->string = PrintUShort(op1->us == value2);
8083 exp->expType = op1->type;
8085 op1->type->refCount++;
8090 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 char value2 = op2->c;
8095 exp->string = PrintChar(op1->c == value2);
8098 exp->expType = op1->type;
8100 op1->type->refCount++;
8105 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 unsigned char value2 = op2->uc;
8110 exp->string = PrintUChar(op1->uc == value2);
8113 exp->expType = op1->type;
8115 op1->type->refCount++;
8120 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 float value2 = op2->f;
8125 exp->string = PrintFloat(op1->f == value2);
8128 exp->expType = op1->type;
8130 op1->type->refCount++;
8135 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 double value2 = op2->d;
8140 exp->string = PrintDouble(op1->d == value2);
8143 exp->expType = op1->type;
8145 op1->type->refCount++;
8150 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 int value2 = op2->i;
8155 exp->string = PrintInt(op1->i != value2);
8158 exp->expType = op1->type;
8160 op1->type->refCount++;
8165 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 unsigned int value2 = op2->ui;
8170 exp->string = PrintUInt(op1->ui != value2);
8173 exp->expType = op1->type;
8175 op1->type->refCount++;
8180 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8182 short value2 = op2->s;
8185 exp->string = PrintShort(op1->s != value2);
8188 exp->expType = op1->type;
8190 op1->type->refCount++;
8195 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8197 unsigned short value2 = op2->us;
8200 exp->string = PrintUShort(op1->us != value2);
8203 exp->expType = op1->type;
8205 op1->type->refCount++;
8210 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8212 char value2 = op2->c;
8215 exp->string = PrintChar(op1->c != value2);
8218 exp->expType = op1->type;
8220 op1->type->refCount++;
8225 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8227 unsigned char value2 = op2->uc;
8230 exp->string = PrintUChar(op1->uc != value2);
8233 exp->expType = op1->type;
8235 op1->type->refCount++;
8240 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8242 float value2 = op2->f;
8245 exp->string = PrintFloat(op1->f != value2);
8248 exp->expType = op1->type;
8250 op1->type->refCount++;
8255 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8257 double value2 = op2->d;
8260 exp->string = PrintDouble(op1->d != value2);
8263 exp->expType = op1->type;
8265 op1->type->refCount++;
8270 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8272 int value2 = op2->i;
8275 exp->string = PrintInt(op1->i && value2);
8278 exp->expType = op1->type;
8280 op1->type->refCount++;
8285 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8287 unsigned int value2 = op2->ui;
8290 exp->string = PrintUInt(op1->ui && value2);
8293 exp->expType = op1->type;
8295 op1->type->refCount++;
8300 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8302 short value2 = op2->s;
8305 exp->string = PrintShort(op1->s && value2);
8308 exp->expType = op1->type;
8310 op1->type->refCount++;
8315 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8317 unsigned short value2 = op2->us;
8320 exp->string = PrintUShort(op1->us && value2);
8323 exp->expType = op1->type;
8325 op1->type->refCount++;
8330 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8332 char value2 = op2->c;
8335 exp->string = PrintChar(op1->c && value2);
8338 exp->expType = op1->type;
8340 op1->type->refCount++;
8345 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8347 unsigned char value2 = op2->uc;
8350 exp->string = PrintUChar(op1->uc && value2);
8353 exp->expType = op1->type;
8355 op1->type->refCount++;
8360 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8362 float value2 = op2->f;
8365 exp->string = PrintFloat(op1->f && value2);
8368 exp->expType = op1->type;
8370 op1->type->refCount++;
8375 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8377 double value2 = op2->d;
8380 exp->string = PrintDouble(op1->d && value2);
8383 exp->expType = op1->type;
8385 op1->type->refCount++;
8390 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8392 int value2 = op2->i;
8395 exp->string = PrintInt(op1->i || value2);
8398 exp->expType = op1->type;
8400 op1->type->refCount++;
8405 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8407 unsigned int value2 = op2->ui;
8410 exp->string = PrintUInt(op1->ui || value2);
8413 exp->expType = op1->type;
8415 op1->type->refCount++;
8420 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8422 short value2 = op2->s;
8425 exp->string = PrintShort(op1->s || value2);
8428 exp->expType = op1->type;
8430 op1->type->refCount++;
8435 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8437 unsigned short value2 = op2->us;
8440 exp->string = PrintUShort(op1->us || value2);
8443 exp->expType = op1->type;
8445 op1->type->refCount++;
8450 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8452 char value2 = op2->c;
8455 exp->string = PrintChar(op1->c || value2);
8458 exp->expType = op1->type;
8460 op1->type->refCount++;
8465 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8467 unsigned char value2 = op2->uc;
8470 exp->string = PrintUChar(op1->uc || value2);
8473 exp->expType = op1->type;
8475 op1->type->refCount++;
8480 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8482 float value2 = op2->f;
8485 exp->string = PrintFloat(op1->f || value2);
8488 exp->expType = op1->type;
8490 op1->type->refCount++;
8495 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8497 double value2 = op2->d;
8500 exp->string = PrintDouble(op1->d || value2);
8503 exp->expType = op1->type;
8505 op1->type->refCount++;
8510 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8512 int value2 = op2->i;
8515 exp->string = PrintInt(op1->i > value2);
8518 exp->expType = op1->type;
8520 op1->type->refCount++;
8525 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8527 unsigned int value2 = op2->ui;
8530 exp->string = PrintUInt(op1->ui > value2);
8533 exp->expType = op1->type;
8535 op1->type->refCount++;
8540 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8542 short value2 = op2->s;
8545 exp->string = PrintShort(op1->s > value2);
8548 exp->expType = op1->type;
8550 op1->type->refCount++;
8555 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8557 unsigned short value2 = op2->us;
8560 exp->string = PrintUShort(op1->us > value2);
8563 exp->expType = op1->type;
8565 op1->type->refCount++;
8570 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8572 char value2 = op2->c;
8575 exp->string = PrintChar(op1->c > value2);
8578 exp->expType = op1->type;
8580 op1->type->refCount++;
8585 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8587 unsigned char value2 = op2->uc;
8590 exp->string = PrintUChar(op1->uc > value2);
8593 exp->expType = op1->type;
8595 op1->type->refCount++;
8600 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8602 float value2 = op2->f;
8605 exp->string = PrintFloat(op1->f > value2);
8608 exp->expType = op1->type;
8610 op1->type->refCount++;
8615 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8617 double value2 = op2->d;
8620 exp->string = PrintDouble(op1->d > value2);
8623 exp->expType = op1->type;
8625 op1->type->refCount++;
8630 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8632 int value2 = op2->i;
8635 exp->string = PrintInt(op1->i < value2);
8638 exp->expType = op1->type;
8640 op1->type->refCount++;
8645 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8647 unsigned int value2 = op2->ui;
8650 exp->string = PrintUInt(op1->ui < value2);
8653 exp->expType = op1->type;
8655 op1->type->refCount++;
8660 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8662 short value2 = op2->s;
8665 exp->string = PrintShort(op1->s < value2);
8668 exp->expType = op1->type;
8670 op1->type->refCount++;
8675 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8677 unsigned short value2 = op2->us;
8680 exp->string = PrintUShort(op1->us < value2);
8683 exp->expType = op1->type;
8685 op1->type->refCount++;
8690 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8692 char value2 = op2->c;
8695 exp->string = PrintChar(op1->c < value2);
8698 exp->expType = op1->type;
8700 op1->type->refCount++;
8705 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8707 unsigned char value2 = op2->uc;
8710 exp->string = PrintUChar(op1->uc < value2);
8713 exp->expType = op1->type;
8715 op1->type->refCount++;
8720 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8722 float value2 = op2->f;
8725 exp->string = PrintFloat(op1->f < value2);
8728 exp->expType = op1->type;
8730 op1->type->refCount++;
8735 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8737 double value2 = op2->d;
8740 exp->string = PrintDouble(op1->d < value2);
8743 exp->expType = op1->type;
8745 op1->type->refCount++;
8750 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8752 int value2 = op2->i;
8755 exp->string = PrintInt(op1->i >= value2);
8758 exp->expType = op1->type;
8760 op1->type->refCount++;
8765 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8767 unsigned int value2 = op2->ui;
8770 exp->string = PrintUInt(op1->ui >= value2);
8773 exp->expType = op1->type;
8775 op1->type->refCount++;
8780 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8782 short value2 = op2->s;
8785 exp->string = PrintShort(op1->s >= value2);
8788 exp->expType = op1->type;
8790 op1->type->refCount++;
8795 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8797 unsigned short value2 = op2->us;
8800 exp->string = PrintUShort(op1->us >= value2);
8803 exp->expType = op1->type;
8805 op1->type->refCount++;
8810 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8812 char value2 = op2->c;
8815 exp->string = PrintChar(op1->c >= value2);
8818 exp->expType = op1->type;
8820 op1->type->refCount++;
8825 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8827 unsigned char value2 = op2->uc;
8830 exp->string = PrintUChar(op1->uc >= value2);
8833 exp->expType = op1->type;
8835 op1->type->refCount++;
8840 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8842 float value2 = op2->f;
8845 exp->string = PrintFloat(op1->f >= value2);
8848 exp->expType = op1->type;
8850 op1->type->refCount++;
8855 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8857 double value2 = op2->d;
8860 exp->string = PrintDouble(op1->d >= value2);
8863 exp->expType = op1->type;
8865 op1->type->refCount++;
8870 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8872 int value2 = op2->i;
8875 exp->string = PrintInt(op1->i <= value2);
8878 exp->expType = op1->type;
8880 op1->type->refCount++;
8885 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8887 unsigned int value2 = op2->ui;
8890 exp->string = PrintUInt(op1->ui <= value2);
8893 exp->expType = op1->type;
8895 op1->type->refCount++;
8900 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8902 short value2 = op2->s;
8905 exp->string = PrintShort(op1->s <= value2);
8908 exp->expType = op1->type;
8910 op1->type->refCount++;
8915 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8917 unsigned short value2 = op2->us;
8920 exp->string = PrintUShort(op1->us <= value2);
8923 exp->expType = op1->type;
8925 op1->type->refCount++;
8930 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8932 char value2 = op2->c;
8935 exp->string = PrintChar(op1->c <= value2);
8938 exp->expType = op1->type;
8940 op1->type->refCount++;
8945 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8947 unsigned char value2 = op2->uc;
8950 exp->string = PrintUChar(op1->uc <= value2);
8953 exp->expType = op1->type;
8955 op1->type->refCount++;
8960 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8962 float value2 = op2->f;
8965 exp->string = PrintFloat(op1->f <= value2);
8968 exp->expType = op1->type;
8970 op1->type->refCount++;
8975 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8977 double value2 = op2->d;
8980 exp->string = PrintDouble(op1->d <= value2);
8983 exp->expType = op1->type;
8985 op1->type->refCount++;
8990 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8993 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8996 exp->expType = op1->type;
8998 op1->type->refCount++;
9003 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9006 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9009 exp->expType = op1->type;
9011 op1->type->refCount++;
9016 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9019 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9022 exp->expType = op1->type;
9024 op1->type->refCount++;
9029 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9032 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9045 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9048 exp->expType = op1->type;
9050 op1->type->refCount++;
9055 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9058 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9061 exp->expType = op1->type;
9063 op1->type->refCount++;
9068 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9071 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9074 exp->expType = op1->type;
9076 op1->type->refCount++;
9081 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9084 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9087 exp->expType = op1->type;
9089 op1->type->refCount++;
9094 struct OpTable intOps =
9096 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
9099 struct OpTable uintOps =
9101 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
9104 struct OpTable shortOps =
9106 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
9109 struct OpTable ushortOps =
9111 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
9114 struct OpTable floatOps =
9116 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
9119 struct OpTable doubleOps =
9121 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
9124 struct OpTable charOps =
9126 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
9129 struct OpTable ucharOps =
9131 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
9134 void ReadString(char * output, char * string)
9136 int len = strlen(string);
9138 unsigned int quoted = 0x0, escaped = 0x0;
9140 for(c = 0; c < len; c++)
9142 char ch = string[c];
9198 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9200 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9202 extern double strtod(char * , char * * );
9204 struct Operand GetOperand(struct Expression * exp)
9210 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9213 struct Type * type = exp->expType;
9217 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9219 if(!type->_class->registered->dataType)
9220 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9221 type = type->_class->registered->dataType;
9223 op.kind = type->kind;
9224 op.type = exp->expType;
9225 if(exp->isConstant && exp->type == 2)
9231 if(exp->constant[0] == '\'')
9232 op.c = exp->constant[1];
9233 else if(type->isSigned)
9235 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9240 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9248 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9253 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9261 op.i = strtol(exp->constant, (((void *)0)), 0);
9266 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9274 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9279 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9287 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9292 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9298 op.f = (float)strtod(exp->constant, (((void *)0)));
9302 op.d = (double)strtod(exp->constant, (((void *)0)));
9308 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9318 int __ecereVMethodID_class_OnGetString;
9320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9322 static void UnusedFunction()
9326 ((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);
9329 extern int __ecereVMethodID_class_OnGetString;
9331 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9333 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9335 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9337 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9338 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9341 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9342 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9344 void * ptr = inst->data + dataMember->offset + offset;
9345 char * result = (((void *)0));
9347 exp->loc = member->loc = inst->loc;
9348 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9349 if(!dataMember->dataType)
9350 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9351 type = dataMember->dataType;
9354 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9356 if(_class->type == 4)
9358 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9362 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9363 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9365 for(item = e->values.first; item; item = item->next)
9367 if((int)item->data == *(int *)ptr)
9369 result = item->name;
9375 exp->identifier = MkIdentifier(result);
9377 exp->destType = MkClassType(_class->fullName);
9378 ProcessExpressionType(exp);
9382 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9384 if(!_class->dataType)
9385 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9386 type = _class->dataType;
9395 FreeExpContents(exp);
9396 exp->constant = PrintFloat(*(float *)ptr);
9402 FreeExpContents(exp);
9403 exp->constant = PrintDouble(*(double *)ptr);
9409 FreeExpContents(exp);
9410 exp->constant = PrintInt(*(int *)ptr);
9416 FreeExpContents(exp);
9417 exp->constant = PrintInt64(*(long long *)ptr);
9423 FreeExpContents(exp);
9424 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9432 ListAdd(memberList, member);
9434 if(parentDataMember->type == 1)
9439 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9441 void PopulateInstance(struct Instantiation * inst)
9443 struct Symbol * classSym = inst->_class->symbol;
9444 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9445 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9446 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9448 inst->members = MkListOne(MkMembersInitList(memberList));
9449 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9451 if(!dataMember->isProperty)
9453 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9454 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9457 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9458 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9460 void * ptr = inst->data + dataMember->offset;
9461 char * result = (((void *)0));
9463 exp->loc = member->loc = inst->loc;
9464 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9465 if(!dataMember->dataType)
9466 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9467 type = dataMember->dataType;
9470 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9472 if(_class->type == 4)
9474 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9478 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9479 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9481 for(item = e->values.first; item; item = item->next)
9483 if((int)item->data == *(int *)ptr)
9485 result = item->name;
9492 exp->identifier = MkIdentifier(result);
9494 exp->destType = MkClassType(_class->fullName);
9495 ProcessExpressionType(exp);
9498 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9500 if(!_class->dataType)
9501 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9502 type = _class->dataType;
9511 exp->constant = PrintFloat(*(float *)ptr);
9517 exp->constant = PrintDouble(*(double *)ptr);
9523 exp->constant = PrintInt(*(int *)ptr);
9529 exp->constant = PrintInt64(*(long long *)ptr);
9535 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9540 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9543 ListAdd(memberList, member);
9549 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);
9551 extern void FreeInstance(struct Instantiation * inst);
9553 void ComputeInstantiation(struct Expression * exp)
9555 struct Instantiation * inst = exp->instance;
9556 struct MembersInit * members;
9557 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9558 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9559 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9560 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9561 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9562 int subMemberStackPos = 0;
9565 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9569 if(_class->type == 0 || _class->type == 5)
9570 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9572 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9576 for(members = (*inst->members).first; members; members = members->next)
9578 switch(members->type)
9582 if(members->dataMembers)
9584 struct MemberInit * member;
9586 for(member = (*members->dataMembers).first; member; member = member->next)
9588 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9589 unsigned int found = 0x0;
9590 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9591 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9592 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9593 unsigned int dataMemberOffset;
9597 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9600 if(curMember->isProperty)
9601 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9604 dataMember = curMember;
9605 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9612 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9616 if(prop->memberAccess == 1)
9618 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9619 curClass = prop->_class;
9624 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9625 int _subMemberStackPos = 0;
9627 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9631 if(dataMember->memberAccess == 1)
9633 curMember = dataMember;
9634 curClass = dataMember->_class;
9635 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9636 subMemberStackPos = _subMemberStackPos;
9641 if(found && member->initializer && member->initializer->type == 0)
9643 struct Expression * value = member->initializer->exp;
9644 struct Type * type = (((void *)0));
9648 type = prop->dataType;
9652 if(!dataMember->dataType)
9653 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9654 type = dataMember->dataType;
9656 if(ident && ident->next)
9658 for(ident = ident->next; ident && type; ident = ident->next)
9662 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9664 type = prop->dataType;
9667 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9669 type = dataMember->dataType;
9672 else if(type->kind == 9 || type->kind == 10)
9674 struct Type * memberType;
9676 for(memberType = type->members.first; memberType; memberType = memberType->next)
9678 if(!strcmp(memberType->name, ident->string))
9689 FreeType(value->destType);
9690 value->destType = type;
9693 ComputeExpression(value);
9695 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9699 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9701 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9703 if(!_class->dataType)
9704 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9705 type = _class->dataType;
9710 void * ptr = inst->data + dataMemberOffset;
9712 if(value->type == 2)
9718 GetInt(value, (int *)ptr);
9723 GetInt64(value, (long long *)ptr);
9728 GetIntPtr(value, (intptr_t *)ptr);
9733 GetFloat(value, (float *)ptr);
9738 GetDouble(value, (double *)ptr);
9743 else if(value->type == 1)
9747 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9749 if(_class->type == 1)
9751 ComputeTypeSize(type);
9752 if(value->instance->data)
9753 memcpy(ptr, value->instance->data, type->size);
9760 if(value->type == 1 && value->instance->data)
9762 void (* Set)(void *, void *) = (void *)prop->Set;
9764 Set(inst->data, value->instance->data);
9765 PopulateInstance(inst);
9767 else if(value->type == 2)
9773 void (* Set)(void *, double) = (void *)prop->Set;
9775 Set(inst->data, strtod(value->constant, (((void *)0))));
9780 void (* Set)(void *, float) = (void *)prop->Set;
9782 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9787 void (* Set)(void *, int) = (void *)prop->Set;
9789 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9794 void (* Set)(void *, long long) = (void *)prop->Set;
9796 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9801 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9803 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9808 else if(value->type == 3)
9812 ReadString(temp, value->string);
9813 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
9817 else if(_class->type == 3)
9821 if(value->type == 2)
9825 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9827 if(_class->type == 3)
9829 if(!_class->dataType)
9830 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9831 type = _class->dataType;
9839 float (* Set)(float) = (void *)prop->Set;
9841 GetFloat(member->initializer->exp, &fValue);
9842 exp->constant = PrintFloat(Set(fValue));
9849 double (* Set)(double) = (void *)prop->Set;
9851 GetDouble(member->initializer->exp, &dValue);
9852 exp->constant = PrintDouble(Set(dValue));
9860 else if(_class->type == 2)
9864 if(value->type == 1 && value->instance->data)
9866 unsigned int (* Set)(void *) = (void *)prop->Set;
9868 bits = Set(value->instance->data);
9870 else if(value->type == 2)
9876 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9880 GetInt(value, &part);
9881 bits = (bits & ~bitMember->mask);
9882 if(!bitMember->dataType)
9883 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9884 type = bitMember->dataType;
9885 if(type->kind == 8 && type->_class && type->_class->registered)
9887 if(!type->_class->registered->dataType)
9888 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9889 type = type->_class->registered->dataType;
9895 bits |= ((char)part << bitMember->pos);
9897 bits |= ((unsigned char)part << bitMember->pos);
9901 bits |= ((short)part << bitMember->pos);
9903 bits |= ((unsigned short)part << bitMember->pos);
9908 bits |= (part << bitMember->pos);
9910 bits |= ((unsigned int)part << bitMember->pos);
9914 bits |= ((long long)part << bitMember->pos);
9916 bits |= ((uint64)part << bitMember->pos);
9920 bits |= ((intptr_t)part << bitMember->pos);
9922 bits |= ((uintptr_t)part << bitMember->pos);
9930 if(_class && _class->type == 3)
9932 ComputeExpression(member->initializer->exp);
9933 exp->constant = member->initializer->exp->constant;
9935 member->initializer->exp->constant = (((void *)0));
9945 if(_class && _class->type == 2)
9947 exp->constant = PrintHexUInt(bits);
9956 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9958 if(exp->op.op == SIZEOF)
9960 FreeExpContents(exp);
9962 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9972 struct Expression * exp2 = exp->op.exp2;
9974 exp->op.exp2 = (((void *)0));
9975 FreeExpContents(exp);
9976 FreeType(exp->expType);
9977 FreeType(exp->destType);
9979 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9985 FreeExpContents(exp);
9986 op1->ops.Neg(exp, op1);
9992 FreeExpContents(exp);
9993 op1->ops.BitNot(exp, op1);
9999 FreeExpContents(exp);
10000 op1->ops.Not(exp, op1);
10012 FreeExpContents(exp);
10013 op1->ops.Add(exp, op1, op2);
10019 FreeExpContents(exp);
10020 op1->ops.Sub(exp, op1, op2);
10026 FreeExpContents(exp);
10027 op1->ops.Mul(exp, op1, op2);
10033 FreeExpContents(exp);
10034 op1->ops.Div(exp, op1, op2);
10040 FreeExpContents(exp);
10041 op1->ops.Mod(exp, op1, op2);
10047 if(op1->ops.BitAnd)
10049 FreeExpContents(exp);
10050 op1->ops.BitAnd(exp, op1, op2);
10057 FreeExpContents(exp);
10058 op1->ops.BitOr(exp, op1, op2);
10062 if(op1->ops.BitXor)
10064 FreeExpContents(exp);
10065 op1->ops.BitXor(exp, op1, op2);
10069 if(op1->ops.LShift)
10071 FreeExpContents(exp);
10072 op1->ops.LShift(exp, op1, op2);
10076 if(op1->ops.RShift)
10078 FreeExpContents(exp);
10079 op1->ops.RShift(exp, op1, op2);
10085 FreeExpContents(exp);
10086 op1->ops.Equ(exp, op1, op2);
10092 FreeExpContents(exp);
10093 op1->ops.Nqu(exp, op1, op2);
10099 FreeExpContents(exp);
10100 op1->ops.And(exp, op1, op2);
10106 FreeExpContents(exp);
10107 op1->ops.Or(exp, op1, op2);
10113 FreeExpContents(exp);
10114 op1->ops.Grt(exp, op1, op2);
10120 FreeExpContents(exp);
10121 op1->ops.Sma(exp, op1, op2);
10125 if(op1->ops.GrtEqu)
10127 FreeExpContents(exp);
10128 op1->ops.GrtEqu(exp, op1, op2);
10132 if(op1->ops.SmaEqu)
10134 FreeExpContents(exp);
10135 op1->ops.SmaEqu(exp, op1, op2);
10143 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10145 void ComputeExpression(struct Expression * exp)
10147 char expString[10240];
10149 expString[0] = '\0';
10154 ComputeInstantiation(exp);
10159 struct Expression * exp1, * exp2 = (((void *)0));
10160 struct Operand op1 =
10164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10167 struct Operand op2 =
10171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10176 ComputeExpression(exp->op.exp2);
10179 ComputeExpression(exp->op.exp1);
10180 exp1 = exp->op.exp1;
10181 exp2 = exp->op.exp2;
10182 op1 = GetOperand(exp1);
10184 op1.type->refCount++;
10187 op2 = GetOperand(exp2);
10189 op2.type->refCount++;
10194 exp1 = exp->op.exp2;
10195 op1 = GetOperand(exp1);
10197 op1.type->refCount++;
10199 CallOperator(exp, exp1, exp2, &op1, &op2);
10201 FreeType(op1.type);
10203 FreeType(op2.type);
10209 struct Expression * e, * n;
10211 for(e = (*exp->list).first; e; e = n)
10216 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10218 ComputeExpression(e);
10219 FreeType(exp->expType);
10220 FreeType(exp->destType);
10222 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10223 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10234 struct Expression * memberExp = exp->member.exp;
10235 struct Identifier * memberID = exp->member.member;
10236 struct Type * type;
10238 ComputeExpression(exp->member.exp);
10239 type = exp->member.exp->expType;
10242 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)));
10243 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10244 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10245 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10247 if(type->kind == 19 && exp->member.exp->type == 26)
10248 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10252 struct Symbol * classSym;
10255 PrintType(type, string, 0x0, 0x1);
10256 classSym = FindClass(string);
10257 _class = classSym ? classSym->registered : (((void *)0));
10259 if(exp->member.member)
10261 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10263 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10265 if(!prop && !member && _class && exp->member.member)
10267 struct Symbol * classSym = FindClass(exp->member.member->string);
10269 convertTo = _class;
10270 _class = classSym ? classSym->registered : (((void *)0));
10271 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10277 struct Type * type = prop->dataType;
10279 if(_class->type == 3)
10281 if(type->kind == 8)
10283 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10285 if(_class->type == 3)
10287 if(!_class->dataType)
10288 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10289 type = _class->dataType;
10297 float (* Get)(float) = (void *)prop->Get;
10299 GetFloat(exp->member.exp, &value);
10300 exp->constant = PrintFloat(Get ? Get(value) : value);
10307 double (* Get)(double);
10309 GetDouble(exp->member.exp, &value);
10311 Get = (void *)prop->Set;
10313 Get = (void *)prop->Get;
10314 exp->constant = PrintDouble(Get ? Get(value) : value);
10324 struct Expression * value = exp->member.exp;
10325 struct Type * type;
10327 if(!prop->dataType)
10328 ProcessPropertyType(prop);
10329 type = prop->dataType;
10333 else if(_class->type == 1)
10339 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10341 if(propertyClass->type == 1 && value->type == 1)
10343 void (* Set)(void *, void *) = (void *)prop->Set;
10345 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10346 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10347 exp->instance->_class = MkSpecifierName(_class->fullName);
10348 exp->instance->loc = exp->loc;
10350 Set(exp->instance->data, value->instance->data);
10351 PopulateInstance(exp->instance);
10358 void (* Set)(void *, int) = (void *)prop->Set;
10360 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10361 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10362 exp->instance->_class = MkSpecifierName(_class->fullName);
10363 exp->instance->loc = exp->loc;
10365 GetInt(value, &intValue);
10366 Set(exp->instance->data, intValue);
10367 PopulateInstance(exp->instance);
10372 long long intValue;
10373 void (* Set)(void *, long long) = (void *)prop->Set;
10375 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10376 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10377 exp->instance->_class = MkSpecifierName(_class->fullName);
10378 exp->instance->loc = exp->loc;
10380 GetInt64(value, &intValue);
10381 Set(exp->instance->data, intValue);
10382 PopulateInstance(exp->instance);
10388 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10390 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10391 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10392 exp->instance->_class = MkSpecifierName(_class->fullName);
10393 exp->instance->loc = exp->loc;
10395 GetIntPtr(value, &intValue);
10396 Set(exp->instance->data, intValue);
10397 PopulateInstance(exp->instance);
10402 double doubleValue;
10403 void (* Set)(void *, double) = (void *)prop->Set;
10405 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10406 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10407 exp->instance->_class = MkSpecifierName(_class->fullName);
10408 exp->instance->loc = exp->loc;
10410 GetDouble(value, &doubleValue);
10411 Set(exp->instance->data, doubleValue);
10412 PopulateInstance(exp->instance);
10417 else if(_class->type == 2)
10423 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10425 if(propertyClass->type == 1 && value->instance->data)
10427 unsigned int (* Set)(void *) = (void *)prop->Set;
10428 unsigned int bits = Set(value->instance->data);
10430 exp->constant = PrintHexUInt(bits);
10434 else if(_class->type == 2)
10436 unsigned int value;
10437 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10440 GetUInt(exp->member.exp, &value);
10442 exp->constant = PrintHexUInt(bits);
10451 if(_class->type == 2)
10453 unsigned int value;
10455 GetUInt(exp->member.exp, &value);
10460 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10462 if(_class->type == 1)
10464 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10466 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10467 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10468 exp->instance->_class = MkSpecifierName(_class->fullName);
10469 exp->instance->loc = exp->loc;
10471 Get(value, exp->instance->data);
10472 PopulateInstance(exp->instance);
10474 else if(_class->type == 2)
10476 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10477 uint64 bits = Get(value);
10479 exp->constant = PrintHexUInt64(bits);
10486 else if(_class->type == 1)
10488 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10494 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10496 if(_class->type == 1 && value)
10498 void (* Get)(void *, void *) = (void *)prop->Get;
10500 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10501 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10502 exp->instance->_class = MkSpecifierName(_class->fullName);
10503 exp->instance->loc = exp->loc;
10505 Get(value, exp->instance->data);
10506 PopulateInstance(exp->instance);
10517 exp->isConstant = 0x0;
10526 FreeExpression(memberExp);
10527 FreeIdentifier(memberID);
10533 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10535 FreeExpContents(exp);
10536 exp->constant = PrintUInt(ComputeTypeSize(type));
10543 struct Symbol * classSym = exp->_class->symbol;
10545 if(classSym && classSym->registered)
10547 if(classSym->registered->fixed)
10549 FreeSpecifier(exp->_class);
10550 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10555 char className[1024];
10557 strcpy(className, "__ecereClass_");
10558 FullClassNameCat(className, classSym->string, 0x1);
10559 MangleClassName(className);
10560 FreeExpContents(exp);
10562 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10563 exp->member.member = MkIdentifier("structSize");
10570 struct Type * type;
10571 struct Expression * e = exp;
10573 if(exp->type == 11)
10576 ComputeExpression(exp->cast.exp);
10579 if(e && exp->expType)
10581 type = exp->expType;
10582 if(type->kind == 8)
10584 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10586 if(_class && (_class->type == 3 || _class->type == 2))
10588 if(!_class->dataType)
10589 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10590 type = _class->dataType;
10600 GetChar(e, &value);
10601 FreeExpContents(exp);
10602 exp->constant = PrintChar(value);
10607 unsigned char value;
10609 GetUChar(e, &value);
10610 FreeExpContents(exp);
10611 exp->constant = PrintUChar(value);
10620 GetShort(e, &value);
10621 FreeExpContents(exp);
10622 exp->constant = PrintShort(value);
10627 unsigned short value;
10629 GetUShort(e, &value);
10630 FreeExpContents(exp);
10631 exp->constant = PrintUShort(value);
10641 FreeExpContents(exp);
10642 exp->constant = PrintInt(value);
10647 unsigned int value;
10649 GetUInt(e, &value);
10650 FreeExpContents(exp);
10651 exp->constant = PrintUInt(value);
10660 GetInt64(e, &value);
10661 FreeExpContents(exp);
10662 exp->constant = PrintInt64(value);
10669 GetUInt64(e, &value);
10670 FreeExpContents(exp);
10671 exp->constant = PrintUInt64(value);
10680 GetIntPtr(e, &value);
10681 FreeExpContents(exp);
10682 exp->constant = PrintInt64((long long)value);
10689 GetUIntPtr(e, &value);
10690 FreeExpContents(exp);
10691 exp->constant = PrintUInt64((uint64)value);
10699 GetFloat(e, &value);
10700 FreeExpContents(exp);
10701 exp->constant = PrintFloat(value);
10709 GetDouble(e, &value);
10710 FreeExpContents(exp);
10711 exp->constant = PrintDouble(value);
10721 struct Operand op1 =
10725 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10728 struct Operand op2 =
10732 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10735 struct Operand op3 =
10739 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10744 ComputeExpression((*exp->cond.exp).last);
10745 if(exp->cond.elseExp)
10746 ComputeExpression(exp->cond.elseExp);
10748 ComputeExpression(exp->cond.cond);
10749 op1 = GetOperand(exp->cond.cond);
10751 op1.type->refCount++;
10752 op2 = GetOperand((*exp->cond.exp).last);
10754 op2.type->refCount++;
10755 op3 = GetOperand(exp->cond.elseExp);
10757 op3.type->refCount++;
10760 FreeExpContents(exp);
10761 op1.ops.Cond(exp, &op1, &op2, &op3);
10764 FreeType(op1.type);
10766 FreeType(op2.type);
10768 FreeType(op3.type);
10774 void ApplyAnyObjectLogic(struct Expression * e);
10776 extern void CopyTypeInto(struct Type * type, struct Type * src);
10778 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10780 unsigned int result = 0x1;
10784 struct __ecereNameSpace__ecere__sys__OldList converts =
10788 struct Conversion * convert;
10790 if(destType->kind == 0)
10792 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10796 for(convert = converts.first; convert; convert = convert->next)
10798 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10802 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10803 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10806 newExp->destType = (((void *)0));
10810 exp->addedThis = 0x1;
10811 exp->member.exp = newExp;
10812 FreeType(exp->member.exp->expType);
10813 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10814 exp->member.exp->expType->classObjectType = objectType;
10815 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10816 exp->member.memberType = 1;
10817 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10818 exp->needCast = 0x1;
10820 exp->expType->refCount++;
10821 ApplyAnyObjectLogic(exp->member.exp);
10827 exp->addedThis = 0x1;
10828 exp->member.exp = newExp;
10829 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10831 newExp->byReference = 0x1;
10833 FreeType(exp->member.exp->expType);
10834 exp->member.exp->expType = (((void *)0));
10835 if(convert->convert->dataType)
10837 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10838 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10839 exp->member.exp->expType->refCount = 1;
10840 exp->member.exp->expType->classObjectType = objectType;
10841 ApplyAnyObjectLogic(exp->member.exp);
10843 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10844 exp->member.memberType = 4;
10845 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10846 exp->needCast = 0x1;
10847 if(convert->resultType)
10848 convert->resultType->refCount++;
10854 FreeType(exp->expType);
10857 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10858 exp->needCast = 0x1;
10860 exp->expType->refCount++;
10864 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10865 exp->needCast = 0x1;
10866 if(convert->resultType)
10867 convert->resultType->refCount++;
10871 if(exp->isConstant && inCompiler)
10872 ComputeExpression(exp);
10873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10875 if(!result && exp->expType && converts.count)
10877 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10879 if(!result && exp->expType && exp->destType)
10881 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))
10888 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10890 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10892 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10894 void CheckTemplateTypes(struct Expression * exp)
10896 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10898 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10899 struct Statement * compound;
10900 struct Context * context;
10904 exp->destType->refCount++;
10906 exp->expType->refCount++;
10907 newExp->prev = (((void *)0));
10908 newExp->next = (((void *)0));
10909 switch(exp->expType->kind)
10912 if(exp->destType->classObjectType)
10915 exp->destType->refCount--;
10917 exp->expType->refCount--;
10918 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10922 struct __ecereNameSpace__ecere__sys__OldList * specs;
10923 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10924 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10926 context = PushContext();
10927 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10928 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10929 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10931 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10932 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10933 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10934 exp->compound->compound.context = context;
10935 PopContext(context);
10940 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10941 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10945 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10947 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10948 struct Statement * compound;
10949 struct Context * context;
10953 exp->destType->refCount++;
10955 exp->expType->refCount++;
10956 newExp->prev = (((void *)0));
10957 newExp->next = (((void *)0));
10958 switch(exp->expType->kind)
10961 if(exp->destType->classObjectType)
10964 exp->destType->refCount--;
10966 exp->expType->refCount--;
10967 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10971 struct __ecereNameSpace__ecere__sys__OldList * specs;
10972 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10973 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10975 context = PushContext();
10976 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10977 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10978 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10980 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10981 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10982 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10983 exp->compound->compound.context = context;
10984 PopContext(context);
10989 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10992 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10993 ProcessExpressionType((*exp->list).first);
10999 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11000 newExp->needCast = 0x1;
11001 ProcessExpressionType((*exp->list).first);
11007 if(exp->expType->kind == 20)
11009 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11013 FreeType(exp->destType);
11014 FreeType(exp->expType);
11015 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11019 if(newExp->type == 8 && newExp->member.memberType == 3)
11023 exp->op.exp1 = (((void *)0));
11024 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11028 char typeString[1024];
11029 struct Declarator * decl;
11030 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11032 typeString[0] = '\0';
11033 PrintType(exp->expType, typeString, 0x0, 0x0);
11034 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11036 exp->cast.typeName = MkTypeName(specs, decl);
11037 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11038 exp->cast.exp->needCast = 0x1;
11046 extern int strncmp(const char * , const char * , int n);
11048 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11050 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11052 int nsLen = strlen(nameSpace);
11053 struct Symbol * symbol;
11055 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)))
11057 char * s = symbol->string;
11059 if(!strncmp(s, nameSpace, nsLen))
11064 for(c = strlen(s) - 1; c >= 0; c--)
11067 namePart = s + c + 1;
11068 if(!strcmp(namePart, name))
11076 return (((void *)0));
11079 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11082 char nameSpace[1024];
11084 unsigned int gotColon = 0x0;
11086 nameSpace[0] = '\0';
11087 for(c = strlen(name) - 1; c >= 0; c--)
11093 namePart = name + c + 1;
11094 while(c >= 0 && name[c] == ':')
11098 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11102 memcpy(nameSpace, name, c + 1);
11103 nameSpace[c + 1] = (char)0;
11104 return ScanWithNameSpace(tree, nameSpace, namePart);
11108 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11114 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11118 return ScanWithNameSpace(tree, "", namePart);
11120 return (((void *)0));
11123 static void ProcessDeclaration(struct Declaration * decl);
11125 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11127 struct Context * ctx;
11128 struct Symbol * symbol = (((void *)0));
11130 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11132 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11134 symbol = (((void *)0));
11137 char curName[1024];
11139 strcpy(curName, thisNameSpace);
11140 strcat(curName, "::");
11141 strcat(curName, name);
11142 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11145 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11148 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11149 if(symbol || ctx == endContext)
11152 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11154 if(symbol->pointerExternal->type == 0)
11156 struct FunctionDefinition * function = symbol->pointerExternal->function;
11157 struct Context * tmpContext = curContext;
11159 curContext = (((void *)0));
11160 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11161 curContext = tmpContext;
11162 symbol->pointerExternal->symbol = symbol;
11163 DeclareType(symbol->type, 0x1, 0x1);
11164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11165 symbol->id = curExternal->symbol->idCode;
11167 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11169 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11170 symbol->id = curExternal->symbol->idCode;
11176 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11178 if(!type->isSigned && type->kind != 22)
11179 ListAdd(specs, MkSpecifier(UNSIGNED));
11184 if(type->_class->registered)
11186 if(!type->_class->registered->dataType)
11187 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11188 GetTypeSpecs(type->_class->registered->dataType, specs);
11193 ListAdd(specs, MkSpecifier(DOUBLE));
11196 ListAdd(specs, MkSpecifier(FLOAT));
11199 ListAdd(specs, MkSpecifier(CHAR));
11202 ListAdd(specs, MkSpecifier(SHORT));
11205 ListAdd(specs, MkSpecifier(INT64));
11208 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11212 ListAdd(specs, MkSpecifier(INT));
11217 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11219 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11226 if(type->_class && type->_class->string)
11228 if(type->classObjectType == 2)
11229 strcat(string, "typed_object");
11231 strcat(string, type->_class->string);
11234 if(type->_class->registered)
11235 strcat(string, type->_class->registered->name);
11237 strcat(string, type->_class->string);
11244 _PrintType(type->type, string, 0x0, printFunction, fullName);
11245 strcat(string, " *");
11250 strcat(string, "void");
11253 strcat(string, type->isSigned ? "int" : "uint");
11256 strcat(string, type->isSigned ? "int64" : "uint64");
11259 strcat(string, type->isSigned ? "intptr" : "uintptr");
11262 strcat(string, type->isSigned ? "char" : "byte");
11265 strcat(string, type->isSigned ? "short" : "uint16");
11268 strcat(string, "float");
11271 strcat(string, "double");
11276 strcat(string, "struct ");
11277 strcat(string, type->enumName);
11279 else if(type->typeName)
11281 strcat(string, type->typeName);
11285 struct Type * member;
11287 strcat(string, "struct {");
11288 for(member = type->members.first; member; member = member->next)
11290 PrintType(member, string, 0x1, fullName);
11291 strcat(string, "; ");
11293 strcat(string, "}");
11299 strcat(string, "union ");
11300 strcat(string, type->enumName);
11302 else if(type->typeName)
11304 strcat(string, type->typeName);
11308 strcat(string, "union ");
11309 strcat(string, "(unnamed)");
11315 strcat(string, "enum ");
11316 strcat(string, type->enumName);
11318 else if(type->typeName)
11320 strcat(string, type->typeName);
11323 strcat(string, "enum");
11329 if(type->dllExport)
11330 strcat(string, "dllexport ");
11331 PrintType(type->returnType, string, 0x0, fullName);
11332 strcat(string, " ");
11339 strcat(string, type->name);
11342 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11348 strcat(string, name);
11354 struct Type * param;
11356 strcat(string, "(");
11357 for(param = type->params.first; param; param = param->next)
11359 PrintType(param, string, 0x1, fullName);
11361 strcat(string, ", ");
11363 strcat(string, ")");
11370 char baseType[1024], size[256];
11371 struct Type * arrayType = type;
11373 baseType[0] = '\0';
11375 while(arrayType->kind == 12)
11378 if(arrayType->enumClass)
11379 strcat(size, arrayType->enumClass->string);
11380 else if(arrayType->arraySizeExp)
11381 PrintExpression(arrayType->arraySizeExp, size);
11383 arrayType = arrayType->arrayType;
11385 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11386 strcat(string, baseType);
11387 strcat(string, size);
11393 strcat(string, "...");
11396 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11399 strcat(string, "subclass(");
11400 strcat(string, type->_class ? type->_class->string : "int");
11401 strcat(string, ")");
11404 strcat(string, type->templateParameter->identifier->string);
11407 strcat(string, "thisclass");
11410 strcat(string, "__builtin_va_list");
11413 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11415 strcat(string, " ");
11416 strcat(string, type->name);
11421 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11423 struct Type * funcType;
11425 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11427 if(funcType && funcType->kind == 11 && type != funcType)
11429 char typeString[1024];
11430 struct Type * param;
11432 PrintType(funcType->returnType, string, 0x0, fullName);
11433 strcat(string, "(");
11434 _PrintType(type, string, printName, 0x0, fullName);
11435 strcat(string, ")");
11436 strcat(string, "(");
11437 for(param = funcType->params.first; param; param = param->next)
11439 PrintType(param, string, 0x1, fullName);
11441 strcat(string, ", ");
11443 strcat(string, ")");
11446 _PrintType(type, string, printName, 0x1, fullName);
11447 if(type->bitFieldCount)
11451 sprintf(count, ":%d", type->bitFieldCount);
11452 strcat(string, count);
11456 static struct Type * FindMember(struct Type * type, char * string)
11458 struct Type * memberType;
11460 for(memberType = type->members.first; memberType; memberType = memberType->next)
11462 if(!memberType->name)
11464 struct Type * subType = FindMember(memberType, string);
11469 else if(!strcmp(memberType->name, string))
11472 return (((void *)0));
11475 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11477 struct Type * memberType;
11479 for(memberType = type->members.first; memberType; memberType = memberType->next)
11481 if(!memberType->name)
11483 struct Type * subType = FindMember(memberType, string);
11487 *offset += memberType->offset;
11491 else if(!strcmp(memberType->name, string))
11493 *offset += memberType->offset;
11497 return (((void *)0));
11500 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11502 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11504 struct Expression * ParseExpressionString(char * expression)
11506 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11507 ((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));
11508 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11510 parsedExpression = (((void *)0));
11512 expression_yyparse();
11513 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11514 return parsedExpression;
11517 extern char * QMkString(char * source);
11519 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11521 void * __ecereTemp1;
11522 struct Identifier * id = exp->identifier;
11523 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11524 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11525 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11526 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11528 if(_class && _class->type == 4)
11530 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11531 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11535 struct __ecereNameSpace__ecere__com__Class * baseClass;
11537 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11539 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11541 for(value = e->values.first; value; value = value->next)
11543 if(!strcmp(value->name, id->string))
11548 char constant[256];
11550 FreeExpContents(exp);
11552 exp->isConstant = 0x1;
11553 if(!strcmp(baseClass->dataTypeString, "int"))
11554 sprintf(constant, "%d", value->data);
11556 sprintf(constant, "0x%X", value->data);
11557 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11558 exp->expType = MkClassType(baseClass->fullName);
11566 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11568 ProcessMethodType(method);
11569 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));
11572 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11574 if(!prop->dataType)
11575 ProcessPropertyType(prop);
11576 exp->expType = prop->dataType;
11578 prop->dataType->refCount++;
11581 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11583 if(!member->dataType)
11584 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11585 exp->expType = member->dataType;
11586 if(member->dataType)
11587 member->dataType->refCount++;
11590 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11592 if(!classProp->dataType)
11593 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11594 if(classProp->constant)
11596 FreeExpContents(exp);
11597 exp->isConstant = 0x1;
11598 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11601 exp->constant = QMkString((char *)classProp->Get(_class));
11605 char constant[256];
11608 sprintf(constant, "%d", (int)classProp->Get(_class));
11609 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11615 exp->expType = classProp->dataType;
11616 if(classProp->dataType)
11617 classProp->dataType->refCount++;
11623 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11625 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11626 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11627 struct __ecereNameSpace__ecere__com__NameSpace * child;
11631 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)))
11633 data = ScanGlobalData(child, name);
11641 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11643 extern char * strncpy(char * , const char * , int n);
11645 static struct GlobalData * FindGlobalData(char * name)
11648 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11650 nameSpace = globalData;
11651 for(c = 0; name[c]; c++)
11653 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11655 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11656 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11658 strncpy(spaceName, name + start, c - start);
11659 spaceName[c - start] = '\0';
11660 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11661 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11663 return (((void *)0));
11664 nameSpace = newSpace;
11672 return ScanGlobalData(nameSpace, name + start);
11674 return (((void *)0));
11677 static int definedExpStackPos;
11679 static void * definedExpStack[512];
11681 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11683 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11685 FreeExpContents(checkedExp);
11686 FreeType(checkedExp->expType);
11687 FreeType(checkedExp->destType);
11688 *checkedExp = *newExp;
11689 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11690 checkedExp->prev = prev;
11691 checkedExp->next = next;
11694 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11696 extern int printf(char * , ...);
11698 void __ecereMethod_Expression_Clear();
11700 void ApplyAnyObjectLogic(struct Expression * e)
11702 struct Type * destType = e->destType;
11704 if(destType && (destType->classObjectType == 3))
11706 if(e && e->expType)
11708 struct Type * type = e->expType;
11709 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11711 if(type->kind == 8 && type->_class && type->_class->registered)
11713 _class = type->_class->registered;
11715 else if(type->kind == 19)
11717 _class = FindClass("ecere::com::Class")->registered;
11721 char string[1024] = "";
11722 struct Symbol * classSym;
11724 PrintType(type, string, 0x0, 0x1);
11725 classSym = FindClass(string);
11727 _class = classSym->registered;
11729 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)))
11731 if(!_class || strcmp(_class->fullName, "char *"))
11733 struct Expression * checkedExp = e, * newExp;
11735 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11737 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11739 if(checkedExp->type == 25)
11741 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11744 checkedExp = (*checkedExp->list).last;
11746 else if(checkedExp->type == 11)
11747 checkedExp = checkedExp->cast.exp;
11749 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11751 newExp = checkedExp->op.exp2;
11752 checkedExp->op.exp2 = (((void *)0));
11753 FreeExpContents(checkedExp);
11754 if(e->expType && e->expType->passAsTemplate)
11758 ComputeTypeSize(e->expType);
11759 sprintf(size, "%d", e->expType->size);
11760 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))))));
11762 ReplaceExpContents(checkedExp, newExp);
11763 e->byReference = 0x1;
11765 else if(!e->byReference || (_class && _class->type == 5))
11767 struct Expression * checkedExp, * newExp;
11770 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;
11772 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11774 struct Context * context = PushContext();
11775 struct Declarator * decl;
11776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11777 char typeString[1024];
11778 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11780 typeString[0] = '\0';
11782 newExp->prev = (((void *)0));
11783 newExp->next = (((void *)0));
11784 newExp->expType = (((void *)0));
11785 PrintType(e->expType, typeString, 0x0, 0x1);
11786 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11787 newExp->destType = ProcessType(specs, decl);
11788 curContext = context;
11793 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11795 sprintf(name, "__internalValue%03X", internalValueCounter++);
11796 if(!curCompound->compound.declarations)
11797 curCompound->compound.declarations = MkList();
11798 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11799 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11800 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11801 e->compound = MkCompoundStmt((((void *)0)), stmts);
11804 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11806 struct Type * type = e->destType;
11808 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11809 CopyTypeInto(e->destType, type);
11810 e->destType->refCount = 1;
11811 e->destType->classObjectType = 0;
11814 e->compound->compound.context = context;
11815 PopContext(context);
11816 curContext = context->parent;
11820 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11822 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11824 if(checkedExp->type == 25)
11826 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11829 checkedExp = (*checkedExp->list).last;
11831 else if(checkedExp->type == 11)
11832 checkedExp = checkedExp->cast.exp;
11835 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11837 *operand = *checkedExp;
11838 checkedExp->destType = (((void *)0));
11839 checkedExp->expType = (((void *)0));
11840 __ecereMethod_Expression_Clear(checkedExp);
11841 checkedExp->type = 4;
11842 checkedExp->op.op = '&';
11843 checkedExp->op.exp1 = (((void *)0));
11844 checkedExp->op.exp2 = operand;
11853 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))))
11855 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11861 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11864 thisExp->prev = (((void *)0));
11865 thisExp->next = (((void *)0));
11866 __ecereMethod_Expression_Clear(e);
11868 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11869 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11870 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11872 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11873 CopyTypeInto(e->expType, thisExp->expType);
11874 e->expType->byReference = 0x0;
11875 e->expType->refCount = 1;
11876 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))
11878 e->expType->classObjectType = 0;
11883 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11885 if(destType->kind == 14)
11887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11889 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11891 unsigned int byReference = e->expType->byReference;
11892 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11893 struct Declarator * decl;
11894 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11895 char typeString[1024];
11896 struct Type * type;
11897 int backupClassObjectType;
11899 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11903 backupClassObjectType = type->classObjectType;
11904 type->classObjectType = 0;
11905 typeString[0] = '\0';
11906 PrintType(type, typeString, 0x0, 0x1);
11907 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11908 type->classObjectType = backupClassObjectType;
11910 thisExp->prev = (((void *)0));
11911 thisExp->next = (((void *)0));
11912 __ecereMethod_Expression_Clear(e);
11913 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)))
11917 e->op.exp1 = (((void *)0));
11918 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11923 e->cast.typeName = MkTypeName(specs, decl);
11924 e->cast.exp = thisExp;
11925 e->byReference = 0x1;
11928 e->destType = destType;
11930 destType->refCount++;
11935 extern char * strstr(char * , const char * );
11937 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11939 struct __ecereNameSpace__ecere__com__DefinedExpression
11941 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11942 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11945 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11946 } __attribute__ ((gcc_struct));
11948 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11950 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11952 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11954 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11956 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11958 extern struct Expression * CopyExpression(struct Expression * exp);
11960 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11962 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11964 static void ProcessStatement(struct Statement * stmt);
11966 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
11968 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11970 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
11972 extern char * sourceFile;
11974 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11976 void ProcessExpressionType(struct Expression * exp)
11978 void * __ecereTemp2;
11979 void * __ecereTemp1;
11980 unsigned int unresolved = 0x0;
11981 struct Location oldyylloc = yylloc;
11982 unsigned int notByReference = 0x0;
11984 if(!exp || exp->expType)
11991 struct Identifier * id = exp->identifier;
11995 if(id->_class && id->_class->name)
11997 id->classSym = id->_class->symbol;
11999 if(strstr(id->string, "__ecereClass") == id->string)
12001 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12004 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12006 ReplaceClassMembers(exp, thisClass);
12009 ProcessExpressionType(exp);
12012 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12017 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12021 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12027 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12030 ProcessExpressionType(exp);
12034 else if(currentClass && !id->_class)
12036 if(ResolveIdWithClass(exp, currentClass, 0x1))
12039 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12044 struct Type * type = symbol->type;
12045 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12047 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12049 struct Context * context = SetupTemplatesContext(_class);
12051 type = ReplaceThisClassType(_class);
12052 FinishTemplatesContext(context);
12054 type->refCount = 0;
12056 FreeSpecifier(id->_class);
12057 id->_class = (((void *)0));
12058 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12059 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12060 id->classSym = (((void *)0));
12061 exp->expType = type;
12064 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12065 exp->isConstant = 0x1;
12066 if(symbol->isParam || !strcmp(id->string, "this"))
12068 if(_class && _class->type == 1)
12069 exp->byReference = 0x1;
12071 if(symbol->isIterator)
12073 if(symbol->isIterator == 3)
12076 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12077 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12078 exp->expType = (((void *)0));
12079 ProcessExpressionType(exp);
12081 else if(symbol->isIterator != 4)
12084 exp->member.exp = MkExpIdentifier(exp->identifier);
12085 exp->member.exp->expType = exp->expType;
12086 exp->member.member = MkIdentifier("data");
12087 exp->expType = (((void *)0));
12088 ProcessExpressionType(exp);
12095 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12097 if(thisNameSpace && !(id->_class && !id->_class->name))
12101 strcpy(name, thisNameSpace);
12102 strcat(name, "::");
12103 strcat(name, id->string);
12104 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12107 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12112 for(c = 0; c < definedExpStackPos; c++)
12113 if(definedExpStack[c] == definedExp)
12115 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12117 struct Location backupYylloc = yylloc;
12119 definedExpStack[definedExpStackPos++] = definedExp;
12120 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12121 ((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));
12122 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12124 parsedExpression = (((void *)0));
12126 expression_yyparse();
12127 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12128 yylloc = backupYylloc;
12129 if(parsedExpression)
12131 FreeIdentifier(id);
12133 exp->list = MkListOne(parsedExpression);
12134 parsedExpression->loc = yylloc;
12135 ProcessExpressionType(exp);
12136 definedExpStackPos--;
12139 definedExpStackPos--;
12145 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12151 struct GlobalData * data = (((void *)0));
12153 if(thisNameSpace && !(id->_class && !id->_class->name))
12157 strcpy(name, thisNameSpace);
12158 strcat(name, "::");
12159 strcat(name, id->string);
12160 data = FindGlobalData(name);
12163 data = FindGlobalData(id->string);
12166 DeclareGlobalData(data);
12167 exp->expType = data->dataType;
12169 data->dataType->refCount++;
12170 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12171 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12172 FreeSpecifier(id->_class);
12173 id->_class = (((void *)0));
12178 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12180 if(thisNameSpace && !(id->_class && !id->_class->name))
12184 strcpy(name, thisNameSpace);
12185 strcat(name, "::");
12186 strcat(name, id->string);
12187 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12190 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12195 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12196 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12198 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12199 strcpy(name, "__ecereFunction_");
12200 FullClassNameCat(name, id->string, 0x0);
12201 if(DeclareFunction(function, name))
12203 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12204 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12206 exp->expType = function->dataType;
12207 if(function->dataType)
12208 function->dataType->refCount++;
12209 FreeSpecifier(id->_class);
12210 id->_class = (((void *)0));
12222 struct __ecereNameSpace__ecere__com__Class * _class;
12224 if(!exp->instance->_class)
12226 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12228 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12231 ProcessInstantiationType(exp->instance);
12232 exp->isConstant = exp->instance->isConstant;
12233 if(exp->instance->_class)
12235 exp->expType = MkClassType(exp->instance->_class->name);
12243 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12245 exp->expType = type;
12246 if(exp->constant[0] == '\'')
12248 if((int)((unsigned char *)exp->constant)[1] > 127)
12251 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12254 ch = exp->constant[1];
12255 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12256 exp->constant = PrintUInt(ch);
12258 type->_class = FindClass("unichar");
12259 type->isSigned = 0x0;
12264 type->isSigned = 0x1;
12267 else if(strchr(exp->constant, '.'))
12269 char ch = exp->constant[strlen(exp->constant) - 1];
12275 type->isSigned = 0x1;
12279 if(exp->constant[0] == '0' && exp->constant[1])
12280 type->isSigned = 0x0;
12281 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12282 type->isSigned = 0x0;
12283 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12284 type->isSigned = 0x0;
12286 type->isSigned = 0x1;
12289 exp->isConstant = 0x1;
12295 exp->isConstant = 0x1;
12296 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));
12301 ProcessExpressionType(exp->_new.size);
12302 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));
12303 DeclareType(exp->expType->type, 0x0, 0x0);
12307 ProcessExpressionType(exp->_renew.size);
12308 ProcessExpressionType(exp->_renew.exp);
12309 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));
12310 DeclareType(exp->expType->type, 0x0, 0x0);
12314 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12315 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12316 unsigned int useDestType = 0x0, useSideType = 0x0;
12317 struct Location oldyylloc = yylloc;
12318 unsigned int useSideUnit = 0x0;
12319 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12361 if(exp->op.op != '*' || exp->op.exp1)
12368 if(exp->op.op == '&')
12370 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12372 struct Identifier * id = exp->op.exp2->identifier;
12373 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12375 if(symbol && symbol->isIterator == 2)
12378 exp->member.exp = exp->op.exp2;
12379 exp->member.member = MkIdentifier("key");
12380 exp->expType = (((void *)0));
12381 exp->op.exp2->expType = symbol->type;
12382 symbol->type->refCount++;
12383 ProcessExpressionType(exp);
12391 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))
12393 if(exp->op.exp1->destType)
12394 FreeType(exp->op.exp1->destType);
12395 exp->op.exp1->destType = exp->destType;
12397 exp->destType->refCount++;
12401 if(exp->op.exp1->destType)
12402 FreeType(exp->op.exp1->destType);
12403 exp->op.exp1->destType = dummy;
12406 if(exp->op.exp1->destType && exp->op.op != '=')
12407 exp->op.exp1->destType->count++;
12408 ProcessExpressionType(exp->op.exp1);
12409 if(exp->op.exp1->destType && exp->op.op != '=')
12410 exp->op.exp1->destType->count--;
12411 if(exp->op.exp1->destType == dummy)
12414 exp->op.exp1->destType = (((void *)0));
12416 type1 = exp->op.exp1->expType;
12420 char expString[10240];
12422 expString[0] = '\0';
12423 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12427 exp->op.exp2->destType = exp->op.exp1->expType;
12428 if(exp->op.exp1->expType)
12429 exp->op.exp1->expType->refCount++;
12433 exp->op.exp2->destType = exp->destType;
12435 exp->destType->refCount++;
12439 exp->expType = type1;
12444 PrintExpression(exp->op.exp2, expString);
12445 if(type1 && type1->kind == 13)
12447 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)
12448 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12449 else if(exp->op.op == '=')
12451 if(exp->op.exp2->destType)
12452 FreeType(exp->op.exp2->destType);
12453 exp->op.exp2->destType = type1;
12460 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)
12464 if(exp->op.exp2->destType)
12465 FreeType(exp->op.exp2->destType);
12466 exp->op.exp2->destType = type1;
12473 exp->expType = type1;
12475 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)))
12477 if(exp->op.exp2->destType)
12478 FreeType(exp->op.exp2->destType);
12479 exp->op.exp2->destType = exp->destType;
12481 exp->destType->refCount++;
12485 if(exp->op.exp2->destType)
12486 FreeType(exp->op.exp2->destType);
12487 exp->op.exp2->destType = dummy;
12490 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12492 FreeType(exp->op.exp2->destType);
12493 exp->op.exp2->destType = type1;
12496 if(exp->op.exp2->destType && exp->op.op != '=')
12497 exp->op.exp2->destType->count++;
12498 ProcessExpressionType(exp->op.exp2);
12499 if(exp->op.exp2->destType && exp->op.op != '=')
12500 exp->op.exp2->destType->count--;
12501 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12503 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)
12505 if(exp->op.op != '=' && type1->type->kind == 0)
12506 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12508 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)))
12510 if(exp->op.op == ADD_ASSIGN)
12511 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12513 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))
12515 if(exp->op.op == ADD_ASSIGN)
12516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12518 else if(inCompiler)
12520 char type1String[1024];
12521 char type2String[1024];
12523 type1String[0] = '\0';
12524 type2String[0] = '\0';
12525 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12526 PrintType(type1, type2String, 0x0, 0x1);
12527 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12528 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12531 if(exp->op.exp2->destType == dummy)
12534 exp->op.exp2->destType = (((void *)0));
12536 type2 = exp->op.exp2->expType;
12539 if(exp->op.op == SIZEOF)
12541 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12542 exp->isConstant = 0x1;
12544 else if(exp->op.op == '*' && !exp->op.exp1)
12546 exp->expType = Dereference(type2);
12547 if(type2 && type2->kind == 8)
12548 notByReference = 0x1;
12550 else if(exp->op.op == '&' && !exp->op.exp1)
12551 exp->expType = Reference(type2);
12558 if(exp->op.exp1->destType)
12559 FreeType(exp->op.exp1->destType);
12560 exp->op.exp1->destType = MkClassType("bool");
12561 exp->op.exp1->destType->truth = 0x1;
12562 if(!exp->op.exp1->expType)
12563 ProcessExpressionType(exp->op.exp1);
12565 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12566 FreeType(exp->op.exp1->expType);
12567 exp->op.exp1->expType = MkClassType("bool");
12568 exp->op.exp1->expType->truth = 0x1;
12572 if(exp->op.exp2->destType)
12573 FreeType(exp->op.exp2->destType);
12574 exp->op.exp2->destType = MkClassType("bool");
12575 exp->op.exp2->destType->truth = 0x1;
12576 if(!exp->op.exp2->expType)
12577 ProcessExpressionType(exp->op.exp2);
12579 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12580 FreeType(exp->op.exp2->expType);
12581 exp->op.exp2->expType = MkClassType("bool");
12582 exp->op.exp2->expType->truth = 0x1;
12585 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")))))
12587 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12589 if(exp->op.exp2->destType)
12590 FreeType(exp->op.exp2->destType);
12591 exp->op.exp2->destType = type1;
12593 if(exp->op.exp1->destType)
12594 FreeType(exp->op.exp1->destType);
12595 exp->op.exp1->destType = type2;
12597 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)
12598 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);
12599 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12601 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12605 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12607 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12608 ProcessExpressionType(exp->op.exp1);
12609 if(type2->kind != 13)
12611 ProcessExpressionType(classExp);
12612 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"))))))));
12613 if(!exp->op.exp2->expType)
12614 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12615 ProcessExpressionType(exp->op.exp2);
12619 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)))
12621 if(type1->kind != 8 && type1->type->kind == 0)
12622 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12623 exp->expType = type1;
12627 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)))
12629 if(type2->kind != 8 && type2->type->kind == 0)
12630 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12631 exp->expType = type2;
12635 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))
12637 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12641 unsigned int success = 0x0;
12643 if(type1->kind == 13 && type2->kind == 13)
12645 if(exp->op.op == '+')
12646 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12647 else if(exp->op.op == '-')
12649 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12651 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12653 if(type1->type->kind == 20)
12655 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12659 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12661 ProcessExpressionType(classExp);
12663 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")))))));
12664 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12672 if(!success && exp->op.exp1->type == 2)
12674 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12677 FreeType(exp->expType);
12678 exp->expType = exp->op.exp1->destType;
12679 if(exp->op.exp1->destType)
12680 exp->op.exp1->destType->refCount++;
12683 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12686 FreeType(exp->expType);
12687 exp->expType = exp->op.exp2->destType;
12688 if(exp->op.exp2->destType)
12689 exp->op.exp2->destType->refCount++;
12695 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12698 FreeType(exp->expType);
12699 exp->expType = exp->op.exp2->destType;
12700 if(exp->op.exp2->destType)
12701 exp->op.exp2->destType->refCount++;
12704 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12707 FreeType(exp->expType);
12708 exp->expType = exp->op.exp1->destType;
12709 if(exp->op.exp1->destType)
12710 exp->op.exp1->destType->refCount++;
12716 char expString1[10240];
12717 char expString2[10240];
12721 expString1[0] = '\0';
12722 expString2[0] = '\0';
12727 PrintExpression(exp->op.exp1, expString1);
12728 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12729 PrintExpression(exp->op.exp2, expString2);
12730 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12731 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12732 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12734 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12738 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12740 if(exp->op.exp1->destType)
12741 FreeType(exp->op.exp1->destType);
12742 exp->op.exp1->destType = type2->_class->registered->dataType;
12743 if(type2->_class->registered->dataType)
12744 type2->_class->registered->dataType->refCount++;
12745 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12746 exp->expType = type2;
12750 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12752 if(exp->op.exp2->destType)
12753 FreeType(exp->op.exp2->destType);
12754 exp->op.exp2->destType = type1->_class->registered->dataType;
12755 if(type1->_class->registered->dataType)
12756 type1->_class->registered->dataType->refCount++;
12757 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12758 exp->expType = type1;
12764 unsigned int valid = 0x0;
12766 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12768 if(exp->op.exp2->destType)
12769 FreeType(exp->op.exp2->destType);
12770 if(!type1->_class->registered->dataType)
12771 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12772 exp->op.exp2->destType = type1->_class->registered->dataType;
12773 exp->op.exp2->destType->refCount++;
12774 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12775 type2 = exp->op.exp2->destType;
12776 exp->expType = type2;
12779 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12781 if(exp->op.exp1->destType)
12782 FreeType(exp->op.exp1->destType);
12783 if(!type2->_class->registered->dataType)
12784 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12785 exp->op.exp1->destType = type2->_class->registered->dataType;
12786 exp->op.exp1->destType->refCount++;
12787 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12788 type1 = exp->op.exp1->destType;
12789 exp->expType = type1;
12792 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12794 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12796 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12799 FreeType(exp->expType);
12800 exp->expType = exp->op.exp1->expType;
12801 if(exp->op.exp2->expType)
12802 exp->op.exp1->expType->refCount++;
12806 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12808 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12811 FreeType(exp->expType);
12812 exp->expType = exp->op.exp2->expType;
12813 if(exp->op.exp2->expType)
12814 exp->op.exp2->expType->refCount++;
12821 if(exp->op.exp2->destType)
12822 FreeType(exp->op.exp2->destType);
12823 exp->op.exp2->destType = type1;
12825 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12828 FreeType(exp->expType);
12829 exp->expType = exp->op.exp2->destType;
12830 if(exp->op.exp2->destType)
12831 exp->op.exp2->destType->refCount++;
12833 else if(type1 && type2)
12835 char expString1[10240];
12836 char expString2[10240];
12837 char type1String[1024];
12838 char type2String[1024];
12840 expString1[0] = '\0';
12841 expString2[0] = '\0';
12842 type1String[0] = '\0';
12843 type2String[0] = '\0';
12846 PrintExpression(exp->op.exp1, expString1);
12847 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12848 PrintExpression(exp->op.exp2, expString2);
12849 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12850 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12851 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12853 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12854 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12856 exp->expType = exp->op.exp1->expType;
12857 if(exp->op.exp1->expType)
12858 exp->op.exp1->expType->refCount++;
12860 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12862 exp->expType = exp->op.exp2->expType;
12863 if(exp->op.exp2->expType)
12864 exp->op.exp2->expType->refCount++;
12871 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12873 struct Type * oldType = exp->op.exp1->expType;
12875 exp->op.exp1->expType = (((void *)0));
12876 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12879 exp->op.exp1->expType = oldType;
12881 if(exp->op.exp1->destType)
12882 FreeType(exp->op.exp1->destType);
12883 exp->op.exp1->destType = type2;
12885 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12888 FreeType(exp->expType);
12889 exp->expType = exp->op.exp1->destType;
12890 if(exp->op.exp1->destType)
12891 exp->op.exp1->destType->refCount++;
12895 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12897 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12899 if(exp->op.exp1->destType)
12900 FreeType(exp->op.exp1->destType);
12901 exp->op.exp1->destType = type2->_class->registered->dataType;
12902 if(type2->_class->registered->dataType)
12903 type2->_class->registered->dataType->refCount++;
12904 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12906 if(exp->op.op == '!')
12908 exp->expType = MkClassType("bool");
12909 exp->expType->truth = 0x1;
12913 exp->expType = type2;
12918 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12920 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12922 if(exp->op.exp2->destType)
12923 FreeType(exp->op.exp2->destType);
12924 exp->op.exp2->destType = type1->_class->registered->dataType;
12925 if(type1->_class->registered->dataType)
12926 type1->_class->registered->dataType->refCount++;
12927 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12929 exp->expType = type1;
12935 if(exp->op.exp1 && !exp->op.exp1->expType)
12937 char expString[10000];
12939 expString[0] = '\0';
12942 PrintExpression(exp->op.exp1, expString);
12943 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12946 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12948 if(exp->op.exp2 && !exp->op.exp2->expType)
12950 char expString[10240];
12952 expString[0] = '\0';
12955 PrintExpression(exp->op.exp2, expString);
12956 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12959 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12963 FreeType(exp->expType);
12964 exp->expType = MkClassType("bool");
12965 exp->expType->truth = 0x1;
12967 if(exp->op.op != SIZEOF)
12968 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12969 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12971 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12973 yylloc = oldyylloc;
12980 struct Expression * e;
12982 exp->isConstant = 0x1;
12983 for(e = (*exp->list).first; e; e = e->next)
12985 unsigned int inced = 0x0;
12989 FreeType(e->destType);
12990 e->destType = exp->destType;
12993 exp->destType->refCount++;
12994 e->destType->count++;
12998 ProcessExpressionType(e);
13000 exp->destType->count--;
13001 if(!exp->expType && !e->next)
13003 exp->expType = e->expType;
13005 e->expType->refCount++;
13008 exp->isConstant = 0x0;
13010 e = (*exp->list).first;
13011 if(!e->next && e->type == 8)
13013 struct Expression * next = exp->next, * prev = exp->prev;
13015 FreeType(exp->expType);
13016 FreeType(exp->destType);
13017 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13021 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13022 ProcessExpressionType(exp);
13028 struct Expression * e;
13030 exp->isConstant = 0x1;
13031 ProcessExpressionType(exp->index.exp);
13032 if(!exp->index.exp->isConstant)
13033 exp->isConstant = 0x0;
13034 if(exp->index.exp->expType)
13036 struct Type * source = exp->index.exp->expType;
13038 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)
13040 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13042 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13043 if(exp->index.index && (*exp->index.index).last)
13045 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13049 for(e = (*exp->index.index).first; e; e = e->next)
13051 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13054 FreeType(e->destType);
13055 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13057 ProcessExpressionType(e);
13062 exp->isConstant = 0x0;
13065 exp->expType = Dereference(exp->index.exp->expType);
13067 DeclareType(exp->expType, 0x0, 0x0);
13072 struct Expression * e;
13073 struct Type * functionType;
13074 struct Type * methodType = (((void *)0));
13080 PrintExpression(exp->call.exp, name);
13081 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13083 PrintExpression(exp->call.exp, name);
13086 if(exp->call.exp->type == 0)
13088 struct Expression * idExp = exp->call.exp;
13089 struct Identifier * id = idExp->identifier;
13091 if(!strcmp(id->string, "__builtin_frame_address"))
13093 exp->expType = ProcessTypeString("void *", 0x1);
13094 if(exp->call.arguments && (*exp->call.arguments).first)
13095 ProcessExpressionType((*exp->call.arguments).first);
13098 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13100 exp->expType = ProcessTypeString("int", 0x1);
13101 if(exp->call.arguments && (*exp->call.arguments).first)
13102 ProcessExpressionType((*exp->call.arguments).first);
13105 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13107 struct Expression * a = (((void *)0));
13108 struct Expression * b = (((void *)0));
13109 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13111 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13113 a = (*exp->call.arguments).first;
13114 b = (*exp->call.arguments).last;
13118 else if((*exp->call.arguments).count == 1)
13120 a = (*exp->call.arguments).first;
13125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13126 idExp->identifier = (((void *)0));
13127 FreeExpContents(exp);
13128 ProcessExpressionType(a);
13130 ProcessExpressionType(b);
13132 exp->list = MkList();
13133 if(a->expType && (!b || b->expType))
13135 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13139 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13140 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13141 struct Declaration * decl;
13142 char temp1[1024], temp2[1024];
13144 GetTypeSpecs(a->expType, specs);
13145 if(a && !a->isConstant && a->type != 0)
13147 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13148 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13149 tempExp1 = QMkExpId(temp1);
13150 tempExp1->expType = a->expType;
13152 a->expType->refCount++;
13153 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13155 if(b && !b->isConstant && b->type != 0)
13157 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13158 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13159 tempExp2 = QMkExpId(temp2);
13160 tempExp2->expType = b->expType;
13162 b->expType->refCount++;
13163 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13165 decl = MkDeclaration(specs, decls);
13166 if(!curCompound->compound.declarations)
13167 curCompound->compound.declarations = MkList();
13168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13172 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13174 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13176 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13177 exp->expType = a->expType;
13179 a->expType->refCount++;
13181 else if(!strcmp(id->string, "Abs"))
13183 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13184 exp->expType = a->expType;
13186 a->expType->refCount++;
13188 else if(!strcmp(id->string, "Sgn"))
13190 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"))))));
13191 exp->expType = ProcessTypeString("int", 0x0);
13193 FreeExpression(tempExp1);
13195 FreeExpression(tempExp2);
13196 FreeIdentifier(id);
13202 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13204 if(!exp->call.exp->destType)
13206 exp->call.exp->destType = dummy;
13209 ProcessExpressionType(exp->call.exp);
13210 if(exp->call.exp->destType == dummy)
13213 exp->call.exp->destType = (((void *)0));
13217 functionType = exp->call.exp->expType;
13218 if(functionType && functionType->kind == 16)
13220 methodType = functionType;
13221 functionType = methodType->method->dataType;
13222 if(exp->call.exp->expType->usedClass)
13224 char typeString[1024];
13226 typeString[0] = '\0';
13227 PrintType(functionType, typeString, 0x1, 0x1);
13228 if(strstr(typeString, "thisclass"))
13230 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13231 struct Declarator * decl;
13234 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13236 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13237 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13238 thisClassParams = 0x0;
13239 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13241 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13243 thisClass = exp->call.exp->expType->usedClass;
13244 ProcessDeclarator(decl);
13245 thisClass = backupThisClass;
13247 thisClassParams = 0x1;
13248 functionType = ProcessType(specs, decl);
13249 functionType->refCount = 0;
13250 FinishTemplatesContext(context);
13252 FreeList(specs, FreeSpecifier);
13253 FreeDeclarator(decl);
13257 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13259 struct Type * type = functionType->type;
13261 if(!functionType->refCount)
13263 functionType->type = (((void *)0));
13264 FreeType(functionType);
13266 functionType = type;
13268 if(functionType && functionType->kind != 11)
13270 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13272 else if(functionType)
13274 unsigned int emptyParams = 0x0, noParams = 0x0;
13275 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13276 struct Type * type = functionType->params.first;
13277 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13279 struct Location oldyylloc = yylloc;
13283 if(functionType->extraParam && e)
13285 e->destType = MkClassType(functionType->thisClass->string);
13288 if(!functionType->staticMethod)
13290 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13292 type = MkClassType(memberExp->member.exp->expType->_class->string);
13295 e->destType = type;
13297 type = functionType->params.first;
13300 type->refCount = 0;
13302 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13304 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13307 e->destType = type;
13309 type = functionType->params.first;
13312 type->refCount = 0;
13315 if(type && type->kind == 0)
13318 if(!type->refCount)
13320 type = (((void *)0));
13322 for(; e; e = e->next)
13324 if(!type && !emptyParams)
13327 if(methodType && methodType->methodClass)
13328 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);
13330 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);
13333 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13335 struct Type * templatedType = (((void *)0));
13336 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13337 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13340 if(_class && _class->templateArgs)
13342 struct __ecereNameSpace__ecere__com__Class * sClass;
13344 for(sClass = _class; sClass; sClass = sClass->base)
13346 if(sClass->templateClass)
13347 sClass = sClass->templateClass;
13349 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13351 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13353 struct __ecereNameSpace__ecere__com__Class * nextClass;
13355 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13357 if(nextClass->templateClass)
13358 nextClass = nextClass->templateClass;
13359 id += nextClass->templateParams.count;
13369 if(curParam && _class->templateArgs[id].dataTypeString)
13371 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13374 struct Context * context = SetupTemplatesContext(_class);
13376 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13377 FinishTemplatesContext(context);
13379 e->destType = templatedType;
13382 templatedType->passAsTemplate = 0x1;
13387 e->destType = type;
13394 e->destType = type;
13398 if(type && type->kind != 14)
13400 struct Type * next = type->next;
13402 if(!type->refCount)
13407 if(type && type->kind != 14)
13409 if(methodType && methodType->methodClass)
13410 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);
13412 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);
13414 yylloc = oldyylloc;
13415 if(type && !type->refCount)
13420 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13421 if(exp->call.exp->type == 0)
13423 char * string = exp->call.exp->identifier->string;
13427 struct Symbol * symbol;
13428 struct Location oldyylloc = yylloc;
13430 yylloc = exp->call.exp->identifier->loc;
13431 if(strstr(string, "__builtin_") == string)
13434 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13435 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));
13436 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13437 if(strstr(symbol->string, "::"))
13438 globalContext->hasNameSpace = 0x1;
13439 yylloc = oldyylloc;
13442 else if(exp->call.exp->type == 8)
13446 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13447 if(!functionType->returnType)
13449 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13452 if(functionType && functionType->kind == 11)
13454 exp->expType = functionType->returnType;
13455 if(functionType->returnType)
13456 functionType->returnType->refCount++;
13457 if(!functionType->refCount)
13458 FreeType(functionType);
13460 if(exp->call.arguments)
13462 for(e = (*exp->call.arguments).first; e; e = e->next)
13464 struct Type * destType = e->destType;
13466 ProcessExpressionType(e);
13473 struct Type * type;
13474 struct Location oldyylloc = yylloc;
13475 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13477 exp->thisPtr = thisPtr;
13478 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13480 exp->member.member->classSym = exp->member.member->_class->symbol;
13482 ProcessExpressionType(exp->member.exp);
13483 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)
13485 exp->isConstant = 0x0;
13488 exp->isConstant = exp->member.exp->isConstant;
13489 type = exp->member.exp->expType;
13491 if(type && (type->kind == 20))
13493 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13494 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13498 for(param = _class->templateParams.first; param; param = param->next)
13500 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13504 if(param && param->defaultArg.member)
13506 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13510 struct Expression * expMember = exp->member.exp;
13511 struct Declarator * decl;
13512 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13513 char thisClassTypeString[1024];
13515 FreeIdentifier(exp->member.member);
13516 ProcessExpressionType(argExp);
13518 char * colon = strstr(param->defaultArg.memberString, "::");
13522 char className[1024];
13523 struct __ecereNameSpace__ecere__com__Class * sClass;
13525 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13526 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13529 strcpy(thisClassTypeString, _class->fullName);
13531 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13532 exp->expType = ProcessType(specs, decl);
13533 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13535 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13536 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13538 int paramCount = 0;
13539 int lastParam = -1;
13540 char templateString[1024];
13541 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13543 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13544 for(cClass = expClass; cClass; cClass = cClass->base)
13548 for(param = cClass->templateParams.first; param; param = param->next)
13551 struct __ecereNameSpace__ecere__com__Class * sClass;
13552 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13554 for(sClass = cClass->base; sClass; sClass = sClass->base)
13555 id += sClass->templateParams.count;
13556 arg = expClass->templateArgs[id];
13557 for(sClass = _class; sClass; sClass = sClass->base)
13559 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13561 struct __ecereNameSpace__ecere__com__Class * nextClass;
13563 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13564 p += nextClass->templateParams.count;
13565 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13567 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13569 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13571 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13572 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13579 char argument[256];
13581 argument[0] = '\0';
13582 switch(param->type)
13586 char expString[1024];
13587 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13588 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13589 struct Expression * exp;
13590 char * string = PrintHexUInt64(arg.expression.ui64);
13592 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13593 ProcessExpressionType(exp);
13594 ComputeExpression(exp);
13595 expString[0] = '\0';
13596 PrintExpression(exp, expString);
13597 strcat(argument, expString);
13598 FreeExpression(exp);
13603 strcat(argument, arg.member->name);
13608 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13610 if(!strcmp(arg.dataTypeString, "thisclass"))
13611 strcat(argument, thisClassTypeString);
13613 strcat(argument, arg.dataTypeString);
13621 strcat(templateString, ", ");
13622 if(lastParam != p - 1)
13624 strcat(templateString, param->name);
13625 strcat(templateString, " = ");
13627 strcat(templateString, argument);
13636 int len = strlen(templateString);
13638 if(templateString[len - 1] == '>')
13639 templateString[len++] = ' ';
13640 templateString[len++] = '>';
13641 templateString[len++] = '\0';
13644 struct Context * context = SetupTemplatesContext(_class);
13646 FreeType(exp->expType);
13647 exp->expType = ProcessTypeString(templateString, 0x0);
13648 FinishTemplatesContext(context);
13652 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")))))))));
13655 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13657 type = ProcessTemplateParameterType(type->templateParameter);
13660 if(type && (type->kind == 20))
13662 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13664 struct Identifier * id = exp->member.member;
13665 int typeKind = type->kind;
13666 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));
13668 if(typeKind == 19 && exp->member.exp->type == 26)
13670 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13673 if(id && (typeKind == 3 || typeKind == 15))
13674 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13677 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13678 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13679 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13680 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13681 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13683 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13684 exp->member.memberType = 1;
13685 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13686 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13689 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13691 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13692 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13694 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13696 member = (((void *)0));
13698 if(!member && !prop)
13699 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13700 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13701 exp->member.thisPtr = 0x1;
13707 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13708 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13709 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13711 if(!prop && !member)
13713 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13716 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13717 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13718 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13723 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13724 prop = (((void *)0));
13726 member = (((void *)0));
13730 if(!prop && !member)
13731 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13732 if(!prop && !member && !method)
13736 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13739 exp->member.memberType = 5;
13740 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13744 char structName[1024];
13745 struct Identifier * id = exp->member.member;
13746 struct Expression * classExp = exp->member.exp;
13749 FreeType(classExp->expType);
13750 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13751 strcpy(structName, "__ecereClassData_");
13752 FullClassNameCat(structName, type->_class->string, 0x0);
13754 exp->member.member = id;
13755 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"))))))));
13757 ProcessExpressionType(exp);
13763 struct Symbol * classSym = FindClass(id->string);
13767 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13770 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13776 exp->member.memberType = 1;
13777 if(!prop->dataType)
13778 ProcessPropertyType(prop);
13779 exp->expType = prop->dataType;
13781 prop->dataType->refCount++;
13785 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13787 FreeExpContents(exp);
13789 exp->identifier = MkIdentifier("class");
13790 ProcessExpressionType(exp);
13793 exp->member.memberType = 3;
13794 DeclareStruct(_class->fullName, 0x0);
13795 if(!member->dataType)
13797 struct Context * context = SetupTemplatesContext(_class);
13799 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13800 FinishTemplatesContext(context);
13802 exp->expType = member->dataType;
13803 if(member->dataType)
13804 member->dataType->refCount++;
13806 else if(revConvert)
13808 exp->member.memberType = 4;
13809 exp->expType = MkClassType(revConvert->_class->fullName);
13815 exp->member.memberType = 2;
13817 if(!method->dataType)
13818 ProcessMethodType(method);
13819 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));
13820 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13821 exp->expType->usedClass = _class;
13823 else if(!classProp)
13825 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13827 FreeExpContents(exp);
13829 exp->identifier = MkIdentifier("class");
13830 ProcessExpressionType(exp);
13833 yylloc = exp->member.member->loc;
13834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13836 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13838 if(_class && exp->expType)
13840 struct __ecereNameSpace__ecere__com__Class * tClass;
13843 while(tClass && !tClass->templateClass)
13844 tClass = tClass->base;
13845 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13848 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13849 struct __ecereNameSpace__ecere__com__Class * sClass;
13851 for(sClass = tClass; sClass; sClass = sClass->base)
13854 if(sClass->templateClass)
13855 sClass = sClass->templateClass;
13856 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13858 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13860 for(sClass = sClass->base; sClass; sClass = sClass->base)
13861 id += sClass->templateParams.count;
13869 if(curParam && tClass->templateArgs[id].dataTypeString)
13871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13872 struct Context * context = SetupTemplatesContext(tClass);
13874 FreeType(exp->expType);
13875 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13878 if(exp->expType->kind == 21)
13880 FreeType(exp->expType);
13881 exp->expType = ReplaceThisClassType(_class);
13883 if(tClass->templateClass)
13884 exp->expType->passAsTemplate = 0x1;
13887 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13888 if(exp->destType->kind == 21)
13890 FreeType(exp->destType);
13891 exp->destType = ReplaceThisClassType(_class);
13895 FinishTemplatesContext(context);
13898 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13901 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13902 struct __ecereNameSpace__ecere__com__Class * sClass;
13904 for(sClass = tClass; sClass; sClass = sClass->base)
13907 if(sClass->templateClass)
13908 sClass = sClass->templateClass;
13909 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13911 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13913 for(sClass = sClass->base; sClass; sClass = sClass->base)
13914 id += sClass->templateParams.count;
13924 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13925 struct Context * context = SetupTemplatesContext(tClass);
13926 struct Type * basicType;
13928 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13931 if(basicType->kind == 21)
13933 FreeType(basicType);
13934 basicType = ReplaceThisClassType(_class);
13936 FreeType(exp->expType);
13937 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));
13940 exp->destType = exp->expType;
13941 exp->destType->refCount++;
13944 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13945 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13946 struct Declarator * decl;
13948 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13951 exp->destType->refCount++;
13953 exp->expType->refCount++;
13955 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13956 exp->cast.exp = newExp;
13959 FinishTemplatesContext(context);
13962 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13964 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13968 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13971 int paramCount = 0;
13972 int lastParam = -1;
13973 char templateString[1024];
13974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13976 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13977 while(cClass != expClass)
13979 struct __ecereNameSpace__ecere__com__Class * sClass;
13981 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13984 for(param = cClass->templateParams.first; param; param = param->next)
13986 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13989 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13990 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13992 while(cClassCur != tClass && !paramCur)
13994 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13996 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13998 cClassCur = sClassCur;
13999 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14001 if(!strcmp(paramCur->name, param->name))
14008 if(paramCur && paramCur->type == 0)
14009 arg = tClass->templateArgs[cp];
14011 arg = expClass->templateArgs[p];
14013 char argument[256];
14015 argument[0] = '\0';
14016 switch(param->type)
14020 char expString[1024];
14021 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14022 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14023 struct Expression * exp;
14024 char * string = PrintHexUInt64(arg.expression.ui64);
14026 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14027 ProcessExpressionType(exp);
14028 ComputeExpression(exp);
14029 expString[0] = '\0';
14030 PrintExpression(exp, expString);
14031 strcat(argument, expString);
14032 FreeExpression(exp);
14037 strcat(argument, arg.member->name);
14042 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14043 strcat(argument, arg.dataTypeString);
14050 strcat(templateString, ", ");
14051 if(lastParam != p - 1)
14053 strcat(templateString, param->name);
14054 strcat(templateString, " = ");
14056 strcat(templateString, argument);
14065 int len = strlen(templateString);
14067 if(templateString[len - 1] == '>')
14068 templateString[len++] = ' ';
14069 templateString[len++] = '>';
14070 templateString[len++] = '\0';
14072 FreeType(exp->expType);
14074 struct Context * context = SetupTemplatesContext(tClass);
14076 exp->expType = ProcessTypeString(templateString, 0x0);
14077 FinishTemplatesContext(context);
14084 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)");
14086 else if(type && (type->kind == 9 || type->kind == 10))
14088 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14092 exp->expType = memberType;
14094 memberType->refCount++;
14099 char expString[10240];
14101 expString[0] = '\0';
14104 PrintExpression(exp, expString);
14105 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14107 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14109 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14111 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14113 struct Identifier * id = exp->member.member;
14114 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));
14118 FreeType(exp->expType);
14119 exp->expType = ReplaceThisClassType(_class);
14123 yylloc = oldyylloc;
14128 struct Type * destType = exp->destType;
14130 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14132 exp->member.member->classSym = exp->member.member->_class->symbol;
14134 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14138 ProcessExpressionType(exp);
14145 struct Symbol * classSym = exp->_class->symbol;
14147 if(classSym && classSym->registered)
14149 if(classSym->registered->type == 5)
14154 DeclareStruct(classSym->string, 0x0);
14155 FreeSpecifier(exp->_class);
14157 FullClassNameCat(name, classSym->string, 0x0);
14158 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14162 if(classSym->registered->fixed)
14164 FreeSpecifier(exp->_class);
14165 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14170 char className[1024];
14172 strcpy(className, "__ecereClass_");
14173 FullClassNameCat(className, classSym->string, 0x1);
14174 MangleClassName(className);
14175 DeclareClass(classSym, className);
14176 FreeExpContents(exp);
14178 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14179 exp->member.member = MkIdentifier("structSize");
14183 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14188 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14190 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14191 exp->isConstant = 0x1;
14192 DeclareType(type, 0x0, 0x0);
14198 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14200 type->count = (unsigned int)1;
14201 FreeType(exp->cast.exp->destType);
14202 exp->cast.exp->destType = type;
14204 ProcessExpressionType(exp->cast.exp);
14205 type->count = (unsigned int)0;
14206 exp->expType = type;
14207 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14209 void * prev = exp->prev, * next = exp->next;
14210 struct Type * expType = exp->cast.exp->destType;
14211 struct Expression * castExp = exp->cast.exp;
14212 struct Type * destType = exp->destType;
14215 expType->refCount++;
14216 FreeType(exp->expType);
14217 FreeTypeName(exp->cast.typeName);
14219 FreeType(exp->expType);
14220 FreeType(exp->destType);
14221 exp->expType = expType;
14222 exp->destType = destType;
14223 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14229 exp->isConstant = exp->cast.exp->isConstant;
14235 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14238 exp->expType = type;
14243 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14245 ProcessExpressionType(exp->vaArg.exp);
14247 exp->expType = type;
14252 struct Expression * e;
14254 exp->isConstant = 0x1;
14255 FreeType(exp->cond.cond->destType);
14256 exp->cond.cond->destType = MkClassType("bool");
14257 exp->cond.cond->destType->truth = 0x1;
14258 ProcessExpressionType(exp->cond.cond);
14259 if(!exp->cond.cond->isConstant)
14260 exp->isConstant = 0x0;
14261 for(e = (*exp->cond.exp).first; e; e = e->next)
14265 FreeType(e->destType);
14266 e->destType = exp->destType;
14268 e->destType->refCount++;
14270 ProcessExpressionType(e);
14273 exp->expType = e->expType;
14275 e->expType->refCount++;
14278 exp->isConstant = 0x0;
14280 FreeType(exp->cond.elseExp->destType);
14281 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14282 if(exp->cond.elseExp->destType)
14283 exp->cond.elseExp->destType->refCount++;
14284 ProcessExpressionType(exp->cond.elseExp);
14285 if(!exp->cond.elseExp->isConstant)
14286 exp->isConstant = 0x0;
14291 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14293 struct Statement * last = (*exp->compound->compound.statements).last;
14295 if(last->type == 3 && last->expressions && (*last->expressions).last)
14297 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14299 exp->destType->refCount++;
14301 ProcessStatement(exp->compound);
14302 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14303 if(((struct Expression *)(*last->expressions).last)->expType)
14304 exp->expType->refCount++;
14310 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14312 if(spec && spec->type == 1)
14314 exp->expType = MkClassType(spec->name);
14315 exp->expType->kind = 19;
14316 exp->byReference = 0x1;
14320 exp->expType = MkClassType("ecere::com::Class");
14321 exp->byReference = 0x1;
14327 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14331 struct Identifier * id = exp->classData.id;
14332 char structName[1024];
14333 struct Expression * classExp;
14335 strcpy(structName, "__ecereClassData_");
14336 FullClassNameCat(structName, _class->fullName, 0x0);
14338 exp->member.member = id;
14339 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14340 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14342 classExp = MkExpIdentifier(MkIdentifier("class"));
14343 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"))))))));
14344 ProcessExpressionType(exp);
14351 struct Type * type = (((void *)0));
14352 char * typeString = (((void *)0));
14353 char typeStringBuf[1024];
14355 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))
14357 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14359 typeString = templateClass->templateArgs[2].dataTypeString;
14363 struct Expression * e;
14365 for(e = (*exp->list).first; e; e = e->next)
14367 ProcessExpressionType(e);
14377 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14381 e->expType = (((void *)0));
14382 e = (*exp->list).first;
14383 ProcessExpressionType(e);
14386 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14388 FreeType(e->expType);
14389 e->expType = (((void *)0));
14391 type = (((void *)0));
14399 FreeType(e->expType);
14400 e->expType = (((void *)0));
14406 typeStringBuf[0] = '\0';
14407 PrintType(type, typeStringBuf, 0x0, 0x1);
14408 typeString = typeStringBuf;
14410 type = (((void *)0));
14415 char templateString[1024];
14416 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14417 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14418 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14419 struct Expression * expExt;
14420 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14422 sprintf(templateString, "Container<%s>", typeString);
14425 struct Expression * e;
14427 type = ProcessTypeString(typeString, 0x0);
14428 while(e = (*exp->list).first)
14430 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14431 e->destType = type;
14433 ProcessExpressionType(e);
14434 ListAdd(initializers, MkInitializerAssignment(e));
14437 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14439 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14440 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14441 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14442 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14443 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14444 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14445 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14446 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14447 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14448 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
14449 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14450 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14451 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14452 exp->expType = ProcessTypeString(templateString, 0x0);
14454 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14455 ProcessExpressionType(expExt);
14459 exp->expType = ProcessTypeString("Container", 0x0);
14460 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14465 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14467 FreeType(exp->expType);
14468 exp->expType = ReplaceThisClassType(thisClass);
14470 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14472 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14476 if(exp->expType->kind != 15)
14478 struct Type * member;
14479 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14481 FreeType(exp->expType);
14482 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14483 exp->expType->kind = symbol->type->kind;
14484 exp->expType->refCount++;
14485 exp->expType->enumName = enumName;
14486 exp->expType->members = symbol->type->members;
14487 for(member = symbol->type->members.first; member; member = member->next)
14488 member->refCount++;
14492 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14494 for(member = symbol->type->members.first; member; member = member->next)
14496 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14498 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14504 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14506 else if(exp->destType && !exp->destType->keepCast)
14508 if(!CheckExpressionType(exp, exp->destType, 0x0))
14510 if(!exp->destType->count || unresolved)
14515 if(exp->destType->kind != 14)
14522 char expString[10240];
14524 expString[0] = '\0';
14525 PrintType(exp->destType, type2, 0x0, 0x1);
14528 PrintExpression(exp, expString);
14529 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14532 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14533 else if(exp->type != 16)
14534 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14539 char expString[10240];
14541 expString[0] = '\0';
14544 PrintExpression(exp, expString);
14545 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14548 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14549 else if(exp->type != 16)
14550 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14562 PrintType(exp->expType, type1, 0x0, 0x1);
14563 PrintType(exp->destType, type2, 0x0, 0x1);
14565 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)))
14569 char expString[10240];
14571 expString[0] = '\0';
14574 PrintExpression(exp, expString);
14575 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14577 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14578 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14579 FreeType(exp->expType);
14580 exp->destType->refCount++;
14581 exp->expType = exp->destType;
14586 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14588 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14589 char typeString[1024];
14590 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14591 struct Declarator * decl;
14593 typeString[0] = '\0';
14596 exp->expType->refCount++;
14598 exp->expType->refCount++;
14600 newExp->destType = exp->expType;
14601 PrintType(exp->expType, typeString, 0x0, 0x0);
14602 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14603 exp->cast.typeName = MkTypeName(specs, decl);
14604 exp->cast.exp = newExp;
14607 else if(unresolved)
14609 if(exp->identifier->_class && exp->identifier->_class->name)
14610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14611 else if(exp->identifier->string && exp->identifier->string[0])
14612 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14614 else if(!exp->expType && exp->type != 16)
14616 char expString[10240];
14618 expString[0] = '\0';
14621 PrintExpression(exp, expString);
14622 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14624 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14626 ApplyAnyObjectLogic(exp);
14627 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14629 exp->byReference = 0x1;
14631 yylloc = oldyylloc;
14634 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)
14638 *curMember = (*curMember)->next;
14639 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14641 *curMember = subMemberStack[--(*subMemberStackPos)];
14642 *curMember = (*curMember)->next;
14644 while((*curMember) && (*curMember)->isProperty)
14645 *curMember = (*curMember)->next;
14646 if(subMemberStackPos)
14648 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14650 subMemberStack[(*subMemberStackPos)++] = *curMember;
14651 *curMember = (*curMember)->members.first;
14652 while(*curMember && (*curMember)->isProperty)
14653 *curMember = (*curMember)->next;
14661 if(subMemberStackPos && *subMemberStackPos)
14663 *curMember = subMemberStack[--(*subMemberStackPos)];
14664 *curMember = (*curMember)->next;
14668 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14670 if(*curClass == _class)
14672 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14674 *curMember = (*curClass)->membersAndProperties.first;
14676 while((*curMember) && (*curMember)->isProperty)
14677 *curMember = (*curMember)->next;
14678 if(subMemberStackPos)
14680 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14682 subMemberStack[(*subMemberStackPos)++] = *curMember;
14683 *curMember = (*curMember)->members.first;
14684 while(*curMember && (*curMember)->isProperty)
14685 *curMember = (*curMember)->next;
14692 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14697 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14699 if(init->exp && !init->exp->destType)
14701 FreeType(init->exp->destType);
14702 init->exp->destType = type;
14708 ProcessExpressionType(init->exp);
14709 init->isConstant = init->exp->isConstant;
14715 struct Expression * exp = init->exp;
14716 struct Instantiation * inst = exp->instance;
14717 struct MembersInit * members;
14720 init->list = MkList();
14723 for(members = (*inst->members).first; members; members = members->next)
14725 if(members->type == 0)
14727 struct MemberInit * member;
14729 for(member = (*members->dataMembers).first; member; member = member->next)
14731 ListAdd(init->list, member->initializer);
14732 member->initializer = (((void *)0));
14737 FreeExpression(exp);
14741 struct Initializer * i;
14742 struct Type * initializerType = (((void *)0));
14743 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14744 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14745 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14746 int subMemberStackPos = 0;
14748 if(type && type->kind == 12)
14749 initializerType = Dereference(type);
14750 else if(type && (type->kind == 9 || type->kind == 10))
14751 initializerType = type->members.first;
14752 for(i = (*init->list).first; i; i = i->next)
14754 if(type && type->kind == 8 && type->_class && type->_class->registered)
14756 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14759 if(!curMember->dataType)
14760 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14761 initializerType = curMember->dataType;
14764 ProcessInitializer(i, initializerType);
14765 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14766 initializerType = initializerType->next;
14768 init->isConstant = 0x0;
14770 if(type && type->kind == 12)
14771 FreeType(initializerType);
14772 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14774 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14781 extern struct Symbol * FindType(struct Context * ctx, char * name);
14783 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14785 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14791 if(spec->specifier == THISCLASS)
14796 spec->name = ReplaceThisClass(thisClass);
14797 spec->symbol = FindClass(spec->name);
14798 ProcessSpecifier(spec, declareStruct);
14805 struct Symbol * symbol = FindType(curContext, spec->name);
14808 DeclareType(symbol->type, 0x1, 0x1);
14809 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14810 DeclareStruct(spec->name, 0x0);
14815 struct Enumerator * e;
14819 for(e = (*spec->list).first; e; e = e->next)
14822 ProcessExpressionType(e->exp);
14830 if(spec->definitions)
14832 struct ClassDef * def;
14833 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14835 ProcessClass(spec->definitions, symbol);
14842 static void ProcessDeclarator(struct Declarator * decl)
14847 if(decl->identifier->classSym)
14849 FreeSpecifier(decl->identifier->_class);
14850 decl->identifier->_class = (((void *)0));
14854 if(decl->array.exp)
14855 ProcessExpressionType(decl->array.exp);
14862 if(decl->declarator)
14863 ProcessDeclarator(decl->declarator);
14864 if(decl->type == 4)
14866 struct Identifier * id = GetDeclId(decl);
14868 if(id && id->_class)
14870 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14872 if(!decl->function.parameters)
14873 decl->function.parameters = MkList();
14874 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14875 id->_class = (((void *)0));
14877 if(decl->function.parameters)
14879 struct TypeName * param;
14881 for(param = (*decl->function.parameters).first; param; param = param->next)
14883 if(param->qualifiers && (*param->qualifiers).first)
14885 struct Specifier * spec = (*param->qualifiers).first;
14887 if(spec && spec->specifier == TYPED_OBJECT)
14889 struct Declarator * d = param->declarator;
14890 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);
14892 FreeList(param->qualifiers, FreeSpecifier);
14893 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14894 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14895 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14898 else if(spec && spec->specifier == ANY_OBJECT)
14900 struct Declarator * d = param->declarator;
14902 FreeList(param->qualifiers, FreeSpecifier);
14903 param->qualifiers = MkListOne(MkSpecifier(VOID));
14904 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14906 else if(spec->specifier == THISCLASS)
14911 spec->name = ReplaceThisClass(thisClass);
14912 spec->symbol = FindClass(spec->name);
14913 ProcessSpecifier(spec, 0x0);
14917 if(param->declarator)
14918 ProcessDeclarator(param->declarator);
14926 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14928 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14930 static void ProcessDeclaration(struct Declaration * decl)
14932 yylloc = decl->loc;
14937 unsigned int declareStruct = 0x0;
14939 if(decl->declarators)
14941 struct InitDeclarator * d;
14943 for(d = (*decl->declarators).first; d; d = d->next)
14945 struct Type * type, * subType;
14947 ProcessDeclarator(d->declarator);
14948 type = ProcessType(decl->specifiers, d->declarator);
14951 ProcessInitializer(d->initializer, type);
14952 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14954 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14956 struct Instantiation * inst = d->initializer->exp->instance;
14958 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14959 d->initializer->exp->instance = (((void *)0));
14960 if(decl->specifiers)
14961 FreeList(decl->specifiers, FreeSpecifier);
14962 FreeList(decl->declarators, FreeInitDeclarator);
14969 for(subType = type; subType; )
14971 if(subType->kind == 8)
14973 declareStruct = 0x1;
14976 else if(subType->kind == 13)
14978 else if(subType->kind == 12)
14979 subType = subType->arrayType;
14988 if(decl->specifiers)
14990 struct Specifier * s;
14992 for(s = (*decl->specifiers).first; s; s = s->next)
14994 ProcessSpecifier(s, declareStruct);
15001 ProcessInstantiationType(decl->inst);
15006 struct Specifier * spec;
15007 struct Declarator * d;
15008 unsigned int declareStruct = 0x0;
15010 if(decl->declarators)
15012 for(d = (*decl->declarators).first; d; d = d->next)
15014 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15015 struct Type * subType;
15017 ProcessDeclarator(d);
15018 for(subType = type; subType; )
15020 if(subType->kind == 8)
15022 declareStruct = 0x1;
15025 else if(subType->kind == 13)
15027 else if(subType->kind == 12)
15028 subType = subType->arrayType;
15035 if(decl->specifiers)
15037 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15038 ProcessSpecifier(spec, declareStruct);
15045 static struct FunctionDefinition * curFunction;
15047 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15049 char propName[1024], propNameM[1024];
15050 char getName[1024], setName[1024];
15051 struct __ecereNameSpace__ecere__sys__OldList * args;
15053 DeclareProperty(prop, setName, getName);
15054 strcpy(propName, "__ecereProp_");
15055 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15056 strcat(propName, "_");
15057 FullClassNameCat(propName, prop->name, 0x1);
15058 MangleClassName(propName);
15059 strcpy(propNameM, "__ecerePropM_");
15060 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15061 strcat(propNameM, "_");
15062 FullClassNameCat(propNameM, prop->name, 0x1);
15063 MangleClassName(propNameM);
15064 if(prop->isWatchable)
15067 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15068 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15069 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15071 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15072 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15073 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15077 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15078 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15079 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15081 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15082 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15083 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15085 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15086 curFunction->propSet->fireWatchersDone = 0x1;
15089 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15091 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15093 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15095 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15097 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15099 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15101 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15103 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15105 static void ProcessStatement(struct Statement * stmt)
15107 yylloc = stmt->loc;
15111 ProcessStatement(stmt->labeled.stmt);
15114 if(stmt->caseStmt.exp)
15116 FreeType(stmt->caseStmt.exp->destType);
15117 stmt->caseStmt.exp->destType = curSwitchType;
15119 curSwitchType->refCount++;
15120 ProcessExpressionType(stmt->caseStmt.exp);
15121 ComputeExpression(stmt->caseStmt.exp);
15123 if(stmt->caseStmt.stmt)
15124 ProcessStatement(stmt->caseStmt.stmt);
15128 if(stmt->compound.context)
15130 struct Declaration * decl;
15131 struct Statement * s;
15132 struct Statement * prevCompound = curCompound;
15133 struct Context * prevContext = curContext;
15135 if(!stmt->compound.isSwitch)
15137 curCompound = stmt;
15138 curContext = stmt->compound.context;
15140 if(stmt->compound.declarations)
15142 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15143 ProcessDeclaration(decl);
15145 if(stmt->compound.statements)
15147 for(s = (*stmt->compound.statements).first; s; s = s->next)
15148 ProcessStatement(s);
15150 curContext = prevContext;
15151 curCompound = prevCompound;
15157 struct Expression * exp;
15159 if(stmt->expressions)
15161 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15162 ProcessExpressionType(exp);
15168 struct Expression * exp;
15170 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15171 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15172 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15173 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15175 ProcessExpressionType(exp);
15177 if(stmt->ifStmt.stmt)
15178 ProcessStatement(stmt->ifStmt.stmt);
15179 if(stmt->ifStmt.elseStmt)
15180 ProcessStatement(stmt->ifStmt.elseStmt);
15185 struct Type * oldSwitchType = curSwitchType;
15187 if(stmt->switchStmt.exp)
15189 struct Expression * exp;
15191 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15195 ProcessExpressionType(exp);
15198 curSwitchType = exp->expType;
15201 ProcessStatement(stmt->switchStmt.stmt);
15202 curSwitchType = oldSwitchType;
15207 if(stmt->whileStmt.exp)
15209 struct Expression * exp;
15211 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15212 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15213 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15214 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15216 ProcessExpressionType(exp);
15219 if(stmt->whileStmt.stmt)
15220 ProcessStatement(stmt->whileStmt.stmt);
15225 if(stmt->doWhile.exp)
15227 struct Expression * exp;
15229 if((*stmt->doWhile.exp).last)
15231 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15232 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15233 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15235 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15237 ProcessExpressionType(exp);
15240 if(stmt->doWhile.stmt)
15241 ProcessStatement(stmt->doWhile.stmt);
15246 struct Expression * exp;
15248 if(stmt->forStmt.init)
15249 ProcessStatement(stmt->forStmt.init);
15250 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15252 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15253 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15254 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15256 if(stmt->forStmt.check)
15257 ProcessStatement(stmt->forStmt.check);
15258 if(stmt->forStmt.increment)
15260 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15261 ProcessExpressionType(exp);
15263 if(stmt->forStmt.stmt)
15264 ProcessStatement(stmt->forStmt.stmt);
15269 struct Identifier * id = stmt->forEachStmt.id;
15270 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15271 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15272 struct Statement * block = stmt->forEachStmt.stmt;
15273 char iteratorType[1024];
15274 struct Type * source;
15275 struct Expression * e;
15276 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));
15277 struct Expression * arrayExp;
15278 char * typeString = (((void *)0));
15279 int builtinCount = 0;
15281 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15285 FreeType(e->destType);
15286 e->destType = ProcessTypeString("Container", 0x0);
15288 if(!isBuiltin || e->next)
15289 ProcessExpressionType(e);
15291 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15292 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15294 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15295 struct Symbol * symbol;
15296 struct Expression * expIt = (((void *)0));
15297 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15298 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15299 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15300 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15303 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15304 stmt->compound.context->parent = curContext;
15305 curContext = stmt->compound.context;
15306 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15308 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15309 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15311 isCustomAVLTree = 0x1;
15312 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15314 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15317 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15319 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15321 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15324 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15328 struct Declarator * decl;
15329 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15331 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15332 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15333 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15337 struct Type * type = (((void *)0));
15338 char typeStringBuf[1024];
15340 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15341 if(((struct Expression *)(*exp).last)->type == 11)
15343 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15346 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15348 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)
15350 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15352 typeString = templateClass->templateArgs[2].dataTypeString;
15354 else if(arrayExp->list)
15356 struct Expression * e;
15358 for(e = (*arrayExp->list).first; e; e = e->next)
15360 ProcessExpressionType(e);
15370 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15374 e->expType = (((void *)0));
15375 e = (*arrayExp->list).first;
15376 ProcessExpressionType(e);
15379 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15381 FreeType(e->expType);
15382 e->expType = (((void *)0));
15384 type = (((void *)0));
15392 FreeType(e->expType);
15393 e->expType = (((void *)0));
15399 typeStringBuf[0] = '\0';
15400 PrintType(type, typeStringBuf, 0x0, 0x1);
15401 typeString = typeStringBuf;
15407 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15408 struct Declarator * decl;
15409 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15413 struct Expression * e;
15415 builtinCount = (*arrayExp->list).count;
15416 type = ProcessTypeString(typeString, 0x0);
15417 while(e = (*arrayExp->list).first)
15419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15420 e->destType = type;
15422 ProcessExpressionType(e);
15423 ListAdd(initializers, MkInitializerAssignment(e));
15426 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15428 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15429 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15430 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15431 FreeList(exp, FreeExpression);
15435 arrayExp->expType = ProcessTypeString("Container", 0x0);
15436 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15439 else if(isLinkList && !isList)
15441 struct Declarator * decl;
15442 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15444 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15445 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15446 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15448 else if(_class->templateArgs)
15451 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15453 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15454 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15456 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15457 if(block && block->type == 2 && block->compound.context)
15459 block->compound.context->parent = stmt->compound.context;
15463 block = MkIfStmt(filter, block, (((void *)0)));
15467 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));
15468 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15469 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15470 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15476 sprintf(count, "%d", builtinCount);
15477 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));
15478 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15479 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15480 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15482 else if(isLinkList && !isList)
15484 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15485 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15487 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15489 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));
15493 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15494 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15496 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));
15498 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15499 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15500 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15504 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15506 ProcessExpressionType(expIt);
15507 if((*stmt->compound.declarations).first)
15508 ProcessDeclaration((*stmt->compound.declarations).first);
15510 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15511 ProcessStatement(stmt);
15512 curContext = stmt->compound.context->parent;
15517 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15529 struct Expression * exp;
15531 if(stmt->expressions)
15533 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15537 if(curFunction && !curFunction->type)
15538 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15539 FreeType(exp->destType);
15540 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15542 exp->destType->refCount++;
15544 ProcessExpressionType(exp);
15551 ProcessDeclaration(stmt->decl);
15556 struct AsmField * field;
15558 if(stmt->asmStmt.inputFields)
15560 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15561 if(field->expression)
15562 ProcessExpressionType(field->expression);
15564 if(stmt->asmStmt.outputFields)
15566 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15567 if(field->expression)
15568 ProcessExpressionType(field->expression);
15570 if(stmt->asmStmt.clobberedFields)
15572 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15574 if(field->expression)
15575 ProcessExpressionType(field->expression);
15582 struct PropertyWatch * propWatch;
15583 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15584 struct Expression * object = stmt->_watch.object;
15585 struct Expression * watcher = stmt->_watch.watcher;
15588 ProcessExpressionType(watcher);
15590 ProcessExpressionType(object);
15593 if(watcher || thisClass)
15595 struct External * external = curExternal;
15596 struct Context * context = curContext;
15599 stmt->expressions = MkList();
15600 curExternal = external->prev;
15601 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15603 struct ClassFunction * func;
15604 char watcherName[1024];
15605 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15606 struct External * createdExternal;
15607 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15610 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15611 if(propWatch->deleteWatch)
15612 strcat(watcherName, "_delete");
15615 struct Identifier * propID;
15617 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15619 strcat(watcherName, "_");
15620 strcat(watcherName, propID->string);
15623 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15625 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15626 ProcessClassFunctionBody(func, propWatch->compound);
15627 propWatch->compound = (((void *)0));
15628 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15629 createdExternal->symbol->idCode = external->symbol->idCode;
15630 curExternal = createdExternal;
15631 ProcessFunction(createdExternal->function);
15633 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15635 externalDecl->declaration = decl;
15636 if(decl->symbol && !decl->symbol->pointerExternal)
15637 decl->symbol->pointerExternal = externalDecl;
15639 if(propWatch->deleteWatch)
15641 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15643 ListAdd(args, CopyExpression(object));
15644 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15645 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15646 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15650 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15651 struct Identifier * propID;
15653 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15655 char propName[1024];
15656 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15660 char getName[1024], setName[1024];
15661 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15663 DeclareProperty(prop, setName, getName);
15664 strcpy(propName, "__ecereProp_");
15665 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15666 strcat(propName, "_");
15667 FullClassNameCat(propName, prop->name, 0x1);
15668 ListAdd(args, CopyExpression(object));
15669 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15670 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15671 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15672 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15680 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15682 curExternal = external;
15683 curContext = context;
15685 FreeExpression(watcher);
15687 FreeExpression(object);
15688 FreeList(watches, FreePropertyWatch);
15691 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15695 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15697 ProcessStatement(propWatch->compound);
15704 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15705 struct Expression * object = stmt->_watch.object;
15706 struct __ecereNameSpace__ecere__com__Class * _class;
15709 ProcessExpressionType(object);
15712 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15715 struct Identifier * propID;
15718 stmt->expressions = MkList();
15719 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15721 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15728 for(propID = (*watches).first; propID; propID = propID->next)
15730 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15734 CreateFireWatcher(prop, object, stmt);
15737 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15742 struct __ecereNameSpace__ecere__com__Property * prop;
15743 struct __ecereNameSpace__ecere__com__Class * base;
15745 for(base = _class; base; base = base->base)
15747 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15749 if(prop->isProperty && prop->isWatchable)
15751 CreateFireWatcher(prop, object, stmt);
15757 FreeExpression(object);
15758 FreeList(watches, FreeIdentifier);
15761 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15767 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15768 struct Expression * object = stmt->_watch.object;
15769 struct Expression * watcher = stmt->_watch.watcher;
15770 struct __ecereNameSpace__ecere__com__Class * _class;
15773 ProcessExpressionType(object);
15775 ProcessExpressionType(watcher);
15778 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15779 if(watcher || thisClass)
15783 struct Identifier * propID;
15786 stmt->expressions = MkList();
15789 struct __ecereNameSpace__ecere__sys__OldList * args;
15792 ListAdd(args, CopyExpression(object));
15793 ListAdd(args, MkExpConstant("0"));
15794 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15795 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15799 for(propID = (*watches).first; propID; propID = propID->next)
15801 char propName[1024];
15802 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15806 char getName[1024], setName[1024];
15807 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15809 DeclareProperty(prop, setName, getName);
15810 strcpy(propName, "__ecereProp_");
15811 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15812 strcat(propName, "_");
15813 FullClassNameCat(propName, prop->name, 0x1);
15814 MangleClassName(propName);
15815 ListAdd(args, CopyExpression(object));
15816 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15817 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15818 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15821 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15825 FreeExpression(object);
15827 FreeExpression(watcher);
15828 FreeList(watches, FreeIdentifier);
15831 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15841 extern struct Expression * QBrackets(struct Expression * exp);
15843 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15845 extern struct Declarator * QMkPtrDecl(char * id);
15847 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15849 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15851 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15853 static void ProcessFunction(struct FunctionDefinition * function)
15855 void * __ecereTemp2;
15856 void * __ecereTemp1;
15857 struct Identifier * id = GetDeclId(function->declarator);
15858 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15859 struct Type * type = symbol ? symbol->type : (((void *)0));
15860 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15861 struct Context * oldTopContext = topContext;
15863 yylloc = function->loc;
15864 if(type && type->thisClass)
15866 struct Symbol * classSym = type->thisClass;
15867 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15868 char className[1024];
15869 char structName[1024];
15870 struct Declarator * funcDecl;
15871 struct Symbol * thisSymbol;
15872 unsigned int typedObject = 0x0;
15874 if(_class && !_class->base)
15876 _class = currentClass;
15877 if(_class && !_class->symbol)
15878 _class->symbol = FindClass(_class->fullName);
15879 classSym = _class ? _class->symbol : (((void *)0));
15882 thisClass = _class;
15883 if(inCompiler && _class)
15885 if(type->kind == 11)
15887 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15889 struct Type * param = symbol->type->params.first;
15891 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15894 if(type->classObjectType != 1)
15896 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15897 symbol->type->staticMethod = 0x1;
15898 symbol->type->thisClass = (((void *)0));
15899 symbol->type->extraParam = 0x0;
15902 strcpy(className, "__ecereClass_");
15903 FullClassNameCat(className, _class->fullName, 0x1);
15904 MangleClassName(className);
15905 structName[0] = (char)0;
15906 FullClassNameCat(structName, _class->fullName, 0x0);
15907 funcDecl = GetFuncDecl(function->declarator);
15910 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15912 struct TypeName * param = (*funcDecl->function.parameters).first;
15914 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15917 FreeTypeName(param);
15920 if(!function->propertyNoThis)
15922 struct TypeName * thisParam;
15924 if(type->classObjectType != 1)
15926 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15927 if(!funcDecl->function.parameters)
15928 funcDecl->function.parameters = MkList();
15929 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15933 if(type->classObjectType != 1)
15935 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15936 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15938 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));
15939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15943 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15945 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15947 funcDecl = GetFuncDecl(initDecl->declarator);
15950 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15952 struct TypeName * param = (*funcDecl->function.parameters).first;
15954 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15957 FreeTypeName(param);
15960 if(type->classObjectType != 1)
15962 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15964 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15966 if(!funcDecl->function.parameters)
15967 funcDecl->function.parameters = MkList();
15968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15976 if(type->classObjectType != 1)
15978 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));
15979 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15980 if(typedObject && thisSymbol->type)
15982 thisSymbol->type->classObjectType = 2;
15983 thisSymbol->type->byReference = type->byReference;
15987 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15989 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15992 struct __ecereNameSpace__ecere__com__Class * base;
15994 for(base = _class; base && base->type != 1000; base = base->next)
15996 for(member = base->membersAndProperties.first; member; member = member->next)
15997 if(!member->isProperty)
16003 for(member = _class->membersAndProperties.first; member; member = member->next)
16004 if(!member->isProperty)
16008 char pointerName[1024];
16009 struct Declaration * decl;
16010 struct Initializer * initializer;
16011 struct Expression * exp, * bytePtr;
16013 strcpy(pointerName, "__ecerePointer_");
16014 FullClassNameCat(pointerName, _class->fullName, 0x0);
16016 char className[1024];
16018 strcpy(className, "__ecereClass_");
16019 FullClassNameCat(className, classSym->string, 0x1);
16020 MangleClassName(className);
16021 DeclareClass(classSym, className);
16023 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16028 sprintf(string, "%d", _class->offset);
16029 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16033 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16035 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16036 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));
16039 yylloc = function->body->loc;
16040 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16042 struct Context * prevContext = curContext;
16044 curContext = function->body->compound.context;
16045 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16046 curContext = prevContext;
16048 decl->symbol = (((void *)0));
16049 if(!function->body->compound.declarations)
16050 function->body->compound.declarations = MkList();
16051 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16057 thisClass = (((void *)0));
16060 FreeSpecifier(id->_class);
16061 id->_class = (((void *)0));
16062 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16064 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16066 id = GetDeclId(initDecl->declarator);
16067 FreeSpecifier(id->_class);
16068 id->_class = (((void *)0));
16072 topContext = function->body->compound.context;
16074 struct FunctionDefinition * oldFunction = curFunction;
16076 curFunction = function;
16078 ProcessStatement(function->body);
16079 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16081 struct Statement * prevCompound = curCompound;
16082 struct Context * prevContext = curContext;
16083 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16085 if(!function->body->compound.statements)
16086 function->body->compound.statements = MkList();
16087 ListAdd(function->body->compound.statements, fireWatchers);
16088 curCompound = function->body;
16089 curContext = function->body->compound.context;
16090 ProcessStatement(fireWatchers);
16091 curContext = prevContext;
16092 curCompound = prevCompound;
16094 curFunction = oldFunction;
16096 if(function->declarator)
16098 ProcessDeclarator(function->declarator);
16100 topContext = oldTopContext;
16101 thisClass = oldThisClass;
16104 extern void FreeSymbol(struct Symbol * symbol);
16106 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16108 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16110 struct ClassDef * def;
16111 struct External * external = curExternal;
16112 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16114 for(def = definitions->first; def; def = def->next)
16118 if(def->function->declarator)
16119 curExternal = def->function->declarator->symbol->pointerExternal;
16121 curExternal = external;
16122 ProcessFunction((struct FunctionDefinition *)def->function);
16124 else if(def->type == 2)
16126 if(def->decl->type == 2)
16128 thisClass = regClass;
16129 ProcessInstantiationType(def->decl->inst);
16130 thisClass = (((void *)0));
16134 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16137 thisClass = regClass;
16138 ProcessDeclaration(def->decl);
16139 thisClass = backThisClass;
16142 else if(def->type == 1 && def->defProperties)
16144 struct MemberInit * defProperty;
16145 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);
16147 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16148 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16150 thisClass = regClass;
16151 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16152 thisClass = (((void *)0));
16154 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16155 FreeSymbol(thisSymbol);
16157 else if(def->type == 3 && def->propertyDef)
16159 struct PropertyDef * prop = def->propertyDef;
16161 thisClass = regClass;
16166 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16168 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16170 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16171 ProcessStatement(prop->setStmt);
16177 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16179 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16181 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16182 ProcessStatement(prop->getStmt);
16184 if(prop->issetStmt)
16188 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16190 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16192 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16193 ProcessStatement(prop->issetStmt);
16195 thisClass = (((void *)0));
16197 else if(def->type == 4 && def->propertyWatch)
16199 struct PropertyWatch * propertyWatch = def->propertyWatch;
16201 thisClass = regClass;
16202 if(propertyWatch->compound)
16204 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);
16206 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16207 curExternal = (((void *)0));
16208 ProcessStatement(propertyWatch->compound);
16210 thisClass = (((void *)0));
16215 void DeclareFunctionUtil(char * s)
16217 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16224 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16225 strcpy(name, "__ecereFunction_");
16226 FullClassNameCat(name, s, 0x0);
16227 DeclareFunction(function, name);
16231 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16233 void ComputeDataTypes()
16235 void * __ecereTemp1;
16236 struct External * external;
16237 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16238 struct External * after = (((void *)0));
16240 currentClass = (((void *)0));
16241 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16242 for(external = (*ast).first; external; external = external->next)
16244 if(external->type == 1)
16246 struct Declaration * decl = external->declaration;
16250 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16254 struct InitDeclarator * initDecl = (*decls).first;
16258 struct Declarator * declarator = initDecl->declarator;
16260 if(declarator && declarator->type == 1)
16262 struct Identifier * id = declarator->identifier;
16264 if(id && id->string)
16266 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t"))
16268 external->symbol->id = -1001, external->symbol->idCode = -1001;
16278 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16280 curExternal = temp;
16281 DeclareFunctionUtil("eSystem_New");
16282 DeclareFunctionUtil("eSystem_New0");
16283 DeclareFunctionUtil("eSystem_Renew");
16284 DeclareFunctionUtil("eSystem_Renew0");
16285 DeclareFunctionUtil("eClass_GetProperty");
16286 DeclareStruct("ecere::com::Class", 0x0);
16287 DeclareStruct("ecere::com::Instance", 0x0);
16288 DeclareStruct("ecere::com::Property", 0x0);
16289 DeclareStruct("ecere::com::DataMember", 0x0);
16290 DeclareStruct("ecere::com::Method", 0x0);
16291 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16292 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16294 for(external = (*ast).first; external; external = external->next)
16296 afterExternal = curExternal = external;
16297 if(external->type == 0)
16299 currentClass = external->function->_class;
16300 ProcessFunction(external->function);
16302 else if(external->type == 1)
16304 currentClass = (((void *)0));
16305 ProcessDeclaration(external->declaration);
16307 else if(external->type == 2)
16309 struct ClassDefinition * _class = external->_class;
16311 currentClass = external->symbol->registered;
16312 if(_class->definitions)
16314 ProcessClass(_class->definitions, _class->symbol);
16318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16319 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16322 else if(external->type == 4)
16324 thisNameSpace = external->id->string;
16327 currentClass = (((void *)0));
16328 thisNameSpace = (((void *)0));
16329 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16330 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16333 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);
16335 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);
16337 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16339 struct __ecereNameSpace__ecere__com__Class * class;
16341 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16342 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16343 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16344 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16345 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16346 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16347 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16348 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16349 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16350 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16351 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16352 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16353 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16354 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16355 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16356 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16357 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16358 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16359 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16360 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16361 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16362 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16363 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16364 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16365 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16366 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16367 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16368 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16369 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16370 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16371 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16372 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16373 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16374 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
16375 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16378 __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);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16391 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16392 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16393 __ecereClass_Conversion = class;
16394 __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);
16395 __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);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16397 __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);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16417 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)