2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
16 typedef long long int64;
17 typedef unsigned long long uint64;
19 typedef __int64 int64;
20 typedef unsigned __int64 uint64;
23 #define __ENDIAN_PAD(x) (8 - (x))
25 #define __ENDIAN_PAD(x) 0
28 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
30 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
32 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
34 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
36 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
38 struct __ecereNameSpace__ecere__sys__BTNode;
40 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
42 struct __ecereNameSpace__ecere__sys__BinaryTree
44 struct __ecereNameSpace__ecere__sys__BTNode * root;
46 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
47 void (* FreeKey)(void * key);
48 } __attribute__ ((gcc_struct));
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
52 struct __ecereNameSpace__ecere__sys__OldList
59 } __attribute__ ((gcc_struct));
61 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
63 struct __ecereNameSpace__ecere__com__Method
66 struct __ecereNameSpace__ecere__com__Method * parent;
67 struct __ecereNameSpace__ecere__com__Method * left;
68 struct __ecereNameSpace__ecere__com__Method * right;
73 struct __ecereNameSpace__ecere__com__Class * _class;
75 char * dataTypeString;
76 struct Type * dataType;
78 } __attribute__ ((gcc_struct));
80 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
82 struct __ecereNameSpace__ecere__com__Property
84 struct __ecereNameSpace__ecere__com__Property * prev;
85 struct __ecereNameSpace__ecere__com__Property * next;
87 unsigned int isProperty;
90 struct __ecereNameSpace__ecere__com__Class * _class;
91 char * dataTypeString;
92 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
93 struct Type * dataType;
96 unsigned int (* IsSet)();
100 unsigned int conversion;
101 unsigned int watcherOffset;
103 unsigned int compiled;
104 unsigned int selfWatchable;
105 unsigned int isWatchable;
106 } __attribute__ ((gcc_struct));
108 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
115 unsigned int included;
116 } __attribute__ ((gcc_struct));
118 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
122 struct CodePosition start;
123 struct CodePosition end;
124 } __attribute__ ((gcc_struct));
126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
130 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
139 struct Attrib * attr;
140 } __attribute__ ((gcc_struct));
141 } __attribute__ ((gcc_struct));
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
145 struct ClassDefinition
147 struct ClassDefinition * prev;
148 struct ClassDefinition * next;
150 struct Specifier * _class;
151 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
152 struct __ecereNameSpace__ecere__sys__OldList * definitions;
153 struct Symbol * symbol;
154 struct Location blockStart;
155 struct Location nameLoc;
158 unsigned int deleteWatchable;
159 } __attribute__ ((gcc_struct));
161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
165 struct Context * parent;
166 struct __ecereNameSpace__ecere__sys__BinaryTree types;
167 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
168 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
169 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
172 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
173 struct ClassDefinition * classDef;
174 unsigned int templateTypesOnly;
175 unsigned int hasNameSpace;
176 } __attribute__ ((gcc_struct));
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
182 struct Instantiation * prev;
183 struct Instantiation * next;
185 struct Specifier * _class;
186 struct Expression * exp;
187 struct __ecereNameSpace__ecere__sys__OldList * members;
188 struct Symbol * symbol;
189 unsigned int fullSet;
190 unsigned int isConstant;
191 unsigned char * data;
192 struct Location nameLoc;
193 struct Location insideLoc;
195 } __attribute__ ((gcc_struct));
197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
201 struct Declaration * prev;
202 struct Declaration * next;
209 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
210 struct __ecereNameSpace__ecere__sys__OldList * declarators;
211 } __attribute__ ((gcc_struct));
212 struct Instantiation * inst;
215 struct Identifier * id;
216 struct Expression * exp;
217 } __attribute__ ((gcc_struct));
218 } __attribute__ ((gcc_struct));
219 struct Specifier * extStorage;
220 struct Symbol * symbol;
222 } __attribute__ ((gcc_struct));
224 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
228 struct Statement * prev;
229 struct Statement * next;
234 struct __ecereNameSpace__ecere__sys__OldList * expressions;
237 struct Identifier * id;
238 struct Statement * stmt;
239 } __attribute__ ((gcc_struct)) labeled;
242 struct Expression * exp;
243 struct Statement * stmt;
244 } __attribute__ ((gcc_struct)) caseStmt;
247 struct __ecereNameSpace__ecere__sys__OldList * declarations;
248 struct __ecereNameSpace__ecere__sys__OldList * statements;
249 struct Context * context;
250 unsigned int isSwitch;
251 } __attribute__ ((gcc_struct)) compound;
254 struct __ecereNameSpace__ecere__sys__OldList * exp;
255 struct Statement * stmt;
256 struct Statement * elseStmt;
257 } __attribute__ ((gcc_struct)) ifStmt;
260 struct __ecereNameSpace__ecere__sys__OldList * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) switchStmt;
265 struct __ecereNameSpace__ecere__sys__OldList * exp;
266 struct Statement * stmt;
267 } __attribute__ ((gcc_struct)) whileStmt;
270 struct __ecereNameSpace__ecere__sys__OldList * exp;
271 struct Statement * stmt;
272 } __attribute__ ((gcc_struct)) doWhile;
275 struct Statement * init;
276 struct Statement * check;
277 struct __ecereNameSpace__ecere__sys__OldList * increment;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) forStmt;
282 struct Identifier * id;
283 } __attribute__ ((gcc_struct)) gotoStmt;
286 struct Specifier * spec;
288 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
289 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
290 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
291 } __attribute__ ((gcc_struct)) asmStmt;
294 struct Expression * watcher;
295 struct Expression * object;
296 struct __ecereNameSpace__ecere__sys__OldList * watches;
297 } __attribute__ ((gcc_struct)) _watch;
300 struct Identifier * id;
301 struct __ecereNameSpace__ecere__sys__OldList * exp;
302 struct __ecereNameSpace__ecere__sys__OldList * filter;
303 struct Statement * stmt;
304 } __attribute__ ((gcc_struct)) forEachStmt;
305 struct Declaration * decl;
306 } __attribute__ ((gcc_struct));
307 } __attribute__ ((gcc_struct));
309 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
313 struct TypeName * prev;
314 struct TypeName * next;
316 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
317 struct Declarator * declarator;
319 struct Expression * bitCount;
320 } __attribute__ ((gcc_struct));
322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
326 struct Initializer * prev;
327 struct Initializer * next;
332 struct Expression * exp;
333 struct __ecereNameSpace__ecere__sys__OldList * list;
334 } __attribute__ ((gcc_struct));
335 unsigned int isConstant;
336 } __attribute__ ((gcc_struct));
338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
340 struct __ecereNameSpace__ecere__com__DataValue
355 } __attribute__ ((gcc_struct));
356 } __attribute__ ((gcc_struct));
358 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
362 struct Expression * prev;
363 struct Expression * next;
371 struct Identifier * identifier;
372 } __attribute__ ((gcc_struct));
373 struct Statement * compound;
374 struct Instantiation * instance;
376 struct __ecereNameSpace__ecere__sys__OldList * list;
379 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
380 struct Declarator * decl;
381 } __attribute__ ((gcc_struct)) _classExp;
384 struct Identifier * id;
385 } __attribute__ ((gcc_struct)) classData;
388 struct Expression * exp;
389 struct __ecereNameSpace__ecere__sys__OldList * arguments;
390 struct Location argLoc;
391 } __attribute__ ((gcc_struct)) call;
394 struct Expression * exp;
395 struct __ecereNameSpace__ecere__sys__OldList * index;
396 } __attribute__ ((gcc_struct)) index;
399 struct Expression * exp;
400 struct Identifier * member;
402 unsigned int thisPtr;
403 } __attribute__ ((gcc_struct)) member;
407 struct Expression * exp1;
408 struct Expression * exp2;
409 } __attribute__ ((gcc_struct)) op;
410 struct TypeName * typeName;
411 struct Specifier * _class;
414 struct TypeName * typeName;
415 struct Expression * exp;
416 } __attribute__ ((gcc_struct)) cast;
419 struct Expression * cond;
420 struct __ecereNameSpace__ecere__sys__OldList * exp;
421 struct Expression * elseExp;
422 } __attribute__ ((gcc_struct)) cond;
425 struct TypeName * typeName;
426 struct Expression * size;
427 } __attribute__ ((gcc_struct)) _new;
430 struct TypeName * typeName;
431 struct Expression * size;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) _renew;
437 struct Identifier * id;
438 } __attribute__ ((gcc_struct)) db;
441 struct Expression * ds;
442 struct Expression * name;
443 } __attribute__ ((gcc_struct)) dbopen;
446 struct TypeName * typeName;
447 struct Initializer * initializer;
448 } __attribute__ ((gcc_struct)) initializer;
451 struct Expression * exp;
452 struct TypeName * typeName;
453 } __attribute__ ((gcc_struct)) vaArg;
454 } __attribute__ ((gcc_struct));
455 unsigned int debugValue;
456 struct __ecereNameSpace__ecere__com__DataValue val;
457 unsigned int address;
458 unsigned int hasAddress;
459 struct Type * expType;
460 struct Type * destType;
463 unsigned int byReference;
464 unsigned int isConstant;
465 unsigned int addedThis;
466 unsigned int needCast;
467 unsigned int thisPtr;
468 } __attribute__ ((gcc_struct));
470 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
472 struct TemplateDatatype
474 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
475 struct Declarator * decl;
476 } __attribute__ ((gcc_struct));
478 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
480 struct TemplateArgument;
482 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
484 struct TemplateParameter
486 struct TemplateParameter * prev;
487 struct TemplateParameter * next;
490 struct Identifier * identifier;
493 struct TemplateDatatype * dataType;
495 } __attribute__ ((gcc_struct));
496 struct TemplateArgument * defaultArgument;
497 char * dataTypeString;
498 struct Type * baseType;
499 } __attribute__ ((gcc_struct));
501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
505 struct Specifier * prev;
506 struct Specifier * next;
514 struct ExtDecl * extDecl;
516 struct Symbol * symbol;
517 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
518 } __attribute__ ((gcc_struct));
521 struct Identifier * id;
522 struct __ecereNameSpace__ecere__sys__OldList * list;
523 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
524 struct __ecereNameSpace__ecere__sys__OldList * definitions;
525 unsigned int addNameSpace;
526 struct Context * ctx;
527 } __attribute__ ((gcc_struct));
528 struct Expression * expression;
529 struct Specifier * _class;
530 struct TemplateParameter * templateParameter;
531 } __attribute__ ((gcc_struct));
532 } __attribute__ ((gcc_struct));
534 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
538 struct Identifier * prev;
539 struct Identifier * next;
541 struct Symbol * classSym;
542 struct Specifier * _class;
544 struct Identifier * badID;
545 } __attribute__ ((gcc_struct));
547 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
555 struct Declarator * prev;
556 struct Declarator * next;
559 struct Symbol * symbol;
560 struct Declarator * declarator;
563 struct Identifier * identifier;
566 struct Expression * exp;
567 struct Expression * posExp;
568 struct Attrib * attrib;
569 } __attribute__ ((gcc_struct)) structDecl;
572 struct Expression * exp;
573 struct Specifier * enumClass;
574 } __attribute__ ((gcc_struct)) array;
577 struct __ecereNameSpace__ecere__sys__OldList * parameters;
578 } __attribute__ ((gcc_struct)) function;
581 struct Pointer * pointer;
582 } __attribute__ ((gcc_struct)) pointer;
585 struct ExtDecl * extended;
586 } __attribute__ ((gcc_struct)) extended;
587 } __attribute__ ((gcc_struct));
588 } __attribute__ ((gcc_struct));
590 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
592 struct FunctionDefinition
594 struct FunctionDefinition * prev;
595 struct FunctionDefinition * next;
597 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
598 struct Declarator * declarator;
599 struct __ecereNameSpace__ecere__sys__OldList * declarations;
600 struct Statement * body;
601 struct __ecereNameSpace__ecere__com__Class * _class;
602 struct __ecereNameSpace__ecere__sys__OldList attached;
605 struct Symbol * propSet;
607 unsigned int propertyNoThis;
608 } __attribute__ ((gcc_struct));
610 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
618 struct External * prev;
619 struct External * next;
622 struct Symbol * symbol;
625 struct FunctionDefinition * function;
626 struct ClassDefinition * _class;
627 struct Declaration * declaration;
629 struct Identifier * id;
630 struct DBTableDef * table;
631 } __attribute__ ((gcc_struct));
633 } __attribute__ ((gcc_struct));
635 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
639 struct ModuleImport * prev;
640 struct ModuleImport * next;
642 struct __ecereNameSpace__ecere__sys__OldList classes;
643 struct __ecereNameSpace__ecere__sys__OldList functions;
646 } __attribute__ ((gcc_struct));
648 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
652 struct ClassImport * prev;
653 struct ClassImport * next;
655 struct __ecereNameSpace__ecere__sys__OldList methods;
656 struct __ecereNameSpace__ecere__sys__OldList properties;
658 unsigned int isRemote;
659 } __attribute__ ((gcc_struct));
661 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
666 struct Symbol * parent;
667 struct Symbol * left;
668 struct Symbol * right;
673 struct __ecereNameSpace__ecere__com__Method * method;
674 struct __ecereNameSpace__ecere__com__Property * _property;
675 struct __ecereNameSpace__ecere__com__Class * registered;
676 } __attribute__ ((gcc_struct));
683 struct External * pointerExternal;
684 struct External * structExternal;
685 } __attribute__ ((gcc_struct));
688 struct External * externalGet;
689 struct External * externalSet;
690 struct External * externalPtr;
691 struct External * externalIsSet;
692 } __attribute__ ((gcc_struct));
695 struct External * methodExternal;
696 struct External * methodCodeExternal;
697 } __attribute__ ((gcc_struct));
698 } __attribute__ ((gcc_struct));
699 unsigned int imported;
700 unsigned int declaredStructSym;
701 struct __ecereNameSpace__ecere__com__Class * _class;
702 unsigned int declaredStruct;
703 unsigned int needConstructor;
704 unsigned int needDestructor;
705 char * constructorName;
708 char * destructorName;
709 struct ModuleImport * module;
710 struct ClassImport * _import;
711 struct Location nameLoc;
712 unsigned int isParam;
713 unsigned int isRemote;
714 unsigned int isStruct;
715 unsigned int fireWatchersDone;
717 unsigned int classData;
718 unsigned int isStatic;
720 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
721 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
722 struct Context * ctx;
724 struct Expression * propCategory;
725 } __attribute__ ((gcc_struct));
727 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
736 struct Symbol * _class;
739 struct __ecereNameSpace__ecere__sys__OldList members;
741 } __attribute__ ((gcc_struct));
744 struct Type * returnType;
745 struct __ecereNameSpace__ecere__sys__OldList params;
746 struct Symbol * thisClass;
747 unsigned int staticMethod;
748 struct TemplateParameter * thisClassTemplate;
749 } __attribute__ ((gcc_struct));
752 struct __ecereNameSpace__ecere__com__Method * method;
753 struct __ecereNameSpace__ecere__com__Class * methodClass;
754 struct __ecereNameSpace__ecere__com__Class * usedClass;
755 } __attribute__ ((gcc_struct));
758 struct Type * arrayType;
760 struct Expression * arraySizeExp;
761 unsigned int freeExp;
762 struct Symbol * enumClass;
763 } __attribute__ ((gcc_struct));
765 struct TemplateParameter * templateParameter;
766 } __attribute__ ((gcc_struct));
767 unsigned int isSigned;
769 unsigned int constant;
776 unsigned int byReference;
777 unsigned int extraParam;
779 unsigned int directClassAccess;
780 unsigned int computing;
781 unsigned int dllExport;
783 unsigned int keepCast;
784 unsigned int passAsTemplate;
786 } __attribute__ ((gcc_struct));
788 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
790 struct __ecereNameSpace__ecere__com__Class
792 struct __ecereNameSpace__ecere__com__Class * prev;
793 struct __ecereNameSpace__ecere__com__Class * next;
799 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
800 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
803 struct __ecereNameSpace__ecere__com__Class * base;
804 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
805 struct __ecereNameSpace__ecere__sys__BinaryTree members;
806 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
807 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
808 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
809 struct __ecereNameSpace__ecere__sys__OldList derivatives;
813 struct __ecereNameSpace__ecere__com__Instance * module;
814 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
815 char * dataTypeString;
816 struct Type * dataType;
818 int defaultAlignment;
819 void (* Initialize)();
821 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
822 char * designerClass;
823 unsigned int noExpansion;
824 char * defaultProperty;
825 unsigned int comRedefinition;
827 unsigned int isRemote;
828 unsigned int internalDecl;
830 unsigned int computeSize;
832 int destructionWatchOffset;
834 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
835 int inheritanceAccess;
838 struct __ecereNameSpace__ecere__sys__OldList conversions;
839 struct __ecereNameSpace__ecere__sys__OldList templateParams;
840 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
841 struct __ecereNameSpace__ecere__com__Class * templateClass;
842 struct __ecereNameSpace__ecere__sys__OldList templatized;
844 } __attribute__ ((gcc_struct));
846 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
848 struct __ecereNameSpace__ecere__com__Instance
851 struct __ecereNameSpace__ecere__com__Class * _class;
853 } __attribute__ ((gcc_struct));
855 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
857 struct __ecereNameSpace__ecere__com__DataMember
859 struct __ecereNameSpace__ecere__com__DataMember * prev;
860 struct __ecereNameSpace__ecere__com__DataMember * next;
862 unsigned int isProperty;
865 struct __ecereNameSpace__ecere__com__Class * _class;
866 char * dataTypeString;
867 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
868 struct Type * dataType;
872 struct __ecereNameSpace__ecere__sys__OldList members;
873 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
876 } __attribute__ ((gcc_struct));
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
880 struct __ecereNameSpace__ecere__com__SerialBuffer
882 unsigned char * _buffer;
886 } __attribute__ ((gcc_struct));
888 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
890 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
896 char * dataTypeString;
897 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
898 } __attribute__ ((gcc_struct));
899 struct __ecereNameSpace__ecere__com__DataValue expression;
905 struct __ecereNameSpace__ecere__com__DataMember * member;
906 struct __ecereNameSpace__ecere__com__Property * prop;
907 struct __ecereNameSpace__ecere__com__Method * method;
908 } __attribute__ ((gcc_struct));
909 } __attribute__ ((gcc_struct));
910 } __attribute__ ((gcc_struct));
911 } __attribute__ ((gcc_struct));
913 typedef unsigned int size_t;
915 void exit(int status);
917 void * calloc(size_t nmemb, size_t size);
919 void free(void * ptr);
921 void * malloc(size_t size);
923 void * realloc(void * ptr, size_t size);
925 long int strtol(const char * nptr, char ** endptr, int base);
927 long long int strtoll(const char * nptr, char ** endptr, int base);
929 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
933 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
936 typedef union YYSTYPE
941 struct Identifier * id;
942 struct Expression * exp;
943 struct Specifier * specifier;
944 struct __ecereNameSpace__ecere__sys__OldList * list;
945 struct Enumerator * enumerator;
946 struct Declarator * declarator;
947 struct Pointer * pointer;
948 struct Initializer * initializer;
949 struct InitDeclarator * initDeclarator;
950 struct TypeName * typeName;
951 struct Declaration * declaration;
952 struct Statement * stmt;
953 struct FunctionDefinition * function;
954 struct External * external;
955 struct Context * context;
956 struct AsmField * asmField;
957 struct Attrib * attrib;
958 struct ExtDecl * extDecl;
959 struct Attribute * attribute;
960 struct Instantiation * instance;
961 struct MembersInit * membersInit;
962 struct MemberInit * memberInit;
963 struct ClassFunction * classFunction;
964 struct ClassDefinition * _class;
965 struct ClassDef * classDef;
966 struct PropertyDef * prop;
968 struct Symbol * symbol;
969 struct PropertyWatch * propertyWatch;
970 struct TemplateParameter * templateParameter;
971 struct TemplateArgument * templateArgument;
972 struct TemplateDatatype * templateDatatype;
973 struct DBTableEntry * dbtableEntry;
974 struct DBIndexItem * dbindexItem;
975 struct DBTableDef * dbtableDef;
976 } __attribute__ ((gcc_struct)) YYSTYPE;
978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
982 struct Enumerator * prev;
983 struct Enumerator * next;
985 struct Identifier * id;
986 struct Expression * exp;
987 } __attribute__ ((gcc_struct));
989 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
991 struct InitDeclarator
993 struct InitDeclarator * prev;
994 struct InitDeclarator * next;
996 struct Declarator * declarator;
997 struct Initializer * initializer;
998 } __attribute__ ((gcc_struct));
1000 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1004 struct AsmField * prev;
1005 struct AsmField * next;
1006 struct Location loc;
1008 struct Expression * expression;
1009 } __attribute__ ((gcc_struct));
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1015 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1017 struct ClassFunction
1019 struct ClassFunction * prev;
1020 struct ClassFunction * next;
1021 struct Location loc;
1022 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1023 struct Declarator * declarator;
1024 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1025 struct Statement * body;
1026 struct __ecereNameSpace__ecere__com__Class * _class;
1027 struct __ecereNameSpace__ecere__sys__OldList attached;
1030 struct Symbol * propSet;
1031 unsigned int isVirtual;
1032 unsigned int isConstructor;
1033 unsigned int isDestructor;
1034 unsigned int dontMangle;
1037 } __attribute__ ((gcc_struct));
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1043 struct MembersInit * prev;
1044 struct MembersInit * next;
1045 struct Location loc;
1049 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1050 struct ClassFunction * function;
1051 } __attribute__ ((gcc_struct));
1052 } __attribute__ ((gcc_struct));
1054 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1058 struct MemberInit * prev;
1059 struct MemberInit * next;
1060 struct Location loc;
1061 struct Location realLoc;
1062 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1063 struct Initializer * initializer;
1065 unsigned int variable;
1066 unsigned int takeOutExp;
1067 } __attribute__ ((gcc_struct));
1069 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1073 struct PropertyDef * prev;
1074 struct PropertyDef * next;
1075 struct Location loc;
1076 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1077 struct Declarator * declarator;
1078 struct Identifier * id;
1079 struct Statement * getStmt;
1080 struct Statement * setStmt;
1081 struct Statement * issetStmt;
1082 struct Symbol * symbol;
1083 unsigned int conversion;
1084 unsigned int isWatchable;
1085 struct Expression * category;
1086 } __attribute__ ((gcc_struct));
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1090 struct PropertyWatch
1092 struct PropertyWatch * prev;
1093 struct PropertyWatch * next;
1094 struct Location loc;
1095 struct Statement * compound;
1096 struct __ecereNameSpace__ecere__sys__OldList * properties;
1097 unsigned int deleteWatch;
1098 } __attribute__ ((gcc_struct));
1100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1104 struct ClassDef * prev;
1105 struct ClassDef * next;
1106 struct Location loc;
1110 struct Declaration * decl;
1111 struct ClassFunction * function;
1112 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1113 struct PropertyDef * propertyDef;
1114 struct PropertyWatch * propertyWatch;
1116 struct Identifier * defaultProperty;
1119 struct Identifier * id;
1120 struct Initializer * initializer;
1121 } __attribute__ ((gcc_struct));
1122 } __attribute__ ((gcc_struct));
1125 } __attribute__ ((gcc_struct));
1127 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1129 struct DBTableEntry;
1131 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1135 extern YYSTYPE yylval;
1137 extern struct Location yylloc;
1139 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1141 extern int returnCode;
1143 extern struct Expression * parsedExpression;
1145 extern unsigned int yydebug;
1147 void SetYydebug(unsigned int b)
1152 extern unsigned int echoOn;
1154 void resetScanner();
1158 int expression_yyparse();
1160 static struct Statement * curCompound;
1162 struct External * curExternal, * afterExternal;
1164 static struct Type * curSwitchType;
1166 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1168 struct __ecereNameSpace__ecere__com__Class * thisClass;
1170 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1175 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1180 static char * thisNameSpace;
1182 struct __ecereNameSpace__ecere__com__Class * containerClass;
1184 unsigned int thisClassParams = 0x1;
1186 unsigned int internalValueCounter;
1188 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1190 struct __ecereNameSpace__ecere__sys__TempFile
1192 char __ecere_padding[24];
1193 } __attribute__ ((gcc_struct));
1195 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1197 extern int strlen(const char * );
1199 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1201 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1203 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1205 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1207 void PrintExpression(struct Expression * exp, char * string)
1210 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1214 OutputExpression(exp, f);
1215 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1216 count = strlen(string);
1217 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);
1218 string[count] = '\0';
1219 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1223 extern int isspace(int c);
1225 long long _strtoi64(char * string, char ** endString, int base)
1227 long long value = 0;
1232 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1244 if(ch == (char)0 && string[c + 1] == 'x')
1257 for(; (ch = string[c]); c++)
1261 else if(ch >= '1' && ch <= '9')
1263 else if(ch >= 'a' && ch <= 'z')
1265 else if(ch >= 'A' && ch <= 'Z')
1270 *endString = string + c;
1281 *endString = string + c;
1285 return sign * value;
1288 uint64 _strtoui64(char * string, char ** endString, int base)
1295 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1307 if(ch == (char)0 && string[c + 1] == 'x')
1320 for(; (ch = string[c]); c++)
1324 else if(ch >= '1' && ch <= '9')
1326 else if(ch >= 'a' && ch <= 'z')
1328 else if(ch >= 'A' && ch <= 'Z')
1333 *endString = string + c;
1344 *endString = string + c;
1348 return sign * value;
1351 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1353 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1355 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1357 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1359 if(!param->baseType)
1361 if(param->dataTypeString)
1362 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1364 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1366 return param->baseType;
1368 return (((void *)0));
1371 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1373 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1375 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1379 if(type1->kind == type2->kind)
1388 if(type1->passAsTemplate && !type2->passAsTemplate)
1390 return type1->isSigned != type2->isSigned;
1392 return type1->_class != type2->_class;
1394 return NeedCast(type1->type, type2->type);
1402 extern int strcmp(const char * , const char * );
1404 extern struct Context * curContext;
1406 extern struct Context * topContext;
1408 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1410 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);
1412 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1414 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);
1416 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);
1418 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1420 struct __ecereNameSpace__ecere__com__ClassProperty
1423 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1424 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1425 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1427 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1428 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1429 char * dataTypeString;
1430 struct Type * dataType;
1431 unsigned int constant;
1432 } __attribute__ ((gcc_struct));
1434 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1436 extern struct Expression * QMkExpId(char * id);
1438 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1440 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1442 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1443 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1448 char * dataTypeString;
1450 } __attribute__ ((gcc_struct));
1451 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1453 char __ecere_padding[4];
1454 } __attribute__ ((gcc_struct));
1456 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1458 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1460 extern void FreeIdentifier(struct Identifier * id);
1462 void ProcessExpressionType(struct Expression * exp);
1464 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1466 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1468 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1470 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1472 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1474 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1476 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1478 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1480 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1482 if(exp->type == 0 && exp->identifier)
1484 struct Identifier * id = exp->identifier;
1485 struct Context * ctx;
1486 struct Symbol * symbol = (((void *)0));
1488 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1490 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1492 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1497 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1499 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1500 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1501 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1502 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1506 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1508 if(!prop && !method)
1509 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1510 if(!prop && !method && !member)
1512 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1514 if(prop || method || member || classProp)
1517 exp->member.member = id;
1518 exp->member.memberType = 0;
1519 exp->member.exp = QMkExpId("this");
1520 exp->addedThis = 0x1;
1522 else if(_class && _class->templateParams.first)
1524 struct __ecereNameSpace__ecere__com__Class * sClass;
1526 for(sClass = _class; sClass; sClass = sClass->base)
1528 if(sClass->templateParams.first)
1530 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1532 for(param = sClass->templateParams.first; param; param = param->next)
1534 if(param->type == 2 && !strcmp(param->name, id->string))
1536 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1540 struct Declarator * decl;
1541 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1543 FreeIdentifier(exp->member.member);
1544 ProcessExpressionType(argExp);
1545 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1546 exp->expType = ProcessType(specs, decl);
1548 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1559 extern int sprintf(char * , char * , ...);
1561 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1563 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1565 char * PrintInt(long long result)
1569 if(result > (((long long)0x7fffffffffffffffLL)))
1570 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1572 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 char * PrintUInt(uint64 result)
1580 if(result > (0xffffffff))
1581 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1582 else if(result > (((int)0x7fffffff)))
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1589 char * PrintInt64(long long result)
1593 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1597 char * PrintUInt64(uint64 result)
1601 if(result > (((long long)0x7fffffffffffffffLL)))
1602 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1604 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1605 return __ecereNameSpace__ecere__sys__CopyString(temp);
1608 char * PrintHexUInt(uint64 result)
1612 if(result > (0xffffffff))
1613 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1615 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1616 return __ecereNameSpace__ecere__sys__CopyString(temp);
1619 char * PrintHexUInt64(uint64 result)
1623 if(result > (0xffffffff))
1624 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1626 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1627 return __ecereNameSpace__ecere__sys__CopyString(temp);
1630 char * PrintShort(short result)
1634 sprintf(temp, "%d", (unsigned short)result);
1635 return __ecereNameSpace__ecere__sys__CopyString(temp);
1638 char * PrintUShort(unsigned short result)
1642 if(result > (unsigned short)32767)
1643 sprintf(temp, "0x%X", (int)result);
1645 sprintf(temp, "%d", result);
1646 return __ecereNameSpace__ecere__sys__CopyString(temp);
1649 extern int isprint(int c);
1651 char * PrintChar(char result)
1655 if(result > (char)0 && isprint(result))
1656 sprintf(temp, "'%c'", result);
1657 else if(result < (char)0)
1658 sprintf(temp, "%d", result);
1660 sprintf(temp, "0x%X", (unsigned char)result);
1661 return __ecereNameSpace__ecere__sys__CopyString(temp);
1664 char * PrintUChar(unsigned char result)
1668 sprintf(temp, "0x%X", result);
1669 return __ecereNameSpace__ecere__sys__CopyString(temp);
1672 char * PrintFloat(float result)
1676 sprintf(temp, "%.16ff", result);
1677 return __ecereNameSpace__ecere__sys__CopyString(temp);
1680 char * PrintDouble(double result)
1684 sprintf(temp, "%.16f", result);
1685 return __ecereNameSpace__ecere__sys__CopyString(temp);
1688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1692 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1693 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1694 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1695 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1696 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1697 unsigned int (* Neg)(struct Expression *, struct Operand *);
1698 unsigned int (* Inc)(struct Expression *, struct Operand *);
1699 unsigned int (* Dec)(struct Expression *, struct Operand *);
1700 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1701 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1702 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1703 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1704 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1705 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1706 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1707 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1708 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1712 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1714 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1715 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1716 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* Not)(struct Expression *, struct Operand *);
1718 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1725 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1727 } __attribute__ ((gcc_struct));
1729 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1735 unsigned int ptrSize;
1751 } __attribute__ ((gcc_struct));
1753 } __attribute__ ((gcc_struct));
1755 struct Operand GetOperand(struct Expression * exp);
1757 unsigned int GetInt(struct Expression * exp, int * value2)
1759 struct Operand op2 = GetOperand(exp);
1761 if(op2.kind == 3 && op2.type->isSigned)
1763 else if(op2.kind == 3)
1764 *value2 = (int)op2.ui;
1765 if(op2.kind == 4 && op2.type->isSigned)
1766 *value2 = (int)op2.i64;
1767 else if(op2.kind == 4)
1768 *value2 = (int)op2.ui64;
1769 else if(op2.kind == 22 && op2.type->isSigned)
1770 *value2 = (int)op2.iptr;
1771 else if(op2.kind == 22)
1772 *value2 = (int)op2.uiptr;
1773 else if(op2.kind == 2 && op2.type->isSigned)
1774 *value2 = (int)op2.s;
1775 else if(op2.kind == 2)
1776 *value2 = (int)op2.us;
1777 else if(op2.kind == 1 && op2.type->isSigned)
1778 *value2 = (int)op2.c;
1779 else if(op2.kind == 1)
1780 *value2 = (int)op2.uc;
1781 else if(op2.kind == 6)
1782 *value2 = (int)op2.f;
1783 else if(op2.kind == 7)
1784 *value2 = (int)op2.d;
1785 else if(op2.kind == 13)
1786 *value2 = (int)op2.ui;
1792 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1794 struct Operand op2 = GetOperand(exp);
1796 if(op2.kind == 3 && op2.type->isSigned)
1797 *value2 = (unsigned int)op2.i;
1798 else if(op2.kind == 3)
1800 if(op2.kind == 4 && op2.type->isSigned)
1801 *value2 = (unsigned int)op2.i64;
1802 else if(op2.kind == 4)
1803 *value2 = (unsigned int)op2.ui64;
1804 else if(op2.kind == 22 && op2.type->isSigned)
1805 *value2 = (unsigned int)op2.iptr;
1806 else if(op2.kind == 22)
1807 *value2 = (unsigned int)op2.uiptr;
1808 else if(op2.kind == 2 && op2.type->isSigned)
1809 *value2 = (unsigned int)op2.s;
1810 else if(op2.kind == 2)
1811 *value2 = (unsigned int)op2.us;
1812 else if(op2.kind == 1 && op2.type->isSigned)
1813 *value2 = (unsigned int)op2.c;
1814 else if(op2.kind == 1)
1815 *value2 = (unsigned int)op2.uc;
1816 else if(op2.kind == 6)
1817 *value2 = (unsigned int)op2.f;
1818 else if(op2.kind == 7)
1819 *value2 = (unsigned int)op2.d;
1820 else if(op2.kind == 13)
1827 unsigned int GetInt64(struct Expression * exp, long long * value2)
1829 struct Operand op2 = GetOperand(exp);
1831 if(op2.kind == 3 && op2.type->isSigned)
1832 *value2 = (long long)op2.i;
1833 else if(op2.kind == 3)
1834 *value2 = (long long)op2.ui;
1835 if(op2.kind == 4 && op2.type->isSigned)
1837 else if(op2.kind == 4)
1838 *value2 = (long long)op2.ui64;
1839 else if(op2.kind == 22 && op2.type->isSigned)
1840 *value2 = (long long)op2.iptr;
1841 else if(op2.kind == 22)
1842 *value2 = (long long)op2.uiptr;
1843 else if(op2.kind == 2 && op2.type->isSigned)
1844 *value2 = (long long)op2.s;
1845 else if(op2.kind == 2)
1846 *value2 = (long long)op2.us;
1847 else if(op2.kind == 1 && op2.type->isSigned)
1848 *value2 = (long long)op2.c;
1849 else if(op2.kind == 1)
1850 *value2 = (long long)op2.uc;
1851 else if(op2.kind == 6)
1852 *value2 = (long long)op2.f;
1853 else if(op2.kind == 7)
1854 *value2 = (long long)op2.d;
1855 else if(op2.kind == 13)
1856 *value2 = (long long)op2.ui;
1862 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1864 struct Operand op2 = GetOperand(exp);
1866 if(op2.kind == 3 && op2.type->isSigned)
1867 *value2 = (uint64)op2.i;
1868 else if(op2.kind == 3)
1869 *value2 = (uint64)op2.ui;
1870 if(op2.kind == 4 && op2.type->isSigned)
1871 *value2 = (uint64)op2.i64;
1872 else if(op2.kind == 4)
1874 else if(op2.kind == 22 && op2.type->isSigned)
1875 *value2 = (uint64)op2.iptr;
1876 else if(op2.kind == 22)
1877 *value2 = (uint64)op2.uiptr;
1878 else if(op2.kind == 2 && op2.type->isSigned)
1879 *value2 = (uint64)op2.s;
1880 else if(op2.kind == 2)
1881 *value2 = (uint64)op2.us;
1882 else if(op2.kind == 1 && op2.type->isSigned)
1883 *value2 = (uint64)op2.c;
1884 else if(op2.kind == 1)
1885 *value2 = (uint64)op2.uc;
1886 else if(op2.kind == 6)
1887 *value2 = (uint64)op2.f;
1888 else if(op2.kind == 7)
1889 *value2 = (uint64)op2.d;
1890 else if(op2.kind == 13)
1891 *value2 = (uint64)op2.ui;
1897 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1899 struct Operand op2 = GetOperand(exp);
1901 if(op2.kind == 3 && op2.type->isSigned)
1902 *value2 = (intptr_t)op2.i;
1903 else if(op2.kind == 3)
1904 *value2 = (intptr_t)op2.ui;
1905 if(op2.kind == 4 && op2.type->isSigned)
1906 *value2 = (intptr_t)op2.i64;
1907 else if(op2.kind == 4)
1908 *value2 = (intptr_t)op2.ui64;
1909 else if(op2.kind == 22 && op2.type->isSigned)
1911 else if(op2.kind == 22)
1912 *value2 = (intptr_t)op2.uiptr;
1913 else if(op2.kind == 2 && op2.type->isSigned)
1914 *value2 = (intptr_t)op2.s;
1915 else if(op2.kind == 2)
1916 *value2 = (intptr_t)op2.us;
1917 else if(op2.kind == 1 && op2.type->isSigned)
1918 *value2 = (intptr_t)op2.c;
1919 else if(op2.kind == 1)
1920 *value2 = (intptr_t)op2.uc;
1921 else if(op2.kind == 6)
1922 *value2 = (intptr_t)op2.f;
1923 else if(op2.kind == 7)
1924 *value2 = (intptr_t)op2.d;
1925 else if(op2.kind == 13)
1926 *value2 = (intptr_t)op2.ui;
1932 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1934 struct Operand op2 = GetOperand(exp);
1936 if(op2.kind == 3 && op2.type->isSigned)
1937 *value2 = (uintptr_t)op2.i;
1938 else if(op2.kind == 3)
1939 *value2 = (uintptr_t)op2.ui;
1940 if(op2.kind == 4 && op2.type->isSigned)
1941 *value2 = (uintptr_t)op2.i64;
1942 else if(op2.kind == 4)
1943 *value2 = (uintptr_t)op2.ui64;
1944 else if(op2.kind == 22 && op2.type->isSigned)
1945 *value2 = (uintptr_t)op2.iptr;
1946 else if(op2.kind == 22)
1947 *value2 = op2.uiptr;
1948 else if(op2.kind == 2 && op2.type->isSigned)
1949 *value2 = (uintptr_t)op2.s;
1950 else if(op2.kind == 2)
1951 *value2 = (uintptr_t)op2.us;
1952 else if(op2.kind == 1 && op2.type->isSigned)
1953 *value2 = (uintptr_t)op2.c;
1954 else if(op2.kind == 1)
1955 *value2 = (uintptr_t)op2.uc;
1956 else if(op2.kind == 6)
1957 *value2 = (uintptr_t)op2.f;
1958 else if(op2.kind == 7)
1959 *value2 = (uintptr_t)op2.d;
1960 else if(op2.kind == 13)
1961 *value2 = (uintptr_t)op2.ui;
1967 unsigned int GetShort(struct Expression * exp, short * value2)
1969 struct Operand op2 = GetOperand(exp);
1971 if(op2.kind == 3 && op2.type->isSigned)
1972 *value2 = (short)op2.i;
1973 else if(op2.kind == 3)
1974 *value2 = (short)op2.ui;
1975 if(op2.kind == 4 && op2.type->isSigned)
1976 *value2 = (short)op2.i64;
1977 else if(op2.kind == 4)
1978 *value2 = (short)op2.ui64;
1979 else if(op2.kind == 22 && op2.type->isSigned)
1980 *value2 = (short)op2.iptr;
1981 else if(op2.kind == 22)
1982 *value2 = (short)op2.uiptr;
1983 else if(op2.kind == 2 && op2.type->isSigned)
1985 else if(op2.kind == 2)
1986 *value2 = (short)op2.us;
1987 else if(op2.kind == 1 && op2.type->isSigned)
1988 *value2 = (short)op2.c;
1989 else if(op2.kind == 1)
1990 *value2 = (short)op2.uc;
1991 else if(op2.kind == 6)
1992 *value2 = (short)op2.f;
1993 else if(op2.kind == 7)
1994 *value2 = (short)op2.d;
1995 else if(op2.kind == 13)
1996 *value2 = (short)op2.ui;
2002 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2004 struct Operand op2 = GetOperand(exp);
2006 if(op2.kind == 3 && op2.type->isSigned)
2007 *value2 = (unsigned short)op2.i;
2008 else if(op2.kind == 3)
2009 *value2 = (unsigned short)op2.ui;
2010 if(op2.kind == 4 && op2.type->isSigned)
2011 *value2 = (unsigned short)op2.i64;
2012 else if(op2.kind == 4)
2013 *value2 = (unsigned short)op2.ui64;
2014 else if(op2.kind == 22 && op2.type->isSigned)
2015 *value2 = (unsigned short)op2.iptr;
2016 else if(op2.kind == 22)
2017 *value2 = (unsigned short)op2.uiptr;
2018 else if(op2.kind == 2 && op2.type->isSigned)
2019 *value2 = (unsigned short)op2.s;
2020 else if(op2.kind == 2)
2022 else if(op2.kind == 1 && op2.type->isSigned)
2023 *value2 = (unsigned short)op2.c;
2024 else if(op2.kind == 1)
2025 *value2 = (unsigned short)op2.uc;
2026 else if(op2.kind == 6)
2027 *value2 = (unsigned short)op2.f;
2028 else if(op2.kind == 7)
2029 *value2 = (unsigned short)op2.d;
2030 else if(op2.kind == 13)
2031 *value2 = (unsigned short)op2.ui;
2037 unsigned int GetChar(struct Expression * exp, char * value2)
2039 struct Operand op2 = GetOperand(exp);
2041 if(op2.kind == 3 && op2.type->isSigned)
2042 *value2 = (char)op2.i;
2043 else if(op2.kind == 3)
2044 *value2 = (char)op2.ui;
2045 if(op2.kind == 4 && op2.type->isSigned)
2046 *value2 = (char)op2.i64;
2047 else if(op2.kind == 4)
2048 *value2 = (char)op2.ui64;
2049 else if(op2.kind == 22 && op2.type->isSigned)
2050 *value2 = (char)op2.iptr;
2051 else if(op2.kind == 22)
2052 *value2 = (char)op2.uiptr;
2053 else if(op2.kind == 2 && op2.type->isSigned)
2054 *value2 = (char)op2.s;
2055 else if(op2.kind == 2)
2056 *value2 = (char)op2.us;
2057 else if(op2.kind == 1 && op2.type->isSigned)
2059 else if(op2.kind == 1)
2060 *value2 = (char)op2.uc;
2061 else if(op2.kind == 6)
2062 *value2 = (char)op2.f;
2063 else if(op2.kind == 7)
2064 *value2 = (char)op2.d;
2065 else if(op2.kind == 13)
2066 *value2 = (char)op2.ui;
2072 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2074 struct Operand op2 = GetOperand(exp);
2076 if(op2.kind == 3 && op2.type->isSigned)
2077 *value2 = (unsigned char)op2.i;
2078 else if(op2.kind == 3)
2079 *value2 = (unsigned char)op2.ui;
2080 if(op2.kind == 4 && op2.type->isSigned)
2081 *value2 = (unsigned char)op2.i64;
2082 else if(op2.kind == 4)
2083 *value2 = (unsigned char)op2.ui64;
2084 else if(op2.kind == 22 && op2.type->isSigned)
2085 *value2 = (unsigned char)op2.iptr;
2086 else if(op2.kind == 22)
2087 *value2 = (unsigned char)op2.uiptr;
2088 else if(op2.kind == 2 && op2.type->isSigned)
2089 *value2 = (unsigned char)op2.s;
2090 else if(op2.kind == 2)
2091 *value2 = (unsigned char)op2.us;
2092 else if(op2.kind == 1 && op2.type->isSigned)
2093 *value2 = (unsigned char)op2.c;
2094 else if(op2.kind == 1)
2096 else if(op2.kind == 6)
2097 *value2 = (unsigned char)op2.f;
2098 else if(op2.kind == 7)
2099 *value2 = (unsigned char)op2.d;
2100 else if(op2.kind == 13)
2101 *value2 = (unsigned char)op2.ui;
2107 unsigned int GetFloat(struct Expression * exp, float * value2)
2109 struct Operand op2 = GetOperand(exp);
2111 if(op2.kind == 3 && op2.type->isSigned)
2112 *value2 = (float)(float)op2.i;
2113 else if(op2.kind == 3)
2114 *value2 = (float)(float)op2.ui;
2115 if(op2.kind == 4 && op2.type->isSigned)
2116 *value2 = (float)(float)op2.i64;
2117 else if(op2.kind == 4)
2118 *value2 = (float)(float)op2.ui64;
2119 else if(op2.kind == 22 && op2.type->isSigned)
2120 *value2 = (float)op2.iptr;
2121 else if(op2.kind == 22)
2122 *value2 = (float)op2.uiptr;
2123 else if(op2.kind == 2 && op2.type->isSigned)
2124 *value2 = (float)(float)op2.s;
2125 else if(op2.kind == 2)
2126 *value2 = (float)(float)op2.us;
2127 else if(op2.kind == 1 && op2.type->isSigned)
2128 *value2 = (float)(float)op2.c;
2129 else if(op2.kind == 1)
2130 *value2 = (float)(float)op2.uc;
2131 else if(op2.kind == 6)
2132 *value2 = (float)op2.f;
2133 else if(op2.kind == 7)
2134 *value2 = (float)op2.d;
2135 else if(op2.kind == 13)
2136 *value2 = (float)(float)op2.ui;
2142 unsigned int GetDouble(struct Expression * exp, double * value2)
2144 struct Operand op2 = GetOperand(exp);
2146 if(op2.kind == 3 && op2.type->isSigned)
2147 *value2 = (double)(double)op2.i;
2148 else if(op2.kind == 3)
2149 *value2 = (double)(double)op2.ui;
2150 if(op2.kind == 4 && op2.type->isSigned)
2151 *value2 = (double)(double)op2.i64;
2152 else if(op2.kind == 4)
2153 *value2 = (double)(double)op2.ui64;
2154 else if(op2.kind == 22 && op2.type->isSigned)
2155 *value2 = (double)op2.iptr;
2156 else if(op2.kind == 22)
2157 *value2 = (double)op2.uiptr;
2158 else if(op2.kind == 2 && op2.type->isSigned)
2159 *value2 = (double)(double)op2.s;
2160 else if(op2.kind == 2)
2161 *value2 = (double)(double)op2.us;
2162 else if(op2.kind == 1 && op2.type->isSigned)
2163 *value2 = (double)(double)op2.c;
2164 else if(op2.kind == 1)
2165 *value2 = (double)(double)op2.uc;
2166 else if(op2.kind == 6)
2167 *value2 = (double)op2.f;
2168 else if(op2.kind == 7)
2169 *value2 = (double)op2.d;
2170 else if(op2.kind == 13)
2171 *value2 = (double)(double)op2.ui;
2177 void ComputeExpression(struct Expression * exp);
2179 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2181 int ComputeTypeSize(struct Type * type);
2183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2185 struct __ecereNameSpace__ecere__com__BitMember
2187 struct __ecereNameSpace__ecere__com__BitMember * prev;
2188 struct __ecereNameSpace__ecere__com__BitMember * next;
2190 unsigned int isProperty;
2193 struct __ecereNameSpace__ecere__com__Class * _class;
2194 char * dataTypeString;
2195 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2196 struct Type * dataType;
2201 } __attribute__ ((gcc_struct));
2203 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2205 struct __ecereNameSpace__ecere__sys__OldLink
2207 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2208 struct __ecereNameSpace__ecere__sys__OldLink * next;
2210 } __attribute__ ((gcc_struct));
2212 void FinishTemplatesContext(struct Context * context);
2214 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2216 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2217 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2219 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2222 int unionMemberOffset = 0;
2225 if(!member && _class->destructionWatchOffset)
2226 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2228 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2230 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2232 if(!dataMember->isProperty)
2234 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2236 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2242 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2244 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2246 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2248 if(!isMember && _class->type == 2 && dataMember->dataType)
2250 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2254 ComputeTypeSize(dataMember->dataType);
2255 if(bitMember->pos == -1)
2256 bitMember->pos = _class->memberOffset;
2257 if(!bitMember->size)
2258 bitMember->size = dataMember->dataType->size * 8;
2259 _class->memberOffset = bitMember->pos + bitMember->size;
2260 for(d = 0; d < bitMember->size; d++)
2266 bitMember->mask = mask << bitMember->pos;
2268 else if(dataMember->type == 0 && dataMember->dataType)
2273 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2274 ComputeTypeSize(dataMember->dataType);
2275 if(dataMember->dataType->bitFieldCount)
2277 bitFields += dataMember->dataType->bitFieldCount;
2284 int size = (bitFields + 7) / 8;
2288 int __simpleStruct0;
2292 int __simpleStruct0;
2294 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2295 if(member->memberOffset % alignment)
2296 member->memberOffset += alignment - (member->memberOffset % alignment);
2298 dataMember->offset = member->memberOffset;
2299 if(member->type == 1)
2300 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2303 member->memberOffset += size;
2310 int __simpleStruct0;
2312 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2313 if(_class->memberOffset % alignment)
2314 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2316 dataMember->offset = _class->memberOffset;
2317 _class->memberOffset += size;
2321 size = dataMember->dataType->size;
2322 alignment = dataMember->dataType->alignment;
2326 int __simpleStruct0;
2330 int __simpleStruct0;
2332 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2333 if(member->memberOffset % alignment)
2334 member->memberOffset += alignment - (member->memberOffset % alignment);
2336 dataMember->offset = member->memberOffset;
2337 if(member->type == 1)
2338 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2341 member->memberOffset += size;
2348 int __simpleStruct0;
2350 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2351 if(_class->memberOffset % alignment)
2352 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2354 dataMember->offset = _class->memberOffset;
2355 _class->memberOffset += size;
2360 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2363 int __simpleStruct2;
2364 int __simpleStruct0, __simpleStruct1;
2366 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2367 dataMember->offset = member->memberOffset;
2368 if(member->type == 1)
2369 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2371 member->memberOffset += dataMember->memberOffset;
2375 int __simpleStruct0, __simpleStruct1;
2377 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2378 dataMember->offset = _class->memberOffset;
2379 _class->memberOffset += dataMember->memberOffset;
2387 int size = (bitFields + 7) / 8;
2391 int __simpleStruct0;
2395 int __simpleStruct0;
2397 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2398 if(member->memberOffset % alignment)
2399 member->memberOffset += alignment - (member->memberOffset % alignment);
2401 if(member->type == 1)
2402 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2405 member->memberOffset += size;
2412 int __simpleStruct0;
2414 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2415 if(_class->memberOffset % alignment)
2416 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2418 _class->memberOffset += size;
2423 if(member && member->type == 1)
2425 member->memberOffset = unionMemberOffset;
2429 if(_class->type != 2)
2431 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2434 struct __ecereNameSpace__ecere__com__Property * prop;
2436 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2438 if(prop->isProperty && prop->isWatchable)
2440 prop->watcherOffset = _class->structSize;
2441 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2446 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2448 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2450 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2452 if(deriv->computeSize)
2454 deriv->offset = _class->structSize;
2455 deriv->memberOffset = 0;
2456 deriv->structSize = deriv->offset;
2457 ComputeClassMembers(deriv, 0x0);
2465 FinishTemplatesContext(context);
2468 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2470 struct __ecereNameSpace__ecere__com__NameSpace
2473 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2474 struct __ecereNameSpace__ecere__com__NameSpace * left;
2475 struct __ecereNameSpace__ecere__com__NameSpace * right;
2477 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2478 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2479 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2480 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2481 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2482 } __attribute__ ((gcc_struct));
2484 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2486 struct __ecereNameSpace__ecere__com__Module
2488 struct __ecereNameSpace__ecere__com__Instance * application;
2489 struct __ecereNameSpace__ecere__sys__OldList classes;
2490 struct __ecereNameSpace__ecere__sys__OldList defines;
2491 struct __ecereNameSpace__ecere__sys__OldList functions;
2492 struct __ecereNameSpace__ecere__sys__OldList modules;
2493 struct __ecereNameSpace__ecere__com__Instance * prev;
2494 struct __ecereNameSpace__ecere__com__Instance * next;
2500 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2501 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2502 } __attribute__ ((gcc_struct));
2504 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2506 struct __ecereNameSpace__ecere__com__Class * _class;
2507 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2509 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2510 ComputeModuleClasses(subModule->data);
2511 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2512 ComputeClassMembers(_class, 0x0);
2515 extern int targetBits;
2517 extern unsigned int inCompiler;
2519 extern void Compiler_Error(char * format, ...);
2521 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2523 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2525 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2527 int ComputeTypeSize(struct Type * type)
2529 unsigned int size = type ? type->size : 0;
2531 if(!size && type && !type->computing)
2533 type->computing = 0x1;
2537 type->alignment = size = sizeof(char);
2540 type->alignment = size = sizeof(int);
2543 type->alignment = size = sizeof(long long);
2546 type->alignment = size = targetBits / 8;
2549 type->alignment = size = sizeof(long);
2552 type->alignment = size = sizeof(short);
2555 type->alignment = size = sizeof(float);
2558 type->alignment = size = sizeof(double);
2562 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2564 if(_class && _class->type == 1)
2566 ComputeClassMembers(_class, 0x0);
2567 type->alignment = _class->structAlignment;
2568 size = _class->structSize;
2569 if(type->alignment && size % type->alignment)
2570 size += type->alignment - (size % type->alignment);
2572 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2574 if(!_class->dataType)
2575 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2576 size = type->alignment = ComputeTypeSize(_class->dataType);
2579 size = type->alignment = targetBits / 8;
2584 size = type->alignment = targetBits / 8;
2587 if(type->arraySizeExp)
2589 ProcessExpressionType(type->arraySizeExp);
2590 ComputeExpression(type->arraySizeExp);
2591 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)))
2593 struct Location oldLoc = yylloc;
2594 char expression[10240];
2596 expression[0] = '\0';
2597 type->arraySizeExp->expType = (((void *)0));
2598 yylloc = type->arraySizeExp->loc;
2600 PrintExpression(type->arraySizeExp, expression);
2601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2604 GetInt(type->arraySizeExp, &type->arraySize);
2606 else if(type->enumClass)
2608 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2610 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2613 type->arraySize = 0;
2617 type->arraySize = 0;
2619 size = ComputeTypeSize(type->type) * type->arraySize;
2620 type->alignment = type->type->alignment;
2624 struct Type * member;
2626 for(member = type->members.first; member; member = member->next)
2628 int __simpleStruct0, __simpleStruct1;
2629 unsigned int addSize = ComputeTypeSize(member);
2631 member->offset = size;
2632 if(member->alignment && size % member->alignment)
2633 member->offset += member->alignment - (size % member->alignment);
2634 size = member->offset;
2635 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2638 if(type->alignment && size % type->alignment)
2639 size += type->alignment - (size % type->alignment);
2644 struct Type * member;
2646 for(member = type->members.first; member; member = member->next)
2648 int __simpleStruct0, __simpleStruct1;
2649 unsigned int addSize = ComputeTypeSize(member);
2651 member->offset = size;
2652 if(member->alignment && size % member->alignment)
2653 member->offset += member->alignment - (size % member->alignment);
2654 size = member->offset;
2655 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2656 size = ((size > addSize) ? size : addSize);
2658 if(type->alignment && size % type->alignment)
2659 size += type->alignment - (size % type->alignment);
2664 struct TemplateParameter * param = type->templateParameter;
2665 struct Type * baseType = ProcessTemplateParameterType(param);
2668 size = ComputeTypeSize(baseType);
2670 size = sizeof(uint64);
2683 size = targetBits / 8;
2688 type->computing = 0x0;
2693 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2695 extern struct Identifier * MkIdentifier(char * string);
2697 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2699 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2701 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2703 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2705 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2707 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2709 extern void FreeType(struct Type * type);
2711 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2713 extern struct Specifier * MkSpecifier(int specifier);
2715 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2717 extern struct Expression * MkExpConstant(char * string);
2719 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)
2721 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2722 unsigned int totalSize = 0;
2723 unsigned int maxSize = 0;
2724 int alignment, size;
2725 struct __ecereNameSpace__ecere__com__DataMember * member;
2726 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2728 if(!isMember && _class->base)
2730 maxSize = _class->structSize;
2732 if(_class->type == 1 || _class->type == 5)
2733 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2735 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
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->dataTypeString)
2748 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2749 struct Declarator * decl;
2751 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2752 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2753 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2754 if(!member->dataType)
2755 member->dataType = ProcessType(specs, decl);
2756 ReplaceThisClassSpecifiers(specs, topClass);
2758 struct Type * type = ProcessType(specs, decl);
2760 DeclareType(member->dataType, 0x0, 0x0);
2763 ComputeTypeSize(member->dataType);
2764 size = member->dataType->size;
2765 alignment = member->dataType->alignment;
2768 if(totalSize % alignment)
2769 totalSize += alignment - (totalSize % alignment);
2778 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2781 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2782 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2783 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2784 alignment = member->structAlignment;
2787 if(totalSize % alignment)
2788 totalSize += alignment - (totalSize % alignment);
2798 unsigned int __simpleStruct0;
2800 if(topMember && topMember->type == 1)
2801 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2803 *retSize += totalSize;
2805 else if(totalSize < maxSize && _class->type != 1000)
2807 char sizeString[50];
2809 sprintf(sizeString, "%d", maxSize - totalSize);
2810 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2813 FinishTemplatesContext(context);
2814 return topMember ? topMember->memberID : _class->memberID;
2817 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2819 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2820 unsigned int totalSize = 0;
2821 struct __ecereNameSpace__ecere__com__DataMember * member;
2822 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2824 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2825 DeclareMembers(_class->base, 0x0);
2826 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2828 if(!member->isProperty)
2830 switch(member->type)
2834 if(!member->dataType && member->dataTypeString)
2835 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2836 if(member->dataType)
2837 DeclareType(member->dataType, 0x0, 0x0);
2843 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2850 FinishTemplatesContext(context);
2851 return topMember ? topMember->memberID : _class->memberID;
2854 extern struct Symbol * FindClass(char * name);
2856 extern char * strchr(char * , int);
2858 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2860 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2862 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2864 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2866 extern char * strcpy(char * , const char * );
2868 extern void MangleClassName(char * className);
2870 extern void DeclareClass(struct Symbol * classSym, char * className);
2872 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2874 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2876 void DeclareStruct(char * name, unsigned int skipNoHead)
2878 struct External * external = (((void *)0));
2879 struct Symbol * classSym = FindClass(name);
2881 if(!inCompiler || !classSym)
2882 return (((void *)0));
2883 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2884 return (((void *)0));
2885 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2887 struct Declaration * decl;
2888 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2889 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2890 char structName[1024];
2892 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2893 classSym->declaring++;
2894 if(strchr(classSym->string, '<'))
2896 if(classSym->registered->templateClass)
2898 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2899 classSym->declaring--;
2901 return (((void *)0));
2903 DeclareMembers(classSym->registered, 0x0);
2904 structName[0] = (char)0;
2905 FullClassNameCat(structName, name, 0x0);
2908 classSym->declaredStructSym = 0x1;
2909 declarations = MkList();
2910 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2911 if(!(*declarations).count)
2913 FreeList(declarations, (((void *)0)));
2914 declarations = (((void *)0));
2917 if(skipNoHead || declarations)
2919 if(external && external->declaration)
2921 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2922 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2924 if(classSym->structExternal)
2925 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2926 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2927 classSym->id = curExternal->symbol->idCode;
2928 classSym->idCode = curExternal->symbol->idCode;
2934 external = MkExternalDeclaration((((void *)0)));
2935 specifiers = MkList();
2936 declarators = MkList();
2937 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2938 external->declaration = decl = MkDeclaration(specifiers, declarators);
2939 if(decl->symbol && !decl->symbol->pointerExternal)
2940 decl->symbol->pointerExternal = external;
2941 if(classSym->registered && classSym->registered->type == 1)
2943 char className[1024];
2945 strcpy(className, "__ecereClass_");
2946 FullClassNameCat(className, classSym->string, 0x1);
2947 MangleClassName(className);
2948 DeclareClass(classSym, className);
2949 external->symbol = classSym;
2950 classSym->pointerExternal = external;
2951 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2952 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2956 char className[1024];
2958 strcpy(className, "__ecereClass_");
2959 FullClassNameCat(className, classSym->string, 0x1);
2960 MangleClassName(className);
2961 classSym->structExternal = external;
2962 DeclareClass(classSym, className);
2963 external->symbol = classSym;
2965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2968 classSym->declaring--;
2970 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2972 classSym->declaring++;
2974 if(classSym->registered)
2975 DeclareMembers(classSym->registered, 0x0);
2977 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2979 if(classSym->structExternal)
2980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2982 classSym->id = curExternal->symbol->idCode;
2983 classSym->idCode = curExternal->symbol->idCode;
2985 classSym->declaring--;
2989 extern char * strcat(char * , const char * );
2991 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2993 extern struct ModuleImport * mainModule;
2995 extern struct Specifier * MkSpecifierName(char * name);
2997 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2999 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3001 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3003 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3005 extern void FreeDeclarator(struct Declarator * decl);
3007 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3009 struct PropertyImport
3011 struct PropertyImport * prev;
3012 struct PropertyImport * next;
3014 unsigned int isVirtual;
3015 unsigned int hasSet;
3016 unsigned int hasGet;
3017 } __attribute__ ((gcc_struct));
3019 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3021 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3023 void * __ecereTemp1;
3024 struct Symbol * symbol = prop->symbol;
3025 char propName[1024];
3027 strcpy(setName, "__ecereProp_");
3028 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3029 strcat(setName, "_Set_");
3030 FullClassNameCat(setName, prop->name, 0x1);
3031 strcpy(getName, "__ecereProp_");
3032 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3033 strcat(getName, "_Get_");
3034 FullClassNameCat(getName, prop->name, 0x1);
3035 strcpy(propName, "__ecereProp_");
3036 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3037 strcat(propName, "_");
3038 FullClassNameCat(propName, prop->name, 0x1);
3039 MangleClassName(getName);
3040 MangleClassName(setName);
3041 MangleClassName(propName);
3042 if(prop->_class->type == 1)
3043 DeclareStruct(prop->_class->fullName, 0x0);
3044 if(!symbol || curExternal->symbol->idCode < symbol->id)
3046 unsigned int imported = 0x0;
3047 unsigned int dllImport = 0x0;
3049 if(!symbol || symbol->_import)
3053 struct Symbol * classSym;
3055 if(!prop->_class->symbol)
3056 prop->_class->symbol = FindClass(prop->_class->fullName);
3057 classSym = prop->_class->symbol;
3058 if(classSym && !classSym->_import)
3060 struct ModuleImport * module;
3062 if(prop->_class->module)
3063 module = FindModule(prop->_class->module);
3065 module = mainModule;
3066 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));
3067 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3069 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3070 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));
3072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3075 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3080 struct Context * context = SetupTemplatesContext(prop->_class);
3082 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3083 FinishTemplatesContext(context);
3087 if(!symbol->externalGet || symbol->externalGet->type == 0)
3089 struct Declaration * decl;
3090 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3091 struct Declarator * d;
3092 struct __ecereNameSpace__ecere__sys__OldList * params;
3093 struct Specifier * spec;
3094 struct External * external;
3095 struct Declarator * typeDecl;
3096 unsigned int simple = 0x0;
3098 specifiers = MkList();
3099 declarators = MkList();
3101 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3102 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3104 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3106 struct Context * context = SetupTemplatesContext(prop->_class);
3108 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3109 FinishTemplatesContext(context);
3111 for(spec = (*specifiers).first; spec; spec = spec->next)
3115 if((!typeDecl || typeDecl->type == 1))
3117 struct Symbol * classSym = spec->symbol;
3119 symbol->_class = classSym->registered;
3120 if(classSym->registered && classSym->registered->type == 1)
3122 DeclareStruct(spec->name, 0x0);
3129 d = PlugDeclarator(typeDecl, d);
3132 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3133 specifiers = MkList();
3135 d = MkDeclaratorFunction(d, params);
3137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3138 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3141 ListAdd(specifiers, MkSpecifier(VOID));
3142 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3143 decl = MkDeclaration(specifiers, declarators);
3144 external = MkExternalDeclaration(decl);
3145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3146 external->symbol = symbol;
3147 symbol->externalGet = external;
3148 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3150 FreeDeclarator(typeDecl);
3154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3159 if(!symbol->externalSet || symbol->externalSet->type == 0)
3161 struct Declaration * decl;
3162 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3163 struct Declarator * d;
3164 struct __ecereNameSpace__ecere__sys__OldList * params;
3165 struct Specifier * spec;
3166 struct External * external;
3167 struct Declarator * typeDecl;
3169 declarators = MkList();
3171 if(!prop->conversion || prop->_class->type == 1)
3173 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3175 specifiers = MkList();
3177 struct Context * context = SetupTemplatesContext(prop->_class);
3179 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3180 FinishTemplatesContext(context);
3182 ListAdd(params, MkTypeName(specifiers, d));
3183 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3185 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3186 d = MkDeclaratorFunction(d, params);
3187 for(spec = (*specifiers).first; spec; spec = spec->next)
3191 if((!typeDecl || typeDecl->type == 1))
3193 struct Symbol * classSym = spec->symbol;
3195 symbol->_class = classSym->registered;
3196 if(classSym->registered && classSym->registered->type == 1)
3197 DeclareStruct(spec->name, 0x0);
3201 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3202 specifiers = MkList();
3204 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3205 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3207 if(!prop->conversion || prop->_class->type == 1)
3208 ListAdd(specifiers, MkSpecifier(VOID));
3210 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3211 decl = MkDeclaration(specifiers, declarators);
3212 external = MkExternalDeclaration(decl);
3213 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3214 external->symbol = symbol;
3215 symbol->externalSet = external;
3216 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3223 if(!symbol->externalPtr)
3225 struct Declaration * decl;
3226 struct External * external;
3227 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3233 ListAdd(specifiers, MkSpecifierName("Property"));
3235 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3237 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3240 strcpy(propName, "__ecerePropM_");
3241 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3242 strcat(propName, "_");
3243 FullClassNameCat(propName, prop->name, 0x1);
3244 MangleClassName(propName);
3245 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3247 decl = MkDeclaration(specifiers, list);
3249 external = MkExternalDeclaration(decl);
3250 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3251 external->symbol = symbol;
3252 symbol->externalPtr = external;
3256 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3258 symbol->id = curExternal->symbol->idCode;
3262 struct Type * Dereference(struct Type * source)
3264 void * __ecereTemp1;
3265 struct Type * type = (((void *)0));
3269 if(source->kind == 13 || source->kind == 12)
3271 type = source->type;
3272 source->type->refCount++;
3274 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3276 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3278 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3284 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3289 static struct Type * Reference(struct Type * source)
3291 void * __ecereTemp1;
3292 struct Type * type = (((void *)0));
3296 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));
3302 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);
3304 extern void * memcpy(void * , const void * , unsigned int size);
3306 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3308 extern void FreeExpression(struct Expression * exp);
3310 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3312 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);
3314 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3316 extern struct Type * MkClassType(char * name);
3318 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);
3320 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)
3322 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3323 unsigned int found = 0x0;
3324 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3325 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3326 unsigned int freeType = 0x0;
3328 yylloc = member->loc;
3333 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3337 dataMember = *curMember;
3343 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3344 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3345 int _subMemberStackPos = 0;
3348 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3351 dataMember = thisMember;
3352 if(curMember && thisMember->memberAccess == 1)
3354 *curMember = thisMember;
3355 *curClass = thisMember->_class;
3356 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3357 *subMemberStackPos = _subMemberStackPos;
3363 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3364 if(method && method->type == 1)
3367 method = (((void *)0));
3372 struct Type * type = (((void *)0));
3376 if(!dataMember->dataType && dataMember->dataTypeString)
3378 struct Context * context = SetupTemplatesContext(_class);
3380 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3381 FinishTemplatesContext(context);
3383 type = dataMember->dataType;
3387 if(!method->dataType)
3388 ProcessMethodType(method);
3389 type = method->dataType;
3391 if(ident && ident->next)
3393 for(ident = ident->next; ident && type; ident = ident->next)
3397 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3399 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3401 type = dataMember->dataType;
3403 else if(type->kind == 9 || type->kind == 10)
3405 struct Type * memberType;
3407 for(memberType = type->members.first; memberType; memberType = memberType->next)
3409 if(!strcmp(memberType->name, ident->string))
3418 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3421 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3422 struct __ecereNameSpace__ecere__com__Class * sClass;
3424 for(sClass = _class; sClass; sClass = sClass->base)
3427 if(sClass->templateClass)
3428 sClass = sClass->templateClass;
3429 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3431 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3433 for(sClass = sClass->base; sClass; sClass = sClass->base)
3435 if(sClass->templateClass)
3436 sClass = sClass->templateClass;
3437 id += sClass->templateParams.count;
3448 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3450 if(arg.dataTypeString)
3452 type = ProcessTypeString(arg.dataTypeString, 0x0);
3454 if(type && _class->templateClass)
3455 type->passAsTemplate = 0x1;
3462 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3464 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3465 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3469 char templateString[1024];
3470 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3472 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3473 for(cClass = expClass; cClass; cClass = cClass->base)
3477 if(cClass->templateClass)
3478 cClass = cClass->templateClass;
3479 for(param = cClass->templateParams.first; param; param = param->next)
3482 struct __ecereNameSpace__ecere__com__Class * sClass;
3483 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3485 for(sClass = cClass->base; sClass; sClass = sClass->base)
3487 if(sClass->templateClass)
3488 sClass = sClass->templateClass;
3489 id += sClass->templateParams.count;
3491 arg = expClass->templateArgs[id];
3492 for(sClass = _class; sClass; sClass = sClass->base)
3494 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3496 struct __ecereNameSpace__ecere__com__Class * nextClass;
3498 if(sClass->templateClass)
3499 sClass = sClass->templateClass;
3500 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3502 if(nextClass->templateClass)
3503 nextClass = nextClass->templateClass;
3504 p += nextClass->templateParams.count;
3506 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3508 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3510 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3512 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3513 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3527 char expString[1024];
3528 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3529 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3530 struct Expression * exp;
3531 char * string = PrintHexUInt64(arg.expression.ui64);
3533 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3534 ProcessExpressionType(exp);
3535 ComputeExpression(exp);
3536 expString[0] = '\0';
3537 PrintExpression(exp, expString);
3538 strcat(argument, expString);
3539 FreeExpression(exp);
3544 strcat(argument, arg.member->name);
3549 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3550 strcat(argument, arg.dataTypeString);
3557 strcat(templateString, ", ");
3558 if(lastParam != p - 1)
3560 strcat(templateString, param->name);
3561 strcat(templateString, " = ");
3563 strcat(templateString, argument);
3572 int len = strlen(templateString);
3574 if(templateString[len - 1] == '<')
3578 if(templateString[len - 1] == '>')
3579 templateString[len++] = ' ';
3580 templateString[len++] = '>';
3582 templateString[len++] = '\0';
3585 struct Context * context = SetupTemplatesContext(_class);
3589 type = ProcessTypeString(templateString, 0x0);
3591 FinishTemplatesContext(context);
3594 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3596 ProcessExpressionType(member->initializer->exp);
3597 if(!member->initializer->exp->expType)
3601 char expString[10240];
3603 expString[0] = '\0';
3604 PrintExpression(member->initializer->exp, expString);
3605 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3609 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3614 else if(member->initializer)
3616 ProcessInitializer(member->initializer, type);
3623 if(_class && _class->type == 3)
3625 if(member->initializer)
3627 struct Type * type = MkClassType(_class->fullName);
3629 ProcessInitializer(member->initializer, type);
3635 if(member->initializer)
3637 ProcessInitializer(member->initializer, (((void *)0)));
3643 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3647 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3649 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3658 extern struct Identifier * GetDeclId(struct Declarator * decl);
3660 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);
3662 extern void FreeSpecifier(struct Specifier * spec);
3664 static void ProcessFunction(struct FunctionDefinition * function);
3666 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3668 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3670 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3672 extern void FreeClassFunction(struct ClassFunction * func);
3674 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3676 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3678 void ProcessInstantiationType(struct Instantiation * inst)
3683 struct MembersInit * members;
3684 struct Symbol * classSym;
3685 struct __ecereNameSpace__ecere__com__Class * _class;
3687 classSym = inst->_class->symbol;
3688 _class = classSym ? classSym->registered : (((void *)0));
3689 if(!_class || _class->type != 5)
3690 DeclareStruct(inst->_class->name, 0x0);
3691 afterExternal = afterExternal ? afterExternal : curExternal;
3693 ProcessExpressionType(inst->exp);
3694 inst->isConstant = 0x1;
3697 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3698 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3699 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3700 int subMemberStackPos = 0;
3702 for(members = (*inst->members).first; members; members = members->next)
3704 switch(members->type)
3709 static unsigned int instMethodID = 0;
3710 struct External * external = curExternal;
3711 struct Context * context = curContext;
3712 struct Declarator * declarator = members->function->declarator;
3713 struct Identifier * nameID = GetDeclId(declarator);
3714 char * unmangled = nameID ? nameID->string : (((void *)0));
3715 struct Expression * exp;
3716 struct External * createdExternal = (((void *)0));
3722 strcpy(name, "__ecereInstMeth_");
3723 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3725 strcat(name, nameID->string);
3727 sprintf(number, "_%08d", instMethodID++);
3728 strcat(name, number);
3729 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3733 struct Symbol * symbol = declarator->symbol;
3734 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3736 if(method && method->type == 1)
3738 symbol->method = method;
3739 ProcessMethodType(method);
3740 if(!symbol->type->thisClass)
3742 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3744 if(!currentClass->symbol)
3745 currentClass->symbol = FindClass(currentClass->fullName);
3746 symbol->type->thisClass = currentClass->symbol;
3751 _class->symbol = FindClass(_class->fullName);
3752 symbol->type->thisClass = _class->symbol;
3755 DeclareType(symbol->type, 0x1, 0x1);
3759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3762 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3765 FreeSpecifier(nameID->_class);
3766 nameID->_class = (((void *)0));
3770 struct Type * type = declarator->symbol->type;
3771 struct External * oldExternal = curExternal;
3773 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3775 struct External * externalDecl;
3777 externalDecl = MkExternalDeclaration((((void *)0)));
3778 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3779 if(createdExternal->function)
3781 ProcessFunction(createdExternal->function);
3783 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3785 externalDecl->declaration = decl;
3786 if(decl->symbol && !decl->symbol->pointerExternal)
3787 decl->symbol->pointerExternal = externalDecl;
3788 declarator->symbol->pointerExternal = externalDecl;
3795 curExternal = declarator->symbol->pointerExternal;
3796 ProcessFunction((struct FunctionDefinition *)members->function);
3798 curExternal = external;
3799 curContext = context;
3802 FreeClassFunction(members->function);
3803 exp = QMkExpId(name);
3805 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3806 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3812 if(members->dataMembers && classSym)
3814 struct MemberInit * member;
3815 struct Location oldyyloc = yylloc;
3817 for(member = (*members->dataMembers).first; member; member = member->next)
3819 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3820 if(member->initializer && !member->initializer->isConstant)
3821 inst->isConstant = 0x0;
3833 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3837 if(type->kind == 11)
3839 struct Type * param;
3843 for(param = type->params.first; param; param = param->next)
3844 DeclareType(param, declarePointers, 0x1);
3846 DeclareType(type->returnType, declarePointers, 0x1);
3848 else if(type->kind == 13 && declarePointers)
3849 DeclareType(type->type, declarePointers, 0x0);
3850 else if(type->kind == 8)
3852 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3853 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3855 else if(type->kind == 9 || type->kind == 10)
3857 struct Type * member;
3859 for(member = type->members.first; member; member = member->next)
3860 DeclareType(member, 0x0, 0x0);
3862 else if(type->kind == 12)
3863 DeclareType(type->arrayType, declarePointers, 0x0);
3867 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3869 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3871 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3873 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3874 struct __ecereNameSpace__ecere__com__Class * sClass;
3876 for(sClass = _class; sClass; sClass = sClass->base)
3879 if(sClass->templateClass)
3880 sClass = sClass->templateClass;
3881 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3883 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3885 for(sClass = sClass->base; sClass; sClass = sClass->base)
3887 if(sClass->templateClass)
3888 sClass = sClass->templateClass;
3889 id += sClass->templateParams.count;
3900 arg = &_class->templateArgs[id];
3901 if(arg && param->type == 0)
3902 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3907 extern struct Context * PushContext(void);
3909 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3911 struct TemplatedType
3914 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3915 struct __ecereNameSpace__ecere__sys__BTNode * left;
3916 struct __ecereNameSpace__ecere__sys__BTNode * right;
3918 struct TemplateParameter * param;
3919 } __attribute__ ((gcc_struct));
3921 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3923 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3925 void * __ecereTemp1;
3926 struct Context * context = PushContext();
3928 context->templateTypesOnly = 0x1;
3929 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3931 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3933 for(; param; param = param->next)
3935 if(param->type == 0 && param->identifier)
3937 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3939 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3945 struct __ecereNameSpace__ecere__com__Class * sClass;
3947 for(sClass = _class; sClass; sClass = sClass->base)
3949 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3951 for(p = sClass->templateParams.first; p; p = p->next)
3955 struct TemplateParameter * param = p->param;
3956 struct TemplatedType * type;
3960 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));
3962 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));
3963 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3971 extern void PopContext(struct Context * ctx);
3973 extern void FreeContext(struct Context * context);
3975 void FinishTemplatesContext(struct Context * context)
3977 PopContext(context);
3978 FreeContext(context);
3979 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3982 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3984 if(!method->dataType)
3986 struct Context * context = SetupTemplatesContext(method->_class);
3988 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3989 FinishTemplatesContext(context);
3990 if(method->type != 1 && method->dataType)
3992 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3994 if(!method->_class->symbol)
3995 method->_class->symbol = FindClass(method->_class->fullName);
3996 method->dataType->thisClass = method->_class->symbol;
4002 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4006 struct Context * context = SetupTemplatesContext(prop->_class);
4008 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4009 FinishTemplatesContext(context);
4013 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4015 extern void FreeTypeName(struct TypeName * typeName);
4017 static void ProcessDeclarator(struct Declarator * decl);
4019 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4025 struct MethodImport * prev;
4026 struct MethodImport * next;
4028 unsigned int isVirtual;
4029 } __attribute__ ((gcc_struct));
4031 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4033 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4035 void * __ecereTemp1;
4036 struct Symbol * symbol = method->symbol;
4038 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4040 unsigned int imported = 0x0;
4041 unsigned int dllImport = 0x0;
4043 if(!method->dataType)
4044 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4045 if(!symbol || symbol->_import || method->type == 1)
4047 if(!symbol || method->type == 1)
4049 struct Symbol * classSym;
4051 if(!method->_class->symbol)
4052 method->_class->symbol = FindClass(method->_class->fullName);
4053 classSym = method->_class->symbol;
4054 if(!classSym->_import)
4056 struct ModuleImport * module;
4058 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4059 module = FindModule(method->_class->module);
4061 module = mainModule;
4062 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));
4063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4067 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4069 if(!symbol->_import)
4071 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));
4072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4076 symbol->type = method->dataType;
4078 symbol->type->refCount++;
4081 if(!method->dataType->dllExport)
4084 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4088 if(method->type != 1 && method->dataType)
4089 DeclareType(method->dataType, 0x1, 0x1);
4090 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4092 struct Declaration * decl;
4093 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4094 struct Declarator * d;
4095 struct Declarator * funcDecl;
4096 struct External * external;
4098 specifiers = MkList();
4099 declarators = MkList();
4101 ListAdd(specifiers, MkSpecifier(EXTERN));
4102 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4103 ListAdd(specifiers, MkSpecifier(STATIC));
4104 if(method->type == 1)
4106 ListAdd(specifiers, MkSpecifier(INT));
4107 d = MkDeclaratorIdentifier(MkIdentifier(name));
4111 d = MkDeclaratorIdentifier(MkIdentifier(name));
4113 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4115 struct Context * context = SetupTemplatesContext(method->_class);
4117 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4118 FinishTemplatesContext(context);
4120 funcDecl = GetFuncDecl(d);
4123 struct Specifier * spec, * next;
4125 for(spec = (*specifiers).first; spec; spec = next)
4130 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4131 FreeSpecifier(spec);
4135 if(method->dataType && !method->dataType->staticMethod)
4137 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4139 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4140 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")));
4141 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4142 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4144 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4146 struct TypeName * param = (*funcDecl->function.parameters).first;
4148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4149 FreeTypeName(param);
4151 if(!funcDecl->function.parameters)
4152 funcDecl->function.parameters = MkList();
4153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4157 ProcessDeclarator(d);
4158 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4159 decl = MkDeclaration(specifiers, declarators);
4160 ReplaceThisClassSpecifiers(specifiers, method->_class);
4161 if(symbol->pointerExternal)
4163 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4166 *functionSymbol = *symbol;
4167 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4168 if(functionSymbol->type)
4169 functionSymbol->type->refCount++;
4171 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4172 symbol->pointerExternal->symbol = functionSymbol;
4174 external = MkExternalDeclaration(decl);
4176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4177 external->symbol = symbol;
4178 symbol->pointerExternal = external;
4182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4184 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4188 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4190 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4192 unsigned int first = 0x1;
4194 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4196 char className[1024];
4198 strcpy(className, _class->fullName);
4199 for(param = _class->templateParams.first; param; param = param->next)
4203 strcat(className, "<");
4205 strcat(className, ", ");
4206 if(lastParam + 1 != p)
4208 strcat(className, param->name);
4209 strcat(className, " = ");
4211 strcat(className, param->name);
4219 int len = strlen(className);
4221 if(className[len - 1] == '>')
4222 className[len++] = ' ';
4223 className[len++] = '>';
4224 className[len++] = '\0';
4226 return __ecereNameSpace__ecere__sys__CopyString(className);
4229 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4232 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4234 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4236 unsigned int first = 0x1;
4238 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4240 char className[1024];
4242 strcpy(className, _class->fullName);
4243 for(param = _class->templateParams.first; param; param = param->next)
4247 strcat(className, "<");
4249 strcat(className, ", ");
4250 if(lastParam + 1 != p)
4252 strcat(className, param->name);
4253 strcat(className, " = ");
4255 strcat(className, param->name);
4263 int len = strlen(className);
4265 if(className[len - 1] == '>')
4266 className[len++] = ' ';
4267 className[len++] = '>';
4268 className[len++] = '\0';
4270 return MkClassType(className);
4274 return MkClassType(_class->fullName);
4278 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4280 if(specs != (((void *)0)) && _class)
4282 struct Specifier * spec;
4284 for(spec = specs->first; spec; spec = spec->next)
4286 if(spec->type == 0 && spec->specifier == THISCLASS)
4289 spec->name = ReplaceThisClass(_class);
4290 spec->symbol = FindClass(spec->name);
4296 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4298 struct __ecereNameSpace__ecere__com__GlobalFunction
4300 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4301 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4304 struct __ecereNameSpace__ecere__com__Instance * module;
4305 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4306 char * dataTypeString;
4307 struct Type * dataType;
4309 } __attribute__ ((gcc_struct));
4311 extern struct Context * globalContext;
4313 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4315 struct FunctionImport
4317 struct FunctionImport * prev;
4318 struct FunctionImport * next;
4320 } __attribute__ ((gcc_struct));
4322 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4324 void * __ecereTemp1;
4325 struct Symbol * symbol = function->symbol;
4327 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4329 unsigned int imported = 0x0;
4330 unsigned int dllImport = 0x0;
4332 if(!function->dataType)
4334 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4335 if(!function->dataType->thisClass)
4336 function->dataType->staticMethod = 0x1;
4342 struct ModuleImport * module = FindModule(function->module);
4344 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4347 if(!function->dataType->dllExport)
4349 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));
4350 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4354 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4355 if(!symbol->type->thisClass)
4356 symbol->type->staticMethod = 0x1;
4359 imported = symbol->_import ? 0x1 : 0x0;
4360 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4363 DeclareType(function->dataType, 0x1, 0x1);
4366 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4368 struct Declaration * decl;
4369 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4370 struct Declarator * d;
4371 struct Declarator * funcDecl;
4372 struct External * external;
4374 specifiers = MkList();
4375 declarators = MkList();
4376 ListAdd(specifiers, MkSpecifier(EXTERN));
4377 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4379 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4380 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4381 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4383 struct Specifier * spec;
4385 for(spec = (*specifiers).first; spec; spec = spec->next)
4386 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4388 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4389 FreeSpecifier(spec);
4393 funcDecl = GetFuncDecl(d);
4394 if(funcDecl && !funcDecl->function.parameters)
4396 funcDecl->function.parameters = MkList();
4397 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4399 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4401 struct Context * oldCtx = curContext;
4403 curContext = globalContext;
4404 decl = MkDeclaration(specifiers, declarators);
4405 curContext = oldCtx;
4407 if(symbol->pointerExternal)
4409 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4412 *functionSymbol = *symbol;
4413 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4414 if(functionSymbol->type)
4415 functionSymbol->type->refCount++;
4417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4418 symbol->pointerExternal->symbol = functionSymbol;
4420 external = MkExternalDeclaration(decl);
4422 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4423 external->symbol = symbol;
4424 symbol->pointerExternal = external;
4428 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4431 symbol->id = curExternal->symbol->idCode;
4434 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4437 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4442 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4443 struct __ecereNameSpace__ecere__sys__BTNode * left;
4444 struct __ecereNameSpace__ecere__sys__BTNode * right;
4446 struct __ecereNameSpace__ecere__com__Instance * module;
4447 char * dataTypeString;
4448 struct Type * dataType;
4451 } __attribute__ ((gcc_struct));
4453 void DeclareGlobalData(struct GlobalData * data)
4455 struct Symbol * symbol = data->symbol;
4457 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4462 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4465 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4466 DeclareType(data->dataType, 0x1, 0x1);
4469 if(!symbol->pointerExternal)
4471 struct Declaration * decl;
4472 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4473 struct Declarator * d;
4474 struct External * external;
4476 specifiers = MkList();
4477 declarators = MkList();
4478 ListAdd(specifiers, MkSpecifier(EXTERN));
4479 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4480 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4481 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4482 decl = MkDeclaration(specifiers, declarators);
4483 external = MkExternalDeclaration(decl);
4485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4486 external->symbol = symbol;
4487 symbol->pointerExternal = external;
4491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4494 symbol->id = curExternal->symbol->idCode;
4501 struct Conversion * prev, * next;
4502 struct __ecereNameSpace__ecere__com__Property * convert;
4504 struct Type * resultType;
4505 } __attribute__ ((gcc_struct));
4507 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4509 extern void Compiler_Warning(char * format, ...);
4511 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4513 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)
4517 if(source->kind == 20 && dest->kind != 20)
4519 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4524 if(dest->kind == 20 && source->kind != 20)
4526 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4531 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4535 if(source->classObjectType == 3 && dest->classObjectType != 2)
4539 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4541 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4544 if(dest->kind == 14 && source->kind != 0)
4546 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))
4548 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))
4550 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4552 if(source->_class->registered && source->_class->registered->type == 3)
4554 if(conversions != (((void *)0)))
4556 if(source->_class->registered == dest->_class->registered)
4561 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4563 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4565 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4567 if(sourceBase == destBase)
4571 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))
4575 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4577 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4584 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
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(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 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);
4627 struct __ecereNameSpace__ecere__com__Class * _class;
4629 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4631 struct __ecereNameSpace__ecere__com__Property * convert;
4633 for(convert = _class->conversions.first; convert; convert = convert->next)
4635 if(convert->memberAccess == 1 || _class->module == privateModule)
4637 if(!convert->dataType)
4638 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4639 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4641 if(!conversions && !convert->Set)
4643 else if(conversions != (((void *)0)))
4645 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))
4649 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4659 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4661 if(!dest->_class->registered->dataType)
4662 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4663 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4665 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4672 if(source->kind == 8)
4674 struct __ecereNameSpace__ecere__com__Class * _class;
4676 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4678 struct __ecereNameSpace__ecere__com__Property * convert;
4680 for(convert = _class->conversions.first; convert; convert = convert->next)
4682 if(convert->memberAccess == 1 || _class->module == privateModule)
4684 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4686 if(!convert->dataType)
4687 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4688 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4690 if(!conversions && !convert->Get)
4692 else if(conversions != (((void *)0)))
4694 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))
4698 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4700 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4708 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4710 if(!source->_class->registered->dataType)
4711 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4712 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4719 if(source->kind == 8 || source->kind == 19)
4721 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4723 else if(dest->kind == 7 && source->kind == 6)
4725 else if(dest->kind == 2 && source->kind == 1)
4727 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4729 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4731 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4733 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4735 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4737 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)))
4739 struct Type * paramSource, * paramDest;
4741 if(dest->kind == 16)
4742 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4743 if(source->kind == 16)
4744 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4745 if(dest->kind == 13 && dest->type->kind == 11)
4747 if(source->kind == 13 && source->type->kind == 11)
4748 source = source->type;
4749 if(dest->kind == 16)
4750 dest = dest->method->dataType;
4751 if(source->kind == 16)
4752 source = source->method->dataType;
4753 paramSource = source->params.first;
4754 if(paramSource && paramSource->kind == 0)
4755 paramSource = (((void *)0));
4756 paramDest = dest->params.first;
4757 if(paramDest && paramDest->kind == 0)
4758 paramDest = (((void *)0));
4759 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4761 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))))
4763 if(paramDest && paramDest->kind == 8)
4764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4766 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4769 paramDest = paramDest->next;
4771 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4773 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4777 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4779 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4785 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4788 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4794 paramSource = paramSource->next;
4800 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4802 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4808 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4816 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4818 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4821 for(; paramDest; paramDest = paramDest->next)
4825 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4829 struct Type * paramDestType = paramDest;
4830 struct Type * paramSourceType = paramSource;
4831 struct Type * type = paramDestType;
4833 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4836 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4837 struct __ecereNameSpace__ecere__com__Class * sClass;
4839 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4842 if(sClass->templateClass)
4843 sClass = sClass->templateClass;
4844 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4846 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4848 for(sClass = sClass->base; sClass; sClass = sClass->base)
4850 if(sClass->templateClass)
4851 sClass = sClass->templateClass;
4852 id += sClass->templateParams.count;
4863 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4865 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4868 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)))
4873 PrintType(paramDest, type, 0x0, 0x1);
4874 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4875 if(paramDestType != paramDest)
4876 FreeType(paramDestType);
4879 if(paramDestType != paramDest)
4880 FreeType(paramDestType);
4882 paramSource = paramSource->next;
4886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4891 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4895 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4897 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4904 static void FreeConvert(struct Conversion * convert)
4906 if(convert->resultType)
4907 FreeType(convert->resultType);
4910 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4912 struct __ecereNameSpace__ecere__com__BTNamedLink
4915 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4916 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4917 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4920 } __attribute__ ((gcc_struct));
4922 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4924 struct __ecereNameSpace__ecere__com__EnumClassData
4926 struct __ecereNameSpace__ecere__sys__OldList values;
4928 } __attribute__ ((gcc_struct));
4930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4932 struct __ecereNameSpace__ecere__sys__NamedLink
4934 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4935 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4938 } __attribute__ ((gcc_struct));
4940 extern void FreeExpContents(struct Expression * exp);
4942 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4944 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4946 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4948 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4950 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4952 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4954 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4956 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)))
4958 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4960 if(_class->type == 4)
4962 struct __ecereNameSpace__ecere__sys__OldList converts =
4966 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4970 _class->symbol = FindClass(_class->fullName);
4971 type->_class = _class->symbol;
4972 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4974 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4975 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4979 struct __ecereNameSpace__ecere__com__Class * baseClass;
4981 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4983 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4985 for(value = e->values.first; value; value = value->next)
4987 if(!strcmp(value->name, string))
4992 FreeExpContents(sourceExp);
4993 FreeType(sourceExp->expType);
4994 sourceExp->isConstant = 0x1;
4995 sourceExp->expType = MkClassType(baseClass->fullName);
4999 sourceExp->type = 2;
5000 if(!strcmp(baseClass->dataTypeString, "int"))
5001 sprintf(constant, "%d", value->data);
5003 sprintf(constant, "0x%X", value->data);
5004 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5006 while(converts.first)
5008 struct Conversion * convert = converts.first;
5010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5011 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5013 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5021 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5024 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)))
5025 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5030 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5032 struct __ecereNameSpace__ecere__com__SubModule
5034 struct __ecereNameSpace__ecere__com__SubModule * prev;
5035 struct __ecereNameSpace__ecere__com__SubModule * next;
5036 struct __ecereNameSpace__ecere__com__Instance * module;
5038 } __attribute__ ((gcc_struct));
5040 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5042 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5044 if(searchFor == searchIn)
5046 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5048 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5050 if(ModuleVisibility(subModule->module, searchFor))
5057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5059 struct __ecereNameSpace__ecere__com__Application
5064 unsigned int isGUIApp;
5065 struct __ecereNameSpace__ecere__sys__OldList allModules;
5066 char * parsedCommand;
5067 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5068 } __attribute__ ((gcc_struct));
5070 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5072 struct __ecereNameSpace__ecere__com__Instance * module;
5074 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5076 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5078 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5080 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)
5082 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5088 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5090 void ReadString(char * output, char * string);
5092 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5094 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5096 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5098 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5100 void * __ecereTemp1;
5101 struct Type * source = sourceExp->expType;
5102 struct Type * realDest = dest;
5104 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5106 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5108 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5110 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5112 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5114 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5116 if(sourceBase == destBase)
5122 struct __ecereNameSpace__ecere__sys__OldList * specs;
5123 unsigned int flag = 0x0;
5124 long long value = (((int)0x7fffffff));
5128 if(sourceExp->type == 2)
5130 if(source->isSigned)
5131 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5133 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5135 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5137 if(source->isSigned)
5138 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5140 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5142 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5145 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));
5149 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5151 if(_class && _class->type == 3)
5153 if(source->kind != 8)
5155 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5156 struct Type * tempDest, * tempSource;
5158 for(; _class->base->type != 1000; _class = _class->base)
5161 tempDest = tempType;
5164 _class->symbol = FindClass(_class->fullName);
5165 tempType->_class = _class->symbol;
5166 tempType->truth = dest->truth;
5167 if(tempType->_class)
5168 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5169 FreeType(sourceExp->expType);
5170 sourceExp->expType = dest;
5173 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5176 if(_class && _class->type == 2 && source->kind != 8)
5178 if(!dest->_class->registered->dataType)
5179 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5180 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5183 FreeType(sourceExp->expType);
5184 source = sourceExp->expType = MkClassType(dest->_class->string);
5188 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5190 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5191 struct Declarator * decl;
5194 ReadString(string, sourceExp->string);
5195 decl = SpecDeclFromString(string, specs, (((void *)0)));
5196 FreeExpContents(sourceExp);
5197 FreeType(sourceExp->expType);
5198 sourceExp->type = 26;
5199 sourceExp->_classExp.specifiers = specs;
5200 sourceExp->_classExp.decl = decl;
5201 sourceExp->expType = dest;
5208 else if(source->kind == 8)
5210 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5212 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5216 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5217 struct Type * tempDest, * tempSource;
5219 if(!source->_class->registered->dataType)
5220 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5221 for(; _class->base->type != 1000; _class = _class->base)
5224 tempSource = tempType;
5226 tempType->_class = FindClass(_class->fullName);
5227 tempType->truth = source->truth;
5228 tempType->classObjectType = source->classObjectType;
5229 if(tempType->_class)
5230 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5231 if(conversions->last)
5233 ((struct Conversion *)conversions->last)->resultType = dest;
5236 FreeType(sourceExp->expType);
5237 sourceExp->expType = MkClassType(_class->fullName);
5238 sourceExp->expType->truth = source->truth;
5239 sourceExp->expType->classObjectType = source->classObjectType;
5240 if(!sourceExp->destType)
5242 FreeType(sourceExp->destType);
5243 sourceExp->destType = sourceExp->expType;
5244 if(sourceExp->expType)
5245 sourceExp->expType->refCount++;
5247 if(!_class->dataType)
5248 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5250 dest = MkClassType(source->_class->string);
5251 dest->truth = source->truth;
5252 dest->classObjectType = source->classObjectType;
5254 source = _class->dataType;
5256 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5262 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5271 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5273 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5275 if(_class->type == 0 || _class->type == 5)
5277 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5279 *newExp = *sourceExp;
5280 if(sourceExp->destType)
5281 sourceExp->destType->refCount++;
5282 if(sourceExp->expType)
5283 sourceExp->expType->refCount++;
5284 sourceExp->type = 11;
5285 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5286 sourceExp->cast.exp = newExp;
5287 FreeType(sourceExp->expType);
5288 sourceExp->expType = (((void *)0));
5289 ProcessExpressionType(sourceExp);
5292 FreeType(sourceExp->expType);
5293 sourceExp->expType = dest;
5300 if(!_class->dataType)
5301 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5303 dest = _class->dataType;
5306 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5308 specs = MkListOne(MkSpecifier(DOUBLE));
5310 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5312 specs = MkListOne(MkSpecifier(FLOAT));
5314 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5318 ListAdd(specs, MkSpecifier(UNSIGNED));
5319 ListAdd(specs, MkSpecifier(INT64));
5321 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5325 ListAdd(specs, MkSpecifier(UNSIGNED));
5326 ListAdd(specs, MkSpecifier(INT));
5328 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5332 ListAdd(specs, MkSpecifier(UNSIGNED));
5333 ListAdd(specs, MkSpecifier(SHORT));
5335 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5339 ListAdd(specs, MkSpecifier(UNSIGNED));
5340 ListAdd(specs, MkSpecifier(CHAR));
5349 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))
5351 specs = MkListOne(MkSpecifier(DOUBLE));
5353 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5355 specs = MkListOne(MkSpecifier(FLOAT));
5357 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)))
5361 ListAdd(specs, MkSpecifier(UNSIGNED));
5362 ListAdd(specs, MkSpecifier(CHAR));
5364 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)))))
5368 ListAdd(specs, MkSpecifier(UNSIGNED));
5369 ListAdd(specs, MkSpecifier(SHORT));
5371 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5375 ListAdd(specs, MkSpecifier(UNSIGNED));
5376 ListAdd(specs, MkSpecifier(INT));
5378 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5382 ListAdd(specs, MkSpecifier(UNSIGNED));
5383 ListAdd(specs, MkSpecifier(INT64));
5385 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5387 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5397 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5399 *newExp = *sourceExp;
5400 newExp->prev = (((void *)0));
5401 newExp->next = (((void *)0));
5402 if(sourceExp->destType)
5403 sourceExp->destType->refCount++;
5404 if(sourceExp->expType)
5405 sourceExp->expType->refCount++;
5406 sourceExp->type = 11;
5407 if(realDest->kind == 8)
5409 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5410 FreeList(specs, FreeSpecifier);
5413 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5414 if(newExp->type == 4)
5416 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5419 sourceExp->cast.exp = newExp;
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = (((void *)0));
5422 ProcessExpressionType(sourceExp);
5425 FreeList(specs, FreeSpecifier);
5432 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5433 sourceExp = (*sourceExp->list).last;
5434 if(sourceExp->type == 0)
5436 struct Identifier * id = sourceExp->identifier;
5440 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5442 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5443 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5447 for(; _class && _class->type == 4; _class = _class->base)
5449 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5450 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5452 for(value = e->values.first; value; value = value->next)
5454 if(!strcmp(value->name, id->string))
5459 FreeExpContents(sourceExp);
5460 FreeType(sourceExp->expType);
5461 sourceExp->isConstant = 0x1;
5462 sourceExp->expType = MkClassType(_class->fullName);
5466 sourceExp->type = 2;
5467 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5468 sprintf(constant, "%d", value->data);
5470 sprintf(constant, "0x%X", value->data);
5471 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5479 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5486 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5488 int value2 = op2->i;
5491 exp->string = PrintInt(op1->i + value2);
5494 exp->expType = op1->type;
5496 op1->type->refCount++;
5501 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5503 unsigned int value2 = op2->ui;
5506 exp->string = PrintUInt(op1->ui + value2);
5509 exp->expType = op1->type;
5511 op1->type->refCount++;
5516 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5518 short value2 = op2->s;
5521 exp->string = PrintShort(op1->s + value2);
5524 exp->expType = op1->type;
5526 op1->type->refCount++;
5531 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5533 unsigned short value2 = op2->us;
5536 exp->string = PrintUShort(op1->us + value2);
5539 exp->expType = op1->type;
5541 op1->type->refCount++;
5546 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5548 char value2 = op2->c;
5551 exp->string = PrintChar(op1->c + value2);
5554 exp->expType = op1->type;
5556 op1->type->refCount++;
5561 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5563 unsigned char value2 = op2->uc;
5566 exp->string = PrintUChar(op1->uc + value2);
5569 exp->expType = op1->type;
5571 op1->type->refCount++;
5576 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5578 float value2 = op2->f;
5581 exp->string = PrintFloat(op1->f + value2);
5584 exp->expType = op1->type;
5586 op1->type->refCount++;
5591 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5593 double value2 = op2->d;
5596 exp->string = PrintDouble(op1->d + value2);
5599 exp->expType = op1->type;
5601 op1->type->refCount++;
5606 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5608 int value2 = op2->i;
5611 exp->string = PrintInt(op1->i - value2);
5614 exp->expType = op1->type;
5616 op1->type->refCount++;
5621 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5623 unsigned int value2 = op2->ui;
5626 exp->string = PrintUInt(op1->ui - value2);
5629 exp->expType = op1->type;
5631 op1->type->refCount++;
5636 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5638 short value2 = op2->s;
5641 exp->string = PrintShort(op1->s - value2);
5644 exp->expType = op1->type;
5646 op1->type->refCount++;
5651 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5653 unsigned short value2 = op2->us;
5656 exp->string = PrintUShort(op1->us - value2);
5659 exp->expType = op1->type;
5661 op1->type->refCount++;
5666 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5668 char value2 = op2->c;
5671 exp->string = PrintChar(op1->c - value2);
5674 exp->expType = op1->type;
5676 op1->type->refCount++;
5681 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5683 unsigned char value2 = op2->uc;
5686 exp->string = PrintUChar(op1->uc - value2);
5689 exp->expType = op1->type;
5691 op1->type->refCount++;
5696 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5698 float value2 = op2->f;
5701 exp->string = PrintFloat(op1->f - value2);
5704 exp->expType = op1->type;
5706 op1->type->refCount++;
5711 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5713 double value2 = op2->d;
5716 exp->string = PrintDouble(op1->d - value2);
5719 exp->expType = op1->type;
5721 op1->type->refCount++;
5726 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5728 int value2 = op2->i;
5731 exp->string = PrintInt(op1->i * value2);
5734 exp->expType = op1->type;
5736 op1->type->refCount++;
5741 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5743 unsigned int value2 = op2->ui;
5746 exp->string = PrintUInt(op1->ui * value2);
5749 exp->expType = op1->type;
5751 op1->type->refCount++;
5756 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5758 short value2 = op2->s;
5761 exp->string = PrintShort(op1->s * value2);
5764 exp->expType = op1->type;
5766 op1->type->refCount++;
5771 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5773 unsigned short value2 = op2->us;
5776 exp->string = PrintUShort(op1->us * value2);
5779 exp->expType = op1->type;
5781 op1->type->refCount++;
5786 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5788 char value2 = op2->c;
5791 exp->string = PrintChar(op1->c * value2);
5794 exp->expType = op1->type;
5796 op1->type->refCount++;
5801 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5803 unsigned char value2 = op2->uc;
5806 exp->string = PrintUChar(op1->uc * value2);
5809 exp->expType = op1->type;
5811 op1->type->refCount++;
5816 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5818 float value2 = op2->f;
5821 exp->string = PrintFloat(op1->f * value2);
5824 exp->expType = op1->type;
5826 op1->type->refCount++;
5831 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5833 double value2 = op2->d;
5836 exp->string = PrintDouble(op1->d * value2);
5839 exp->expType = op1->type;
5841 op1->type->refCount++;
5846 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5848 int value2 = op2->i;
5851 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5854 exp->expType = op1->type;
5856 op1->type->refCount++;
5861 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5863 unsigned int value2 = op2->ui;
5866 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5869 exp->expType = op1->type;
5871 op1->type->refCount++;
5876 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5878 short value2 = op2->s;
5881 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5884 exp->expType = op1->type;
5886 op1->type->refCount++;
5891 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5893 unsigned short value2 = op2->us;
5896 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5899 exp->expType = op1->type;
5901 op1->type->refCount++;
5906 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5908 char value2 = op2->c;
5911 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5914 exp->expType = op1->type;
5916 op1->type->refCount++;
5921 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5923 unsigned char value2 = op2->uc;
5926 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5929 exp->expType = op1->type;
5931 op1->type->refCount++;
5936 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5938 float value2 = op2->f;
5941 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5944 exp->expType = op1->type;
5946 op1->type->refCount++;
5951 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5953 double value2 = op2->d;
5956 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5959 exp->expType = op1->type;
5961 op1->type->refCount++;
5966 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5968 int value2 = op2->i;
5971 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5974 exp->expType = op1->type;
5976 op1->type->refCount++;
5981 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5983 unsigned int value2 = op2->ui;
5986 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5989 exp->expType = op1->type;
5991 op1->type->refCount++;
5996 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5998 short value2 = op2->s;
6001 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6004 exp->expType = op1->type;
6006 op1->type->refCount++;
6011 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6013 unsigned short value2 = op2->us;
6016 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6019 exp->expType = op1->type;
6021 op1->type->refCount++;
6026 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6028 char value2 = op2->c;
6031 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6034 exp->expType = op1->type;
6036 op1->type->refCount++;
6041 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6043 unsigned char value2 = op2->uc;
6046 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6049 exp->expType = op1->type;
6051 op1->type->refCount++;
6056 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6059 exp->string = PrintInt(-op1->i);
6062 exp->expType = op1->type;
6064 op1->type->refCount++;
6069 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6072 exp->string = PrintUInt(-op1->ui);
6075 exp->expType = op1->type;
6077 op1->type->refCount++;
6082 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6085 exp->string = PrintShort(-op1->s);
6088 exp->expType = op1->type;
6090 op1->type->refCount++;
6095 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6098 exp->string = PrintUShort(-op1->us);
6101 exp->expType = op1->type;
6103 op1->type->refCount++;
6108 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6111 exp->string = PrintChar(-op1->c);
6114 exp->expType = op1->type;
6116 op1->type->refCount++;
6121 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6124 exp->string = PrintUChar(-op1->uc);
6127 exp->expType = op1->type;
6129 op1->type->refCount++;
6134 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6137 exp->string = PrintFloat(-op1->f);
6140 exp->expType = op1->type;
6142 op1->type->refCount++;
6147 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6150 exp->string = PrintDouble(-op1->d);
6153 exp->expType = op1->type;
6155 op1->type->refCount++;
6160 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6163 exp->string = PrintInt(++op1->i);
6166 exp->expType = op1->type;
6168 op1->type->refCount++;
6173 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6176 exp->string = PrintUInt(++op1->ui);
6179 exp->expType = op1->type;
6181 op1->type->refCount++;
6186 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6189 exp->string = PrintShort(++op1->s);
6192 exp->expType = op1->type;
6194 op1->type->refCount++;
6199 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6202 exp->string = PrintUShort(++op1->us);
6205 exp->expType = op1->type;
6207 op1->type->refCount++;
6212 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6215 exp->string = PrintChar(++op1->c);
6218 exp->expType = op1->type;
6220 op1->type->refCount++;
6225 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6228 exp->string = PrintUChar(++op1->uc);
6231 exp->expType = op1->type;
6233 op1->type->refCount++;
6238 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6241 exp->string = PrintFloat(++op1->f);
6244 exp->expType = op1->type;
6246 op1->type->refCount++;
6251 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6254 exp->string = PrintDouble(++op1->d);
6257 exp->expType = op1->type;
6259 op1->type->refCount++;
6264 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6267 exp->string = PrintInt(--op1->i);
6270 exp->expType = op1->type;
6272 op1->type->refCount++;
6277 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6280 exp->string = PrintUInt(--op1->ui);
6283 exp->expType = op1->type;
6285 op1->type->refCount++;
6290 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6293 exp->string = PrintShort(--op1->s);
6296 exp->expType = op1->type;
6298 op1->type->refCount++;
6303 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6306 exp->string = PrintUShort(--op1->us);
6309 exp->expType = op1->type;
6311 op1->type->refCount++;
6316 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6319 exp->string = PrintChar(--op1->c);
6322 exp->expType = op1->type;
6324 op1->type->refCount++;
6329 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6332 exp->string = PrintUChar(--op1->uc);
6335 exp->expType = op1->type;
6337 op1->type->refCount++;
6342 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6345 exp->string = PrintFloat(--op1->f);
6348 exp->expType = op1->type;
6350 op1->type->refCount++;
6355 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6358 exp->string = PrintDouble(--op1->d);
6361 exp->expType = op1->type;
6363 op1->type->refCount++;
6368 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6370 int value2 = op2->i;
6373 exp->string = PrintInt(op1->i = value2);
6376 exp->expType = op1->type;
6378 op1->type->refCount++;
6383 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6385 unsigned int value2 = op2->ui;
6388 exp->string = PrintUInt(op1->ui = value2);
6391 exp->expType = op1->type;
6393 op1->type->refCount++;
6398 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6400 short value2 = op2->s;
6403 exp->string = PrintShort(op1->s = value2);
6406 exp->expType = op1->type;
6408 op1->type->refCount++;
6413 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6415 unsigned short value2 = op2->us;
6418 exp->string = PrintUShort(op1->us = value2);
6421 exp->expType = op1->type;
6423 op1->type->refCount++;
6428 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6430 char value2 = op2->c;
6433 exp->string = PrintChar(op1->c = value2);
6436 exp->expType = op1->type;
6438 op1->type->refCount++;
6443 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6445 unsigned char value2 = op2->uc;
6448 exp->string = PrintUChar(op1->uc = value2);
6451 exp->expType = op1->type;
6453 op1->type->refCount++;
6458 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6460 float value2 = op2->f;
6463 exp->string = PrintFloat(op1->f = value2);
6466 exp->expType = op1->type;
6468 op1->type->refCount++;
6473 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6475 double value2 = op2->d;
6478 exp->string = PrintDouble(op1->d = value2);
6481 exp->expType = op1->type;
6483 op1->type->refCount++;
6488 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6490 int value2 = op2->i;
6493 exp->string = PrintInt(op1->i += value2);
6496 exp->expType = op1->type;
6498 op1->type->refCount++;
6503 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6505 unsigned int value2 = op2->ui;
6508 exp->string = PrintUInt(op1->ui += value2);
6511 exp->expType = op1->type;
6513 op1->type->refCount++;
6518 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6520 short value2 = op2->s;
6523 exp->string = PrintShort(op1->s += value2);
6526 exp->expType = op1->type;
6528 op1->type->refCount++;
6533 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6535 unsigned short value2 = op2->us;
6538 exp->string = PrintUShort(op1->us += value2);
6541 exp->expType = op1->type;
6543 op1->type->refCount++;
6548 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6550 char value2 = op2->c;
6553 exp->string = PrintChar(op1->c += value2);
6556 exp->expType = op1->type;
6558 op1->type->refCount++;
6563 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6565 unsigned char value2 = op2->uc;
6568 exp->string = PrintUChar(op1->uc += value2);
6571 exp->expType = op1->type;
6573 op1->type->refCount++;
6578 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6580 float value2 = op2->f;
6583 exp->string = PrintFloat(op1->f += value2);
6586 exp->expType = op1->type;
6588 op1->type->refCount++;
6593 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6595 double value2 = op2->d;
6598 exp->string = PrintDouble(op1->d += value2);
6601 exp->expType = op1->type;
6603 op1->type->refCount++;
6608 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6610 int value2 = op2->i;
6613 exp->string = PrintInt(op1->i -= value2);
6616 exp->expType = op1->type;
6618 op1->type->refCount++;
6623 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6625 unsigned int value2 = op2->ui;
6628 exp->string = PrintUInt(op1->ui -= value2);
6631 exp->expType = op1->type;
6633 op1->type->refCount++;
6638 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6640 short value2 = op2->s;
6643 exp->string = PrintShort(op1->s -= value2);
6646 exp->expType = op1->type;
6648 op1->type->refCount++;
6653 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6655 unsigned short value2 = op2->us;
6658 exp->string = PrintUShort(op1->us -= value2);
6661 exp->expType = op1->type;
6663 op1->type->refCount++;
6668 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6670 char value2 = op2->c;
6673 exp->string = PrintChar(op1->c -= value2);
6676 exp->expType = op1->type;
6678 op1->type->refCount++;
6683 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6685 unsigned char value2 = op2->uc;
6688 exp->string = PrintUChar(op1->uc -= value2);
6691 exp->expType = op1->type;
6693 op1->type->refCount++;
6698 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6700 float value2 = op2->f;
6703 exp->string = PrintFloat(op1->f -= value2);
6706 exp->expType = op1->type;
6708 op1->type->refCount++;
6713 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6715 double value2 = op2->d;
6718 exp->string = PrintDouble(op1->d -= value2);
6721 exp->expType = op1->type;
6723 op1->type->refCount++;
6728 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6730 int value2 = op2->i;
6733 exp->string = PrintInt(op1->i *= value2);
6736 exp->expType = op1->type;
6738 op1->type->refCount++;
6743 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6745 unsigned int value2 = op2->ui;
6748 exp->string = PrintUInt(op1->ui *= value2);
6751 exp->expType = op1->type;
6753 op1->type->refCount++;
6758 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6760 short value2 = op2->s;
6763 exp->string = PrintShort(op1->s *= value2);
6766 exp->expType = op1->type;
6768 op1->type->refCount++;
6773 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6775 unsigned short value2 = op2->us;
6778 exp->string = PrintUShort(op1->us *= value2);
6781 exp->expType = op1->type;
6783 op1->type->refCount++;
6788 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6790 char value2 = op2->c;
6793 exp->string = PrintChar(op1->c *= value2);
6796 exp->expType = op1->type;
6798 op1->type->refCount++;
6803 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6805 unsigned char value2 = op2->uc;
6808 exp->string = PrintUChar(op1->uc *= value2);
6811 exp->expType = op1->type;
6813 op1->type->refCount++;
6818 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6820 float value2 = op2->f;
6823 exp->string = PrintFloat(op1->f *= value2);
6826 exp->expType = op1->type;
6828 op1->type->refCount++;
6833 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6835 double value2 = op2->d;
6838 exp->string = PrintDouble(op1->d *= value2);
6841 exp->expType = op1->type;
6843 op1->type->refCount++;
6848 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6850 int value2 = op2->i;
6853 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6856 exp->expType = op1->type;
6858 op1->type->refCount++;
6863 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6865 unsigned int value2 = op2->ui;
6868 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6871 exp->expType = op1->type;
6873 op1->type->refCount++;
6878 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6880 short value2 = op2->s;
6883 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6886 exp->expType = op1->type;
6888 op1->type->refCount++;
6893 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6895 unsigned short value2 = op2->us;
6898 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6901 exp->expType = op1->type;
6903 op1->type->refCount++;
6908 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6910 char value2 = op2->c;
6913 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6916 exp->expType = op1->type;
6918 op1->type->refCount++;
6923 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6925 unsigned char value2 = op2->uc;
6928 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6931 exp->expType = op1->type;
6933 op1->type->refCount++;
6938 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6940 float value2 = op2->f;
6943 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6946 exp->expType = op1->type;
6948 op1->type->refCount++;
6953 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6955 double value2 = op2->d;
6958 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6961 exp->expType = op1->type;
6963 op1->type->refCount++;
6968 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6970 int value2 = op2->i;
6973 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6976 exp->expType = op1->type;
6978 op1->type->refCount++;
6983 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6985 unsigned int value2 = op2->ui;
6988 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6991 exp->expType = op1->type;
6993 op1->type->refCount++;
6998 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7000 short value2 = op2->s;
7003 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7006 exp->expType = op1->type;
7008 op1->type->refCount++;
7013 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7015 unsigned short value2 = op2->us;
7018 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7021 exp->expType = op1->type;
7023 op1->type->refCount++;
7028 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7030 char value2 = op2->c;
7033 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7036 exp->expType = op1->type;
7038 op1->type->refCount++;
7043 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7045 unsigned char value2 = op2->uc;
7048 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7051 exp->expType = op1->type;
7053 op1->type->refCount++;
7058 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7060 int value2 = op2->i;
7063 exp->string = PrintInt(op1->i & value2);
7066 exp->expType = op1->type;
7068 op1->type->refCount++;
7073 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7075 unsigned int value2 = op2->ui;
7078 exp->string = PrintUInt(op1->ui & value2);
7081 exp->expType = op1->type;
7083 op1->type->refCount++;
7088 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7090 short value2 = op2->s;
7093 exp->string = PrintShort(op1->s & value2);
7096 exp->expType = op1->type;
7098 op1->type->refCount++;
7103 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7105 unsigned short value2 = op2->us;
7108 exp->string = PrintUShort(op1->us & value2);
7111 exp->expType = op1->type;
7113 op1->type->refCount++;
7118 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7120 char value2 = op2->c;
7123 exp->string = PrintChar(op1->c & value2);
7126 exp->expType = op1->type;
7128 op1->type->refCount++;
7133 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7135 unsigned char value2 = op2->uc;
7138 exp->string = PrintUChar(op1->uc & value2);
7141 exp->expType = op1->type;
7143 op1->type->refCount++;
7148 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7150 int value2 = op2->i;
7153 exp->string = PrintInt(op1->i | value2);
7156 exp->expType = op1->type;
7158 op1->type->refCount++;
7163 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7165 unsigned int value2 = op2->ui;
7168 exp->string = PrintUInt(op1->ui | value2);
7171 exp->expType = op1->type;
7173 op1->type->refCount++;
7178 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7180 short value2 = op2->s;
7183 exp->string = PrintShort(op1->s | value2);
7186 exp->expType = op1->type;
7188 op1->type->refCount++;
7193 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7195 unsigned short value2 = op2->us;
7198 exp->string = PrintUShort(op1->us | value2);
7201 exp->expType = op1->type;
7203 op1->type->refCount++;
7208 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7210 char value2 = op2->c;
7213 exp->string = PrintChar(op1->c | value2);
7216 exp->expType = op1->type;
7218 op1->type->refCount++;
7223 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7225 unsigned char value2 = op2->uc;
7228 exp->string = PrintUChar(op1->uc | value2);
7231 exp->expType = op1->type;
7233 op1->type->refCount++;
7238 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7240 int value2 = op2->i;
7243 exp->string = PrintInt(op1->i ^ value2);
7246 exp->expType = op1->type;
7248 op1->type->refCount++;
7253 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7255 unsigned int value2 = op2->ui;
7258 exp->string = PrintUInt(op1->ui ^ value2);
7261 exp->expType = op1->type;
7263 op1->type->refCount++;
7268 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7270 short value2 = op2->s;
7273 exp->string = PrintShort(op1->s ^ value2);
7276 exp->expType = op1->type;
7278 op1->type->refCount++;
7283 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7285 unsigned short value2 = op2->us;
7288 exp->string = PrintUShort(op1->us ^ value2);
7291 exp->expType = op1->type;
7293 op1->type->refCount++;
7298 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7300 char value2 = op2->c;
7303 exp->string = PrintChar(op1->c ^ value2);
7306 exp->expType = op1->type;
7308 op1->type->refCount++;
7313 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7315 unsigned char value2 = op2->uc;
7318 exp->string = PrintUChar(op1->uc ^ value2);
7321 exp->expType = op1->type;
7323 op1->type->refCount++;
7328 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7330 int value2 = op2->i;
7333 exp->string = PrintInt(op1->i << value2);
7336 exp->expType = op1->type;
7338 op1->type->refCount++;
7343 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7345 unsigned int value2 = op2->ui;
7348 exp->string = PrintUInt(op1->ui << value2);
7351 exp->expType = op1->type;
7353 op1->type->refCount++;
7358 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7360 short value2 = op2->s;
7363 exp->string = PrintShort(op1->s << value2);
7366 exp->expType = op1->type;
7368 op1->type->refCount++;
7373 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7375 unsigned short value2 = op2->us;
7378 exp->string = PrintUShort(op1->us << value2);
7381 exp->expType = op1->type;
7383 op1->type->refCount++;
7388 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7390 char value2 = op2->c;
7393 exp->string = PrintChar(op1->c << value2);
7396 exp->expType = op1->type;
7398 op1->type->refCount++;
7403 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7405 unsigned char value2 = op2->uc;
7408 exp->string = PrintUChar(op1->uc << value2);
7411 exp->expType = op1->type;
7413 op1->type->refCount++;
7418 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7420 int value2 = op2->i;
7423 exp->string = PrintInt(op1->i >> value2);
7426 exp->expType = op1->type;
7428 op1->type->refCount++;
7433 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7435 unsigned int value2 = op2->ui;
7438 exp->string = PrintUInt(op1->ui >> value2);
7441 exp->expType = op1->type;
7443 op1->type->refCount++;
7448 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7450 short value2 = op2->s;
7453 exp->string = PrintShort(op1->s >> value2);
7456 exp->expType = op1->type;
7458 op1->type->refCount++;
7463 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7465 unsigned short value2 = op2->us;
7468 exp->string = PrintUShort(op1->us >> value2);
7471 exp->expType = op1->type;
7473 op1->type->refCount++;
7478 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7480 char value2 = op2->c;
7483 exp->string = PrintChar(op1->c >> value2);
7486 exp->expType = op1->type;
7488 op1->type->refCount++;
7493 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7495 unsigned char value2 = op2->uc;
7498 exp->string = PrintUChar(op1->uc >> value2);
7501 exp->expType = op1->type;
7503 op1->type->refCount++;
7508 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7511 exp->string = PrintInt(~op1->i);
7514 exp->expType = op1->type;
7516 op1->type->refCount++;
7521 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7524 exp->string = PrintUInt(~op1->ui);
7527 exp->expType = op1->type;
7529 op1->type->refCount++;
7534 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7537 exp->string = PrintShort(~op1->s);
7540 exp->expType = op1->type;
7542 op1->type->refCount++;
7547 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7550 exp->string = PrintUShort(~op1->us);
7553 exp->expType = op1->type;
7555 op1->type->refCount++;
7560 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7563 exp->string = PrintChar(~op1->c);
7566 exp->expType = op1->type;
7568 op1->type->refCount++;
7573 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7576 exp->string = PrintUChar(~op1->uc);
7579 exp->expType = op1->type;
7581 op1->type->refCount++;
7586 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7588 int value2 = op2->i;
7591 exp->string = PrintInt(op1->i &= value2);
7594 exp->expType = op1->type;
7596 op1->type->refCount++;
7601 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7603 unsigned int value2 = op2->ui;
7606 exp->string = PrintUInt(op1->ui &= value2);
7609 exp->expType = op1->type;
7611 op1->type->refCount++;
7616 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7618 short value2 = op2->s;
7621 exp->string = PrintShort(op1->s &= value2);
7624 exp->expType = op1->type;
7626 op1->type->refCount++;
7631 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7633 unsigned short value2 = op2->us;
7636 exp->string = PrintUShort(op1->us &= value2);
7639 exp->expType = op1->type;
7641 op1->type->refCount++;
7646 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7648 char value2 = op2->c;
7651 exp->string = PrintChar(op1->c &= value2);
7654 exp->expType = op1->type;
7656 op1->type->refCount++;
7661 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7663 unsigned char value2 = op2->uc;
7666 exp->string = PrintUChar(op1->uc &= value2);
7669 exp->expType = op1->type;
7671 op1->type->refCount++;
7676 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7678 int value2 = op2->i;
7681 exp->string = PrintInt(op1->i |= value2);
7684 exp->expType = op1->type;
7686 op1->type->refCount++;
7691 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7693 unsigned int value2 = op2->ui;
7696 exp->string = PrintUInt(op1->ui |= value2);
7699 exp->expType = op1->type;
7701 op1->type->refCount++;
7706 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7708 short value2 = op2->s;
7711 exp->string = PrintShort(op1->s |= value2);
7714 exp->expType = op1->type;
7716 op1->type->refCount++;
7721 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7723 unsigned short value2 = op2->us;
7726 exp->string = PrintUShort(op1->us |= value2);
7729 exp->expType = op1->type;
7731 op1->type->refCount++;
7736 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7738 char value2 = op2->c;
7741 exp->string = PrintChar(op1->c |= value2);
7744 exp->expType = op1->type;
7746 op1->type->refCount++;
7751 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7753 unsigned char value2 = op2->uc;
7756 exp->string = PrintUChar(op1->uc |= value2);
7759 exp->expType = op1->type;
7761 op1->type->refCount++;
7766 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7768 int value2 = op2->i;
7771 exp->string = PrintInt(op1->i ^= value2);
7774 exp->expType = op1->type;
7776 op1->type->refCount++;
7781 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7783 unsigned int value2 = op2->ui;
7786 exp->string = PrintUInt(op1->ui ^= value2);
7789 exp->expType = op1->type;
7791 op1->type->refCount++;
7796 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7798 short value2 = op2->s;
7801 exp->string = PrintShort(op1->s ^= value2);
7804 exp->expType = op1->type;
7806 op1->type->refCount++;
7811 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7813 unsigned short value2 = op2->us;
7816 exp->string = PrintUShort(op1->us ^= value2);
7819 exp->expType = op1->type;
7821 op1->type->refCount++;
7826 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7828 char value2 = op2->c;
7831 exp->string = PrintChar(op1->c ^= value2);
7834 exp->expType = op1->type;
7836 op1->type->refCount++;
7841 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7843 unsigned char value2 = op2->uc;
7846 exp->string = PrintUChar(op1->uc ^= value2);
7849 exp->expType = op1->type;
7851 op1->type->refCount++;
7856 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7858 int value2 = op2->i;
7861 exp->string = PrintInt(op1->i <<= value2);
7864 exp->expType = op1->type;
7866 op1->type->refCount++;
7871 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7873 unsigned int value2 = op2->ui;
7876 exp->string = PrintUInt(op1->ui <<= value2);
7879 exp->expType = op1->type;
7881 op1->type->refCount++;
7886 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7888 short value2 = op2->s;
7891 exp->string = PrintShort(op1->s <<= value2);
7894 exp->expType = op1->type;
7896 op1->type->refCount++;
7901 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7903 unsigned short value2 = op2->us;
7906 exp->string = PrintUShort(op1->us <<= value2);
7909 exp->expType = op1->type;
7911 op1->type->refCount++;
7916 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7918 char value2 = op2->c;
7921 exp->string = PrintChar(op1->c <<= value2);
7924 exp->expType = op1->type;
7926 op1->type->refCount++;
7931 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7933 unsigned char value2 = op2->uc;
7936 exp->string = PrintUChar(op1->uc <<= value2);
7939 exp->expType = op1->type;
7941 op1->type->refCount++;
7946 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7948 int value2 = op2->i;
7951 exp->string = PrintInt(op1->i >>= value2);
7954 exp->expType = op1->type;
7956 op1->type->refCount++;
7961 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7963 unsigned int value2 = op2->ui;
7966 exp->string = PrintUInt(op1->ui >>= value2);
7969 exp->expType = op1->type;
7971 op1->type->refCount++;
7976 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7978 short value2 = op2->s;
7981 exp->string = PrintShort(op1->s >>= value2);
7984 exp->expType = op1->type;
7986 op1->type->refCount++;
7991 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7993 unsigned short value2 = op2->us;
7996 exp->string = PrintUShort(op1->us >>= value2);
7999 exp->expType = op1->type;
8001 op1->type->refCount++;
8006 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8008 char value2 = op2->c;
8011 exp->string = PrintChar(op1->c >>= value2);
8014 exp->expType = op1->type;
8016 op1->type->refCount++;
8021 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8023 unsigned char value2 = op2->uc;
8026 exp->string = PrintUChar(op1->uc >>= value2);
8029 exp->expType = op1->type;
8031 op1->type->refCount++;
8036 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8039 exp->string = PrintInt(!op1->i);
8042 exp->expType = op1->type;
8044 op1->type->refCount++;
8049 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8052 exp->string = PrintUInt(!op1->ui);
8055 exp->expType = op1->type;
8057 op1->type->refCount++;
8062 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8065 exp->string = PrintShort(!op1->s);
8068 exp->expType = op1->type;
8070 op1->type->refCount++;
8075 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8078 exp->string = PrintUShort(!op1->us);
8081 exp->expType = op1->type;
8083 op1->type->refCount++;
8088 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8091 exp->string = PrintChar(!op1->c);
8094 exp->expType = op1->type;
8096 op1->type->refCount++;
8101 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8104 exp->string = PrintUChar(!op1->uc);
8107 exp->expType = op1->type;
8109 op1->type->refCount++;
8114 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8116 int value2 = op2->i;
8119 exp->string = PrintInt(op1->i == value2);
8122 exp->expType = op1->type;
8124 op1->type->refCount++;
8129 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 unsigned int value2 = op2->ui;
8134 exp->string = PrintUInt(op1->ui == value2);
8137 exp->expType = op1->type;
8139 op1->type->refCount++;
8144 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 short value2 = op2->s;
8149 exp->string = PrintShort(op1->s == value2);
8152 exp->expType = op1->type;
8154 op1->type->refCount++;
8159 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 unsigned short value2 = op2->us;
8164 exp->string = PrintUShort(op1->us == value2);
8167 exp->expType = op1->type;
8169 op1->type->refCount++;
8174 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 char value2 = op2->c;
8179 exp->string = PrintChar(op1->c == value2);
8182 exp->expType = op1->type;
8184 op1->type->refCount++;
8189 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8191 unsigned char value2 = op2->uc;
8194 exp->string = PrintUChar(op1->uc == value2);
8197 exp->expType = op1->type;
8199 op1->type->refCount++;
8204 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8206 float value2 = op2->f;
8209 exp->string = PrintFloat(op1->f == value2);
8212 exp->expType = op1->type;
8214 op1->type->refCount++;
8219 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8221 double value2 = op2->d;
8224 exp->string = PrintDouble(op1->d == value2);
8227 exp->expType = op1->type;
8229 op1->type->refCount++;
8234 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8236 int value2 = op2->i;
8239 exp->string = PrintInt(op1->i != value2);
8242 exp->expType = op1->type;
8244 op1->type->refCount++;
8249 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8251 unsigned int value2 = op2->ui;
8254 exp->string = PrintUInt(op1->ui != value2);
8257 exp->expType = op1->type;
8259 op1->type->refCount++;
8264 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8266 short value2 = op2->s;
8269 exp->string = PrintShort(op1->s != value2);
8272 exp->expType = op1->type;
8274 op1->type->refCount++;
8279 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8281 unsigned short value2 = op2->us;
8284 exp->string = PrintUShort(op1->us != value2);
8287 exp->expType = op1->type;
8289 op1->type->refCount++;
8294 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8296 char value2 = op2->c;
8299 exp->string = PrintChar(op1->c != value2);
8302 exp->expType = op1->type;
8304 op1->type->refCount++;
8309 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8311 unsigned char value2 = op2->uc;
8314 exp->string = PrintUChar(op1->uc != value2);
8317 exp->expType = op1->type;
8319 op1->type->refCount++;
8324 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8326 float value2 = op2->f;
8329 exp->string = PrintFloat(op1->f != value2);
8332 exp->expType = op1->type;
8334 op1->type->refCount++;
8339 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8341 double value2 = op2->d;
8344 exp->string = PrintDouble(op1->d != value2);
8347 exp->expType = op1->type;
8349 op1->type->refCount++;
8354 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8356 int value2 = op2->i;
8359 exp->string = PrintInt(op1->i && value2);
8362 exp->expType = op1->type;
8364 op1->type->refCount++;
8369 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8371 unsigned int value2 = op2->ui;
8374 exp->string = PrintUInt(op1->ui && value2);
8377 exp->expType = op1->type;
8379 op1->type->refCount++;
8384 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8386 short value2 = op2->s;
8389 exp->string = PrintShort(op1->s && value2);
8392 exp->expType = op1->type;
8394 op1->type->refCount++;
8399 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8401 unsigned short value2 = op2->us;
8404 exp->string = PrintUShort(op1->us && value2);
8407 exp->expType = op1->type;
8409 op1->type->refCount++;
8414 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8416 char value2 = op2->c;
8419 exp->string = PrintChar(op1->c && value2);
8422 exp->expType = op1->type;
8424 op1->type->refCount++;
8429 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8431 unsigned char value2 = op2->uc;
8434 exp->string = PrintUChar(op1->uc && value2);
8437 exp->expType = op1->type;
8439 op1->type->refCount++;
8444 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8446 float value2 = op2->f;
8449 exp->string = PrintFloat(op1->f && value2);
8452 exp->expType = op1->type;
8454 op1->type->refCount++;
8459 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8461 double value2 = op2->d;
8464 exp->string = PrintDouble(op1->d && value2);
8467 exp->expType = op1->type;
8469 op1->type->refCount++;
8474 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8476 int value2 = op2->i;
8479 exp->string = PrintInt(op1->i || value2);
8482 exp->expType = op1->type;
8484 op1->type->refCount++;
8489 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8491 unsigned int value2 = op2->ui;
8494 exp->string = PrintUInt(op1->ui || value2);
8497 exp->expType = op1->type;
8499 op1->type->refCount++;
8504 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8506 short value2 = op2->s;
8509 exp->string = PrintShort(op1->s || value2);
8512 exp->expType = op1->type;
8514 op1->type->refCount++;
8519 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8521 unsigned short value2 = op2->us;
8524 exp->string = PrintUShort(op1->us || value2);
8527 exp->expType = op1->type;
8529 op1->type->refCount++;
8534 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8536 char value2 = op2->c;
8539 exp->string = PrintChar(op1->c || value2);
8542 exp->expType = op1->type;
8544 op1->type->refCount++;
8549 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8551 unsigned char value2 = op2->uc;
8554 exp->string = PrintUChar(op1->uc || value2);
8557 exp->expType = op1->type;
8559 op1->type->refCount++;
8564 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8566 float value2 = op2->f;
8569 exp->string = PrintFloat(op1->f || value2);
8572 exp->expType = op1->type;
8574 op1->type->refCount++;
8579 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8581 double value2 = op2->d;
8584 exp->string = PrintDouble(op1->d || value2);
8587 exp->expType = op1->type;
8589 op1->type->refCount++;
8594 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8596 int value2 = op2->i;
8599 exp->string = PrintInt(op1->i > value2);
8602 exp->expType = op1->type;
8604 op1->type->refCount++;
8609 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8611 unsigned int value2 = op2->ui;
8614 exp->string = PrintUInt(op1->ui > value2);
8617 exp->expType = op1->type;
8619 op1->type->refCount++;
8624 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8626 short value2 = op2->s;
8629 exp->string = PrintShort(op1->s > value2);
8632 exp->expType = op1->type;
8634 op1->type->refCount++;
8639 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8641 unsigned short value2 = op2->us;
8644 exp->string = PrintUShort(op1->us > value2);
8647 exp->expType = op1->type;
8649 op1->type->refCount++;
8654 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8656 char value2 = op2->c;
8659 exp->string = PrintChar(op1->c > value2);
8662 exp->expType = op1->type;
8664 op1->type->refCount++;
8669 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8671 unsigned char value2 = op2->uc;
8674 exp->string = PrintUChar(op1->uc > value2);
8677 exp->expType = op1->type;
8679 op1->type->refCount++;
8684 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8686 float value2 = op2->f;
8689 exp->string = PrintFloat(op1->f > value2);
8692 exp->expType = op1->type;
8694 op1->type->refCount++;
8699 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8701 double value2 = op2->d;
8704 exp->string = PrintDouble(op1->d > value2);
8707 exp->expType = op1->type;
8709 op1->type->refCount++;
8714 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8716 int value2 = op2->i;
8719 exp->string = PrintInt(op1->i < value2);
8722 exp->expType = op1->type;
8724 op1->type->refCount++;
8729 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8731 unsigned int value2 = op2->ui;
8734 exp->string = PrintUInt(op1->ui < value2);
8737 exp->expType = op1->type;
8739 op1->type->refCount++;
8744 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8746 short value2 = op2->s;
8749 exp->string = PrintShort(op1->s < value2);
8752 exp->expType = op1->type;
8754 op1->type->refCount++;
8759 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8761 unsigned short value2 = op2->us;
8764 exp->string = PrintUShort(op1->us < value2);
8767 exp->expType = op1->type;
8769 op1->type->refCount++;
8774 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8776 char value2 = op2->c;
8779 exp->string = PrintChar(op1->c < value2);
8782 exp->expType = op1->type;
8784 op1->type->refCount++;
8789 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8791 unsigned char value2 = op2->uc;
8794 exp->string = PrintUChar(op1->uc < value2);
8797 exp->expType = op1->type;
8799 op1->type->refCount++;
8804 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8806 float value2 = op2->f;
8809 exp->string = PrintFloat(op1->f < value2);
8812 exp->expType = op1->type;
8814 op1->type->refCount++;
8819 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8821 double value2 = op2->d;
8824 exp->string = PrintDouble(op1->d < value2);
8827 exp->expType = op1->type;
8829 op1->type->refCount++;
8834 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8836 int value2 = op2->i;
8839 exp->string = PrintInt(op1->i >= value2);
8842 exp->expType = op1->type;
8844 op1->type->refCount++;
8849 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8851 unsigned int value2 = op2->ui;
8854 exp->string = PrintUInt(op1->ui >= value2);
8857 exp->expType = op1->type;
8859 op1->type->refCount++;
8864 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8866 short value2 = op2->s;
8869 exp->string = PrintShort(op1->s >= value2);
8872 exp->expType = op1->type;
8874 op1->type->refCount++;
8879 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8881 unsigned short value2 = op2->us;
8884 exp->string = PrintUShort(op1->us >= value2);
8887 exp->expType = op1->type;
8889 op1->type->refCount++;
8894 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8896 char value2 = op2->c;
8899 exp->string = PrintChar(op1->c >= value2);
8902 exp->expType = op1->type;
8904 op1->type->refCount++;
8909 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8911 unsigned char value2 = op2->uc;
8914 exp->string = PrintUChar(op1->uc >= value2);
8917 exp->expType = op1->type;
8919 op1->type->refCount++;
8924 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8926 float value2 = op2->f;
8929 exp->string = PrintFloat(op1->f >= value2);
8932 exp->expType = op1->type;
8934 op1->type->refCount++;
8939 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8941 double value2 = op2->d;
8944 exp->string = PrintDouble(op1->d >= value2);
8947 exp->expType = op1->type;
8949 op1->type->refCount++;
8954 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8956 int value2 = op2->i;
8959 exp->string = PrintInt(op1->i <= value2);
8962 exp->expType = op1->type;
8964 op1->type->refCount++;
8969 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8971 unsigned int value2 = op2->ui;
8974 exp->string = PrintUInt(op1->ui <= value2);
8977 exp->expType = op1->type;
8979 op1->type->refCount++;
8984 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8986 short value2 = op2->s;
8989 exp->string = PrintShort(op1->s <= value2);
8992 exp->expType = op1->type;
8994 op1->type->refCount++;
8999 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9001 unsigned short value2 = op2->us;
9004 exp->string = PrintUShort(op1->us <= value2);
9007 exp->expType = op1->type;
9009 op1->type->refCount++;
9014 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9016 char value2 = op2->c;
9019 exp->string = PrintChar(op1->c <= value2);
9022 exp->expType = op1->type;
9024 op1->type->refCount++;
9029 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9031 unsigned char value2 = op2->uc;
9034 exp->string = PrintUChar(op1->uc <= value2);
9037 exp->expType = op1->type;
9039 op1->type->refCount++;
9044 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9046 float value2 = op2->f;
9049 exp->string = PrintFloat(op1->f <= value2);
9052 exp->expType = op1->type;
9054 op1->type->refCount++;
9059 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9061 double value2 = op2->d;
9064 exp->string = PrintDouble(op1->d <= value2);
9067 exp->expType = op1->type;
9069 op1->type->refCount++;
9074 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9077 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9090 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9093 exp->expType = op1->type;
9095 op1->type->refCount++;
9100 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9103 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9106 exp->expType = op1->type;
9108 op1->type->refCount++;
9113 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9116 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9119 exp->expType = op1->type;
9121 op1->type->refCount++;
9126 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9129 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9132 exp->expType = op1->type;
9134 op1->type->refCount++;
9139 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9142 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9145 exp->expType = op1->type;
9147 op1->type->refCount++;
9152 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9155 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9158 exp->expType = op1->type;
9160 op1->type->refCount++;
9165 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9168 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9171 exp->expType = op1->type;
9173 op1->type->refCount++;
9178 struct OpTable intOps =
9180 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
9183 struct OpTable uintOps =
9185 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
9188 struct OpTable shortOps =
9190 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
9193 struct OpTable ushortOps =
9195 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
9198 struct OpTable floatOps =
9200 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
9203 struct OpTable doubleOps =
9205 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
9208 struct OpTable charOps =
9210 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
9213 struct OpTable ucharOps =
9215 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
9218 void ReadString(char * output, char * string)
9220 int len = strlen(string);
9222 unsigned int quoted = 0x0, escaped = 0x0;
9224 for(c = 0; c < len; c++)
9226 char ch = string[c];
9282 extern double strtod(char * , char * * );
9284 struct Operand GetOperand(struct Expression * exp)
9290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9293 struct Type * type = exp->expType;
9297 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9299 if(!type->_class->registered->dataType)
9300 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9301 type = type->_class->registered->dataType;
9303 op.kind = type->kind;
9304 op.type = exp->expType;
9305 if(exp->isConstant && exp->type == 2)
9311 if(exp->constant[0] == '\'')
9312 op.c = exp->constant[1];
9313 else if(type->isSigned)
9315 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9320 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9328 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9333 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9341 op.i = strtol(exp->constant, (((void *)0)), 0);
9346 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9354 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9359 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9367 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9372 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9378 op.f = (float)strtod(exp->constant, (((void *)0)));
9382 op.d = (double)strtod(exp->constant, (((void *)0)));
9388 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9398 int __ecereVMethodID_class_OnGetString;
9400 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9402 static void UnusedFunction()
9406 ((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);
9409 extern int __ecereVMethodID_class_OnGetString;
9411 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9413 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9415 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9417 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9418 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9421 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9422 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9424 void * ptr = inst->data + dataMember->offset + offset;
9425 char * result = (((void *)0));
9427 exp->loc = member->loc = inst->loc;
9428 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9429 if(!dataMember->dataType)
9430 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9431 type = dataMember->dataType;
9434 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9436 if(_class->type == 4)
9438 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9442 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9443 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9445 for(item = e->values.first; item; item = item->next)
9447 if((int)item->data == *(int *)ptr)
9449 result = item->name;
9455 exp->identifier = MkIdentifier(result);
9457 exp->destType = MkClassType(_class->fullName);
9458 ProcessExpressionType(exp);
9462 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9464 if(!_class->dataType)
9465 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9466 type = _class->dataType;
9475 FreeExpContents(exp);
9476 exp->constant = PrintFloat(*(float *)ptr);
9482 FreeExpContents(exp);
9483 exp->constant = PrintDouble(*(double *)ptr);
9489 FreeExpContents(exp);
9490 exp->constant = PrintInt(*(int *)ptr);
9496 FreeExpContents(exp);
9497 exp->constant = PrintInt64(*(long long *)ptr);
9503 FreeExpContents(exp);
9504 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9512 ListAdd(memberList, member);
9514 if(parentDataMember->type == 1)
9519 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9521 void PopulateInstance(struct Instantiation * inst)
9523 struct Symbol * classSym = inst->_class->symbol;
9524 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9525 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9526 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9528 inst->members = MkListOne(MkMembersInitList(memberList));
9529 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9531 if(!dataMember->isProperty)
9533 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9534 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9537 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9538 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9540 void * ptr = inst->data + dataMember->offset;
9541 char * result = (((void *)0));
9543 exp->loc = member->loc = inst->loc;
9544 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9545 if(!dataMember->dataType)
9546 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9547 type = dataMember->dataType;
9550 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9552 if(_class->type == 4)
9554 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9558 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9559 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9561 for(item = e->values.first; item; item = item->next)
9563 if((int)item->data == *(int *)ptr)
9565 result = item->name;
9572 exp->identifier = MkIdentifier(result);
9574 exp->destType = MkClassType(_class->fullName);
9575 ProcessExpressionType(exp);
9578 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9580 if(!_class->dataType)
9581 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9582 type = _class->dataType;
9591 exp->constant = PrintFloat(*(float *)ptr);
9597 exp->constant = PrintDouble(*(double *)ptr);
9603 exp->constant = PrintInt(*(int *)ptr);
9609 exp->constant = PrintInt64(*(long long *)ptr);
9615 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9623 ListAdd(memberList, member);
9629 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);
9631 extern void FreeInstance(struct Instantiation * inst);
9633 void ComputeInstantiation(struct Expression * exp)
9635 struct Instantiation * inst = exp->instance;
9636 struct MembersInit * members;
9637 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9638 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9639 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9640 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9641 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9642 int subMemberStackPos = 0;
9645 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9649 if(_class->type == 0 || _class->type == 5)
9650 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9652 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9656 for(members = (*inst->members).first; members; members = members->next)
9658 switch(members->type)
9662 if(members->dataMembers)
9664 struct MemberInit * member;
9666 for(member = (*members->dataMembers).first; member; member = member->next)
9668 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9669 unsigned int found = 0x0;
9670 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9671 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9672 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9673 unsigned int dataMemberOffset;
9677 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9680 if(curMember->isProperty)
9681 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9684 dataMember = curMember;
9685 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9692 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9696 if(prop->memberAccess == 1)
9698 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9699 curClass = prop->_class;
9704 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9705 int _subMemberStackPos = 0;
9707 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9711 if(dataMember->memberAccess == 1)
9713 curMember = dataMember;
9714 curClass = dataMember->_class;
9715 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9716 subMemberStackPos = _subMemberStackPos;
9721 if(found && member->initializer && member->initializer->type == 0)
9723 struct Expression * value = member->initializer->exp;
9724 struct Type * type = (((void *)0));
9728 type = prop->dataType;
9732 if(!dataMember->dataType)
9733 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9734 type = dataMember->dataType;
9736 if(ident && ident->next)
9738 for(ident = ident->next; ident && type; ident = ident->next)
9742 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9744 type = prop->dataType;
9747 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9749 type = dataMember->dataType;
9752 else if(type->kind == 9 || type->kind == 10)
9754 struct Type * memberType;
9756 for(memberType = type->members.first; memberType; memberType = memberType->next)
9758 if(!strcmp(memberType->name, ident->string))
9769 FreeType(value->destType);
9770 value->destType = type;
9773 ComputeExpression(value);
9775 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9779 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9781 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9783 if(!_class->dataType)
9784 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9785 type = _class->dataType;
9790 void * ptr = inst->data + dataMemberOffset;
9792 if(value->type == 2)
9798 GetInt(value, (int *)ptr);
9803 GetInt64(value, (long long *)ptr);
9808 GetIntPtr(value, (intptr_t *)ptr);
9813 GetFloat(value, (float *)ptr);
9818 GetDouble(value, (double *)ptr);
9823 else if(value->type == 1)
9827 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9829 if(_class->type == 1)
9831 ComputeTypeSize(type);
9832 if(value->instance->data)
9833 memcpy(ptr, value->instance->data, type->size);
9840 if(value->type == 1 && value->instance->data)
9842 void (* Set)(void *, void *) = (void *)prop->Set;
9844 Set(inst->data, value->instance->data);
9845 PopulateInstance(inst);
9847 else if(value->type == 2)
9853 void (* Set)(void *, double) = (void *)prop->Set;
9855 Set(inst->data, strtod(value->constant, (((void *)0))));
9860 void (* Set)(void *, float) = (void *)prop->Set;
9862 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9867 void (* Set)(void *, int) = (void *)prop->Set;
9869 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9874 void (* Set)(void *, long long) = (void *)prop->Set;
9876 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9881 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9883 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9888 else if(value->type == 3)
9892 ReadString(temp, value->string);
9893 prop->Set(inst->data, temp);
9897 else if(_class->type == 3)
9901 if(value->type == 2)
9905 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9907 if(_class->type == 3)
9909 if(!_class->dataType)
9910 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9911 type = _class->dataType;
9919 float (* Set)(float) = (void *)prop->Set;
9921 GetFloat(member->initializer->exp, &fValue);
9922 exp->constant = PrintFloat(Set(fValue));
9929 double (* Set)(double) = (void *)prop->Set;
9931 GetDouble(member->initializer->exp, &dValue);
9932 exp->constant = PrintDouble(Set(dValue));
9940 else if(_class->type == 2)
9944 if(value->type == 1 && value->instance->data)
9946 unsigned int (* Set)(void *) = (void *)prop->Set;
9948 bits = Set(value->instance->data);
9950 else if(value->type == 2)
9956 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9960 GetInt(value, &part);
9961 bits = (bits & ~bitMember->mask);
9962 if(!bitMember->dataType)
9963 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9964 type = bitMember->dataType;
9965 if(type->kind == 8 && type->_class && type->_class->registered)
9967 if(!type->_class->registered->dataType)
9968 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9969 type = type->_class->registered->dataType;
9975 bits |= ((char)part << bitMember->pos);
9977 bits |= ((unsigned char)part << bitMember->pos);
9981 bits |= ((short)part << bitMember->pos);
9983 bits |= ((unsigned short)part << bitMember->pos);
9988 bits |= (part << bitMember->pos);
9990 bits |= ((unsigned int)part << bitMember->pos);
9994 bits |= ((long long)part << bitMember->pos);
9996 bits |= ((uint64)part << bitMember->pos);
10000 bits |= ((intptr_t)part << bitMember->pos);
10002 bits |= ((uintptr_t)part << bitMember->pos);
10010 if(_class && _class->type == 3)
10012 ComputeExpression(member->initializer->exp);
10013 exp->constant = member->initializer->exp->constant;
10015 member->initializer->exp->constant = (((void *)0));
10025 if(_class && _class->type == 2)
10027 exp->constant = PrintHexUInt(bits);
10032 FreeInstance(inst);
10036 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10038 if(exp->op.op == SIZEOF)
10040 FreeExpContents(exp);
10042 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10052 struct Expression * exp2 = exp->op.exp2;
10054 exp->op.exp2 = (((void *)0));
10055 FreeExpContents(exp);
10056 FreeType(exp->expType);
10057 FreeType(exp->destType);
10059 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10065 FreeExpContents(exp);
10066 op1->ops.Neg(exp, op1);
10070 if(op1->ops.BitNot)
10072 FreeExpContents(exp);
10073 op1->ops.BitNot(exp, op1);
10079 FreeExpContents(exp);
10080 op1->ops.Not(exp, op1);
10092 FreeExpContents(exp);
10093 op1->ops.Add(exp, op1, op2);
10099 FreeExpContents(exp);
10100 op1->ops.Sub(exp, op1, op2);
10106 FreeExpContents(exp);
10107 op1->ops.Mul(exp, op1, op2);
10113 FreeExpContents(exp);
10114 op1->ops.Div(exp, op1, op2);
10120 FreeExpContents(exp);
10121 op1->ops.Mod(exp, op1, op2);
10127 if(op1->ops.BitAnd)
10129 FreeExpContents(exp);
10130 op1->ops.BitAnd(exp, op1, op2);
10137 FreeExpContents(exp);
10138 op1->ops.BitOr(exp, op1, op2);
10142 if(op1->ops.BitXor)
10144 FreeExpContents(exp);
10145 op1->ops.BitXor(exp, op1, op2);
10149 if(op1->ops.LShift)
10151 FreeExpContents(exp);
10152 op1->ops.LShift(exp, op1, op2);
10156 if(op1->ops.RShift)
10158 FreeExpContents(exp);
10159 op1->ops.RShift(exp, op1, op2);
10165 FreeExpContents(exp);
10166 op1->ops.Equ(exp, op1, op2);
10172 FreeExpContents(exp);
10173 op1->ops.Nqu(exp, op1, op2);
10179 FreeExpContents(exp);
10180 op1->ops.And(exp, op1, op2);
10186 FreeExpContents(exp);
10187 op1->ops.Or(exp, op1, op2);
10193 FreeExpContents(exp);
10194 op1->ops.Grt(exp, op1, op2);
10200 FreeExpContents(exp);
10201 op1->ops.Sma(exp, op1, op2);
10205 if(op1->ops.GrtEqu)
10207 FreeExpContents(exp);
10208 op1->ops.GrtEqu(exp, op1, op2);
10212 if(op1->ops.SmaEqu)
10214 FreeExpContents(exp);
10215 op1->ops.SmaEqu(exp, op1, op2);
10223 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10225 void ComputeExpression(struct Expression * exp)
10227 char expString[10240];
10229 expString[0] = '\0';
10234 ComputeInstantiation(exp);
10239 struct Expression * exp1, * exp2 = (((void *)0));
10240 struct Operand op1 =
10244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10247 struct Operand op2 =
10251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10256 ComputeExpression(exp->op.exp2);
10259 ComputeExpression(exp->op.exp1);
10260 exp1 = exp->op.exp1;
10261 exp2 = exp->op.exp2;
10262 op1 = GetOperand(exp1);
10264 op1.type->refCount++;
10267 op2 = GetOperand(exp2);
10269 op2.type->refCount++;
10274 exp1 = exp->op.exp2;
10275 op1 = GetOperand(exp1);
10277 op1.type->refCount++;
10279 CallOperator(exp, exp1, exp2, &op1, &op2);
10281 FreeType(op1.type);
10283 FreeType(op2.type);
10289 struct Expression * e, * n;
10291 for(e = (*exp->list).first; e; e = n)
10296 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10298 ComputeExpression(e);
10299 FreeType(exp->expType);
10300 FreeType(exp->destType);
10302 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10303 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10314 struct Expression * memberExp = exp->member.exp;
10315 struct Identifier * memberID = exp->member.member;
10316 struct Type * type;
10318 ComputeExpression(exp->member.exp);
10319 type = exp->member.exp->expType;
10322 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)));
10323 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10324 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10325 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10327 if(type->kind == 19 && exp->member.exp->type == 26)
10328 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10332 struct Symbol * classSym;
10335 PrintType(type, string, 0x0, 0x1);
10336 classSym = FindClass(string);
10337 _class = classSym ? classSym->registered : (((void *)0));
10339 if(exp->member.member)
10341 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10343 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10345 if(!prop && !member && _class && exp->member.member)
10347 struct Symbol * classSym = FindClass(exp->member.member->string);
10349 convertTo = _class;
10350 _class = classSym ? classSym->registered : (((void *)0));
10351 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10357 struct Type * type = prop->dataType;
10359 if(_class->type == 3)
10361 if(type->kind == 8)
10363 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10365 if(_class->type == 3)
10367 if(!_class->dataType)
10368 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10369 type = _class->dataType;
10377 float (* Get)(float) = (void *)prop->Get;
10379 GetFloat(exp->member.exp, &value);
10380 exp->constant = PrintFloat(Get ? Get(value) : value);
10387 double (* Get)(double);
10389 GetDouble(exp->member.exp, &value);
10391 Get = (void *)prop->Set;
10393 Get = (void *)prop->Get;
10394 exp->constant = PrintDouble(Get ? Get(value) : value);
10404 struct Expression * value = exp->member.exp;
10405 struct Type * type;
10407 if(!prop->dataType)
10408 ProcessPropertyType(prop);
10409 type = prop->dataType;
10413 else if(_class->type == 1)
10419 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10421 if(propertyClass->type == 1 && value->type == 1)
10423 void (* Set)(void *, void *) = (void *)prop->Set;
10425 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10426 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10427 exp->instance->_class = MkSpecifierName(_class->fullName);
10428 exp->instance->loc = exp->loc;
10430 Set(exp->instance->data, value->instance->data);
10431 PopulateInstance(exp->instance);
10438 void (* Set)(void *, int) = (void *)prop->Set;
10440 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10441 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10442 exp->instance->_class = MkSpecifierName(_class->fullName);
10443 exp->instance->loc = exp->loc;
10445 GetInt(value, &intValue);
10446 Set(exp->instance->data, intValue);
10447 PopulateInstance(exp->instance);
10452 long long intValue;
10453 void (* Set)(void *, long long) = (void *)prop->Set;
10455 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10456 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10457 exp->instance->_class = MkSpecifierName(_class->fullName);
10458 exp->instance->loc = exp->loc;
10460 GetInt64(value, &intValue);
10461 Set(exp->instance->data, intValue);
10462 PopulateInstance(exp->instance);
10468 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10470 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10471 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10472 exp->instance->_class = MkSpecifierName(_class->fullName);
10473 exp->instance->loc = exp->loc;
10475 GetIntPtr(value, &intValue);
10476 Set(exp->instance->data, intValue);
10477 PopulateInstance(exp->instance);
10482 double doubleValue;
10483 void (* Set)(void *, double) = (void *)prop->Set;
10485 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10486 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10487 exp->instance->_class = MkSpecifierName(_class->fullName);
10488 exp->instance->loc = exp->loc;
10490 GetDouble(value, &doubleValue);
10491 Set(exp->instance->data, doubleValue);
10492 PopulateInstance(exp->instance);
10497 else if(_class->type == 2)
10503 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10505 if(propertyClass->type == 1 && value->instance->data)
10507 unsigned int (* Set)(void *) = (void *)prop->Set;
10508 unsigned int bits = Set(value->instance->data);
10510 exp->constant = PrintHexUInt(bits);
10514 else if(_class->type == 2)
10516 unsigned int value;
10517 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10520 GetUInt(exp->member.exp, &value);
10522 exp->constant = PrintHexUInt(bits);
10531 if(_class->type == 2)
10533 unsigned int value;
10535 GetUInt(exp->member.exp, &value);
10540 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10542 if(_class->type == 1)
10544 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10546 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10547 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10548 exp->instance->_class = MkSpecifierName(_class->fullName);
10549 exp->instance->loc = exp->loc;
10551 Get(value, exp->instance->data);
10552 PopulateInstance(exp->instance);
10554 else if(_class->type == 2)
10556 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10557 uint64 bits = Get(value);
10559 exp->constant = PrintHexUInt64(bits);
10566 else if(_class->type == 1)
10568 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10574 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10576 if(_class->type == 1 && value)
10578 void (* Get)(void *, void *) = (void *)prop->Get;
10580 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10581 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10582 exp->instance->_class = MkSpecifierName(_class->fullName);
10583 exp->instance->loc = exp->loc;
10585 Get(value, exp->instance->data);
10586 PopulateInstance(exp->instance);
10597 exp->isConstant = 0x0;
10606 FreeExpression(memberExp);
10607 FreeIdentifier(memberID);
10613 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10615 FreeExpContents(exp);
10616 exp->constant = PrintUInt(ComputeTypeSize(type));
10623 struct Symbol * classSym = exp->_class->symbol;
10625 if(classSym && classSym->registered)
10627 if(classSym->registered->fixed)
10629 FreeSpecifier(exp->_class);
10630 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10635 char className[1024];
10637 strcpy(className, "__ecereClass_");
10638 FullClassNameCat(className, classSym->string, 0x1);
10639 MangleClassName(className);
10640 FreeExpContents(exp);
10642 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10643 exp->member.member = MkIdentifier("structSize");
10650 struct Type * type;
10651 struct Expression * e = exp;
10653 if(exp->type == 11)
10656 ComputeExpression(exp->cast.exp);
10659 if(e && exp->expType)
10661 type = exp->expType;
10662 if(type->kind == 8)
10664 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10666 if(_class && (_class->type == 3 || _class->type == 2))
10668 if(!_class->dataType)
10669 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10670 type = _class->dataType;
10680 GetChar(e, &value);
10681 FreeExpContents(exp);
10682 exp->constant = PrintChar(value);
10687 unsigned char value;
10689 GetUChar(e, &value);
10690 FreeExpContents(exp);
10691 exp->constant = PrintUChar(value);
10700 GetShort(e, &value);
10701 FreeExpContents(exp);
10702 exp->constant = PrintShort(value);
10707 unsigned short value;
10709 GetUShort(e, &value);
10710 FreeExpContents(exp);
10711 exp->constant = PrintUShort(value);
10721 FreeExpContents(exp);
10722 exp->constant = PrintInt(value);
10727 unsigned int value;
10729 GetUInt(e, &value);
10730 FreeExpContents(exp);
10731 exp->constant = PrintUInt(value);
10740 GetInt64(e, &value);
10741 FreeExpContents(exp);
10742 exp->constant = PrintInt64(value);
10749 GetUInt64(e, &value);
10750 FreeExpContents(exp);
10751 exp->constant = PrintUInt64(value);
10760 GetIntPtr(e, &value);
10761 FreeExpContents(exp);
10762 exp->constant = PrintInt64((long long)value);
10769 GetUIntPtr(e, &value);
10770 FreeExpContents(exp);
10771 exp->constant = PrintUInt64((uint64)value);
10779 GetFloat(e, &value);
10780 FreeExpContents(exp);
10781 exp->constant = PrintFloat(value);
10789 GetDouble(e, &value);
10790 FreeExpContents(exp);
10791 exp->constant = PrintDouble(value);
10801 struct Operand op1 =
10805 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10808 struct Operand op2 =
10812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10815 struct Operand op3 =
10819 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10824 ComputeExpression((*exp->cond.exp).last);
10825 if(exp->cond.elseExp)
10826 ComputeExpression(exp->cond.elseExp);
10828 ComputeExpression(exp->cond.cond);
10829 op1 = GetOperand(exp->cond.cond);
10831 op1.type->refCount++;
10832 op2 = GetOperand((*exp->cond.exp).last);
10834 op2.type->refCount++;
10835 op3 = GetOperand(exp->cond.elseExp);
10837 op3.type->refCount++;
10840 FreeExpContents(exp);
10841 op1.ops.Cond(exp, &op1, &op2, &op3);
10844 FreeType(op1.type);
10846 FreeType(op2.type);
10848 FreeType(op3.type);
10854 void ApplyAnyObjectLogic(struct Expression * e);
10856 extern void CopyTypeInto(struct Type * type, struct Type * src);
10858 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10860 unsigned int result = 0x1;
10864 struct __ecereNameSpace__ecere__sys__OldList converts =
10868 struct Conversion * convert;
10870 if(destType->kind == 0)
10872 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10876 for(convert = converts.first; convert; convert = convert->next)
10878 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10882 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10883 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10886 newExp->destType = (((void *)0));
10890 exp->addedThis = 0x1;
10891 exp->member.exp = newExp;
10892 FreeType(exp->member.exp->expType);
10893 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10894 exp->member.exp->expType->classObjectType = objectType;
10895 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10896 exp->member.memberType = 1;
10897 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10898 exp->needCast = 0x1;
10900 exp->expType->refCount++;
10901 ApplyAnyObjectLogic(exp->member.exp);
10907 exp->addedThis = 0x1;
10908 exp->member.exp = newExp;
10909 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10911 newExp->byReference = 0x1;
10913 FreeType(exp->member.exp->expType);
10914 exp->member.exp->expType = (((void *)0));
10915 if(convert->convert->dataType)
10917 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10918 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10919 exp->member.exp->expType->refCount = 1;
10920 exp->member.exp->expType->classObjectType = objectType;
10921 ApplyAnyObjectLogic(exp->member.exp);
10923 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10924 exp->member.memberType = 4;
10925 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10926 exp->needCast = 0x1;
10927 if(convert->resultType)
10928 convert->resultType->refCount++;
10934 FreeType(exp->expType);
10937 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10938 exp->needCast = 0x1;
10940 exp->expType->refCount++;
10944 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10945 exp->needCast = 0x1;
10946 if(convert->resultType)
10947 convert->resultType->refCount++;
10951 if(exp->isConstant && inCompiler)
10952 ComputeExpression(exp);
10953 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10955 if(!result && exp->expType && converts.count)
10957 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10959 if(!result && exp->expType && exp->destType)
10961 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))
10968 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10970 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10972 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10974 void CheckTemplateTypes(struct Expression * exp)
10976 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10978 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10979 struct Statement * compound;
10980 struct Context * context;
10984 exp->destType->refCount++;
10986 exp->expType->refCount++;
10987 newExp->prev = (((void *)0));
10988 newExp->next = (((void *)0));
10989 switch(exp->expType->kind)
10992 if(exp->destType->classObjectType)
10995 exp->destType->refCount--;
10997 exp->expType->refCount--;
10998 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11002 struct __ecereNameSpace__ecere__sys__OldList * specs;
11003 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11004 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11006 context = PushContext();
11007 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11008 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11009 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11011 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11012 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11013 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11014 exp->compound->compound.context = context;
11015 PopContext(context);
11020 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11021 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11025 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11027 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11028 struct Statement * compound;
11029 struct Context * context;
11033 exp->destType->refCount++;
11035 exp->expType->refCount++;
11036 newExp->prev = (((void *)0));
11037 newExp->next = (((void *)0));
11038 switch(exp->expType->kind)
11041 if(exp->destType->classObjectType)
11044 exp->destType->refCount--;
11046 exp->expType->refCount--;
11047 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11051 struct __ecereNameSpace__ecere__sys__OldList * specs;
11052 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11053 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11055 context = PushContext();
11056 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11057 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11058 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11060 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11061 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11062 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11063 exp->compound->compound.context = context;
11064 PopContext(context);
11069 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11072 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11073 ProcessExpressionType((*exp->list).first);
11079 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11080 newExp->needCast = 0x1;
11081 ProcessExpressionType((*exp->list).first);
11087 if(exp->expType->kind == 20)
11089 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11093 FreeType(exp->destType);
11094 FreeType(exp->expType);
11095 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11099 if(newExp->type == 8 && newExp->member.memberType == 3)
11103 exp->op.exp1 = (((void *)0));
11104 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11108 char typeString[1024];
11109 struct Declarator * decl;
11110 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11112 typeString[0] = '\0';
11113 PrintType(exp->expType, typeString, 0x0, 0x0);
11114 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11116 exp->cast.typeName = MkTypeName(specs, decl);
11117 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11118 exp->cast.exp->needCast = 0x1;
11126 extern int strncmp(const char * , const char * , int n);
11128 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11130 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11132 int nsLen = strlen(nameSpace);
11133 struct Symbol * symbol;
11135 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)))
11137 char * s = symbol->string;
11139 if(!strncmp(s, nameSpace, nsLen))
11144 for(c = strlen(s) - 1; c >= 0; c--)
11147 namePart = s + c + 1;
11148 if(!strcmp(namePart, name))
11156 return (((void *)0));
11159 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11162 char nameSpace[1024];
11164 unsigned int gotColon = 0x0;
11166 nameSpace[0] = '\0';
11167 for(c = strlen(name) - 1; c >= 0; c--)
11173 namePart = name + c + 1;
11174 while(c >= 0 && name[c] == ':')
11178 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11182 memcpy(nameSpace, name, c + 1);
11183 nameSpace[c + 1] = (char)0;
11184 return ScanWithNameSpace(tree, nameSpace, namePart);
11188 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11194 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11198 return ScanWithNameSpace(tree, "", namePart);
11200 return (((void *)0));
11203 static void ProcessDeclaration(struct Declaration * decl);
11205 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11207 struct Context * ctx;
11208 struct Symbol * symbol = (((void *)0));
11210 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11212 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11214 symbol = (((void *)0));
11217 char curName[1024];
11219 strcpy(curName, thisNameSpace);
11220 strcat(curName, "::");
11221 strcat(curName, name);
11222 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11225 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11228 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11229 if(symbol || ctx == endContext)
11232 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11234 if(symbol->pointerExternal->type == 0)
11236 struct FunctionDefinition * function = symbol->pointerExternal->function;
11237 struct Context * tmpContext = curContext;
11239 curContext = (((void *)0));
11240 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11241 curContext = tmpContext;
11242 symbol->pointerExternal->symbol = symbol;
11243 DeclareType(symbol->type, 0x1, 0x1);
11244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11245 symbol->id = curExternal->symbol->idCode;
11247 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11250 symbol->id = curExternal->symbol->idCode;
11256 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11258 if(!type->isSigned && type->kind != 22)
11259 ListAdd(specs, MkSpecifier(UNSIGNED));
11264 if(type->_class->registered)
11266 if(!type->_class->registered->dataType)
11267 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11268 GetTypeSpecs(type->_class->registered->dataType, specs);
11273 ListAdd(specs, MkSpecifier(DOUBLE));
11276 ListAdd(specs, MkSpecifier(FLOAT));
11279 ListAdd(specs, MkSpecifier(CHAR));
11282 ListAdd(specs, MkSpecifier(SHORT));
11285 ListAdd(specs, MkSpecifier(INT64));
11288 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11292 ListAdd(specs, MkSpecifier(INT));
11297 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11299 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11306 if(type->_class && type->_class->string)
11308 if(type->classObjectType == 2)
11309 strcat(string, "typed_object");
11311 strcat(string, type->_class->string);
11314 if(type->_class->registered)
11315 strcat(string, type->_class->registered->name);
11317 strcat(string, type->_class->string);
11324 _PrintType(type->type, string, 0x0, printFunction, fullName);
11325 strcat(string, " *");
11330 strcat(string, "void");
11333 strcat(string, type->isSigned ? "int" : "uint");
11336 strcat(string, type->isSigned ? "int64" : "uint64");
11339 strcat(string, type->isSigned ? "intptr" : "uintptr");
11342 strcat(string, type->isSigned ? "char" : "byte");
11345 strcat(string, type->isSigned ? "short" : "uint16");
11348 strcat(string, "float");
11351 strcat(string, "double");
11356 strcat(string, "struct ");
11357 strcat(string, type->enumName);
11359 else if(type->typeName)
11361 strcat(string, type->typeName);
11365 struct Type * member;
11367 strcat(string, "struct {");
11368 for(member = type->members.first; member; member = member->next)
11370 PrintType(member, string, 0x1, fullName);
11371 strcat(string, "; ");
11373 strcat(string, "}");
11379 strcat(string, "union ");
11380 strcat(string, type->enumName);
11382 else if(type->typeName)
11384 strcat(string, type->typeName);
11388 strcat(string, "union ");
11389 strcat(string, "(unnamed)");
11395 strcat(string, "enum ");
11396 strcat(string, type->enumName);
11398 else if(type->typeName)
11400 strcat(string, type->typeName);
11403 strcat(string, "enum");
11409 if(type->dllExport)
11410 strcat(string, "dllexport ");
11411 PrintType(type->returnType, string, 0x0, fullName);
11412 strcat(string, " ");
11419 strcat(string, type->name);
11422 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11428 strcat(string, name);
11434 struct Type * param;
11436 strcat(string, "(");
11437 for(param = type->params.first; param; param = param->next)
11439 PrintType(param, string, 0x1, fullName);
11441 strcat(string, ", ");
11443 strcat(string, ")");
11450 char baseType[1024], size[256];
11451 struct Type * arrayType = type;
11453 baseType[0] = '\0';
11455 while(arrayType->kind == 12)
11458 if(arrayType->enumClass)
11459 strcat(size, arrayType->enumClass->string);
11460 else if(arrayType->arraySizeExp)
11461 PrintExpression(arrayType->arraySizeExp, size);
11463 arrayType = arrayType->arrayType;
11465 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11466 strcat(string, baseType);
11467 strcat(string, size);
11473 strcat(string, "...");
11476 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11479 strcat(string, "subclass(");
11480 strcat(string, type->_class ? type->_class->string : "int");
11481 strcat(string, ")");
11484 strcat(string, type->templateParameter->identifier->string);
11487 strcat(string, "thisclass");
11490 strcat(string, "__builtin_va_list");
11493 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11495 strcat(string, " ");
11496 strcat(string, type->name);
11501 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11503 struct Type * funcType;
11505 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11507 if(funcType && funcType->kind == 11 && type != funcType)
11509 char typeString[1024];
11510 struct Type * param;
11512 PrintType(funcType->returnType, string, 0x0, fullName);
11513 strcat(string, "(");
11514 _PrintType(type, string, printName, 0x0, fullName);
11515 strcat(string, ")");
11516 strcat(string, "(");
11517 for(param = funcType->params.first; param; param = param->next)
11519 PrintType(param, string, 0x1, fullName);
11521 strcat(string, ", ");
11523 strcat(string, ")");
11526 _PrintType(type, string, printName, 0x1, fullName);
11527 if(type->bitFieldCount)
11531 sprintf(count, ":%d", type->bitFieldCount);
11532 strcat(string, count);
11536 static struct Type * FindMember(struct Type * type, char * string)
11538 struct Type * memberType;
11540 for(memberType = type->members.first; memberType; memberType = memberType->next)
11542 if(!memberType->name)
11544 struct Type * subType = FindMember(memberType, string);
11549 else if(!strcmp(memberType->name, string))
11552 return (((void *)0));
11555 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11557 struct Type * memberType;
11559 for(memberType = type->members.first; memberType; memberType = memberType->next)
11561 if(!memberType->name)
11563 struct Type * subType = FindMember(memberType, string);
11567 *offset += memberType->offset;
11571 else if(!strcmp(memberType->name, string))
11573 *offset += memberType->offset;
11577 return (((void *)0));
11580 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11582 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11584 struct Expression * ParseExpressionString(char * expression)
11586 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11587 ((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));
11588 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11590 parsedExpression = (((void *)0));
11592 expression_yyparse();
11593 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11594 return parsedExpression;
11597 extern char * QMkString(char * source);
11599 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11601 void * __ecereTemp1;
11602 struct Identifier * id = exp->identifier;
11603 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11604 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11605 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11606 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11608 if(_class && _class->type == 4)
11610 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11611 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11615 struct __ecereNameSpace__ecere__com__Class * baseClass;
11617 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11619 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11621 for(value = e->values.first; value; value = value->next)
11623 if(!strcmp(value->name, id->string))
11628 char constant[256];
11630 FreeExpContents(exp);
11632 exp->isConstant = 0x1;
11633 if(!strcmp(baseClass->dataTypeString, "int"))
11634 sprintf(constant, "%d", value->data);
11636 sprintf(constant, "0x%X", value->data);
11637 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11638 exp->expType = MkClassType(baseClass->fullName);
11646 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11648 ProcessMethodType(method);
11649 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));
11652 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11654 if(!prop->dataType)
11655 ProcessPropertyType(prop);
11656 exp->expType = prop->dataType;
11658 prop->dataType->refCount++;
11661 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11663 if(!member->dataType)
11664 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11665 exp->expType = member->dataType;
11666 if(member->dataType)
11667 member->dataType->refCount++;
11670 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11672 if(!classProp->dataType)
11673 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11674 if(classProp->constant)
11676 FreeExpContents(exp);
11677 exp->isConstant = 0x1;
11678 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11681 exp->constant = QMkString((char *)classProp->Get(_class));
11685 char constant[256];
11688 sprintf(constant, "%d", classProp->Get(_class));
11689 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11695 exp->expType = classProp->dataType;
11696 if(classProp->dataType)
11697 classProp->dataType->refCount++;
11703 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11705 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11706 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11707 struct __ecereNameSpace__ecere__com__NameSpace * child;
11711 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)))
11713 data = ScanGlobalData(child, name);
11721 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11723 extern char * strncpy(char * , const char * , int n);
11725 static struct GlobalData * FindGlobalData(char * name)
11728 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11730 nameSpace = globalData;
11731 for(c = 0; name[c]; c++)
11733 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11735 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11736 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11738 strncpy(spaceName, name + start, c - start);
11739 spaceName[c - start] = '\0';
11740 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11741 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11743 return (((void *)0));
11744 nameSpace = newSpace;
11752 return ScanGlobalData(nameSpace, name + start);
11754 return (((void *)0));
11757 static int definedExpStackPos;
11759 static void * definedExpStack[512];
11761 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11763 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11765 FreeExpContents(checkedExp);
11766 FreeType(checkedExp->expType);
11767 FreeType(checkedExp->destType);
11768 *checkedExp = *newExp;
11769 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11770 checkedExp->prev = prev;
11771 checkedExp->next = next;
11774 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11776 extern int printf(char * , ...);
11778 void __ecereMethod_Expression_Clear();
11780 void ApplyAnyObjectLogic(struct Expression * e)
11782 struct Type * destType = e->destType;
11784 if(destType && (destType->classObjectType == 3))
11786 if(e && e->expType)
11788 struct Type * type = e->expType;
11789 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11791 if(type->kind == 8 && type->_class && type->_class->registered)
11793 _class = type->_class->registered;
11795 else if(type->kind == 19)
11797 _class = FindClass("ecere::com::Class")->registered;
11801 char string[1024] = "";
11802 struct Symbol * classSym;
11804 PrintType(type, string, 0x0, 0x1);
11805 classSym = FindClass(string);
11807 _class = classSym->registered;
11809 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)))
11811 if(!_class || strcmp(_class->fullName, "char *"))
11813 struct Expression * checkedExp = e, * newExp;
11815 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11817 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11819 if(checkedExp->type == 25)
11821 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11824 checkedExp = (*checkedExp->list).last;
11826 else if(checkedExp->type == 11)
11827 checkedExp = checkedExp->cast.exp;
11829 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11831 newExp = checkedExp->op.exp2;
11832 checkedExp->op.exp2 = (((void *)0));
11833 FreeExpContents(checkedExp);
11834 if(e->expType && e->expType->passAsTemplate)
11838 ComputeTypeSize(e->expType);
11839 sprintf(size, "%d", e->expType->size);
11840 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))))));
11842 ReplaceExpContents(checkedExp, newExp);
11843 e->byReference = 0x1;
11845 else if(!e->byReference || (_class && _class->type == 5))
11847 struct Expression * checkedExp, * newExp;
11850 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;
11852 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11854 struct Context * context = PushContext();
11855 struct Declarator * decl;
11856 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11857 char typeString[1024];
11858 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11860 typeString[0] = '\0';
11862 newExp->prev = (((void *)0));
11863 newExp->next = (((void *)0));
11864 newExp->expType = (((void *)0));
11865 PrintType(e->expType, typeString, 0x0, 0x1);
11866 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11867 newExp->destType = ProcessType(specs, decl);
11868 curContext = context;
11873 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11875 sprintf(name, "__internalValue%03X", internalValueCounter++);
11876 if(!curCompound->compound.declarations)
11877 curCompound->compound.declarations = MkList();
11878 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11879 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11880 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11881 e->compound = MkCompoundStmt((((void *)0)), stmts);
11884 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11886 struct Type * type = e->destType;
11888 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11889 CopyTypeInto(e->destType, type);
11890 e->destType->refCount = 1;
11891 e->destType->classObjectType = 0;
11894 e->compound->compound.context = context;
11895 PopContext(context);
11896 curContext = context->parent;
11900 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11902 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11904 if(checkedExp->type == 25)
11906 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11909 checkedExp = (*checkedExp->list).last;
11911 else if(checkedExp->type == 11)
11912 checkedExp = checkedExp->cast.exp;
11915 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11917 *operand = *checkedExp;
11918 checkedExp->destType = (((void *)0));
11919 checkedExp->expType = (((void *)0));
11920 __ecereMethod_Expression_Clear(checkedExp);
11921 checkedExp->type = 4;
11922 checkedExp->op.op = '&';
11923 checkedExp->op.exp1 = (((void *)0));
11924 checkedExp->op.exp2 = operand;
11933 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))))
11935 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11941 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11944 thisExp->prev = (((void *)0));
11945 thisExp->next = (((void *)0));
11946 __ecereMethod_Expression_Clear(e);
11948 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11949 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11950 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11952 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11953 CopyTypeInto(e->expType, thisExp->expType);
11954 e->expType->byReference = 0x0;
11955 e->expType->refCount = 1;
11956 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))
11958 e->expType->classObjectType = 0;
11963 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11965 if(destType->kind == 14)
11967 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11969 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11971 unsigned int byReference = e->expType->byReference;
11972 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11973 struct Declarator * decl;
11974 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11975 char typeString[1024];
11976 struct Type * type;
11977 int backupClassObjectType;
11979 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11983 backupClassObjectType = type->classObjectType;
11984 type->classObjectType = 0;
11985 typeString[0] = '\0';
11986 PrintType(type, typeString, 0x0, 0x1);
11987 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11988 type->classObjectType = backupClassObjectType;
11990 thisExp->prev = (((void *)0));
11991 thisExp->next = (((void *)0));
11992 __ecereMethod_Expression_Clear(e);
11993 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)))
11997 e->op.exp1 = (((void *)0));
11998 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12003 e->cast.typeName = MkTypeName(specs, decl);
12004 e->cast.exp = thisExp;
12005 e->byReference = 0x1;
12008 e->destType = destType;
12010 destType->refCount++;
12015 extern char * strstr(char * , const char * );
12017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12019 struct __ecereNameSpace__ecere__com__DefinedExpression
12021 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12022 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12025 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12026 } __attribute__ ((gcc_struct));
12028 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12030 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12032 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12034 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12036 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12038 extern struct Expression * CopyExpression(struct Expression * exp);
12040 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12042 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12044 static void ProcessStatement(struct Statement * stmt);
12046 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12048 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12050 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12052 extern char * sourceFile;
12054 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12056 void ProcessExpressionType(struct Expression * exp)
12058 void * __ecereTemp2;
12059 void * __ecereTemp1;
12060 unsigned int unresolved = 0x0;
12061 struct Location oldyylloc = yylloc;
12062 unsigned int notByReference = 0x0;
12064 if(!exp || exp->expType)
12071 struct Identifier * id = exp->identifier;
12075 if(id->_class && id->_class->name)
12077 id->classSym = id->_class->symbol;
12079 if(strstr(id->string, "__ecereClass") == id->string)
12081 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12084 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12086 ReplaceClassMembers(exp, thisClass);
12089 ProcessExpressionType(exp);
12092 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12097 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12101 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12107 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12110 ProcessExpressionType(exp);
12114 else if(currentClass && !id->_class)
12116 if(ResolveIdWithClass(exp, currentClass, 0x1))
12119 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12124 struct Type * type = symbol->type;
12125 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12127 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12129 struct Context * context = SetupTemplatesContext(_class);
12131 type = ReplaceThisClassType(_class);
12132 FinishTemplatesContext(context);
12134 type->refCount = 0;
12136 FreeSpecifier(id->_class);
12137 id->_class = (((void *)0));
12138 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12139 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12140 id->classSym = (((void *)0));
12141 exp->expType = type;
12144 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12145 exp->isConstant = 0x1;
12146 if(symbol->isParam || !strcmp(id->string, "this"))
12148 if(_class && _class->type == 1)
12149 exp->byReference = 0x1;
12151 if(symbol->isIterator)
12153 if(symbol->isIterator == 3)
12156 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12157 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12158 exp->expType = (((void *)0));
12159 ProcessExpressionType(exp);
12161 else if(symbol->isIterator != 4)
12164 exp->member.exp = MkExpIdentifier(exp->identifier);
12165 exp->member.exp->expType = exp->expType;
12166 exp->member.member = MkIdentifier("data");
12167 exp->expType = (((void *)0));
12168 ProcessExpressionType(exp);
12175 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12177 if(thisNameSpace && !(id->_class && !id->_class->name))
12181 strcpy(name, thisNameSpace);
12182 strcat(name, "::");
12183 strcat(name, id->string);
12184 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12187 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12192 for(c = 0; c < definedExpStackPos; c++)
12193 if(definedExpStack[c] == definedExp)
12195 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12197 struct Location backupYylloc = yylloc;
12199 definedExpStack[definedExpStackPos++] = definedExp;
12200 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12201 ((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));
12202 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12204 parsedExpression = (((void *)0));
12206 expression_yyparse();
12207 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12208 yylloc = backupYylloc;
12209 if(parsedExpression)
12211 FreeIdentifier(id);
12213 exp->list = MkListOne(parsedExpression);
12214 parsedExpression->loc = yylloc;
12215 ProcessExpressionType(exp);
12216 definedExpStackPos--;
12219 definedExpStackPos--;
12225 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12231 struct GlobalData * data = (((void *)0));
12233 if(thisNameSpace && !(id->_class && !id->_class->name))
12237 strcpy(name, thisNameSpace);
12238 strcat(name, "::");
12239 strcat(name, id->string);
12240 data = FindGlobalData(name);
12243 data = FindGlobalData(id->string);
12246 DeclareGlobalData(data);
12247 exp->expType = data->dataType;
12249 data->dataType->refCount++;
12250 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12251 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12252 FreeSpecifier(id->_class);
12253 id->_class = (((void *)0));
12258 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12260 if(thisNameSpace && !(id->_class && !id->_class->name))
12264 strcpy(name, thisNameSpace);
12265 strcat(name, "::");
12266 strcat(name, id->string);
12267 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12270 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12275 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12276 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12278 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12279 strcpy(name, "__ecereFunction_");
12280 FullClassNameCat(name, id->string, 0x0);
12281 if(DeclareFunction(function, name))
12283 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12284 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12286 exp->expType = function->dataType;
12287 if(function->dataType)
12288 function->dataType->refCount++;
12289 FreeSpecifier(id->_class);
12290 id->_class = (((void *)0));
12302 struct __ecereNameSpace__ecere__com__Class * _class;
12304 if(!exp->instance->_class)
12306 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12308 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12311 ProcessInstantiationType(exp->instance);
12312 exp->isConstant = exp->instance->isConstant;
12313 if(exp->instance->_class)
12315 exp->expType = MkClassType(exp->instance->_class->name);
12323 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12325 exp->expType = type;
12326 if(exp->constant[0] == '\'')
12328 if((int)((unsigned char *)exp->constant)[1] > 127)
12331 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12334 ch = exp->constant[1];
12335 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12336 exp->constant = PrintUInt(ch);
12338 type->_class = FindClass("unichar");
12339 type->isSigned = 0x0;
12344 type->isSigned = 0x1;
12347 else if(strchr(exp->constant, '.'))
12349 char ch = exp->constant[strlen(exp->constant) - 1];
12355 type->isSigned = 0x1;
12359 if(exp->constant[0] == '0' && exp->constant[1])
12360 type->isSigned = 0x0;
12361 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12362 type->isSigned = 0x0;
12363 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12364 type->isSigned = 0x0;
12366 type->isSigned = 0x1;
12369 exp->isConstant = 0x1;
12375 exp->isConstant = 0x1;
12376 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));
12381 ProcessExpressionType(exp->_new.size);
12382 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));
12383 DeclareType(exp->expType->type, 0x0, 0x0);
12387 ProcessExpressionType(exp->_renew.size);
12388 ProcessExpressionType(exp->_renew.exp);
12389 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));
12390 DeclareType(exp->expType->type, 0x0, 0x0);
12394 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12395 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12396 unsigned int useDestType = 0x0, useSideType = 0x0;
12397 struct Location oldyylloc = yylloc;
12398 unsigned int useSideUnit = 0x0;
12399 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12441 if(exp->op.op != '*' || exp->op.exp1)
12448 if(exp->op.op == '&')
12450 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12452 struct Identifier * id = exp->op.exp2->identifier;
12453 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12455 if(symbol && symbol->isIterator == 2)
12458 exp->member.exp = exp->op.exp2;
12459 exp->member.member = MkIdentifier("key");
12460 exp->expType = (((void *)0));
12461 exp->op.exp2->expType = symbol->type;
12462 symbol->type->refCount++;
12463 ProcessExpressionType(exp);
12471 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))
12473 if(exp->op.exp1->destType)
12474 FreeType(exp->op.exp1->destType);
12475 exp->op.exp1->destType = exp->destType;
12477 exp->destType->refCount++;
12481 if(exp->op.exp1->destType)
12482 FreeType(exp->op.exp1->destType);
12483 exp->op.exp1->destType = dummy;
12486 if(exp->op.exp1->destType && exp->op.op != '=')
12487 exp->op.exp1->destType->count++;
12488 ProcessExpressionType(exp->op.exp1);
12489 if(exp->op.exp1->destType && exp->op.op != '=')
12490 exp->op.exp1->destType->count--;
12491 if(exp->op.exp1->destType == dummy)
12494 exp->op.exp1->destType = (((void *)0));
12496 type1 = exp->op.exp1->expType;
12500 char expString[10240];
12502 expString[0] = '\0';
12503 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12507 exp->op.exp2->destType = exp->op.exp1->expType;
12508 if(exp->op.exp1->expType)
12509 exp->op.exp1->expType->refCount++;
12513 exp->op.exp2->destType = exp->destType;
12515 exp->destType->refCount++;
12519 exp->expType = type1;
12524 PrintExpression(exp->op.exp2, expString);
12525 if(type1 && type1->kind == 13)
12527 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)
12528 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12529 else if(exp->op.op == '=')
12531 if(exp->op.exp2->destType)
12532 FreeType(exp->op.exp2->destType);
12533 exp->op.exp2->destType = type1;
12540 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)
12544 if(exp->op.exp2->destType)
12545 FreeType(exp->op.exp2->destType);
12546 exp->op.exp2->destType = type1;
12553 exp->expType = type1;
12555 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)))
12557 if(exp->op.exp2->destType)
12558 FreeType(exp->op.exp2->destType);
12559 exp->op.exp2->destType = exp->destType;
12561 exp->destType->refCount++;
12565 if(exp->op.exp2->destType)
12566 FreeType(exp->op.exp2->destType);
12567 exp->op.exp2->destType = dummy;
12570 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12572 FreeType(exp->op.exp2->destType);
12573 exp->op.exp2->destType = type1;
12576 if(exp->op.exp2->destType && exp->op.op != '=')
12577 exp->op.exp2->destType->count++;
12578 ProcessExpressionType(exp->op.exp2);
12579 if(exp->op.exp2->destType && exp->op.op != '=')
12580 exp->op.exp2->destType->count--;
12581 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12583 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)
12585 if(exp->op.op != '=' && type1->type->kind == 0)
12586 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12588 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)))
12590 if(exp->op.op == ADD_ASSIGN)
12591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12593 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))
12595 if(exp->op.op == ADD_ASSIGN)
12596 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12598 else if(inCompiler)
12600 char type1String[1024];
12601 char type2String[1024];
12603 type1String[0] = '\0';
12604 type2String[0] = '\0';
12605 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12606 PrintType(type1, type2String, 0x0, 0x1);
12607 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12608 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12611 if(exp->op.exp2->destType == dummy)
12614 exp->op.exp2->destType = (((void *)0));
12616 type2 = exp->op.exp2->expType;
12619 if(exp->op.op == SIZEOF)
12621 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12622 exp->isConstant = 0x1;
12624 else if(exp->op.op == '*' && !exp->op.exp1)
12626 exp->expType = Dereference(type2);
12627 if(type2 && type2->kind == 8)
12628 notByReference = 0x1;
12630 else if(exp->op.op == '&' && !exp->op.exp1)
12631 exp->expType = Reference(type2);
12638 if(exp->op.exp1->destType)
12639 FreeType(exp->op.exp1->destType);
12640 exp->op.exp1->destType = MkClassType("bool");
12641 exp->op.exp1->destType->truth = 0x1;
12642 if(!exp->op.exp1->expType)
12643 ProcessExpressionType(exp->op.exp1);
12645 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12646 FreeType(exp->op.exp1->expType);
12647 exp->op.exp1->expType = MkClassType("bool");
12648 exp->op.exp1->expType->truth = 0x1;
12652 if(exp->op.exp2->destType)
12653 FreeType(exp->op.exp2->destType);
12654 exp->op.exp2->destType = MkClassType("bool");
12655 exp->op.exp2->destType->truth = 0x1;
12656 if(!exp->op.exp2->expType)
12657 ProcessExpressionType(exp->op.exp2);
12659 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12660 FreeType(exp->op.exp2->expType);
12661 exp->op.exp2->expType = MkClassType("bool");
12662 exp->op.exp2->expType->truth = 0x1;
12665 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")))))
12667 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12669 if(exp->op.exp2->destType)
12670 FreeType(exp->op.exp2->destType);
12671 exp->op.exp2->destType = type1;
12673 if(exp->op.exp1->destType)
12674 FreeType(exp->op.exp1->destType);
12675 exp->op.exp1->destType = type2;
12677 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)
12678 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);
12679 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12681 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12685 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12687 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12688 ProcessExpressionType(exp->op.exp1);
12689 if(type2->kind != 13)
12691 ProcessExpressionType(classExp);
12692 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"))))))));
12693 if(!exp->op.exp2->expType)
12694 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12695 ProcessExpressionType(exp->op.exp2);
12699 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)))
12701 if(type1->kind != 8 && type1->type->kind == 0)
12702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12703 exp->expType = type1;
12707 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)))
12709 if(type2->kind != 8 && type2->type->kind == 0)
12710 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12711 exp->expType = type2;
12715 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))
12717 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12721 unsigned int success = 0x0;
12723 if(type1->kind == 13 && type2->kind == 13)
12725 if(exp->op.op == '+')
12726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12727 else if(exp->op.op == '-')
12729 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12731 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12733 if(type1->type->kind == 20)
12735 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12739 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12741 ProcessExpressionType(classExp);
12743 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")))))));
12744 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12752 if(!success && exp->op.exp1->type == 2)
12754 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12757 FreeType(exp->expType);
12758 exp->expType = exp->op.exp1->destType;
12759 if(exp->op.exp1->destType)
12760 exp->op.exp1->destType->refCount++;
12763 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12766 FreeType(exp->expType);
12767 exp->expType = exp->op.exp2->destType;
12768 if(exp->op.exp2->destType)
12769 exp->op.exp2->destType->refCount++;
12775 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12778 FreeType(exp->expType);
12779 exp->expType = exp->op.exp2->destType;
12780 if(exp->op.exp2->destType)
12781 exp->op.exp2->destType->refCount++;
12784 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12787 FreeType(exp->expType);
12788 exp->expType = exp->op.exp1->destType;
12789 if(exp->op.exp1->destType)
12790 exp->op.exp1->destType->refCount++;
12796 char expString1[10240];
12797 char expString2[10240];
12801 expString1[0] = '\0';
12802 expString2[0] = '\0';
12807 PrintExpression(exp->op.exp1, expString1);
12808 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12809 PrintExpression(exp->op.exp2, expString2);
12810 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12811 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12812 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12814 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12818 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12820 if(exp->op.exp1->destType)
12821 FreeType(exp->op.exp1->destType);
12822 exp->op.exp1->destType = type2->_class->registered->dataType;
12823 if(type2->_class->registered->dataType)
12824 type2->_class->registered->dataType->refCount++;
12825 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12826 exp->expType = type2;
12830 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12832 if(exp->op.exp2->destType)
12833 FreeType(exp->op.exp2->destType);
12834 exp->op.exp2->destType = type1->_class->registered->dataType;
12835 if(type1->_class->registered->dataType)
12836 type1->_class->registered->dataType->refCount++;
12837 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12838 exp->expType = type1;
12844 unsigned int valid = 0x0;
12846 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12848 if(exp->op.exp2->destType)
12849 FreeType(exp->op.exp2->destType);
12850 if(!type1->_class->registered->dataType)
12851 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12852 exp->op.exp2->destType = type1->_class->registered->dataType;
12853 exp->op.exp2->destType->refCount++;
12854 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12855 type2 = exp->op.exp2->destType;
12856 exp->expType = type2;
12859 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12861 if(exp->op.exp1->destType)
12862 FreeType(exp->op.exp1->destType);
12863 if(!type2->_class->registered->dataType)
12864 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12865 exp->op.exp1->destType = type2->_class->registered->dataType;
12866 exp->op.exp1->destType->refCount++;
12867 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12868 type1 = exp->op.exp1->destType;
12869 exp->expType = type1;
12872 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12874 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12876 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12879 FreeType(exp->expType);
12880 exp->expType = exp->op.exp1->expType;
12881 if(exp->op.exp2->expType)
12882 exp->op.exp1->expType->refCount++;
12886 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12888 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12891 FreeType(exp->expType);
12892 exp->expType = exp->op.exp2->expType;
12893 if(exp->op.exp2->expType)
12894 exp->op.exp2->expType->refCount++;
12901 if(exp->op.exp2->destType)
12902 FreeType(exp->op.exp2->destType);
12903 exp->op.exp2->destType = type1;
12905 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12908 FreeType(exp->expType);
12909 exp->expType = exp->op.exp2->destType;
12910 if(exp->op.exp2->destType)
12911 exp->op.exp2->destType->refCount++;
12913 else if(type1 && type2)
12915 char expString1[10240];
12916 char expString2[10240];
12917 char type1String[1024];
12918 char type2String[1024];
12920 expString1[0] = '\0';
12921 expString2[0] = '\0';
12922 type1String[0] = '\0';
12923 type2String[0] = '\0';
12926 PrintExpression(exp->op.exp1, expString1);
12927 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12928 PrintExpression(exp->op.exp2, expString2);
12929 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12930 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12931 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12933 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12934 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12936 exp->expType = exp->op.exp1->expType;
12937 if(exp->op.exp1->expType)
12938 exp->op.exp1->expType->refCount++;
12940 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12942 exp->expType = exp->op.exp2->expType;
12943 if(exp->op.exp2->expType)
12944 exp->op.exp2->expType->refCount++;
12951 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12953 struct Type * oldType = exp->op.exp1->expType;
12955 exp->op.exp1->expType = (((void *)0));
12956 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12959 exp->op.exp1->expType = oldType;
12961 if(exp->op.exp1->destType)
12962 FreeType(exp->op.exp1->destType);
12963 exp->op.exp1->destType = type2;
12965 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12968 FreeType(exp->expType);
12969 exp->expType = exp->op.exp1->destType;
12970 if(exp->op.exp1->destType)
12971 exp->op.exp1->destType->refCount++;
12975 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12977 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12979 if(exp->op.exp1->destType)
12980 FreeType(exp->op.exp1->destType);
12981 exp->op.exp1->destType = type2->_class->registered->dataType;
12982 if(type2->_class->registered->dataType)
12983 type2->_class->registered->dataType->refCount++;
12984 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12986 if(exp->op.op == '!')
12988 exp->expType = MkClassType("bool");
12989 exp->expType->truth = 0x1;
12993 exp->expType = type2;
12998 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13000 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13002 if(exp->op.exp2->destType)
13003 FreeType(exp->op.exp2->destType);
13004 exp->op.exp2->destType = type1->_class->registered->dataType;
13005 if(type1->_class->registered->dataType)
13006 type1->_class->registered->dataType->refCount++;
13007 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13009 exp->expType = type1;
13015 if(exp->op.exp1 && !exp->op.exp1->expType)
13017 char expString[10000];
13019 expString[0] = '\0';
13022 PrintExpression(exp->op.exp1, expString);
13023 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13028 if(exp->op.exp2 && !exp->op.exp2->expType)
13030 char expString[10240];
13032 expString[0] = '\0';
13035 PrintExpression(exp->op.exp2, expString);
13036 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13039 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13043 FreeType(exp->expType);
13044 exp->expType = MkClassType("bool");
13045 exp->expType->truth = 0x1;
13047 if(exp->op.op != SIZEOF)
13048 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13049 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13051 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13053 yylloc = oldyylloc;
13060 struct Expression * e;
13062 exp->isConstant = 0x1;
13063 for(e = (*exp->list).first; e; e = e->next)
13065 unsigned int inced = 0x0;
13069 FreeType(e->destType);
13070 e->destType = exp->destType;
13073 exp->destType->refCount++;
13074 e->destType->count++;
13078 ProcessExpressionType(e);
13080 exp->destType->count--;
13081 if(!exp->expType && !e->next)
13083 exp->expType = e->expType;
13085 e->expType->refCount++;
13088 exp->isConstant = 0x0;
13090 e = (*exp->list).first;
13091 if(!e->next && e->type == 8)
13093 struct Expression * next = exp->next, * prev = exp->prev;
13095 FreeType(exp->expType);
13096 FreeType(exp->destType);
13097 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13101 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13102 ProcessExpressionType(exp);
13108 struct Expression * e;
13110 exp->isConstant = 0x1;
13111 ProcessExpressionType(exp->index.exp);
13112 if(!exp->index.exp->isConstant)
13113 exp->isConstant = 0x0;
13114 if(exp->index.exp->expType)
13116 struct Type * source = exp->index.exp->expType;
13118 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)
13120 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13122 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13123 if(exp->index.index && (*exp->index.index).last)
13125 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13129 for(e = (*exp->index.index).first; e; e = e->next)
13131 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13134 FreeType(e->destType);
13135 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13137 ProcessExpressionType(e);
13142 exp->isConstant = 0x0;
13145 exp->expType = Dereference(exp->index.exp->expType);
13147 DeclareType(exp->expType, 0x0, 0x0);
13152 struct Expression * e;
13153 struct Type * functionType;
13154 struct Type * methodType = (((void *)0));
13160 PrintExpression(exp->call.exp, name);
13161 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13163 PrintExpression(exp->call.exp, name);
13166 if(exp->call.exp->type == 0)
13168 struct Expression * idExp = exp->call.exp;
13169 struct Identifier * id = idExp->identifier;
13171 if(!strcmp(id->string, "__ENDIAN_PAD"))
13173 exp->expType = ProcessTypeString("int", 0x1);
13174 if(exp->call.arguments && (*exp->call.arguments).first)
13175 ProcessExpressionType((*exp->call.arguments).first);
13178 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13180 struct Expression * a = (((void *)0));
13181 struct Expression * b = (((void *)0));
13182 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13184 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13186 a = (*exp->call.arguments).first;
13187 b = (*exp->call.arguments).last;
13191 else if((*exp->call.arguments).count == 1)
13193 a = (*exp->call.arguments).first;
13198 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13199 idExp->identifier = (((void *)0));
13200 FreeExpContents(exp);
13201 ProcessExpressionType(a);
13203 ProcessExpressionType(b);
13205 exp->list = MkList();
13206 if(a->expType && (!b || b->expType))
13208 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13212 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13213 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13214 struct Declaration * decl;
13215 char temp1[1024], temp2[1024];
13217 GetTypeSpecs(a->expType, specs);
13218 if(a && !a->isConstant && a->type != 0)
13220 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13221 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13222 tempExp1 = QMkExpId(temp1);
13223 tempExp1->expType = a->expType;
13225 a->expType->refCount++;
13226 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13228 if(b && !b->isConstant && b->type != 0)
13230 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13231 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13232 tempExp2 = QMkExpId(temp2);
13233 tempExp2->expType = b->expType;
13235 b->expType->refCount++;
13236 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13238 decl = MkDeclaration(specs, decls);
13239 if(!curCompound->compound.declarations)
13240 curCompound->compound.declarations = MkList();
13241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13245 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13247 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13249 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13250 exp->expType = a->expType;
13252 a->expType->refCount++;
13254 else if(!strcmp(id->string, "Abs"))
13256 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13257 exp->expType = a->expType;
13259 a->expType->refCount++;
13261 else if(!strcmp(id->string, "Sgn"))
13263 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"))))));
13264 exp->expType = ProcessTypeString("int", 0x0);
13266 FreeExpression(tempExp1);
13268 FreeExpression(tempExp2);
13269 FreeIdentifier(id);
13275 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13277 if(!exp->call.exp->destType)
13279 exp->call.exp->destType = dummy;
13282 ProcessExpressionType(exp->call.exp);
13283 if(exp->call.exp->destType == dummy)
13286 exp->call.exp->destType = (((void *)0));
13290 functionType = exp->call.exp->expType;
13291 if(functionType && functionType->kind == 16)
13293 methodType = functionType;
13294 functionType = methodType->method->dataType;
13295 if(exp->call.exp->expType->usedClass)
13297 char typeString[1024];
13299 typeString[0] = '\0';
13300 PrintType(functionType, typeString, 0x1, 0x1);
13301 if(strstr(typeString, "thisclass"))
13303 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13304 struct Declarator * decl;
13307 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13309 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13310 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13311 thisClassParams = 0x0;
13312 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13314 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13316 thisClass = exp->call.exp->expType->usedClass;
13317 ProcessDeclarator(decl);
13318 thisClass = backupThisClass;
13320 thisClassParams = 0x1;
13321 functionType = ProcessType(specs, decl);
13322 functionType->refCount = 0;
13323 FinishTemplatesContext(context);
13325 FreeList(specs, FreeSpecifier);
13326 FreeDeclarator(decl);
13330 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13332 struct Type * type = functionType->type;
13334 if(!functionType->refCount)
13336 functionType->type = (((void *)0));
13337 FreeType(functionType);
13339 functionType = type;
13341 if(functionType && functionType->kind != 11)
13343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13345 else if(functionType)
13347 unsigned int emptyParams = 0x0, noParams = 0x0;
13348 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13349 struct Type * type = functionType->params.first;
13350 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13352 struct Location oldyylloc = yylloc;
13356 if(functionType->extraParam && e)
13358 e->destType = MkClassType(functionType->thisClass->string);
13361 if(!functionType->staticMethod)
13363 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13365 type = MkClassType(memberExp->member.exp->expType->_class->string);
13368 e->destType = type;
13370 type = functionType->params.first;
13373 type->refCount = 0;
13375 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13377 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13380 e->destType = type;
13382 type = functionType->params.first;
13385 type->refCount = 0;
13388 if(type && type->kind == 0)
13391 if(!type->refCount)
13393 type = (((void *)0));
13395 for(; e; e = e->next)
13397 if(!type && !emptyParams)
13400 if(methodType && methodType->methodClass)
13401 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);
13403 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);
13406 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13408 struct Type * templatedType = (((void *)0));
13409 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13410 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13413 if(_class && _class->templateArgs)
13415 struct __ecereNameSpace__ecere__com__Class * sClass;
13417 for(sClass = _class; sClass; sClass = sClass->base)
13419 if(sClass->templateClass)
13420 sClass = sClass->templateClass;
13422 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13424 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13426 struct __ecereNameSpace__ecere__com__Class * nextClass;
13428 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13430 if(nextClass->templateClass)
13431 nextClass = nextClass->templateClass;
13432 id += nextClass->templateParams.count;
13442 if(curParam && _class->templateArgs[id].dataTypeString)
13444 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13447 struct Context * context = SetupTemplatesContext(_class);
13449 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13450 FinishTemplatesContext(context);
13452 e->destType = templatedType;
13455 templatedType->passAsTemplate = 0x1;
13460 e->destType = type;
13467 e->destType = type;
13471 if(type && type->kind != 14)
13473 struct Type * next = type->next;
13475 if(!type->refCount)
13480 if(type && type->kind != 14)
13482 if(methodType && methodType->methodClass)
13483 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);
13485 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);
13487 yylloc = oldyylloc;
13488 if(type && !type->refCount)
13493 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13494 if(exp->call.exp->type == 0)
13496 char * string = exp->call.exp->identifier->string;
13500 struct Symbol * symbol;
13501 struct Location oldyylloc = yylloc;
13503 yylloc = exp->call.exp->identifier->loc;
13504 if(strstr(string, "__builtin_") == string)
13507 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13508 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));
13509 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13510 if(strstr(symbol->string, "::"))
13511 globalContext->hasNameSpace = 0x1;
13512 yylloc = oldyylloc;
13515 else if(exp->call.exp->type == 8)
13519 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13520 if(!functionType->returnType)
13522 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13525 if(functionType && functionType->kind == 11)
13527 exp->expType = functionType->returnType;
13528 if(functionType->returnType)
13529 functionType->returnType->refCount++;
13530 if(!functionType->refCount)
13531 FreeType(functionType);
13533 if(exp->call.arguments)
13535 for(e = (*exp->call.arguments).first; e; e = e->next)
13537 struct Type * destType = e->destType;
13539 ProcessExpressionType(e);
13546 struct Type * type;
13547 struct Location oldyylloc = yylloc;
13548 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13550 exp->thisPtr = thisPtr;
13551 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13553 exp->member.member->classSym = exp->member.member->_class->symbol;
13555 ProcessExpressionType(exp->member.exp);
13556 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)
13558 exp->isConstant = 0x0;
13561 exp->isConstant = exp->member.exp->isConstant;
13562 type = exp->member.exp->expType;
13564 if(type && (type->kind == 20))
13566 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13567 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13571 for(param = _class->templateParams.first; param; param = param->next)
13573 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13577 if(param && param->defaultArg.member)
13579 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13583 struct Expression * expMember = exp->member.exp;
13584 struct Declarator * decl;
13585 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13586 char thisClassTypeString[1024];
13588 FreeIdentifier(exp->member.member);
13589 ProcessExpressionType(argExp);
13591 char * colon = strstr(param->defaultArg.memberString, "::");
13595 char className[1024];
13596 struct __ecereNameSpace__ecere__com__Class * sClass;
13598 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13599 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13602 strcpy(thisClassTypeString, _class->fullName);
13604 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13605 exp->expType = ProcessType(specs, decl);
13606 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13608 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13609 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13611 int paramCount = 0;
13612 int lastParam = -1;
13613 char templateString[1024];
13614 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13616 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13617 for(cClass = expClass; cClass; cClass = cClass->base)
13621 for(param = cClass->templateParams.first; param; param = param->next)
13624 struct __ecereNameSpace__ecere__com__Class * sClass;
13625 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13627 for(sClass = cClass->base; sClass; sClass = sClass->base)
13628 id += sClass->templateParams.count;
13629 arg = expClass->templateArgs[id];
13630 for(sClass = _class; sClass; sClass = sClass->base)
13632 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13634 struct __ecereNameSpace__ecere__com__Class * nextClass;
13636 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13637 p += nextClass->templateParams.count;
13638 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13640 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13642 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13644 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13645 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13652 char argument[256];
13654 argument[0] = '\0';
13655 switch(param->type)
13659 char expString[1024];
13660 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13661 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13662 struct Expression * exp;
13663 char * string = PrintHexUInt64(arg.expression.ui64);
13665 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13666 ProcessExpressionType(exp);
13667 ComputeExpression(exp);
13668 expString[0] = '\0';
13669 PrintExpression(exp, expString);
13670 strcat(argument, expString);
13671 FreeExpression(exp);
13676 strcat(argument, arg.member->name);
13681 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13683 if(!strcmp(arg.dataTypeString, "thisclass"))
13684 strcat(argument, thisClassTypeString);
13686 strcat(argument, arg.dataTypeString);
13694 strcat(templateString, ", ");
13695 if(lastParam != p - 1)
13697 strcat(templateString, param->name);
13698 strcat(templateString, " = ");
13700 strcat(templateString, argument);
13709 int len = strlen(templateString);
13711 if(templateString[len - 1] == '>')
13712 templateString[len++] = ' ';
13713 templateString[len++] = '>';
13714 templateString[len++] = '\0';
13717 struct Context * context = SetupTemplatesContext(_class);
13719 FreeType(exp->expType);
13720 exp->expType = ProcessTypeString(templateString, 0x0);
13721 FinishTemplatesContext(context);
13725 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")))))))));
13728 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13730 type = ProcessTemplateParameterType(type->templateParameter);
13733 if(type && (type->kind == 20))
13735 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13737 struct Identifier * id = exp->member.member;
13738 int typeKind = type->kind;
13739 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));
13741 if(typeKind == 19 && exp->member.exp->type == 26)
13743 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13746 if(id && (typeKind == 3 || typeKind == 15))
13747 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13750 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13751 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13752 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13753 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13754 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13756 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13757 exp->member.memberType = 1;
13758 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13759 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13762 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13764 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13765 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13767 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13769 member = (((void *)0));
13771 if(!member && !prop)
13772 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13773 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13774 exp->member.thisPtr = 0x1;
13780 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13781 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13782 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13784 if(!prop && !member)
13786 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13789 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13790 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13791 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13796 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13797 prop = (((void *)0));
13799 member = (((void *)0));
13803 if(!prop && !member)
13804 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13805 if(!prop && !member && !method)
13809 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13812 exp->member.memberType = 5;
13813 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13817 char structName[1024];
13818 struct Identifier * id = exp->member.member;
13819 struct Expression * classExp = exp->member.exp;
13822 FreeType(classExp->expType);
13823 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13824 strcpy(structName, "__ecereClassData_");
13825 FullClassNameCat(structName, type->_class->string, 0x0);
13827 exp->member.member = id;
13828 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"))))))));
13830 ProcessExpressionType(exp);
13836 struct Symbol * classSym = FindClass(id->string);
13840 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13843 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13849 exp->member.memberType = 1;
13850 if(!prop->dataType)
13851 ProcessPropertyType(prop);
13852 exp->expType = prop->dataType;
13854 prop->dataType->refCount++;
13858 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13860 FreeExpContents(exp);
13862 exp->identifier = MkIdentifier("class");
13863 ProcessExpressionType(exp);
13866 exp->member.memberType = 3;
13867 DeclareStruct(_class->fullName, 0x0);
13868 if(!member->dataType)
13870 struct Context * context = SetupTemplatesContext(_class);
13872 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13873 FinishTemplatesContext(context);
13875 exp->expType = member->dataType;
13876 if(member->dataType)
13877 member->dataType->refCount++;
13879 else if(revConvert)
13881 exp->member.memberType = 4;
13882 exp->expType = MkClassType(revConvert->_class->fullName);
13888 exp->member.memberType = 2;
13890 if(!method->dataType)
13891 ProcessMethodType(method);
13892 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));
13893 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13894 exp->expType->usedClass = _class;
13896 else if(!classProp)
13898 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13900 FreeExpContents(exp);
13902 exp->identifier = MkIdentifier("class");
13903 ProcessExpressionType(exp);
13906 yylloc = exp->member.member->loc;
13907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13909 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13911 if(_class && exp->expType)
13913 struct __ecereNameSpace__ecere__com__Class * tClass;
13916 while(tClass && !tClass->templateClass)
13917 tClass = tClass->base;
13918 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13921 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13922 struct __ecereNameSpace__ecere__com__Class * sClass;
13924 for(sClass = tClass; sClass; sClass = sClass->base)
13927 if(sClass->templateClass)
13928 sClass = sClass->templateClass;
13929 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13931 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13933 for(sClass = sClass->base; sClass; sClass = sClass->base)
13934 id += sClass->templateParams.count;
13942 if(curParam && tClass->templateArgs[id].dataTypeString)
13944 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13945 struct Context * context = SetupTemplatesContext(tClass);
13947 FreeType(exp->expType);
13948 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13951 if(exp->expType->kind == 21)
13953 FreeType(exp->expType);
13954 exp->expType = ReplaceThisClassType(_class);
13956 if(tClass->templateClass)
13957 exp->expType->passAsTemplate = 0x1;
13960 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13961 if(exp->destType->kind == 21)
13963 FreeType(exp->destType);
13964 exp->destType = ReplaceThisClassType(_class);
13968 FinishTemplatesContext(context);
13971 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13974 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13975 struct __ecereNameSpace__ecere__com__Class * sClass;
13977 for(sClass = tClass; sClass; sClass = sClass->base)
13980 if(sClass->templateClass)
13981 sClass = sClass->templateClass;
13982 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13984 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13986 for(sClass = sClass->base; sClass; sClass = sClass->base)
13987 id += sClass->templateParams.count;
13997 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13998 struct Context * context = SetupTemplatesContext(tClass);
13999 struct Type * basicType;
14001 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14004 if(basicType->kind == 21)
14006 FreeType(basicType);
14007 basicType = ReplaceThisClassType(_class);
14009 FreeType(exp->expType);
14010 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));
14013 exp->destType = exp->expType;
14014 exp->destType->refCount++;
14017 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14018 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14019 struct Declarator * decl;
14021 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14024 exp->destType->refCount++;
14026 exp->expType->refCount++;
14028 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14029 exp->cast.exp = newExp;
14032 FinishTemplatesContext(context);
14035 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14037 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14041 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14044 int paramCount = 0;
14045 int lastParam = -1;
14046 char templateString[1024];
14047 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14049 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14050 while(cClass != expClass)
14052 struct __ecereNameSpace__ecere__com__Class * sClass;
14054 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14057 for(param = cClass->templateParams.first; param; param = param->next)
14059 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14062 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14063 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14065 while(cClassCur != tClass && !paramCur)
14067 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14069 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14071 cClassCur = sClassCur;
14072 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14074 if(!strcmp(paramCur->name, param->name))
14081 if(paramCur && paramCur->type == 0)
14082 arg = tClass->templateArgs[cp];
14084 arg = expClass->templateArgs[p];
14086 char argument[256];
14088 argument[0] = '\0';
14089 switch(param->type)
14093 char expString[1024];
14094 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14095 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14096 struct Expression * exp;
14097 char * string = PrintHexUInt64(arg.expression.ui64);
14099 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14100 ProcessExpressionType(exp);
14101 ComputeExpression(exp);
14102 expString[0] = '\0';
14103 PrintExpression(exp, expString);
14104 strcat(argument, expString);
14105 FreeExpression(exp);
14110 strcat(argument, arg.member->name);
14115 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14116 strcat(argument, arg.dataTypeString);
14123 strcat(templateString, ", ");
14124 if(lastParam != p - 1)
14126 strcat(templateString, param->name);
14127 strcat(templateString, " = ");
14129 strcat(templateString, argument);
14138 int len = strlen(templateString);
14140 if(templateString[len - 1] == '>')
14141 templateString[len++] = ' ';
14142 templateString[len++] = '>';
14143 templateString[len++] = '\0';
14145 FreeType(exp->expType);
14147 struct Context * context = SetupTemplatesContext(tClass);
14149 exp->expType = ProcessTypeString(templateString, 0x0);
14150 FinishTemplatesContext(context);
14157 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)");
14159 else if(type && (type->kind == 9 || type->kind == 10))
14161 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14165 exp->expType = memberType;
14167 memberType->refCount++;
14172 char expString[10240];
14174 expString[0] = '\0';
14177 PrintExpression(exp, expString);
14178 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14180 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14182 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14184 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14186 struct Identifier * id = exp->member.member;
14187 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));
14191 FreeType(exp->expType);
14192 exp->expType = ReplaceThisClassType(_class);
14196 yylloc = oldyylloc;
14201 struct Type * destType = exp->destType;
14203 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14205 exp->member.member->classSym = exp->member.member->_class->symbol;
14207 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14211 ProcessExpressionType(exp);
14218 struct Symbol * classSym = exp->_class->symbol;
14220 if(classSym && classSym->registered)
14222 if(classSym->registered->type == 5)
14227 DeclareStruct(classSym->string, 0x0);
14228 FreeSpecifier(exp->_class);
14230 FullClassNameCat(name, classSym->string, 0x0);
14231 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14235 if(classSym->registered->fixed)
14237 FreeSpecifier(exp->_class);
14238 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14243 char className[1024];
14245 strcpy(className, "__ecereClass_");
14246 FullClassNameCat(className, classSym->string, 0x1);
14247 MangleClassName(className);
14248 DeclareClass(classSym, className);
14249 FreeExpContents(exp);
14251 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14252 exp->member.member = MkIdentifier("structSize");
14256 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14261 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14263 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14264 exp->isConstant = 0x1;
14265 DeclareType(type, 0x0, 0x0);
14271 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14273 type->count = (unsigned int)1;
14274 FreeType(exp->cast.exp->destType);
14275 exp->cast.exp->destType = type;
14277 ProcessExpressionType(exp->cast.exp);
14278 type->count = (unsigned int)0;
14279 exp->expType = type;
14280 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14282 void * prev = exp->prev, * next = exp->next;
14283 struct Type * expType = exp->cast.exp->destType;
14284 struct Expression * castExp = exp->cast.exp;
14285 struct Type * destType = exp->destType;
14288 expType->refCount++;
14289 FreeType(exp->expType);
14290 FreeTypeName(exp->cast.typeName);
14292 FreeType(exp->expType);
14293 FreeType(exp->destType);
14294 exp->expType = expType;
14295 exp->destType = destType;
14296 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14302 exp->isConstant = exp->cast.exp->isConstant;
14308 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14311 exp->expType = type;
14316 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14318 ProcessExpressionType(exp->vaArg.exp);
14320 exp->expType = type;
14325 struct Expression * e;
14327 exp->isConstant = 0x1;
14328 FreeType(exp->cond.cond->destType);
14329 exp->cond.cond->destType = MkClassType("bool");
14330 exp->cond.cond->destType->truth = 0x1;
14331 ProcessExpressionType(exp->cond.cond);
14332 if(!exp->cond.cond->isConstant)
14333 exp->isConstant = 0x0;
14334 for(e = (*exp->cond.exp).first; e; e = e->next)
14338 FreeType(e->destType);
14339 e->destType = exp->destType;
14341 e->destType->refCount++;
14343 ProcessExpressionType(e);
14346 exp->expType = e->expType;
14348 e->expType->refCount++;
14351 exp->isConstant = 0x0;
14353 FreeType(exp->cond.elseExp->destType);
14354 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14355 if(exp->cond.elseExp->destType)
14356 exp->cond.elseExp->destType->refCount++;
14357 ProcessExpressionType(exp->cond.elseExp);
14358 if(!exp->cond.elseExp->isConstant)
14359 exp->isConstant = 0x0;
14364 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14366 struct Statement * last = (*exp->compound->compound.statements).last;
14368 if(last->type == 3 && last->expressions && (*last->expressions).last)
14370 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14372 exp->destType->refCount++;
14374 ProcessStatement(exp->compound);
14375 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14376 if(((struct Expression *)(*last->expressions).last)->expType)
14377 exp->expType->refCount++;
14383 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14385 if(spec && spec->type == 1)
14387 exp->expType = MkClassType(spec->name);
14388 exp->expType->kind = 19;
14389 exp->byReference = 0x1;
14393 exp->expType = MkClassType("ecere::com::Class");
14394 exp->byReference = 0x1;
14400 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14404 struct Identifier * id = exp->classData.id;
14405 char structName[1024];
14406 struct Expression * classExp;
14408 strcpy(structName, "__ecereClassData_");
14409 FullClassNameCat(structName, _class->fullName, 0x0);
14411 exp->member.member = id;
14412 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14413 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14415 classExp = MkExpIdentifier(MkIdentifier("class"));
14416 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"))))))));
14417 ProcessExpressionType(exp);
14424 struct Type * type = (((void *)0));
14425 char * typeString = (((void *)0));
14426 char typeStringBuf[1024];
14428 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))
14430 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14432 typeString = templateClass->templateArgs[2].dataTypeString;
14436 struct Expression * e;
14438 for(e = (*exp->list).first; e; e = e->next)
14440 ProcessExpressionType(e);
14450 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14454 e->expType = (((void *)0));
14455 e = (*exp->list).first;
14456 ProcessExpressionType(e);
14459 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14461 FreeType(e->expType);
14462 e->expType = (((void *)0));
14464 type = (((void *)0));
14472 FreeType(e->expType);
14473 e->expType = (((void *)0));
14479 typeStringBuf[0] = '\0';
14480 PrintType(type, typeStringBuf, 0x0, 0x1);
14481 typeString = typeStringBuf;
14483 type = (((void *)0));
14488 char templateString[1024];
14489 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14490 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14491 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14492 struct Expression * expExt;
14493 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14495 sprintf(templateString, "Container<%s>", typeString);
14498 struct Expression * e;
14500 type = ProcessTypeString(typeString, 0x0);
14501 while(e = (*exp->list).first)
14503 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14504 e->destType = type;
14506 ProcessExpressionType(e);
14507 ListAdd(initializers, MkInitializerAssignment(e));
14510 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14512 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14513 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14514 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14515 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14516 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14517 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14518 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14519 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14520 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14521 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, 0), ((struct Expression *)__ecereTemp1))));
14522 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14523 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14524 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14525 exp->expType = ProcessTypeString(templateString, 0x0);
14527 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14528 ProcessExpressionType(expExt);
14532 exp->expType = ProcessTypeString("Container", 0x0);
14533 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14538 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14540 FreeType(exp->expType);
14541 exp->expType = ReplaceThisClassType(thisClass);
14543 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14545 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14549 if(exp->expType->kind != 15)
14551 struct Type * member;
14552 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14554 FreeType(exp->expType);
14555 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14556 exp->expType->kind = symbol->type->kind;
14557 exp->expType->refCount++;
14558 exp->expType->enumName = enumName;
14559 exp->expType->members = symbol->type->members;
14560 for(member = symbol->type->members.first; member; member = member->next)
14561 member->refCount++;
14565 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14567 for(member = symbol->type->members.first; member; member = member->next)
14569 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14571 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14577 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14579 else if(exp->destType && !exp->destType->keepCast)
14581 if(!CheckExpressionType(exp, exp->destType, 0x0))
14583 if(!exp->destType->count || unresolved)
14588 if(exp->destType->kind != 14)
14595 char expString[10240];
14597 expString[0] = '\0';
14598 PrintType(exp->destType, type2, 0x0, 0x1);
14601 PrintExpression(exp, expString);
14602 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14606 else if(exp->type != 16)
14607 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14612 char expString[10240];
14614 expString[0] = '\0';
14617 PrintExpression(exp, expString);
14618 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14622 else if(exp->type != 16)
14623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14635 PrintType(exp->expType, type1, 0x0, 0x1);
14636 PrintType(exp->destType, type2, 0x0, 0x1);
14638 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)))
14642 char expString[10240];
14644 expString[0] = '\0';
14647 PrintExpression(exp, expString);
14648 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14650 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14651 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14652 FreeType(exp->expType);
14653 exp->destType->refCount++;
14654 exp->expType = exp->destType;
14659 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14661 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14662 char typeString[1024];
14663 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14664 struct Declarator * decl;
14666 typeString[0] = '\0';
14669 exp->expType->refCount++;
14671 exp->expType->refCount++;
14673 newExp->destType = exp->expType;
14674 PrintType(exp->expType, typeString, 0x0, 0x0);
14675 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14676 exp->cast.typeName = MkTypeName(specs, decl);
14677 exp->cast.exp = newExp;
14680 else if(unresolved)
14682 if(exp->identifier->_class && exp->identifier->_class->name)
14683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14684 else if(exp->identifier->string && exp->identifier->string[0])
14685 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14687 else if(!exp->expType && exp->type != 16)
14689 char expString[10240];
14691 expString[0] = '\0';
14694 PrintExpression(exp, expString);
14695 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14697 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14699 ApplyAnyObjectLogic(exp);
14700 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14702 exp->byReference = 0x1;
14704 yylloc = oldyylloc;
14707 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)
14711 *curMember = (*curMember)->next;
14712 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14714 *curMember = subMemberStack[--(*subMemberStackPos)];
14715 *curMember = (*curMember)->next;
14717 while((*curMember) && (*curMember)->isProperty)
14718 *curMember = (*curMember)->next;
14719 if(subMemberStackPos)
14721 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14723 subMemberStack[(*subMemberStackPos)++] = *curMember;
14724 *curMember = (*curMember)->members.first;
14725 while(*curMember && (*curMember)->isProperty)
14726 *curMember = (*curMember)->next;
14734 if(subMemberStackPos && *subMemberStackPos)
14736 *curMember = subMemberStack[--(*subMemberStackPos)];
14737 *curMember = (*curMember)->next;
14741 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14743 if(*curClass == _class)
14745 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14747 *curMember = (*curClass)->membersAndProperties.first;
14749 while((*curMember) && (*curMember)->isProperty)
14750 *curMember = (*curMember)->next;
14751 if(subMemberStackPos)
14753 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14755 subMemberStack[(*subMemberStackPos)++] = *curMember;
14756 *curMember = (*curMember)->members.first;
14757 while(*curMember && (*curMember)->isProperty)
14758 *curMember = (*curMember)->next;
14765 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14770 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14772 if(init->exp && !init->exp->destType)
14774 FreeType(init->exp->destType);
14775 init->exp->destType = type;
14781 ProcessExpressionType(init->exp);
14782 init->isConstant = init->exp->isConstant;
14788 struct Expression * exp = init->exp;
14789 struct Instantiation * inst = exp->instance;
14790 struct MembersInit * members;
14793 init->list = MkList();
14796 for(members = (*inst->members).first; members; members = members->next)
14798 if(members->type == 0)
14800 struct MemberInit * member;
14802 for(member = (*members->dataMembers).first; member; member = member->next)
14804 ListAdd(init->list, member->initializer);
14805 member->initializer = (((void *)0));
14810 FreeExpression(exp);
14814 struct Initializer * i;
14815 struct Type * initializerType = (((void *)0));
14816 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14817 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14818 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14819 int subMemberStackPos = 0;
14821 if(type && type->kind == 12)
14822 initializerType = Dereference(type);
14823 else if(type && (type->kind == 9 || type->kind == 10))
14824 initializerType = type->members.first;
14825 for(i = (*init->list).first; i; i = i->next)
14827 if(type && type->kind == 8 && type->_class && type->_class->registered)
14829 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14832 if(!curMember->dataType)
14833 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14834 initializerType = curMember->dataType;
14837 ProcessInitializer(i, initializerType);
14838 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14839 initializerType = initializerType->next;
14841 init->isConstant = 0x0;
14843 if(type && type->kind == 12)
14844 FreeType(initializerType);
14845 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14854 extern struct Symbol * FindType(struct Context * ctx, char * name);
14856 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14858 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14864 if(spec->specifier == THISCLASS)
14869 spec->name = ReplaceThisClass(thisClass);
14870 spec->symbol = FindClass(spec->name);
14871 ProcessSpecifier(spec, declareStruct);
14878 struct Symbol * symbol = FindType(curContext, spec->name);
14881 DeclareType(symbol->type, 0x1, 0x1);
14882 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14883 DeclareStruct(spec->name, 0x0);
14888 struct Enumerator * e;
14892 for(e = (*spec->list).first; e; e = e->next)
14895 ProcessExpressionType(e->exp);
14903 if(spec->definitions)
14905 struct ClassDef * def;
14906 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14908 ProcessClass(spec->definitions, symbol);
14915 static void ProcessDeclarator(struct Declarator * decl)
14920 if(decl->identifier->classSym)
14922 FreeSpecifier(decl->identifier->_class);
14923 decl->identifier->_class = (((void *)0));
14927 if(decl->array.exp)
14928 ProcessExpressionType(decl->array.exp);
14935 if(decl->declarator)
14936 ProcessDeclarator(decl->declarator);
14937 if(decl->type == 4)
14939 struct Identifier * id = GetDeclId(decl);
14941 if(id && id->_class)
14943 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14945 if(!decl->function.parameters)
14946 decl->function.parameters = MkList();
14947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14948 id->_class = (((void *)0));
14950 if(decl->function.parameters)
14952 struct TypeName * param;
14954 for(param = (*decl->function.parameters).first; param; param = param->next)
14956 if(param->qualifiers && (*param->qualifiers).first)
14958 struct Specifier * spec = (*param->qualifiers).first;
14960 if(spec && spec->specifier == TYPED_OBJECT)
14962 struct Declarator * d = param->declarator;
14963 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);
14965 FreeList(param->qualifiers, FreeSpecifier);
14966 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14967 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14968 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14971 else if(spec && spec->specifier == ANY_OBJECT)
14973 struct Declarator * d = param->declarator;
14975 FreeList(param->qualifiers, FreeSpecifier);
14976 param->qualifiers = MkListOne(MkSpecifier(VOID));
14977 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14979 else if(spec->specifier == THISCLASS)
14984 spec->name = ReplaceThisClass(thisClass);
14985 spec->symbol = FindClass(spec->name);
14986 ProcessSpecifier(spec, 0x0);
14990 if(param->declarator)
14991 ProcessDeclarator(param->declarator);
14999 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15001 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15003 static void ProcessDeclaration(struct Declaration * decl)
15005 yylloc = decl->loc;
15010 unsigned int declareStruct = 0x0;
15012 if(decl->declarators)
15014 struct InitDeclarator * d;
15016 for(d = (*decl->declarators).first; d; d = d->next)
15018 struct Type * type, * subType;
15020 ProcessDeclarator(d->declarator);
15021 type = ProcessType(decl->specifiers, d->declarator);
15024 ProcessInitializer(d->initializer, type);
15025 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15027 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15029 struct Instantiation * inst = d->initializer->exp->instance;
15031 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15032 d->initializer->exp->instance = (((void *)0));
15033 if(decl->specifiers)
15034 FreeList(decl->specifiers, FreeSpecifier);
15035 FreeList(decl->declarators, FreeInitDeclarator);
15042 for(subType = type; subType; )
15044 if(subType->kind == 8)
15046 declareStruct = 0x1;
15049 else if(subType->kind == 13)
15051 else if(subType->kind == 12)
15052 subType = subType->arrayType;
15061 if(decl->specifiers)
15063 struct Specifier * s;
15065 for(s = (*decl->specifiers).first; s; s = s->next)
15067 ProcessSpecifier(s, declareStruct);
15074 ProcessInstantiationType(decl->inst);
15079 struct Specifier * spec;
15080 struct Declarator * d;
15081 unsigned int declareStruct = 0x0;
15083 if(decl->declarators)
15085 for(d = (*decl->declarators).first; d; d = d->next)
15087 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15088 struct Type * subType;
15090 ProcessDeclarator(d);
15091 for(subType = type; subType; )
15093 if(subType->kind == 8)
15095 declareStruct = 0x1;
15098 else if(subType->kind == 13)
15100 else if(subType->kind == 12)
15101 subType = subType->arrayType;
15108 if(decl->specifiers)
15110 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15111 ProcessSpecifier(spec, declareStruct);
15118 static struct FunctionDefinition * curFunction;
15120 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15122 char propName[1024], propNameM[1024];
15123 char getName[1024], setName[1024];
15124 struct __ecereNameSpace__ecere__sys__OldList * args;
15126 DeclareProperty(prop, setName, getName);
15127 strcpy(propName, "__ecereProp_");
15128 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15129 strcat(propName, "_");
15130 FullClassNameCat(propName, prop->name, 0x1);
15131 MangleClassName(propName);
15132 strcpy(propNameM, "__ecerePropM_");
15133 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15134 strcat(propNameM, "_");
15135 FullClassNameCat(propNameM, prop->name, 0x1);
15136 MangleClassName(propNameM);
15137 if(prop->isWatchable)
15140 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15141 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15142 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15144 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15145 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15146 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15150 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15151 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15152 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15154 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15155 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15156 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15158 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15159 curFunction->propSet->fireWatchersDone = 0x1;
15162 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15164 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15166 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15168 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15170 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15172 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15174 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15176 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15178 static void ProcessStatement(struct Statement * stmt)
15180 yylloc = stmt->loc;
15184 ProcessStatement(stmt->labeled.stmt);
15187 if(stmt->caseStmt.exp)
15189 FreeType(stmt->caseStmt.exp->destType);
15190 stmt->caseStmt.exp->destType = curSwitchType;
15192 curSwitchType->refCount++;
15193 ProcessExpressionType(stmt->caseStmt.exp);
15194 ComputeExpression(stmt->caseStmt.exp);
15196 if(stmt->caseStmt.stmt)
15197 ProcessStatement(stmt->caseStmt.stmt);
15201 if(stmt->compound.context)
15203 struct Declaration * decl;
15204 struct Statement * s;
15205 struct Statement * prevCompound = curCompound;
15206 struct Context * prevContext = curContext;
15208 if(!stmt->compound.isSwitch)
15210 curCompound = stmt;
15211 curContext = stmt->compound.context;
15213 if(stmt->compound.declarations)
15215 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15216 ProcessDeclaration(decl);
15218 if(stmt->compound.statements)
15220 for(s = (*stmt->compound.statements).first; s; s = s->next)
15221 ProcessStatement(s);
15223 curContext = prevContext;
15224 curCompound = prevCompound;
15230 struct Expression * exp;
15232 if(stmt->expressions)
15234 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15235 ProcessExpressionType(exp);
15241 struct Expression * exp;
15243 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15244 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15245 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15246 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15248 ProcessExpressionType(exp);
15250 if(stmt->ifStmt.stmt)
15251 ProcessStatement(stmt->ifStmt.stmt);
15252 if(stmt->ifStmt.elseStmt)
15253 ProcessStatement(stmt->ifStmt.elseStmt);
15258 struct Type * oldSwitchType = curSwitchType;
15260 if(stmt->switchStmt.exp)
15262 struct Expression * exp;
15264 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15268 ProcessExpressionType(exp);
15271 curSwitchType = exp->expType;
15274 ProcessStatement(stmt->switchStmt.stmt);
15275 curSwitchType = oldSwitchType;
15280 if(stmt->whileStmt.exp)
15282 struct Expression * exp;
15284 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15285 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15286 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15287 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15289 ProcessExpressionType(exp);
15292 if(stmt->whileStmt.stmt)
15293 ProcessStatement(stmt->whileStmt.stmt);
15298 if(stmt->doWhile.exp)
15300 struct Expression * exp;
15302 if((*stmt->doWhile.exp).last)
15304 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15305 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15306 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15308 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15310 ProcessExpressionType(exp);
15313 if(stmt->doWhile.stmt)
15314 ProcessStatement(stmt->doWhile.stmt);
15319 struct Expression * exp;
15321 if(stmt->forStmt.init)
15322 ProcessStatement(stmt->forStmt.init);
15323 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15325 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15326 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15327 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15329 if(stmt->forStmt.check)
15330 ProcessStatement(stmt->forStmt.check);
15331 if(stmt->forStmt.increment)
15333 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15334 ProcessExpressionType(exp);
15336 if(stmt->forStmt.stmt)
15337 ProcessStatement(stmt->forStmt.stmt);
15342 struct Identifier * id = stmt->forEachStmt.id;
15343 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15344 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15345 struct Statement * block = stmt->forEachStmt.stmt;
15346 char iteratorType[1024];
15347 struct Type * source;
15348 struct Expression * e;
15349 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));
15350 struct Expression * arrayExp;
15351 char * typeString = (((void *)0));
15352 int builtinCount = 0;
15354 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15358 FreeType(e->destType);
15359 e->destType = ProcessTypeString("Container", 0x0);
15361 if(!isBuiltin || e->next)
15362 ProcessExpressionType(e);
15364 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15365 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15367 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15368 struct Symbol * symbol;
15369 struct Expression * expIt = (((void *)0));
15370 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15371 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15372 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15373 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15376 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15377 stmt->compound.context->parent = curContext;
15378 curContext = stmt->compound.context;
15379 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15381 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15382 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15384 isCustomAVLTree = 0x1;
15385 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15387 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15390 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15392 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15394 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15397 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15401 struct Declarator * decl;
15402 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15404 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15405 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15406 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15410 struct Type * type = (((void *)0));
15411 char typeStringBuf[1024];
15413 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15414 if(((struct Expression *)(*exp).last)->type == 11)
15416 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15419 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15421 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)
15423 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15425 typeString = templateClass->templateArgs[2].dataTypeString;
15427 else if(arrayExp->list)
15429 struct Expression * e;
15431 for(e = (*arrayExp->list).first; e; e = e->next)
15433 ProcessExpressionType(e);
15443 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15447 e->expType = (((void *)0));
15448 e = (*arrayExp->list).first;
15449 ProcessExpressionType(e);
15452 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15454 FreeType(e->expType);
15455 e->expType = (((void *)0));
15457 type = (((void *)0));
15465 FreeType(e->expType);
15466 e->expType = (((void *)0));
15472 typeStringBuf[0] = '\0';
15473 PrintType(type, typeStringBuf, 0x0, 0x1);
15474 typeString = typeStringBuf;
15480 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15481 struct Declarator * decl;
15482 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15486 struct Expression * e;
15488 builtinCount = (*arrayExp->list).count;
15489 type = ProcessTypeString(typeString, 0x0);
15490 while(e = (*arrayExp->list).first)
15492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15493 e->destType = type;
15495 ProcessExpressionType(e);
15496 ListAdd(initializers, MkInitializerAssignment(e));
15499 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15501 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15502 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15503 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15504 FreeList(exp, FreeExpression);
15508 arrayExp->expType = ProcessTypeString("Container", 0x0);
15509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15512 else if(isLinkList && !isList)
15514 struct Declarator * decl;
15515 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15517 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15518 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15519 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15521 else if(_class->templateArgs)
15524 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15526 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15527 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15529 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15530 if(block && block->type == 2 && block->compound.context)
15532 block->compound.context->parent = stmt->compound.context;
15536 block = MkIfStmt(filter, block, (((void *)0)));
15540 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));
15541 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15542 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15543 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15549 sprintf(count, "%d", builtinCount);
15550 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));
15551 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15552 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15553 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15555 else if(isLinkList && !isList)
15557 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15558 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15560 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15562 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));
15566 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15567 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15569 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));
15571 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15572 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15573 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15577 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15579 ProcessExpressionType(expIt);
15580 if((*stmt->compound.declarations).first)
15581 ProcessDeclaration((*stmt->compound.declarations).first);
15583 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15584 ProcessStatement(stmt);
15585 curContext = stmt->compound.context->parent;
15590 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15602 struct Expression * exp;
15604 if(stmt->expressions)
15606 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15610 if(curFunction && !curFunction->type)
15611 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15612 FreeType(exp->destType);
15613 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15615 exp->destType->refCount++;
15617 ProcessExpressionType(exp);
15624 ProcessDeclaration(stmt->decl);
15629 struct AsmField * field;
15631 if(stmt->asmStmt.inputFields)
15633 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15634 if(field->expression)
15635 ProcessExpressionType(field->expression);
15637 if(stmt->asmStmt.outputFields)
15639 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15640 if(field->expression)
15641 ProcessExpressionType(field->expression);
15643 if(stmt->asmStmt.clobberedFields)
15645 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15647 if(field->expression)
15648 ProcessExpressionType(field->expression);
15655 struct PropertyWatch * propWatch;
15656 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15657 struct Expression * object = stmt->_watch.object;
15658 struct Expression * watcher = stmt->_watch.watcher;
15661 ProcessExpressionType(watcher);
15663 ProcessExpressionType(object);
15666 if(watcher || thisClass)
15668 struct External * external = curExternal;
15669 struct Context * context = curContext;
15672 stmt->expressions = MkList();
15673 curExternal = external->prev;
15674 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15676 struct ClassFunction * func;
15677 char watcherName[1024];
15678 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15679 struct External * createdExternal;
15680 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15682 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15683 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15684 if(propWatch->deleteWatch)
15685 strcat(watcherName, "_delete");
15688 struct Identifier * propID;
15690 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15692 strcat(watcherName, "_");
15693 strcat(watcherName, propID->string);
15696 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15698 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15699 ProcessClassFunctionBody(func, propWatch->compound);
15700 propWatch->compound = (((void *)0));
15701 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15702 createdExternal->symbol->idCode = external->symbol->idCode;
15703 curExternal = createdExternal;
15704 ProcessFunction(createdExternal->function);
15706 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15708 externalDecl->declaration = decl;
15709 if(decl->symbol && !decl->symbol->pointerExternal)
15710 decl->symbol->pointerExternal = externalDecl;
15712 if(propWatch->deleteWatch)
15714 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15716 ListAdd(args, CopyExpression(object));
15717 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15718 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15719 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15723 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15724 struct Identifier * propID;
15726 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15728 char propName[1024];
15729 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15733 char getName[1024], setName[1024];
15734 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15736 DeclareProperty(prop, setName, getName);
15737 strcpy(propName, "__ecereProp_");
15738 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15739 strcat(propName, "_");
15740 FullClassNameCat(propName, prop->name, 0x1);
15741 ListAdd(args, CopyExpression(object));
15742 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15743 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15744 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15745 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15753 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15755 curExternal = external;
15756 curContext = context;
15758 FreeExpression(watcher);
15760 FreeExpression(object);
15761 FreeList(watches, FreePropertyWatch);
15764 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15768 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15770 ProcessStatement(propWatch->compound);
15777 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15778 struct Expression * object = stmt->_watch.object;
15779 struct __ecereNameSpace__ecere__com__Class * _class;
15782 ProcessExpressionType(object);
15785 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15788 struct Identifier * propID;
15791 stmt->expressions = MkList();
15792 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15794 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15801 for(propID = (*watches).first; propID; propID = propID->next)
15803 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15807 CreateFireWatcher(prop, object, stmt);
15810 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15815 struct __ecereNameSpace__ecere__com__Property * prop;
15816 struct __ecereNameSpace__ecere__com__Class * base;
15818 for(base = _class; base; base = base->base)
15820 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15822 if(prop->isProperty && prop->isWatchable)
15824 CreateFireWatcher(prop, object, stmt);
15830 FreeExpression(object);
15831 FreeList(watches, FreeIdentifier);
15834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15840 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15841 struct Expression * object = stmt->_watch.object;
15842 struct Expression * watcher = stmt->_watch.watcher;
15843 struct __ecereNameSpace__ecere__com__Class * _class;
15846 ProcessExpressionType(object);
15848 ProcessExpressionType(watcher);
15851 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15852 if(watcher || thisClass)
15856 struct Identifier * propID;
15859 stmt->expressions = MkList();
15862 struct __ecereNameSpace__ecere__sys__OldList * args;
15865 ListAdd(args, CopyExpression(object));
15866 ListAdd(args, MkExpConstant("0"));
15867 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15868 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15872 for(propID = (*watches).first; propID; propID = propID->next)
15874 char propName[1024];
15875 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15879 char getName[1024], setName[1024];
15880 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15882 DeclareProperty(prop, setName, getName);
15883 strcpy(propName, "__ecereProp_");
15884 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15885 strcat(propName, "_");
15886 FullClassNameCat(propName, prop->name, 0x1);
15887 MangleClassName(propName);
15888 ListAdd(args, CopyExpression(object));
15889 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15890 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15891 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15894 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15898 FreeExpression(object);
15900 FreeExpression(watcher);
15901 FreeList(watches, FreeIdentifier);
15904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15907 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15914 extern struct Expression * QBrackets(struct Expression * exp);
15916 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15918 extern struct Declarator * QMkPtrDecl(char * id);
15920 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15922 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15924 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15926 static void ProcessFunction(struct FunctionDefinition * function)
15928 void * __ecereTemp2;
15929 void * __ecereTemp1;
15930 struct Identifier * id = GetDeclId(function->declarator);
15931 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15932 struct Type * type = symbol ? symbol->type : (((void *)0));
15933 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15934 struct Context * oldTopContext = topContext;
15936 yylloc = function->loc;
15937 if(type && type->thisClass)
15939 struct Symbol * classSym = type->thisClass;
15940 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15941 char className[1024];
15942 char structName[1024];
15943 struct Declarator * funcDecl;
15944 struct Symbol * thisSymbol;
15945 unsigned int typedObject = 0x0;
15947 if(_class && !_class->base)
15949 _class = currentClass;
15950 if(_class && !_class->symbol)
15951 _class->symbol = FindClass(_class->fullName);
15952 classSym = _class ? _class->symbol : (((void *)0));
15955 thisClass = _class;
15956 if(inCompiler && _class)
15958 if(type->kind == 11)
15960 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15962 struct Type * param = symbol->type->params.first;
15964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15967 if(type->classObjectType != 1)
15969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15970 symbol->type->staticMethod = 0x1;
15971 symbol->type->thisClass = (((void *)0));
15972 symbol->type->extraParam = 0x0;
15975 strcpy(className, "__ecereClass_");
15976 FullClassNameCat(className, _class->fullName, 0x1);
15977 MangleClassName(className);
15978 structName[0] = (char)0;
15979 FullClassNameCat(structName, _class->fullName, 0x0);
15980 funcDecl = GetFuncDecl(function->declarator);
15983 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15985 struct TypeName * param = (*funcDecl->function.parameters).first;
15987 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15990 FreeTypeName(param);
15993 if(!function->propertyNoThis)
15995 struct TypeName * thisParam;
15997 if(type->classObjectType != 1)
15999 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16000 if(!funcDecl->function.parameters)
16001 funcDecl->function.parameters = MkList();
16002 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16006 if(type->classObjectType != 1)
16008 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16009 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16011 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));
16012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16016 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16018 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16020 funcDecl = GetFuncDecl(initDecl->declarator);
16023 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16025 struct TypeName * param = (*funcDecl->function.parameters).first;
16027 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16030 FreeTypeName(param);
16033 if(type->classObjectType != 1)
16035 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16037 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16039 if(!funcDecl->function.parameters)
16040 funcDecl->function.parameters = MkList();
16041 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16049 if(type->classObjectType != 1)
16051 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));
16052 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16053 if(typedObject && thisSymbol->type)
16055 thisSymbol->type->classObjectType = 2;
16056 thisSymbol->type->byReference = type->byReference;
16060 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16062 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16065 struct __ecereNameSpace__ecere__com__Class * base;
16067 for(base = _class; base && base->type != 1000; base = base->next)
16069 for(member = base->membersAndProperties.first; member; member = member->next)
16070 if(!member->isProperty)
16076 for(member = _class->membersAndProperties.first; member; member = member->next)
16077 if(!member->isProperty)
16081 char pointerName[1024];
16082 struct Declaration * decl;
16083 struct Initializer * initializer;
16084 struct Expression * exp, * bytePtr;
16086 strcpy(pointerName, "__ecerePointer_");
16087 FullClassNameCat(pointerName, _class->fullName, 0x0);
16089 char className[1024];
16091 strcpy(className, "__ecereClass_");
16092 FullClassNameCat(className, classSym->string, 0x1);
16093 MangleClassName(className);
16094 DeclareClass(classSym, className);
16096 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16101 sprintf(string, "%d", _class->offset);
16102 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16106 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16108 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16109 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));
16112 yylloc = function->body->loc;
16113 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16115 struct Context * prevContext = curContext;
16117 curContext = function->body->compound.context;
16118 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16119 curContext = prevContext;
16121 decl->symbol = (((void *)0));
16122 if(!function->body->compound.declarations)
16123 function->body->compound.declarations = MkList();
16124 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16130 thisClass = (((void *)0));
16133 FreeSpecifier(id->_class);
16134 id->_class = (((void *)0));
16135 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16137 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16139 id = GetDeclId(initDecl->declarator);
16140 FreeSpecifier(id->_class);
16141 id->_class = (((void *)0));
16145 topContext = function->body->compound.context;
16147 struct FunctionDefinition * oldFunction = curFunction;
16149 curFunction = function;
16151 ProcessStatement(function->body);
16152 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16154 struct Statement * prevCompound = curCompound;
16155 struct Context * prevContext = curContext;
16156 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16158 if(!function->body->compound.statements)
16159 function->body->compound.statements = MkList();
16160 ListAdd(function->body->compound.statements, fireWatchers);
16161 curCompound = function->body;
16162 curContext = function->body->compound.context;
16163 ProcessStatement(fireWatchers);
16164 curContext = prevContext;
16165 curCompound = prevCompound;
16167 curFunction = oldFunction;
16169 if(function->declarator)
16171 ProcessDeclarator(function->declarator);
16173 topContext = oldTopContext;
16174 thisClass = oldThisClass;
16177 extern void FreeSymbol(struct Symbol * symbol);
16179 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16181 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16183 struct ClassDef * def;
16184 struct External * external = curExternal;
16185 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16187 for(def = definitions->first; def; def = def->next)
16191 if(def->function->declarator)
16192 curExternal = def->function->declarator->symbol->pointerExternal;
16194 curExternal = external;
16195 ProcessFunction((struct FunctionDefinition *)def->function);
16197 else if(def->type == 2)
16199 if(def->decl->type == 2)
16201 thisClass = regClass;
16202 ProcessInstantiationType(def->decl->inst);
16203 thisClass = (((void *)0));
16207 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16210 thisClass = regClass;
16211 ProcessDeclaration(def->decl);
16212 thisClass = backThisClass;
16215 else if(def->type == 1 && def->defProperties)
16217 struct MemberInit * defProperty;
16218 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);
16220 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16221 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16223 thisClass = regClass;
16224 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16225 thisClass = (((void *)0));
16227 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16228 FreeSymbol(thisSymbol);
16230 else if(def->type == 3 && def->propertyDef)
16232 struct PropertyDef * prop = def->propertyDef;
16234 thisClass = regClass;
16239 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16241 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16243 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16244 ProcessStatement(prop->setStmt);
16250 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16252 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16254 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16255 ProcessStatement(prop->getStmt);
16257 if(prop->issetStmt)
16261 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16263 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16265 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16266 ProcessStatement(prop->issetStmt);
16268 thisClass = (((void *)0));
16270 else if(def->type == 4 && def->propertyWatch)
16272 struct PropertyWatch * propertyWatch = def->propertyWatch;
16274 thisClass = regClass;
16275 if(propertyWatch->compound)
16277 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);
16279 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16280 curExternal = (((void *)0));
16281 ProcessStatement(propertyWatch->compound);
16283 thisClass = (((void *)0));
16288 void DeclareFunctionUtil(char * s)
16290 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16297 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16298 strcpy(name, "__ecereFunction_");
16299 FullClassNameCat(name, s, 0x0);
16300 DeclareFunction(function, name);
16304 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16306 void ComputeDataTypes()
16308 void * __ecereTemp1;
16309 struct External * external;
16310 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16312 currentClass = (((void *)0));
16313 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16314 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16316 curExternal = temp;
16317 DeclareFunctionUtil("eSystem_New");
16318 DeclareFunctionUtil("eSystem_New0");
16319 DeclareFunctionUtil("eSystem_Renew");
16320 DeclareFunctionUtil("eSystem_Renew0");
16321 DeclareStruct("ecere::com::Class", 0x0);
16322 DeclareStruct("ecere::com::Instance", 0x0);
16323 DeclareStruct("ecere::com::Property", 0x0);
16324 DeclareStruct("ecere::com::DataMember", 0x0);
16325 DeclareStruct("ecere::com::Method", 0x0);
16326 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16327 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16328 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16329 for(external = (*ast).first; external; external = external->next)
16331 afterExternal = curExternal = external;
16332 if(external->type == 0)
16334 currentClass = external->function->_class;
16335 ProcessFunction(external->function);
16337 else if(external->type == 1)
16339 currentClass = (((void *)0));
16340 ProcessDeclaration(external->declaration);
16342 else if(external->type == 2)
16344 struct ClassDefinition * _class = external->_class;
16346 currentClass = external->symbol->registered;
16347 if(_class->definitions)
16349 ProcessClass(_class->definitions, _class->symbol);
16353 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16354 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16357 else if(external->type == 4)
16359 thisNameSpace = external->id->string;
16362 currentClass = (((void *)0));
16363 thisNameSpace = (((void *)0));
16364 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16365 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16368 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);
16370 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);
16372 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16374 struct __ecereNameSpace__ecere__com__Class * class;
16376 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16377 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16378 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16379 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16380 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16381 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16382 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16383 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16384 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16385 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16386 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16387 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16388 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16389 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16390 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16415 __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);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16428 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16429 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16430 __ecereClass_Conversion = class;
16431 __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);
16432 __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);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16434 __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);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16443 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16444 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16445 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16454 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)