2 typedef long long int64;
3 typedef unsigned long long uint64;
4 #elif defined(__TINYC__)
6 #define __builtin_va_list va_list
7 #define __builtin_va_start va_start
8 #define __builtin_va_end va_end
10 #define strcasecmp stricmp
11 #define strncasecmp strnicmp
12 #define __declspec(x) __attribute__((x))
14 typedef long long int64;
15 typedef unsigned long long uint64;
17 typedef __int64 int64;
18 typedef unsigned __int64 uint64;
21 #define __ENDIAN_PAD(x) (8 - (x))
23 #define __ENDIAN_PAD(x) 0
25 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
27 struct __ecereNameSpace__ecere__sys__BTNode;
29 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
31 struct __ecereNameSpace__ecere__sys__BinaryTree
33 struct __ecereNameSpace__ecere__sys__BTNode * root;
35 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int a, unsigned int b);
36 void (* FreeKey)(void * key);
39 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
41 struct __ecereNameSpace__ecere__sys__OldList
50 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
52 struct __ecereNameSpace__ecere__com__Method
55 struct __ecereNameSpace__ecere__com__Method * parent;
56 struct __ecereNameSpace__ecere__com__Method * left;
57 struct __ecereNameSpace__ecere__com__Method * right;
62 struct __ecereNameSpace__ecere__com__Class * _class;
64 char * dataTypeString;
65 struct Type * dataType;
69 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
71 struct __ecereNameSpace__ecere__com__Property
73 struct __ecereNameSpace__ecere__com__Property * prev;
74 struct __ecereNameSpace__ecere__com__Property * next;
76 unsigned int isProperty;
79 struct __ecereNameSpace__ecere__com__Class * _class;
80 char * dataTypeString;
81 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
82 struct Type * dataType;
85 unsigned int (* IsSet)();
89 unsigned int conversion;
90 unsigned int watcherOffset;
92 unsigned int compiled;
93 unsigned int selfWatchable;
94 unsigned int isWatchable;
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
104 unsigned int included;
107 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
111 struct CodePosition start;
112 struct CodePosition end;
115 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
117 struct ClassDefinition
119 struct ClassDefinition * prev;
120 struct ClassDefinition * next;
122 struct Specifier * _class;
123 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
124 struct __ecereNameSpace__ecere__sys__OldList * definitions;
125 struct Symbol * symbol;
126 struct Location blockStart;
127 struct Location nameLoc;
130 unsigned int deleteWatchable;
133 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
137 struct Context * parent;
138 struct __ecereNameSpace__ecere__sys__BinaryTree types;
139 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
140 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
141 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
144 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
145 struct ClassDefinition * classDef;
146 unsigned int templateTypesOnly;
147 unsigned int hasNameSpace;
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
154 struct Instantiation * prev;
155 struct Instantiation * next;
157 struct Specifier * _class;
158 struct Expression * exp;
159 struct __ecereNameSpace__ecere__sys__OldList * members;
160 struct Symbol * symbol;
161 unsigned int fullSet;
162 unsigned int isConstant;
163 unsigned char * data;
164 struct Location nameLoc;
165 struct Location insideLoc;
169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
173 struct Declaration * prev;
174 struct Declaration * next;
181 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
182 struct __ecereNameSpace__ecere__sys__OldList * declarators;
184 struct Instantiation * inst;
187 struct Identifier * id;
188 struct Expression * exp;
191 struct Specifier * extStorage;
192 struct Symbol * symbol;
196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
200 struct Statement * prev;
201 struct Statement * next;
206 struct __ecereNameSpace__ecere__sys__OldList * expressions;
209 struct Identifier * id;
210 struct Statement * stmt;
214 struct Expression * exp;
215 struct Statement * stmt;
219 struct __ecereNameSpace__ecere__sys__OldList * declarations;
220 struct __ecereNameSpace__ecere__sys__OldList * statements;
221 struct Context * context;
222 unsigned int isSwitch;
226 struct __ecereNameSpace__ecere__sys__OldList * exp;
227 struct Statement * stmt;
228 struct Statement * elseStmt;
232 struct __ecereNameSpace__ecere__sys__OldList * exp;
233 struct Statement * stmt;
237 struct __ecereNameSpace__ecere__sys__OldList * exp;
238 struct Statement * stmt;
242 struct __ecereNameSpace__ecere__sys__OldList * exp;
243 struct Statement * stmt;
247 struct Statement * init;
248 struct Statement * check;
249 struct __ecereNameSpace__ecere__sys__OldList * increment;
250 struct Statement * stmt;
254 struct Identifier * id;
258 struct Specifier * spec;
260 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
261 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
262 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
266 struct Expression * watcher;
267 struct Expression * object;
268 struct __ecereNameSpace__ecere__sys__OldList * watches;
272 struct Identifier * id;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct __ecereNameSpace__ecere__sys__OldList * filter;
275 struct Statement * stmt;
277 struct Declaration * decl;
281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
285 struct TypeName * prev;
286 struct TypeName * next;
288 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
289 struct Declarator * declarator;
291 struct Expression * bitCount;
294 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
298 struct Initializer * prev;
299 struct Initializer * next;
304 struct Expression * exp;
305 struct __ecereNameSpace__ecere__sys__OldList * list;
307 unsigned int isConstant;
310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
312 struct __ecereNameSpace__ecere__com__DataValue
330 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
334 struct Expression * prev;
335 struct Expression * next;
343 struct Identifier * identifier;
345 struct Statement * compound;
346 struct Instantiation * instance;
348 struct __ecereNameSpace__ecere__sys__OldList * list;
351 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
352 struct Declarator * decl;
356 struct Identifier * id;
360 struct Expression * exp;
361 struct __ecereNameSpace__ecere__sys__OldList * arguments;
362 struct Location argLoc;
366 struct Expression * exp;
367 struct __ecereNameSpace__ecere__sys__OldList * index;
371 struct Expression * exp;
372 struct Identifier * member;
374 unsigned int thisPtr;
379 struct Expression * exp1;
380 struct Expression * exp2;
382 struct TypeName * typeName;
383 struct Specifier * _class;
386 struct TypeName * typeName;
387 struct Expression * exp;
391 struct Expression * cond;
392 struct __ecereNameSpace__ecere__sys__OldList * exp;
393 struct Expression * elseExp;
397 struct TypeName * typeName;
398 struct Expression * size;
402 struct TypeName * typeName;
403 struct Expression * size;
404 struct Expression * exp;
409 struct Identifier * id;
413 struct Expression * ds;
414 struct Expression * name;
418 struct TypeName * typeName;
419 struct Initializer * initializer;
423 struct Expression * exp;
424 struct TypeName * typeName;
427 unsigned int debugValue;
428 struct __ecereNameSpace__ecere__com__DataValue val;
429 unsigned int address;
430 unsigned int hasAddress;
431 struct Type * expType;
432 struct Type * destType;
435 unsigned int byReference;
436 unsigned int isConstant;
437 unsigned int addedThis;
438 unsigned int needCast;
439 unsigned int thisPtr;
442 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
444 struct TemplateDatatype
446 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
447 struct Declarator * decl;
450 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
452 struct TemplateArgument;
454 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
456 struct TemplateParameter
458 struct TemplateParameter * prev;
459 struct TemplateParameter * next;
462 struct Identifier * identifier;
465 struct TemplateDatatype * dataType;
468 struct TemplateArgument * defaultArgument;
469 char * dataTypeString;
470 struct Type * baseType;
473 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
477 struct Specifier * prev;
478 struct Specifier * next;
487 struct Symbol * symbol;
488 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
492 struct Identifier * id;
493 struct __ecereNameSpace__ecere__sys__OldList * list;
494 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
495 struct __ecereNameSpace__ecere__sys__OldList * definitions;
496 unsigned int addNameSpace;
497 struct Context * ctx;
499 struct Expression * expression;
500 struct Specifier * _class;
501 struct TemplateParameter * templateParameter;
505 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
509 struct Identifier * prev;
510 struct Identifier * next;
512 struct Symbol * classSym;
513 struct Specifier * _class;
515 struct Identifier * badID;
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
522 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
526 struct Declarator * prev;
527 struct Declarator * next;
530 struct Symbol * symbol;
531 struct Declarator * declarator;
534 struct Identifier * identifier;
537 struct Expression * exp;
538 struct Expression * posExp;
543 struct Expression * exp;
544 struct Specifier * enumClass;
548 struct __ecereNameSpace__ecere__sys__OldList * parameters;
552 struct Pointer * pointer;
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
563 struct FunctionDefinition
565 struct FunctionDefinition * prev;
566 struct FunctionDefinition * next;
568 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
569 struct Declarator * declarator;
570 struct __ecereNameSpace__ecere__sys__OldList * declarations;
571 struct Statement * body;
572 struct __ecereNameSpace__ecere__com__Class * _class;
573 struct __ecereNameSpace__ecere__sys__OldList attached;
576 struct Symbol * propSet;
578 unsigned int propertyNoThis;
581 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
585 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
589 struct External * prev;
590 struct External * next;
593 struct Symbol * symbol;
596 struct FunctionDefinition * function;
597 struct ClassDefinition * _class;
598 struct Declaration * declaration;
600 struct Identifier * id;
601 struct DBTableDef * table;
606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
610 struct ModuleImport * prev;
611 struct ModuleImport * next;
613 struct __ecereNameSpace__ecere__sys__OldList classes;
614 struct __ecereNameSpace__ecere__sys__OldList functions;
619 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
623 struct ClassImport * prev;
624 struct ClassImport * next;
626 struct __ecereNameSpace__ecere__sys__OldList methods;
627 struct __ecereNameSpace__ecere__sys__OldList properties;
629 unsigned int isRemote;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
637 struct Symbol * parent;
638 struct Symbol * left;
639 struct Symbol * right;
644 struct __ecereNameSpace__ecere__com__Method * method;
645 struct __ecereNameSpace__ecere__com__Property * _property;
646 struct __ecereNameSpace__ecere__com__Class * registered;
654 struct External * pointerExternal;
655 struct External * structExternal;
659 struct External * externalGet;
660 struct External * externalSet;
661 struct External * externalPtr;
662 struct External * externalIsSet;
666 struct External * methodExternal;
667 struct External * methodCodeExternal;
670 unsigned int imported;
671 unsigned int declaredStructSym;
672 struct __ecereNameSpace__ecere__com__Class * _class;
673 unsigned int declaredStruct;
674 unsigned int needConstructor;
675 unsigned int needDestructor;
676 char * constructorName;
679 char * destructorName;
680 struct ModuleImport * module;
681 struct ClassImport * _import;
682 struct Location nameLoc;
683 unsigned int isParam;
684 unsigned int isRemote;
685 unsigned int isStruct;
686 unsigned int fireWatchersDone;
688 unsigned int classData;
689 unsigned int isStatic;
691 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
693 struct Context * ctx;
695 struct Expression * propCategory;
698 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
707 struct Symbol * _class;
710 struct __ecereNameSpace__ecere__sys__OldList members;
715 struct Type * returnType;
716 struct __ecereNameSpace__ecere__sys__OldList params;
717 struct Symbol * thisClass;
718 unsigned int staticMethod;
719 struct TemplateParameter * thisClassTemplate;
723 struct __ecereNameSpace__ecere__com__Method * method;
724 struct __ecereNameSpace__ecere__com__Class * methodClass;
725 struct __ecereNameSpace__ecere__com__Class * usedClass;
729 struct Type * arrayType;
731 struct Expression * arraySizeExp;
732 unsigned int freeExp;
733 struct Symbol * enumClass;
736 struct TemplateParameter * templateParameter;
738 unsigned int isSigned;
740 unsigned int constant;
747 unsigned int byReference;
748 unsigned int extraParam;
750 unsigned int directClassAccess;
751 unsigned int computing;
752 unsigned int dllExport;
754 unsigned int keepCast;
755 unsigned int passAsTemplate;
759 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
761 struct __ecereNameSpace__ecere__com__Class
763 struct __ecereNameSpace__ecere__com__Class * prev;
764 struct __ecereNameSpace__ecere__com__Class * next;
770 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
771 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
774 struct __ecereNameSpace__ecere__com__Class * base;
775 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
776 struct __ecereNameSpace__ecere__sys__BinaryTree members;
777 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
778 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
779 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
780 struct __ecereNameSpace__ecere__sys__OldList derivatives;
784 struct __ecereNameSpace__ecere__com__Instance * module;
785 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
786 char * dataTypeString;
787 struct Type * dataType;
789 int defaultAlignment;
790 void (* Initialize)();
792 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
793 char * designerClass;
794 unsigned int noExpansion;
795 char * defaultProperty;
796 unsigned int comRedefinition;
798 unsigned int isRemote;
799 unsigned int internalDecl;
801 unsigned int computeSize;
803 int destructionWatchOffset;
805 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
806 int inheritanceAccess;
809 struct __ecereNameSpace__ecere__sys__OldList conversions;
810 struct __ecereNameSpace__ecere__sys__OldList templateParams;
811 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
812 struct __ecereNameSpace__ecere__com__Class * templateClass;
813 struct __ecereNameSpace__ecere__sys__OldList templatized;
817 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
819 struct __ecereNameSpace__ecere__com__Instance
822 struct __ecereNameSpace__ecere__com__Class * _class;
826 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
828 struct __ecereNameSpace__ecere__com__DataMember
830 struct __ecereNameSpace__ecere__com__DataMember * prev;
831 struct __ecereNameSpace__ecere__com__DataMember * next;
833 unsigned int isProperty;
836 struct __ecereNameSpace__ecere__com__Class * _class;
837 char * dataTypeString;
838 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
839 struct Type * dataType;
843 struct __ecereNameSpace__ecere__sys__OldList members;
844 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
849 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
851 struct __ecereNameSpace__ecere__com__SerialBuffer
853 unsigned char * _buffer;
859 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
867 char * dataTypeString;
868 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
870 struct __ecereNameSpace__ecere__com__DataValue expression;
876 struct __ecereNameSpace__ecere__com__DataMember * member;
877 struct __ecereNameSpace__ecere__com__Property * prop;
878 struct __ecereNameSpace__ecere__com__Method * method;
884 typedef unsigned int size_t;
886 void exit(int status);
888 void * calloc(size_t nmemb, size_t size);
890 void free(void * ptr);
892 void * malloc(size_t size);
894 void * realloc(void * ptr, size_t size);
896 long int strtol(const char * nptr, char ** endptr, int base);
898 long long int strtoll(const char * nptr, char ** endptr, int base);
900 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
904 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, EXT_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
907 typedef union YYSTYPE
912 struct Identifier * id;
913 struct Expression * exp;
914 struct Specifier * specifier;
915 struct __ecereNameSpace__ecere__sys__OldList * list;
916 struct Enumerator * enumerator;
917 struct Declarator * declarator;
918 struct Pointer * pointer;
919 struct Initializer * initializer;
920 struct InitDeclarator * initDeclarator;
921 struct TypeName * typeName;
922 struct Declaration * declaration;
923 struct Statement * stmt;
924 struct FunctionDefinition * function;
925 struct External * external;
926 struct Context * context;
927 struct AsmField * asmField;
928 struct Instantiation * instance;
929 struct MembersInit * membersInit;
930 struct MemberInit * memberInit;
931 struct ClassFunction * classFunction;
932 struct ClassDefinition * _class;
933 struct ClassDef * classDef;
934 struct PropertyDef * prop;
936 struct Symbol * symbol;
937 struct PropertyWatch * propertyWatch;
938 struct TemplateParameter * templateParameter;
939 struct TemplateArgument * templateArgument;
940 struct TemplateDatatype * templateDatatype;
941 struct DBTableEntry * dbtableEntry;
942 struct DBIndexItem * dbindexItem;
943 struct DBTableDef * dbtableDef;
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
950 struct Enumerator * prev;
951 struct Enumerator * next;
953 struct Identifier * id;
954 struct Expression * exp;
957 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
959 struct InitDeclarator
961 struct InitDeclarator * prev;
962 struct InitDeclarator * next;
964 struct Declarator * declarator;
965 struct Initializer * initializer;
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
972 struct AsmField * prev;
973 struct AsmField * next;
976 struct Expression * expression;
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
983 struct ClassFunction * prev;
984 struct ClassFunction * next;
986 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
987 struct Declarator * declarator;
988 struct __ecereNameSpace__ecere__sys__OldList * declarations;
989 struct Statement * body;
990 struct __ecereNameSpace__ecere__com__Class * _class;
991 struct __ecereNameSpace__ecere__sys__OldList attached;
994 struct Symbol * propSet;
995 unsigned int isVirtual;
996 unsigned int isConstructor;
997 unsigned int isDestructor;
998 unsigned int dontMangle;
1003 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1007 struct MembersInit * prev;
1008 struct MembersInit * next;
1009 struct Location loc;
1013 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1014 struct ClassFunction * function;
1018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1022 struct MemberInit * prev;
1023 struct MemberInit * next;
1024 struct Location loc;
1025 struct Location realLoc;
1026 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1027 struct Initializer * initializer;
1029 unsigned int variable;
1030 unsigned int takeOutExp;
1033 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1037 struct PropertyDef * prev;
1038 struct PropertyDef * next;
1039 struct Location loc;
1040 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1041 struct Declarator * declarator;
1042 struct Identifier * id;
1043 struct Statement * getStmt;
1044 struct Statement * setStmt;
1045 struct Statement * issetStmt;
1046 struct Symbol * symbol;
1047 unsigned int conversion;
1048 unsigned int isWatchable;
1049 struct Expression * category;
1052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1054 struct PropertyWatch
1056 struct PropertyWatch * prev;
1057 struct PropertyWatch * next;
1058 struct Location loc;
1059 struct Statement * compound;
1060 struct __ecereNameSpace__ecere__sys__OldList * properties;
1061 unsigned int deleteWatch;
1064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1068 struct ClassDef * prev;
1069 struct ClassDef * next;
1070 struct Location loc;
1074 struct Declaration * decl;
1075 struct ClassFunction * function;
1076 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1077 struct PropertyDef * propertyDef;
1078 struct PropertyWatch * propertyWatch;
1080 struct Identifier * defaultProperty;
1083 struct Identifier * id;
1084 struct Initializer * initializer;
1091 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1093 struct DBTableEntry;
1095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1099 extern YYSTYPE yylval;
1101 extern struct Location yylloc;
1103 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1105 extern int returnCode;
1107 extern struct Expression * parsedExpression;
1109 extern unsigned int yydebug;
1111 void SetYydebug(unsigned int b)
1116 extern unsigned int echoOn;
1118 void resetScanner();
1122 int expression_yyparse();
1124 static struct Statement * curCompound;
1126 struct External * curExternal, * afterExternal;
1128 static struct Type * curSwitchType;
1130 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1132 struct __ecereNameSpace__ecere__com__Class * thisClass;
1134 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1139 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1144 static char * thisNameSpace;
1146 struct __ecereNameSpace__ecere__com__Class * containerClass;
1148 unsigned int thisClassParams = 0x1;
1150 unsigned int internalValueCounter;
1152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1154 struct __ecereNameSpace__ecere__sys__TempFile
1156 char __ecere_padding[24];
1159 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1161 extern int strlen(const char * );
1163 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1165 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1167 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1169 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1171 void PrintExpression(struct Expression * exp, char * string)
1174 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1178 OutputExpression(exp, f);
1179 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1180 count = strlen(string);
1181 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);
1182 string[count] = '\0';
1183 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1187 extern int isspace(int c);
1189 long long _strtoi64(char * string, char ** endString, int base)
1191 long long value = 0;
1196 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1208 if(ch == (char)0 && string[c + 1] == 'x')
1221 for(; (ch = string[c]); c++)
1225 else if(ch >= '1' && ch <= '9')
1227 else if(ch >= 'a' && ch <= 'z')
1229 else if(ch >= 'A' && ch <= 'Z')
1234 *endString = string + c;
1245 *endString = string + c;
1249 return sign * value;
1252 uint64 _strtoui64(char * string, char ** endString, int base)
1259 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1271 if(ch == (char)0 && string[c + 1] == 'x')
1284 for(; (ch = string[c]); c++)
1288 else if(ch >= '1' && ch <= '9')
1290 else if(ch >= 'a' && ch <= 'z')
1292 else if(ch >= 'A' && ch <= 'Z')
1297 *endString = string + c;
1308 *endString = string + c;
1312 return sign * value;
1315 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1317 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1319 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1321 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1323 if(!param->baseType)
1325 if(param->dataTypeString)
1326 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1328 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1330 return param->baseType;
1332 return (((void *)0));
1335 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1337 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1339 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1343 if(type1->kind == type2->kind)
1351 if(type1->passAsTemplate && !type2->passAsTemplate)
1353 return type1->isSigned != type2->isSigned;
1355 return type1->_class != type2->_class;
1357 return NeedCast(type1->type, type2->type);
1365 extern int strcmp(const char * , const char * );
1367 extern struct Context * curContext;
1369 extern struct Context * topContext;
1371 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1373 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);
1375 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1377 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);
1379 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);
1381 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1383 struct __ecereNameSpace__ecere__com__ClassProperty
1386 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1387 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1388 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1390 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1391 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1392 char * dataTypeString;
1393 struct Type * dataType;
1394 unsigned int constant;
1397 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1399 extern struct Expression * QMkExpId(char * id);
1401 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1403 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1405 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1406 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1411 char * dataTypeString;
1414 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1416 char __ecere_padding[4];
1419 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1421 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1423 extern void FreeIdentifier(struct Identifier * id);
1425 void ProcessExpressionType(struct Expression * exp);
1427 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1429 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1431 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1433 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1435 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1437 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1439 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1441 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1443 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1445 if(exp->type == 0 && exp->identifier)
1447 struct Identifier * id = exp->identifier;
1448 struct Context * ctx;
1449 struct Symbol * symbol = (((void *)0));
1451 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1453 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1455 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1460 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1462 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1463 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1464 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1465 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1469 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1471 if(!prop && !method)
1472 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1473 if(!prop && !method && !member)
1475 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1477 if(prop || method || member || classProp)
1480 exp->member.member = id;
1481 exp->member.memberType = 0;
1482 exp->member.exp = QMkExpId("this");
1483 exp->addedThis = 0x1;
1485 else if(_class && _class->templateParams.first)
1487 struct __ecereNameSpace__ecere__com__Class * sClass;
1489 for(sClass = _class; sClass; sClass = sClass->base)
1491 if(sClass->templateParams.first)
1493 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1495 for(param = sClass->templateParams.first; param; param = param->next)
1497 if(param->type == 2 && !strcmp(param->name, id->string))
1499 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1503 struct Declarator * decl;
1504 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1506 FreeIdentifier(exp->member.member);
1507 ProcessExpressionType(argExp);
1508 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1509 exp->expType = ProcessType(specs, decl);
1511 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1522 extern int sprintf(char * , char * , ...);
1524 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1526 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1528 char * PrintInt(long long result)
1532 if(result > (((long long)0x7fffffffffffffffLL)))
1533 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1535 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1536 return __ecereNameSpace__ecere__sys__CopyString(temp);
1539 char * PrintUInt(uint64 result)
1543 if(result > (0xffffffff))
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1545 else if(result > (((int)0x7fffffff)))
1546 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1548 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1549 return __ecereNameSpace__ecere__sys__CopyString(temp);
1552 char * PrintInt64(long long result)
1556 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1557 return __ecereNameSpace__ecere__sys__CopyString(temp);
1560 char * PrintUInt64(uint64 result)
1564 if(result > (((long long)0x7fffffffffffffffLL)))
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1567 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1571 char * PrintHexUInt(uint64 result)
1575 if(result > (0xffffffff))
1576 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1578 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 char * PrintHexUInt64(uint64 result)
1586 if(result > (0xffffffff))
1587 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1589 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1590 return __ecereNameSpace__ecere__sys__CopyString(temp);
1593 char * PrintShort(short result)
1597 sprintf(temp, "%d", (unsigned short)result);
1598 return __ecereNameSpace__ecere__sys__CopyString(temp);
1601 char * PrintUShort(unsigned short result)
1605 if(result > (unsigned short)32767)
1606 sprintf(temp, "0x%X", (int)result);
1608 sprintf(temp, "%d", result);
1609 return __ecereNameSpace__ecere__sys__CopyString(temp);
1612 extern int isprint(int c);
1614 char * PrintChar(char result)
1618 if(result > (char)0 && isprint(result))
1619 sprintf(temp, "'%c'", result);
1620 else if(result < (char)0)
1621 sprintf(temp, "%d", result);
1623 sprintf(temp, "0x%X", (unsigned char)result);
1624 return __ecereNameSpace__ecere__sys__CopyString(temp);
1627 char * PrintUChar(unsigned char result)
1631 sprintf(temp, "0x%X", result);
1632 return __ecereNameSpace__ecere__sys__CopyString(temp);
1635 char * PrintFloat(float result)
1639 sprintf(temp, "%.16ff", result);
1640 return __ecereNameSpace__ecere__sys__CopyString(temp);
1643 char * PrintDouble(double result)
1647 sprintf(temp, "%.16f", result);
1648 return __ecereNameSpace__ecere__sys__CopyString(temp);
1651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1655 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1657 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1658 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1659 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1660 unsigned int (* Neg)(struct Expression *, struct Operand *);
1661 unsigned int (* Inc)(struct Expression *, struct Operand *);
1662 unsigned int (* Dec)(struct Expression *, struct Operand *);
1663 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1675 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (* Not)(struct Expression *, struct Operand *);
1681 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1688 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1689 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1692 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1698 unsigned int ptrSize;
1716 struct Operand GetOperand(struct Expression * exp);
1718 unsigned int GetInt(struct Expression * exp, int * value2)
1720 struct Operand op2 = GetOperand(exp);
1722 if(op2.kind == 3 && op2.type->isSigned)
1724 else if(op2.kind == 3)
1725 *value2 = (int)op2.ui;
1726 if(op2.kind == 4 && op2.type->isSigned)
1727 *value2 = (int)op2.i64;
1728 else if(op2.kind == 4)
1729 *value2 = (int)op2.ui64;
1730 else if(op2.kind == 2 && op2.type->isSigned)
1731 *value2 = (int)op2.s;
1732 else if(op2.kind == 2)
1733 *value2 = (int)op2.us;
1734 else if(op2.kind == 1 && op2.type->isSigned)
1735 *value2 = (int)op2.c;
1736 else if(op2.kind == 1)
1737 *value2 = (int)op2.uc;
1738 else if(op2.kind == 6)
1739 *value2 = (int)op2.f;
1740 else if(op2.kind == 7)
1741 *value2 = (int)op2.d;
1742 else if(op2.kind == 13)
1743 *value2 = (int)op2.ui;
1749 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1751 struct Operand op2 = GetOperand(exp);
1753 if(op2.kind == 3 && op2.type->isSigned)
1754 *value2 = (unsigned int)op2.i;
1755 else if(op2.kind == 3)
1757 if(op2.kind == 4 && op2.type->isSigned)
1758 *value2 = (unsigned int)op2.i64;
1759 else if(op2.kind == 4)
1760 *value2 = (unsigned int)op2.ui64;
1761 else if(op2.kind == 2 && op2.type->isSigned)
1762 *value2 = (unsigned int)op2.s;
1763 else if(op2.kind == 2)
1764 *value2 = (unsigned int)op2.us;
1765 else if(op2.kind == 1 && op2.type->isSigned)
1766 *value2 = (unsigned int)op2.c;
1767 else if(op2.kind == 1)
1768 *value2 = (unsigned int)op2.uc;
1769 else if(op2.kind == 6)
1770 *value2 = (unsigned int)op2.f;
1771 else if(op2.kind == 7)
1772 *value2 = (unsigned int)op2.d;
1773 else if(op2.kind == 13)
1780 unsigned int GetInt64(struct Expression * exp, long long * value2)
1782 struct Operand op2 = GetOperand(exp);
1784 if(op2.kind == 3 && op2.type->isSigned)
1785 *value2 = (long long)op2.i;
1786 else if(op2.kind == 3)
1787 *value2 = (long long)op2.ui;
1788 if(op2.kind == 4 && op2.type->isSigned)
1790 else if(op2.kind == 4)
1791 *value2 = (long long)op2.ui64;
1792 else if(op2.kind == 2 && op2.type->isSigned)
1793 *value2 = (long long)op2.s;
1794 else if(op2.kind == 2)
1795 *value2 = (long long)op2.us;
1796 else if(op2.kind == 1 && op2.type->isSigned)
1797 *value2 = (long long)op2.c;
1798 else if(op2.kind == 1)
1799 *value2 = (long long)op2.uc;
1800 else if(op2.kind == 6)
1801 *value2 = (long long)op2.f;
1802 else if(op2.kind == 7)
1803 *value2 = (long long)op2.d;
1804 else if(op2.kind == 13)
1805 *value2 = (long long)op2.ui;
1811 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1813 struct Operand op2 = GetOperand(exp);
1815 if(op2.kind == 3 && op2.type->isSigned)
1816 *value2 = (uint64)op2.i;
1817 else if(op2.kind == 3)
1818 *value2 = (uint64)op2.ui;
1819 if(op2.kind == 4 && op2.type->isSigned)
1820 *value2 = (uint64)op2.i64;
1821 else if(op2.kind == 4)
1823 else if(op2.kind == 2 && op2.type->isSigned)
1824 *value2 = (uint64)op2.s;
1825 else if(op2.kind == 2)
1826 *value2 = (uint64)op2.us;
1827 else if(op2.kind == 1 && op2.type->isSigned)
1828 *value2 = (uint64)op2.c;
1829 else if(op2.kind == 1)
1830 *value2 = (uint64)op2.uc;
1831 else if(op2.kind == 6)
1832 *value2 = (uint64)op2.f;
1833 else if(op2.kind == 7)
1834 *value2 = (uint64)op2.d;
1835 else if(op2.kind == 13)
1836 *value2 = (uint64)op2.ui;
1842 unsigned int GetShort(struct Expression * exp, short * value2)
1844 struct Operand op2 = GetOperand(exp);
1846 if(op2.kind == 3 && op2.type->isSigned)
1847 *value2 = (short)op2.i;
1848 else if(op2.kind == 3)
1849 *value2 = (short)op2.ui;
1850 if(op2.kind == 4 && op2.type->isSigned)
1851 *value2 = (short)op2.i64;
1852 else if(op2.kind == 4)
1853 *value2 = (short)op2.ui64;
1854 else if(op2.kind == 2 && op2.type->isSigned)
1856 else if(op2.kind == 2)
1857 *value2 = (short)op2.us;
1858 else if(op2.kind == 1 && op2.type->isSigned)
1859 *value2 = (short)op2.c;
1860 else if(op2.kind == 1)
1861 *value2 = (short)op2.uc;
1862 else if(op2.kind == 6)
1863 *value2 = (short)op2.f;
1864 else if(op2.kind == 7)
1865 *value2 = (short)op2.d;
1866 else if(op2.kind == 13)
1867 *value2 = (short)op2.ui;
1873 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1875 struct Operand op2 = GetOperand(exp);
1877 if(op2.kind == 3 && op2.type->isSigned)
1878 *value2 = (unsigned short)op2.i;
1879 else if(op2.kind == 3)
1880 *value2 = (unsigned short)op2.ui;
1881 if(op2.kind == 4 && op2.type->isSigned)
1882 *value2 = (unsigned short)op2.i64;
1883 else if(op2.kind == 4)
1884 *value2 = (unsigned short)op2.ui64;
1885 else if(op2.kind == 2 && op2.type->isSigned)
1886 *value2 = (unsigned short)op2.s;
1887 else if(op2.kind == 2)
1889 else if(op2.kind == 1 && op2.type->isSigned)
1890 *value2 = (unsigned short)op2.c;
1891 else if(op2.kind == 1)
1892 *value2 = (unsigned short)op2.uc;
1893 else if(op2.kind == 6)
1894 *value2 = (unsigned short)op2.f;
1895 else if(op2.kind == 7)
1896 *value2 = (unsigned short)op2.d;
1897 else if(op2.kind == 13)
1898 *value2 = (unsigned short)op2.ui;
1904 unsigned int GetChar(struct Expression * exp, char * value2)
1906 struct Operand op2 = GetOperand(exp);
1908 if(op2.kind == 3 && op2.type->isSigned)
1909 *value2 = (char)op2.i;
1910 else if(op2.kind == 3)
1911 *value2 = (char)op2.ui;
1912 if(op2.kind == 4 && op2.type->isSigned)
1913 *value2 = (char)op2.i64;
1914 else if(op2.kind == 4)
1915 *value2 = (char)op2.ui64;
1916 else if(op2.kind == 2 && op2.type->isSigned)
1917 *value2 = (char)op2.s;
1918 else if(op2.kind == 2)
1919 *value2 = (char)op2.us;
1920 else if(op2.kind == 1 && op2.type->isSigned)
1922 else if(op2.kind == 1)
1923 *value2 = (char)op2.uc;
1924 else if(op2.kind == 6)
1925 *value2 = (char)op2.f;
1926 else if(op2.kind == 7)
1927 *value2 = (char)op2.d;
1928 else if(op2.kind == 13)
1929 *value2 = (char)op2.ui;
1935 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1937 struct Operand op2 = GetOperand(exp);
1939 if(op2.kind == 3 && op2.type->isSigned)
1940 *value2 = (unsigned char)op2.i;
1941 else if(op2.kind == 3)
1942 *value2 = (unsigned char)op2.ui;
1943 if(op2.kind == 4 && op2.type->isSigned)
1944 *value2 = (unsigned char)op2.i64;
1945 else if(op2.kind == 4)
1946 *value2 = (unsigned char)op2.ui64;
1947 else if(op2.kind == 2 && op2.type->isSigned)
1948 *value2 = (unsigned char)op2.s;
1949 else if(op2.kind == 2)
1950 *value2 = (unsigned char)op2.us;
1951 else if(op2.kind == 1 && op2.type->isSigned)
1952 *value2 = (unsigned char)op2.c;
1953 else if(op2.kind == 1)
1955 else if(op2.kind == 6)
1956 *value2 = (unsigned char)op2.f;
1957 else if(op2.kind == 7)
1958 *value2 = (unsigned char)op2.d;
1959 else if(op2.kind == 13)
1960 *value2 = (unsigned char)op2.ui;
1966 unsigned int GetFloat(struct Expression * exp, float * value2)
1968 struct Operand op2 = GetOperand(exp);
1970 if(op2.kind == 3 && op2.type->isSigned)
1971 *value2 = (float)(float)op2.i;
1972 else if(op2.kind == 3)
1973 *value2 = (float)(float)op2.ui;
1974 if(op2.kind == 4 && op2.type->isSigned)
1975 *value2 = (float)(float)op2.i64;
1976 else if(op2.kind == 4)
1977 *value2 = (float)(float)op2.ui64;
1978 else if(op2.kind == 2 && op2.type->isSigned)
1979 *value2 = (float)(float)op2.s;
1980 else if(op2.kind == 2)
1981 *value2 = (float)(float)op2.us;
1982 else if(op2.kind == 1 && op2.type->isSigned)
1983 *value2 = (float)(float)op2.c;
1984 else if(op2.kind == 1)
1985 *value2 = (float)(float)op2.uc;
1986 else if(op2.kind == 6)
1987 *value2 = (float)op2.f;
1988 else if(op2.kind == 7)
1989 *value2 = (float)op2.d;
1990 else if(op2.kind == 13)
1991 *value2 = (float)(float)op2.ui;
1997 unsigned int GetDouble(struct Expression * exp, double * value2)
1999 struct Operand op2 = GetOperand(exp);
2001 if(op2.kind == 3 && op2.type->isSigned)
2002 *value2 = (double)(double)op2.i;
2003 else if(op2.kind == 3)
2004 *value2 = (double)(double)op2.ui;
2005 if(op2.kind == 4 && op2.type->isSigned)
2006 *value2 = (double)(double)op2.i64;
2007 else if(op2.kind == 4)
2008 *value2 = (double)(double)op2.ui64;
2009 else if(op2.kind == 2 && op2.type->isSigned)
2010 *value2 = (double)(double)op2.s;
2011 else if(op2.kind == 2)
2012 *value2 = (double)(double)op2.us;
2013 else if(op2.kind == 1 && op2.type->isSigned)
2014 *value2 = (double)(double)op2.c;
2015 else if(op2.kind == 1)
2016 *value2 = (double)(double)op2.uc;
2017 else if(op2.kind == 6)
2018 *value2 = (double)op2.f;
2019 else if(op2.kind == 7)
2020 *value2 = (double)op2.d;
2021 else if(op2.kind == 13)
2022 *value2 = (double)(double)op2.ui;
2028 void ComputeExpression(struct Expression * exp);
2030 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2032 int ComputeTypeSize(struct Type * type);
2034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2036 struct __ecereNameSpace__ecere__com__BitMember
2038 struct __ecereNameSpace__ecere__com__BitMember * prev;
2039 struct __ecereNameSpace__ecere__com__BitMember * next;
2041 unsigned int isProperty;
2044 struct __ecereNameSpace__ecere__com__Class * _class;
2045 char * dataTypeString;
2046 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2047 struct Type * dataType;
2054 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2056 struct __ecereNameSpace__ecere__sys__OldLink
2058 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2059 struct __ecereNameSpace__ecere__sys__OldLink * next;
2063 void FinishTemplatesContext(struct Context * context);
2065 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2067 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2068 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2070 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2073 int unionMemberOffset = 0;
2076 if(!member && _class->destructionWatchOffset)
2077 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2079 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2081 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2083 if(!dataMember->isProperty)
2085 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2087 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2093 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2095 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2097 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2099 if(!isMember && _class->type == 2 && dataMember->dataType)
2101 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2105 ComputeTypeSize(dataMember->dataType);
2106 if(bitMember->pos == -1)
2107 bitMember->pos = _class->memberOffset;
2108 if(!bitMember->size)
2109 bitMember->size = dataMember->dataType->size * 8;
2110 _class->memberOffset = bitMember->pos + bitMember->size;
2111 for(d = 0; d < bitMember->size; d++)
2117 bitMember->mask = mask << bitMember->pos;
2119 else if(dataMember->type == 0 && dataMember->dataType)
2124 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2125 ComputeTypeSize(dataMember->dataType);
2126 if(dataMember->dataType->bitFieldCount)
2128 bitFields += dataMember->dataType->bitFieldCount;
2135 int size = (bitFields + 7) / 8;
2139 int __simpleStruct0;
2143 int __simpleStruct0;
2145 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2146 if(member->memberOffset % alignment)
2147 member->memberOffset += alignment - (member->memberOffset % alignment);
2149 dataMember->offset = member->memberOffset;
2150 if(member->type == 1)
2151 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2154 member->memberOffset += size;
2161 int __simpleStruct0;
2163 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2164 if(_class->memberOffset % alignment)
2165 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2167 dataMember->offset = _class->memberOffset;
2168 _class->memberOffset += size;
2172 size = dataMember->dataType->size;
2173 alignment = dataMember->dataType->alignment;
2177 int __simpleStruct0;
2181 int __simpleStruct0;
2183 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2184 if(member->memberOffset % alignment)
2185 member->memberOffset += alignment - (member->memberOffset % alignment);
2187 dataMember->offset = member->memberOffset;
2188 if(member->type == 1)
2189 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2192 member->memberOffset += size;
2199 int __simpleStruct0;
2201 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2202 if(_class->memberOffset % alignment)
2203 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2205 dataMember->offset = _class->memberOffset;
2206 _class->memberOffset += size;
2211 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2214 int __simpleStruct2;
2215 int __simpleStruct0, __simpleStruct1;
2217 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2218 dataMember->offset = member->memberOffset;
2219 if(member->type == 1)
2220 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2222 member->memberOffset += dataMember->memberOffset;
2226 int __simpleStruct0, __simpleStruct1;
2228 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2229 dataMember->offset = _class->memberOffset;
2230 _class->memberOffset += dataMember->memberOffset;
2238 int size = (bitFields + 7) / 8;
2242 int __simpleStruct0;
2246 int __simpleStruct0;
2248 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2249 if(member->memberOffset % alignment)
2250 member->memberOffset += alignment - (member->memberOffset % alignment);
2252 if(member->type == 1)
2253 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2256 member->memberOffset += size;
2263 int __simpleStruct0;
2265 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2266 if(_class->memberOffset % alignment)
2267 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2269 _class->memberOffset += size;
2274 if(member && member->type == 1)
2276 member->memberOffset = unionMemberOffset;
2280 if(_class->type != 2)
2282 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2285 struct __ecereNameSpace__ecere__com__Property * prop;
2287 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2289 if(prop->isProperty && prop->isWatchable)
2291 prop->watcherOffset = _class->structSize;
2292 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2297 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2299 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2301 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2303 if(deriv->computeSize)
2305 deriv->offset = _class->structSize;
2306 deriv->memberOffset = 0;
2307 deriv->structSize = deriv->offset;
2308 ComputeClassMembers(deriv, 0x0);
2316 FinishTemplatesContext(context);
2319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2321 struct __ecereNameSpace__ecere__com__NameSpace
2324 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2325 struct __ecereNameSpace__ecere__com__NameSpace * left;
2326 struct __ecereNameSpace__ecere__com__NameSpace * right;
2328 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2329 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2330 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2331 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2332 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2335 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2337 struct __ecereNameSpace__ecere__com__Module
2339 struct __ecereNameSpace__ecere__com__Instance * application;
2340 struct __ecereNameSpace__ecere__sys__OldList classes;
2341 struct __ecereNameSpace__ecere__sys__OldList defines;
2342 struct __ecereNameSpace__ecere__sys__OldList functions;
2343 struct __ecereNameSpace__ecere__sys__OldList modules;
2344 struct __ecereNameSpace__ecere__com__Instance * prev;
2345 struct __ecereNameSpace__ecere__com__Instance * next;
2351 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2352 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2355 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2357 struct __ecereNameSpace__ecere__com__Class * _class;
2358 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2360 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2361 ComputeModuleClasses(subModule->data);
2362 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2363 ComputeClassMembers(_class, 0x0);
2366 extern unsigned int inCompiler;
2368 extern void Compiler_Error(char * format, ...);
2370 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2372 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2374 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2376 int ComputeTypeSize(struct Type * type)
2378 unsigned int size = type ? type->size : 0;
2380 if(!size && type && !type->computing)
2382 type->computing = 0x1;
2386 type->alignment = size = sizeof(char);
2389 type->alignment = size = sizeof(int);
2392 type->alignment = size = sizeof(long long);
2395 type->alignment = size = sizeof(long);
2398 type->alignment = size = sizeof(short);
2401 type->alignment = size = sizeof(float);
2404 type->alignment = size = sizeof(double);
2408 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2410 if(_class && _class->type == 1)
2412 ComputeClassMembers(_class, 0x0);
2413 type->alignment = _class->structAlignment;
2414 size = _class->structSize;
2415 if(type->alignment && size % type->alignment)
2416 size += type->alignment - (size % type->alignment);
2418 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2420 if(!_class->dataType)
2421 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2422 size = type->alignment = ComputeTypeSize(_class->dataType);
2425 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2430 size = type->alignment = sizeof(void *);
2433 if(type->arraySizeExp)
2435 ProcessExpressionType(type->arraySizeExp);
2436 ComputeExpression(type->arraySizeExp);
2437 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)))
2439 struct Location oldLoc = yylloc;
2440 char expression[10240];
2442 expression[0] = '\0';
2443 type->arraySizeExp->expType = (((void *)0));
2444 yylloc = type->arraySizeExp->loc;
2446 PrintExpression(type->arraySizeExp, expression);
2447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2450 GetInt(type->arraySizeExp, &type->arraySize);
2452 else if(type->enumClass)
2454 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2456 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2459 type->arraySize = 0;
2463 type->arraySize = 0;
2465 size = ComputeTypeSize(type->type) * type->arraySize;
2466 type->alignment = type->type->alignment;
2470 struct Type * member;
2472 for(member = type->members.first; member; member = member->next)
2474 int __simpleStruct0, __simpleStruct1;
2475 unsigned int addSize = ComputeTypeSize(member);
2477 member->offset = size;
2478 if(member->alignment && size % member->alignment)
2479 member->offset += member->alignment - (size % member->alignment);
2480 size = member->offset;
2481 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2484 if(type->alignment && size % type->alignment)
2485 size += type->alignment - (size % type->alignment);
2490 struct Type * member;
2492 for(member = type->members.first; member; member = member->next)
2494 int __simpleStruct0, __simpleStruct1;
2495 unsigned int addSize = ComputeTypeSize(member);
2497 member->offset = size;
2498 if(member->alignment && size % member->alignment)
2499 member->offset += member->alignment - (size % member->alignment);
2500 size = member->offset;
2501 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2502 size = ((size > addSize) ? size : addSize);
2504 if(type->alignment && size % type->alignment)
2505 size += type->alignment - (size % type->alignment);
2510 struct TemplateParameter * param = type->templateParameter;
2511 struct Type * baseType = ProcessTemplateParameterType(param);
2514 size = ComputeTypeSize(baseType);
2516 size = sizeof(uint64);
2529 size = sizeof(void *);
2534 type->computing = 0x0;
2539 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2541 extern struct Identifier * MkIdentifier(char * string);
2543 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2545 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2547 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2549 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2551 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2553 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2555 extern void FreeType(struct Type * type);
2557 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2559 extern struct Specifier * MkSpecifier(int specifier);
2561 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2563 extern struct Expression * MkExpConstant(char * string);
2565 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)
2567 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2568 unsigned int totalSize = 0;
2569 unsigned int maxSize = 0;
2570 int alignment, size;
2571 struct __ecereNameSpace__ecere__com__DataMember * member;
2572 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2574 if(!isMember && _class->base)
2576 maxSize = _class->structSize;
2578 if(_class->type == 1 || _class->type == 5)
2579 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2581 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2584 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2586 if(!member->isProperty)
2588 switch(member->type)
2592 if(member->dataTypeString)
2594 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2595 struct Declarator * decl;
2597 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2598 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2599 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2600 if(!member->dataType)
2601 member->dataType = ProcessType(specs, decl);
2602 ReplaceThisClassSpecifiers(specs, topClass);
2604 struct Type * type = ProcessType(specs, decl);
2606 DeclareType(member->dataType, 0x0, 0x0);
2609 ComputeTypeSize(member->dataType);
2610 size = member->dataType->size;
2611 alignment = member->dataType->alignment;
2614 if(totalSize % alignment)
2615 totalSize += alignment - (totalSize % alignment);
2624 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2627 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2628 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2629 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2630 alignment = member->structAlignment;
2633 if(totalSize % alignment)
2634 totalSize += alignment - (totalSize % alignment);
2644 unsigned int __simpleStruct0;
2646 if(topMember && topMember->type == 1)
2647 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2649 *retSize += totalSize;
2651 else if(totalSize < maxSize && _class->type != 1000)
2653 char sizeString[50];
2655 sprintf(sizeString, "%d", maxSize - totalSize);
2656 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2659 FinishTemplatesContext(context);
2660 return topMember ? topMember->memberID : _class->memberID;
2663 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2665 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2666 unsigned int totalSize = 0;
2667 struct __ecereNameSpace__ecere__com__DataMember * member;
2668 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2670 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2671 DeclareMembers(_class->base, 0x0);
2672 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2674 if(!member->isProperty)
2676 switch(member->type)
2680 if(!member->dataType && member->dataTypeString)
2681 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2682 if(member->dataType)
2683 DeclareType(member->dataType, 0x0, 0x0);
2689 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2696 FinishTemplatesContext(context);
2697 return topMember ? topMember->memberID : _class->memberID;
2700 extern struct Symbol * FindClass(char * name);
2702 extern char * strchr(char * , int);
2704 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2706 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2708 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2710 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2712 extern char * strcpy(char * , const char * );
2714 extern void MangleClassName(char * className);
2716 extern void DeclareClass(struct Symbol * classSym, char * className);
2718 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2720 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2722 void DeclareStruct(char * name, unsigned int skipNoHead)
2724 struct External * external = (((void *)0));
2725 struct Symbol * classSym = FindClass(name);
2727 if(!inCompiler || !classSym)
2728 return (((void *)0));
2729 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2730 return (((void *)0));
2731 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2733 struct Declaration * decl;
2734 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2735 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2736 char structName[1024];
2738 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2739 classSym->declaring++;
2740 if(strchr(classSym->string, '<'))
2742 if(classSym->registered->templateClass)
2744 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2745 classSym->declaring--;
2747 return (((void *)0));
2749 DeclareMembers(classSym->registered, 0x0);
2750 structName[0] = (char)0;
2751 FullClassNameCat(structName, name, 0x0);
2754 classSym->declaredStructSym = 0x1;
2755 declarations = MkList();
2756 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2757 if(!(*declarations).count)
2759 FreeList(declarations, (((void *)0)));
2760 declarations = (((void *)0));
2763 if(skipNoHead || declarations)
2765 if(external && external->declaration)
2767 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2768 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2770 if(classSym->structExternal)
2771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2772 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2773 classSym->id = curExternal->symbol->idCode;
2774 classSym->idCode = curExternal->symbol->idCode;
2780 external = MkExternalDeclaration((((void *)0)));
2781 specifiers = MkList();
2782 declarators = MkList();
2783 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2784 external->declaration = decl = MkDeclaration(specifiers, declarators);
2785 if(decl->symbol && !decl->symbol->pointerExternal)
2786 decl->symbol->pointerExternal = external;
2787 if(classSym->registered && classSym->registered->type == 1)
2789 char className[1024];
2791 strcpy(className, "__ecereClass_");
2792 FullClassNameCat(className, classSym->string, 0x1);
2793 MangleClassName(className);
2794 DeclareClass(classSym, className);
2795 external->symbol = classSym;
2796 classSym->pointerExternal = external;
2797 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2798 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2802 char className[1024];
2804 strcpy(className, "__ecereClass_");
2805 FullClassNameCat(className, classSym->string, 0x1);
2806 MangleClassName(className);
2807 classSym->structExternal = external;
2808 DeclareClass(classSym, className);
2809 external->symbol = classSym;
2811 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2814 classSym->declaring--;
2816 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2818 classSym->declaring++;
2820 if(classSym->registered)
2821 DeclareMembers(classSym->registered, 0x0);
2823 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2825 if(classSym->structExternal)
2826 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2827 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2828 classSym->id = curExternal->symbol->idCode;
2829 classSym->idCode = curExternal->symbol->idCode;
2831 classSym->declaring--;
2835 extern char * strcat(char * , const char * );
2837 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2839 extern struct ModuleImport * mainModule;
2841 extern struct Specifier * MkSpecifierName(char * name);
2843 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2845 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2847 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2849 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2851 extern void FreeDeclarator(struct Declarator * decl);
2853 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2855 struct PropertyImport
2857 struct PropertyImport * prev;
2858 struct PropertyImport * next;
2860 unsigned int isVirtual;
2861 unsigned int hasSet;
2862 unsigned int hasGet;
2865 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2867 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2869 void * __ecereTemp1;
2870 struct Symbol * symbol = prop->symbol;
2871 char propName[1024];
2873 strcpy(setName, "__ecereProp_");
2874 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2875 strcat(setName, "_Set_");
2876 FullClassNameCat(setName, prop->name, 0x1);
2877 strcpy(getName, "__ecereProp_");
2878 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2879 strcat(getName, "_Get_");
2880 FullClassNameCat(getName, prop->name, 0x1);
2881 strcpy(propName, "__ecereProp_");
2882 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2883 strcat(propName, "_");
2884 FullClassNameCat(propName, prop->name, 0x1);
2885 MangleClassName(getName);
2886 MangleClassName(setName);
2887 MangleClassName(propName);
2888 if(prop->_class->type == 1)
2889 DeclareStruct(prop->_class->fullName, 0x0);
2890 if(!symbol || curExternal->symbol->idCode < symbol->id)
2892 unsigned int imported = 0x0;
2893 unsigned int dllImport = 0x0;
2895 if(!symbol || symbol->_import)
2899 struct Symbol * classSym;
2901 if(!prop->_class->symbol)
2902 prop->_class->symbol = FindClass(prop->_class->fullName);
2903 classSym = prop->_class->symbol;
2904 if(classSym && !classSym->_import)
2906 struct ModuleImport * module;
2908 if(prop->_class->module)
2909 module = FindModule(prop->_class->module);
2911 module = mainModule;
2912 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));
2913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2915 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2916 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));
2918 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2921 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2926 struct Context * context = SetupTemplatesContext(prop->_class);
2928 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2929 FinishTemplatesContext(context);
2933 if(!symbol->externalGet || symbol->externalGet->type == 0)
2935 struct Declaration * decl;
2936 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2937 struct Declarator * d;
2938 struct __ecereNameSpace__ecere__sys__OldList * params;
2939 struct Specifier * spec;
2940 struct External * external;
2941 struct Declarator * typeDecl;
2942 unsigned int simple = 0x0;
2944 specifiers = MkList();
2945 declarators = MkList();
2947 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2948 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2950 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2952 struct Context * context = SetupTemplatesContext(prop->_class);
2954 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2955 FinishTemplatesContext(context);
2957 for(spec = (*specifiers).first; spec; spec = spec->next)
2961 if((!typeDecl || typeDecl->type == 1))
2963 struct Symbol * classSym = spec->symbol;
2965 symbol->_class = classSym->registered;
2966 if(classSym->registered && classSym->registered->type == 1)
2968 DeclareStruct(spec->name, 0x0);
2975 d = PlugDeclarator(typeDecl, d);
2978 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2979 specifiers = MkList();
2981 d = MkDeclaratorFunction(d, params);
2983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
2984 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2987 ListAdd(specifiers, MkSpecifier(VOID));
2988 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2989 decl = MkDeclaration(specifiers, declarators);
2990 external = MkExternalDeclaration(decl);
2991 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2992 external->symbol = symbol;
2993 symbol->externalGet = external;
2994 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2996 FreeDeclarator(typeDecl);
3000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3005 if(!symbol->externalSet || symbol->externalSet->type == 0)
3007 struct Declaration * decl;
3008 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3009 struct Declarator * d;
3010 struct __ecereNameSpace__ecere__sys__OldList * params;
3011 struct Specifier * spec;
3012 struct External * external;
3013 struct Declarator * typeDecl;
3015 declarators = MkList();
3017 if(!prop->conversion || prop->_class->type == 1)
3019 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3021 specifiers = MkList();
3023 struct Context * context = SetupTemplatesContext(prop->_class);
3025 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3026 FinishTemplatesContext(context);
3028 ListAdd(params, MkTypeName(specifiers, d));
3029 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3031 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3032 d = MkDeclaratorFunction(d, params);
3033 for(spec = (*specifiers).first; spec; spec = spec->next)
3037 if((!typeDecl || typeDecl->type == 1))
3039 struct Symbol * classSym = spec->symbol;
3041 symbol->_class = classSym->registered;
3042 if(classSym->registered && classSym->registered->type == 1)
3043 DeclareStruct(spec->name, 0x0);
3047 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3048 specifiers = MkList();
3050 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3051 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3052 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3053 if(!prop->conversion || prop->_class->type == 1)
3054 ListAdd(specifiers, MkSpecifier(VOID));
3056 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3057 decl = MkDeclaration(specifiers, declarators);
3058 external = MkExternalDeclaration(decl);
3059 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3060 external->symbol = symbol;
3061 symbol->externalSet = external;
3062 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3066 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3069 if(!symbol->externalPtr)
3071 struct Declaration * decl;
3072 struct External * external;
3073 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3076 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3078 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3079 ListAdd(specifiers, MkSpecifierName("Property"));
3081 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3083 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3086 strcpy(propName, "__ecerePropM_");
3087 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3088 strcat(propName, "_");
3089 FullClassNameCat(propName, prop->name, 0x1);
3090 MangleClassName(propName);
3091 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3093 decl = MkDeclaration(specifiers, list);
3095 external = MkExternalDeclaration(decl);
3096 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3097 external->symbol = symbol;
3098 symbol->externalPtr = external;
3102 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3104 symbol->id = curExternal->symbol->idCode;
3108 struct Type * Dereference(struct Type * source)
3110 void * __ecereTemp1;
3111 struct Type * type = (((void *)0));
3115 if(source->kind == 13 || source->kind == 12)
3117 type = source->type;
3118 source->type->refCount++;
3120 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3122 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3124 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3130 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3135 static struct Type * Reference(struct Type * source)
3137 void * __ecereTemp1;
3138 struct Type * type = (((void *)0));
3142 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));
3148 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);
3150 extern void * memcpy(void * , const void * , unsigned int size);
3152 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3154 extern void FreeExpression(struct Expression * exp);
3156 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3158 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);
3160 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3162 extern struct Type * MkClassType(char * name);
3164 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);
3166 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)
3168 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3169 unsigned int found = 0x0;
3170 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3171 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3172 unsigned int freeType = 0x0;
3174 yylloc = member->loc;
3179 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3183 dataMember = *curMember;
3189 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3190 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3191 int _subMemberStackPos = 0;
3194 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3197 dataMember = thisMember;
3198 if(curMember && thisMember->memberAccess == 1)
3200 *curMember = thisMember;
3201 *curClass = thisMember->_class;
3202 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3203 *subMemberStackPos = _subMemberStackPos;
3209 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3210 if(method && method->type == 1)
3213 method = (((void *)0));
3218 struct Type * type = (((void *)0));
3222 if(!dataMember->dataType && dataMember->dataTypeString)
3224 struct Context * context = SetupTemplatesContext(_class);
3226 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3227 FinishTemplatesContext(context);
3229 type = dataMember->dataType;
3233 if(!method->dataType)
3234 ProcessMethodType(method);
3235 type = method->dataType;
3237 if(ident && ident->next)
3239 for(ident = ident->next; ident && type; ident = ident->next)
3243 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3245 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3247 type = dataMember->dataType;
3249 else if(type->kind == 9 || type->kind == 10)
3251 struct Type * memberType;
3253 for(memberType = type->members.first; memberType; memberType = memberType->next)
3255 if(!strcmp(memberType->name, ident->string))
3264 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3267 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3268 struct __ecereNameSpace__ecere__com__Class * sClass;
3270 for(sClass = _class; sClass; sClass = sClass->base)
3273 if(sClass->templateClass)
3274 sClass = sClass->templateClass;
3275 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3277 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3279 for(sClass = sClass->base; sClass; sClass = sClass->base)
3281 if(sClass->templateClass)
3282 sClass = sClass->templateClass;
3283 id += sClass->templateParams.count;
3294 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3296 if(arg.dataTypeString)
3298 type = ProcessTypeString(arg.dataTypeString, 0x0);
3300 if(type && _class->templateClass)
3301 type->passAsTemplate = 0x1;
3308 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3310 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3311 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3315 char templateString[1024];
3316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3318 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3319 for(cClass = expClass; cClass; cClass = cClass->base)
3323 if(cClass->templateClass)
3324 cClass = cClass->templateClass;
3325 for(param = cClass->templateParams.first; param; param = param->next)
3328 struct __ecereNameSpace__ecere__com__Class * sClass;
3329 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3331 for(sClass = cClass->base; sClass; sClass = sClass->base)
3333 if(sClass->templateClass)
3334 sClass = sClass->templateClass;
3335 id += sClass->templateParams.count;
3337 arg = expClass->templateArgs[id];
3338 for(sClass = _class; sClass; sClass = sClass->base)
3340 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3342 struct __ecereNameSpace__ecere__com__Class * nextClass;
3344 if(sClass->templateClass)
3345 sClass = sClass->templateClass;
3346 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3348 if(nextClass->templateClass)
3349 nextClass = nextClass->templateClass;
3350 p += nextClass->templateParams.count;
3352 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3354 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3356 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3358 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3359 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3373 char expString[1024];
3374 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3375 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3376 struct Expression * exp;
3377 char * string = PrintHexUInt64(arg.expression.ui64);
3379 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3380 ProcessExpressionType(exp);
3381 ComputeExpression(exp);
3382 expString[0] = '\0';
3383 PrintExpression(exp, expString);
3384 strcat(argument, expString);
3385 FreeExpression(exp);
3390 strcat(argument, arg.member->name);
3395 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3396 strcat(argument, arg.dataTypeString);
3403 strcat(templateString, ", ");
3404 if(lastParam != p - 1)
3406 strcat(templateString, param->name);
3407 strcat(templateString, " = ");
3409 strcat(templateString, argument);
3418 int len = strlen(templateString);
3420 if(templateString[len - 1] == '<')
3424 if(templateString[len - 1] == '>')
3425 templateString[len++] = ' ';
3426 templateString[len++] = '>';
3428 templateString[len++] = '\0';
3431 struct Context * context = SetupTemplatesContext(_class);
3435 type = ProcessTypeString(templateString, 0x0);
3437 FinishTemplatesContext(context);
3440 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3442 ProcessExpressionType(member->initializer->exp);
3443 if(!member->initializer->exp->expType)
3447 char expString[10240];
3449 expString[0] = '\0';
3450 PrintExpression(member->initializer->exp, expString);
3451 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3452 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3455 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3457 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3460 else if(member->initializer)
3462 ProcessInitializer(member->initializer, type);
3469 if(_class && _class->type == 3)
3471 if(member->initializer)
3473 struct Type * type = MkClassType(_class->fullName);
3475 ProcessInitializer(member->initializer, type);
3481 if(member->initializer)
3483 ProcessInitializer(member->initializer, (((void *)0)));
3489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3493 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3495 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3504 extern struct Identifier * GetDeclId(struct Declarator * decl);
3506 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);
3508 extern void FreeSpecifier(struct Specifier * spec);
3510 static void ProcessFunction(struct FunctionDefinition * function);
3512 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3514 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3516 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3518 extern void FreeClassFunction(struct ClassFunction * func);
3520 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3522 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3524 void ProcessInstantiationType(struct Instantiation * inst)
3529 struct MembersInit * members;
3530 struct Symbol * classSym;
3531 struct __ecereNameSpace__ecere__com__Class * _class;
3533 classSym = inst->_class->symbol;
3534 _class = classSym ? classSym->registered : (((void *)0));
3535 if(!_class || _class->type != 5)
3536 DeclareStruct(inst->_class->name, 0x0);
3537 afterExternal = afterExternal ? afterExternal : curExternal;
3539 ProcessExpressionType(inst->exp);
3540 inst->isConstant = 0x1;
3543 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3544 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3545 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3546 int subMemberStackPos = 0;
3548 for(members = (*inst->members).first; members; members = members->next)
3550 switch(members->type)
3555 static unsigned int instMethodID = 0;
3556 struct External * external = curExternal;
3557 struct Context * context = curContext;
3558 struct Declarator * declarator = members->function->declarator;
3559 struct Identifier * nameID = GetDeclId(declarator);
3560 char * unmangled = nameID ? nameID->string : (((void *)0));
3561 struct Expression * exp;
3562 struct External * createdExternal = (((void *)0));
3568 strcpy(name, "__ecereInstMeth_");
3569 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3571 strcat(name, nameID->string);
3573 sprintf(number, "_%08d", instMethodID++);
3574 strcat(name, number);
3575 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3579 struct Symbol * symbol = declarator->symbol;
3580 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3582 if(method && method->type == 1)
3584 symbol->method = method;
3585 ProcessMethodType(method);
3586 if(!symbol->type->thisClass)
3588 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3590 if(!currentClass->symbol)
3591 currentClass->symbol = FindClass(currentClass->fullName);
3592 symbol->type->thisClass = currentClass->symbol;
3597 _class->symbol = FindClass(_class->fullName);
3598 symbol->type->thisClass = _class->symbol;
3601 DeclareType(symbol->type, 0x1, 0x1);
3605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3608 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3611 FreeSpecifier(nameID->_class);
3612 nameID->_class = (((void *)0));
3616 struct Type * type = declarator->symbol->type;
3617 struct External * oldExternal = curExternal;
3619 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3621 struct External * externalDecl;
3623 externalDecl = MkExternalDeclaration((((void *)0)));
3624 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3625 if(createdExternal->function)
3627 ProcessFunction(createdExternal->function);
3629 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3631 externalDecl->declaration = decl;
3632 if(decl->symbol && !decl->symbol->pointerExternal)
3633 decl->symbol->pointerExternal = externalDecl;
3634 declarator->symbol->pointerExternal = externalDecl;
3641 curExternal = declarator->symbol->pointerExternal;
3642 ProcessFunction((struct FunctionDefinition *)members->function);
3644 curExternal = external;
3645 curContext = context;
3648 FreeClassFunction(members->function);
3649 exp = QMkExpId(name);
3651 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3652 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3658 if(members->dataMembers && classSym)
3660 struct MemberInit * member;
3661 struct Location oldyyloc = yylloc;
3663 for(member = (*members->dataMembers).first; member; member = member->next)
3665 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3666 if(member->initializer && !member->initializer->isConstant)
3667 inst->isConstant = 0x0;
3679 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3683 if(type->kind == 11)
3685 struct Type * param;
3689 for(param = type->params.first; param; param = param->next)
3690 DeclareType(param, declarePointers, 0x1);
3692 DeclareType(type->returnType, declarePointers, 0x1);
3694 else if(type->kind == 13 && declarePointers)
3695 DeclareType(type->type, declarePointers, 0x0);
3696 else if(type->kind == 8)
3698 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3699 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3701 else if(type->kind == 9 || type->kind == 10)
3703 struct Type * member;
3705 for(member = type->members.first; member; member = member->next)
3706 DeclareType(member, 0x0, 0x0);
3708 else if(type->kind == 12)
3709 DeclareType(type->arrayType, declarePointers, 0x0);
3713 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3715 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3717 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3719 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3720 struct __ecereNameSpace__ecere__com__Class * sClass;
3722 for(sClass = _class; sClass; sClass = sClass->base)
3725 if(sClass->templateClass)
3726 sClass = sClass->templateClass;
3727 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3729 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3731 for(sClass = sClass->base; sClass; sClass = sClass->base)
3733 if(sClass->templateClass)
3734 sClass = sClass->templateClass;
3735 id += sClass->templateParams.count;
3746 arg = &_class->templateArgs[id];
3747 if(arg && param->type == 0)
3748 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3753 extern struct Context * PushContext(void);
3755 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3757 struct TemplatedType
3760 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3761 struct __ecereNameSpace__ecere__sys__BTNode * left;
3762 struct __ecereNameSpace__ecere__sys__BTNode * right;
3764 struct TemplateParameter * param;
3767 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3769 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3771 void * __ecereTemp1;
3772 struct Context * context = PushContext();
3774 context->templateTypesOnly = 0x1;
3775 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3777 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3779 for(; param; param = param->next)
3781 if(param->type == 0 && param->identifier)
3783 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3785 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3791 struct __ecereNameSpace__ecere__com__Class * sClass;
3793 for(sClass = _class; sClass; sClass = sClass->base)
3795 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3797 for(p = sClass->templateParams.first; p; p = p->next)
3801 struct TemplateParameter * param = p->param;
3802 struct TemplatedType * type;
3806 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));
3808 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (unsigned int)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3809 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3817 extern void PopContext(struct Context * ctx);
3819 extern void FreeContext(struct Context * context);
3821 void FinishTemplatesContext(struct Context * context)
3823 PopContext(context);
3824 FreeContext(context);
3825 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3828 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3830 if(!method->dataType)
3832 struct Context * context = SetupTemplatesContext(method->_class);
3834 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3835 FinishTemplatesContext(context);
3836 if(method->type != 1 && method->dataType)
3838 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3840 if(!method->_class->symbol)
3841 method->_class->symbol = FindClass(method->_class->fullName);
3842 method->dataType->thisClass = method->_class->symbol;
3848 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3852 struct Context * context = SetupTemplatesContext(prop->_class);
3854 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3855 FinishTemplatesContext(context);
3859 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3861 extern void FreeTypeName(struct TypeName * typeName);
3863 static void ProcessDeclarator(struct Declarator * decl);
3865 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3867 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3871 struct MethodImport * prev;
3872 struct MethodImport * next;
3874 unsigned int isVirtual;
3877 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3879 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3881 void * __ecereTemp1;
3882 struct Symbol * symbol = method->symbol;
3884 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3886 unsigned int imported = 0x0;
3887 unsigned int dllImport = 0x0;
3889 if(!method->dataType)
3890 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3891 if(!symbol || symbol->_import || method->type == 1)
3893 if(!symbol || method->type == 1)
3895 struct Symbol * classSym;
3897 if(!method->_class->symbol)
3898 method->_class->symbol = FindClass(method->_class->fullName);
3899 classSym = method->_class->symbol;
3900 if(!classSym->_import)
3902 struct ModuleImport * module;
3904 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3905 module = FindModule(method->_class->module);
3907 module = mainModule;
3908 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));
3909 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3913 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3915 if(!symbol->_import)
3917 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));
3918 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3922 symbol->type = method->dataType;
3924 symbol->type->refCount++;
3927 if(!method->dataType->dllExport)
3930 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3934 if(method->type != 1 && method->dataType)
3935 DeclareType(method->dataType, 0x1, 0x1);
3936 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3938 struct Declaration * decl;
3939 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3940 struct Declarator * d;
3941 struct Declarator * funcDecl;
3942 struct External * external;
3944 specifiers = MkList();
3945 declarators = MkList();
3947 ListAdd(specifiers, MkSpecifier(EXTERN));
3948 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3949 ListAdd(specifiers, MkSpecifier(STATIC));
3950 if(method->type == 1)
3952 ListAdd(specifiers, MkSpecifier(INT));
3953 d = MkDeclaratorIdentifier(MkIdentifier(name));
3957 d = MkDeclaratorIdentifier(MkIdentifier(name));
3959 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3961 struct Context * context = SetupTemplatesContext(method->_class);
3963 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3964 FinishTemplatesContext(context);
3966 funcDecl = GetFuncDecl(d);
3969 struct Specifier * spec, * next;
3971 for(spec = (*specifiers).first; spec; spec = next)
3976 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3977 FreeSpecifier(spec);
3981 if(method->dataType && !method->dataType->staticMethod)
3983 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3985 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3986 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")));
3987 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3988 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3990 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
3992 struct TypeName * param = (*funcDecl->function.parameters).first;
3994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3995 FreeTypeName(param);
3997 if(!funcDecl->function.parameters)
3998 funcDecl->function.parameters = MkList();
3999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4003 ProcessDeclarator(d);
4004 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4005 decl = MkDeclaration(specifiers, declarators);
4006 ReplaceThisClassSpecifiers(specifiers, method->_class);
4007 if(symbol->pointerExternal)
4009 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4012 *functionSymbol = *symbol;
4013 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4014 if(functionSymbol->type)
4015 functionSymbol->type->refCount++;
4017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4018 symbol->pointerExternal->symbol = functionSymbol;
4020 external = MkExternalDeclaration(decl);
4022 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4023 external->symbol = symbol;
4024 symbol->pointerExternal = external;
4028 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4030 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4034 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4036 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4038 unsigned int first = 0x1;
4040 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4042 char className[1024];
4044 strcpy(className, _class->fullName);
4045 for(param = _class->templateParams.first; param; param = param->next)
4049 strcat(className, "<");
4051 strcat(className, ", ");
4052 if(lastParam + 1 != p)
4054 strcat(className, param->name);
4055 strcat(className, " = ");
4057 strcat(className, param->name);
4065 int len = strlen(className);
4067 if(className[len - 1] == '>')
4068 className[len++] = ' ';
4069 className[len++] = '>';
4070 className[len++] = '\0';
4072 return __ecereNameSpace__ecere__sys__CopyString(className);
4075 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4078 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4080 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4082 unsigned int first = 0x1;
4084 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4086 char className[1024];
4088 strcpy(className, _class->fullName);
4089 for(param = _class->templateParams.first; param; param = param->next)
4093 strcat(className, "<");
4095 strcat(className, ", ");
4096 if(lastParam + 1 != p)
4098 strcat(className, param->name);
4099 strcat(className, " = ");
4101 strcat(className, param->name);
4109 int len = strlen(className);
4111 if(className[len - 1] == '>')
4112 className[len++] = ' ';
4113 className[len++] = '>';
4114 className[len++] = '\0';
4116 return MkClassType(className);
4120 return MkClassType(_class->fullName);
4124 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4126 if(specs != (((void *)0)) && _class)
4128 struct Specifier * spec;
4130 for(spec = specs->first; spec; spec = spec->next)
4132 if(spec->type == 0 && spec->specifier == THISCLASS)
4135 spec->name = ReplaceThisClass(_class);
4136 spec->symbol = FindClass(spec->name);
4142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4144 struct __ecereNameSpace__ecere__com__GlobalFunction
4146 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4147 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4150 struct __ecereNameSpace__ecere__com__Instance * module;
4151 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4152 char * dataTypeString;
4153 struct Type * dataType;
4157 extern struct Context * globalContext;
4159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4161 struct FunctionImport
4163 struct FunctionImport * prev;
4164 struct FunctionImport * next;
4168 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4170 void * __ecereTemp1;
4171 struct Symbol * symbol = function->symbol;
4173 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4175 unsigned int imported = 0x0;
4176 unsigned int dllImport = 0x0;
4178 if(!function->dataType)
4180 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4181 if(!function->dataType->thisClass)
4182 function->dataType->staticMethod = 0x1;
4188 struct ModuleImport * module = FindModule(function->module);
4190 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4193 if(!function->dataType->dllExport)
4195 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));
4196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4200 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4201 if(!symbol->type->thisClass)
4202 symbol->type->staticMethod = 0x1;
4205 imported = symbol->_import ? 0x1 : 0x0;
4206 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4209 DeclareType(function->dataType, 0x1, 0x1);
4212 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4214 struct Declaration * decl;
4215 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4216 struct Declarator * d;
4217 struct Declarator * funcDecl;
4218 struct External * external;
4220 specifiers = MkList();
4221 declarators = MkList();
4222 ListAdd(specifiers, MkSpecifier(EXTERN));
4223 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4225 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4226 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4227 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4229 struct Specifier * spec;
4231 for(spec = (*specifiers).first; spec; spec = spec->next)
4232 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4235 FreeSpecifier(spec);
4239 funcDecl = GetFuncDecl(d);
4240 if(funcDecl && !funcDecl->function.parameters)
4242 funcDecl->function.parameters = MkList();
4243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4245 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4247 struct Context * oldCtx = curContext;
4249 curContext = globalContext;
4250 decl = MkDeclaration(specifiers, declarators);
4251 curContext = oldCtx;
4253 if(symbol->pointerExternal)
4255 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4258 *functionSymbol = *symbol;
4259 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4260 if(functionSymbol->type)
4261 functionSymbol->type->refCount++;
4263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4264 symbol->pointerExternal->symbol = functionSymbol;
4266 external = MkExternalDeclaration(decl);
4268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4269 external->symbol = symbol;
4270 symbol->pointerExternal = external;
4274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4277 symbol->id = curExternal->symbol->idCode;
4280 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4283 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4288 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4289 struct __ecereNameSpace__ecere__sys__BTNode * left;
4290 struct __ecereNameSpace__ecere__sys__BTNode * right;
4292 struct __ecereNameSpace__ecere__com__Instance * module;
4293 char * dataTypeString;
4294 struct Type * dataType;
4299 void DeclareGlobalData(struct GlobalData * data)
4301 struct Symbol * symbol = data->symbol;
4303 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4308 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4311 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4312 DeclareType(data->dataType, 0x1, 0x1);
4315 if(!symbol->pointerExternal)
4317 struct Declaration * decl;
4318 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4319 struct Declarator * d;
4320 struct External * external;
4322 specifiers = MkList();
4323 declarators = MkList();
4324 ListAdd(specifiers, MkSpecifier(EXTERN));
4325 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4326 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4327 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4328 decl = MkDeclaration(specifiers, declarators);
4329 external = MkExternalDeclaration(decl);
4331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4332 external->symbol = symbol;
4333 symbol->pointerExternal = external;
4337 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4340 symbol->id = curExternal->symbol->idCode;
4347 struct Conversion * prev, * next;
4348 struct __ecereNameSpace__ecere__com__Property * convert;
4350 struct Type * resultType;
4353 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4355 extern void Compiler_Warning(char * format, ...);
4357 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4359 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)
4363 if(source->kind == 20 && dest->kind != 20)
4365 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4370 if(dest->kind == 20 && source->kind != 20)
4372 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4377 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4381 if(source->classObjectType == 3 && dest->classObjectType != 2)
4385 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4387 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4390 if(dest->kind == 14 && source->kind != 0)
4392 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))
4394 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))
4396 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4398 if(source->_class->registered && source->_class->registered->type == 3)
4400 if(conversions != (((void *)0)))
4402 if(source->_class->registered == dest->_class->registered)
4407 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4409 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4411 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4413 if(sourceBase == destBase)
4417 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))
4421 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4423 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4430 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4434 if(source->kind == 8)
4436 struct __ecereNameSpace__ecere__com__Class * _class;
4438 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4440 struct __ecereNameSpace__ecere__com__Property * convert;
4442 for(convert = _class->conversions.first; convert; convert = convert->next)
4444 if(convert->memberAccess == 1 || _class->module == privateModule)
4446 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4448 if(!convert->dataType)
4449 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4450 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4452 if(!conversions && !convert->Get)
4454 else if(conversions != (((void *)0)))
4456 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))
4460 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4473 struct __ecereNameSpace__ecere__com__Class * _class;
4475 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4477 struct __ecereNameSpace__ecere__com__Property * convert;
4479 for(convert = _class->conversions.first; convert; convert = convert->next)
4481 if(convert->memberAccess == 1 || _class->module == privateModule)
4483 if(!convert->dataType)
4484 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4485 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4487 if(!conversions && !convert->Set)
4489 else if(conversions != (((void *)0)))
4491 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))
4495 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4497 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4505 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4507 if(!dest->_class->registered->dataType)
4508 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4509 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4511 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4518 if(source->kind == 8)
4520 struct __ecereNameSpace__ecere__com__Class * _class;
4522 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4524 struct __ecereNameSpace__ecere__com__Property * convert;
4526 for(convert = _class->conversions.first; convert; convert = convert->next)
4528 if(convert->memberAccess == 1 || _class->module == privateModule)
4530 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4532 if(!convert->dataType)
4533 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4534 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4536 if(!conversions && !convert->Get)
4538 else if(conversions != (((void *)0)))
4540 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))
4544 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4546 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4554 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4556 if(!source->_class->registered->dataType)
4557 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4558 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4565 if(source->kind == 8 || source->kind == 19)
4567 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4569 else if(dest->kind == 7 && source->kind == 6)
4571 else if(dest->kind == 2 && source->kind == 1)
4573 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4575 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4577 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4579 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4581 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)))
4583 struct Type * paramSource, * paramDest;
4585 if(dest->kind == 16)
4586 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4587 if(source->kind == 16)
4588 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4589 if(dest->kind == 13 && dest->type->kind == 11)
4591 if(source->kind == 13 && source->type->kind == 11)
4592 source = source->type;
4593 if(dest->kind == 16)
4594 dest = dest->method->dataType;
4595 if(source->kind == 16)
4596 source = source->method->dataType;
4597 paramSource = source->params.first;
4598 if(paramSource && paramSource->kind == 0)
4599 paramSource = (((void *)0));
4600 paramDest = dest->params.first;
4601 if(paramDest && paramDest->kind == 0)
4602 paramDest = (((void *)0));
4603 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4605 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))))
4607 if(paramDest && paramDest->kind == 8)
4608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4613 paramDest = paramDest->next;
4615 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4617 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4621 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4623 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4629 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4632 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4638 paramSource = paramSource->next;
4644 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4646 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4652 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4654 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4660 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4662 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4665 for(; paramDest; paramDest = paramDest->next)
4669 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4673 struct Type * paramDestType = paramDest;
4674 struct Type * paramSourceType = paramSource;
4675 struct Type * type = paramDestType;
4677 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4680 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4681 struct __ecereNameSpace__ecere__com__Class * sClass;
4683 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4686 if(sClass->templateClass)
4687 sClass = sClass->templateClass;
4688 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4690 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4692 for(sClass = sClass->base; sClass; sClass = sClass->base)
4694 if(sClass->templateClass)
4695 sClass = sClass->templateClass;
4696 id += sClass->templateParams.count;
4707 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4709 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4712 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)))
4717 PrintType(paramDest, type, 0x0, 0x1);
4718 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4719 if(paramDestType != paramDest)
4720 FreeType(paramDestType);
4723 if(paramDestType != paramDest)
4724 FreeType(paramDestType);
4726 paramSource = paramSource->next;
4730 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4735 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4739 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4741 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4748 static void FreeConvert(struct Conversion * convert)
4750 if(convert->resultType)
4751 FreeType(convert->resultType);
4754 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4756 struct __ecereNameSpace__ecere__com__BTNamedLink
4759 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4760 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4761 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4766 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4768 struct __ecereNameSpace__ecere__com__EnumClassData
4770 struct __ecereNameSpace__ecere__sys__OldList values;
4774 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4776 struct __ecereNameSpace__ecere__sys__NamedLink
4778 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4779 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4784 extern void FreeExpContents(struct Expression * exp);
4786 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4788 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4790 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4792 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4794 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4796 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4798 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4800 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)))
4802 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4804 if(_class->type == 4)
4806 struct __ecereNameSpace__ecere__sys__OldList converts =
4810 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4814 _class->symbol = FindClass(_class->fullName);
4815 type->_class = _class->symbol;
4816 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4818 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4819 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4823 struct __ecereNameSpace__ecere__com__Class * baseClass;
4825 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4827 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4829 for(value = e->values.first; value; value = value->next)
4831 if(!strcmp(value->name, string))
4836 FreeExpContents(sourceExp);
4837 FreeType(sourceExp->expType);
4838 sourceExp->isConstant = 0x1;
4839 sourceExp->expType = MkClassType(baseClass->fullName);
4843 sourceExp->type = 2;
4844 if(!strcmp(baseClass->dataTypeString, "int"))
4845 sprintf(constant, "%d", value->data);
4847 sprintf(constant, "0x%X", value->data);
4848 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4850 while(converts.first)
4852 struct Conversion * convert = converts.first;
4854 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4857 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4864 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4865 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4868 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)))
4869 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4874 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4876 struct __ecereNameSpace__ecere__com__SubModule
4878 struct __ecereNameSpace__ecere__com__SubModule * prev;
4879 struct __ecereNameSpace__ecere__com__SubModule * next;
4880 struct __ecereNameSpace__ecere__com__Instance * module;
4884 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4886 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4888 if(searchFor == searchIn)
4890 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4892 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4894 if(ModuleVisibility(subModule->module, searchFor))
4901 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4903 struct __ecereNameSpace__ecere__com__Application
4908 unsigned int isGUIApp;
4909 struct __ecereNameSpace__ecere__sys__OldList allModules;
4910 char * parsedCommand;
4911 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4914 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4916 struct __ecereNameSpace__ecere__com__Instance * module;
4918 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
4920 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4922 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4924 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)
4926 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4932 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
4934 void ReadString(char * output, char * string);
4936 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4938 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
4940 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4942 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4944 void * __ecereTemp1;
4945 struct Type * source = sourceExp->expType;
4946 struct Type * realDest = dest;
4948 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4950 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4952 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4954 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4956 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4958 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4960 if(sourceBase == destBase)
4966 struct __ecereNameSpace__ecere__sys__OldList * specs;
4967 unsigned int flag = 0x0;
4968 long long value = (((int)0x7fffffff));
4972 if(sourceExp->type == 2)
4974 if(source->isSigned)
4975 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4977 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4979 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4981 if(source->isSigned)
4982 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4984 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4986 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4989 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));
4993 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4995 if(_class && _class->type == 3)
4997 if(source->kind != 8)
4999 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5000 struct Type * tempDest, * tempSource;
5002 for(; _class->base->type != 1000; _class = _class->base)
5005 tempDest = tempType;
5008 _class->symbol = FindClass(_class->fullName);
5009 tempType->_class = _class->symbol;
5010 tempType->truth = dest->truth;
5011 if(tempType->_class)
5012 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5013 FreeType(sourceExp->expType);
5014 sourceExp->expType = dest;
5017 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5020 if(_class && _class->type == 2 && source->kind != 8)
5022 if(!dest->_class->registered->dataType)
5023 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5024 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5027 FreeType(sourceExp->expType);
5028 source = sourceExp->expType = MkClassType(dest->_class->string);
5032 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5034 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5035 struct Declarator * decl;
5038 ReadString(string, sourceExp->string);
5039 decl = SpecDeclFromString(string, specs, (((void *)0)));
5040 FreeExpContents(sourceExp);
5041 FreeType(sourceExp->expType);
5042 sourceExp->type = 26;
5043 sourceExp->_classExp.specifiers = specs;
5044 sourceExp->_classExp.decl = decl;
5045 sourceExp->expType = dest;
5052 else if(source->kind == 8)
5054 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5056 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5060 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5061 struct Type * tempDest, * tempSource;
5063 if(!source->_class->registered->dataType)
5064 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5065 for(; _class->base->type != 1000; _class = _class->base)
5068 tempSource = tempType;
5070 tempType->_class = FindClass(_class->fullName);
5071 tempType->truth = source->truth;
5072 tempType->classObjectType = source->classObjectType;
5073 if(tempType->_class)
5074 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5075 if(conversions->last)
5077 ((struct Conversion *)conversions->last)->resultType = dest;
5080 FreeType(sourceExp->expType);
5081 sourceExp->expType = MkClassType(_class->fullName);
5082 sourceExp->expType->truth = source->truth;
5083 sourceExp->expType->classObjectType = source->classObjectType;
5084 if(!sourceExp->destType)
5086 FreeType(sourceExp->destType);
5087 sourceExp->destType = sourceExp->expType;
5088 if(sourceExp->expType)
5089 sourceExp->expType->refCount++;
5091 if(!_class->dataType)
5092 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5094 dest = MkClassType(source->_class->string);
5095 dest->truth = source->truth;
5096 dest->classObjectType = source->classObjectType;
5098 source = _class->dataType;
5100 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5106 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5115 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5117 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5119 if(_class->type == 0 || _class->type == 5)
5121 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5123 *newExp = *sourceExp;
5124 if(sourceExp->destType)
5125 sourceExp->destType->refCount++;
5126 if(sourceExp->expType)
5127 sourceExp->expType->refCount++;
5128 sourceExp->type = 11;
5129 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5130 sourceExp->cast.exp = newExp;
5131 FreeType(sourceExp->expType);
5132 sourceExp->expType = (((void *)0));
5133 ProcessExpressionType(sourceExp);
5136 FreeType(sourceExp->expType);
5137 sourceExp->expType = dest;
5144 if(!_class->dataType)
5145 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5147 dest = _class->dataType;
5150 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5152 specs = MkListOne(MkSpecifier(DOUBLE));
5154 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5156 specs = MkListOne(MkSpecifier(FLOAT));
5158 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5162 ListAdd(specs, MkSpecifier(UNSIGNED));
5163 ListAdd(specs, MkSpecifier(INT64));
5165 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5169 ListAdd(specs, MkSpecifier(UNSIGNED));
5170 ListAdd(specs, MkSpecifier(INT));
5172 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5176 ListAdd(specs, MkSpecifier(UNSIGNED));
5177 ListAdd(specs, MkSpecifier(SHORT));
5179 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5183 ListAdd(specs, MkSpecifier(UNSIGNED));
5184 ListAdd(specs, MkSpecifier(CHAR));
5193 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))
5195 specs = MkListOne(MkSpecifier(DOUBLE));
5197 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5199 specs = MkListOne(MkSpecifier(FLOAT));
5201 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)))
5205 ListAdd(specs, MkSpecifier(UNSIGNED));
5206 ListAdd(specs, MkSpecifier(CHAR));
5208 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)))))
5212 ListAdd(specs, MkSpecifier(UNSIGNED));
5213 ListAdd(specs, MkSpecifier(SHORT));
5215 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5219 ListAdd(specs, MkSpecifier(UNSIGNED));
5220 ListAdd(specs, MkSpecifier(INT));
5222 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5226 ListAdd(specs, MkSpecifier(UNSIGNED));
5227 ListAdd(specs, MkSpecifier(INT64));
5229 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5231 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5241 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5243 *newExp = *sourceExp;
5244 newExp->prev = (((void *)0));
5245 newExp->next = (((void *)0));
5246 if(sourceExp->destType)
5247 sourceExp->destType->refCount++;
5248 if(sourceExp->expType)
5249 sourceExp->expType->refCount++;
5250 sourceExp->type = 11;
5251 if(realDest->kind == 8)
5253 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5254 FreeList(specs, FreeSpecifier);
5257 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5258 if(newExp->type == 4)
5260 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5263 sourceExp->cast.exp = newExp;
5264 FreeType(sourceExp->expType);
5265 sourceExp->expType = (((void *)0));
5266 ProcessExpressionType(sourceExp);
5269 FreeList(specs, FreeSpecifier);
5276 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5277 sourceExp = (*sourceExp->list).last;
5278 if(sourceExp->type == 0)
5280 struct Identifier * id = sourceExp->identifier;
5284 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5286 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5287 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5291 for(; _class && _class->type == 4; _class = _class->base)
5293 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5294 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5296 for(value = e->values.first; value; value = value->next)
5298 if(!strcmp(value->name, id->string))
5303 FreeExpContents(sourceExp);
5304 FreeType(sourceExp->expType);
5305 sourceExp->isConstant = 0x1;
5306 sourceExp->expType = MkClassType(_class->fullName);
5310 sourceExp->type = 2;
5311 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5312 sprintf(constant, "%d", value->data);
5314 sprintf(constant, "0x%X", value->data);
5315 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5323 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5330 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5332 int value2 = op2->i;
5335 exp->string = PrintInt(op1->i + value2);
5338 exp->expType = op1->type;
5340 op1->type->refCount++;
5345 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5347 unsigned int value2 = op2->ui;
5350 exp->string = PrintUInt(op1->ui + value2);
5353 exp->expType = op1->type;
5355 op1->type->refCount++;
5360 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5362 short value2 = op2->s;
5365 exp->string = PrintShort(op1->s + value2);
5368 exp->expType = op1->type;
5370 op1->type->refCount++;
5375 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5377 unsigned short value2 = op2->us;
5380 exp->string = PrintUShort(op1->us + value2);
5383 exp->expType = op1->type;
5385 op1->type->refCount++;
5390 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5392 char value2 = op2->c;
5395 exp->string = PrintChar(op1->c + value2);
5398 exp->expType = op1->type;
5400 op1->type->refCount++;
5405 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5407 unsigned char value2 = op2->uc;
5410 exp->string = PrintUChar(op1->uc + value2);
5413 exp->expType = op1->type;
5415 op1->type->refCount++;
5420 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5422 float value2 = op2->f;
5425 exp->string = PrintFloat(op1->f + value2);
5428 exp->expType = op1->type;
5430 op1->type->refCount++;
5435 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5437 double value2 = op2->d;
5440 exp->string = PrintDouble(op1->d + value2);
5443 exp->expType = op1->type;
5445 op1->type->refCount++;
5450 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5452 int value2 = op2->i;
5455 exp->string = PrintInt(op1->i - value2);
5458 exp->expType = op1->type;
5460 op1->type->refCount++;
5465 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5467 unsigned int value2 = op2->ui;
5470 exp->string = PrintUInt(op1->ui - value2);
5473 exp->expType = op1->type;
5475 op1->type->refCount++;
5480 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5482 short value2 = op2->s;
5485 exp->string = PrintShort(op1->s - value2);
5488 exp->expType = op1->type;
5490 op1->type->refCount++;
5495 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5497 unsigned short value2 = op2->us;
5500 exp->string = PrintUShort(op1->us - value2);
5503 exp->expType = op1->type;
5505 op1->type->refCount++;
5510 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5512 char value2 = op2->c;
5515 exp->string = PrintChar(op1->c - value2);
5518 exp->expType = op1->type;
5520 op1->type->refCount++;
5525 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5527 unsigned char value2 = op2->uc;
5530 exp->string = PrintUChar(op1->uc - value2);
5533 exp->expType = op1->type;
5535 op1->type->refCount++;
5540 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5542 float value2 = op2->f;
5545 exp->string = PrintFloat(op1->f - value2);
5548 exp->expType = op1->type;
5550 op1->type->refCount++;
5555 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5557 double value2 = op2->d;
5560 exp->string = PrintDouble(op1->d - value2);
5563 exp->expType = op1->type;
5565 op1->type->refCount++;
5570 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5572 int value2 = op2->i;
5575 exp->string = PrintInt(op1->i * value2);
5578 exp->expType = op1->type;
5580 op1->type->refCount++;
5585 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5587 unsigned int value2 = op2->ui;
5590 exp->string = PrintUInt(op1->ui * value2);
5593 exp->expType = op1->type;
5595 op1->type->refCount++;
5600 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5602 short value2 = op2->s;
5605 exp->string = PrintShort(op1->s * value2);
5608 exp->expType = op1->type;
5610 op1->type->refCount++;
5615 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5617 unsigned short value2 = op2->us;
5620 exp->string = PrintUShort(op1->us * value2);
5623 exp->expType = op1->type;
5625 op1->type->refCount++;
5630 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5632 char value2 = op2->c;
5635 exp->string = PrintChar(op1->c * value2);
5638 exp->expType = op1->type;
5640 op1->type->refCount++;
5645 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5647 unsigned char value2 = op2->uc;
5650 exp->string = PrintUChar(op1->uc * value2);
5653 exp->expType = op1->type;
5655 op1->type->refCount++;
5660 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5662 float value2 = op2->f;
5665 exp->string = PrintFloat(op1->f * value2);
5668 exp->expType = op1->type;
5670 op1->type->refCount++;
5675 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5677 double value2 = op2->d;
5680 exp->string = PrintDouble(op1->d * value2);
5683 exp->expType = op1->type;
5685 op1->type->refCount++;
5690 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5692 int value2 = op2->i;
5695 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5698 exp->expType = op1->type;
5700 op1->type->refCount++;
5705 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5707 unsigned int value2 = op2->ui;
5710 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5713 exp->expType = op1->type;
5715 op1->type->refCount++;
5720 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5722 short value2 = op2->s;
5725 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5728 exp->expType = op1->type;
5730 op1->type->refCount++;
5735 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5737 unsigned short value2 = op2->us;
5740 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5743 exp->expType = op1->type;
5745 op1->type->refCount++;
5750 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5752 char value2 = op2->c;
5755 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5758 exp->expType = op1->type;
5760 op1->type->refCount++;
5765 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5767 unsigned char value2 = op2->uc;
5770 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5773 exp->expType = op1->type;
5775 op1->type->refCount++;
5780 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5782 float value2 = op2->f;
5785 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5788 exp->expType = op1->type;
5790 op1->type->refCount++;
5795 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5797 double value2 = op2->d;
5800 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5803 exp->expType = op1->type;
5805 op1->type->refCount++;
5810 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5812 int value2 = op2->i;
5815 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5818 exp->expType = op1->type;
5820 op1->type->refCount++;
5825 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5827 unsigned int value2 = op2->ui;
5830 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5833 exp->expType = op1->type;
5835 op1->type->refCount++;
5840 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5842 short value2 = op2->s;
5845 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5848 exp->expType = op1->type;
5850 op1->type->refCount++;
5855 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5857 unsigned short value2 = op2->us;
5860 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5863 exp->expType = op1->type;
5865 op1->type->refCount++;
5870 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5872 char value2 = op2->c;
5875 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5878 exp->expType = op1->type;
5880 op1->type->refCount++;
5885 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5887 unsigned char value2 = op2->uc;
5890 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5893 exp->expType = op1->type;
5895 op1->type->refCount++;
5900 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5903 exp->string = PrintInt(-op1->i);
5906 exp->expType = op1->type;
5908 op1->type->refCount++;
5913 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5916 exp->string = PrintUInt(-op1->ui);
5919 exp->expType = op1->type;
5921 op1->type->refCount++;
5926 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5929 exp->string = PrintShort(-op1->s);
5932 exp->expType = op1->type;
5934 op1->type->refCount++;
5939 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5942 exp->string = PrintUShort(-op1->us);
5945 exp->expType = op1->type;
5947 op1->type->refCount++;
5952 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5955 exp->string = PrintChar(-op1->c);
5958 exp->expType = op1->type;
5960 op1->type->refCount++;
5965 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5968 exp->string = PrintUChar(-op1->uc);
5971 exp->expType = op1->type;
5973 op1->type->refCount++;
5978 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5981 exp->string = PrintFloat(-op1->f);
5984 exp->expType = op1->type;
5986 op1->type->refCount++;
5991 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5994 exp->string = PrintDouble(-op1->d);
5997 exp->expType = op1->type;
5999 op1->type->refCount++;
6004 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6007 exp->string = PrintInt(++op1->i);
6010 exp->expType = op1->type;
6012 op1->type->refCount++;
6017 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6020 exp->string = PrintUInt(++op1->ui);
6023 exp->expType = op1->type;
6025 op1->type->refCount++;
6030 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6033 exp->string = PrintShort(++op1->s);
6036 exp->expType = op1->type;
6038 op1->type->refCount++;
6043 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6046 exp->string = PrintUShort(++op1->us);
6049 exp->expType = op1->type;
6051 op1->type->refCount++;
6056 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6059 exp->string = PrintChar(++op1->c);
6062 exp->expType = op1->type;
6064 op1->type->refCount++;
6069 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6072 exp->string = PrintUChar(++op1->uc);
6075 exp->expType = op1->type;
6077 op1->type->refCount++;
6082 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6085 exp->string = PrintFloat(++op1->f);
6088 exp->expType = op1->type;
6090 op1->type->refCount++;
6095 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6098 exp->string = PrintDouble(++op1->d);
6101 exp->expType = op1->type;
6103 op1->type->refCount++;
6108 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6111 exp->string = PrintInt(--op1->i);
6114 exp->expType = op1->type;
6116 op1->type->refCount++;
6121 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6124 exp->string = PrintUInt(--op1->ui);
6127 exp->expType = op1->type;
6129 op1->type->refCount++;
6134 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6137 exp->string = PrintShort(--op1->s);
6140 exp->expType = op1->type;
6142 op1->type->refCount++;
6147 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6150 exp->string = PrintUShort(--op1->us);
6153 exp->expType = op1->type;
6155 op1->type->refCount++;
6160 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6163 exp->string = PrintChar(--op1->c);
6166 exp->expType = op1->type;
6168 op1->type->refCount++;
6173 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6176 exp->string = PrintUChar(--op1->uc);
6179 exp->expType = op1->type;
6181 op1->type->refCount++;
6186 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6189 exp->string = PrintFloat(--op1->f);
6192 exp->expType = op1->type;
6194 op1->type->refCount++;
6199 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6202 exp->string = PrintDouble(--op1->d);
6205 exp->expType = op1->type;
6207 op1->type->refCount++;
6212 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6214 int value2 = op2->i;
6217 exp->string = PrintInt(op1->i = value2);
6220 exp->expType = op1->type;
6222 op1->type->refCount++;
6227 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6229 unsigned int value2 = op2->ui;
6232 exp->string = PrintUInt(op1->ui = value2);
6235 exp->expType = op1->type;
6237 op1->type->refCount++;
6242 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6244 short value2 = op2->s;
6247 exp->string = PrintShort(op1->s = value2);
6250 exp->expType = op1->type;
6252 op1->type->refCount++;
6257 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6259 unsigned short value2 = op2->us;
6262 exp->string = PrintUShort(op1->us = value2);
6265 exp->expType = op1->type;
6267 op1->type->refCount++;
6272 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6274 char value2 = op2->c;
6277 exp->string = PrintChar(op1->c = value2);
6280 exp->expType = op1->type;
6282 op1->type->refCount++;
6287 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6289 unsigned char value2 = op2->uc;
6292 exp->string = PrintUChar(op1->uc = value2);
6295 exp->expType = op1->type;
6297 op1->type->refCount++;
6302 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6304 float value2 = op2->f;
6307 exp->string = PrintFloat(op1->f = value2);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6319 double value2 = op2->d;
6322 exp->string = PrintDouble(op1->d = value2);
6325 exp->expType = op1->type;
6327 op1->type->refCount++;
6332 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6334 int value2 = op2->i;
6337 exp->string = PrintInt(op1->i += value2);
6340 exp->expType = op1->type;
6342 op1->type->refCount++;
6347 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6349 unsigned int value2 = op2->ui;
6352 exp->string = PrintUInt(op1->ui += value2);
6355 exp->expType = op1->type;
6357 op1->type->refCount++;
6362 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6364 short value2 = op2->s;
6367 exp->string = PrintShort(op1->s += value2);
6370 exp->expType = op1->type;
6372 op1->type->refCount++;
6377 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6379 unsigned short value2 = op2->us;
6382 exp->string = PrintUShort(op1->us += value2);
6385 exp->expType = op1->type;
6387 op1->type->refCount++;
6392 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6394 char value2 = op2->c;
6397 exp->string = PrintChar(op1->c += value2);
6400 exp->expType = op1->type;
6402 op1->type->refCount++;
6407 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6409 unsigned char value2 = op2->uc;
6412 exp->string = PrintUChar(op1->uc += value2);
6415 exp->expType = op1->type;
6417 op1->type->refCount++;
6422 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6424 float value2 = op2->f;
6427 exp->string = PrintFloat(op1->f += value2);
6430 exp->expType = op1->type;
6432 op1->type->refCount++;
6437 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6439 double value2 = op2->d;
6442 exp->string = PrintDouble(op1->d += value2);
6445 exp->expType = op1->type;
6447 op1->type->refCount++;
6452 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6454 int value2 = op2->i;
6457 exp->string = PrintInt(op1->i -= value2);
6460 exp->expType = op1->type;
6462 op1->type->refCount++;
6467 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6469 unsigned int value2 = op2->ui;
6472 exp->string = PrintUInt(op1->ui -= value2);
6475 exp->expType = op1->type;
6477 op1->type->refCount++;
6482 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6484 short value2 = op2->s;
6487 exp->string = PrintShort(op1->s -= value2);
6490 exp->expType = op1->type;
6492 op1->type->refCount++;
6497 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6499 unsigned short value2 = op2->us;
6502 exp->string = PrintUShort(op1->us -= value2);
6505 exp->expType = op1->type;
6507 op1->type->refCount++;
6512 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6514 char value2 = op2->c;
6517 exp->string = PrintChar(op1->c -= value2);
6520 exp->expType = op1->type;
6522 op1->type->refCount++;
6527 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6529 unsigned char value2 = op2->uc;
6532 exp->string = PrintUChar(op1->uc -= value2);
6535 exp->expType = op1->type;
6537 op1->type->refCount++;
6542 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6544 float value2 = op2->f;
6547 exp->string = PrintFloat(op1->f -= value2);
6550 exp->expType = op1->type;
6552 op1->type->refCount++;
6557 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6559 double value2 = op2->d;
6562 exp->string = PrintDouble(op1->d -= value2);
6565 exp->expType = op1->type;
6567 op1->type->refCount++;
6572 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6574 int value2 = op2->i;
6577 exp->string = PrintInt(op1->i *= value2);
6580 exp->expType = op1->type;
6582 op1->type->refCount++;
6587 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6589 unsigned int value2 = op2->ui;
6592 exp->string = PrintUInt(op1->ui *= value2);
6595 exp->expType = op1->type;
6597 op1->type->refCount++;
6602 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6604 short value2 = op2->s;
6607 exp->string = PrintShort(op1->s *= value2);
6610 exp->expType = op1->type;
6612 op1->type->refCount++;
6617 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6619 unsigned short value2 = op2->us;
6622 exp->string = PrintUShort(op1->us *= value2);
6625 exp->expType = op1->type;
6627 op1->type->refCount++;
6632 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6634 char value2 = op2->c;
6637 exp->string = PrintChar(op1->c *= value2);
6640 exp->expType = op1->type;
6642 op1->type->refCount++;
6647 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6649 unsigned char value2 = op2->uc;
6652 exp->string = PrintUChar(op1->uc *= value2);
6655 exp->expType = op1->type;
6657 op1->type->refCount++;
6662 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6664 float value2 = op2->f;
6667 exp->string = PrintFloat(op1->f *= value2);
6670 exp->expType = op1->type;
6672 op1->type->refCount++;
6677 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6679 double value2 = op2->d;
6682 exp->string = PrintDouble(op1->d *= value2);
6685 exp->expType = op1->type;
6687 op1->type->refCount++;
6692 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6694 int value2 = op2->i;
6697 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6700 exp->expType = op1->type;
6702 op1->type->refCount++;
6707 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6709 unsigned int value2 = op2->ui;
6712 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6715 exp->expType = op1->type;
6717 op1->type->refCount++;
6722 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6724 short value2 = op2->s;
6727 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6730 exp->expType = op1->type;
6732 op1->type->refCount++;
6737 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6739 unsigned short value2 = op2->us;
6742 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6745 exp->expType = op1->type;
6747 op1->type->refCount++;
6752 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6754 char value2 = op2->c;
6757 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6760 exp->expType = op1->type;
6762 op1->type->refCount++;
6767 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6769 unsigned char value2 = op2->uc;
6772 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6775 exp->expType = op1->type;
6777 op1->type->refCount++;
6782 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6784 float value2 = op2->f;
6787 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6790 exp->expType = op1->type;
6792 op1->type->refCount++;
6797 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6799 double value2 = op2->d;
6802 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6805 exp->expType = op1->type;
6807 op1->type->refCount++;
6812 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6814 int value2 = op2->i;
6817 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6820 exp->expType = op1->type;
6822 op1->type->refCount++;
6827 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6829 unsigned int value2 = op2->ui;
6832 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6835 exp->expType = op1->type;
6837 op1->type->refCount++;
6842 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6844 short value2 = op2->s;
6847 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6850 exp->expType = op1->type;
6852 op1->type->refCount++;
6857 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6859 unsigned short value2 = op2->us;
6862 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6865 exp->expType = op1->type;
6867 op1->type->refCount++;
6872 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6874 char value2 = op2->c;
6877 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6880 exp->expType = op1->type;
6882 op1->type->refCount++;
6887 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6889 unsigned char value2 = op2->uc;
6892 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6895 exp->expType = op1->type;
6897 op1->type->refCount++;
6902 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6904 int value2 = op2->i;
6907 exp->string = PrintInt(op1->i & value2);
6910 exp->expType = op1->type;
6912 op1->type->refCount++;
6917 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6919 unsigned int value2 = op2->ui;
6922 exp->string = PrintUInt(op1->ui & value2);
6925 exp->expType = op1->type;
6927 op1->type->refCount++;
6932 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6934 short value2 = op2->s;
6937 exp->string = PrintShort(op1->s & value2);
6940 exp->expType = op1->type;
6942 op1->type->refCount++;
6947 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6949 unsigned short value2 = op2->us;
6952 exp->string = PrintUShort(op1->us & value2);
6955 exp->expType = op1->type;
6957 op1->type->refCount++;
6962 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6964 char value2 = op2->c;
6967 exp->string = PrintChar(op1->c & value2);
6970 exp->expType = op1->type;
6972 op1->type->refCount++;
6977 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6979 unsigned char value2 = op2->uc;
6982 exp->string = PrintUChar(op1->uc & value2);
6985 exp->expType = op1->type;
6987 op1->type->refCount++;
6992 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6994 int value2 = op2->i;
6997 exp->string = PrintInt(op1->i | value2);
7000 exp->expType = op1->type;
7002 op1->type->refCount++;
7007 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7009 unsigned int value2 = op2->ui;
7012 exp->string = PrintUInt(op1->ui | value2);
7015 exp->expType = op1->type;
7017 op1->type->refCount++;
7022 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7024 short value2 = op2->s;
7027 exp->string = PrintShort(op1->s | value2);
7030 exp->expType = op1->type;
7032 op1->type->refCount++;
7037 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7039 unsigned short value2 = op2->us;
7042 exp->string = PrintUShort(op1->us | value2);
7045 exp->expType = op1->type;
7047 op1->type->refCount++;
7052 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7054 char value2 = op2->c;
7057 exp->string = PrintChar(op1->c | value2);
7060 exp->expType = op1->type;
7062 op1->type->refCount++;
7067 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7069 unsigned char value2 = op2->uc;
7072 exp->string = PrintUChar(op1->uc | value2);
7075 exp->expType = op1->type;
7077 op1->type->refCount++;
7082 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7084 int value2 = op2->i;
7087 exp->string = PrintInt(op1->i ^ value2);
7090 exp->expType = op1->type;
7092 op1->type->refCount++;
7097 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7099 unsigned int value2 = op2->ui;
7102 exp->string = PrintUInt(op1->ui ^ value2);
7105 exp->expType = op1->type;
7107 op1->type->refCount++;
7112 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7114 short value2 = op2->s;
7117 exp->string = PrintShort(op1->s ^ value2);
7120 exp->expType = op1->type;
7122 op1->type->refCount++;
7127 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7129 unsigned short value2 = op2->us;
7132 exp->string = PrintUShort(op1->us ^ value2);
7135 exp->expType = op1->type;
7137 op1->type->refCount++;
7142 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7144 char value2 = op2->c;
7147 exp->string = PrintChar(op1->c ^ value2);
7150 exp->expType = op1->type;
7152 op1->type->refCount++;
7157 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7159 unsigned char value2 = op2->uc;
7162 exp->string = PrintUChar(op1->uc ^ value2);
7165 exp->expType = op1->type;
7167 op1->type->refCount++;
7172 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7174 int value2 = op2->i;
7177 exp->string = PrintInt(op1->i << value2);
7180 exp->expType = op1->type;
7182 op1->type->refCount++;
7187 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7189 unsigned int value2 = op2->ui;
7192 exp->string = PrintUInt(op1->ui << value2);
7195 exp->expType = op1->type;
7197 op1->type->refCount++;
7202 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7204 short value2 = op2->s;
7207 exp->string = PrintShort(op1->s << value2);
7210 exp->expType = op1->type;
7212 op1->type->refCount++;
7217 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7219 unsigned short value2 = op2->us;
7222 exp->string = PrintUShort(op1->us << value2);
7225 exp->expType = op1->type;
7227 op1->type->refCount++;
7232 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7234 char value2 = op2->c;
7237 exp->string = PrintChar(op1->c << value2);
7240 exp->expType = op1->type;
7242 op1->type->refCount++;
7247 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7249 unsigned char value2 = op2->uc;
7252 exp->string = PrintUChar(op1->uc << value2);
7255 exp->expType = op1->type;
7257 op1->type->refCount++;
7262 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7264 int value2 = op2->i;
7267 exp->string = PrintInt(op1->i >> value2);
7270 exp->expType = op1->type;
7272 op1->type->refCount++;
7277 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7279 unsigned int value2 = op2->ui;
7282 exp->string = PrintUInt(op1->ui >> value2);
7285 exp->expType = op1->type;
7287 op1->type->refCount++;
7292 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7294 short value2 = op2->s;
7297 exp->string = PrintShort(op1->s >> value2);
7300 exp->expType = op1->type;
7302 op1->type->refCount++;
7307 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7309 unsigned short value2 = op2->us;
7312 exp->string = PrintUShort(op1->us >> value2);
7315 exp->expType = op1->type;
7317 op1->type->refCount++;
7322 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7324 char value2 = op2->c;
7327 exp->string = PrintChar(op1->c >> value2);
7330 exp->expType = op1->type;
7332 op1->type->refCount++;
7337 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7339 unsigned char value2 = op2->uc;
7342 exp->string = PrintUChar(op1->uc >> value2);
7345 exp->expType = op1->type;
7347 op1->type->refCount++;
7352 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7355 exp->string = PrintInt(~op1->i);
7358 exp->expType = op1->type;
7360 op1->type->refCount++;
7365 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7368 exp->string = PrintUInt(~op1->ui);
7371 exp->expType = op1->type;
7373 op1->type->refCount++;
7378 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7381 exp->string = PrintShort(~op1->s);
7384 exp->expType = op1->type;
7386 op1->type->refCount++;
7391 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7394 exp->string = PrintUShort(~op1->us);
7397 exp->expType = op1->type;
7399 op1->type->refCount++;
7404 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7407 exp->string = PrintChar(~op1->c);
7410 exp->expType = op1->type;
7412 op1->type->refCount++;
7417 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7420 exp->string = PrintUChar(~op1->uc);
7423 exp->expType = op1->type;
7425 op1->type->refCount++;
7430 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7432 int value2 = op2->i;
7435 exp->string = PrintInt(op1->i &= value2);
7438 exp->expType = op1->type;
7440 op1->type->refCount++;
7445 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7447 unsigned int value2 = op2->ui;
7450 exp->string = PrintUInt(op1->ui &= value2);
7453 exp->expType = op1->type;
7455 op1->type->refCount++;
7460 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7462 short value2 = op2->s;
7465 exp->string = PrintShort(op1->s &= value2);
7468 exp->expType = op1->type;
7470 op1->type->refCount++;
7475 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7477 unsigned short value2 = op2->us;
7480 exp->string = PrintUShort(op1->us &= value2);
7483 exp->expType = op1->type;
7485 op1->type->refCount++;
7490 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7492 char value2 = op2->c;
7495 exp->string = PrintChar(op1->c &= value2);
7498 exp->expType = op1->type;
7500 op1->type->refCount++;
7505 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7507 unsigned char value2 = op2->uc;
7510 exp->string = PrintUChar(op1->uc &= value2);
7513 exp->expType = op1->type;
7515 op1->type->refCount++;
7520 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7522 int value2 = op2->i;
7525 exp->string = PrintInt(op1->i |= value2);
7528 exp->expType = op1->type;
7530 op1->type->refCount++;
7535 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7537 unsigned int value2 = op2->ui;
7540 exp->string = PrintUInt(op1->ui |= value2);
7543 exp->expType = op1->type;
7545 op1->type->refCount++;
7550 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7552 short value2 = op2->s;
7555 exp->string = PrintShort(op1->s |= value2);
7558 exp->expType = op1->type;
7560 op1->type->refCount++;
7565 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7567 unsigned short value2 = op2->us;
7570 exp->string = PrintUShort(op1->us |= value2);
7573 exp->expType = op1->type;
7575 op1->type->refCount++;
7580 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7582 char value2 = op2->c;
7585 exp->string = PrintChar(op1->c |= value2);
7588 exp->expType = op1->type;
7590 op1->type->refCount++;
7595 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7597 unsigned char value2 = op2->uc;
7600 exp->string = PrintUChar(op1->uc |= value2);
7603 exp->expType = op1->type;
7605 op1->type->refCount++;
7610 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7612 int value2 = op2->i;
7615 exp->string = PrintInt(op1->i ^= value2);
7618 exp->expType = op1->type;
7620 op1->type->refCount++;
7625 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7627 unsigned int value2 = op2->ui;
7630 exp->string = PrintUInt(op1->ui ^= value2);
7633 exp->expType = op1->type;
7635 op1->type->refCount++;
7640 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7642 short value2 = op2->s;
7645 exp->string = PrintShort(op1->s ^= value2);
7648 exp->expType = op1->type;
7650 op1->type->refCount++;
7655 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7657 unsigned short value2 = op2->us;
7660 exp->string = PrintUShort(op1->us ^= value2);
7663 exp->expType = op1->type;
7665 op1->type->refCount++;
7670 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7672 char value2 = op2->c;
7675 exp->string = PrintChar(op1->c ^= value2);
7678 exp->expType = op1->type;
7680 op1->type->refCount++;
7685 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7687 unsigned char value2 = op2->uc;
7690 exp->string = PrintUChar(op1->uc ^= value2);
7693 exp->expType = op1->type;
7695 op1->type->refCount++;
7700 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7702 int value2 = op2->i;
7705 exp->string = PrintInt(op1->i <<= value2);
7708 exp->expType = op1->type;
7710 op1->type->refCount++;
7715 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7717 unsigned int value2 = op2->ui;
7720 exp->string = PrintUInt(op1->ui <<= value2);
7723 exp->expType = op1->type;
7725 op1->type->refCount++;
7730 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7732 short value2 = op2->s;
7735 exp->string = PrintShort(op1->s <<= value2);
7738 exp->expType = op1->type;
7740 op1->type->refCount++;
7745 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7747 unsigned short value2 = op2->us;
7750 exp->string = PrintUShort(op1->us <<= value2);
7753 exp->expType = op1->type;
7755 op1->type->refCount++;
7760 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7762 char value2 = op2->c;
7765 exp->string = PrintChar(op1->c <<= value2);
7768 exp->expType = op1->type;
7770 op1->type->refCount++;
7775 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7777 unsigned char value2 = op2->uc;
7780 exp->string = PrintUChar(op1->uc <<= value2);
7783 exp->expType = op1->type;
7785 op1->type->refCount++;
7790 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7792 int value2 = op2->i;
7795 exp->string = PrintInt(op1->i >>= value2);
7798 exp->expType = op1->type;
7800 op1->type->refCount++;
7805 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7807 unsigned int value2 = op2->ui;
7810 exp->string = PrintUInt(op1->ui >>= value2);
7813 exp->expType = op1->type;
7815 op1->type->refCount++;
7820 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7822 short value2 = op2->s;
7825 exp->string = PrintShort(op1->s >>= value2);
7828 exp->expType = op1->type;
7830 op1->type->refCount++;
7835 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7837 unsigned short value2 = op2->us;
7840 exp->string = PrintUShort(op1->us >>= value2);
7843 exp->expType = op1->type;
7845 op1->type->refCount++;
7850 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7852 char value2 = op2->c;
7855 exp->string = PrintChar(op1->c >>= value2);
7858 exp->expType = op1->type;
7860 op1->type->refCount++;
7865 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7867 unsigned char value2 = op2->uc;
7870 exp->string = PrintUChar(op1->uc >>= value2);
7873 exp->expType = op1->type;
7875 op1->type->refCount++;
7880 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7883 exp->string = PrintInt(!op1->i);
7886 exp->expType = op1->type;
7888 op1->type->refCount++;
7893 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7896 exp->string = PrintUInt(!op1->ui);
7899 exp->expType = op1->type;
7901 op1->type->refCount++;
7906 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7909 exp->string = PrintShort(!op1->s);
7912 exp->expType = op1->type;
7914 op1->type->refCount++;
7919 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7922 exp->string = PrintUShort(!op1->us);
7925 exp->expType = op1->type;
7927 op1->type->refCount++;
7932 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7935 exp->string = PrintChar(!op1->c);
7938 exp->expType = op1->type;
7940 op1->type->refCount++;
7945 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7948 exp->string = PrintUChar(!op1->uc);
7951 exp->expType = op1->type;
7953 op1->type->refCount++;
7958 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7960 int value2 = op2->i;
7963 exp->string = PrintInt(op1->i == value2);
7966 exp->expType = op1->type;
7968 op1->type->refCount++;
7973 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7975 unsigned int value2 = op2->ui;
7978 exp->string = PrintUInt(op1->ui == value2);
7981 exp->expType = op1->type;
7983 op1->type->refCount++;
7988 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7990 short value2 = op2->s;
7993 exp->string = PrintShort(op1->s == value2);
7996 exp->expType = op1->type;
7998 op1->type->refCount++;
8003 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8005 unsigned short value2 = op2->us;
8008 exp->string = PrintUShort(op1->us == value2);
8011 exp->expType = op1->type;
8013 op1->type->refCount++;
8018 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8020 char value2 = op2->c;
8023 exp->string = PrintChar(op1->c == value2);
8026 exp->expType = op1->type;
8028 op1->type->refCount++;
8033 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8035 unsigned char value2 = op2->uc;
8038 exp->string = PrintUChar(op1->uc == value2);
8041 exp->expType = op1->type;
8043 op1->type->refCount++;
8048 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8050 float value2 = op2->f;
8053 exp->string = PrintFloat(op1->f == value2);
8056 exp->expType = op1->type;
8058 op1->type->refCount++;
8063 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8065 double value2 = op2->d;
8068 exp->string = PrintDouble(op1->d == value2);
8071 exp->expType = op1->type;
8073 op1->type->refCount++;
8078 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8080 int value2 = op2->i;
8083 exp->string = PrintInt(op1->i != value2);
8086 exp->expType = op1->type;
8088 op1->type->refCount++;
8093 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8095 unsigned int value2 = op2->ui;
8098 exp->string = PrintUInt(op1->ui != value2);
8101 exp->expType = op1->type;
8103 op1->type->refCount++;
8108 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8110 short value2 = op2->s;
8113 exp->string = PrintShort(op1->s != value2);
8116 exp->expType = op1->type;
8118 op1->type->refCount++;
8123 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8125 unsigned short value2 = op2->us;
8128 exp->string = PrintUShort(op1->us != value2);
8131 exp->expType = op1->type;
8133 op1->type->refCount++;
8138 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8140 char value2 = op2->c;
8143 exp->string = PrintChar(op1->c != value2);
8146 exp->expType = op1->type;
8148 op1->type->refCount++;
8153 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8155 unsigned char value2 = op2->uc;
8158 exp->string = PrintUChar(op1->uc != value2);
8161 exp->expType = op1->type;
8163 op1->type->refCount++;
8168 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8170 float value2 = op2->f;
8173 exp->string = PrintFloat(op1->f != value2);
8176 exp->expType = op1->type;
8178 op1->type->refCount++;
8183 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8185 double value2 = op2->d;
8188 exp->string = PrintDouble(op1->d != value2);
8191 exp->expType = op1->type;
8193 op1->type->refCount++;
8198 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8200 int value2 = op2->i;
8203 exp->string = PrintInt(op1->i && value2);
8206 exp->expType = op1->type;
8208 op1->type->refCount++;
8213 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8215 unsigned int value2 = op2->ui;
8218 exp->string = PrintUInt(op1->ui && value2);
8221 exp->expType = op1->type;
8223 op1->type->refCount++;
8228 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8230 short value2 = op2->s;
8233 exp->string = PrintShort(op1->s && value2);
8236 exp->expType = op1->type;
8238 op1->type->refCount++;
8243 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8245 unsigned short value2 = op2->us;
8248 exp->string = PrintUShort(op1->us && value2);
8251 exp->expType = op1->type;
8253 op1->type->refCount++;
8258 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8260 char value2 = op2->c;
8263 exp->string = PrintChar(op1->c && value2);
8266 exp->expType = op1->type;
8268 op1->type->refCount++;
8273 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8275 unsigned char value2 = op2->uc;
8278 exp->string = PrintUChar(op1->uc && value2);
8281 exp->expType = op1->type;
8283 op1->type->refCount++;
8288 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8290 float value2 = op2->f;
8293 exp->string = PrintFloat(op1->f && value2);
8296 exp->expType = op1->type;
8298 op1->type->refCount++;
8303 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8305 double value2 = op2->d;
8308 exp->string = PrintDouble(op1->d && value2);
8311 exp->expType = op1->type;
8313 op1->type->refCount++;
8318 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8320 int value2 = op2->i;
8323 exp->string = PrintInt(op1->i || value2);
8326 exp->expType = op1->type;
8328 op1->type->refCount++;
8333 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8335 unsigned int value2 = op2->ui;
8338 exp->string = PrintUInt(op1->ui || value2);
8341 exp->expType = op1->type;
8343 op1->type->refCount++;
8348 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8350 short value2 = op2->s;
8353 exp->string = PrintShort(op1->s || value2);
8356 exp->expType = op1->type;
8358 op1->type->refCount++;
8363 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8365 unsigned short value2 = op2->us;
8368 exp->string = PrintUShort(op1->us || value2);
8371 exp->expType = op1->type;
8373 op1->type->refCount++;
8378 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8380 char value2 = op2->c;
8383 exp->string = PrintChar(op1->c || value2);
8386 exp->expType = op1->type;
8388 op1->type->refCount++;
8393 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8395 unsigned char value2 = op2->uc;
8398 exp->string = PrintUChar(op1->uc || value2);
8401 exp->expType = op1->type;
8403 op1->type->refCount++;
8408 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8410 float value2 = op2->f;
8413 exp->string = PrintFloat(op1->f || value2);
8416 exp->expType = op1->type;
8418 op1->type->refCount++;
8423 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8425 double value2 = op2->d;
8428 exp->string = PrintDouble(op1->d || value2);
8431 exp->expType = op1->type;
8433 op1->type->refCount++;
8438 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8440 int value2 = op2->i;
8443 exp->string = PrintInt(op1->i > value2);
8446 exp->expType = op1->type;
8448 op1->type->refCount++;
8453 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8455 unsigned int value2 = op2->ui;
8458 exp->string = PrintUInt(op1->ui > value2);
8461 exp->expType = op1->type;
8463 op1->type->refCount++;
8468 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8470 short value2 = op2->s;
8473 exp->string = PrintShort(op1->s > value2);
8476 exp->expType = op1->type;
8478 op1->type->refCount++;
8483 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8485 unsigned short value2 = op2->us;
8488 exp->string = PrintUShort(op1->us > value2);
8491 exp->expType = op1->type;
8493 op1->type->refCount++;
8498 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8500 char value2 = op2->c;
8503 exp->string = PrintChar(op1->c > value2);
8506 exp->expType = op1->type;
8508 op1->type->refCount++;
8513 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8515 unsigned char value2 = op2->uc;
8518 exp->string = PrintUChar(op1->uc > value2);
8521 exp->expType = op1->type;
8523 op1->type->refCount++;
8528 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8530 float value2 = op2->f;
8533 exp->string = PrintFloat(op1->f > value2);
8536 exp->expType = op1->type;
8538 op1->type->refCount++;
8543 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8545 double value2 = op2->d;
8548 exp->string = PrintDouble(op1->d > value2);
8551 exp->expType = op1->type;
8553 op1->type->refCount++;
8558 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8560 int value2 = op2->i;
8563 exp->string = PrintInt(op1->i < value2);
8566 exp->expType = op1->type;
8568 op1->type->refCount++;
8573 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8575 unsigned int value2 = op2->ui;
8578 exp->string = PrintUInt(op1->ui < value2);
8581 exp->expType = op1->type;
8583 op1->type->refCount++;
8588 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8590 short value2 = op2->s;
8593 exp->string = PrintShort(op1->s < value2);
8596 exp->expType = op1->type;
8598 op1->type->refCount++;
8603 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8605 unsigned short value2 = op2->us;
8608 exp->string = PrintUShort(op1->us < value2);
8611 exp->expType = op1->type;
8613 op1->type->refCount++;
8618 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8620 char value2 = op2->c;
8623 exp->string = PrintChar(op1->c < value2);
8626 exp->expType = op1->type;
8628 op1->type->refCount++;
8633 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8635 unsigned char value2 = op2->uc;
8638 exp->string = PrintUChar(op1->uc < value2);
8641 exp->expType = op1->type;
8643 op1->type->refCount++;
8648 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8650 float value2 = op2->f;
8653 exp->string = PrintFloat(op1->f < value2);
8656 exp->expType = op1->type;
8658 op1->type->refCount++;
8663 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8665 double value2 = op2->d;
8668 exp->string = PrintDouble(op1->d < value2);
8671 exp->expType = op1->type;
8673 op1->type->refCount++;
8678 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8680 int value2 = op2->i;
8683 exp->string = PrintInt(op1->i >= value2);
8686 exp->expType = op1->type;
8688 op1->type->refCount++;
8693 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8695 unsigned int value2 = op2->ui;
8698 exp->string = PrintUInt(op1->ui >= value2);
8701 exp->expType = op1->type;
8703 op1->type->refCount++;
8708 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8710 short value2 = op2->s;
8713 exp->string = PrintShort(op1->s >= value2);
8716 exp->expType = op1->type;
8718 op1->type->refCount++;
8723 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8725 unsigned short value2 = op2->us;
8728 exp->string = PrintUShort(op1->us >= value2);
8731 exp->expType = op1->type;
8733 op1->type->refCount++;
8738 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8740 char value2 = op2->c;
8743 exp->string = PrintChar(op1->c >= value2);
8746 exp->expType = op1->type;
8748 op1->type->refCount++;
8753 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8755 unsigned char value2 = op2->uc;
8758 exp->string = PrintUChar(op1->uc >= value2);
8761 exp->expType = op1->type;
8763 op1->type->refCount++;
8768 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8770 float value2 = op2->f;
8773 exp->string = PrintFloat(op1->f >= value2);
8776 exp->expType = op1->type;
8778 op1->type->refCount++;
8783 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8785 double value2 = op2->d;
8788 exp->string = PrintDouble(op1->d >= value2);
8791 exp->expType = op1->type;
8793 op1->type->refCount++;
8798 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8800 int value2 = op2->i;
8803 exp->string = PrintInt(op1->i <= value2);
8806 exp->expType = op1->type;
8808 op1->type->refCount++;
8813 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8815 unsigned int value2 = op2->ui;
8818 exp->string = PrintUInt(op1->ui <= value2);
8821 exp->expType = op1->type;
8823 op1->type->refCount++;
8828 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8830 short value2 = op2->s;
8833 exp->string = PrintShort(op1->s <= value2);
8836 exp->expType = op1->type;
8838 op1->type->refCount++;
8843 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8845 unsigned short value2 = op2->us;
8848 exp->string = PrintUShort(op1->us <= value2);
8851 exp->expType = op1->type;
8853 op1->type->refCount++;
8858 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8860 char value2 = op2->c;
8863 exp->string = PrintChar(op1->c <= value2);
8866 exp->expType = op1->type;
8868 op1->type->refCount++;
8873 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8875 unsigned char value2 = op2->uc;
8878 exp->string = PrintUChar(op1->uc <= value2);
8881 exp->expType = op1->type;
8883 op1->type->refCount++;
8888 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8890 float value2 = op2->f;
8893 exp->string = PrintFloat(op1->f <= value2);
8896 exp->expType = op1->type;
8898 op1->type->refCount++;
8903 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8905 double value2 = op2->d;
8908 exp->string = PrintDouble(op1->d <= value2);
8911 exp->expType = op1->type;
8913 op1->type->refCount++;
8918 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8921 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8924 exp->expType = op1->type;
8926 op1->type->refCount++;
8931 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8934 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8937 exp->expType = op1->type;
8939 op1->type->refCount++;
8944 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8947 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8950 exp->expType = op1->type;
8952 op1->type->refCount++;
8957 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8960 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8963 exp->expType = op1->type;
8965 op1->type->refCount++;
8970 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8973 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8976 exp->expType = op1->type;
8978 op1->type->refCount++;
8983 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8986 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8989 exp->expType = op1->type;
8991 op1->type->refCount++;
8996 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8999 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9002 exp->expType = op1->type;
9004 op1->type->refCount++;
9009 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9012 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9015 exp->expType = op1->type;
9017 op1->type->refCount++;
9022 struct OpTable intOps =
9024 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
9027 struct OpTable uintOps =
9029 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
9032 struct OpTable shortOps =
9034 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
9037 struct OpTable ushortOps =
9039 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
9042 struct OpTable floatOps =
9044 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
9047 struct OpTable doubleOps =
9049 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
9052 struct OpTable charOps =
9054 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
9057 struct OpTable ucharOps =
9059 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
9062 void ReadString(char * output, char * string)
9064 int len = strlen(string);
9066 unsigned int quoted = 0x0, escaped = 0x0;
9068 for(c = 0; c < len; c++)
9070 char ch = string[c];
9126 extern double strtod(char * , char * * );
9128 struct Operand GetOperand(struct Expression * exp)
9134 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9137 struct Type * type = exp->expType;
9141 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9143 if(!type->_class->registered->dataType)
9144 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9145 type = type->_class->registered->dataType;
9147 op.kind = type->kind;
9148 op.type = exp->expType;
9149 if(exp->isConstant && exp->type == 2)
9155 if(exp->constant[0] == '\'')
9156 op.c = exp->constant[1];
9157 else if(type->isSigned)
9159 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9164 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9172 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9177 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9185 op.i = strtol(exp->constant, (((void *)0)), 0);
9190 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9198 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9203 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9209 op.f = (float)strtod(exp->constant, (((void *)0)));
9213 op.d = (double)strtod(exp->constant, (((void *)0)));
9219 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9229 int __ecereVMethodID_class_OnGetString;
9231 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9233 static void UnusedFunction()
9237 ((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);
9240 extern int __ecereVMethodID_class_OnGetString;
9242 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9244 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9246 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9248 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9249 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9252 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9253 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9255 void * ptr = inst->data + dataMember->offset + offset;
9256 char * result = (((void *)0));
9258 exp->loc = member->loc = inst->loc;
9259 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9260 if(!dataMember->dataType)
9261 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9262 type = dataMember->dataType;
9265 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9267 if(_class->type == 4)
9269 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9273 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9274 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9276 for(item = e->values.first; item; item = item->next)
9278 if((int)item->data == *(int *)ptr)
9280 result = item->name;
9286 exp->identifier = MkIdentifier(result);
9288 exp->destType = MkClassType(_class->fullName);
9289 ProcessExpressionType(exp);
9293 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9295 if(!_class->dataType)
9296 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9297 type = _class->dataType;
9306 FreeExpContents(exp);
9307 exp->constant = PrintFloat(*(float *)ptr);
9313 FreeExpContents(exp);
9314 exp->constant = PrintDouble(*(double *)ptr);
9320 FreeExpContents(exp);
9321 exp->constant = PrintInt(*(int *)ptr);
9327 FreeExpContents(exp);
9328 exp->constant = PrintInt64(*(long long *)ptr);
9333 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9336 ListAdd(memberList, member);
9338 if(parentDataMember->type == 1)
9343 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9345 void PopulateInstance(struct Instantiation * inst)
9347 struct Symbol * classSym = inst->_class->symbol;
9348 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9349 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9350 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9352 inst->members = MkListOne(MkMembersInitList(memberList));
9353 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9355 if(!dataMember->isProperty)
9357 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9358 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9361 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9362 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9364 void * ptr = inst->data + dataMember->offset;
9365 char * result = (((void *)0));
9367 exp->loc = member->loc = inst->loc;
9368 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9369 if(!dataMember->dataType)
9370 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9371 type = dataMember->dataType;
9374 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9376 if(_class->type == 4)
9378 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9382 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9383 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9385 for(item = e->values.first; item; item = item->next)
9387 if((int)item->data == *(int *)ptr)
9389 result = item->name;
9396 exp->identifier = MkIdentifier(result);
9398 exp->destType = MkClassType(_class->fullName);
9399 ProcessExpressionType(exp);
9402 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9404 if(!_class->dataType)
9405 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9406 type = _class->dataType;
9415 exp->constant = PrintFloat(*(float *)ptr);
9421 exp->constant = PrintDouble(*(double *)ptr);
9427 exp->constant = PrintInt(*(int *)ptr);
9433 exp->constant = PrintInt64(*(long long *)ptr);
9438 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9441 ListAdd(memberList, member);
9447 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);
9449 extern void FreeInstance(struct Instantiation * inst);
9451 void ComputeInstantiation(struct Expression * exp)
9453 struct Instantiation * inst = exp->instance;
9454 struct MembersInit * members;
9455 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9456 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9457 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9458 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9459 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9460 int subMemberStackPos = 0;
9463 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9467 if(_class->type == 0 || _class->type == 5)
9468 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9470 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9474 for(members = (*inst->members).first; members; members = members->next)
9476 switch(members->type)
9480 if(members->dataMembers)
9482 struct MemberInit * member;
9484 for(member = (*members->dataMembers).first; member; member = member->next)
9486 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9487 unsigned int found = 0x0;
9488 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9489 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9490 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9491 unsigned int dataMemberOffset;
9495 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9498 if(curMember->isProperty)
9499 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9502 dataMember = curMember;
9503 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9510 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9514 if(prop->memberAccess == 1)
9516 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9517 curClass = prop->_class;
9522 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9523 int _subMemberStackPos = 0;
9525 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9529 if(dataMember->memberAccess == 1)
9531 curMember = dataMember;
9532 curClass = dataMember->_class;
9533 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9534 subMemberStackPos = _subMemberStackPos;
9539 if(found && member->initializer && member->initializer->type == 0)
9541 struct Expression * value = member->initializer->exp;
9542 struct Type * type = (((void *)0));
9546 type = prop->dataType;
9550 if(!dataMember->dataType)
9551 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9552 type = dataMember->dataType;
9554 if(ident && ident->next)
9556 for(ident = ident->next; ident && type; ident = ident->next)
9560 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9562 type = prop->dataType;
9565 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9567 type = dataMember->dataType;
9570 else if(type->kind == 9 || type->kind == 10)
9572 struct Type * memberType;
9574 for(memberType = type->members.first; memberType; memberType = memberType->next)
9576 if(!strcmp(memberType->name, ident->string))
9587 FreeType(value->destType);
9588 value->destType = type;
9591 ComputeExpression(value);
9593 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9597 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9599 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9601 if(!_class->dataType)
9602 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9603 type = _class->dataType;
9608 void * ptr = inst->data + dataMemberOffset;
9610 if(value->type == 2)
9616 GetInt(value, (int *)ptr);
9621 GetInt64(value, (long long *)ptr);
9626 GetFloat(value, (float *)ptr);
9631 GetDouble(value, (double *)ptr);
9636 else if(value->type == 1)
9640 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9642 if(_class->type == 1)
9644 ComputeTypeSize(type);
9645 if(value->instance->data)
9646 memcpy(ptr, value->instance->data, type->size);
9653 if(value->type == 1 && value->instance->data)
9655 void (* Set)(void *, void *) = (void *)prop->Set;
9657 Set(inst->data, value->instance->data);
9658 PopulateInstance(inst);
9660 else if(value->type == 2)
9666 void (* Set)(void *, double) = (void *)prop->Set;
9668 Set(inst->data, strtod(value->constant, (((void *)0))));
9673 void (* Set)(void *, float) = (void *)prop->Set;
9675 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9680 void (* Set)(void *, int) = (void *)prop->Set;
9682 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9687 void (* Set)(void *, long long) = (void *)prop->Set;
9689 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9694 else if(value->type == 3)
9698 ReadString(temp, value->string);
9699 prop->Set(inst->data, temp);
9703 else if(_class->type == 3)
9707 if(value->type == 2)
9711 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9713 if(_class->type == 3)
9715 if(!_class->dataType)
9716 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9717 type = _class->dataType;
9725 float (* Set)(float) = (void *)prop->Set;
9727 GetFloat(member->initializer->exp, &fValue);
9728 exp->constant = PrintFloat(Set(fValue));
9735 double (* Set)(double) = (void *)prop->Set;
9737 GetDouble(member->initializer->exp, &dValue);
9738 exp->constant = PrintDouble(Set(dValue));
9746 else if(_class->type == 2)
9750 if(value->type == 1 && value->instance->data)
9752 unsigned int (* Set)(void *) = (void *)prop->Set;
9754 bits = Set(value->instance->data);
9756 else if(value->type == 2)
9762 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9766 GetInt(value, &part);
9767 bits = (bits & ~bitMember->mask);
9768 if(!bitMember->dataType)
9769 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9770 type = bitMember->dataType;
9771 if(type->kind == 8 && type->_class && type->_class->registered)
9773 if(!type->_class->registered->dataType)
9774 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9775 type = type->_class->registered->dataType;
9781 bits |= ((char)part << bitMember->pos);
9783 bits |= ((unsigned char)part << bitMember->pos);
9787 bits |= ((short)part << bitMember->pos);
9789 bits |= ((unsigned short)part << bitMember->pos);
9794 bits |= (part << bitMember->pos);
9796 bits |= ((unsigned int)part << bitMember->pos);
9800 bits |= ((long long)part << bitMember->pos);
9802 bits |= ((uint64)part << bitMember->pos);
9810 if(_class && _class->type == 3)
9812 ComputeExpression(member->initializer->exp);
9813 exp->constant = member->initializer->exp->constant;
9815 member->initializer->exp->constant = (((void *)0));
9825 if(_class && _class->type == 2)
9827 exp->constant = PrintHexUInt(bits);
9836 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9838 if(exp->op.op == SIZEOF)
9840 FreeExpContents(exp);
9842 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9852 struct Expression * exp2 = exp->op.exp2;
9854 exp->op.exp2 = (((void *)0));
9855 FreeExpContents(exp);
9856 FreeType(exp->expType);
9857 FreeType(exp->destType);
9859 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9865 FreeExpContents(exp);
9866 op1->ops.Neg(exp, op1);
9872 FreeExpContents(exp);
9873 op1->ops.BitNot(exp, op1);
9879 FreeExpContents(exp);
9880 op1->ops.Not(exp, op1);
9892 FreeExpContents(exp);
9893 op1->ops.Add(exp, op1, op2);
9899 FreeExpContents(exp);
9900 op1->ops.Sub(exp, op1, op2);
9906 FreeExpContents(exp);
9907 op1->ops.Mul(exp, op1, op2);
9913 FreeExpContents(exp);
9914 op1->ops.Div(exp, op1, op2);
9920 FreeExpContents(exp);
9921 op1->ops.Mod(exp, op1, op2);
9929 FreeExpContents(exp);
9930 op1->ops.BitAnd(exp, op1, op2);
9937 FreeExpContents(exp);
9938 op1->ops.BitOr(exp, op1, op2);
9944 FreeExpContents(exp);
9945 op1->ops.BitXor(exp, op1, op2);
9951 FreeExpContents(exp);
9952 op1->ops.LShift(exp, op1, op2);
9958 FreeExpContents(exp);
9959 op1->ops.RShift(exp, op1, op2);
9965 FreeExpContents(exp);
9966 op1->ops.Equ(exp, op1, op2);
9972 FreeExpContents(exp);
9973 op1->ops.Nqu(exp, op1, op2);
9979 FreeExpContents(exp);
9980 op1->ops.And(exp, op1, op2);
9986 FreeExpContents(exp);
9987 op1->ops.Or(exp, op1, op2);
9993 FreeExpContents(exp);
9994 op1->ops.Grt(exp, op1, op2);
10000 FreeExpContents(exp);
10001 op1->ops.Sma(exp, op1, op2);
10005 if(op1->ops.GrtEqu)
10007 FreeExpContents(exp);
10008 op1->ops.GrtEqu(exp, op1, op2);
10012 if(op1->ops.SmaEqu)
10014 FreeExpContents(exp);
10015 op1->ops.SmaEqu(exp, op1, op2);
10023 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10025 void ComputeExpression(struct Expression * exp)
10027 char expString[10240];
10029 expString[0] = '\0';
10034 ComputeInstantiation(exp);
10039 struct Expression * exp1, * exp2 = (((void *)0));
10040 struct Operand op1 =
10044 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10047 struct Operand op2 =
10051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10056 ComputeExpression(exp->op.exp2);
10059 ComputeExpression(exp->op.exp1);
10060 exp1 = exp->op.exp1;
10061 exp2 = exp->op.exp2;
10062 op1 = GetOperand(exp1);
10064 op1.type->refCount++;
10067 op2 = GetOperand(exp2);
10069 op2.type->refCount++;
10074 exp1 = exp->op.exp2;
10075 op1 = GetOperand(exp1);
10077 op1.type->refCount++;
10079 CallOperator(exp, exp1, exp2, &op1, &op2);
10081 FreeType(op1.type);
10083 FreeType(op2.type);
10089 struct Expression * e, * n;
10091 for(e = (*exp->list).first; e; e = n)
10096 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10098 ComputeExpression(e);
10099 FreeType(exp->expType);
10100 FreeType(exp->destType);
10102 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10103 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10114 struct Expression * memberExp = exp->member.exp;
10115 struct Identifier * memberID = exp->member.member;
10116 struct Type * type;
10118 ComputeExpression(exp->member.exp);
10119 type = exp->member.exp->expType;
10122 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)));
10123 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10124 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10125 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10127 if(type->kind == 19 && exp->member.exp->type == 26)
10128 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10132 struct Symbol * classSym;
10135 PrintType(type, string, 0x0, 0x1);
10136 classSym = FindClass(string);
10137 _class = classSym ? classSym->registered : (((void *)0));
10139 if(exp->member.member)
10141 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10143 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10145 if(!prop && !member && _class && exp->member.member)
10147 struct Symbol * classSym = FindClass(exp->member.member->string);
10149 convertTo = _class;
10150 _class = classSym ? classSym->registered : (((void *)0));
10151 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10157 struct Type * type = prop->dataType;
10159 if(_class->type == 3)
10161 if(type->kind == 8)
10163 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10165 if(_class->type == 3)
10167 if(!_class->dataType)
10168 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10169 type = _class->dataType;
10177 float (* Get)(float) = (void *)prop->Get;
10179 GetFloat(exp->member.exp, &value);
10180 exp->constant = PrintFloat(Get ? Get(value) : value);
10187 double (* Get)(double);
10189 GetDouble(exp->member.exp, &value);
10191 Get = (void *)prop->Set;
10193 Get = (void *)prop->Get;
10194 exp->constant = PrintDouble(Get ? Get(value) : value);
10204 struct Expression * value = exp->member.exp;
10205 struct Type * type;
10207 if(!prop->dataType)
10208 ProcessPropertyType(prop);
10209 type = prop->dataType;
10213 else if(_class->type == 1)
10219 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10221 if(propertyClass->type == 1 && value->type == 1)
10223 void (* Set)(void *, void *) = (void *)prop->Set;
10225 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10226 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10227 exp->instance->_class = MkSpecifierName(_class->fullName);
10228 exp->instance->loc = exp->loc;
10230 Set(exp->instance->data, value->instance->data);
10231 PopulateInstance(exp->instance);
10238 void (* Set)(void *, int) = (void *)prop->Set;
10240 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10241 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10242 exp->instance->_class = MkSpecifierName(_class->fullName);
10243 exp->instance->loc = exp->loc;
10245 GetInt(value, &intValue);
10246 Set(exp->instance->data, intValue);
10247 PopulateInstance(exp->instance);
10252 long long intValue;
10253 void (* Set)(void *, long long) = (void *)prop->Set;
10255 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10256 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10257 exp->instance->_class = MkSpecifierName(_class->fullName);
10258 exp->instance->loc = exp->loc;
10260 GetInt64(value, &intValue);
10261 Set(exp->instance->data, intValue);
10262 PopulateInstance(exp->instance);
10267 double doubleValue;
10268 void (* Set)(void *, double) = (void *)prop->Set;
10270 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10271 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10272 exp->instance->_class = MkSpecifierName(_class->fullName);
10273 exp->instance->loc = exp->loc;
10275 GetDouble(value, &doubleValue);
10276 Set(exp->instance->data, doubleValue);
10277 PopulateInstance(exp->instance);
10282 else if(_class->type == 2)
10288 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10290 if(propertyClass->type == 1 && value->instance->data)
10292 unsigned int (* Set)(void *) = (void *)prop->Set;
10293 unsigned int bits = Set(value->instance->data);
10295 exp->constant = PrintHexUInt(bits);
10299 else if(_class->type == 2)
10301 unsigned int value;
10302 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10305 GetUInt(exp->member.exp, &value);
10307 exp->constant = PrintHexUInt(bits);
10316 if(_class->type == 2)
10318 unsigned int value;
10320 GetUInt(exp->member.exp, &value);
10325 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10327 if(_class->type == 1)
10329 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10331 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10332 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10333 exp->instance->_class = MkSpecifierName(_class->fullName);
10334 exp->instance->loc = exp->loc;
10336 Get(value, exp->instance->data);
10337 PopulateInstance(exp->instance);
10339 else if(_class->type == 2)
10341 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10342 uint64 bits = Get(value);
10344 exp->constant = PrintHexUInt64(bits);
10351 else if(_class->type == 1)
10353 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10359 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10361 if(_class->type == 1 && value)
10363 void (* Get)(void *, void *) = (void *)prop->Get;
10365 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10366 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10367 exp->instance->_class = MkSpecifierName(_class->fullName);
10368 exp->instance->loc = exp->loc;
10370 Get(value, exp->instance->data);
10371 PopulateInstance(exp->instance);
10382 exp->isConstant = 0x0;
10391 FreeExpression(memberExp);
10392 FreeIdentifier(memberID);
10398 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10400 FreeExpContents(exp);
10401 exp->constant = PrintUInt(ComputeTypeSize(type));
10408 struct Symbol * classSym = exp->_class->symbol;
10410 if(classSym && classSym->registered)
10412 if(classSym->registered->fixed)
10414 FreeSpecifier(exp->_class);
10415 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10420 char className[1024];
10422 strcpy(className, "__ecereClass_");
10423 FullClassNameCat(className, classSym->string, 0x1);
10424 MangleClassName(className);
10425 FreeExpContents(exp);
10427 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10428 exp->member.member = MkIdentifier("structSize");
10435 struct Type * type;
10436 struct Expression * e = exp;
10438 if(exp->type == 11)
10441 ComputeExpression(exp->cast.exp);
10444 if(e && exp->expType)
10446 type = exp->expType;
10447 if(type->kind == 8)
10449 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10451 if(_class && (_class->type == 3 || _class->type == 2))
10453 if(!_class->dataType)
10454 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10455 type = _class->dataType;
10465 GetChar(e, &value);
10466 FreeExpContents(exp);
10467 exp->constant = PrintChar(value);
10472 unsigned char value;
10474 GetUChar(e, &value);
10475 FreeExpContents(exp);
10476 exp->constant = PrintUChar(value);
10485 GetShort(e, &value);
10486 FreeExpContents(exp);
10487 exp->constant = PrintShort(value);
10492 unsigned short value;
10494 GetUShort(e, &value);
10495 FreeExpContents(exp);
10496 exp->constant = PrintUShort(value);
10506 FreeExpContents(exp);
10507 exp->constant = PrintInt(value);
10512 unsigned int value;
10514 GetUInt(e, &value);
10515 FreeExpContents(exp);
10516 exp->constant = PrintUInt(value);
10525 GetInt64(e, &value);
10526 FreeExpContents(exp);
10527 exp->constant = PrintInt64(value);
10534 GetUInt64(e, &value);
10535 FreeExpContents(exp);
10536 exp->constant = PrintUInt64(value);
10544 GetFloat(e, &value);
10545 FreeExpContents(exp);
10546 exp->constant = PrintFloat(value);
10554 GetDouble(e, &value);
10555 FreeExpContents(exp);
10556 exp->constant = PrintDouble(value);
10566 struct Operand op1 =
10570 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10573 struct Operand op2 =
10577 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10580 struct Operand op3 =
10584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10589 ComputeExpression((*exp->cond.exp).last);
10590 if(exp->cond.elseExp)
10591 ComputeExpression(exp->cond.elseExp);
10593 ComputeExpression(exp->cond.cond);
10594 op1 = GetOperand(exp->cond.cond);
10596 op1.type->refCount++;
10597 op2 = GetOperand((*exp->cond.exp).last);
10599 op2.type->refCount++;
10600 op3 = GetOperand(exp->cond.elseExp);
10602 op3.type->refCount++;
10605 FreeExpContents(exp);
10606 op1.ops.Cond(exp, &op1, &op2, &op3);
10609 FreeType(op1.type);
10611 FreeType(op2.type);
10613 FreeType(op3.type);
10619 void ApplyAnyObjectLogic(struct Expression * e);
10621 extern void CopyTypeInto(struct Type * type, struct Type * src);
10623 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10625 unsigned int result = 0x1;
10629 struct __ecereNameSpace__ecere__sys__OldList converts =
10633 struct Conversion * convert;
10635 if(destType->kind == 0)
10637 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10641 for(convert = converts.first; convert; convert = convert->next)
10643 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10647 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10648 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10651 newExp->destType = (((void *)0));
10655 exp->addedThis = 0x1;
10656 exp->member.exp = newExp;
10657 FreeType(exp->member.exp->expType);
10658 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10659 exp->member.exp->expType->classObjectType = objectType;
10660 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10661 exp->member.memberType = 1;
10662 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10663 exp->needCast = 0x1;
10665 exp->expType->refCount++;
10666 ApplyAnyObjectLogic(exp->member.exp);
10672 exp->addedThis = 0x1;
10673 exp->member.exp = newExp;
10674 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10676 newExp->byReference = 0x1;
10678 FreeType(exp->member.exp->expType);
10679 exp->member.exp->expType = (((void *)0));
10680 if(convert->convert->dataType)
10682 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10683 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10684 exp->member.exp->expType->refCount = 1;
10685 exp->member.exp->expType->classObjectType = objectType;
10686 ApplyAnyObjectLogic(exp->member.exp);
10688 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10689 exp->member.memberType = 4;
10690 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10691 exp->needCast = 0x1;
10692 if(convert->resultType)
10693 convert->resultType->refCount++;
10699 FreeType(exp->expType);
10702 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10703 exp->needCast = 0x1;
10705 exp->expType->refCount++;
10709 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10710 exp->needCast = 0x1;
10711 if(convert->resultType)
10712 convert->resultType->refCount++;
10716 if(exp->isConstant && inCompiler)
10717 ComputeExpression(exp);
10718 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10720 if(!result && exp->expType && converts.count)
10722 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10724 if(!result && exp->expType && exp->destType)
10726 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))
10733 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10735 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10737 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10739 void CheckTemplateTypes(struct Expression * exp)
10741 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10743 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10744 struct Statement * compound;
10745 struct Context * context;
10749 exp->destType->refCount++;
10751 exp->expType->refCount++;
10752 newExp->prev = (((void *)0));
10753 newExp->next = (((void *)0));
10754 switch(exp->expType->kind)
10757 if(exp->destType->classObjectType)
10760 exp->destType->refCount--;
10762 exp->expType->refCount--;
10763 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10767 struct __ecereNameSpace__ecere__sys__OldList * specs;
10768 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10769 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10771 context = PushContext();
10772 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10773 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10774 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10776 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10777 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
10778 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
10779 exp->compound->compound.context = context;
10780 PopContext(context);
10785 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10786 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10790 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10792 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10793 struct Statement * compound;
10794 struct Context * context;
10798 exp->destType->refCount++;
10800 exp->expType->refCount++;
10801 newExp->prev = (((void *)0));
10802 newExp->next = (((void *)0));
10803 switch(exp->expType->kind)
10806 if(exp->destType->classObjectType)
10809 exp->destType->refCount--;
10811 exp->expType->refCount--;
10812 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10816 struct __ecereNameSpace__ecere__sys__OldList * specs;
10817 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
10818 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
10820 context = PushContext();
10821 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
10822 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
10823 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
10825 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
10826 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
10827 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
10828 exp->compound->compound.context = context;
10829 PopContext(context);
10834 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10837 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10838 ProcessExpressionType((*exp->list).first);
10844 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10845 newExp->needCast = 0x1;
10846 ProcessExpressionType((*exp->list).first);
10852 if(exp->expType->kind == 20)
10854 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10858 FreeType(exp->destType);
10859 FreeType(exp->expType);
10860 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10864 if(newExp->type == 8 && newExp->member.memberType == 3)
10868 exp->op.exp1 = (((void *)0));
10869 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10873 char typeString[1024];
10874 struct Declarator * decl;
10875 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10877 typeString[0] = '\0';
10878 PrintType(exp->expType, typeString, 0x0, 0x0);
10879 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10881 exp->cast.typeName = MkTypeName(specs, decl);
10882 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10883 exp->cast.exp->needCast = 0x1;
10891 extern int strncmp(const char * , const char * , int n);
10893 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
10895 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10897 int nsLen = strlen(nameSpace);
10898 struct Symbol * symbol;
10900 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)))
10902 char * s = symbol->string;
10904 if(!strncmp(s, nameSpace, nsLen))
10909 for(c = strlen(s) - 1; c >= 0; c--)
10912 namePart = s + c + 1;
10913 if(!strcmp(namePart, name))
10921 return (((void *)0));
10924 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10927 char nameSpace[1024];
10929 unsigned int gotColon = 0x0;
10931 nameSpace[0] = '\0';
10932 for(c = strlen(name) - 1; c >= 0; c--)
10938 namePart = name + c + 1;
10939 while(c >= 0 && name[c] == ':')
10943 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10947 memcpy(nameSpace, name, c + 1);
10948 nameSpace[c + 1] = (char)0;
10949 return ScanWithNameSpace(tree, nameSpace, namePart);
10953 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10959 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10963 return ScanWithNameSpace(tree, "", namePart);
10965 return (((void *)0));
10968 static void ProcessDeclaration(struct Declaration * decl);
10970 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10972 struct Context * ctx;
10973 struct Symbol * symbol = (((void *)0));
10975 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10977 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
10979 symbol = (((void *)0));
10982 char curName[1024];
10984 strcpy(curName, thisNameSpace);
10985 strcat(curName, "::");
10986 strcat(curName, name);
10987 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10990 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10993 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
10994 if(symbol || ctx == endContext)
10997 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10999 if(symbol->pointerExternal->type == 0)
11001 struct FunctionDefinition * function = symbol->pointerExternal->function;
11002 struct Context * tmpContext = curContext;
11004 curContext = (((void *)0));
11005 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11006 curContext = tmpContext;
11007 symbol->pointerExternal->symbol = symbol;
11008 DeclareType(symbol->type, 0x1, 0x1);
11009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11010 symbol->id = curExternal->symbol->idCode;
11012 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11014 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11015 symbol->id = curExternal->symbol->idCode;
11021 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11023 if(!type->isSigned)
11024 ListAdd(specs, MkSpecifier(UNSIGNED));
11029 if(type->_class->registered)
11031 if(!type->_class->registered->dataType)
11032 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11033 GetTypeSpecs(type->_class->registered->dataType, specs);
11038 ListAdd(specs, MkSpecifier(DOUBLE));
11041 ListAdd(specs, MkSpecifier(FLOAT));
11044 ListAdd(specs, MkSpecifier(CHAR));
11047 ListAdd(specs, MkSpecifier(SHORT));
11050 ListAdd(specs, MkSpecifier(INT64));
11054 ListAdd(specs, MkSpecifier(INT));
11059 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11061 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11068 if(type->_class && type->_class->string)
11070 if(type->classObjectType == 2)
11071 strcat(string, "typed_object");
11073 strcat(string, type->_class->string);
11076 if(type->_class->registered)
11077 strcat(string, type->_class->registered->name);
11079 strcat(string, type->_class->string);
11086 _PrintType(type->type, string, 0x0, printFunction, fullName);
11087 strcat(string, " *");
11092 strcat(string, "void");
11095 strcat(string, type->isSigned ? "int" : "uint");
11098 strcat(string, type->isSigned ? "int64" : "uint64");
11101 strcat(string, type->isSigned ? "char" : "byte");
11104 strcat(string, type->isSigned ? "short" : "uint16");
11107 strcat(string, "float");
11110 strcat(string, "double");
11115 strcat(string, "struct ");
11116 strcat(string, type->enumName);
11118 else if(type->typeName)
11120 strcat(string, type->typeName);
11124 struct Type * member;
11126 strcat(string, "struct {");
11127 for(member = type->members.first; member; member = member->next)
11129 PrintType(member, string, 0x1, fullName);
11130 strcat(string, "; ");
11132 strcat(string, "}");
11138 strcat(string, "union ");
11139 strcat(string, type->enumName);
11141 else if(type->typeName)
11143 strcat(string, type->typeName);
11147 strcat(string, "union ");
11148 strcat(string, "(unnamed)");
11154 strcat(string, "enum ");
11155 strcat(string, type->enumName);
11157 else if(type->typeName)
11159 strcat(string, type->typeName);
11162 strcat(string, "enum");
11168 if(type->dllExport)
11169 strcat(string, "dllexport ");
11170 PrintType(type->returnType, string, 0x0, fullName);
11171 strcat(string, " ");
11178 strcat(string, type->name);
11181 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11187 strcat(string, name);
11193 struct Type * param;
11195 strcat(string, "(");
11196 for(param = type->params.first; param; param = param->next)
11198 PrintType(param, string, 0x1, fullName);
11200 strcat(string, ", ");
11202 strcat(string, ")");
11209 char baseType[1024], size[256];
11210 struct Type * arrayType = type;
11212 baseType[0] = '\0';
11214 while(arrayType->kind == 12)
11217 if(arrayType->enumClass)
11218 strcat(size, arrayType->enumClass->string);
11219 else if(arrayType->arraySizeExp)
11220 PrintExpression(arrayType->arraySizeExp, size);
11222 arrayType = arrayType->arrayType;
11224 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11225 strcat(string, baseType);
11226 strcat(string, size);
11232 strcat(string, "...");
11235 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11238 strcat(string, "subclass(");
11239 strcat(string, type->_class ? type->_class->string : "int");
11240 strcat(string, ")");
11243 strcat(string, type->templateParameter->identifier->string);
11246 strcat(string, "thisclass");
11249 strcat(string, "__builtin_va_list");
11252 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11254 strcat(string, " ");
11255 strcat(string, type->name);
11260 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11262 struct Type * funcType;
11264 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11266 if(funcType && funcType->kind == 11 && type != funcType)
11268 char typeString[1024];
11269 struct Type * param;
11271 PrintType(funcType->returnType, string, 0x0, fullName);
11272 strcat(string, "(");
11273 _PrintType(type, string, printName, 0x0, fullName);
11274 strcat(string, ")");
11275 strcat(string, "(");
11276 for(param = funcType->params.first; param; param = param->next)
11278 PrintType(param, string, 0x1, fullName);
11280 strcat(string, ", ");
11282 strcat(string, ")");
11285 _PrintType(type, string, printName, 0x1, fullName);
11286 if(type->bitFieldCount)
11290 sprintf(count, ":%d", type->bitFieldCount);
11291 strcat(string, count);
11295 static struct Type * FindMember(struct Type * type, char * string)
11297 struct Type * memberType;
11299 for(memberType = type->members.first; memberType; memberType = memberType->next)
11301 if(!memberType->name)
11303 struct Type * subType = FindMember(memberType, string);
11308 else if(!strcmp(memberType->name, string))
11311 return (((void *)0));
11314 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11316 struct Type * memberType;
11318 for(memberType = type->members.first; memberType; memberType = memberType->next)
11320 if(!memberType->name)
11322 struct Type * subType = FindMember(memberType, string);
11326 *offset += memberType->offset;
11330 else if(!strcmp(memberType->name, string))
11332 *offset += memberType->offset;
11336 return (((void *)0));
11339 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11341 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11343 struct Expression * ParseExpressionString(char * expression)
11345 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11346 ((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));
11347 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11349 parsedExpression = (((void *)0));
11351 expression_yyparse();
11352 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11353 return parsedExpression;
11356 extern char * QMkString(char * source);
11358 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11360 void * __ecereTemp1;
11361 struct Identifier * id = exp->identifier;
11362 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11363 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11364 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11365 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11367 if(_class && _class->type == 4)
11369 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11370 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11374 struct __ecereNameSpace__ecere__com__Class * baseClass;
11376 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11378 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11380 for(value = e->values.first; value; value = value->next)
11382 if(!strcmp(value->name, id->string))
11387 char constant[256];
11389 FreeExpContents(exp);
11391 exp->isConstant = 0x1;
11392 if(!strcmp(baseClass->dataTypeString, "int"))
11393 sprintf(constant, "%d", value->data);
11395 sprintf(constant, "0x%X", value->data);
11396 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11397 exp->expType = MkClassType(baseClass->fullName);
11405 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11407 ProcessMethodType(method);
11408 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));
11411 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11413 if(!prop->dataType)
11414 ProcessPropertyType(prop);
11415 exp->expType = prop->dataType;
11417 prop->dataType->refCount++;
11420 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11422 if(!member->dataType)
11423 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11424 exp->expType = member->dataType;
11425 if(member->dataType)
11426 member->dataType->refCount++;
11429 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11431 if(!classProp->dataType)
11432 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11433 if(classProp->constant)
11435 FreeExpContents(exp);
11436 exp->isConstant = 0x1;
11437 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11440 exp->constant = QMkString((char *)classProp->Get(_class));
11444 char constant[256];
11447 sprintf(constant, "%d", classProp->Get(_class));
11448 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11454 exp->expType = classProp->dataType;
11455 if(classProp->dataType)
11456 classProp->dataType->refCount++;
11462 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11464 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11465 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11466 struct __ecereNameSpace__ecere__com__NameSpace * child;
11470 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)))
11472 data = ScanGlobalData(child, name);
11480 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11482 extern char * strncpy(char * , const char * , int n);
11484 static struct GlobalData * FindGlobalData(char * name)
11487 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11489 nameSpace = globalData;
11490 for(c = 0; name[c]; c++)
11492 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11494 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11495 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11497 strncpy(spaceName, name + start, c - start);
11498 spaceName[c - start] = '\0';
11499 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11500 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11502 return (((void *)0));
11503 nameSpace = newSpace;
11511 return ScanGlobalData(nameSpace, name + start);
11513 return (((void *)0));
11516 static int definedExpStackPos;
11518 static void * definedExpStack[512];
11520 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11522 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11524 FreeExpContents(checkedExp);
11525 FreeType(checkedExp->expType);
11526 FreeType(checkedExp->destType);
11527 *checkedExp = *newExp;
11528 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11529 checkedExp->prev = prev;
11530 checkedExp->next = next;
11533 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11535 extern int printf(char * , ...);
11537 void __ecereMethod_Expression_Clear();
11539 void ApplyAnyObjectLogic(struct Expression * e)
11541 struct Type * destType = e->destType;
11543 if(destType && (destType->classObjectType == 3))
11545 if(e && e->expType)
11547 struct Type * type = e->expType;
11548 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11550 if(type->kind == 8 && type->_class && type->_class->registered)
11552 _class = type->_class->registered;
11554 else if(type->kind == 19)
11556 _class = FindClass("ecere::com::Class")->registered;
11560 char string[1024] = "";
11561 struct Symbol * classSym;
11563 PrintType(type, string, 0x0, 0x1);
11564 classSym = FindClass(string);
11566 _class = classSym->registered;
11568 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)))
11570 if(!_class || strcmp(_class->fullName, "char *"))
11572 struct Expression * checkedExp = e, * newExp;
11574 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11576 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11578 if(checkedExp->type == 25)
11580 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11583 checkedExp = (*checkedExp->list).last;
11585 else if(checkedExp->type == 11)
11586 checkedExp = checkedExp->cast.exp;
11588 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11590 newExp = checkedExp->op.exp2;
11591 checkedExp->op.exp2 = (((void *)0));
11592 FreeExpContents(checkedExp);
11593 if(e->expType && e->expType->passAsTemplate)
11597 ComputeTypeSize(e->expType);
11598 sprintf(size, "%d", e->expType->size);
11599 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))))));
11601 ReplaceExpContents(checkedExp, newExp);
11602 e->byReference = 0x1;
11604 else if(!e->byReference || (_class && _class->type == 5))
11606 struct Expression * checkedExp, * newExp;
11609 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;
11611 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11613 struct Context * context = PushContext();
11614 struct Declarator * decl;
11615 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11616 char typeString[1024];
11617 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11619 typeString[0] = '\0';
11621 newExp->prev = (((void *)0));
11622 newExp->next = (((void *)0));
11623 newExp->expType = (((void *)0));
11624 PrintType(e->expType, typeString, 0x0, 0x1);
11625 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11626 newExp->destType = ProcessType(specs, decl);
11627 curContext = context;
11632 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11634 sprintf(name, "__internalValue%03X", internalValueCounter++);
11635 if(!curCompound->compound.declarations)
11636 curCompound->compound.declarations = MkList();
11637 ListAdd(curCompound->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11638 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11639 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11640 e->compound = MkCompoundStmt((((void *)0)), stmts);
11643 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11645 struct Type * type = e->destType;
11647 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11648 CopyTypeInto(e->destType, type);
11649 e->destType->refCount = 1;
11650 e->destType->classObjectType = 0;
11653 e->compound->compound.context = context;
11654 PopContext(context);
11655 curContext = context->parent;
11659 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11661 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11663 if(checkedExp->type == 25)
11665 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11668 checkedExp = (*checkedExp->list).last;
11670 else if(checkedExp->type == 11)
11671 checkedExp = checkedExp->cast.exp;
11674 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11676 *operand = *checkedExp;
11677 checkedExp->destType = (((void *)0));
11678 checkedExp->expType = (((void *)0));
11679 __ecereMethod_Expression_Clear(checkedExp);
11680 checkedExp->type = 4;
11681 checkedExp->op.op = '&';
11682 checkedExp->op.exp1 = (((void *)0));
11683 checkedExp->op.exp2 = operand;
11692 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))))
11694 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11700 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11703 thisExp->prev = (((void *)0));
11704 thisExp->next = (((void *)0));
11705 __ecereMethod_Expression_Clear(e);
11707 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11708 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11709 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11711 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11712 CopyTypeInto(e->expType, thisExp->expType);
11713 e->expType->byReference = 0x0;
11714 e->expType->refCount = 1;
11715 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))
11717 e->expType->classObjectType = 0;
11722 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11724 if(destType->kind == 14)
11726 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11728 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11730 unsigned int byReference = e->expType->byReference;
11731 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11732 struct Declarator * decl;
11733 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11734 char typeString[1024];
11735 struct Type * type;
11736 int backupClassObjectType;
11738 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11742 backupClassObjectType = type->classObjectType;
11743 type->classObjectType = 0;
11744 typeString[0] = '\0';
11745 PrintType(type, typeString, 0x0, 0x1);
11746 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11747 type->classObjectType = backupClassObjectType;
11749 thisExp->prev = (((void *)0));
11750 thisExp->next = (((void *)0));
11751 __ecereMethod_Expression_Clear(e);
11752 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)))
11756 e->op.exp1 = (((void *)0));
11757 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11762 e->cast.typeName = MkTypeName(specs, decl);
11763 e->cast.exp = thisExp;
11764 e->byReference = 0x1;
11767 e->destType = destType;
11769 destType->refCount++;
11774 extern char * strstr(char * , const char * );
11776 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11778 struct __ecereNameSpace__ecere__com__DefinedExpression
11780 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11781 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11784 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11787 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11789 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11791 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11793 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11795 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11797 extern struct Expression * CopyExpression(struct Expression * exp);
11799 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11801 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11803 static void ProcessStatement(struct Statement * stmt);
11805 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
11807 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11809 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
11811 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11813 void ProcessExpressionType(struct Expression * exp)
11815 void * __ecereTemp2;
11816 void * __ecereTemp1;
11817 unsigned int unresolved = 0x0;
11818 struct Location oldyylloc = yylloc;
11819 unsigned int notByReference = 0x0;
11821 if(!exp || exp->expType)
11828 struct Identifier * id = exp->identifier;
11832 if(id->_class && id->_class->name)
11834 id->classSym = id->_class->symbol;
11836 if(strstr(id->string, "__ecereClass") == id->string)
11838 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11841 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11843 ReplaceClassMembers(exp, thisClass);
11846 ProcessExpressionType(exp);
11849 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11854 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11858 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11864 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11867 ProcessExpressionType(exp);
11871 else if(currentClass && !id->_class)
11873 if(ResolveIdWithClass(exp, currentClass, 0x1))
11876 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11881 struct Type * type = symbol->type;
11882 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11884 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11886 struct Context * context = SetupTemplatesContext(_class);
11888 type = ReplaceThisClassType(_class);
11889 FinishTemplatesContext(context);
11891 type->refCount = 0;
11893 FreeSpecifier(id->_class);
11894 id->_class = (((void *)0));
11895 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11896 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11897 id->classSym = (((void *)0));
11898 exp->expType = type;
11901 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11902 exp->isConstant = 0x1;
11903 if(symbol->isParam || !strcmp(id->string, "this"))
11905 if(_class && _class->type == 1)
11906 exp->byReference = 0x1;
11908 if(symbol->isIterator)
11910 if(symbol->isIterator == 3)
11913 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11914 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11915 exp->expType = (((void *)0));
11916 ProcessExpressionType(exp);
11918 else if(symbol->isIterator != 4)
11921 exp->member.exp = MkExpIdentifier(exp->identifier);
11922 exp->member.exp->expType = exp->expType;
11923 exp->member.member = MkIdentifier("data");
11924 exp->expType = (((void *)0));
11925 ProcessExpressionType(exp);
11932 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11934 if(thisNameSpace && !(id->_class && !id->_class->name))
11938 strcpy(name, thisNameSpace);
11939 strcat(name, "::");
11940 strcat(name, id->string);
11941 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11944 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11949 for(c = 0; c < definedExpStackPos; c++)
11950 if(definedExpStack[c] == definedExp)
11952 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11954 struct Location backupYylloc = yylloc;
11956 definedExpStack[definedExpStackPos++] = definedExp;
11957 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11958 ((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));
11959 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11961 parsedExpression = (((void *)0));
11963 expression_yyparse();
11964 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11965 yylloc = backupYylloc;
11966 if(parsedExpression)
11968 FreeIdentifier(id);
11970 exp->list = MkListOne(parsedExpression);
11971 parsedExpression->loc = yylloc;
11972 ProcessExpressionType(exp);
11973 definedExpStackPos--;
11976 definedExpStackPos--;
11982 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11988 struct GlobalData * data = (((void *)0));
11990 if(thisNameSpace && !(id->_class && !id->_class->name))
11994 strcpy(name, thisNameSpace);
11995 strcat(name, "::");
11996 strcat(name, id->string);
11997 data = FindGlobalData(name);
12000 data = FindGlobalData(id->string);
12003 DeclareGlobalData(data);
12004 exp->expType = data->dataType;
12006 data->dataType->refCount++;
12007 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12008 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12009 FreeSpecifier(id->_class);
12010 id->_class = (((void *)0));
12015 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12017 if(thisNameSpace && !(id->_class && !id->_class->name))
12021 strcpy(name, thisNameSpace);
12022 strcat(name, "::");
12023 strcat(name, id->string);
12024 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12027 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12032 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12033 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12035 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12036 strcpy(name, "__ecereFunction_");
12037 FullClassNameCat(name, id->string, 0x0);
12038 if(DeclareFunction(function, name))
12040 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12041 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12043 exp->expType = function->dataType;
12044 if(function->dataType)
12045 function->dataType->refCount++;
12046 FreeSpecifier(id->_class);
12047 id->_class = (((void *)0));
12059 struct __ecereNameSpace__ecere__com__Class * _class;
12061 if(!exp->instance->_class)
12063 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12065 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12068 ProcessInstantiationType(exp->instance);
12069 exp->isConstant = exp->instance->isConstant;
12070 if(exp->instance->_class)
12072 exp->expType = MkClassType(exp->instance->_class->name);
12080 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12082 exp->expType = type;
12083 if(exp->constant[0] == '\'')
12085 if((int)((unsigned char *)exp->constant)[1] > 127)
12088 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12091 ch = exp->constant[1];
12092 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12093 exp->constant = PrintUInt(ch);
12095 type->_class = FindClass("unichar");
12096 type->isSigned = 0x0;
12101 type->isSigned = 0x1;
12104 else if(strchr(exp->constant, '.'))
12106 char ch = exp->constant[strlen(exp->constant) - 1];
12112 type->isSigned = 0x1;
12116 if(exp->constant[0] == '0' && exp->constant[1])
12117 type->isSigned = 0x0;
12118 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12119 type->isSigned = 0x0;
12120 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12121 type->isSigned = 0x0;
12123 type->isSigned = 0x1;
12126 exp->isConstant = 0x1;
12132 exp->isConstant = 0x1;
12133 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));
12138 ProcessExpressionType(exp->_new.size);
12139 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));
12140 DeclareType(exp->expType->type, 0x0, 0x0);
12144 ProcessExpressionType(exp->_renew.size);
12145 ProcessExpressionType(exp->_renew.exp);
12146 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));
12147 DeclareType(exp->expType->type, 0x0, 0x0);
12151 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12152 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12153 unsigned int useDestType = 0x0, useSideType = 0x0;
12154 struct Location oldyylloc = yylloc;
12155 unsigned int useSideUnit = 0x0;
12156 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12198 if(exp->op.op != '*' || exp->op.exp1)
12205 if(exp->op.op == '&')
12207 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12209 struct Identifier * id = exp->op.exp2->identifier;
12210 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12212 if(symbol && symbol->isIterator == 2)
12215 exp->member.exp = exp->op.exp2;
12216 exp->member.member = MkIdentifier("key");
12217 exp->expType = (((void *)0));
12218 exp->op.exp2->expType = symbol->type;
12219 symbol->type->refCount++;
12220 ProcessExpressionType(exp);
12228 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))
12230 if(exp->op.exp1->destType)
12231 FreeType(exp->op.exp1->destType);
12232 exp->op.exp1->destType = exp->destType;
12234 exp->destType->refCount++;
12238 if(exp->op.exp1->destType)
12239 FreeType(exp->op.exp1->destType);
12240 exp->op.exp1->destType = dummy;
12243 if(exp->op.exp1->destType && exp->op.op != '=')
12244 exp->op.exp1->destType->count++;
12245 ProcessExpressionType(exp->op.exp1);
12246 if(exp->op.exp1->destType && exp->op.op != '=')
12247 exp->op.exp1->destType->count--;
12248 if(exp->op.exp1->destType == dummy)
12251 exp->op.exp1->destType = (((void *)0));
12253 type1 = exp->op.exp1->expType;
12257 char expString[10240];
12259 expString[0] = '\0';
12260 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12264 exp->op.exp2->destType = exp->op.exp1->expType;
12265 if(exp->op.exp1->expType)
12266 exp->op.exp1->expType->refCount++;
12270 exp->op.exp2->destType = exp->destType;
12272 exp->destType->refCount++;
12276 exp->expType = type1;
12281 PrintExpression(exp->op.exp2, expString);
12282 if(type1 && type1->kind == 13)
12284 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)
12285 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12286 else if(exp->op.op == '=')
12288 if(exp->op.exp2->destType)
12289 FreeType(exp->op.exp2->destType);
12290 exp->op.exp2->destType = type1;
12297 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)
12301 if(exp->op.exp2->destType)
12302 FreeType(exp->op.exp2->destType);
12303 exp->op.exp2->destType = type1;
12310 exp->expType = type1;
12312 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)))
12314 if(exp->op.exp2->destType)
12315 FreeType(exp->op.exp2->destType);
12316 exp->op.exp2->destType = exp->destType;
12318 exp->destType->refCount++;
12322 if(exp->op.exp2->destType)
12323 FreeType(exp->op.exp2->destType);
12324 exp->op.exp2->destType = dummy;
12327 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12329 FreeType(exp->op.exp2->destType);
12330 exp->op.exp2->destType = type1;
12333 if(exp->op.exp2->destType && exp->op.op != '=')
12334 exp->op.exp2->destType->count++;
12335 ProcessExpressionType(exp->op.exp2);
12336 if(exp->op.exp2->destType && exp->op.op != '=')
12337 exp->op.exp2->destType->count--;
12338 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12340 if(exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12342 if(exp->op.op != '=' && type1->type->kind == 0)
12343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12345 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)))
12347 if(exp->op.op == ADD_ASSIGN)
12348 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12350 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))
12352 if(exp->op.op == ADD_ASSIGN)
12353 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12355 else if(inCompiler)
12357 char type1String[1024];
12358 char type2String[1024];
12360 type1String[0] = '\0';
12361 type2String[0] = '\0';
12362 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12363 PrintType(type1, type2String, 0x0, 0x1);
12364 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12365 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12368 if(exp->op.exp2->destType == dummy)
12371 exp->op.exp2->destType = (((void *)0));
12373 type2 = exp->op.exp2->expType;
12376 if(exp->op.op == SIZEOF)
12378 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12379 exp->isConstant = 0x1;
12381 else if(exp->op.op == '*' && !exp->op.exp1)
12383 exp->expType = Dereference(type2);
12384 if(type2 && type2->kind == 8)
12385 notByReference = 0x1;
12387 else if(exp->op.op == '&' && !exp->op.exp1)
12388 exp->expType = Reference(type2);
12395 if(exp->op.exp1->destType)
12396 FreeType(exp->op.exp1->destType);
12397 exp->op.exp1->destType = MkClassType("bool");
12398 exp->op.exp1->destType->truth = 0x1;
12399 if(!exp->op.exp1->expType)
12400 ProcessExpressionType(exp->op.exp1);
12402 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12403 FreeType(exp->op.exp1->expType);
12404 exp->op.exp1->expType = MkClassType("bool");
12405 exp->op.exp1->expType->truth = 0x1;
12409 if(exp->op.exp2->destType)
12410 FreeType(exp->op.exp2->destType);
12411 exp->op.exp2->destType = MkClassType("bool");
12412 exp->op.exp2->destType->truth = 0x1;
12413 if(!exp->op.exp2->expType)
12414 ProcessExpressionType(exp->op.exp2);
12416 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12417 FreeType(exp->op.exp2->expType);
12418 exp->op.exp2->expType = MkClassType("bool");
12419 exp->op.exp2->expType->truth = 0x1;
12422 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")))))
12424 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12426 if(exp->op.exp2->destType)
12427 FreeType(exp->op.exp2->destType);
12428 exp->op.exp2->destType = type1;
12430 if(exp->op.exp1->destType)
12431 FreeType(exp->op.exp1->destType);
12432 exp->op.exp1->destType = type2;
12434 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)
12435 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);
12436 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12438 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12442 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12444 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12445 ProcessExpressionType(exp->op.exp1);
12446 if(type2->kind != 13)
12448 ProcessExpressionType(classExp);
12449 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"))))))));
12450 if(!exp->op.exp2->expType)
12451 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12452 ProcessExpressionType(exp->op.exp2);
12456 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12458 if(type1->kind != 8 && type1->type->kind == 0)
12459 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12460 exp->expType = type1;
12464 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12466 if(type2->kind != 8 && type2->type->kind == 0)
12467 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12468 exp->expType = type2;
12472 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))
12474 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12478 unsigned int success = 0x0;
12480 if(type1->kind == 13 && type2->kind == 13)
12482 if(exp->op.op == '+')
12483 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12484 else if(exp->op.op == '-')
12486 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12488 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12490 if(type1->type->kind == 20)
12492 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12496 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12498 ProcessExpressionType(classExp);
12500 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")))))));
12501 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12509 if(!success && exp->op.exp1->type == 2)
12511 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12514 FreeType(exp->expType);
12515 exp->expType = exp->op.exp1->destType;
12516 if(exp->op.exp1->destType)
12517 exp->op.exp1->destType->refCount++;
12520 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12523 FreeType(exp->expType);
12524 exp->expType = exp->op.exp2->destType;
12525 if(exp->op.exp2->destType)
12526 exp->op.exp2->destType->refCount++;
12532 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12535 FreeType(exp->expType);
12536 exp->expType = exp->op.exp2->destType;
12537 if(exp->op.exp2->destType)
12538 exp->op.exp2->destType->refCount++;
12541 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12544 FreeType(exp->expType);
12545 exp->expType = exp->op.exp1->destType;
12546 if(exp->op.exp1->destType)
12547 exp->op.exp1->destType->refCount++;
12553 char expString1[10240];
12554 char expString2[10240];
12558 expString1[0] = '\0';
12559 expString2[0] = '\0';
12564 PrintExpression(exp->op.exp1, expString1);
12565 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12566 PrintExpression(exp->op.exp2, expString2);
12567 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12568 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12569 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12571 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12575 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12577 if(exp->op.exp1->destType)
12578 FreeType(exp->op.exp1->destType);
12579 exp->op.exp1->destType = type2->_class->registered->dataType;
12580 if(type2->_class->registered->dataType)
12581 type2->_class->registered->dataType->refCount++;
12582 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12583 exp->expType = type2;
12587 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12589 if(exp->op.exp2->destType)
12590 FreeType(exp->op.exp2->destType);
12591 exp->op.exp2->destType = type1->_class->registered->dataType;
12592 if(type1->_class->registered->dataType)
12593 type1->_class->registered->dataType->refCount++;
12594 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12595 exp->expType = type1;
12601 unsigned int valid = 0x0;
12603 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12605 if(exp->op.exp2->destType)
12606 FreeType(exp->op.exp2->destType);
12607 if(!type1->_class->registered->dataType)
12608 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12609 exp->op.exp2->destType = type1->_class->registered->dataType;
12610 exp->op.exp2->destType->refCount++;
12611 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12612 type2 = exp->op.exp2->destType;
12613 exp->expType = type2;
12616 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12618 if(exp->op.exp1->destType)
12619 FreeType(exp->op.exp1->destType);
12620 if(!type2->_class->registered->dataType)
12621 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12622 exp->op.exp1->destType = type2->_class->registered->dataType;
12623 exp->op.exp1->destType->refCount++;
12624 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12625 type1 = exp->op.exp1->destType;
12626 exp->expType = type1;
12629 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12631 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12633 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12636 FreeType(exp->expType);
12637 exp->expType = exp->op.exp1->expType;
12638 if(exp->op.exp2->expType)
12639 exp->op.exp1->expType->refCount++;
12643 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12645 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12648 FreeType(exp->expType);
12649 exp->expType = exp->op.exp2->expType;
12650 if(exp->op.exp2->expType)
12651 exp->op.exp2->expType->refCount++;
12658 if(exp->op.exp2->destType)
12659 FreeType(exp->op.exp2->destType);
12660 exp->op.exp2->destType = type1;
12662 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12665 FreeType(exp->expType);
12666 exp->expType = exp->op.exp2->destType;
12667 if(exp->op.exp2->destType)
12668 exp->op.exp2->destType->refCount++;
12670 else if(type1 && type2)
12672 char expString1[10240];
12673 char expString2[10240];
12674 char type1String[1024];
12675 char type2String[1024];
12677 expString1[0] = '\0';
12678 expString2[0] = '\0';
12679 type1String[0] = '\0';
12680 type2String[0] = '\0';
12683 PrintExpression(exp->op.exp1, expString1);
12684 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12685 PrintExpression(exp->op.exp2, expString2);
12686 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12687 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12688 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12690 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12691 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12693 exp->expType = exp->op.exp1->expType;
12694 if(exp->op.exp1->expType)
12695 exp->op.exp1->expType->refCount++;
12697 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12699 exp->expType = exp->op.exp2->expType;
12700 if(exp->op.exp2->expType)
12701 exp->op.exp2->expType->refCount++;
12708 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12710 struct Type * oldType = exp->op.exp1->expType;
12712 exp->op.exp1->expType = (((void *)0));
12713 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12716 exp->op.exp1->expType = oldType;
12718 if(exp->op.exp1->destType)
12719 FreeType(exp->op.exp1->destType);
12720 exp->op.exp1->destType = type2;
12722 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12725 FreeType(exp->expType);
12726 exp->expType = exp->op.exp1->destType;
12727 if(exp->op.exp1->destType)
12728 exp->op.exp1->destType->refCount++;
12732 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12734 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12736 if(exp->op.exp1->destType)
12737 FreeType(exp->op.exp1->destType);
12738 exp->op.exp1->destType = type2->_class->registered->dataType;
12739 if(type2->_class->registered->dataType)
12740 type2->_class->registered->dataType->refCount++;
12741 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12743 if(exp->op.op == '!')
12745 exp->expType = MkClassType("bool");
12746 exp->expType->truth = 0x1;
12750 exp->expType = type2;
12755 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12757 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12759 if(exp->op.exp2->destType)
12760 FreeType(exp->op.exp2->destType);
12761 exp->op.exp2->destType = type1->_class->registered->dataType;
12762 if(type1->_class->registered->dataType)
12763 type1->_class->registered->dataType->refCount++;
12764 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12766 exp->expType = type1;
12772 if(exp->op.exp1 && !exp->op.exp1->expType)
12774 char expString[10000];
12776 expString[0] = '\0';
12779 PrintExpression(exp->op.exp1, expString);
12780 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12783 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12785 if(exp->op.exp2 && !exp->op.exp2->expType)
12787 char expString[10240];
12789 expString[0] = '\0';
12792 PrintExpression(exp->op.exp2, expString);
12793 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12796 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12800 FreeType(exp->expType);
12801 exp->expType = MkClassType("bool");
12802 exp->expType->truth = 0x1;
12804 if(exp->op.op != SIZEOF)
12805 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12806 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12808 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12810 yylloc = oldyylloc;
12817 struct Expression * e;
12819 exp->isConstant = 0x1;
12820 for(e = (*exp->list).first; e; e = e->next)
12822 unsigned int inced = 0x0;
12826 FreeType(e->destType);
12827 e->destType = exp->destType;
12830 exp->destType->refCount++;
12831 e->destType->count++;
12835 ProcessExpressionType(e);
12837 exp->destType->count--;
12838 if(!exp->expType && !e->next)
12840 exp->expType = e->expType;
12842 e->expType->refCount++;
12845 exp->isConstant = 0x0;
12847 e = (*exp->list).first;
12848 if(!e->next && e->type == 8)
12850 struct Expression * next = exp->next, * prev = exp->prev;
12852 FreeType(exp->expType);
12853 FreeType(exp->destType);
12854 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12858 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12859 ProcessExpressionType(exp);
12865 struct Expression * e;
12867 exp->isConstant = 0x1;
12868 ProcessExpressionType(exp->index.exp);
12869 if(!exp->index.exp->isConstant)
12870 exp->isConstant = 0x0;
12871 if(exp->index.exp->expType)
12873 struct Type * source = exp->index.exp->expType;
12875 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)
12877 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12879 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12880 if(exp->index.index && (*exp->index.index).last)
12882 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12886 for(e = (*exp->index.index).first; e; e = e->next)
12888 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12891 FreeType(e->destType);
12892 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12894 ProcessExpressionType(e);
12899 exp->isConstant = 0x0;
12902 exp->expType = Dereference(exp->index.exp->expType);
12904 DeclareType(exp->expType, 0x0, 0x0);
12909 struct Expression * e;
12910 struct Type * functionType;
12911 struct Type * methodType = (((void *)0));
12917 PrintExpression(exp->call.exp, name);
12918 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12920 PrintExpression(exp->call.exp, name);
12923 if(exp->call.exp->type == 0)
12925 struct Expression * idExp = exp->call.exp;
12926 struct Identifier * id = idExp->identifier;
12928 if(!strcmp(id->string, "__ENDIAN_PAD"))
12930 exp->expType = ProcessTypeString("int", 0x1);
12931 if(exp->call.arguments && (*exp->call.arguments).first)
12932 ProcessExpressionType((*exp->call.arguments).first);
12935 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12937 struct Expression * a = (((void *)0));
12938 struct Expression * b = (((void *)0));
12939 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12941 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12943 a = (*exp->call.arguments).first;
12944 b = (*exp->call.arguments).last;
12948 else if((*exp->call.arguments).count == 1)
12950 a = (*exp->call.arguments).first;
12955 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12956 idExp->identifier = (((void *)0));
12957 FreeExpContents(exp);
12958 ProcessExpressionType(a);
12960 ProcessExpressionType(b);
12962 exp->list = MkList();
12963 if(a->expType && (!b || b->expType))
12965 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12969 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12970 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12971 struct Declaration * decl;
12972 char temp1[1024], temp2[1024];
12974 GetTypeSpecs(a->expType, specs);
12975 if(a && !a->isConstant && a->type != 0)
12977 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12978 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12979 tempExp1 = QMkExpId(temp1);
12980 tempExp1->expType = a->expType;
12982 a->expType->refCount++;
12983 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12985 if(b && !b->isConstant && b->type != 0)
12987 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12988 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12989 tempExp2 = QMkExpId(temp2);
12990 tempExp2->expType = b->expType;
12992 b->expType->refCount++;
12993 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12995 decl = MkDeclaration(specs, decls);
12996 if(!curCompound->compound.declarations)
12997 curCompound->compound.declarations = MkList();
12998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13002 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13004 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13006 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13007 exp->expType = a->expType;
13009 a->expType->refCount++;
13011 else if(!strcmp(id->string, "Abs"))
13013 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13014 exp->expType = a->expType;
13016 a->expType->refCount++;
13018 else if(!strcmp(id->string, "Sgn"))
13020 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"))))));
13021 exp->expType = ProcessTypeString("int", 0x0);
13023 FreeExpression(tempExp1);
13025 FreeExpression(tempExp2);
13026 FreeIdentifier(id);
13032 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13034 if(!exp->call.exp->destType)
13036 exp->call.exp->destType = dummy;
13039 ProcessExpressionType(exp->call.exp);
13040 if(exp->call.exp->destType == dummy)
13043 exp->call.exp->destType = (((void *)0));
13047 functionType = exp->call.exp->expType;
13048 if(functionType && functionType->kind == 16)
13050 methodType = functionType;
13051 functionType = methodType->method->dataType;
13052 if(exp->call.exp->expType->usedClass)
13054 char typeString[1024];
13056 typeString[0] = '\0';
13057 PrintType(functionType, typeString, 0x1, 0x1);
13058 if(strstr(typeString, "thisclass"))
13060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13061 struct Declarator * decl;
13064 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13066 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13067 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13068 thisClassParams = 0x0;
13069 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13071 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13073 thisClass = exp->call.exp->expType->usedClass;
13074 ProcessDeclarator(decl);
13075 thisClass = backupThisClass;
13077 thisClassParams = 0x1;
13078 functionType = ProcessType(specs, decl);
13079 functionType->refCount = 0;
13080 FinishTemplatesContext(context);
13082 FreeList(specs, FreeSpecifier);
13083 FreeDeclarator(decl);
13087 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13089 struct Type * type = functionType->type;
13091 if(!functionType->refCount)
13093 functionType->type = (((void *)0));
13094 FreeType(functionType);
13096 functionType = type;
13098 if(functionType && functionType->kind != 11)
13100 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13102 else if(functionType)
13104 unsigned int emptyParams = 0x0, noParams = 0x0;
13105 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13106 struct Type * type = functionType->params.first;
13107 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13109 struct Location oldyylloc = yylloc;
13113 if(functionType->extraParam && e)
13115 e->destType = MkClassType(functionType->thisClass->string);
13118 if(!functionType->staticMethod)
13120 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13122 type = MkClassType(memberExp->member.exp->expType->_class->string);
13125 e->destType = type;
13127 type = functionType->params.first;
13130 type->refCount = 0;
13132 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13134 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13137 e->destType = type;
13139 type = functionType->params.first;
13142 type->refCount = 0;
13145 if(type && type->kind == 0)
13148 if(!type->refCount)
13150 type = (((void *)0));
13152 for(; e; e = e->next)
13154 if(!type && !emptyParams)
13157 if(methodType && methodType->methodClass)
13158 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);
13160 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);
13163 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13165 struct Type * templatedType = (((void *)0));
13166 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13167 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13170 if(_class && _class->templateArgs)
13172 struct __ecereNameSpace__ecere__com__Class * sClass;
13174 for(sClass = _class; sClass; sClass = sClass->base)
13176 if(sClass->templateClass)
13177 sClass = sClass->templateClass;
13179 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13181 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13183 struct __ecereNameSpace__ecere__com__Class * nextClass;
13185 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13187 if(nextClass->templateClass)
13188 nextClass = nextClass->templateClass;
13189 id += nextClass->templateParams.count;
13199 if(curParam && _class->templateArgs[id].dataTypeString)
13201 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13204 struct Context * context = SetupTemplatesContext(_class);
13206 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13207 FinishTemplatesContext(context);
13209 e->destType = templatedType;
13212 templatedType->passAsTemplate = 0x1;
13217 e->destType = type;
13224 e->destType = type;
13228 if(type && type->kind != 14)
13230 struct Type * next = type->next;
13232 if(!type->refCount)
13237 if(type && type->kind != 14)
13239 if(methodType && methodType->methodClass)
13240 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);
13242 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);
13244 yylloc = oldyylloc;
13245 if(type && !type->refCount)
13250 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13251 if(exp->call.exp->type == 0)
13253 char * string = exp->call.exp->identifier->string;
13257 struct Symbol * symbol;
13258 struct Location oldyylloc = yylloc;
13260 yylloc = exp->call.exp->identifier->loc;
13261 if(strstr(string, "__builtin_") == string)
13264 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13265 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));
13266 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13267 if(strstr(symbol->string, "::"))
13268 globalContext->hasNameSpace = 0x1;
13269 yylloc = oldyylloc;
13272 else if(exp->call.exp->type == 8)
13276 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13277 if(!functionType->returnType)
13279 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13282 if(functionType && functionType->kind == 11)
13284 exp->expType = functionType->returnType;
13285 if(functionType->returnType)
13286 functionType->returnType->refCount++;
13287 if(!functionType->refCount)
13288 FreeType(functionType);
13290 if(exp->call.arguments)
13292 for(e = (*exp->call.arguments).first; e; e = e->next)
13294 struct Type * destType = e->destType;
13296 ProcessExpressionType(e);
13303 struct Type * type;
13304 struct Location oldyylloc = yylloc;
13305 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13307 exp->thisPtr = thisPtr;
13308 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13310 exp->member.member->classSym = exp->member.member->_class->symbol;
13312 ProcessExpressionType(exp->member.exp);
13313 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)
13315 exp->isConstant = 0x0;
13318 exp->isConstant = exp->member.exp->isConstant;
13319 type = exp->member.exp->expType;
13321 if(type && (type->kind == 20))
13323 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13324 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13328 for(param = _class->templateParams.first; param; param = param->next)
13330 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13334 if(param && param->defaultArg.member)
13336 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13340 struct Expression * expMember = exp->member.exp;
13341 struct Declarator * decl;
13342 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13343 char thisClassTypeString[1024];
13345 FreeIdentifier(exp->member.member);
13346 ProcessExpressionType(argExp);
13348 char * colon = strstr(param->defaultArg.memberString, "::");
13352 char className[1024];
13353 struct __ecereNameSpace__ecere__com__Class * sClass;
13355 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13356 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13359 strcpy(thisClassTypeString, _class->fullName);
13361 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13362 exp->expType = ProcessType(specs, decl);
13363 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13365 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13366 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13368 int paramCount = 0;
13369 int lastParam = -1;
13370 char templateString[1024];
13371 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13373 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13374 for(cClass = expClass; cClass; cClass = cClass->base)
13378 for(param = cClass->templateParams.first; param; param = param->next)
13381 struct __ecereNameSpace__ecere__com__Class * sClass;
13382 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13384 for(sClass = cClass->base; sClass; sClass = sClass->base)
13385 id += sClass->templateParams.count;
13386 arg = expClass->templateArgs[id];
13387 for(sClass = _class; sClass; sClass = sClass->base)
13389 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13391 struct __ecereNameSpace__ecere__com__Class * nextClass;
13393 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13394 p += nextClass->templateParams.count;
13395 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13397 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13399 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13401 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13402 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13409 char argument[256];
13411 argument[0] = '\0';
13412 switch(param->type)
13416 char expString[1024];
13417 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13418 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13419 struct Expression * exp;
13420 char * string = PrintHexUInt64(arg.expression.ui64);
13422 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13423 ProcessExpressionType(exp);
13424 ComputeExpression(exp);
13425 expString[0] = '\0';
13426 PrintExpression(exp, expString);
13427 strcat(argument, expString);
13428 FreeExpression(exp);
13433 strcat(argument, arg.member->name);
13438 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13440 if(!strcmp(arg.dataTypeString, "thisclass"))
13441 strcat(argument, thisClassTypeString);
13443 strcat(argument, arg.dataTypeString);
13451 strcat(templateString, ", ");
13452 if(lastParam != p - 1)
13454 strcat(templateString, param->name);
13455 strcat(templateString, " = ");
13457 strcat(templateString, argument);
13466 int len = strlen(templateString);
13468 if(templateString[len - 1] == '>')
13469 templateString[len++] = ' ';
13470 templateString[len++] = '>';
13471 templateString[len++] = '\0';
13474 struct Context * context = SetupTemplatesContext(_class);
13476 FreeType(exp->expType);
13477 exp->expType = ProcessTypeString(templateString, 0x0);
13478 FinishTemplatesContext(context);
13482 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")))))))));
13485 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13487 type = ProcessTemplateParameterType(type->templateParameter);
13490 if(type && (type->kind == 20))
13492 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13494 struct Identifier * id = exp->member.member;
13495 int typeKind = type->kind;
13496 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));
13498 if(typeKind == 19 && exp->member.exp->type == 26)
13500 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13503 if(id && (typeKind == 3 || typeKind == 15))
13504 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13507 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13508 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13509 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13510 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13511 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13513 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13514 exp->member.memberType = 1;
13515 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13516 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13519 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13521 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13522 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13524 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13526 member = (((void *)0));
13528 if(!member && !prop)
13529 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13530 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13531 exp->member.thisPtr = 0x1;
13537 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13538 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13539 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13541 if(!prop && !member)
13543 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13546 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13547 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13548 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13553 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13554 prop = (((void *)0));
13556 member = (((void *)0));
13560 if(!prop && !member)
13561 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13562 if(!prop && !member && !method)
13566 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13569 exp->member.memberType = 5;
13570 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13574 char structName[1024];
13575 struct Identifier * id = exp->member.member;
13576 struct Expression * classExp = exp->member.exp;
13579 FreeType(classExp->expType);
13580 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13581 strcpy(structName, "__ecereClassData_");
13582 FullClassNameCat(structName, type->_class->string, 0x0);
13584 exp->member.member = id;
13585 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"))))))));
13587 ProcessExpressionType(exp);
13593 struct Symbol * classSym = FindClass(id->string);
13597 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13600 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13606 exp->member.memberType = 1;
13607 if(!prop->dataType)
13608 ProcessPropertyType(prop);
13609 exp->expType = prop->dataType;
13611 prop->dataType->refCount++;
13615 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13617 FreeExpContents(exp);
13619 exp->identifier = MkIdentifier("class");
13620 ProcessExpressionType(exp);
13623 exp->member.memberType = 3;
13624 DeclareStruct(_class->fullName, 0x0);
13625 if(!member->dataType)
13627 struct Context * context = SetupTemplatesContext(_class);
13629 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13630 FinishTemplatesContext(context);
13632 exp->expType = member->dataType;
13633 if(member->dataType)
13634 member->dataType->refCount++;
13636 else if(revConvert)
13638 exp->member.memberType = 4;
13639 exp->expType = MkClassType(revConvert->_class->fullName);
13645 exp->member.memberType = 2;
13647 if(!method->dataType)
13648 ProcessMethodType(method);
13649 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));
13650 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13651 exp->expType->usedClass = _class;
13653 else if(!classProp)
13655 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13657 FreeExpContents(exp);
13659 exp->identifier = MkIdentifier("class");
13660 ProcessExpressionType(exp);
13663 yylloc = exp->member.member->loc;
13664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13666 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13668 if(_class && exp->expType)
13670 struct __ecereNameSpace__ecere__com__Class * tClass;
13673 while(tClass && !tClass->templateClass)
13674 tClass = tClass->base;
13675 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13678 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13679 struct __ecereNameSpace__ecere__com__Class * sClass;
13681 for(sClass = tClass; sClass; sClass = sClass->base)
13684 if(sClass->templateClass)
13685 sClass = sClass->templateClass;
13686 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13688 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13690 for(sClass = sClass->base; sClass; sClass = sClass->base)
13691 id += sClass->templateParams.count;
13699 if(curParam && tClass->templateArgs[id].dataTypeString)
13701 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13702 struct Context * context = SetupTemplatesContext(tClass);
13704 FreeType(exp->expType);
13705 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13708 if(exp->expType->kind == 21)
13710 FreeType(exp->expType);
13711 exp->expType = ReplaceThisClassType(_class);
13713 if(tClass->templateClass)
13714 exp->expType->passAsTemplate = 0x1;
13717 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13718 if(exp->destType->kind == 21)
13720 FreeType(exp->destType);
13721 exp->destType = ReplaceThisClassType(_class);
13725 FinishTemplatesContext(context);
13728 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13731 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13732 struct __ecereNameSpace__ecere__com__Class * sClass;
13734 for(sClass = tClass; sClass; sClass = sClass->base)
13737 if(sClass->templateClass)
13738 sClass = sClass->templateClass;
13739 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13741 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13743 for(sClass = sClass->base; sClass; sClass = sClass->base)
13744 id += sClass->templateParams.count;
13754 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13755 struct Context * context = SetupTemplatesContext(tClass);
13756 struct Type * basicType;
13758 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13761 if(basicType->kind == 21)
13763 FreeType(basicType);
13764 basicType = ReplaceThisClassType(_class);
13766 FreeType(exp->expType);
13767 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));
13770 exp->destType = exp->expType;
13771 exp->destType->refCount++;
13774 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13776 struct Declarator * decl;
13778 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13781 exp->destType->refCount++;
13783 exp->expType->refCount++;
13785 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13786 exp->cast.exp = newExp;
13789 FinishTemplatesContext(context);
13792 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13794 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13798 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13801 int paramCount = 0;
13802 int lastParam = -1;
13803 char templateString[1024];
13804 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13806 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13807 while(cClass != expClass)
13809 struct __ecereNameSpace__ecere__com__Class * sClass;
13811 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13814 for(param = cClass->templateParams.first; param; param = param->next)
13816 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13819 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13820 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13822 while(cClassCur != tClass && !paramCur)
13824 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13826 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13828 cClassCur = sClassCur;
13829 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13831 if(!strcmp(paramCur->name, param->name))
13838 if(paramCur && paramCur->type == 0)
13839 arg = tClass->templateArgs[cp];
13841 arg = expClass->templateArgs[p];
13843 char argument[256];
13845 argument[0] = '\0';
13846 switch(param->type)
13850 char expString[1024];
13851 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13852 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13853 struct Expression * exp;
13854 char * string = PrintHexUInt64(arg.expression.ui64);
13856 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13857 ProcessExpressionType(exp);
13858 ComputeExpression(exp);
13859 expString[0] = '\0';
13860 PrintExpression(exp, expString);
13861 strcat(argument, expString);
13862 FreeExpression(exp);
13867 strcat(argument, arg.member->name);
13872 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13873 strcat(argument, arg.dataTypeString);
13880 strcat(templateString, ", ");
13881 if(lastParam != p - 1)
13883 strcat(templateString, param->name);
13884 strcat(templateString, " = ");
13886 strcat(templateString, argument);
13895 int len = strlen(templateString);
13897 if(templateString[len - 1] == '>')
13898 templateString[len++] = ' ';
13899 templateString[len++] = '>';
13900 templateString[len++] = '\0';
13902 FreeType(exp->expType);
13904 struct Context * context = SetupTemplatesContext(tClass);
13906 exp->expType = ProcessTypeString(templateString, 0x0);
13907 FinishTemplatesContext(context);
13914 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)");
13916 else if(type && (type->kind == 9 || type->kind == 10))
13918 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13922 exp->expType = memberType;
13924 memberType->refCount++;
13929 char expString[10240];
13931 expString[0] = '\0';
13934 PrintExpression(exp, expString);
13935 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13939 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13941 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13943 struct Identifier * id = exp->member.member;
13944 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));
13948 FreeType(exp->expType);
13949 exp->expType = ReplaceThisClassType(_class);
13953 yylloc = oldyylloc;
13958 struct Type * destType = exp->destType;
13960 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13962 exp->member.member->classSym = exp->member.member->_class->symbol;
13964 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13968 ProcessExpressionType(exp);
13975 struct Symbol * classSym = exp->_class->symbol;
13977 if(classSym && classSym->registered)
13979 if(classSym->registered->type == 5)
13984 DeclareStruct(classSym->string, 0x0);
13985 FreeSpecifier(exp->_class);
13987 FullClassNameCat(name, classSym->string, 0x0);
13988 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13992 if(classSym->registered->fixed)
13994 FreeSpecifier(exp->_class);
13995 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14000 char className[1024];
14002 strcpy(className, "__ecereClass_");
14003 FullClassNameCat(className, classSym->string, 0x1);
14004 MangleClassName(className);
14005 DeclareClass(classSym, className);
14006 FreeExpContents(exp);
14008 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14009 exp->member.member = MkIdentifier("structSize");
14013 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14018 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14020 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14021 exp->isConstant = 0x1;
14022 DeclareType(type, 0x0, 0x0);
14028 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14030 type->count = (unsigned int)1;
14031 FreeType(exp->cast.exp->destType);
14032 exp->cast.exp->destType = type;
14034 ProcessExpressionType(exp->cast.exp);
14035 type->count = (unsigned int)0;
14036 exp->expType = type;
14037 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14039 void * prev = exp->prev, * next = exp->next;
14040 struct Type * expType = exp->cast.exp->destType;
14041 struct Expression * castExp = exp->cast.exp;
14042 struct Type * destType = exp->destType;
14045 expType->refCount++;
14046 FreeType(exp->expType);
14047 FreeTypeName(exp->cast.typeName);
14049 FreeType(exp->expType);
14050 FreeType(exp->destType);
14051 exp->expType = expType;
14052 exp->destType = destType;
14053 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14059 exp->isConstant = exp->cast.exp->isConstant;
14065 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14068 exp->expType = type;
14073 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14075 ProcessExpressionType(exp->vaArg.exp);
14077 exp->expType = type;
14082 struct Expression * e;
14084 exp->isConstant = 0x1;
14085 FreeType(exp->cond.cond->destType);
14086 exp->cond.cond->destType = MkClassType("bool");
14087 exp->cond.cond->destType->truth = 0x1;
14088 ProcessExpressionType(exp->cond.cond);
14089 if(!exp->cond.cond->isConstant)
14090 exp->isConstant = 0x0;
14091 for(e = (*exp->cond.exp).first; e; e = e->next)
14095 FreeType(e->destType);
14096 e->destType = exp->destType;
14098 e->destType->refCount++;
14100 ProcessExpressionType(e);
14103 exp->expType = e->expType;
14105 e->expType->refCount++;
14108 exp->isConstant = 0x0;
14110 FreeType(exp->cond.elseExp->destType);
14111 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14112 if(exp->cond.elseExp->destType)
14113 exp->cond.elseExp->destType->refCount++;
14114 ProcessExpressionType(exp->cond.elseExp);
14115 if(!exp->cond.elseExp->isConstant)
14116 exp->isConstant = 0x0;
14121 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14123 struct Statement * last = (*exp->compound->compound.statements).last;
14125 if(last->type == 3 && last->expressions && (*last->expressions).last)
14127 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14129 exp->destType->refCount++;
14131 ProcessStatement(exp->compound);
14132 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14133 if(((struct Expression *)(*last->expressions).last)->expType)
14134 exp->expType->refCount++;
14140 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14142 if(spec && spec->type == 1)
14144 exp->expType = MkClassType(spec->name);
14145 exp->expType->kind = 19;
14146 exp->byReference = 0x1;
14150 exp->expType = MkClassType("ecere::com::Class");
14151 exp->byReference = 0x1;
14157 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14161 struct Identifier * id = exp->classData.id;
14162 char structName[1024];
14163 struct Expression * classExp;
14165 strcpy(structName, "__ecereClassData_");
14166 FullClassNameCat(structName, _class->fullName, 0x0);
14168 exp->member.member = id;
14169 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14170 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14172 classExp = MkExpIdentifier(MkIdentifier("class"));
14173 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"))))))));
14174 ProcessExpressionType(exp);
14181 struct Type * type = (((void *)0));
14182 char * typeString = (((void *)0));
14183 char typeStringBuf[1024];
14185 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))
14187 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14189 typeString = templateClass->templateArgs[2].dataTypeString;
14193 struct Expression * e;
14195 for(e = (*exp->list).first; e; e = e->next)
14197 ProcessExpressionType(e);
14207 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14211 e->expType = (((void *)0));
14212 e = (*exp->list).first;
14213 ProcessExpressionType(e);
14216 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14218 FreeType(e->expType);
14219 e->expType = (((void *)0));
14221 type = (((void *)0));
14229 FreeType(e->expType);
14230 e->expType = (((void *)0));
14236 typeStringBuf[0] = '\0';
14237 PrintType(type, typeStringBuf, 0x0, 0x1);
14238 typeString = typeStringBuf;
14240 type = (((void *)0));
14245 char templateString[1024];
14246 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14247 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14248 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14249 struct Expression * expExt;
14250 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14252 sprintf(templateString, "Container<%s>", typeString);
14255 struct Expression * e;
14257 type = ProcessTypeString(typeString, 0x0);
14258 while(e = (*exp->list).first)
14260 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14261 e->destType = type;
14263 ProcessExpressionType(e);
14264 ListAdd(initializers, MkInitializerAssignment(e));
14267 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14269 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14270 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14271 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14272 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14273 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14274 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14275 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14276 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14277 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14278 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))));
14279 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14280 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14281 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14282 exp->expType = ProcessTypeString(templateString, 0x0);
14284 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14285 ProcessExpressionType(expExt);
14289 exp->expType = ProcessTypeString("Container", 0x0);
14290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14295 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14297 FreeType(exp->expType);
14298 exp->expType = ReplaceThisClassType(thisClass);
14300 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14302 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14306 if(exp->expType->kind != 15)
14308 struct Type * member;
14309 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14311 FreeType(exp->expType);
14312 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14313 exp->expType->kind = symbol->type->kind;
14314 exp->expType->refCount++;
14315 exp->expType->enumName = enumName;
14316 exp->expType->members = symbol->type->members;
14317 for(member = symbol->type->members.first; member; member = member->next)
14318 member->refCount++;
14322 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14324 for(member = symbol->type->members.first; member; member = member->next)
14326 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14328 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14334 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14336 else if(exp->destType && !exp->destType->keepCast)
14338 if(!CheckExpressionType(exp, exp->destType, 0x0))
14340 if(!exp->destType->count || unresolved)
14345 if(exp->destType->kind != 14)
14352 char expString[10240];
14354 expString[0] = '\0';
14355 PrintType(exp->destType, type2, 0x0, 0x1);
14358 PrintExpression(exp, expString);
14359 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14362 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14363 else if(exp->type != 16)
14364 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14369 char expString[10240];
14371 expString[0] = '\0';
14374 PrintExpression(exp, expString);
14375 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14379 else if(exp->type != 16)
14380 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14392 PrintType(exp->expType, type1, 0x0, 0x1);
14393 PrintType(exp->destType, type2, 0x0, 0x1);
14395 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)))
14399 char expString[10240];
14401 expString[0] = '\0';
14404 PrintExpression(exp, expString);
14405 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14407 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14408 FreeType(exp->expType);
14409 exp->destType->refCount++;
14410 exp->expType = exp->destType;
14415 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14417 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14418 char typeString[1024];
14419 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14420 struct Declarator * decl;
14422 typeString[0] = '\0';
14425 exp->expType->refCount++;
14427 exp->expType->refCount++;
14429 newExp->destType = exp->expType;
14430 PrintType(exp->expType, typeString, 0x0, 0x0);
14431 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14432 exp->cast.typeName = MkTypeName(specs, decl);
14433 exp->cast.exp = newExp;
14436 else if(unresolved)
14438 if(exp->identifier->_class && exp->identifier->_class->name)
14439 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14440 else if(exp->identifier->string && exp->identifier->string[0])
14441 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14443 else if(!exp->expType && exp->type != 16)
14445 char expString[10240];
14447 expString[0] = '\0';
14450 PrintExpression(exp, expString);
14451 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14453 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14455 ApplyAnyObjectLogic(exp);
14456 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14458 exp->byReference = 0x1;
14460 yylloc = oldyylloc;
14463 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)
14467 *curMember = (*curMember)->next;
14468 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14470 *curMember = subMemberStack[--(*subMemberStackPos)];
14471 *curMember = (*curMember)->next;
14473 while((*curMember) && (*curMember)->isProperty)
14474 *curMember = (*curMember)->next;
14475 if(subMemberStackPos)
14477 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14479 subMemberStack[(*subMemberStackPos)++] = *curMember;
14480 *curMember = (*curMember)->members.first;
14481 while(*curMember && (*curMember)->isProperty)
14482 *curMember = (*curMember)->next;
14490 if(subMemberStackPos && *subMemberStackPos)
14492 *curMember = subMemberStack[--(*subMemberStackPos)];
14493 *curMember = (*curMember)->next;
14497 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14499 if(*curClass == _class)
14501 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14503 *curMember = (*curClass)->membersAndProperties.first;
14505 while((*curMember) && (*curMember)->isProperty)
14506 *curMember = (*curMember)->next;
14507 if(subMemberStackPos)
14509 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14511 subMemberStack[(*subMemberStackPos)++] = *curMember;
14512 *curMember = (*curMember)->members.first;
14513 while(*curMember && (*curMember)->isProperty)
14514 *curMember = (*curMember)->next;
14521 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14526 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14528 if(init->exp && !init->exp->destType)
14530 FreeType(init->exp->destType);
14531 init->exp->destType = type;
14537 ProcessExpressionType(init->exp);
14538 init->isConstant = init->exp->isConstant;
14544 struct Expression * exp = init->exp;
14545 struct Instantiation * inst = exp->instance;
14546 struct MembersInit * members;
14549 init->list = MkList();
14552 for(members = (*inst->members).first; members; members = members->next)
14554 if(members->type == 0)
14556 struct MemberInit * member;
14558 for(member = (*members->dataMembers).first; member; member = member->next)
14560 ListAdd(init->list, member->initializer);
14561 member->initializer = (((void *)0));
14566 FreeExpression(exp);
14570 struct Initializer * i;
14571 struct Type * initializerType = (((void *)0));
14572 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14573 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14574 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14575 int subMemberStackPos = 0;
14577 if(type && type->kind == 12)
14578 initializerType = Dereference(type);
14579 else if(type && (type->kind == 9 || type->kind == 10))
14580 initializerType = type->members.first;
14581 for(i = (*init->list).first; i; i = i->next)
14583 if(type && type->kind == 8 && type->_class && type->_class->registered)
14585 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14588 if(!curMember->dataType)
14589 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14590 initializerType = curMember->dataType;
14593 ProcessInitializer(i, initializerType);
14594 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14595 initializerType = initializerType->next;
14597 init->isConstant = 0x0;
14599 if(type && type->kind == 12)
14600 FreeType(initializerType);
14601 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14610 extern struct Symbol * FindType(struct Context * ctx, char * name);
14612 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14614 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14620 if(spec->specifier == THISCLASS)
14625 spec->name = ReplaceThisClass(thisClass);
14626 spec->symbol = FindClass(spec->name);
14627 ProcessSpecifier(spec, declareStruct);
14634 struct Symbol * symbol = FindType(curContext, spec->name);
14637 DeclareType(symbol->type, 0x1, 0x1);
14638 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14639 DeclareStruct(spec->name, 0x0);
14644 struct Enumerator * e;
14648 for(e = (*spec->list).first; e; e = e->next)
14651 ProcessExpressionType(e->exp);
14659 if(spec->definitions)
14661 struct ClassDef * def;
14662 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14664 ProcessClass(spec->definitions, symbol);
14671 static void ProcessDeclarator(struct Declarator * decl)
14676 if(decl->identifier->classSym)
14678 FreeSpecifier(decl->identifier->_class);
14679 decl->identifier->_class = (((void *)0));
14683 if(decl->array.exp)
14684 ProcessExpressionType(decl->array.exp);
14691 if(decl->declarator)
14692 ProcessDeclarator(decl->declarator);
14693 if(decl->type == 4)
14695 struct Identifier * id = GetDeclId(decl);
14697 if(id && id->_class)
14699 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14701 if(!decl->function.parameters)
14702 decl->function.parameters = MkList();
14703 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14704 id->_class = (((void *)0));
14706 if(decl->function.parameters)
14708 struct TypeName * param;
14710 for(param = (*decl->function.parameters).first; param; param = param->next)
14712 if(param->qualifiers && (*param->qualifiers).first)
14714 struct Specifier * spec = (*param->qualifiers).first;
14716 if(spec && spec->specifier == TYPED_OBJECT)
14718 struct Declarator * d = param->declarator;
14719 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);
14721 FreeList(param->qualifiers, FreeSpecifier);
14722 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14723 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14724 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14727 else if(spec && spec->specifier == ANY_OBJECT)
14729 struct Declarator * d = param->declarator;
14731 FreeList(param->qualifiers, FreeSpecifier);
14732 param->qualifiers = MkListOne(MkSpecifier(VOID));
14733 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14735 else if(spec->specifier == THISCLASS)
14740 spec->name = ReplaceThisClass(thisClass);
14741 spec->symbol = FindClass(spec->name);
14742 ProcessSpecifier(spec, 0x0);
14746 if(param->declarator)
14747 ProcessDeclarator(param->declarator);
14755 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14757 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14759 static void ProcessDeclaration(struct Declaration * decl)
14761 yylloc = decl->loc;
14766 unsigned int declareStruct = 0x0;
14768 if(decl->declarators)
14770 struct InitDeclarator * d;
14772 for(d = (*decl->declarators).first; d; d = d->next)
14774 struct Type * type, * subType;
14776 ProcessDeclarator(d->declarator);
14777 type = ProcessType(decl->specifiers, d->declarator);
14780 ProcessInitializer(d->initializer, type);
14781 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14783 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14785 struct Instantiation * inst = d->initializer->exp->instance;
14787 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14788 d->initializer->exp->instance = (((void *)0));
14789 if(decl->specifiers)
14790 FreeList(decl->specifiers, FreeSpecifier);
14791 FreeList(decl->declarators, FreeInitDeclarator);
14798 for(subType = type; subType; )
14800 if(subType->kind == 8)
14802 declareStruct = 0x1;
14805 else if(subType->kind == 13)
14807 else if(subType->kind == 12)
14808 subType = subType->arrayType;
14817 if(decl->specifiers)
14819 struct Specifier * s;
14821 for(s = (*decl->specifiers).first; s; s = s->next)
14823 ProcessSpecifier(s, declareStruct);
14830 ProcessInstantiationType(decl->inst);
14835 struct Specifier * spec;
14836 struct Declarator * d;
14837 unsigned int declareStruct = 0x0;
14839 if(decl->declarators)
14841 for(d = (*decl->declarators).first; d; d = d->next)
14843 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14844 struct Type * subType;
14846 ProcessDeclarator(d);
14847 for(subType = type; subType; )
14849 if(subType->kind == 8)
14851 declareStruct = 0x1;
14854 else if(subType->kind == 13)
14856 else if(subType->kind == 12)
14857 subType = subType->arrayType;
14864 if(decl->specifiers)
14866 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14867 ProcessSpecifier(spec, declareStruct);
14874 static struct FunctionDefinition * curFunction;
14876 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14878 char propName[1024], propNameM[1024];
14879 char getName[1024], setName[1024];
14880 struct __ecereNameSpace__ecere__sys__OldList * args;
14882 DeclareProperty(prop, setName, getName);
14883 strcpy(propName, "__ecereProp_");
14884 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14885 strcat(propName, "_");
14886 FullClassNameCat(propName, prop->name, 0x1);
14887 MangleClassName(propName);
14888 strcpy(propNameM, "__ecerePropM_");
14889 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14890 strcat(propNameM, "_");
14891 FullClassNameCat(propNameM, prop->name, 0x1);
14892 MangleClassName(propNameM);
14893 if(prop->isWatchable)
14896 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14897 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14898 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14900 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14901 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14902 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14906 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14907 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14908 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14910 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14911 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14912 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14914 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14915 curFunction->propSet->fireWatchersDone = 0x1;
14918 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
14920 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
14922 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14924 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14926 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14928 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14930 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14932 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14934 static void ProcessStatement(struct Statement * stmt)
14936 yylloc = stmt->loc;
14940 ProcessStatement(stmt->labeled.stmt);
14943 if(stmt->caseStmt.exp)
14945 FreeType(stmt->caseStmt.exp->destType);
14946 stmt->caseStmt.exp->destType = curSwitchType;
14948 curSwitchType->refCount++;
14949 ProcessExpressionType(stmt->caseStmt.exp);
14950 ComputeExpression(stmt->caseStmt.exp);
14952 if(stmt->caseStmt.stmt)
14953 ProcessStatement(stmt->caseStmt.stmt);
14957 if(stmt->compound.context)
14959 struct Declaration * decl;
14960 struct Statement * s;
14961 struct Statement * prevCompound = curCompound;
14962 struct Context * prevContext = curContext;
14964 if(!stmt->compound.isSwitch)
14966 curCompound = stmt;
14967 curContext = stmt->compound.context;
14969 if(stmt->compound.declarations)
14971 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14972 ProcessDeclaration(decl);
14974 if(stmt->compound.statements)
14976 for(s = (*stmt->compound.statements).first; s; s = s->next)
14977 ProcessStatement(s);
14979 curContext = prevContext;
14980 curCompound = prevCompound;
14986 struct Expression * exp;
14988 if(stmt->expressions)
14990 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14991 ProcessExpressionType(exp);
14997 struct Expression * exp;
14999 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15000 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15001 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15002 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15004 ProcessExpressionType(exp);
15006 if(stmt->ifStmt.stmt)
15007 ProcessStatement(stmt->ifStmt.stmt);
15008 if(stmt->ifStmt.elseStmt)
15009 ProcessStatement(stmt->ifStmt.elseStmt);
15014 struct Type * oldSwitchType = curSwitchType;
15016 if(stmt->switchStmt.exp)
15018 struct Expression * exp;
15020 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15024 ProcessExpressionType(exp);
15027 curSwitchType = exp->expType;
15030 ProcessStatement(stmt->switchStmt.stmt);
15031 curSwitchType = oldSwitchType;
15036 if(stmt->whileStmt.exp)
15038 struct Expression * exp;
15040 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15041 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15042 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15043 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15045 ProcessExpressionType(exp);
15048 if(stmt->whileStmt.stmt)
15049 ProcessStatement(stmt->whileStmt.stmt);
15054 if(stmt->doWhile.exp)
15056 struct Expression * exp;
15058 if((*stmt->doWhile.exp).last)
15060 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15061 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15062 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15064 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15066 ProcessExpressionType(exp);
15069 if(stmt->doWhile.stmt)
15070 ProcessStatement(stmt->doWhile.stmt);
15075 struct Expression * exp;
15077 if(stmt->forStmt.init)
15078 ProcessStatement(stmt->forStmt.init);
15079 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15081 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15082 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15083 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15085 if(stmt->forStmt.check)
15086 ProcessStatement(stmt->forStmt.check);
15087 if(stmt->forStmt.increment)
15089 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15090 ProcessExpressionType(exp);
15092 if(stmt->forStmt.stmt)
15093 ProcessStatement(stmt->forStmt.stmt);
15098 struct Identifier * id = stmt->forEachStmt.id;
15099 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15100 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15101 struct Statement * block = stmt->forEachStmt.stmt;
15102 char iteratorType[1024];
15103 struct Type * source;
15104 struct Expression * e;
15105 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));
15106 struct Expression * arrayExp;
15107 char * typeString = (((void *)0));
15108 int builtinCount = 0;
15110 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15114 FreeType(e->destType);
15115 e->destType = ProcessTypeString("Container", 0x0);
15117 if(!isBuiltin || e->next)
15118 ProcessExpressionType(e);
15120 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15121 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15123 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15124 struct Symbol * symbol;
15125 struct Expression * expIt = (((void *)0));
15126 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15127 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15128 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15129 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15132 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15133 stmt->compound.context->parent = curContext;
15134 curContext = stmt->compound.context;
15135 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15137 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15138 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15140 isCustomAVLTree = 0x1;
15141 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15143 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15146 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15148 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15150 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15153 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15157 struct Declarator * decl;
15158 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15160 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15161 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15162 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15166 struct Type * type = (((void *)0));
15167 char typeStringBuf[1024];
15169 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15170 if(((struct Expression *)(*exp).last)->type == 11)
15172 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15175 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15177 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)
15179 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15181 typeString = templateClass->templateArgs[2].dataTypeString;
15183 else if(arrayExp->list)
15185 struct Expression * e;
15187 for(e = (*arrayExp->list).first; e; e = e->next)
15189 ProcessExpressionType(e);
15199 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15203 e->expType = (((void *)0));
15204 e = (*arrayExp->list).first;
15205 ProcessExpressionType(e);
15208 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15210 FreeType(e->expType);
15211 e->expType = (((void *)0));
15213 type = (((void *)0));
15221 FreeType(e->expType);
15222 e->expType = (((void *)0));
15228 typeStringBuf[0] = '\0';
15229 PrintType(type, typeStringBuf, 0x0, 0x1);
15230 typeString = typeStringBuf;
15236 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15237 struct Declarator * decl;
15238 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15242 struct Expression * e;
15244 builtinCount = (*arrayExp->list).count;
15245 type = ProcessTypeString(typeString, 0x0);
15246 while(e = (*arrayExp->list).first)
15248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15249 e->destType = type;
15251 ProcessExpressionType(e);
15252 ListAdd(initializers, MkInitializerAssignment(e));
15255 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15257 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15258 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15259 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15260 FreeList(exp, FreeExpression);
15264 arrayExp->expType = ProcessTypeString("Container", 0x0);
15265 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15268 else if(isLinkList && !isList)
15270 struct Declarator * decl;
15271 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15273 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15274 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15275 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15277 else if(_class->templateArgs)
15280 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15282 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15283 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15285 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15286 if(block && block->type == 2 && block->compound.context)
15288 block->compound.context->parent = stmt->compound.context;
15292 block = MkIfStmt(filter, block, (((void *)0)));
15296 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));
15297 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15298 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15299 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15305 sprintf(count, "%d", builtinCount);
15306 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));
15307 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15308 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15309 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15311 else if(isLinkList && !isList)
15313 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15314 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15316 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15318 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));
15322 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15323 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15325 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));
15327 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15328 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15329 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15333 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15335 ProcessExpressionType(expIt);
15336 if((*stmt->compound.declarations).first)
15337 ProcessDeclaration((*stmt->compound.declarations).first);
15339 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15340 ProcessStatement(stmt);
15341 curContext = stmt->compound.context->parent;
15346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15358 struct Expression * exp;
15360 if(stmt->expressions)
15362 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15366 if(curFunction && !curFunction->type)
15367 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15368 FreeType(exp->destType);
15369 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15371 exp->destType->refCount++;
15373 ProcessExpressionType(exp);
15380 ProcessDeclaration(stmt->decl);
15385 struct AsmField * field;
15387 if(stmt->asmStmt.inputFields)
15389 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15390 if(field->expression)
15391 ProcessExpressionType(field->expression);
15393 if(stmt->asmStmt.outputFields)
15395 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15396 if(field->expression)
15397 ProcessExpressionType(field->expression);
15399 if(stmt->asmStmt.clobberedFields)
15401 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15403 if(field->expression)
15404 ProcessExpressionType(field->expression);
15411 struct PropertyWatch * propWatch;
15412 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15413 struct Expression * object = stmt->_watch.object;
15414 struct Expression * watcher = stmt->_watch.watcher;
15417 ProcessExpressionType(watcher);
15419 ProcessExpressionType(object);
15422 if(watcher || thisClass)
15424 struct External * external = curExternal;
15425 struct Context * context = curContext;
15428 stmt->expressions = MkList();
15429 curExternal = external->prev;
15430 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15432 struct ClassFunction * func;
15433 char watcherName[1024];
15434 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15435 struct External * createdExternal;
15436 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15438 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15439 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15440 if(propWatch->deleteWatch)
15441 strcat(watcherName, "_delete");
15444 struct Identifier * propID;
15446 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15448 strcat(watcherName, "_");
15449 strcat(watcherName, propID->string);
15452 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15454 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15455 ProcessClassFunctionBody(func, propWatch->compound);
15456 propWatch->compound = (((void *)0));
15457 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15458 createdExternal->symbol->idCode = external->symbol->idCode;
15459 curExternal = createdExternal;
15460 ProcessFunction(createdExternal->function);
15462 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15464 externalDecl->declaration = decl;
15465 if(decl->symbol && !decl->symbol->pointerExternal)
15466 decl->symbol->pointerExternal = externalDecl;
15468 if(propWatch->deleteWatch)
15470 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15472 ListAdd(args, CopyExpression(object));
15473 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15474 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15475 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15479 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15480 struct Identifier * propID;
15482 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15484 char propName[1024];
15485 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15489 char getName[1024], setName[1024];
15490 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15492 DeclareProperty(prop, setName, getName);
15493 strcpy(propName, "__ecereProp_");
15494 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15495 strcat(propName, "_");
15496 FullClassNameCat(propName, prop->name, 0x1);
15497 ListAdd(args, CopyExpression(object));
15498 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15499 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15500 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15501 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15504 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15509 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15511 curExternal = external;
15512 curContext = context;
15514 FreeExpression(watcher);
15516 FreeExpression(object);
15517 FreeList(watches, FreePropertyWatch);
15520 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15524 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15526 ProcessStatement(propWatch->compound);
15533 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15534 struct Expression * object = stmt->_watch.object;
15535 struct __ecereNameSpace__ecere__com__Class * _class;
15538 ProcessExpressionType(object);
15541 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15544 struct Identifier * propID;
15547 stmt->expressions = MkList();
15548 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15550 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15557 for(propID = (*watches).first; propID; propID = propID->next)
15559 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15563 CreateFireWatcher(prop, object, stmt);
15566 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15571 struct __ecereNameSpace__ecere__com__Property * prop;
15572 struct __ecereNameSpace__ecere__com__Class * base;
15574 for(base = _class; base; base = base->base)
15576 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15578 if(prop->isProperty && prop->isWatchable)
15580 CreateFireWatcher(prop, object, stmt);
15586 FreeExpression(object);
15587 FreeList(watches, FreeIdentifier);
15590 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15596 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15597 struct Expression * object = stmt->_watch.object;
15598 struct Expression * watcher = stmt->_watch.watcher;
15599 struct __ecereNameSpace__ecere__com__Class * _class;
15602 ProcessExpressionType(object);
15604 ProcessExpressionType(watcher);
15607 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15608 if(watcher || thisClass)
15612 struct Identifier * propID;
15615 stmt->expressions = MkList();
15618 struct __ecereNameSpace__ecere__sys__OldList * args;
15621 ListAdd(args, CopyExpression(object));
15622 ListAdd(args, MkExpConstant("0"));
15623 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15624 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15628 for(propID = (*watches).first; propID; propID = propID->next)
15630 char propName[1024];
15631 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15635 char getName[1024], setName[1024];
15636 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15638 DeclareProperty(prop, setName, getName);
15639 strcpy(propName, "__ecereProp_");
15640 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15641 strcat(propName, "_");
15642 FullClassNameCat(propName, prop->name, 0x1);
15643 MangleClassName(propName);
15644 ListAdd(args, CopyExpression(object));
15645 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15646 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15647 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15650 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15654 FreeExpression(object);
15656 FreeExpression(watcher);
15657 FreeList(watches, FreeIdentifier);
15660 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15663 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15670 extern struct Expression * QBrackets(struct Expression * exp);
15672 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15674 extern struct Declarator * QMkPtrDecl(char * id);
15676 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15678 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15680 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15682 static void ProcessFunction(struct FunctionDefinition * function)
15684 void * __ecereTemp2;
15685 void * __ecereTemp1;
15686 struct Identifier * id = GetDeclId(function->declarator);
15687 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15688 struct Type * type = symbol ? symbol->type : (((void *)0));
15689 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15690 struct Context * oldTopContext = topContext;
15692 yylloc = function->loc;
15693 if(type && type->thisClass)
15695 struct Symbol * classSym = type->thisClass;
15696 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15697 char className[1024];
15698 char structName[1024];
15699 struct Declarator * funcDecl;
15700 struct Symbol * thisSymbol;
15701 unsigned int typedObject = 0x0;
15703 if(_class && !_class->base)
15705 _class = currentClass;
15706 if(_class && !_class->symbol)
15707 _class->symbol = FindClass(_class->fullName);
15708 classSym = _class ? _class->symbol : (((void *)0));
15711 thisClass = _class;
15712 if(inCompiler && _class)
15714 if(type->kind == 11)
15716 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15718 struct Type * param = symbol->type->params.first;
15720 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15723 if(type->classObjectType != 1)
15725 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15726 symbol->type->staticMethod = 0x1;
15727 symbol->type->thisClass = (((void *)0));
15728 symbol->type->extraParam = 0x0;
15731 strcpy(className, "__ecereClass_");
15732 FullClassNameCat(className, _class->fullName, 0x1);
15733 MangleClassName(className);
15734 structName[0] = (char)0;
15735 FullClassNameCat(structName, _class->fullName, 0x0);
15736 funcDecl = GetFuncDecl(function->declarator);
15739 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15741 struct TypeName * param = (*funcDecl->function.parameters).first;
15743 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15746 FreeTypeName(param);
15749 if(!function->propertyNoThis)
15751 struct TypeName * thisParam;
15753 if(type->classObjectType != 1)
15755 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15756 if(!funcDecl->function.parameters)
15757 funcDecl->function.parameters = MkList();
15758 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15762 if(type->classObjectType != 1)
15764 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15765 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15767 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));
15768 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15772 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15774 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15776 funcDecl = GetFuncDecl(initDecl->declarator);
15779 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15781 struct TypeName * param = (*funcDecl->function.parameters).first;
15783 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15785 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15786 FreeTypeName(param);
15789 if(type->classObjectType != 1)
15791 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15793 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15795 if(!funcDecl->function.parameters)
15796 funcDecl->function.parameters = MkList();
15797 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15805 if(type->classObjectType != 1)
15807 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));
15808 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15809 if(typedObject && thisSymbol->type)
15811 thisSymbol->type->classObjectType = 2;
15812 thisSymbol->type->byReference = type->byReference;
15816 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15818 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15821 struct __ecereNameSpace__ecere__com__Class * base;
15823 for(base = _class; base && base->type != 1000; base = base->next)
15825 for(member = base->membersAndProperties.first; member; member = member->next)
15826 if(!member->isProperty)
15832 for(member = _class->membersAndProperties.first; member; member = member->next)
15833 if(!member->isProperty)
15837 char pointerName[1024];
15838 struct Declaration * decl;
15839 struct Initializer * initializer;
15840 struct Expression * exp, * bytePtr;
15842 strcpy(pointerName, "__ecerePointer_");
15843 FullClassNameCat(pointerName, _class->fullName, 0x0);
15845 char className[1024];
15847 strcpy(className, "__ecereClass_");
15848 FullClassNameCat(className, classSym->string, 0x1);
15849 MangleClassName(className);
15850 DeclareClass(classSym, className);
15852 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15857 sprintf(string, "%d", _class->offset);
15858 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15862 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15864 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15865 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));
15868 yylloc = function->body->loc;
15869 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15871 struct Context * prevContext = curContext;
15873 curContext = function->body->compound.context;
15874 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15875 curContext = prevContext;
15877 decl->symbol = (((void *)0));
15878 if(!function->body->compound.declarations)
15879 function->body->compound.declarations = MkList();
15880 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15886 thisClass = (((void *)0));
15889 FreeSpecifier(id->_class);
15890 id->_class = (((void *)0));
15891 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15893 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15895 id = GetDeclId(initDecl->declarator);
15896 FreeSpecifier(id->_class);
15897 id->_class = (((void *)0));
15901 topContext = function->body->compound.context;
15903 struct FunctionDefinition * oldFunction = curFunction;
15905 curFunction = function;
15907 ProcessStatement(function->body);
15908 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15910 struct Statement * prevCompound = curCompound;
15911 struct Context * prevContext = curContext;
15912 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15914 if(!function->body->compound.statements)
15915 function->body->compound.statements = MkList();
15916 ListAdd(function->body->compound.statements, fireWatchers);
15917 curCompound = function->body;
15918 curContext = function->body->compound.context;
15919 ProcessStatement(fireWatchers);
15920 curContext = prevContext;
15921 curCompound = prevCompound;
15923 curFunction = oldFunction;
15925 if(function->declarator)
15927 ProcessDeclarator(function->declarator);
15929 topContext = oldTopContext;
15930 thisClass = oldThisClass;
15933 extern void FreeSymbol(struct Symbol * symbol);
15935 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15937 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15939 struct ClassDef * def;
15940 struct External * external = curExternal;
15941 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15943 for(def = definitions->first; def; def = def->next)
15947 if(def->function->declarator)
15948 curExternal = def->function->declarator->symbol->pointerExternal;
15950 curExternal = external;
15951 ProcessFunction((struct FunctionDefinition *)def->function);
15953 else if(def->type == 2)
15955 if(def->decl->type == 2)
15957 thisClass = regClass;
15958 ProcessInstantiationType(def->decl->inst);
15959 thisClass = (((void *)0));
15963 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15966 thisClass = regClass;
15967 ProcessDeclaration(def->decl);
15968 thisClass = backThisClass;
15971 else if(def->type == 1 && def->defProperties)
15973 struct MemberInit * defProperty;
15974 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);
15976 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15977 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15979 thisClass = regClass;
15980 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15981 thisClass = (((void *)0));
15983 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15984 FreeSymbol(thisSymbol);
15986 else if(def->type == 3 && def->propertyDef)
15988 struct PropertyDef * prop = def->propertyDef;
15990 thisClass = regClass;
15995 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15997 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15999 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16000 ProcessStatement(prop->setStmt);
16006 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16008 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16010 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16011 ProcessStatement(prop->getStmt);
16013 if(prop->issetStmt)
16017 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16019 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16021 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16022 ProcessStatement(prop->issetStmt);
16024 thisClass = (((void *)0));
16026 else if(def->type == 4 && def->propertyWatch)
16028 struct PropertyWatch * propertyWatch = def->propertyWatch;
16030 thisClass = regClass;
16031 if(propertyWatch->compound)
16033 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);
16035 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16036 curExternal = (((void *)0));
16037 ProcessStatement(propertyWatch->compound);
16039 thisClass = (((void *)0));
16044 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16046 void ComputeDataTypes()
16048 void * __ecereTemp1;
16049 struct External * external;
16050 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16052 currentClass = (((void *)0));
16053 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16054 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16056 curExternal = temp;
16057 DeclareStruct("ecere::com::Class", 0x0);
16058 DeclareStruct("ecere::com::Instance", 0x0);
16059 DeclareStruct("ecere::com::Property", 0x0);
16060 DeclareStruct("ecere::com::DataMember", 0x0);
16061 DeclareStruct("ecere::com::Method", 0x0);
16062 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16063 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16065 for(external = (*ast).first; external; external = external->next)
16067 afterExternal = curExternal = external;
16068 if(external->type == 0)
16070 currentClass = external->function->_class;
16071 ProcessFunction(external->function);
16073 else if(external->type == 1)
16075 currentClass = (((void *)0));
16076 ProcessDeclaration(external->declaration);
16078 else if(external->type == 2)
16080 struct ClassDefinition * _class = external->_class;
16082 currentClass = external->symbol->registered;
16083 if(_class->definitions)
16085 ProcessClass(_class->definitions, _class->symbol);
16089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16090 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16093 else if(external->type == 4)
16095 thisNameSpace = external->id->string;
16098 currentClass = (((void *)0));
16099 thisNameSpace = (((void *)0));
16100 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16101 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16104 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);
16106 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);
16108 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16110 struct __ecereNameSpace__ecere__com__Class * class;
16112 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16129 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16130 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16131 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16132 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16133 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16134 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16135 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16136 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16137 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16138 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16139 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16140 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16141 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16142 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16143 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16144 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16145 __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);
16146 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16147 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16148 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16149 __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);
16150 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16151 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16152 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16153 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16154 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16155 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16156 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16157 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16158 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16159 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16160 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16162 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16163 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16164 __ecereClass_Conversion = class;
16165 __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);
16166 __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);
16167 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16168 __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);
16169 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16171 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16175 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16176 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16177 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16178 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16179 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16180 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16181 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16187 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)