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 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), 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 extern char * sourceFile;
11813 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11815 void ProcessExpressionType(struct Expression * exp)
11817 void * __ecereTemp2;
11818 void * __ecereTemp1;
11819 unsigned int unresolved = 0x0;
11820 struct Location oldyylloc = yylloc;
11821 unsigned int notByReference = 0x0;
11823 if(!exp || exp->expType)
11830 struct Identifier * id = exp->identifier;
11834 if(id->_class && id->_class->name)
11836 id->classSym = id->_class->symbol;
11838 if(strstr(id->string, "__ecereClass") == id->string)
11840 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11843 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11845 ReplaceClassMembers(exp, thisClass);
11848 ProcessExpressionType(exp);
11851 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11856 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11860 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11866 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11869 ProcessExpressionType(exp);
11873 else if(currentClass && !id->_class)
11875 if(ResolveIdWithClass(exp, currentClass, 0x1))
11878 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11883 struct Type * type = symbol->type;
11884 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11886 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11888 struct Context * context = SetupTemplatesContext(_class);
11890 type = ReplaceThisClassType(_class);
11891 FinishTemplatesContext(context);
11893 type->refCount = 0;
11895 FreeSpecifier(id->_class);
11896 id->_class = (((void *)0));
11897 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11898 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11899 id->classSym = (((void *)0));
11900 exp->expType = type;
11903 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11904 exp->isConstant = 0x1;
11905 if(symbol->isParam || !strcmp(id->string, "this"))
11907 if(_class && _class->type == 1)
11908 exp->byReference = 0x1;
11910 if(symbol->isIterator)
11912 if(symbol->isIterator == 3)
11915 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11916 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11917 exp->expType = (((void *)0));
11918 ProcessExpressionType(exp);
11920 else if(symbol->isIterator != 4)
11923 exp->member.exp = MkExpIdentifier(exp->identifier);
11924 exp->member.exp->expType = exp->expType;
11925 exp->member.member = MkIdentifier("data");
11926 exp->expType = (((void *)0));
11927 ProcessExpressionType(exp);
11934 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11936 if(thisNameSpace && !(id->_class && !id->_class->name))
11940 strcpy(name, thisNameSpace);
11941 strcat(name, "::");
11942 strcat(name, id->string);
11943 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11946 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11951 for(c = 0; c < definedExpStackPos; c++)
11952 if(definedExpStack[c] == definedExp)
11954 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11956 struct Location backupYylloc = yylloc;
11958 definedExpStack[definedExpStackPos++] = definedExp;
11959 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11960 ((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));
11961 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11963 parsedExpression = (((void *)0));
11965 expression_yyparse();
11966 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11967 yylloc = backupYylloc;
11968 if(parsedExpression)
11970 FreeIdentifier(id);
11972 exp->list = MkListOne(parsedExpression);
11973 parsedExpression->loc = yylloc;
11974 ProcessExpressionType(exp);
11975 definedExpStackPos--;
11978 definedExpStackPos--;
11984 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11990 struct GlobalData * data = (((void *)0));
11992 if(thisNameSpace && !(id->_class && !id->_class->name))
11996 strcpy(name, thisNameSpace);
11997 strcat(name, "::");
11998 strcat(name, id->string);
11999 data = FindGlobalData(name);
12002 data = FindGlobalData(id->string);
12005 DeclareGlobalData(data);
12006 exp->expType = data->dataType;
12008 data->dataType->refCount++;
12009 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12010 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12011 FreeSpecifier(id->_class);
12012 id->_class = (((void *)0));
12017 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12019 if(thisNameSpace && !(id->_class && !id->_class->name))
12023 strcpy(name, thisNameSpace);
12024 strcat(name, "::");
12025 strcat(name, id->string);
12026 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12029 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12034 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12035 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12037 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12038 strcpy(name, "__ecereFunction_");
12039 FullClassNameCat(name, id->string, 0x0);
12040 if(DeclareFunction(function, name))
12042 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12043 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12045 exp->expType = function->dataType;
12046 if(function->dataType)
12047 function->dataType->refCount++;
12048 FreeSpecifier(id->_class);
12049 id->_class = (((void *)0));
12061 struct __ecereNameSpace__ecere__com__Class * _class;
12063 if(!exp->instance->_class)
12065 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12067 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12070 ProcessInstantiationType(exp->instance);
12071 exp->isConstant = exp->instance->isConstant;
12072 if(exp->instance->_class)
12074 exp->expType = MkClassType(exp->instance->_class->name);
12082 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12084 exp->expType = type;
12085 if(exp->constant[0] == '\'')
12087 if((int)((unsigned char *)exp->constant)[1] > 127)
12090 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12093 ch = exp->constant[1];
12094 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12095 exp->constant = PrintUInt(ch);
12097 type->_class = FindClass("unichar");
12098 type->isSigned = 0x0;
12103 type->isSigned = 0x1;
12106 else if(strchr(exp->constant, '.'))
12108 char ch = exp->constant[strlen(exp->constant) - 1];
12114 type->isSigned = 0x1;
12118 if(exp->constant[0] == '0' && exp->constant[1])
12119 type->isSigned = 0x0;
12120 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12121 type->isSigned = 0x0;
12122 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12123 type->isSigned = 0x0;
12125 type->isSigned = 0x1;
12128 exp->isConstant = 0x1;
12134 exp->isConstant = 0x1;
12135 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));
12140 ProcessExpressionType(exp->_new.size);
12141 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));
12142 DeclareType(exp->expType->type, 0x0, 0x0);
12146 ProcessExpressionType(exp->_renew.size);
12147 ProcessExpressionType(exp->_renew.exp);
12148 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));
12149 DeclareType(exp->expType->type, 0x0, 0x0);
12153 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12154 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12155 unsigned int useDestType = 0x0, useSideType = 0x0;
12156 struct Location oldyylloc = yylloc;
12157 unsigned int useSideUnit = 0x0;
12158 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12200 if(exp->op.op != '*' || exp->op.exp1)
12207 if(exp->op.op == '&')
12209 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12211 struct Identifier * id = exp->op.exp2->identifier;
12212 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12214 if(symbol && symbol->isIterator == 2)
12217 exp->member.exp = exp->op.exp2;
12218 exp->member.member = MkIdentifier("key");
12219 exp->expType = (((void *)0));
12220 exp->op.exp2->expType = symbol->type;
12221 symbol->type->refCount++;
12222 ProcessExpressionType(exp);
12230 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))
12232 if(exp->op.exp1->destType)
12233 FreeType(exp->op.exp1->destType);
12234 exp->op.exp1->destType = exp->destType;
12236 exp->destType->refCount++;
12240 if(exp->op.exp1->destType)
12241 FreeType(exp->op.exp1->destType);
12242 exp->op.exp1->destType = dummy;
12245 if(exp->op.exp1->destType && exp->op.op != '=')
12246 exp->op.exp1->destType->count++;
12247 ProcessExpressionType(exp->op.exp1);
12248 if(exp->op.exp1->destType && exp->op.op != '=')
12249 exp->op.exp1->destType->count--;
12250 if(exp->op.exp1->destType == dummy)
12253 exp->op.exp1->destType = (((void *)0));
12255 type1 = exp->op.exp1->expType;
12259 char expString[10240];
12261 expString[0] = '\0';
12262 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12266 exp->op.exp2->destType = exp->op.exp1->expType;
12267 if(exp->op.exp1->expType)
12268 exp->op.exp1->expType->refCount++;
12272 exp->op.exp2->destType = exp->destType;
12274 exp->destType->refCount++;
12278 exp->expType = type1;
12283 PrintExpression(exp->op.exp2, expString);
12284 if(type1 && type1->kind == 13)
12286 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)
12287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12288 else if(exp->op.op == '=')
12290 if(exp->op.exp2->destType)
12291 FreeType(exp->op.exp2->destType);
12292 exp->op.exp2->destType = type1;
12299 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)
12303 if(exp->op.exp2->destType)
12304 FreeType(exp->op.exp2->destType);
12305 exp->op.exp2->destType = type1;
12312 exp->expType = type1;
12314 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)))
12316 if(exp->op.exp2->destType)
12317 FreeType(exp->op.exp2->destType);
12318 exp->op.exp2->destType = exp->destType;
12320 exp->destType->refCount++;
12324 if(exp->op.exp2->destType)
12325 FreeType(exp->op.exp2->destType);
12326 exp->op.exp2->destType = dummy;
12329 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12331 FreeType(exp->op.exp2->destType);
12332 exp->op.exp2->destType = type1;
12335 if(exp->op.exp2->destType && exp->op.op != '=')
12336 exp->op.exp2->destType->count++;
12337 ProcessExpressionType(exp->op.exp2);
12338 if(exp->op.exp2->destType && exp->op.op != '=')
12339 exp->op.exp2->destType->count--;
12340 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12342 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)
12344 if(exp->op.op != '=' && type1->type->kind == 0)
12345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12347 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)))
12349 if(exp->op.op == ADD_ASSIGN)
12350 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12352 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))
12354 if(exp->op.op == ADD_ASSIGN)
12355 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12357 else if(inCompiler)
12359 char type1String[1024];
12360 char type2String[1024];
12362 type1String[0] = '\0';
12363 type2String[0] = '\0';
12364 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12365 PrintType(type1, type2String, 0x0, 0x1);
12366 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12367 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12370 if(exp->op.exp2->destType == dummy)
12373 exp->op.exp2->destType = (((void *)0));
12375 type2 = exp->op.exp2->expType;
12378 if(exp->op.op == SIZEOF)
12380 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12381 exp->isConstant = 0x1;
12383 else if(exp->op.op == '*' && !exp->op.exp1)
12385 exp->expType = Dereference(type2);
12386 if(type2 && type2->kind == 8)
12387 notByReference = 0x1;
12389 else if(exp->op.op == '&' && !exp->op.exp1)
12390 exp->expType = Reference(type2);
12397 if(exp->op.exp1->destType)
12398 FreeType(exp->op.exp1->destType);
12399 exp->op.exp1->destType = MkClassType("bool");
12400 exp->op.exp1->destType->truth = 0x1;
12401 if(!exp->op.exp1->expType)
12402 ProcessExpressionType(exp->op.exp1);
12404 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12405 FreeType(exp->op.exp1->expType);
12406 exp->op.exp1->expType = MkClassType("bool");
12407 exp->op.exp1->expType->truth = 0x1;
12411 if(exp->op.exp2->destType)
12412 FreeType(exp->op.exp2->destType);
12413 exp->op.exp2->destType = MkClassType("bool");
12414 exp->op.exp2->destType->truth = 0x1;
12415 if(!exp->op.exp2->expType)
12416 ProcessExpressionType(exp->op.exp2);
12418 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12419 FreeType(exp->op.exp2->expType);
12420 exp->op.exp2->expType = MkClassType("bool");
12421 exp->op.exp2->expType->truth = 0x1;
12424 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")))))
12426 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12428 if(exp->op.exp2->destType)
12429 FreeType(exp->op.exp2->destType);
12430 exp->op.exp2->destType = type1;
12432 if(exp->op.exp1->destType)
12433 FreeType(exp->op.exp1->destType);
12434 exp->op.exp1->destType = type2;
12436 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)
12437 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);
12438 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12440 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12444 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12446 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12447 ProcessExpressionType(exp->op.exp1);
12448 if(type2->kind != 13)
12450 ProcessExpressionType(classExp);
12451 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"))))))));
12452 if(!exp->op.exp2->expType)
12453 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12454 ProcessExpressionType(exp->op.exp2);
12458 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)))
12460 if(type1->kind != 8 && type1->type->kind == 0)
12461 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12462 exp->expType = type1;
12466 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)))
12468 if(type2->kind != 8 && type2->type->kind == 0)
12469 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12470 exp->expType = type2;
12474 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))
12476 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12480 unsigned int success = 0x0;
12482 if(type1->kind == 13 && type2->kind == 13)
12484 if(exp->op.op == '+')
12485 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12486 else if(exp->op.op == '-')
12488 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12490 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12492 if(type1->type->kind == 20)
12494 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12498 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12500 ProcessExpressionType(classExp);
12502 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")))))));
12503 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12511 if(!success && exp->op.exp1->type == 2)
12513 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12516 FreeType(exp->expType);
12517 exp->expType = exp->op.exp1->destType;
12518 if(exp->op.exp1->destType)
12519 exp->op.exp1->destType->refCount++;
12522 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12525 FreeType(exp->expType);
12526 exp->expType = exp->op.exp2->destType;
12527 if(exp->op.exp2->destType)
12528 exp->op.exp2->destType->refCount++;
12534 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12537 FreeType(exp->expType);
12538 exp->expType = exp->op.exp2->destType;
12539 if(exp->op.exp2->destType)
12540 exp->op.exp2->destType->refCount++;
12543 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12546 FreeType(exp->expType);
12547 exp->expType = exp->op.exp1->destType;
12548 if(exp->op.exp1->destType)
12549 exp->op.exp1->destType->refCount++;
12555 char expString1[10240];
12556 char expString2[10240];
12560 expString1[0] = '\0';
12561 expString2[0] = '\0';
12566 PrintExpression(exp->op.exp1, expString1);
12567 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12568 PrintExpression(exp->op.exp2, expString2);
12569 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12570 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12571 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12573 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12577 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12579 if(exp->op.exp1->destType)
12580 FreeType(exp->op.exp1->destType);
12581 exp->op.exp1->destType = type2->_class->registered->dataType;
12582 if(type2->_class->registered->dataType)
12583 type2->_class->registered->dataType->refCount++;
12584 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12585 exp->expType = type2;
12589 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12591 if(exp->op.exp2->destType)
12592 FreeType(exp->op.exp2->destType);
12593 exp->op.exp2->destType = type1->_class->registered->dataType;
12594 if(type1->_class->registered->dataType)
12595 type1->_class->registered->dataType->refCount++;
12596 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12597 exp->expType = type1;
12603 unsigned int valid = 0x0;
12605 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12607 if(exp->op.exp2->destType)
12608 FreeType(exp->op.exp2->destType);
12609 if(!type1->_class->registered->dataType)
12610 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12611 exp->op.exp2->destType = type1->_class->registered->dataType;
12612 exp->op.exp2->destType->refCount++;
12613 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12614 type2 = exp->op.exp2->destType;
12615 exp->expType = type2;
12618 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12620 if(exp->op.exp1->destType)
12621 FreeType(exp->op.exp1->destType);
12622 if(!type2->_class->registered->dataType)
12623 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12624 exp->op.exp1->destType = type2->_class->registered->dataType;
12625 exp->op.exp1->destType->refCount++;
12626 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12627 type1 = exp->op.exp1->destType;
12628 exp->expType = type1;
12631 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12633 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12635 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12638 FreeType(exp->expType);
12639 exp->expType = exp->op.exp1->expType;
12640 if(exp->op.exp2->expType)
12641 exp->op.exp1->expType->refCount++;
12645 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12647 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12650 FreeType(exp->expType);
12651 exp->expType = exp->op.exp2->expType;
12652 if(exp->op.exp2->expType)
12653 exp->op.exp2->expType->refCount++;
12660 if(exp->op.exp2->destType)
12661 FreeType(exp->op.exp2->destType);
12662 exp->op.exp2->destType = type1;
12664 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12667 FreeType(exp->expType);
12668 exp->expType = exp->op.exp2->destType;
12669 if(exp->op.exp2->destType)
12670 exp->op.exp2->destType->refCount++;
12672 else if(type1 && type2)
12674 char expString1[10240];
12675 char expString2[10240];
12676 char type1String[1024];
12677 char type2String[1024];
12679 expString1[0] = '\0';
12680 expString2[0] = '\0';
12681 type1String[0] = '\0';
12682 type2String[0] = '\0';
12685 PrintExpression(exp->op.exp1, expString1);
12686 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12687 PrintExpression(exp->op.exp2, expString2);
12688 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12689 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12690 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12692 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12693 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12695 exp->expType = exp->op.exp1->expType;
12696 if(exp->op.exp1->expType)
12697 exp->op.exp1->expType->refCount++;
12699 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12701 exp->expType = exp->op.exp2->expType;
12702 if(exp->op.exp2->expType)
12703 exp->op.exp2->expType->refCount++;
12710 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12712 struct Type * oldType = exp->op.exp1->expType;
12714 exp->op.exp1->expType = (((void *)0));
12715 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12718 exp->op.exp1->expType = oldType;
12720 if(exp->op.exp1->destType)
12721 FreeType(exp->op.exp1->destType);
12722 exp->op.exp1->destType = type2;
12724 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12727 FreeType(exp->expType);
12728 exp->expType = exp->op.exp1->destType;
12729 if(exp->op.exp1->destType)
12730 exp->op.exp1->destType->refCount++;
12734 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12736 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12738 if(exp->op.exp1->destType)
12739 FreeType(exp->op.exp1->destType);
12740 exp->op.exp1->destType = type2->_class->registered->dataType;
12741 if(type2->_class->registered->dataType)
12742 type2->_class->registered->dataType->refCount++;
12743 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12745 if(exp->op.op == '!')
12747 exp->expType = MkClassType("bool");
12748 exp->expType->truth = 0x1;
12752 exp->expType = type2;
12757 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12759 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12761 if(exp->op.exp2->destType)
12762 FreeType(exp->op.exp2->destType);
12763 exp->op.exp2->destType = type1->_class->registered->dataType;
12764 if(type1->_class->registered->dataType)
12765 type1->_class->registered->dataType->refCount++;
12766 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12768 exp->expType = type1;
12774 if(exp->op.exp1 && !exp->op.exp1->expType)
12776 char expString[10000];
12778 expString[0] = '\0';
12781 PrintExpression(exp->op.exp1, expString);
12782 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12785 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12787 if(exp->op.exp2 && !exp->op.exp2->expType)
12789 char expString[10240];
12791 expString[0] = '\0';
12794 PrintExpression(exp->op.exp2, expString);
12795 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12802 FreeType(exp->expType);
12803 exp->expType = MkClassType("bool");
12804 exp->expType->truth = 0x1;
12806 if(exp->op.op != SIZEOF)
12807 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12808 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12810 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12812 yylloc = oldyylloc;
12819 struct Expression * e;
12821 exp->isConstant = 0x1;
12822 for(e = (*exp->list).first; e; e = e->next)
12824 unsigned int inced = 0x0;
12828 FreeType(e->destType);
12829 e->destType = exp->destType;
12832 exp->destType->refCount++;
12833 e->destType->count++;
12837 ProcessExpressionType(e);
12839 exp->destType->count--;
12840 if(!exp->expType && !e->next)
12842 exp->expType = e->expType;
12844 e->expType->refCount++;
12847 exp->isConstant = 0x0;
12849 e = (*exp->list).first;
12850 if(!e->next && e->type == 8)
12852 struct Expression * next = exp->next, * prev = exp->prev;
12854 FreeType(exp->expType);
12855 FreeType(exp->destType);
12856 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12860 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12861 ProcessExpressionType(exp);
12867 struct Expression * e;
12869 exp->isConstant = 0x1;
12870 ProcessExpressionType(exp->index.exp);
12871 if(!exp->index.exp->isConstant)
12872 exp->isConstant = 0x0;
12873 if(exp->index.exp->expType)
12875 struct Type * source = exp->index.exp->expType;
12877 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)
12879 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12881 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12882 if(exp->index.index && (*exp->index.index).last)
12884 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12888 for(e = (*exp->index.index).first; e; e = e->next)
12890 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12893 FreeType(e->destType);
12894 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12896 ProcessExpressionType(e);
12901 exp->isConstant = 0x0;
12904 exp->expType = Dereference(exp->index.exp->expType);
12906 DeclareType(exp->expType, 0x0, 0x0);
12911 struct Expression * e;
12912 struct Type * functionType;
12913 struct Type * methodType = (((void *)0));
12919 PrintExpression(exp->call.exp, name);
12920 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12922 PrintExpression(exp->call.exp, name);
12925 if(exp->call.exp->type == 0)
12927 struct Expression * idExp = exp->call.exp;
12928 struct Identifier * id = idExp->identifier;
12930 if(!strcmp(id->string, "__ENDIAN_PAD"))
12932 exp->expType = ProcessTypeString("int", 0x1);
12933 if(exp->call.arguments && (*exp->call.arguments).first)
12934 ProcessExpressionType((*exp->call.arguments).first);
12937 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12939 struct Expression * a = (((void *)0));
12940 struct Expression * b = (((void *)0));
12941 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12943 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12945 a = (*exp->call.arguments).first;
12946 b = (*exp->call.arguments).last;
12950 else if((*exp->call.arguments).count == 1)
12952 a = (*exp->call.arguments).first;
12957 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12958 idExp->identifier = (((void *)0));
12959 FreeExpContents(exp);
12960 ProcessExpressionType(a);
12962 ProcessExpressionType(b);
12964 exp->list = MkList();
12965 if(a->expType && (!b || b->expType))
12967 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12971 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12972 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12973 struct Declaration * decl;
12974 char temp1[1024], temp2[1024];
12976 GetTypeSpecs(a->expType, specs);
12977 if(a && !a->isConstant && a->type != 0)
12979 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12980 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12981 tempExp1 = QMkExpId(temp1);
12982 tempExp1->expType = a->expType;
12984 a->expType->refCount++;
12985 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12987 if(b && !b->isConstant && b->type != 0)
12989 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12990 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12991 tempExp2 = QMkExpId(temp2);
12992 tempExp2->expType = b->expType;
12994 b->expType->refCount++;
12995 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12997 decl = MkDeclaration(specs, decls);
12998 if(!curCompound->compound.declarations)
12999 curCompound->compound.declarations = MkList();
13000 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13004 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13006 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13008 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13009 exp->expType = a->expType;
13011 a->expType->refCount++;
13013 else if(!strcmp(id->string, "Abs"))
13015 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13016 exp->expType = a->expType;
13018 a->expType->refCount++;
13020 else if(!strcmp(id->string, "Sgn"))
13022 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"))))));
13023 exp->expType = ProcessTypeString("int", 0x0);
13025 FreeExpression(tempExp1);
13027 FreeExpression(tempExp2);
13028 FreeIdentifier(id);
13034 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13036 if(!exp->call.exp->destType)
13038 exp->call.exp->destType = dummy;
13041 ProcessExpressionType(exp->call.exp);
13042 if(exp->call.exp->destType == dummy)
13045 exp->call.exp->destType = (((void *)0));
13049 functionType = exp->call.exp->expType;
13050 if(functionType && functionType->kind == 16)
13052 methodType = functionType;
13053 functionType = methodType->method->dataType;
13054 if(exp->call.exp->expType->usedClass)
13056 char typeString[1024];
13058 typeString[0] = '\0';
13059 PrintType(functionType, typeString, 0x1, 0x1);
13060 if(strstr(typeString, "thisclass"))
13062 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13063 struct Declarator * decl;
13066 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13068 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13069 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13070 thisClassParams = 0x0;
13071 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13073 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13075 thisClass = exp->call.exp->expType->usedClass;
13076 ProcessDeclarator(decl);
13077 thisClass = backupThisClass;
13079 thisClassParams = 0x1;
13080 functionType = ProcessType(specs, decl);
13081 functionType->refCount = 0;
13082 FinishTemplatesContext(context);
13084 FreeList(specs, FreeSpecifier);
13085 FreeDeclarator(decl);
13089 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13091 struct Type * type = functionType->type;
13093 if(!functionType->refCount)
13095 functionType->type = (((void *)0));
13096 FreeType(functionType);
13098 functionType = type;
13100 if(functionType && functionType->kind != 11)
13102 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13104 else if(functionType)
13106 unsigned int emptyParams = 0x0, noParams = 0x0;
13107 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13108 struct Type * type = functionType->params.first;
13109 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13111 struct Location oldyylloc = yylloc;
13115 if(functionType->extraParam && e)
13117 e->destType = MkClassType(functionType->thisClass->string);
13120 if(!functionType->staticMethod)
13122 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13124 type = MkClassType(memberExp->member.exp->expType->_class->string);
13127 e->destType = type;
13129 type = functionType->params.first;
13132 type->refCount = 0;
13134 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13136 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13139 e->destType = type;
13141 type = functionType->params.first;
13144 type->refCount = 0;
13147 if(type && type->kind == 0)
13150 if(!type->refCount)
13152 type = (((void *)0));
13154 for(; e; e = e->next)
13156 if(!type && !emptyParams)
13159 if(methodType && methodType->methodClass)
13160 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);
13162 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);
13165 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13167 struct Type * templatedType = (((void *)0));
13168 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13169 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13172 if(_class && _class->templateArgs)
13174 struct __ecereNameSpace__ecere__com__Class * sClass;
13176 for(sClass = _class; sClass; sClass = sClass->base)
13178 if(sClass->templateClass)
13179 sClass = sClass->templateClass;
13181 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13183 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13185 struct __ecereNameSpace__ecere__com__Class * nextClass;
13187 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13189 if(nextClass->templateClass)
13190 nextClass = nextClass->templateClass;
13191 id += nextClass->templateParams.count;
13201 if(curParam && _class->templateArgs[id].dataTypeString)
13203 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13206 struct Context * context = SetupTemplatesContext(_class);
13208 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13209 FinishTemplatesContext(context);
13211 e->destType = templatedType;
13214 templatedType->passAsTemplate = 0x1;
13219 e->destType = type;
13226 e->destType = type;
13230 if(type && type->kind != 14)
13232 struct Type * next = type->next;
13234 if(!type->refCount)
13239 if(type && type->kind != 14)
13241 if(methodType && methodType->methodClass)
13242 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);
13244 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);
13246 yylloc = oldyylloc;
13247 if(type && !type->refCount)
13252 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13253 if(exp->call.exp->type == 0)
13255 char * string = exp->call.exp->identifier->string;
13259 struct Symbol * symbol;
13260 struct Location oldyylloc = yylloc;
13262 yylloc = exp->call.exp->identifier->loc;
13263 if(strstr(string, "__builtin_") == string)
13266 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13267 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));
13268 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13269 if(strstr(symbol->string, "::"))
13270 globalContext->hasNameSpace = 0x1;
13271 yylloc = oldyylloc;
13274 else if(exp->call.exp->type == 8)
13278 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13279 if(!functionType->returnType)
13281 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13284 if(functionType && functionType->kind == 11)
13286 exp->expType = functionType->returnType;
13287 if(functionType->returnType)
13288 functionType->returnType->refCount++;
13289 if(!functionType->refCount)
13290 FreeType(functionType);
13292 if(exp->call.arguments)
13294 for(e = (*exp->call.arguments).first; e; e = e->next)
13296 struct Type * destType = e->destType;
13298 ProcessExpressionType(e);
13305 struct Type * type;
13306 struct Location oldyylloc = yylloc;
13307 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13309 exp->thisPtr = thisPtr;
13310 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13312 exp->member.member->classSym = exp->member.member->_class->symbol;
13314 ProcessExpressionType(exp->member.exp);
13315 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)
13317 exp->isConstant = 0x0;
13320 exp->isConstant = exp->member.exp->isConstant;
13321 type = exp->member.exp->expType;
13323 if(type && (type->kind == 20))
13325 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13326 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13330 for(param = _class->templateParams.first; param; param = param->next)
13332 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13336 if(param && param->defaultArg.member)
13338 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13342 struct Expression * expMember = exp->member.exp;
13343 struct Declarator * decl;
13344 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13345 char thisClassTypeString[1024];
13347 FreeIdentifier(exp->member.member);
13348 ProcessExpressionType(argExp);
13350 char * colon = strstr(param->defaultArg.memberString, "::");
13354 char className[1024];
13355 struct __ecereNameSpace__ecere__com__Class * sClass;
13357 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13358 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13361 strcpy(thisClassTypeString, _class->fullName);
13363 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13364 exp->expType = ProcessType(specs, decl);
13365 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13367 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13368 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13370 int paramCount = 0;
13371 int lastParam = -1;
13372 char templateString[1024];
13373 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13375 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13376 for(cClass = expClass; cClass; cClass = cClass->base)
13380 for(param = cClass->templateParams.first; param; param = param->next)
13383 struct __ecereNameSpace__ecere__com__Class * sClass;
13384 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13386 for(sClass = cClass->base; sClass; sClass = sClass->base)
13387 id += sClass->templateParams.count;
13388 arg = expClass->templateArgs[id];
13389 for(sClass = _class; sClass; sClass = sClass->base)
13391 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13393 struct __ecereNameSpace__ecere__com__Class * nextClass;
13395 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13396 p += nextClass->templateParams.count;
13397 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13399 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13401 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13403 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13404 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13411 char argument[256];
13413 argument[0] = '\0';
13414 switch(param->type)
13418 char expString[1024];
13419 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13420 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13421 struct Expression * exp;
13422 char * string = PrintHexUInt64(arg.expression.ui64);
13424 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13425 ProcessExpressionType(exp);
13426 ComputeExpression(exp);
13427 expString[0] = '\0';
13428 PrintExpression(exp, expString);
13429 strcat(argument, expString);
13430 FreeExpression(exp);
13435 strcat(argument, arg.member->name);
13440 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13442 if(!strcmp(arg.dataTypeString, "thisclass"))
13443 strcat(argument, thisClassTypeString);
13445 strcat(argument, arg.dataTypeString);
13453 strcat(templateString, ", ");
13454 if(lastParam != p - 1)
13456 strcat(templateString, param->name);
13457 strcat(templateString, " = ");
13459 strcat(templateString, argument);
13468 int len = strlen(templateString);
13470 if(templateString[len - 1] == '>')
13471 templateString[len++] = ' ';
13472 templateString[len++] = '>';
13473 templateString[len++] = '\0';
13476 struct Context * context = SetupTemplatesContext(_class);
13478 FreeType(exp->expType);
13479 exp->expType = ProcessTypeString(templateString, 0x0);
13480 FinishTemplatesContext(context);
13484 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")))))))));
13487 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13489 type = ProcessTemplateParameterType(type->templateParameter);
13492 if(type && (type->kind == 20))
13494 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13496 struct Identifier * id = exp->member.member;
13497 int typeKind = type->kind;
13498 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));
13500 if(typeKind == 19 && exp->member.exp->type == 26)
13502 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13505 if(id && (typeKind == 3 || typeKind == 15))
13506 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13509 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13510 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13511 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13512 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13513 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13515 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13516 exp->member.memberType = 1;
13517 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13518 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13521 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13523 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13524 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13526 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13528 member = (((void *)0));
13530 if(!member && !prop)
13531 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13532 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13533 exp->member.thisPtr = 0x1;
13539 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13540 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13541 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13543 if(!prop && !member)
13545 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13548 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13549 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13550 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13555 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13556 prop = (((void *)0));
13558 member = (((void *)0));
13562 if(!prop && !member)
13563 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13564 if(!prop && !member && !method)
13568 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13571 exp->member.memberType = 5;
13572 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13576 char structName[1024];
13577 struct Identifier * id = exp->member.member;
13578 struct Expression * classExp = exp->member.exp;
13581 FreeType(classExp->expType);
13582 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13583 strcpy(structName, "__ecereClassData_");
13584 FullClassNameCat(structName, type->_class->string, 0x0);
13586 exp->member.member = id;
13587 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"))))))));
13589 ProcessExpressionType(exp);
13595 struct Symbol * classSym = FindClass(id->string);
13599 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13602 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13608 exp->member.memberType = 1;
13609 if(!prop->dataType)
13610 ProcessPropertyType(prop);
13611 exp->expType = prop->dataType;
13613 prop->dataType->refCount++;
13617 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13619 FreeExpContents(exp);
13621 exp->identifier = MkIdentifier("class");
13622 ProcessExpressionType(exp);
13625 exp->member.memberType = 3;
13626 DeclareStruct(_class->fullName, 0x0);
13627 if(!member->dataType)
13629 struct Context * context = SetupTemplatesContext(_class);
13631 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13632 FinishTemplatesContext(context);
13634 exp->expType = member->dataType;
13635 if(member->dataType)
13636 member->dataType->refCount++;
13638 else if(revConvert)
13640 exp->member.memberType = 4;
13641 exp->expType = MkClassType(revConvert->_class->fullName);
13647 exp->member.memberType = 2;
13649 if(!method->dataType)
13650 ProcessMethodType(method);
13651 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));
13652 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13653 exp->expType->usedClass = _class;
13655 else if(!classProp)
13657 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13659 FreeExpContents(exp);
13661 exp->identifier = MkIdentifier("class");
13662 ProcessExpressionType(exp);
13665 yylloc = exp->member.member->loc;
13666 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13668 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13670 if(_class && exp->expType)
13672 struct __ecereNameSpace__ecere__com__Class * tClass;
13675 while(tClass && !tClass->templateClass)
13676 tClass = tClass->base;
13677 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13680 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13681 struct __ecereNameSpace__ecere__com__Class * sClass;
13683 for(sClass = tClass; sClass; sClass = sClass->base)
13686 if(sClass->templateClass)
13687 sClass = sClass->templateClass;
13688 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13690 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13692 for(sClass = sClass->base; sClass; sClass = sClass->base)
13693 id += sClass->templateParams.count;
13701 if(curParam && tClass->templateArgs[id].dataTypeString)
13703 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13704 struct Context * context = SetupTemplatesContext(tClass);
13706 FreeType(exp->expType);
13707 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13710 if(exp->expType->kind == 21)
13712 FreeType(exp->expType);
13713 exp->expType = ReplaceThisClassType(_class);
13715 if(tClass->templateClass)
13716 exp->expType->passAsTemplate = 0x1;
13719 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13720 if(exp->destType->kind == 21)
13722 FreeType(exp->destType);
13723 exp->destType = ReplaceThisClassType(_class);
13727 FinishTemplatesContext(context);
13730 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13733 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13734 struct __ecereNameSpace__ecere__com__Class * sClass;
13736 for(sClass = tClass; sClass; sClass = sClass->base)
13739 if(sClass->templateClass)
13740 sClass = sClass->templateClass;
13741 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13743 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13745 for(sClass = sClass->base; sClass; sClass = sClass->base)
13746 id += sClass->templateParams.count;
13756 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13757 struct Context * context = SetupTemplatesContext(tClass);
13758 struct Type * basicType;
13760 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13763 if(basicType->kind == 21)
13765 FreeType(basicType);
13766 basicType = ReplaceThisClassType(_class);
13768 FreeType(exp->expType);
13769 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));
13772 exp->destType = exp->expType;
13773 exp->destType->refCount++;
13776 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13777 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13778 struct Declarator * decl;
13780 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13783 exp->destType->refCount++;
13785 exp->expType->refCount++;
13787 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13788 exp->cast.exp = newExp;
13791 FinishTemplatesContext(context);
13794 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13796 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13800 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13803 int paramCount = 0;
13804 int lastParam = -1;
13805 char templateString[1024];
13806 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13808 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13809 while(cClass != expClass)
13811 struct __ecereNameSpace__ecere__com__Class * sClass;
13813 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13816 for(param = cClass->templateParams.first; param; param = param->next)
13818 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13821 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13822 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13824 while(cClassCur != tClass && !paramCur)
13826 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13828 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13830 cClassCur = sClassCur;
13831 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13833 if(!strcmp(paramCur->name, param->name))
13840 if(paramCur && paramCur->type == 0)
13841 arg = tClass->templateArgs[cp];
13843 arg = expClass->templateArgs[p];
13845 char argument[256];
13847 argument[0] = '\0';
13848 switch(param->type)
13852 char expString[1024];
13853 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13854 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13855 struct Expression * exp;
13856 char * string = PrintHexUInt64(arg.expression.ui64);
13858 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13859 ProcessExpressionType(exp);
13860 ComputeExpression(exp);
13861 expString[0] = '\0';
13862 PrintExpression(exp, expString);
13863 strcat(argument, expString);
13864 FreeExpression(exp);
13869 strcat(argument, arg.member->name);
13874 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13875 strcat(argument, arg.dataTypeString);
13882 strcat(templateString, ", ");
13883 if(lastParam != p - 1)
13885 strcat(templateString, param->name);
13886 strcat(templateString, " = ");
13888 strcat(templateString, argument);
13897 int len = strlen(templateString);
13899 if(templateString[len - 1] == '>')
13900 templateString[len++] = ' ';
13901 templateString[len++] = '>';
13902 templateString[len++] = '\0';
13904 FreeType(exp->expType);
13906 struct Context * context = SetupTemplatesContext(tClass);
13908 exp->expType = ProcessTypeString(templateString, 0x0);
13909 FinishTemplatesContext(context);
13916 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)");
13918 else if(type && (type->kind == 9 || type->kind == 10))
13920 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13924 exp->expType = memberType;
13926 memberType->refCount++;
13931 char expString[10240];
13933 expString[0] = '\0';
13936 PrintExpression(exp, expString);
13937 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13939 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13941 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13943 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13945 struct Identifier * id = exp->member.member;
13946 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));
13950 FreeType(exp->expType);
13951 exp->expType = ReplaceThisClassType(_class);
13955 yylloc = oldyylloc;
13960 struct Type * destType = exp->destType;
13962 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13964 exp->member.member->classSym = exp->member.member->_class->symbol;
13966 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13970 ProcessExpressionType(exp);
13977 struct Symbol * classSym = exp->_class->symbol;
13979 if(classSym && classSym->registered)
13981 if(classSym->registered->type == 5)
13986 DeclareStruct(classSym->string, 0x0);
13987 FreeSpecifier(exp->_class);
13989 FullClassNameCat(name, classSym->string, 0x0);
13990 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13994 if(classSym->registered->fixed)
13996 FreeSpecifier(exp->_class);
13997 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14002 char className[1024];
14004 strcpy(className, "__ecereClass_");
14005 FullClassNameCat(className, classSym->string, 0x1);
14006 MangleClassName(className);
14007 DeclareClass(classSym, className);
14008 FreeExpContents(exp);
14010 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14011 exp->member.member = MkIdentifier("structSize");
14015 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14020 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14022 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14023 exp->isConstant = 0x1;
14024 DeclareType(type, 0x0, 0x0);
14030 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14032 type->count = (unsigned int)1;
14033 FreeType(exp->cast.exp->destType);
14034 exp->cast.exp->destType = type;
14036 ProcessExpressionType(exp->cast.exp);
14037 type->count = (unsigned int)0;
14038 exp->expType = type;
14039 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14041 void * prev = exp->prev, * next = exp->next;
14042 struct Type * expType = exp->cast.exp->destType;
14043 struct Expression * castExp = exp->cast.exp;
14044 struct Type * destType = exp->destType;
14047 expType->refCount++;
14048 FreeType(exp->expType);
14049 FreeTypeName(exp->cast.typeName);
14051 FreeType(exp->expType);
14052 FreeType(exp->destType);
14053 exp->expType = expType;
14054 exp->destType = destType;
14055 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14061 exp->isConstant = exp->cast.exp->isConstant;
14067 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14070 exp->expType = type;
14075 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14077 ProcessExpressionType(exp->vaArg.exp);
14079 exp->expType = type;
14084 struct Expression * e;
14086 exp->isConstant = 0x1;
14087 FreeType(exp->cond.cond->destType);
14088 exp->cond.cond->destType = MkClassType("bool");
14089 exp->cond.cond->destType->truth = 0x1;
14090 ProcessExpressionType(exp->cond.cond);
14091 if(!exp->cond.cond->isConstant)
14092 exp->isConstant = 0x0;
14093 for(e = (*exp->cond.exp).first; e; e = e->next)
14097 FreeType(e->destType);
14098 e->destType = exp->destType;
14100 e->destType->refCount++;
14102 ProcessExpressionType(e);
14105 exp->expType = e->expType;
14107 e->expType->refCount++;
14110 exp->isConstant = 0x0;
14112 FreeType(exp->cond.elseExp->destType);
14113 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14114 if(exp->cond.elseExp->destType)
14115 exp->cond.elseExp->destType->refCount++;
14116 ProcessExpressionType(exp->cond.elseExp);
14117 if(!exp->cond.elseExp->isConstant)
14118 exp->isConstant = 0x0;
14123 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14125 struct Statement * last = (*exp->compound->compound.statements).last;
14127 if(last->type == 3 && last->expressions && (*last->expressions).last)
14129 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14131 exp->destType->refCount++;
14133 ProcessStatement(exp->compound);
14134 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14135 if(((struct Expression *)(*last->expressions).last)->expType)
14136 exp->expType->refCount++;
14142 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14144 if(spec && spec->type == 1)
14146 exp->expType = MkClassType(spec->name);
14147 exp->expType->kind = 19;
14148 exp->byReference = 0x1;
14152 exp->expType = MkClassType("ecere::com::Class");
14153 exp->byReference = 0x1;
14159 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14163 struct Identifier * id = exp->classData.id;
14164 char structName[1024];
14165 struct Expression * classExp;
14167 strcpy(structName, "__ecereClassData_");
14168 FullClassNameCat(structName, _class->fullName, 0x0);
14170 exp->member.member = id;
14171 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14172 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14174 classExp = MkExpIdentifier(MkIdentifier("class"));
14175 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"))))))));
14176 ProcessExpressionType(exp);
14183 struct Type * type = (((void *)0));
14184 char * typeString = (((void *)0));
14185 char typeStringBuf[1024];
14187 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))
14189 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14191 typeString = templateClass->templateArgs[2].dataTypeString;
14195 struct Expression * e;
14197 for(e = (*exp->list).first; e; e = e->next)
14199 ProcessExpressionType(e);
14209 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14213 e->expType = (((void *)0));
14214 e = (*exp->list).first;
14215 ProcessExpressionType(e);
14218 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14220 FreeType(e->expType);
14221 e->expType = (((void *)0));
14223 type = (((void *)0));
14231 FreeType(e->expType);
14232 e->expType = (((void *)0));
14238 typeStringBuf[0] = '\0';
14239 PrintType(type, typeStringBuf, 0x0, 0x1);
14240 typeString = typeStringBuf;
14242 type = (((void *)0));
14247 char templateString[1024];
14248 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14249 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14250 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14251 struct Expression * expExt;
14252 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14254 sprintf(templateString, "Container<%s>", typeString);
14257 struct Expression * e;
14259 type = ProcessTypeString(typeString, 0x0);
14260 while(e = (*exp->list).first)
14262 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14263 e->destType = type;
14265 ProcessExpressionType(e);
14266 ListAdd(initializers, MkInitializerAssignment(e));
14269 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14271 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14272 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14273 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14274 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14275 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14276 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14277 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14278 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14279 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14280 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))));
14281 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14282 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14283 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14284 exp->expType = ProcessTypeString(templateString, 0x0);
14286 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14287 ProcessExpressionType(expExt);
14291 exp->expType = ProcessTypeString("Container", 0x0);
14292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14297 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14299 FreeType(exp->expType);
14300 exp->expType = ReplaceThisClassType(thisClass);
14302 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14304 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14308 if(exp->expType->kind != 15)
14310 struct Type * member;
14311 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14313 FreeType(exp->expType);
14314 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14315 exp->expType->kind = symbol->type->kind;
14316 exp->expType->refCount++;
14317 exp->expType->enumName = enumName;
14318 exp->expType->members = symbol->type->members;
14319 for(member = symbol->type->members.first; member; member = member->next)
14320 member->refCount++;
14324 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14326 for(member = symbol->type->members.first; member; member = member->next)
14328 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14330 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14336 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14338 else if(exp->destType && !exp->destType->keepCast)
14340 if(!CheckExpressionType(exp, exp->destType, 0x0))
14342 if(!exp->destType->count || unresolved)
14347 if(exp->destType->kind != 14)
14354 char expString[10240];
14356 expString[0] = '\0';
14357 PrintType(exp->destType, type2, 0x0, 0x1);
14360 PrintExpression(exp, expString);
14361 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14364 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14365 else if(exp->type != 16)
14366 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14371 char expString[10240];
14373 expString[0] = '\0';
14376 PrintExpression(exp, expString);
14377 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14380 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14381 else if(exp->type != 16)
14382 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14394 PrintType(exp->expType, type1, 0x0, 0x1);
14395 PrintType(exp->destType, type2, 0x0, 0x1);
14397 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)))
14401 char expString[10240];
14403 expString[0] = '\0';
14406 PrintExpression(exp, expString);
14407 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14409 if(strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec"))
14410 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14411 FreeType(exp->expType);
14412 exp->destType->refCount++;
14413 exp->expType = exp->destType;
14418 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14420 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14421 char typeString[1024];
14422 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14423 struct Declarator * decl;
14425 typeString[0] = '\0';
14428 exp->expType->refCount++;
14430 exp->expType->refCount++;
14432 newExp->destType = exp->expType;
14433 PrintType(exp->expType, typeString, 0x0, 0x0);
14434 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14435 exp->cast.typeName = MkTypeName(specs, decl);
14436 exp->cast.exp = newExp;
14439 else if(unresolved)
14441 if(exp->identifier->_class && exp->identifier->_class->name)
14442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14443 else if(exp->identifier->string && exp->identifier->string[0])
14444 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14446 else if(!exp->expType && exp->type != 16)
14448 char expString[10240];
14450 expString[0] = '\0';
14453 PrintExpression(exp, expString);
14454 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14456 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14458 ApplyAnyObjectLogic(exp);
14459 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14461 exp->byReference = 0x1;
14463 yylloc = oldyylloc;
14466 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)
14470 *curMember = (*curMember)->next;
14471 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14473 *curMember = subMemberStack[--(*subMemberStackPos)];
14474 *curMember = (*curMember)->next;
14476 while((*curMember) && (*curMember)->isProperty)
14477 *curMember = (*curMember)->next;
14478 if(subMemberStackPos)
14480 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14482 subMemberStack[(*subMemberStackPos)++] = *curMember;
14483 *curMember = (*curMember)->members.first;
14484 while(*curMember && (*curMember)->isProperty)
14485 *curMember = (*curMember)->next;
14493 if(subMemberStackPos && *subMemberStackPos)
14495 *curMember = subMemberStack[--(*subMemberStackPos)];
14496 *curMember = (*curMember)->next;
14500 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14502 if(*curClass == _class)
14504 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14506 *curMember = (*curClass)->membersAndProperties.first;
14508 while((*curMember) && (*curMember)->isProperty)
14509 *curMember = (*curMember)->next;
14510 if(subMemberStackPos)
14512 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14514 subMemberStack[(*subMemberStackPos)++] = *curMember;
14515 *curMember = (*curMember)->members.first;
14516 while(*curMember && (*curMember)->isProperty)
14517 *curMember = (*curMember)->next;
14524 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14529 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14531 if(init->exp && !init->exp->destType)
14533 FreeType(init->exp->destType);
14534 init->exp->destType = type;
14540 ProcessExpressionType(init->exp);
14541 init->isConstant = init->exp->isConstant;
14547 struct Expression * exp = init->exp;
14548 struct Instantiation * inst = exp->instance;
14549 struct MembersInit * members;
14552 init->list = MkList();
14555 for(members = (*inst->members).first; members; members = members->next)
14557 if(members->type == 0)
14559 struct MemberInit * member;
14561 for(member = (*members->dataMembers).first; member; member = member->next)
14563 ListAdd(init->list, member->initializer);
14564 member->initializer = (((void *)0));
14569 FreeExpression(exp);
14573 struct Initializer * i;
14574 struct Type * initializerType = (((void *)0));
14575 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14576 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14577 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14578 int subMemberStackPos = 0;
14580 if(type && type->kind == 12)
14581 initializerType = Dereference(type);
14582 else if(type && (type->kind == 9 || type->kind == 10))
14583 initializerType = type->members.first;
14584 for(i = (*init->list).first; i; i = i->next)
14586 if(type && type->kind == 8 && type->_class && type->_class->registered)
14588 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14591 if(!curMember->dataType)
14592 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14593 initializerType = curMember->dataType;
14596 ProcessInitializer(i, initializerType);
14597 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14598 initializerType = initializerType->next;
14600 init->isConstant = 0x0;
14602 if(type && type->kind == 12)
14603 FreeType(initializerType);
14604 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14613 extern struct Symbol * FindType(struct Context * ctx, char * name);
14615 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14617 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14623 if(spec->specifier == THISCLASS)
14628 spec->name = ReplaceThisClass(thisClass);
14629 spec->symbol = FindClass(spec->name);
14630 ProcessSpecifier(spec, declareStruct);
14637 struct Symbol * symbol = FindType(curContext, spec->name);
14640 DeclareType(symbol->type, 0x1, 0x1);
14641 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14642 DeclareStruct(spec->name, 0x0);
14647 struct Enumerator * e;
14651 for(e = (*spec->list).first; e; e = e->next)
14654 ProcessExpressionType(e->exp);
14662 if(spec->definitions)
14664 struct ClassDef * def;
14665 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14667 ProcessClass(spec->definitions, symbol);
14674 static void ProcessDeclarator(struct Declarator * decl)
14679 if(decl->identifier->classSym)
14681 FreeSpecifier(decl->identifier->_class);
14682 decl->identifier->_class = (((void *)0));
14686 if(decl->array.exp)
14687 ProcessExpressionType(decl->array.exp);
14694 if(decl->declarator)
14695 ProcessDeclarator(decl->declarator);
14696 if(decl->type == 4)
14698 struct Identifier * id = GetDeclId(decl);
14700 if(id && id->_class)
14702 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14704 if(!decl->function.parameters)
14705 decl->function.parameters = MkList();
14706 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14707 id->_class = (((void *)0));
14709 if(decl->function.parameters)
14711 struct TypeName * param;
14713 for(param = (*decl->function.parameters).first; param; param = param->next)
14715 if(param->qualifiers && (*param->qualifiers).first)
14717 struct Specifier * spec = (*param->qualifiers).first;
14719 if(spec && spec->specifier == TYPED_OBJECT)
14721 struct Declarator * d = param->declarator;
14722 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);
14724 FreeList(param->qualifiers, FreeSpecifier);
14725 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14726 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14727 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14730 else if(spec && spec->specifier == ANY_OBJECT)
14732 struct Declarator * d = param->declarator;
14734 FreeList(param->qualifiers, FreeSpecifier);
14735 param->qualifiers = MkListOne(MkSpecifier(VOID));
14736 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14738 else if(spec->specifier == THISCLASS)
14743 spec->name = ReplaceThisClass(thisClass);
14744 spec->symbol = FindClass(spec->name);
14745 ProcessSpecifier(spec, 0x0);
14749 if(param->declarator)
14750 ProcessDeclarator(param->declarator);
14758 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14760 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14762 static void ProcessDeclaration(struct Declaration * decl)
14764 yylloc = decl->loc;
14769 unsigned int declareStruct = 0x0;
14771 if(decl->declarators)
14773 struct InitDeclarator * d;
14775 for(d = (*decl->declarators).first; d; d = d->next)
14777 struct Type * type, * subType;
14779 ProcessDeclarator(d->declarator);
14780 type = ProcessType(decl->specifiers, d->declarator);
14783 ProcessInitializer(d->initializer, type);
14784 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14786 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14788 struct Instantiation * inst = d->initializer->exp->instance;
14790 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14791 d->initializer->exp->instance = (((void *)0));
14792 if(decl->specifiers)
14793 FreeList(decl->specifiers, FreeSpecifier);
14794 FreeList(decl->declarators, FreeInitDeclarator);
14801 for(subType = type; subType; )
14803 if(subType->kind == 8)
14805 declareStruct = 0x1;
14808 else if(subType->kind == 13)
14810 else if(subType->kind == 12)
14811 subType = subType->arrayType;
14820 if(decl->specifiers)
14822 struct Specifier * s;
14824 for(s = (*decl->specifiers).first; s; s = s->next)
14826 ProcessSpecifier(s, declareStruct);
14833 ProcessInstantiationType(decl->inst);
14838 struct Specifier * spec;
14839 struct Declarator * d;
14840 unsigned int declareStruct = 0x0;
14842 if(decl->declarators)
14844 for(d = (*decl->declarators).first; d; d = d->next)
14846 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14847 struct Type * subType;
14849 ProcessDeclarator(d);
14850 for(subType = type; subType; )
14852 if(subType->kind == 8)
14854 declareStruct = 0x1;
14857 else if(subType->kind == 13)
14859 else if(subType->kind == 12)
14860 subType = subType->arrayType;
14867 if(decl->specifiers)
14869 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14870 ProcessSpecifier(spec, declareStruct);
14877 static struct FunctionDefinition * curFunction;
14879 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14881 char propName[1024], propNameM[1024];
14882 char getName[1024], setName[1024];
14883 struct __ecereNameSpace__ecere__sys__OldList * args;
14885 DeclareProperty(prop, setName, getName);
14886 strcpy(propName, "__ecereProp_");
14887 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14888 strcat(propName, "_");
14889 FullClassNameCat(propName, prop->name, 0x1);
14890 MangleClassName(propName);
14891 strcpy(propNameM, "__ecerePropM_");
14892 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14893 strcat(propNameM, "_");
14894 FullClassNameCat(propNameM, prop->name, 0x1);
14895 MangleClassName(propNameM);
14896 if(prop->isWatchable)
14899 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14900 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14901 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14903 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14904 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14905 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14909 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14910 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14911 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14913 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14914 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14915 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14917 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14918 curFunction->propSet->fireWatchersDone = 0x1;
14921 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
14923 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
14925 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14927 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14929 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14931 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14933 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14935 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14937 static void ProcessStatement(struct Statement * stmt)
14939 yylloc = stmt->loc;
14943 ProcessStatement(stmt->labeled.stmt);
14946 if(stmt->caseStmt.exp)
14948 FreeType(stmt->caseStmt.exp->destType);
14949 stmt->caseStmt.exp->destType = curSwitchType;
14951 curSwitchType->refCount++;
14952 ProcessExpressionType(stmt->caseStmt.exp);
14953 ComputeExpression(stmt->caseStmt.exp);
14955 if(stmt->caseStmt.stmt)
14956 ProcessStatement(stmt->caseStmt.stmt);
14960 if(stmt->compound.context)
14962 struct Declaration * decl;
14963 struct Statement * s;
14964 struct Statement * prevCompound = curCompound;
14965 struct Context * prevContext = curContext;
14967 if(!stmt->compound.isSwitch)
14969 curCompound = stmt;
14970 curContext = stmt->compound.context;
14972 if(stmt->compound.declarations)
14974 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14975 ProcessDeclaration(decl);
14977 if(stmt->compound.statements)
14979 for(s = (*stmt->compound.statements).first; s; s = s->next)
14980 ProcessStatement(s);
14982 curContext = prevContext;
14983 curCompound = prevCompound;
14989 struct Expression * exp;
14991 if(stmt->expressions)
14993 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14994 ProcessExpressionType(exp);
15000 struct Expression * exp;
15002 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15003 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15004 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15005 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15007 ProcessExpressionType(exp);
15009 if(stmt->ifStmt.stmt)
15010 ProcessStatement(stmt->ifStmt.stmt);
15011 if(stmt->ifStmt.elseStmt)
15012 ProcessStatement(stmt->ifStmt.elseStmt);
15017 struct Type * oldSwitchType = curSwitchType;
15019 if(stmt->switchStmt.exp)
15021 struct Expression * exp;
15023 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15027 ProcessExpressionType(exp);
15030 curSwitchType = exp->expType;
15033 ProcessStatement(stmt->switchStmt.stmt);
15034 curSwitchType = oldSwitchType;
15039 if(stmt->whileStmt.exp)
15041 struct Expression * exp;
15043 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15044 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15045 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15046 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15048 ProcessExpressionType(exp);
15051 if(stmt->whileStmt.stmt)
15052 ProcessStatement(stmt->whileStmt.stmt);
15057 if(stmt->doWhile.exp)
15059 struct Expression * exp;
15061 if((*stmt->doWhile.exp).last)
15063 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15064 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15065 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15067 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15069 ProcessExpressionType(exp);
15072 if(stmt->doWhile.stmt)
15073 ProcessStatement(stmt->doWhile.stmt);
15078 struct Expression * exp;
15080 if(stmt->forStmt.init)
15081 ProcessStatement(stmt->forStmt.init);
15082 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15084 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15085 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15086 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15088 if(stmt->forStmt.check)
15089 ProcessStatement(stmt->forStmt.check);
15090 if(stmt->forStmt.increment)
15092 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15093 ProcessExpressionType(exp);
15095 if(stmt->forStmt.stmt)
15096 ProcessStatement(stmt->forStmt.stmt);
15101 struct Identifier * id = stmt->forEachStmt.id;
15102 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15103 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15104 struct Statement * block = stmt->forEachStmt.stmt;
15105 char iteratorType[1024];
15106 struct Type * source;
15107 struct Expression * e;
15108 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));
15109 struct Expression * arrayExp;
15110 char * typeString = (((void *)0));
15111 int builtinCount = 0;
15113 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15117 FreeType(e->destType);
15118 e->destType = ProcessTypeString("Container", 0x0);
15120 if(!isBuiltin || e->next)
15121 ProcessExpressionType(e);
15123 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15124 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15126 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15127 struct Symbol * symbol;
15128 struct Expression * expIt = (((void *)0));
15129 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15130 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15131 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15132 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15135 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15136 stmt->compound.context->parent = curContext;
15137 curContext = stmt->compound.context;
15138 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15140 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15141 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15143 isCustomAVLTree = 0x1;
15144 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15146 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15149 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15151 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15153 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15156 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15160 struct Declarator * decl;
15161 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15163 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15164 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15165 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15169 struct Type * type = (((void *)0));
15170 char typeStringBuf[1024];
15172 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15173 if(((struct Expression *)(*exp).last)->type == 11)
15175 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15178 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15180 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)
15182 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15184 typeString = templateClass->templateArgs[2].dataTypeString;
15186 else if(arrayExp->list)
15188 struct Expression * e;
15190 for(e = (*arrayExp->list).first; e; e = e->next)
15192 ProcessExpressionType(e);
15202 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15206 e->expType = (((void *)0));
15207 e = (*arrayExp->list).first;
15208 ProcessExpressionType(e);
15211 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15213 FreeType(e->expType);
15214 e->expType = (((void *)0));
15216 type = (((void *)0));
15224 FreeType(e->expType);
15225 e->expType = (((void *)0));
15231 typeStringBuf[0] = '\0';
15232 PrintType(type, typeStringBuf, 0x0, 0x1);
15233 typeString = typeStringBuf;
15239 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15240 struct Declarator * decl;
15241 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15245 struct Expression * e;
15247 builtinCount = (*arrayExp->list).count;
15248 type = ProcessTypeString(typeString, 0x0);
15249 while(e = (*arrayExp->list).first)
15251 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15252 e->destType = type;
15254 ProcessExpressionType(e);
15255 ListAdd(initializers, MkInitializerAssignment(e));
15258 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15260 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15261 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15262 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15263 FreeList(exp, FreeExpression);
15267 arrayExp->expType = ProcessTypeString("Container", 0x0);
15268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15271 else if(isLinkList && !isList)
15273 struct Declarator * decl;
15274 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15276 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15277 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15278 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15280 else if(_class->templateArgs)
15283 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15285 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15286 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15288 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15289 if(block && block->type == 2 && block->compound.context)
15291 block->compound.context->parent = stmt->compound.context;
15295 block = MkIfStmt(filter, block, (((void *)0)));
15299 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));
15300 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15301 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15302 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15308 sprintf(count, "%d", builtinCount);
15309 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));
15310 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15311 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15312 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15314 else if(isLinkList && !isList)
15316 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15317 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15319 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15321 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));
15325 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15326 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15328 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));
15330 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15331 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15332 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15336 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15338 ProcessExpressionType(expIt);
15339 if((*stmt->compound.declarations).first)
15340 ProcessDeclaration((*stmt->compound.declarations).first);
15342 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15343 ProcessStatement(stmt);
15344 curContext = stmt->compound.context->parent;
15349 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15361 struct Expression * exp;
15363 if(stmt->expressions)
15365 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15369 if(curFunction && !curFunction->type)
15370 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15371 FreeType(exp->destType);
15372 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15374 exp->destType->refCount++;
15376 ProcessExpressionType(exp);
15383 ProcessDeclaration(stmt->decl);
15388 struct AsmField * field;
15390 if(stmt->asmStmt.inputFields)
15392 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15393 if(field->expression)
15394 ProcessExpressionType(field->expression);
15396 if(stmt->asmStmt.outputFields)
15398 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15399 if(field->expression)
15400 ProcessExpressionType(field->expression);
15402 if(stmt->asmStmt.clobberedFields)
15404 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15406 if(field->expression)
15407 ProcessExpressionType(field->expression);
15414 struct PropertyWatch * propWatch;
15415 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15416 struct Expression * object = stmt->_watch.object;
15417 struct Expression * watcher = stmt->_watch.watcher;
15420 ProcessExpressionType(watcher);
15422 ProcessExpressionType(object);
15425 if(watcher || thisClass)
15427 struct External * external = curExternal;
15428 struct Context * context = curContext;
15431 stmt->expressions = MkList();
15432 curExternal = external->prev;
15433 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15435 struct ClassFunction * func;
15436 char watcherName[1024];
15437 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15438 struct External * createdExternal;
15439 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15441 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15442 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15443 if(propWatch->deleteWatch)
15444 strcat(watcherName, "_delete");
15447 struct Identifier * propID;
15449 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15451 strcat(watcherName, "_");
15452 strcat(watcherName, propID->string);
15455 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15457 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15458 ProcessClassFunctionBody(func, propWatch->compound);
15459 propWatch->compound = (((void *)0));
15460 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15461 createdExternal->symbol->idCode = external->symbol->idCode;
15462 curExternal = createdExternal;
15463 ProcessFunction(createdExternal->function);
15465 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15467 externalDecl->declaration = decl;
15468 if(decl->symbol && !decl->symbol->pointerExternal)
15469 decl->symbol->pointerExternal = externalDecl;
15471 if(propWatch->deleteWatch)
15473 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15475 ListAdd(args, CopyExpression(object));
15476 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15477 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15478 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15482 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15483 struct Identifier * propID;
15485 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15487 char propName[1024];
15488 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15492 char getName[1024], setName[1024];
15493 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15495 DeclareProperty(prop, setName, getName);
15496 strcpy(propName, "__ecereProp_");
15497 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15498 strcat(propName, "_");
15499 FullClassNameCat(propName, prop->name, 0x1);
15500 ListAdd(args, CopyExpression(object));
15501 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15502 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15503 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15504 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15512 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15514 curExternal = external;
15515 curContext = context;
15517 FreeExpression(watcher);
15519 FreeExpression(object);
15520 FreeList(watches, FreePropertyWatch);
15523 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15527 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15529 ProcessStatement(propWatch->compound);
15536 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15537 struct Expression * object = stmt->_watch.object;
15538 struct __ecereNameSpace__ecere__com__Class * _class;
15541 ProcessExpressionType(object);
15544 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15547 struct Identifier * propID;
15550 stmt->expressions = MkList();
15551 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15553 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15560 for(propID = (*watches).first; propID; propID = propID->next)
15562 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15566 CreateFireWatcher(prop, object, stmt);
15569 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15574 struct __ecereNameSpace__ecere__com__Property * prop;
15575 struct __ecereNameSpace__ecere__com__Class * base;
15577 for(base = _class; base; base = base->base)
15579 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15581 if(prop->isProperty && prop->isWatchable)
15583 CreateFireWatcher(prop, object, stmt);
15589 FreeExpression(object);
15590 FreeList(watches, FreeIdentifier);
15593 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15599 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15600 struct Expression * object = stmt->_watch.object;
15601 struct Expression * watcher = stmt->_watch.watcher;
15602 struct __ecereNameSpace__ecere__com__Class * _class;
15605 ProcessExpressionType(object);
15607 ProcessExpressionType(watcher);
15610 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15611 if(watcher || thisClass)
15615 struct Identifier * propID;
15618 stmt->expressions = MkList();
15621 struct __ecereNameSpace__ecere__sys__OldList * args;
15624 ListAdd(args, CopyExpression(object));
15625 ListAdd(args, MkExpConstant("0"));
15626 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15627 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15631 for(propID = (*watches).first; propID; propID = propID->next)
15633 char propName[1024];
15634 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15638 char getName[1024], setName[1024];
15639 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15641 DeclareProperty(prop, setName, getName);
15642 strcpy(propName, "__ecereProp_");
15643 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15644 strcat(propName, "_");
15645 FullClassNameCat(propName, prop->name, 0x1);
15646 MangleClassName(propName);
15647 ListAdd(args, CopyExpression(object));
15648 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15649 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15650 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15653 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15657 FreeExpression(object);
15659 FreeExpression(watcher);
15660 FreeList(watches, FreeIdentifier);
15663 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15666 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15673 extern struct Expression * QBrackets(struct Expression * exp);
15675 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15677 extern struct Declarator * QMkPtrDecl(char * id);
15679 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15681 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15683 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15685 static void ProcessFunction(struct FunctionDefinition * function)
15687 void * __ecereTemp2;
15688 void * __ecereTemp1;
15689 struct Identifier * id = GetDeclId(function->declarator);
15690 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15691 struct Type * type = symbol ? symbol->type : (((void *)0));
15692 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15693 struct Context * oldTopContext = topContext;
15695 yylloc = function->loc;
15696 if(type && type->thisClass)
15698 struct Symbol * classSym = type->thisClass;
15699 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15700 char className[1024];
15701 char structName[1024];
15702 struct Declarator * funcDecl;
15703 struct Symbol * thisSymbol;
15704 unsigned int typedObject = 0x0;
15706 if(_class && !_class->base)
15708 _class = currentClass;
15709 if(_class && !_class->symbol)
15710 _class->symbol = FindClass(_class->fullName);
15711 classSym = _class ? _class->symbol : (((void *)0));
15714 thisClass = _class;
15715 if(inCompiler && _class)
15717 if(type->kind == 11)
15719 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15721 struct Type * param = symbol->type->params.first;
15723 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15726 if(type->classObjectType != 1)
15728 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15729 symbol->type->staticMethod = 0x1;
15730 symbol->type->thisClass = (((void *)0));
15731 symbol->type->extraParam = 0x0;
15734 strcpy(className, "__ecereClass_");
15735 FullClassNameCat(className, _class->fullName, 0x1);
15736 MangleClassName(className);
15737 structName[0] = (char)0;
15738 FullClassNameCat(structName, _class->fullName, 0x0);
15739 funcDecl = GetFuncDecl(function->declarator);
15742 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15744 struct TypeName * param = (*funcDecl->function.parameters).first;
15746 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15748 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15749 FreeTypeName(param);
15752 if(!function->propertyNoThis)
15754 struct TypeName * thisParam;
15756 if(type->classObjectType != 1)
15758 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15759 if(!funcDecl->function.parameters)
15760 funcDecl->function.parameters = MkList();
15761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15765 if(type->classObjectType != 1)
15767 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15768 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15770 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));
15771 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15775 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15777 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15779 funcDecl = GetFuncDecl(initDecl->declarator);
15782 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15784 struct TypeName * param = (*funcDecl->function.parameters).first;
15786 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15788 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15789 FreeTypeName(param);
15792 if(type->classObjectType != 1)
15794 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15796 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15798 if(!funcDecl->function.parameters)
15799 funcDecl->function.parameters = MkList();
15800 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15808 if(type->classObjectType != 1)
15810 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));
15811 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15812 if(typedObject && thisSymbol->type)
15814 thisSymbol->type->classObjectType = 2;
15815 thisSymbol->type->byReference = type->byReference;
15819 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15821 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15824 struct __ecereNameSpace__ecere__com__Class * base;
15826 for(base = _class; base && base->type != 1000; base = base->next)
15828 for(member = base->membersAndProperties.first; member; member = member->next)
15829 if(!member->isProperty)
15835 for(member = _class->membersAndProperties.first; member; member = member->next)
15836 if(!member->isProperty)
15840 char pointerName[1024];
15841 struct Declaration * decl;
15842 struct Initializer * initializer;
15843 struct Expression * exp, * bytePtr;
15845 strcpy(pointerName, "__ecerePointer_");
15846 FullClassNameCat(pointerName, _class->fullName, 0x0);
15848 char className[1024];
15850 strcpy(className, "__ecereClass_");
15851 FullClassNameCat(className, classSym->string, 0x1);
15852 MangleClassName(className);
15853 DeclareClass(classSym, className);
15855 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15860 sprintf(string, "%d", _class->offset);
15861 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15865 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15867 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15868 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));
15871 yylloc = function->body->loc;
15872 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15874 struct Context * prevContext = curContext;
15876 curContext = function->body->compound.context;
15877 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15878 curContext = prevContext;
15880 decl->symbol = (((void *)0));
15881 if(!function->body->compound.declarations)
15882 function->body->compound.declarations = MkList();
15883 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15889 thisClass = (((void *)0));
15892 FreeSpecifier(id->_class);
15893 id->_class = (((void *)0));
15894 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15896 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15898 id = GetDeclId(initDecl->declarator);
15899 FreeSpecifier(id->_class);
15900 id->_class = (((void *)0));
15904 topContext = function->body->compound.context;
15906 struct FunctionDefinition * oldFunction = curFunction;
15908 curFunction = function;
15910 ProcessStatement(function->body);
15911 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15913 struct Statement * prevCompound = curCompound;
15914 struct Context * prevContext = curContext;
15915 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15917 if(!function->body->compound.statements)
15918 function->body->compound.statements = MkList();
15919 ListAdd(function->body->compound.statements, fireWatchers);
15920 curCompound = function->body;
15921 curContext = function->body->compound.context;
15922 ProcessStatement(fireWatchers);
15923 curContext = prevContext;
15924 curCompound = prevCompound;
15926 curFunction = oldFunction;
15928 if(function->declarator)
15930 ProcessDeclarator(function->declarator);
15932 topContext = oldTopContext;
15933 thisClass = oldThisClass;
15936 extern void FreeSymbol(struct Symbol * symbol);
15938 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15940 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15942 struct ClassDef * def;
15943 struct External * external = curExternal;
15944 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15946 for(def = definitions->first; def; def = def->next)
15950 if(def->function->declarator)
15951 curExternal = def->function->declarator->symbol->pointerExternal;
15953 curExternal = external;
15954 ProcessFunction((struct FunctionDefinition *)def->function);
15956 else if(def->type == 2)
15958 if(def->decl->type == 2)
15960 thisClass = regClass;
15961 ProcessInstantiationType(def->decl->inst);
15962 thisClass = (((void *)0));
15966 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15969 thisClass = regClass;
15970 ProcessDeclaration(def->decl);
15971 thisClass = backThisClass;
15974 else if(def->type == 1 && def->defProperties)
15976 struct MemberInit * defProperty;
15977 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);
15979 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15980 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15982 thisClass = regClass;
15983 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15984 thisClass = (((void *)0));
15986 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15987 FreeSymbol(thisSymbol);
15989 else if(def->type == 3 && def->propertyDef)
15991 struct PropertyDef * prop = def->propertyDef;
15993 thisClass = regClass;
15998 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16000 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16002 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16003 ProcessStatement(prop->setStmt);
16009 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16011 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16013 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16014 ProcessStatement(prop->getStmt);
16016 if(prop->issetStmt)
16020 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16022 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16024 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16025 ProcessStatement(prop->issetStmt);
16027 thisClass = (((void *)0));
16029 else if(def->type == 4 && def->propertyWatch)
16031 struct PropertyWatch * propertyWatch = def->propertyWatch;
16033 thisClass = regClass;
16034 if(propertyWatch->compound)
16036 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);
16038 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16039 curExternal = (((void *)0));
16040 ProcessStatement(propertyWatch->compound);
16042 thisClass = (((void *)0));
16047 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16049 void ComputeDataTypes()
16051 void * __ecereTemp1;
16052 struct External * external;
16053 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16055 currentClass = (((void *)0));
16056 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16057 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16058 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16059 curExternal = temp;
16060 DeclareStruct("ecere::com::Class", 0x0);
16061 DeclareStruct("ecere::com::Instance", 0x0);
16062 DeclareStruct("ecere::com::Property", 0x0);
16063 DeclareStruct("ecere::com::DataMember", 0x0);
16064 DeclareStruct("ecere::com::Method", 0x0);
16065 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16066 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16067 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16068 for(external = (*ast).first; external; external = external->next)
16070 afterExternal = curExternal = external;
16071 if(external->type == 0)
16073 currentClass = external->function->_class;
16074 ProcessFunction(external->function);
16076 else if(external->type == 1)
16078 currentClass = (((void *)0));
16079 ProcessDeclaration(external->declaration);
16081 else if(external->type == 2)
16083 struct ClassDefinition * _class = external->_class;
16085 currentClass = external->symbol->registered;
16086 if(_class->definitions)
16088 ProcessClass(_class->definitions, _class->symbol);
16092 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16093 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16096 else if(external->type == 4)
16098 thisNameSpace = external->id->string;
16101 currentClass = (((void *)0));
16102 thisNameSpace = (((void *)0));
16103 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16104 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16107 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);
16109 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);
16111 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16113 struct __ecereNameSpace__ecere__com__Class * class;
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16129 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16130 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16131 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16132 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16133 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16134 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16135 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16136 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16137 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16138 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16139 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16140 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16141 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16142 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16143 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16144 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16145 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16146 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16147 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16148 __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);
16149 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16150 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16151 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16152 __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);
16153 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16154 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16155 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16156 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16157 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16158 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16159 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16160 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16161 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16162 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16163 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16164 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16165 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16166 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16167 __ecereClass_Conversion = class;
16168 __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);
16169 __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);
16170 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16171 __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);
16172 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16173 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16174 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16175 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16176 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16177 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16178 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16179 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16180 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16181 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16182 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16183 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16184 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16185 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16186 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16187 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16190 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)