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 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1152 struct __ecereNameSpace__ecere__sys__TempFile
1154 char __ecere_padding[24];
1157 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1159 extern int strlen(const char * );
1161 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1163 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1165 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1167 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1169 void PrintExpression(struct Expression * exp, char * string)
1172 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1176 OutputExpression(exp, f);
1177 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1178 count = strlen(string);
1179 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);
1180 string[count] = '\0';
1181 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1185 extern int isspace(int c);
1187 long long _strtoi64(char * string, char ** endString, int base)
1189 long long value = 0;
1194 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1206 if(ch == (char)0 && string[c + 1] == 'x')
1219 for(; (ch = string[c]); c++)
1223 else if(ch >= '1' && ch <= '9')
1225 else if(ch >= 'a' && ch <= 'z')
1227 else if(ch >= 'A' && ch <= 'Z')
1231 *endString = string + c;
1241 *endString = string + c;
1245 return sign * value;
1248 uint64 _strtoui64(char * string, char ** endString, int base)
1255 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1267 if(ch == (char)0 && string[c + 1] == 'x')
1280 for(; (ch = string[c]); c++)
1284 else if(ch >= '1' && ch <= '9')
1286 else if(ch >= 'a' && ch <= 'z')
1288 else if(ch >= 'A' && ch <= 'Z')
1293 *endString = string + c;
1304 *endString = string + c;
1308 return sign * value;
1311 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1313 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1315 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1317 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1319 if(!param->baseType)
1321 if(param->dataTypeString)
1322 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1324 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1326 return param->baseType;
1328 return (((void *)0));
1331 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1333 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1335 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1339 if(type1->kind == type2->kind)
1347 if(type1->passAsTemplate && !type2->passAsTemplate)
1349 return type1->isSigned != type2->isSigned;
1351 return type1->_class != type2->_class;
1353 return NeedCast(type1->type, type2->type);
1361 extern int strcmp(const char * , const char * );
1363 extern struct Context * curContext;
1365 extern struct Context * topContext;
1367 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1369 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);
1371 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1373 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);
1375 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);
1377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1379 struct __ecereNameSpace__ecere__com__ClassProperty
1382 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1383 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1384 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1386 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1387 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1388 char * dataTypeString;
1389 struct Type * dataType;
1390 unsigned int constant;
1393 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1395 extern struct Expression * QMkExpId(char * id);
1397 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1399 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1401 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1402 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1407 char * dataTypeString;
1410 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1412 char __ecere_padding[4];
1415 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1417 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1419 extern void FreeIdentifier(struct Identifier * id);
1421 void ProcessExpressionType(struct Expression * exp);
1423 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1425 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1427 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1429 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1431 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1433 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1435 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1437 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1439 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1441 if(exp->type == 0 && exp->identifier)
1443 struct Identifier * id = exp->identifier;
1444 struct Context * ctx;
1445 struct Symbol * symbol = (((void *)0));
1447 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1449 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1451 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1456 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1458 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1459 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1460 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1461 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1465 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1467 if(!prop && !method)
1468 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1469 if(!prop && !method && !member)
1471 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1473 if(prop || method || member || classProp)
1476 exp->member.member = id;
1477 exp->member.memberType = 0;
1478 exp->member.exp = QMkExpId("this");
1479 exp->addedThis = 0x1;
1481 else if(_class && _class->templateParams.first)
1483 struct __ecereNameSpace__ecere__com__Class * sClass;
1485 for(sClass = _class; sClass; sClass = sClass->base)
1487 if(sClass->templateParams.first)
1489 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1491 for(param = sClass->templateParams.first; param; param = param->next)
1493 if(param->type == 2 && !strcmp(param->name, id->string))
1495 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1499 struct Declarator * decl;
1500 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1502 FreeIdentifier(exp->member.member);
1503 ProcessExpressionType(argExp);
1504 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1505 exp->expType = ProcessType(specs, decl);
1507 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1518 extern int sprintf(char * , char * , ...);
1520 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1522 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1524 char * PrintInt(long long result)
1528 if(result > (((long long)0x7fffffffffffffffLL)))
1529 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1532 return __ecereNameSpace__ecere__sys__CopyString(temp);
1535 char * PrintUInt(uint64 result)
1539 if(result > (0xffffffff))
1540 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1541 else if(result > (((int)0x7fffffff)))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 char * PrintInt64(long long result)
1552 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 char * PrintUInt64(uint64 result)
1560 if(result > (((long long)0x7fffffffffffffffLL)))
1561 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1564 return __ecereNameSpace__ecere__sys__CopyString(temp);
1567 char * PrintHexUInt(uint64 result)
1571 if(result > (0xffffffff))
1572 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1574 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1575 return __ecereNameSpace__ecere__sys__CopyString(temp);
1578 char * PrintHexUInt64(uint64 result)
1582 if(result > (0xffffffff))
1583 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1586 return __ecereNameSpace__ecere__sys__CopyString(temp);
1589 char * PrintShort(short result)
1593 sprintf(temp, "%d", (unsigned short)result);
1594 return __ecereNameSpace__ecere__sys__CopyString(temp);
1597 char * PrintUShort(unsigned short result)
1601 if(result > (unsigned short)32767)
1602 sprintf(temp, "0x%X", (int)result);
1604 sprintf(temp, "%d", result);
1605 return __ecereNameSpace__ecere__sys__CopyString(temp);
1608 extern int isprint(int c);
1610 char * PrintChar(char result)
1614 if(result > (char)0 && isprint(result))
1615 sprintf(temp, "'%c'", result);
1616 else if(result < (char)0)
1617 sprintf(temp, "%d", result);
1619 sprintf(temp, "0x%X", (unsigned char)result);
1620 return __ecereNameSpace__ecere__sys__CopyString(temp);
1623 char * PrintUChar(unsigned char result)
1627 sprintf(temp, "0x%X", result);
1628 return __ecereNameSpace__ecere__sys__CopyString(temp);
1631 char * PrintFloat(float result)
1635 sprintf(temp, "%.16ff", result);
1636 return __ecereNameSpace__ecere__sys__CopyString(temp);
1639 char * PrintDouble(double result)
1643 sprintf(temp, "%.16f", result);
1644 return __ecereNameSpace__ecere__sys__CopyString(temp);
1647 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1651 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1652 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1653 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1654 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1655 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (* Neg)(struct Expression *, struct Operand *);
1657 unsigned int (* Inc)(struct Expression *, struct Operand *);
1658 unsigned int (* Dec)(struct Expression *, struct Operand *);
1659 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1660 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1661 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1671 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* Not)(struct Expression *, struct Operand *);
1677 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1679 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1688 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1694 unsigned int ptrSize;
1712 struct Operand GetOperand(struct Expression * exp);
1714 unsigned int GetInt(struct Expression * exp, int * value2)
1716 struct Operand op2 = GetOperand(exp);
1718 if(op2.kind == 3 && op2.type->isSigned)
1720 else if(op2.kind == 3)
1721 *value2 = (int)op2.ui;
1722 if(op2.kind == 4 && op2.type->isSigned)
1723 *value2 = (int)op2.i64;
1724 else if(op2.kind == 4)
1725 *value2 = (int)op2.ui64;
1726 else if(op2.kind == 2 && op2.type->isSigned)
1727 *value2 = (int)op2.s;
1728 else if(op2.kind == 2)
1729 *value2 = (int)op2.us;
1730 else if(op2.kind == 1 && op2.type->isSigned)
1731 *value2 = (int)op2.c;
1732 else if(op2.kind == 1)
1733 *value2 = (int)op2.uc;
1734 else if(op2.kind == 6)
1735 *value2 = (int)op2.f;
1736 else if(op2.kind == 7)
1737 *value2 = (int)op2.d;
1738 else if(op2.kind == 13)
1739 *value2 = (int)op2.ui;
1745 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1747 struct Operand op2 = GetOperand(exp);
1749 if(op2.kind == 3 && op2.type->isSigned)
1750 *value2 = (unsigned int)op2.i;
1751 else if(op2.kind == 3)
1753 if(op2.kind == 4 && op2.type->isSigned)
1754 *value2 = (unsigned int)op2.i64;
1755 else if(op2.kind == 4)
1756 *value2 = (unsigned int)op2.ui64;
1757 else if(op2.kind == 2 && op2.type->isSigned)
1758 *value2 = (unsigned int)op2.s;
1759 else if(op2.kind == 2)
1760 *value2 = (unsigned int)op2.us;
1761 else if(op2.kind == 1 && op2.type->isSigned)
1762 *value2 = (unsigned int)op2.c;
1763 else if(op2.kind == 1)
1764 *value2 = (unsigned int)op2.uc;
1765 else if(op2.kind == 6)
1766 *value2 = (unsigned int)op2.f;
1767 else if(op2.kind == 7)
1768 *value2 = (unsigned int)op2.d;
1769 else if(op2.kind == 13)
1776 unsigned int GetInt64(struct Expression * exp, long long * value2)
1778 struct Operand op2 = GetOperand(exp);
1780 if(op2.kind == 3 && op2.type->isSigned)
1781 *value2 = (long long)op2.i;
1782 else if(op2.kind == 3)
1783 *value2 = (long long)op2.ui;
1784 if(op2.kind == 4 && op2.type->isSigned)
1786 else if(op2.kind == 4)
1787 *value2 = (long long)op2.ui64;
1788 else if(op2.kind == 2 && op2.type->isSigned)
1789 *value2 = (long long)op2.s;
1790 else if(op2.kind == 2)
1791 *value2 = (long long)op2.us;
1792 else if(op2.kind == 1 && op2.type->isSigned)
1793 *value2 = (long long)op2.c;
1794 else if(op2.kind == 1)
1795 *value2 = (long long)op2.uc;
1796 else if(op2.kind == 6)
1797 *value2 = (long long)op2.f;
1798 else if(op2.kind == 7)
1799 *value2 = (long long)op2.d;
1800 else if(op2.kind == 13)
1801 *value2 = (long long)op2.ui;
1807 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1809 struct Operand op2 = GetOperand(exp);
1811 if(op2.kind == 3 && op2.type->isSigned)
1812 *value2 = (uint64)op2.i;
1813 else if(op2.kind == 3)
1814 *value2 = (uint64)op2.ui;
1815 if(op2.kind == 4 && op2.type->isSigned)
1816 *value2 = (uint64)op2.i64;
1817 else if(op2.kind == 4)
1819 else if(op2.kind == 2 && op2.type->isSigned)
1820 *value2 = (uint64)op2.s;
1821 else if(op2.kind == 2)
1822 *value2 = (uint64)op2.us;
1823 else if(op2.kind == 1 && op2.type->isSigned)
1824 *value2 = (uint64)op2.c;
1825 else if(op2.kind == 1)
1826 *value2 = (uint64)op2.uc;
1827 else if(op2.kind == 6)
1828 *value2 = (uint64)op2.f;
1829 else if(op2.kind == 7)
1830 *value2 = (uint64)op2.d;
1831 else if(op2.kind == 13)
1832 *value2 = (uint64)op2.ui;
1838 unsigned int GetShort(struct Expression * exp, short * value2)
1840 struct Operand op2 = GetOperand(exp);
1842 if(op2.kind == 3 && op2.type->isSigned)
1843 *value2 = (short)op2.i;
1844 else if(op2.kind == 3)
1845 *value2 = (short)op2.ui;
1846 if(op2.kind == 4 && op2.type->isSigned)
1847 *value2 = (short)op2.i64;
1848 else if(op2.kind == 4)
1849 *value2 = (short)op2.ui64;
1850 else if(op2.kind == 2 && op2.type->isSigned)
1852 else if(op2.kind == 2)
1853 *value2 = (short)op2.us;
1854 else if(op2.kind == 1 && op2.type->isSigned)
1855 *value2 = (short)op2.c;
1856 else if(op2.kind == 1)
1857 *value2 = (short)op2.uc;
1858 else if(op2.kind == 6)
1859 *value2 = (short)op2.f;
1860 else if(op2.kind == 7)
1861 *value2 = (short)op2.d;
1862 else if(op2.kind == 13)
1863 *value2 = (short)op2.ui;
1869 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1871 struct Operand op2 = GetOperand(exp);
1873 if(op2.kind == 3 && op2.type->isSigned)
1874 *value2 = (unsigned short)op2.i;
1875 else if(op2.kind == 3)
1876 *value2 = (unsigned short)op2.ui;
1877 if(op2.kind == 4 && op2.type->isSigned)
1878 *value2 = (unsigned short)op2.i64;
1879 else if(op2.kind == 4)
1880 *value2 = (unsigned short)op2.ui64;
1881 else if(op2.kind == 2 && op2.type->isSigned)
1882 *value2 = (unsigned short)op2.s;
1883 else if(op2.kind == 2)
1885 else if(op2.kind == 1 && op2.type->isSigned)
1886 *value2 = (unsigned short)op2.c;
1887 else if(op2.kind == 1)
1888 *value2 = (unsigned short)op2.uc;
1889 else if(op2.kind == 6)
1890 *value2 = (unsigned short)op2.f;
1891 else if(op2.kind == 7)
1892 *value2 = (unsigned short)op2.d;
1893 else if(op2.kind == 13)
1894 *value2 = (unsigned short)op2.ui;
1900 unsigned int GetChar(struct Expression * exp, char * value2)
1902 struct Operand op2 = GetOperand(exp);
1904 if(op2.kind == 3 && op2.type->isSigned)
1905 *value2 = (char)op2.i;
1906 else if(op2.kind == 3)
1907 *value2 = (char)op2.ui;
1908 if(op2.kind == 4 && op2.type->isSigned)
1909 *value2 = (char)op2.i64;
1910 else if(op2.kind == 4)
1911 *value2 = (char)op2.ui64;
1912 else if(op2.kind == 2 && op2.type->isSigned)
1913 *value2 = (char)op2.s;
1914 else if(op2.kind == 2)
1915 *value2 = (char)op2.us;
1916 else if(op2.kind == 1 && op2.type->isSigned)
1918 else if(op2.kind == 1)
1919 *value2 = (char)op2.uc;
1920 else if(op2.kind == 6)
1921 *value2 = (char)op2.f;
1922 else if(op2.kind == 7)
1923 *value2 = (char)op2.d;
1924 else if(op2.kind == 13)
1925 *value2 = (char)op2.ui;
1931 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1933 struct Operand op2 = GetOperand(exp);
1935 if(op2.kind == 3 && op2.type->isSigned)
1936 *value2 = (unsigned char)op2.i;
1937 else if(op2.kind == 3)
1938 *value2 = (unsigned char)op2.ui;
1939 if(op2.kind == 4 && op2.type->isSigned)
1940 *value2 = (unsigned char)op2.i64;
1941 else if(op2.kind == 4)
1942 *value2 = (unsigned char)op2.ui64;
1943 else if(op2.kind == 2 && op2.type->isSigned)
1944 *value2 = (unsigned char)op2.s;
1945 else if(op2.kind == 2)
1946 *value2 = (unsigned char)op2.us;
1947 else if(op2.kind == 1 && op2.type->isSigned)
1948 *value2 = (unsigned char)op2.c;
1949 else if(op2.kind == 1)
1951 else if(op2.kind == 6)
1952 *value2 = (unsigned char)op2.f;
1953 else if(op2.kind == 7)
1954 *value2 = (unsigned char)op2.d;
1955 else if(op2.kind == 13)
1956 *value2 = (unsigned char)op2.ui;
1962 unsigned int GetFloat(struct Expression * exp, float * value2)
1964 struct Operand op2 = GetOperand(exp);
1966 if(op2.kind == 3 && op2.type->isSigned)
1967 *value2 = (float)(float)op2.i;
1968 else if(op2.kind == 3)
1969 *value2 = (float)(float)op2.ui;
1970 if(op2.kind == 4 && op2.type->isSigned)
1971 *value2 = (float)(float)op2.i64;
1972 else if(op2.kind == 4)
1973 *value2 = (float)(float)op2.ui64;
1974 else if(op2.kind == 2 && op2.type->isSigned)
1975 *value2 = (float)(float)op2.s;
1976 else if(op2.kind == 2)
1977 *value2 = (float)(float)op2.us;
1978 else if(op2.kind == 1 && op2.type->isSigned)
1979 *value2 = (float)(float)op2.c;
1980 else if(op2.kind == 1)
1981 *value2 = (float)(float)op2.uc;
1982 else if(op2.kind == 6)
1983 *value2 = (float)op2.f;
1984 else if(op2.kind == 7)
1985 *value2 = (float)op2.d;
1986 else if(op2.kind == 13)
1987 *value2 = (float)(float)op2.ui;
1993 unsigned int GetDouble(struct Expression * exp, double * value2)
1995 struct Operand op2 = GetOperand(exp);
1997 if(op2.kind == 3 && op2.type->isSigned)
1998 *value2 = (double)(double)op2.i;
1999 else if(op2.kind == 3)
2000 *value2 = (double)(double)op2.ui;
2001 if(op2.kind == 4 && op2.type->isSigned)
2002 *value2 = (double)(double)op2.i64;
2003 else if(op2.kind == 4)
2004 *value2 = (double)(double)op2.ui64;
2005 else if(op2.kind == 2 && op2.type->isSigned)
2006 *value2 = (double)(double)op2.s;
2007 else if(op2.kind == 2)
2008 *value2 = (double)(double)op2.us;
2009 else if(op2.kind == 1 && op2.type->isSigned)
2010 *value2 = (double)(double)op2.c;
2011 else if(op2.kind == 1)
2012 *value2 = (double)(double)op2.uc;
2013 else if(op2.kind == 6)
2014 *value2 = (double)op2.f;
2015 else if(op2.kind == 7)
2016 *value2 = (double)op2.d;
2017 else if(op2.kind == 13)
2018 *value2 = (double)(double)op2.ui;
2024 void ComputeExpression(struct Expression * exp);
2026 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2028 int ComputeTypeSize(struct Type * type);
2030 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2032 struct __ecereNameSpace__ecere__com__BitMember
2034 struct __ecereNameSpace__ecere__com__BitMember * prev;
2035 struct __ecereNameSpace__ecere__com__BitMember * next;
2037 unsigned int isProperty;
2040 struct __ecereNameSpace__ecere__com__Class * _class;
2041 char * dataTypeString;
2042 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2043 struct Type * dataType;
2050 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2052 struct __ecereNameSpace__ecere__sys__OldLink
2054 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2055 struct __ecereNameSpace__ecere__sys__OldLink * next;
2059 void FinishTemplatesContext(struct Context * context);
2061 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2063 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2064 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2066 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2069 int unionMemberOffset = 0;
2072 if(!member && _class->destructionWatchOffset)
2073 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2075 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2077 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2079 if(!dataMember->isProperty)
2081 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2083 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2089 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2091 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2093 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2095 if(!isMember && _class->type == 2 && dataMember->dataType)
2097 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2101 ComputeTypeSize(dataMember->dataType);
2102 if(bitMember->pos == -1)
2103 bitMember->pos = _class->memberOffset;
2104 if(!bitMember->size)
2105 bitMember->size = dataMember->dataType->size * 8;
2106 _class->memberOffset = bitMember->pos + bitMember->size;
2107 for(d = 0; d < bitMember->size; d++)
2113 bitMember->mask = mask << bitMember->pos;
2115 else if(dataMember->type == 0 && dataMember->dataType)
2120 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2121 ComputeTypeSize(dataMember->dataType);
2122 if(dataMember->dataType->bitFieldCount)
2124 bitFields += dataMember->dataType->bitFieldCount;
2131 int size = (bitFields + 7) / 8;
2135 int __simpleStruct0;
2139 int __simpleStruct0;
2141 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2142 if(member->memberOffset % alignment)
2143 member->memberOffset += alignment - (member->memberOffset % alignment);
2145 dataMember->offset = member->memberOffset;
2146 if(member->type == 1)
2147 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2150 member->memberOffset += size;
2157 int __simpleStruct0;
2159 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2160 if(_class->memberOffset % alignment)
2161 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2163 dataMember->offset = _class->memberOffset;
2164 _class->memberOffset += size;
2168 size = dataMember->dataType->size;
2169 alignment = dataMember->dataType->alignment;
2173 int __simpleStruct0;
2177 int __simpleStruct0;
2179 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2180 if(member->memberOffset % alignment)
2181 member->memberOffset += alignment - (member->memberOffset % alignment);
2183 dataMember->offset = member->memberOffset;
2184 if(member->type == 1)
2185 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2188 member->memberOffset += size;
2195 int __simpleStruct0;
2197 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2198 if(_class->memberOffset % alignment)
2199 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2201 dataMember->offset = _class->memberOffset;
2202 _class->memberOffset += size;
2207 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2210 int __simpleStruct2;
2211 int __simpleStruct0, __simpleStruct1;
2213 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2214 dataMember->offset = member->memberOffset;
2215 if(member->type == 1)
2216 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2218 member->memberOffset += dataMember->memberOffset;
2222 int __simpleStruct0, __simpleStruct1;
2224 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2225 dataMember->offset = _class->memberOffset;
2226 _class->memberOffset += dataMember->memberOffset;
2234 int size = (bitFields + 7) / 8;
2238 int __simpleStruct0;
2242 int __simpleStruct0;
2244 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2245 if(member->memberOffset % alignment)
2246 member->memberOffset += alignment - (member->memberOffset % alignment);
2248 if(member->type == 1)
2249 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2252 member->memberOffset += size;
2259 int __simpleStruct0;
2261 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2262 if(_class->memberOffset % alignment)
2263 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2265 _class->memberOffset += size;
2270 if(member && member->type == 1)
2272 member->memberOffset = unionMemberOffset;
2276 if(_class->type != 2)
2278 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2281 struct __ecereNameSpace__ecere__com__Property * prop;
2283 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2285 if(prop->isProperty && prop->isWatchable)
2287 prop->watcherOffset = _class->structSize;
2288 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2293 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2295 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2297 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2299 if(deriv->computeSize)
2301 deriv->offset = _class->structSize;
2302 deriv->memberOffset = 0;
2303 deriv->structSize = deriv->offset;
2304 ComputeClassMembers(deriv, 0x0);
2312 FinishTemplatesContext(context);
2315 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2317 struct __ecereNameSpace__ecere__com__NameSpace
2320 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2321 struct __ecereNameSpace__ecere__com__NameSpace * left;
2322 struct __ecereNameSpace__ecere__com__NameSpace * right;
2324 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2325 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2326 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2327 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2328 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2333 struct __ecereNameSpace__ecere__com__Module
2335 struct __ecereNameSpace__ecere__com__Instance * application;
2336 struct __ecereNameSpace__ecere__sys__OldList classes;
2337 struct __ecereNameSpace__ecere__sys__OldList defines;
2338 struct __ecereNameSpace__ecere__sys__OldList functions;
2339 struct __ecereNameSpace__ecere__sys__OldList modules;
2340 struct __ecereNameSpace__ecere__com__Instance * prev;
2341 struct __ecereNameSpace__ecere__com__Instance * next;
2346 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2347 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2350 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2352 struct __ecereNameSpace__ecere__com__Class * _class;
2353 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2355 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2356 ComputeModuleClasses(subModule->data);
2357 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2358 ComputeClassMembers(_class, 0x0);
2361 extern unsigned int inCompiler;
2363 extern void Compiler_Error(char * format, ...);
2365 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2367 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2369 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2371 int ComputeTypeSize(struct Type * type)
2373 unsigned int size = type ? type->size : 0;
2375 if(!size && type && !type->computing)
2377 type->computing = 0x1;
2381 type->alignment = size = sizeof(char);
2384 type->alignment = size = sizeof(int);
2387 type->alignment = size = sizeof(long long);
2390 type->alignment = size = sizeof(long);
2393 type->alignment = size = sizeof(short);
2396 type->alignment = size = sizeof(float);
2399 type->alignment = size = sizeof(double);
2403 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2405 if(_class && _class->type == 1)
2407 ComputeClassMembers(_class, 0x0);
2408 type->alignment = _class->structAlignment;
2409 size = _class->structSize;
2410 if(type->alignment && size % type->alignment)
2411 size += type->alignment - (size % type->alignment);
2413 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2415 if(!_class->dataType)
2416 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2417 size = type->alignment = ComputeTypeSize(_class->dataType);
2420 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2425 size = type->alignment = sizeof(void *);
2428 if(type->arraySizeExp)
2430 ProcessExpressionType(type->arraySizeExp);
2431 ComputeExpression(type->arraySizeExp);
2432 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)))
2434 struct Location oldLoc = yylloc;
2435 char expression[10240];
2437 expression[0] = '\0';
2438 type->arraySizeExp->expType = (((void *)0));
2439 yylloc = type->arraySizeExp->loc;
2441 PrintExpression(type->arraySizeExp, expression);
2442 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2445 GetInt(type->arraySizeExp, &type->arraySize);
2447 else if(type->enumClass)
2449 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2451 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2454 type->arraySize = 0;
2458 type->arraySize = 0;
2460 size = ComputeTypeSize(type->type) * type->arraySize;
2461 type->alignment = type->type->alignment;
2465 struct Type * member;
2467 for(member = type->members.first; member; member = member->next)
2469 int __simpleStruct0, __simpleStruct1;
2470 unsigned int addSize = ComputeTypeSize(member);
2472 member->offset = size;
2473 if(member->alignment && size % member->alignment)
2474 member->offset += member->alignment - (size % member->alignment);
2475 size = member->offset;
2476 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2479 if(type->alignment && size % type->alignment)
2480 size += type->alignment - (size % type->alignment);
2485 struct Type * member;
2487 for(member = type->members.first; member; member = member->next)
2489 int __simpleStruct0, __simpleStruct1;
2490 unsigned int addSize = ComputeTypeSize(member);
2492 member->offset = size;
2493 if(member->alignment && size % member->alignment)
2494 member->offset += member->alignment - (size % member->alignment);
2495 size = member->offset;
2496 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2497 size = ((size > addSize) ? size : addSize);
2499 if(type->alignment && size % type->alignment)
2500 size += type->alignment - (size % type->alignment);
2505 struct TemplateParameter * param = type->templateParameter;
2506 struct Type * baseType = ProcessTemplateParameterType(param);
2509 size = ComputeTypeSize(baseType);
2511 size = sizeof(uint64);
2524 size = sizeof(void *);
2529 type->computing = 0x0;
2534 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2536 extern struct Identifier * MkIdentifier(char * string);
2538 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2540 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2542 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2544 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2546 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2548 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2550 extern void FreeType(struct Type * type);
2552 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2554 extern struct Specifier * MkSpecifier(int specifier);
2556 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2558 extern struct Expression * MkExpConstant(char * string);
2560 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)
2562 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2563 unsigned int totalSize = 0;
2564 unsigned int maxSize = 0;
2565 int alignment, size;
2566 struct __ecereNameSpace__ecere__com__DataMember * member;
2567 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2569 if(!isMember && _class->base)
2571 maxSize = _class->structSize;
2573 if(_class->type == 1 || _class->type == 5)
2574 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2576 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2579 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2581 if(!member->isProperty)
2583 switch(member->type)
2587 if(member->dataTypeString)
2589 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2590 struct Declarator * decl;
2592 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2593 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2594 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2595 if(!member->dataType)
2596 member->dataType = ProcessType(specs, decl);
2597 ReplaceThisClassSpecifiers(specs, topClass);
2599 struct Type * type = ProcessType(specs, decl);
2601 DeclareType(member->dataType, 0x0, 0x0);
2604 ComputeTypeSize(member->dataType);
2605 size = member->dataType->size;
2606 alignment = member->dataType->alignment;
2609 if(totalSize % alignment)
2610 totalSize += alignment - (totalSize % alignment);
2619 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2622 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2623 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2624 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2625 alignment = member->structAlignment;
2628 if(totalSize % alignment)
2629 totalSize += alignment - (totalSize % alignment);
2639 unsigned int __simpleStruct0;
2641 if(topMember && topMember->type == 1)
2642 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2644 *retSize += totalSize;
2646 else if(totalSize < maxSize && _class->type != 1000)
2648 char sizeString[50];
2650 sprintf(sizeString, "%d", maxSize - totalSize);
2651 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2654 FinishTemplatesContext(context);
2655 return topMember ? topMember->memberID : _class->memberID;
2658 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2660 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2661 unsigned int totalSize = 0;
2662 struct __ecereNameSpace__ecere__com__DataMember * member;
2663 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2665 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2666 DeclareMembers(_class->base, 0x0);
2667 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2669 if(!member->isProperty)
2671 switch(member->type)
2675 if(!member->dataType && member->dataTypeString)
2676 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2677 if(member->dataType)
2678 DeclareType(member->dataType, 0x0, 0x0);
2684 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2691 FinishTemplatesContext(context);
2692 return topMember ? topMember->memberID : _class->memberID;
2695 extern struct Symbol * FindClass(char * name);
2697 extern char * strchr(char * , int);
2699 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2701 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2703 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2705 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2707 extern char * strcpy(char * , const char * );
2709 extern void MangleClassName(char * className);
2711 extern void DeclareClass(struct Symbol * classSym, char * className);
2713 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2715 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2717 void DeclareStruct(char * name, unsigned int skipNoHead)
2719 struct External * external = (((void *)0));
2720 struct Symbol * classSym = FindClass(name);
2722 if(!inCompiler || !classSym)
2723 return (((void *)0));
2724 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2725 return (((void *)0));
2726 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2728 struct Declaration * decl;
2729 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2730 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2731 char structName[1024];
2733 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2734 classSym->declaring++;
2735 if(strchr(classSym->string, '<'))
2737 if(classSym->registered->templateClass)
2739 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2740 classSym->declaring--;
2742 return (((void *)0));
2744 DeclareMembers(classSym->registered, 0x0);
2745 structName[0] = (char)0;
2746 FullClassNameCat(structName, name, 0x0);
2749 classSym->declaredStructSym = 0x1;
2750 declarations = MkList();
2751 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2752 if(!(*declarations).count)
2754 FreeList(declarations, (((void *)0)));
2755 declarations = (((void *)0));
2758 if(skipNoHead || declarations)
2760 if(external && external->declaration)
2762 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2763 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2765 if(classSym->structExternal)
2766 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2767 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2768 classSym->id = curExternal->symbol->idCode;
2769 classSym->idCode = curExternal->symbol->idCode;
2775 external = MkExternalDeclaration((((void *)0)));
2776 specifiers = MkList();
2777 declarators = MkList();
2778 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2779 external->declaration = decl = MkDeclaration(specifiers, declarators);
2780 if(decl->symbol && !decl->symbol->pointerExternal)
2781 decl->symbol->pointerExternal = external;
2782 if(classSym->registered && classSym->registered->type == 1)
2784 char className[1024];
2786 strcpy(className, "__ecereClass_");
2787 FullClassNameCat(className, classSym->string, 0x1);
2788 MangleClassName(className);
2789 DeclareClass(classSym, className);
2790 external->symbol = classSym;
2791 classSym->pointerExternal = external;
2792 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2793 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2797 char className[1024];
2799 strcpy(className, "__ecereClass_");
2800 FullClassNameCat(className, classSym->string, 0x1);
2801 MangleClassName(className);
2802 classSym->structExternal = external;
2803 DeclareClass(classSym, className);
2804 external->symbol = classSym;
2806 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2809 classSym->declaring--;
2811 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2813 classSym->declaring++;
2815 if(classSym->registered)
2816 DeclareMembers(classSym->registered, 0x0);
2818 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2820 if(classSym->structExternal)
2821 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2822 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2823 classSym->id = curExternal->symbol->idCode;
2824 classSym->idCode = curExternal->symbol->idCode;
2826 classSym->declaring--;
2830 extern char * strcat(char * , const char * );
2832 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2834 extern struct ModuleImport * mainModule;
2836 extern struct Specifier * MkSpecifierName(char * name);
2838 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2840 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2842 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2844 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2846 extern void FreeDeclarator(struct Declarator * decl);
2848 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2850 struct PropertyImport
2852 struct PropertyImport * prev;
2853 struct PropertyImport * next;
2855 unsigned int isVirtual;
2856 unsigned int hasSet;
2857 unsigned int hasGet;
2860 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2862 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2864 void * __ecereTemp1;
2865 struct Symbol * symbol = prop->symbol;
2866 char propName[1024];
2868 strcpy(setName, "__ecereProp_");
2869 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2870 strcat(setName, "_Set_");
2871 FullClassNameCat(setName, prop->name, 0x1);
2872 strcpy(getName, "__ecereProp_");
2873 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2874 strcat(getName, "_Get_");
2875 FullClassNameCat(getName, prop->name, 0x1);
2876 strcpy(propName, "__ecereProp_");
2877 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2878 strcat(propName, "_");
2879 FullClassNameCat(propName, prop->name, 0x1);
2880 MangleClassName(getName);
2881 MangleClassName(setName);
2882 MangleClassName(propName);
2883 if(prop->_class->type == 1)
2884 DeclareStruct(prop->_class->fullName, 0x0);
2885 if(!symbol || curExternal->symbol->idCode < symbol->id)
2887 unsigned int imported = 0x0;
2888 unsigned int dllImport = 0x0;
2890 if(!symbol || symbol->_import)
2894 struct Symbol * classSym;
2896 if(!prop->_class->symbol)
2897 prop->_class->symbol = FindClass(prop->_class->fullName);
2898 classSym = prop->_class->symbol;
2899 if(classSym && !classSym->_import)
2901 struct ModuleImport * module;
2903 if(prop->_class->module)
2904 module = FindModule(prop->_class->module);
2906 module = mainModule;
2907 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));
2908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2910 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2911 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));
2913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2916 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2921 struct Context * context = SetupTemplatesContext(prop->_class);
2923 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2924 FinishTemplatesContext(context);
2928 if(!symbol->externalGet || symbol->externalGet->type == 0)
2930 struct Declaration * decl;
2931 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2932 struct Declarator * d;
2933 struct __ecereNameSpace__ecere__sys__OldList * params;
2934 struct Specifier * spec;
2935 struct External * external;
2936 struct Declarator * typeDecl;
2937 unsigned int simple = 0x0;
2939 specifiers = MkList();
2940 declarators = MkList();
2942 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2943 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2945 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2947 struct Context * context = SetupTemplatesContext(prop->_class);
2949 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2950 FinishTemplatesContext(context);
2952 for(spec = (*specifiers).first; spec; spec = spec->next)
2956 if((!typeDecl || typeDecl->type == 1))
2958 struct Symbol * classSym = spec->symbol;
2960 symbol->_class = classSym->registered;
2961 if(classSym->registered && classSym->registered->type == 1)
2963 DeclareStruct(spec->name, 0x0);
2970 d = PlugDeclarator(typeDecl, d);
2973 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2974 specifiers = MkList();
2976 d = MkDeclaratorFunction(d, params);
2978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
2979 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2980 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2982 ListAdd(specifiers, MkSpecifier(VOID));
2983 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2984 decl = MkDeclaration(specifiers, declarators);
2985 external = MkExternalDeclaration(decl);
2986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2987 external->symbol = symbol;
2988 symbol->externalGet = external;
2989 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2991 FreeDeclarator(typeDecl);
2995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3000 if(!symbol->externalSet || symbol->externalSet->type == 0)
3002 struct Declaration * decl;
3003 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3004 struct Declarator * d;
3005 struct __ecereNameSpace__ecere__sys__OldList * params;
3006 struct Specifier * spec;
3007 struct External * external;
3008 struct Declarator * typeDecl;
3010 declarators = MkList();
3012 if(!prop->conversion || prop->_class->type == 1)
3014 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3016 specifiers = MkList();
3018 struct Context * context = SetupTemplatesContext(prop->_class);
3020 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3021 FinishTemplatesContext(context);
3023 ListAdd(params, MkTypeName(specifiers, d));
3024 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3026 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3027 d = MkDeclaratorFunction(d, params);
3028 for(spec = (*specifiers).first; spec; spec = spec->next)
3032 if((!typeDecl || typeDecl->type == 1))
3034 struct Symbol * classSym = spec->symbol;
3036 symbol->_class = classSym->registered;
3037 if(classSym->registered && classSym->registered->type == 1)
3038 DeclareStruct(spec->name, 0x0);
3042 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3043 specifiers = MkList();
3045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3046 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3048 if(!prop->conversion || prop->_class->type == 1)
3049 ListAdd(specifiers, MkSpecifier(VOID));
3051 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3052 decl = MkDeclaration(specifiers, declarators);
3053 external = MkExternalDeclaration(decl);
3054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3055 external->symbol = symbol;
3056 symbol->externalSet = external;
3057 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3064 if(!symbol->externalPtr)
3066 struct Declaration * decl;
3067 struct External * external;
3068 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3071 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3073 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3074 ListAdd(specifiers, MkSpecifierName("Property"));
3076 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3078 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3081 strcpy(propName, "__ecerePropM_");
3082 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3083 strcat(propName, "_");
3084 FullClassNameCat(propName, prop->name, 0x1);
3085 MangleClassName(propName);
3086 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3088 decl = MkDeclaration(specifiers, list);
3090 external = MkExternalDeclaration(decl);
3091 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3092 external->symbol = symbol;
3093 symbol->externalPtr = external;
3097 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3099 symbol->id = curExternal->symbol->idCode;
3103 struct Type * Dereference(struct Type * source)
3105 void * __ecereTemp1;
3106 struct Type * type = (((void *)0));
3110 if(source->kind == 13 || source->kind == 12)
3112 type = source->type;
3113 source->type->refCount++;
3115 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3117 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3119 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3125 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3130 static struct Type * Reference(struct Type * source)
3132 void * __ecereTemp1;
3133 struct Type * type = (((void *)0));
3137 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));
3143 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);
3145 extern void * memcpy(void * , const void * , unsigned int size);
3147 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3149 extern void FreeExpression(struct Expression * exp);
3151 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3153 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);
3155 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3157 extern struct Type * MkClassType(char * name);
3159 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);
3161 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)
3163 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3164 unsigned int found = 0x0;
3165 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3166 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3167 unsigned int freeType = 0x0;
3169 yylloc = member->loc;
3174 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3178 dataMember = *curMember;
3184 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3185 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3186 int _subMemberStackPos = 0;
3189 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3192 dataMember = thisMember;
3193 if(curMember && thisMember->memberAccess == 1)
3195 *curMember = thisMember;
3196 *curClass = thisMember->_class;
3197 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3198 *subMemberStackPos = _subMemberStackPos;
3204 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3205 if(method && method->type == 1)
3208 method = (((void *)0));
3213 struct Type * type = (((void *)0));
3217 if(!dataMember->dataType && dataMember->dataTypeString)
3219 struct Context * context = SetupTemplatesContext(_class);
3221 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3222 FinishTemplatesContext(context);
3224 type = dataMember->dataType;
3228 if(!method->dataType)
3229 ProcessMethodType(method);
3230 type = method->dataType;
3232 if(ident && ident->next)
3234 for(ident = ident->next; ident && type; ident = ident->next)
3238 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3240 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3242 type = dataMember->dataType;
3244 else if(type->kind == 9 || type->kind == 10)
3246 struct Type * memberType;
3248 for(memberType = type->members.first; memberType; memberType = memberType->next)
3250 if(!strcmp(memberType->name, ident->string))
3259 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3262 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3263 struct __ecereNameSpace__ecere__com__Class * sClass;
3265 for(sClass = _class; sClass; sClass = sClass->base)
3268 if(sClass->templateClass)
3269 sClass = sClass->templateClass;
3270 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3272 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3274 for(sClass = sClass->base; sClass; sClass = sClass->base)
3276 if(sClass->templateClass)
3277 sClass = sClass->templateClass;
3278 id += sClass->templateParams.count;
3289 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3291 if(arg.dataTypeString)
3293 type = ProcessTypeString(arg.dataTypeString, 0x0);
3295 if(type && _class->templateClass)
3296 type->passAsTemplate = 0x1;
3303 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3305 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3306 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3310 char templateString[1024];
3311 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3313 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3314 for(cClass = expClass; cClass; cClass = cClass->base)
3318 if(cClass->templateClass)
3319 cClass = cClass->templateClass;
3320 for(param = cClass->templateParams.first; param; param = param->next)
3323 struct __ecereNameSpace__ecere__com__Class * sClass;
3324 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3326 for(sClass = cClass->base; sClass; sClass = sClass->base)
3328 if(sClass->templateClass)
3329 sClass = sClass->templateClass;
3330 id += sClass->templateParams.count;
3332 arg = expClass->templateArgs[id];
3333 for(sClass = _class; sClass; sClass = sClass->base)
3335 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3337 struct __ecereNameSpace__ecere__com__Class * nextClass;
3339 if(sClass->templateClass)
3340 sClass = sClass->templateClass;
3341 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3343 if(nextClass->templateClass)
3344 nextClass = nextClass->templateClass;
3345 p += nextClass->templateParams.count;
3347 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3349 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3351 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3353 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3354 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3368 char expString[1024];
3369 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3370 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3371 struct Expression * exp;
3372 char * string = PrintHexUInt64(arg.expression.ui64);
3374 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3375 ProcessExpressionType(exp);
3376 ComputeExpression(exp);
3377 expString[0] = '\0';
3378 PrintExpression(exp, expString);
3379 strcat(argument, expString);
3380 FreeExpression(exp);
3385 strcat(argument, arg.member->name);
3390 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3391 strcat(argument, arg.dataTypeString);
3398 strcat(templateString, ", ");
3399 if(lastParam != p - 1)
3401 strcat(templateString, param->name);
3402 strcat(templateString, " = ");
3404 strcat(templateString, argument);
3413 int len = strlen(templateString);
3415 if(templateString[len - 1] == '<')
3419 if(templateString[len - 1] == '>')
3420 templateString[len++] = ' ';
3421 templateString[len++] = '>';
3423 templateString[len++] = '\0';
3426 struct Context * context = SetupTemplatesContext(_class);
3430 type = ProcessTypeString(templateString, 0x0);
3432 FinishTemplatesContext(context);
3435 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3437 ProcessExpressionType(member->initializer->exp);
3438 if(!member->initializer->exp->expType)
3442 char expString[10240];
3444 expString[0] = '\0';
3445 PrintExpression(member->initializer->exp, expString);
3446 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3450 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3452 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3455 else if(member->initializer)
3457 ProcessInitializer(member->initializer, type);
3464 if(_class && _class->type == 3)
3466 if(member->initializer)
3468 struct Type * type = MkClassType(_class->fullName);
3470 ProcessInitializer(member->initializer, type);
3476 if(member->initializer)
3478 ProcessInitializer(member->initializer, (((void *)0)));
3484 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3488 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3490 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3494 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3499 extern struct Identifier * GetDeclId(struct Declarator * decl);
3501 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);
3503 extern void FreeSpecifier(struct Specifier * spec);
3505 static void ProcessFunction(struct FunctionDefinition * function);
3507 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3509 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3511 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3513 extern void FreeClassFunction(struct ClassFunction * func);
3515 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3517 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3519 void ProcessInstantiationType(struct Instantiation * inst)
3524 struct MembersInit * members;
3525 struct Symbol * classSym;
3526 struct __ecereNameSpace__ecere__com__Class * _class;
3528 classSym = inst->_class->symbol;
3529 _class = classSym ? classSym->registered : (((void *)0));
3530 if(!_class || _class->type != 5)
3531 DeclareStruct(inst->_class->name, 0x0);
3532 afterExternal = afterExternal ? afterExternal : curExternal;
3534 ProcessExpressionType(inst->exp);
3535 inst->isConstant = 0x1;
3538 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3539 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3540 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3541 int subMemberStackPos = 0;
3543 for(members = (*inst->members).first; members; members = members->next)
3545 switch(members->type)
3550 static unsigned int instMethodID = 0;
3551 struct External * external = curExternal;
3552 struct Context * context = curContext;
3553 struct Declarator * declarator = members->function->declarator;
3554 struct Identifier * nameID = GetDeclId(declarator);
3555 char * unmangled = nameID ? nameID->string : (((void *)0));
3556 struct Expression * exp;
3557 struct External * createdExternal = (((void *)0));
3563 strcpy(name, "__ecereInstMeth_");
3564 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3566 strcat(name, nameID->string);
3568 sprintf(number, "_%08d", instMethodID++);
3569 strcat(name, number);
3570 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3574 struct Symbol * symbol = declarator->symbol;
3575 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3577 if(method && method->type == 1)
3579 symbol->method = method;
3580 ProcessMethodType(method);
3581 if(!symbol->type->thisClass)
3583 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3585 if(!currentClass->symbol)
3586 currentClass->symbol = FindClass(currentClass->fullName);
3587 symbol->type->thisClass = currentClass->symbol;
3592 _class->symbol = FindClass(_class->fullName);
3593 symbol->type->thisClass = _class->symbol;
3596 DeclareType(symbol->type, 0x1, 0x1);
3600 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3603 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3606 FreeSpecifier(nameID->_class);
3607 nameID->_class = (((void *)0));
3611 struct Type * type = declarator->symbol->type;
3612 struct External * oldExternal = curExternal;
3614 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3616 struct External * externalDecl;
3618 externalDecl = MkExternalDeclaration((((void *)0)));
3619 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3620 if(createdExternal->function)
3622 ProcessFunction(createdExternal->function);
3624 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3626 externalDecl->declaration = decl;
3627 if(decl->symbol && !decl->symbol->pointerExternal)
3628 decl->symbol->pointerExternal = externalDecl;
3629 declarator->symbol->pointerExternal = externalDecl;
3636 curExternal = declarator->symbol->pointerExternal;
3637 ProcessFunction((struct FunctionDefinition *)members->function);
3639 curExternal = external;
3640 curContext = context;
3643 FreeClassFunction(members->function);
3644 exp = QMkExpId(name);
3646 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3647 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3653 if(members->dataMembers && classSym)
3655 struct MemberInit * member;
3656 struct Location oldyyloc = yylloc;
3658 for(member = (*members->dataMembers).first; member; member = member->next)
3660 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3661 if(member->initializer && !member->initializer->isConstant)
3662 inst->isConstant = 0x0;
3674 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3678 if(type->kind == 11)
3680 struct Type * param;
3684 for(param = type->params.first; param; param = param->next)
3685 DeclareType(param, declarePointers, 0x1);
3687 DeclareType(type->returnType, declarePointers, 0x1);
3689 else if(type->kind == 13 && declarePointers)
3690 DeclareType(type->type, declarePointers, 0x0);
3691 else if(type->kind == 8)
3693 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3694 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3696 else if(type->kind == 9 || type->kind == 10)
3698 struct Type * member;
3700 for(member = type->members.first; member; member = member->next)
3701 DeclareType(member, 0x0, 0x0);
3703 else if(type->kind == 12)
3704 DeclareType(type->arrayType, declarePointers, 0x0);
3708 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3710 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3712 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3714 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3715 struct __ecereNameSpace__ecere__com__Class * sClass;
3717 for(sClass = _class; sClass; sClass = sClass->base)
3720 if(sClass->templateClass)
3721 sClass = sClass->templateClass;
3722 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3724 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3726 for(sClass = sClass->base; sClass; sClass = sClass->base)
3728 if(sClass->templateClass)
3729 sClass = sClass->templateClass;
3730 id += sClass->templateParams.count;
3741 arg = &_class->templateArgs[id];
3742 if(arg && param->type == 0)
3743 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3748 extern struct Context * PushContext(void);
3750 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3752 struct TemplatedType
3755 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3756 struct __ecereNameSpace__ecere__sys__BTNode * left;
3757 struct __ecereNameSpace__ecere__sys__BTNode * right;
3759 struct TemplateParameter * param;
3762 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3764 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3766 void * __ecereTemp1;
3767 struct Context * context = PushContext();
3769 context->templateTypesOnly = 0x1;
3770 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3772 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3774 for(; param; param = param->next)
3776 if(param->type == 0 && param->identifier)
3778 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3780 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3786 struct __ecereNameSpace__ecere__com__Class * sClass;
3788 for(sClass = _class; sClass; sClass = sClass->base)
3790 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3792 for(p = sClass->templateParams.first; p; p = p->next)
3796 struct TemplateParameter * param = p->param;
3797 struct TemplatedType * type;
3801 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));
3803 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));
3804 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3812 extern void PopContext(struct Context * ctx);
3814 extern void FreeContext(struct Context * context);
3816 void FinishTemplatesContext(struct Context * context)
3818 PopContext(context);
3819 FreeContext(context);
3820 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3823 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3825 if(!method->dataType)
3827 struct Context * context = SetupTemplatesContext(method->_class);
3829 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3830 FinishTemplatesContext(context);
3831 if(method->type != 1 && method->dataType)
3833 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3835 if(!method->_class->symbol)
3836 method->_class->symbol = FindClass(method->_class->fullName);
3837 method->dataType->thisClass = method->_class->symbol;
3843 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3847 struct Context * context = SetupTemplatesContext(prop->_class);
3849 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3850 FinishTemplatesContext(context);
3854 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3856 extern void FreeTypeName(struct TypeName * typeName);
3858 static void ProcessDeclarator(struct Declarator * decl);
3860 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3862 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3866 struct MethodImport * prev;
3867 struct MethodImport * next;
3869 unsigned int isVirtual;
3872 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3874 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3876 void * __ecereTemp1;
3877 struct Symbol * symbol = method->symbol;
3879 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3881 unsigned int imported = 0x0;
3882 unsigned int dllImport = 0x0;
3884 if(!method->dataType)
3885 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3886 if(!symbol || symbol->_import || method->type == 1)
3888 if(!symbol || method->type == 1)
3890 struct Symbol * classSym;
3892 if(!method->_class->symbol)
3893 method->_class->symbol = FindClass(method->_class->fullName);
3894 classSym = method->_class->symbol;
3895 if(!classSym->_import)
3897 struct ModuleImport * module;
3899 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3900 module = FindModule(method->_class->module);
3902 module = mainModule;
3903 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));
3904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3908 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3910 if(!symbol->_import)
3912 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));
3913 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3917 symbol->type = method->dataType;
3919 symbol->type->refCount++;
3922 if(!method->dataType->dllExport)
3925 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3929 if(method->type != 1 && method->dataType)
3930 DeclareType(method->dataType, 0x1, 0x1);
3931 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3933 struct Declaration * decl;
3934 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3935 struct Declarator * d;
3936 struct Declarator * funcDecl;
3937 struct External * external;
3939 specifiers = MkList();
3940 declarators = MkList();
3942 ListAdd(specifiers, MkSpecifier(EXTERN));
3943 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3944 ListAdd(specifiers, MkSpecifier(STATIC));
3945 if(method->type == 1)
3947 ListAdd(specifiers, MkSpecifier(INT));
3948 d = MkDeclaratorIdentifier(MkIdentifier(name));
3952 d = MkDeclaratorIdentifier(MkIdentifier(name));
3954 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3956 struct Context * context = SetupTemplatesContext(method->_class);
3958 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3959 FinishTemplatesContext(context);
3961 funcDecl = GetFuncDecl(d);
3964 struct Specifier * spec, * next;
3966 for(spec = (*specifiers).first; spec; spec = next)
3971 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3972 FreeSpecifier(spec);
3976 if(method->dataType && !method->dataType->staticMethod)
3978 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3980 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3981 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")));
3982 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3983 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3985 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
3987 struct TypeName * param = (*funcDecl->function.parameters).first;
3989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3990 FreeTypeName(param);
3992 if(!funcDecl->function.parameters)
3993 funcDecl->function.parameters = MkList();
3994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
3998 ProcessDeclarator(d);
3999 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4000 decl = MkDeclaration(specifiers, declarators);
4001 ReplaceThisClassSpecifiers(specifiers, method->_class);
4002 if(symbol->pointerExternal)
4004 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4007 *functionSymbol = *symbol;
4008 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4009 if(functionSymbol->type)
4010 functionSymbol->type->refCount++;
4012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4013 symbol->pointerExternal->symbol = functionSymbol;
4015 external = MkExternalDeclaration(decl);
4017 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4018 external->symbol = symbol;
4019 symbol->pointerExternal = external;
4023 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4025 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4029 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4031 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4033 unsigned int first = 0x1;
4035 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4037 char className[1024];
4039 strcpy(className, _class->fullName);
4040 for(param = _class->templateParams.first; param; param = param->next)
4044 strcat(className, "<");
4046 strcat(className, ", ");
4047 if(lastParam + 1 != p)
4049 strcat(className, param->name);
4050 strcat(className, " = ");
4052 strcat(className, param->name);
4060 int len = strlen(className);
4062 if(className[len - 1] == '>')
4063 className[len++] = ' ';
4064 className[len++] = '>';
4065 className[len++] = '\0';
4067 return __ecereNameSpace__ecere__sys__CopyString(className);
4070 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4073 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4075 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4077 unsigned int first = 0x1;
4079 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4081 char className[1024];
4083 strcpy(className, _class->fullName);
4084 for(param = _class->templateParams.first; param; param = param->next)
4088 strcat(className, "<");
4090 strcat(className, ", ");
4091 if(lastParam + 1 != p)
4093 strcat(className, param->name);
4094 strcat(className, " = ");
4096 strcat(className, param->name);
4104 int len = strlen(className);
4106 if(className[len - 1] == '>')
4107 className[len++] = ' ';
4108 className[len++] = '>';
4109 className[len++] = '\0';
4111 return MkClassType(className);
4115 return MkClassType(_class->fullName);
4119 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4121 if(specs != (((void *)0)) && _class)
4123 struct Specifier * spec;
4125 for(spec = specs->first; spec; spec = spec->next)
4127 if(spec->type == 0 && spec->specifier == THISCLASS)
4130 spec->name = ReplaceThisClass(_class);
4131 spec->symbol = FindClass(spec->name);
4137 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4139 struct __ecereNameSpace__ecere__com__GlobalFunction
4141 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4142 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4145 struct __ecereNameSpace__ecere__com__Instance * module;
4146 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4147 char * dataTypeString;
4148 struct Type * dataType;
4152 extern struct Context * globalContext;
4154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4156 struct FunctionImport
4158 struct FunctionImport * prev;
4159 struct FunctionImport * next;
4163 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4165 void * __ecereTemp1;
4166 struct Symbol * symbol = function->symbol;
4168 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4170 unsigned int imported = 0x0;
4171 unsigned int dllImport = 0x0;
4173 if(!function->dataType)
4175 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4176 if(!function->dataType->thisClass)
4177 function->dataType->staticMethod = 0x1;
4183 struct ModuleImport * module = FindModule(function->module);
4185 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4188 if(!function->dataType->dllExport)
4190 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));
4191 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4195 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4196 if(!symbol->type->thisClass)
4197 symbol->type->staticMethod = 0x1;
4200 imported = symbol->_import ? 0x1 : 0x0;
4201 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4204 DeclareType(function->dataType, 0x1, 0x1);
4207 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4209 struct Declaration * decl;
4210 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4211 struct Declarator * d;
4212 struct Declarator * funcDecl;
4213 struct External * external;
4215 specifiers = MkList();
4216 declarators = MkList();
4217 ListAdd(specifiers, MkSpecifier(EXTERN));
4218 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4220 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4221 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4222 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4224 struct Specifier * spec;
4226 for(spec = (*specifiers).first; spec; spec = spec->next)
4227 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4230 FreeSpecifier(spec);
4234 funcDecl = GetFuncDecl(d);
4235 if(funcDecl && !funcDecl->function.parameters)
4237 funcDecl->function.parameters = MkList();
4238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4240 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4242 struct Context * oldCtx = curContext;
4244 curContext = globalContext;
4245 decl = MkDeclaration(specifiers, declarators);
4246 curContext = oldCtx;
4248 if(symbol->pointerExternal)
4250 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4253 *functionSymbol = *symbol;
4254 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4255 if(functionSymbol->type)
4256 functionSymbol->type->refCount++;
4258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4259 symbol->pointerExternal->symbol = functionSymbol;
4261 external = MkExternalDeclaration(decl);
4263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4264 external->symbol = symbol;
4265 symbol->pointerExternal = external;
4269 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4272 symbol->id = curExternal->symbol->idCode;
4275 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4278 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4283 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4284 struct __ecereNameSpace__ecere__sys__BTNode * left;
4285 struct __ecereNameSpace__ecere__sys__BTNode * right;
4287 struct __ecereNameSpace__ecere__com__Instance * module;
4288 char * dataTypeString;
4289 struct Type * dataType;
4294 void DeclareGlobalData(struct GlobalData * data)
4296 struct Symbol * symbol = data->symbol;
4298 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4303 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4306 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4307 DeclareType(data->dataType, 0x1, 0x1);
4310 if(!symbol->pointerExternal)
4312 struct Declaration * decl;
4313 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4314 struct Declarator * d;
4315 struct External * external;
4317 specifiers = MkList();
4318 declarators = MkList();
4319 ListAdd(specifiers, MkSpecifier(EXTERN));
4320 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4321 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4322 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4323 decl = MkDeclaration(specifiers, declarators);
4324 external = MkExternalDeclaration(decl);
4326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4327 external->symbol = symbol;
4328 symbol->pointerExternal = external;
4332 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4335 symbol->id = curExternal->symbol->idCode;
4342 struct Conversion * prev, * next;
4343 struct __ecereNameSpace__ecere__com__Property * convert;
4345 struct Type * resultType;
4348 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4350 extern void Compiler_Warning(char * format, ...);
4352 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4354 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)
4358 if(source->kind == 20 && dest->kind != 20)
4360 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4365 if(dest->kind == 20 && source->kind != 20)
4367 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4372 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4376 if(source->classObjectType == 3 && dest->classObjectType != 2)
4380 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4382 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4385 if(dest->kind == 14 && source->kind != 0)
4387 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))
4389 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))
4391 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4393 if(source->_class->registered && source->_class->registered->type == 3)
4395 if(conversions != (((void *)0)))
4397 if(source->_class->registered == dest->_class->registered)
4402 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4404 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4406 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4408 if(sourceBase == destBase)
4412 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))
4416 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4418 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4425 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4429 if(source->kind == 8)
4431 struct __ecereNameSpace__ecere__com__Class * _class;
4433 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4435 struct __ecereNameSpace__ecere__com__Property * convert;
4437 for(convert = _class->conversions.first; convert; convert = convert->next)
4439 if(convert->memberAccess == 1 || _class->module == privateModule)
4441 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4443 if(!convert->dataType)
4444 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4445 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4447 if(!conversions && !convert->Get)
4449 else if(conversions != (((void *)0)))
4451 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))
4455 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4457 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4468 struct __ecereNameSpace__ecere__com__Class * _class;
4470 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4472 struct __ecereNameSpace__ecere__com__Property * convert;
4474 for(convert = _class->conversions.first; convert; convert = convert->next)
4476 if(convert->memberAccess == 1 || _class->module == privateModule)
4478 if(!convert->dataType)
4479 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4480 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4482 if(!conversions && !convert->Set)
4484 else if(conversions != (((void *)0)))
4486 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))
4490 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4500 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4502 if(!dest->_class->registered->dataType)
4503 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4504 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4506 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4513 if(source->kind == 8)
4515 struct __ecereNameSpace__ecere__com__Class * _class;
4517 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4519 struct __ecereNameSpace__ecere__com__Property * convert;
4521 for(convert = _class->conversions.first; convert; convert = convert->next)
4523 if(convert->memberAccess == 1 || _class->module == privateModule)
4525 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4527 if(!convert->dataType)
4528 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4529 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4531 if(!conversions && !convert->Get)
4533 else if(conversions != (((void *)0)))
4535 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))
4539 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4549 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4551 if(!source->_class->registered->dataType)
4552 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4553 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4560 if(source->kind == 8 || source->kind == 19)
4562 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4564 else if(dest->kind == 7 && source->kind == 6)
4566 else if(dest->kind == 2 && source->kind == 1)
4568 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4570 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4572 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4574 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4576 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)))
4578 struct Type * paramSource, * paramDest;
4580 if(dest->kind == 16)
4581 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4582 if(source->kind == 16)
4583 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4584 if(dest->kind == 13 && dest->type->kind == 11)
4586 if(source->kind == 13 && source->type->kind == 11)
4587 source = source->type;
4588 if(dest->kind == 16)
4589 dest = dest->method->dataType;
4590 if(source->kind == 16)
4591 source = source->method->dataType;
4592 paramSource = source->params.first;
4593 if(paramSource && paramSource->kind == 0)
4594 paramSource = (((void *)0));
4595 paramDest = dest->params.first;
4596 if(paramDest && paramDest->kind == 0)
4597 paramDest = (((void *)0));
4598 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4600 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))))
4602 if(paramDest && paramDest->kind == 8)
4603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4608 paramDest = paramDest->next;
4610 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4612 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4616 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4624 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4627 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4629 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4633 paramSource = paramSource->next;
4639 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4641 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4647 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4649 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4655 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4657 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4660 for(; paramDest; paramDest = paramDest->next)
4664 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4668 struct Type * paramDestType = paramDest;
4669 struct Type * paramSourceType = paramSource;
4670 struct Type * type = paramDestType;
4672 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4675 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
4676 struct __ecereNameSpace__ecere__com__Class * sClass;
4678 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4681 if(sClass->templateClass)
4682 sClass = sClass->templateClass;
4683 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4685 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4687 for(sClass = sClass->base; sClass; sClass = sClass->base)
4689 if(sClass->templateClass)
4690 sClass = sClass->templateClass;
4691 id += sClass->templateParams.count;
4702 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4704 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4707 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)))
4712 PrintType(paramDest, type, 0x0, 0x1);
4713 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4714 if(paramDestType != paramDest)
4715 FreeType(paramDestType);
4718 if(paramDestType != paramDest)
4719 FreeType(paramDestType);
4721 paramSource = paramSource->next;
4725 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4730 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4734 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4736 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4743 static void FreeConvert(struct Conversion * convert)
4745 if(convert->resultType)
4746 FreeType(convert->resultType);
4749 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4751 struct __ecereNameSpace__ecere__com__BTNamedLink
4754 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4755 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4756 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4761 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4763 struct __ecereNameSpace__ecere__com__EnumClassData
4765 struct __ecereNameSpace__ecere__sys__OldList values;
4769 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4771 struct __ecereNameSpace__ecere__sys__NamedLink
4773 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4774 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4779 extern void FreeExpContents(struct Expression * exp);
4781 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4783 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4785 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4787 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4789 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4791 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4793 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4795 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)))
4797 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4799 if(_class->type == 4)
4801 struct __ecereNameSpace__ecere__sys__OldList converts =
4805 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4809 _class->symbol = FindClass(_class->fullName);
4810 type->_class = _class->symbol;
4811 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4813 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4814 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4818 struct __ecereNameSpace__ecere__com__Class * baseClass;
4820 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4822 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4824 for(value = e->values.first; value; value = value->next)
4826 if(!strcmp(value->name, string))
4831 FreeExpContents(sourceExp);
4832 FreeType(sourceExp->expType);
4833 sourceExp->isConstant = 0x1;
4834 sourceExp->expType = MkClassType(baseClass->fullName);
4838 sourceExp->type = 2;
4839 if(!strcmp(baseClass->dataTypeString, "int"))
4840 sprintf(constant, "%d", value->data);
4842 sprintf(constant, "0x%X", value->data);
4843 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4845 while(converts.first)
4847 struct Conversion * convert = converts.first;
4849 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4850 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4852 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4859 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4860 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4863 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)))
4864 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4869 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4871 struct __ecereNameSpace__ecere__com__SubModule
4873 struct __ecereNameSpace__ecere__com__SubModule * prev;
4874 struct __ecereNameSpace__ecere__com__SubModule * next;
4875 struct __ecereNameSpace__ecere__com__Instance * module;
4879 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4881 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4883 if(searchFor == searchIn)
4885 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4887 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4889 if(ModuleVisibility(subModule->module, searchFor))
4896 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4898 struct __ecereNameSpace__ecere__com__Application
4903 unsigned int isGUIApp;
4904 struct __ecereNameSpace__ecere__sys__OldList allModules;
4905 char * parsedCommand;
4906 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4909 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4911 struct __ecereNameSpace__ecere__com__Instance * module;
4913 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->systemNameSpace, sourceExp, dest, string, conversions))
4915 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4917 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4919 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4921 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4927 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
4929 void ReadString(char * output, char * string);
4931 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4933 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
4935 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4937 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4939 void * __ecereTemp1;
4940 struct Type * source = sourceExp->expType;
4941 struct Type * realDest = dest;
4943 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4945 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4947 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4949 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4951 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4953 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4955 if(sourceBase == destBase)
4961 struct __ecereNameSpace__ecere__sys__OldList * specs;
4962 unsigned int flag = 0x0;
4963 long long value = (((int)0x7fffffff));
4967 if(sourceExp->type == 2)
4969 if(source->isSigned)
4970 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4972 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4974 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4976 if(source->isSigned)
4977 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4979 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4981 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4984 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));
4988 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4990 if(_class && _class->type == 3)
4992 if(source->kind != 8)
4994 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4995 struct Type * tempDest, * tempSource;
4997 for(; _class->base->type != 1000; _class = _class->base)
5000 tempDest = tempType;
5003 _class->symbol = FindClass(_class->fullName);
5004 tempType->_class = _class->symbol;
5005 tempType->truth = dest->truth;
5006 if(tempType->_class)
5007 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5008 FreeType(sourceExp->expType);
5009 sourceExp->expType = dest;
5012 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5015 if(_class && _class->type == 2 && source->kind != 8)
5017 if(!dest->_class->registered->dataType)
5018 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5019 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5022 FreeType(sourceExp->expType);
5023 source = sourceExp->expType = MkClassType(dest->_class->string);
5027 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5029 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5030 struct Declarator * decl;
5033 ReadString(string, sourceExp->string);
5034 decl = SpecDeclFromString(string, specs, (((void *)0)));
5035 FreeExpContents(sourceExp);
5036 FreeType(sourceExp->expType);
5037 sourceExp->type = 26;
5038 sourceExp->_classExp.specifiers = specs;
5039 sourceExp->_classExp.decl = decl;
5040 sourceExp->expType = dest;
5047 else if(source->kind == 8)
5049 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5051 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5055 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5056 struct Type * tempDest, * tempSource;
5058 if(!source->_class->registered->dataType)
5059 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5060 for(; _class->base->type != 1000; _class = _class->base)
5063 tempSource = tempType;
5065 tempType->_class = FindClass(_class->fullName);
5066 tempType->truth = source->truth;
5067 tempType->classObjectType = source->classObjectType;
5068 if(tempType->_class)
5069 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5070 if(conversions->last)
5072 ((struct Conversion *)conversions->last)->resultType = dest;
5075 FreeType(sourceExp->expType);
5076 sourceExp->expType = MkClassType(_class->fullName);
5077 sourceExp->expType->truth = source->truth;
5078 sourceExp->expType->classObjectType = source->classObjectType;
5079 if(!sourceExp->destType)
5081 FreeType(sourceExp->destType);
5082 sourceExp->destType = sourceExp->expType;
5083 if(sourceExp->expType)
5084 sourceExp->expType->refCount++;
5086 if(!_class->dataType)
5087 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5089 dest = MkClassType(source->_class->string);
5090 dest->truth = source->truth;
5091 dest->classObjectType = source->classObjectType;
5093 source = _class->dataType;
5095 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5101 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5110 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5112 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5114 if(_class->type == 0 || _class->type == 5)
5116 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5118 *newExp = *sourceExp;
5119 if(sourceExp->destType)
5120 sourceExp->destType->refCount++;
5121 if(sourceExp->expType)
5122 sourceExp->expType->refCount++;
5123 sourceExp->type = 11;
5124 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5125 sourceExp->cast.exp = newExp;
5126 FreeType(sourceExp->expType);
5127 sourceExp->expType = (((void *)0));
5128 ProcessExpressionType(sourceExp);
5131 FreeType(sourceExp->expType);
5132 sourceExp->expType = dest;
5139 if(!_class->dataType)
5140 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5142 dest = _class->dataType;
5145 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5147 specs = MkListOne(MkSpecifier(DOUBLE));
5149 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5151 specs = MkListOne(MkSpecifier(FLOAT));
5153 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5157 ListAdd(specs, MkSpecifier(UNSIGNED));
5158 ListAdd(specs, MkSpecifier(INT64));
5160 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5164 ListAdd(specs, MkSpecifier(UNSIGNED));
5165 ListAdd(specs, MkSpecifier(INT));
5167 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5171 ListAdd(specs, MkSpecifier(UNSIGNED));
5172 ListAdd(specs, MkSpecifier(SHORT));
5174 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5178 ListAdd(specs, MkSpecifier(UNSIGNED));
5179 ListAdd(specs, MkSpecifier(CHAR));
5188 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))
5190 specs = MkListOne(MkSpecifier(DOUBLE));
5192 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5194 specs = MkListOne(MkSpecifier(FLOAT));
5196 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)))
5200 ListAdd(specs, MkSpecifier(UNSIGNED));
5201 ListAdd(specs, MkSpecifier(CHAR));
5203 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)))))
5207 ListAdd(specs, MkSpecifier(UNSIGNED));
5208 ListAdd(specs, MkSpecifier(SHORT));
5210 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5214 ListAdd(specs, MkSpecifier(UNSIGNED));
5215 ListAdd(specs, MkSpecifier(INT));
5217 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5221 ListAdd(specs, MkSpecifier(UNSIGNED));
5222 ListAdd(specs, MkSpecifier(INT64));
5224 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5226 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5236 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5238 *newExp = *sourceExp;
5239 newExp->prev = (((void *)0));
5240 newExp->next = (((void *)0));
5241 if(sourceExp->destType)
5242 sourceExp->destType->refCount++;
5243 if(sourceExp->expType)
5244 sourceExp->expType->refCount++;
5245 sourceExp->type = 11;
5246 if(realDest->kind == 8)
5248 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5249 FreeList(specs, FreeSpecifier);
5252 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5253 if(newExp->type == 4)
5255 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5258 sourceExp->cast.exp = newExp;
5259 FreeType(sourceExp->expType);
5260 sourceExp->expType = (((void *)0));
5261 ProcessExpressionType(sourceExp);
5264 FreeList(specs, FreeSpecifier);
5271 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5272 sourceExp = (*sourceExp->list).last;
5273 if(sourceExp->type == 0)
5275 struct Identifier * id = sourceExp->identifier;
5279 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5281 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5282 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5286 for(; _class && _class->type == 4; _class = _class->base)
5288 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5289 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5291 for(value = e->values.first; value; value = value->next)
5293 if(!strcmp(value->name, id->string))
5298 FreeExpContents(sourceExp);
5299 FreeType(sourceExp->expType);
5300 sourceExp->isConstant = 0x1;
5301 sourceExp->expType = MkClassType(_class->fullName);
5305 sourceExp->type = 2;
5306 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5307 sprintf(constant, "%d", value->data);
5309 sprintf(constant, "0x%X", value->data);
5310 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5318 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5325 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5327 int value2 = op2->i;
5330 exp->string = PrintInt(op1->i + value2);
5333 exp->expType = op1->type;
5335 op1->type->refCount++;
5340 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5342 unsigned int value2 = op2->ui;
5345 exp->string = PrintUInt(op1->ui + value2);
5348 exp->expType = op1->type;
5350 op1->type->refCount++;
5355 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5357 short value2 = op2->s;
5360 exp->string = PrintShort(op1->s + value2);
5363 exp->expType = op1->type;
5365 op1->type->refCount++;
5370 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5372 unsigned short value2 = op2->us;
5375 exp->string = PrintUShort(op1->us + value2);
5378 exp->expType = op1->type;
5380 op1->type->refCount++;
5385 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5387 char value2 = op2->c;
5390 exp->string = PrintChar(op1->c + value2);
5393 exp->expType = op1->type;
5395 op1->type->refCount++;
5400 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5402 unsigned char value2 = op2->uc;
5405 exp->string = PrintUChar(op1->uc + value2);
5408 exp->expType = op1->type;
5410 op1->type->refCount++;
5415 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5417 float value2 = op2->f;
5420 exp->string = PrintFloat(op1->f + value2);
5423 exp->expType = op1->type;
5425 op1->type->refCount++;
5430 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5432 double value2 = op2->d;
5435 exp->string = PrintDouble(op1->d + value2);
5438 exp->expType = op1->type;
5440 op1->type->refCount++;
5445 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5447 int value2 = op2->i;
5450 exp->string = PrintInt(op1->i - value2);
5453 exp->expType = op1->type;
5455 op1->type->refCount++;
5460 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5462 unsigned int value2 = op2->ui;
5465 exp->string = PrintUInt(op1->ui - value2);
5468 exp->expType = op1->type;
5470 op1->type->refCount++;
5475 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5477 short value2 = op2->s;
5480 exp->string = PrintShort(op1->s - value2);
5483 exp->expType = op1->type;
5485 op1->type->refCount++;
5490 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5492 unsigned short value2 = op2->us;
5495 exp->string = PrintUShort(op1->us - value2);
5498 exp->expType = op1->type;
5500 op1->type->refCount++;
5505 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5507 char value2 = op2->c;
5510 exp->string = PrintChar(op1->c - value2);
5513 exp->expType = op1->type;
5515 op1->type->refCount++;
5520 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5522 unsigned char value2 = op2->uc;
5525 exp->string = PrintUChar(op1->uc - value2);
5528 exp->expType = op1->type;
5530 op1->type->refCount++;
5535 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5537 float value2 = op2->f;
5540 exp->string = PrintFloat(op1->f - value2);
5543 exp->expType = op1->type;
5545 op1->type->refCount++;
5550 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5552 double value2 = op2->d;
5555 exp->string = PrintDouble(op1->d - value2);
5558 exp->expType = op1->type;
5560 op1->type->refCount++;
5565 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5567 int value2 = op2->i;
5570 exp->string = PrintInt(op1->i * value2);
5573 exp->expType = op1->type;
5575 op1->type->refCount++;
5580 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5582 unsigned int value2 = op2->ui;
5585 exp->string = PrintUInt(op1->ui * value2);
5588 exp->expType = op1->type;
5590 op1->type->refCount++;
5595 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5597 short value2 = op2->s;
5600 exp->string = PrintShort(op1->s * value2);
5603 exp->expType = op1->type;
5605 op1->type->refCount++;
5610 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5612 unsigned short value2 = op2->us;
5615 exp->string = PrintUShort(op1->us * value2);
5618 exp->expType = op1->type;
5620 op1->type->refCount++;
5625 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5627 char value2 = op2->c;
5630 exp->string = PrintChar(op1->c * value2);
5633 exp->expType = op1->type;
5635 op1->type->refCount++;
5640 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5642 unsigned char value2 = op2->uc;
5645 exp->string = PrintUChar(op1->uc * value2);
5648 exp->expType = op1->type;
5650 op1->type->refCount++;
5655 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5657 float value2 = op2->f;
5660 exp->string = PrintFloat(op1->f * value2);
5663 exp->expType = op1->type;
5665 op1->type->refCount++;
5670 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5672 double value2 = op2->d;
5675 exp->string = PrintDouble(op1->d * value2);
5678 exp->expType = op1->type;
5680 op1->type->refCount++;
5685 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5687 int value2 = op2->i;
5690 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5693 exp->expType = op1->type;
5695 op1->type->refCount++;
5700 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5702 unsigned int value2 = op2->ui;
5705 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5708 exp->expType = op1->type;
5710 op1->type->refCount++;
5715 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5717 short value2 = op2->s;
5720 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5723 exp->expType = op1->type;
5725 op1->type->refCount++;
5730 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5732 unsigned short value2 = op2->us;
5735 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5738 exp->expType = op1->type;
5740 op1->type->refCount++;
5745 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5747 char value2 = op2->c;
5750 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5753 exp->expType = op1->type;
5755 op1->type->refCount++;
5760 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5762 unsigned char value2 = op2->uc;
5765 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5768 exp->expType = op1->type;
5770 op1->type->refCount++;
5775 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5777 float value2 = op2->f;
5780 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5783 exp->expType = op1->type;
5785 op1->type->refCount++;
5790 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5792 double value2 = op2->d;
5795 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5798 exp->expType = op1->type;
5800 op1->type->refCount++;
5805 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5807 int value2 = op2->i;
5810 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5813 exp->expType = op1->type;
5815 op1->type->refCount++;
5820 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5822 unsigned int value2 = op2->ui;
5825 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5828 exp->expType = op1->type;
5830 op1->type->refCount++;
5835 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5837 short value2 = op2->s;
5840 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5843 exp->expType = op1->type;
5845 op1->type->refCount++;
5850 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 unsigned short value2 = op2->us;
5855 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5858 exp->expType = op1->type;
5860 op1->type->refCount++;
5865 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 char value2 = op2->c;
5870 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5873 exp->expType = op1->type;
5875 op1->type->refCount++;
5880 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 unsigned char value2 = op2->uc;
5885 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5888 exp->expType = op1->type;
5890 op1->type->refCount++;
5895 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5898 exp->string = PrintInt(-op1->i);
5901 exp->expType = op1->type;
5903 op1->type->refCount++;
5908 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5911 exp->string = PrintUInt(-op1->ui);
5914 exp->expType = op1->type;
5916 op1->type->refCount++;
5921 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5924 exp->string = PrintShort(-op1->s);
5927 exp->expType = op1->type;
5929 op1->type->refCount++;
5934 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5937 exp->string = PrintUShort(-op1->us);
5940 exp->expType = op1->type;
5942 op1->type->refCount++;
5947 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5950 exp->string = PrintChar(-op1->c);
5953 exp->expType = op1->type;
5955 op1->type->refCount++;
5960 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5963 exp->string = PrintUChar(-op1->uc);
5966 exp->expType = op1->type;
5968 op1->type->refCount++;
5973 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5976 exp->string = PrintFloat(-op1->f);
5979 exp->expType = op1->type;
5981 op1->type->refCount++;
5986 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5989 exp->string = PrintDouble(-op1->d);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6002 exp->string = PrintInt(++op1->i);
6005 exp->expType = op1->type;
6007 op1->type->refCount++;
6012 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6015 exp->string = PrintUInt(++op1->ui);
6018 exp->expType = op1->type;
6020 op1->type->refCount++;
6025 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6028 exp->string = PrintShort(++op1->s);
6031 exp->expType = op1->type;
6033 op1->type->refCount++;
6038 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6041 exp->string = PrintUShort(++op1->us);
6044 exp->expType = op1->type;
6046 op1->type->refCount++;
6051 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6054 exp->string = PrintChar(++op1->c);
6057 exp->expType = op1->type;
6059 op1->type->refCount++;
6064 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6067 exp->string = PrintUChar(++op1->uc);
6070 exp->expType = op1->type;
6072 op1->type->refCount++;
6077 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6080 exp->string = PrintFloat(++op1->f);
6083 exp->expType = op1->type;
6085 op1->type->refCount++;
6090 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6093 exp->string = PrintDouble(++op1->d);
6096 exp->expType = op1->type;
6098 op1->type->refCount++;
6103 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6106 exp->string = PrintInt(--op1->i);
6109 exp->expType = op1->type;
6111 op1->type->refCount++;
6116 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6119 exp->string = PrintUInt(--op1->ui);
6122 exp->expType = op1->type;
6124 op1->type->refCount++;
6129 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6132 exp->string = PrintShort(--op1->s);
6135 exp->expType = op1->type;
6137 op1->type->refCount++;
6142 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6145 exp->string = PrintUShort(--op1->us);
6148 exp->expType = op1->type;
6150 op1->type->refCount++;
6155 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6158 exp->string = PrintChar(--op1->c);
6161 exp->expType = op1->type;
6163 op1->type->refCount++;
6168 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6171 exp->string = PrintUChar(--op1->uc);
6174 exp->expType = op1->type;
6176 op1->type->refCount++;
6181 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6184 exp->string = PrintFloat(--op1->f);
6187 exp->expType = op1->type;
6189 op1->type->refCount++;
6194 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6197 exp->string = PrintDouble(--op1->d);
6200 exp->expType = op1->type;
6202 op1->type->refCount++;
6207 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6209 int value2 = op2->i;
6212 exp->string = PrintInt(op1->i = value2);
6215 exp->expType = op1->type;
6217 op1->type->refCount++;
6222 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6224 unsigned int value2 = op2->ui;
6227 exp->string = PrintUInt(op1->ui = value2);
6230 exp->expType = op1->type;
6232 op1->type->refCount++;
6237 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6239 short value2 = op2->s;
6242 exp->string = PrintShort(op1->s = value2);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6254 unsigned short value2 = op2->us;
6257 exp->string = PrintUShort(op1->us = value2);
6260 exp->expType = op1->type;
6262 op1->type->refCount++;
6267 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6269 char value2 = op2->c;
6272 exp->string = PrintChar(op1->c = value2);
6275 exp->expType = op1->type;
6277 op1->type->refCount++;
6282 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6284 unsigned char value2 = op2->uc;
6287 exp->string = PrintUChar(op1->uc = value2);
6290 exp->expType = op1->type;
6292 op1->type->refCount++;
6297 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6299 float value2 = op2->f;
6302 exp->string = PrintFloat(op1->f = value2);
6305 exp->expType = op1->type;
6307 op1->type->refCount++;
6312 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6314 double value2 = op2->d;
6317 exp->string = PrintDouble(op1->d = value2);
6320 exp->expType = op1->type;
6322 op1->type->refCount++;
6327 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6329 int value2 = op2->i;
6332 exp->string = PrintInt(op1->i += value2);
6335 exp->expType = op1->type;
6337 op1->type->refCount++;
6342 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6344 unsigned int value2 = op2->ui;
6347 exp->string = PrintUInt(op1->ui += value2);
6350 exp->expType = op1->type;
6352 op1->type->refCount++;
6357 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6359 short value2 = op2->s;
6362 exp->string = PrintShort(op1->s += value2);
6365 exp->expType = op1->type;
6367 op1->type->refCount++;
6372 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6374 unsigned short value2 = op2->us;
6377 exp->string = PrintUShort(op1->us += value2);
6380 exp->expType = op1->type;
6382 op1->type->refCount++;
6387 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6389 char value2 = op2->c;
6392 exp->string = PrintChar(op1->c += value2);
6395 exp->expType = op1->type;
6397 op1->type->refCount++;
6402 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6404 unsigned char value2 = op2->uc;
6407 exp->string = PrintUChar(op1->uc += value2);
6410 exp->expType = op1->type;
6412 op1->type->refCount++;
6417 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6419 float value2 = op2->f;
6422 exp->string = PrintFloat(op1->f += value2);
6425 exp->expType = op1->type;
6427 op1->type->refCount++;
6432 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6434 double value2 = op2->d;
6437 exp->string = PrintDouble(op1->d += value2);
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6449 int value2 = op2->i;
6452 exp->string = PrintInt(op1->i -= value2);
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6464 unsigned int value2 = op2->ui;
6467 exp->string = PrintUInt(op1->ui -= value2);
6470 exp->expType = op1->type;
6472 op1->type->refCount++;
6477 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6479 short value2 = op2->s;
6482 exp->string = PrintShort(op1->s -= value2);
6485 exp->expType = op1->type;
6487 op1->type->refCount++;
6492 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6494 unsigned short value2 = op2->us;
6497 exp->string = PrintUShort(op1->us -= value2);
6500 exp->expType = op1->type;
6502 op1->type->refCount++;
6507 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6509 char value2 = op2->c;
6512 exp->string = PrintChar(op1->c -= value2);
6515 exp->expType = op1->type;
6517 op1->type->refCount++;
6522 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6524 unsigned char value2 = op2->uc;
6527 exp->string = PrintUChar(op1->uc -= value2);
6530 exp->expType = op1->type;
6532 op1->type->refCount++;
6537 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6539 float value2 = op2->f;
6542 exp->string = PrintFloat(op1->f -= value2);
6545 exp->expType = op1->type;
6547 op1->type->refCount++;
6552 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6554 double value2 = op2->d;
6557 exp->string = PrintDouble(op1->d -= value2);
6560 exp->expType = op1->type;
6562 op1->type->refCount++;
6567 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6569 int value2 = op2->i;
6572 exp->string = PrintInt(op1->i *= value2);
6575 exp->expType = op1->type;
6577 op1->type->refCount++;
6582 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6584 unsigned int value2 = op2->ui;
6587 exp->string = PrintUInt(op1->ui *= value2);
6590 exp->expType = op1->type;
6592 op1->type->refCount++;
6597 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6599 short value2 = op2->s;
6602 exp->string = PrintShort(op1->s *= value2);
6605 exp->expType = op1->type;
6607 op1->type->refCount++;
6612 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6614 unsigned short value2 = op2->us;
6617 exp->string = PrintUShort(op1->us *= value2);
6620 exp->expType = op1->type;
6622 op1->type->refCount++;
6627 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6629 char value2 = op2->c;
6632 exp->string = PrintChar(op1->c *= value2);
6635 exp->expType = op1->type;
6637 op1->type->refCount++;
6642 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6644 unsigned char value2 = op2->uc;
6647 exp->string = PrintUChar(op1->uc *= value2);
6650 exp->expType = op1->type;
6652 op1->type->refCount++;
6657 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6659 float value2 = op2->f;
6662 exp->string = PrintFloat(op1->f *= value2);
6665 exp->expType = op1->type;
6667 op1->type->refCount++;
6672 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6674 double value2 = op2->d;
6677 exp->string = PrintDouble(op1->d *= value2);
6680 exp->expType = op1->type;
6682 op1->type->refCount++;
6687 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6689 int value2 = op2->i;
6692 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6695 exp->expType = op1->type;
6697 op1->type->refCount++;
6702 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6704 unsigned int value2 = op2->ui;
6707 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6710 exp->expType = op1->type;
6712 op1->type->refCount++;
6717 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6719 short value2 = op2->s;
6722 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6725 exp->expType = op1->type;
6727 op1->type->refCount++;
6732 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6734 unsigned short value2 = op2->us;
6737 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6740 exp->expType = op1->type;
6742 op1->type->refCount++;
6747 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6749 char value2 = op2->c;
6752 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6755 exp->expType = op1->type;
6757 op1->type->refCount++;
6762 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6764 unsigned char value2 = op2->uc;
6767 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6770 exp->expType = op1->type;
6772 op1->type->refCount++;
6777 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6779 float value2 = op2->f;
6782 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6785 exp->expType = op1->type;
6787 op1->type->refCount++;
6792 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6794 double value2 = op2->d;
6797 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6800 exp->expType = op1->type;
6802 op1->type->refCount++;
6807 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6809 int value2 = op2->i;
6812 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6815 exp->expType = op1->type;
6817 op1->type->refCount++;
6822 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6824 unsigned int value2 = op2->ui;
6827 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6830 exp->expType = op1->type;
6832 op1->type->refCount++;
6837 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6839 short value2 = op2->s;
6842 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6845 exp->expType = op1->type;
6847 op1->type->refCount++;
6852 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6854 unsigned short value2 = op2->us;
6857 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6860 exp->expType = op1->type;
6862 op1->type->refCount++;
6867 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6869 char value2 = op2->c;
6872 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6875 exp->expType = op1->type;
6877 op1->type->refCount++;
6882 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6884 unsigned char value2 = op2->uc;
6887 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6890 exp->expType = op1->type;
6892 op1->type->refCount++;
6897 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6899 int value2 = op2->i;
6902 exp->string = PrintInt(op1->i & value2);
6905 exp->expType = op1->type;
6907 op1->type->refCount++;
6912 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6914 unsigned int value2 = op2->ui;
6917 exp->string = PrintUInt(op1->ui & value2);
6920 exp->expType = op1->type;
6922 op1->type->refCount++;
6927 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6929 short value2 = op2->s;
6932 exp->string = PrintShort(op1->s & value2);
6935 exp->expType = op1->type;
6937 op1->type->refCount++;
6942 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6944 unsigned short value2 = op2->us;
6947 exp->string = PrintUShort(op1->us & value2);
6950 exp->expType = op1->type;
6952 op1->type->refCount++;
6957 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6959 char value2 = op2->c;
6962 exp->string = PrintChar(op1->c & value2);
6965 exp->expType = op1->type;
6967 op1->type->refCount++;
6972 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6974 unsigned char value2 = op2->uc;
6977 exp->string = PrintUChar(op1->uc & value2);
6980 exp->expType = op1->type;
6982 op1->type->refCount++;
6987 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6989 int value2 = op2->i;
6992 exp->string = PrintInt(op1->i | value2);
6995 exp->expType = op1->type;
6997 op1->type->refCount++;
7002 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7004 unsigned int value2 = op2->ui;
7007 exp->string = PrintUInt(op1->ui | value2);
7010 exp->expType = op1->type;
7012 op1->type->refCount++;
7017 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7019 short value2 = op2->s;
7022 exp->string = PrintShort(op1->s | value2);
7025 exp->expType = op1->type;
7027 op1->type->refCount++;
7032 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7034 unsigned short value2 = op2->us;
7037 exp->string = PrintUShort(op1->us | value2);
7040 exp->expType = op1->type;
7042 op1->type->refCount++;
7047 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7049 char value2 = op2->c;
7052 exp->string = PrintChar(op1->c | value2);
7055 exp->expType = op1->type;
7057 op1->type->refCount++;
7062 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7064 unsigned char value2 = op2->uc;
7067 exp->string = PrintUChar(op1->uc | value2);
7070 exp->expType = op1->type;
7072 op1->type->refCount++;
7077 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7079 int value2 = op2->i;
7082 exp->string = PrintInt(op1->i ^ value2);
7085 exp->expType = op1->type;
7087 op1->type->refCount++;
7092 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7094 unsigned int value2 = op2->ui;
7097 exp->string = PrintUInt(op1->ui ^ value2);
7100 exp->expType = op1->type;
7102 op1->type->refCount++;
7107 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7109 short value2 = op2->s;
7112 exp->string = PrintShort(op1->s ^ value2);
7115 exp->expType = op1->type;
7117 op1->type->refCount++;
7122 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7124 unsigned short value2 = op2->us;
7127 exp->string = PrintUShort(op1->us ^ value2);
7130 exp->expType = op1->type;
7132 op1->type->refCount++;
7137 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7139 char value2 = op2->c;
7142 exp->string = PrintChar(op1->c ^ value2);
7145 exp->expType = op1->type;
7147 op1->type->refCount++;
7152 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7154 unsigned char value2 = op2->uc;
7157 exp->string = PrintUChar(op1->uc ^ value2);
7160 exp->expType = op1->type;
7162 op1->type->refCount++;
7167 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7169 int value2 = op2->i;
7172 exp->string = PrintInt(op1->i << value2);
7175 exp->expType = op1->type;
7177 op1->type->refCount++;
7182 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7184 unsigned int value2 = op2->ui;
7187 exp->string = PrintUInt(op1->ui << value2);
7190 exp->expType = op1->type;
7192 op1->type->refCount++;
7197 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7199 short value2 = op2->s;
7202 exp->string = PrintShort(op1->s << value2);
7205 exp->expType = op1->type;
7207 op1->type->refCount++;
7212 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7214 unsigned short value2 = op2->us;
7217 exp->string = PrintUShort(op1->us << value2);
7220 exp->expType = op1->type;
7222 op1->type->refCount++;
7227 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7229 char value2 = op2->c;
7232 exp->string = PrintChar(op1->c << value2);
7235 exp->expType = op1->type;
7237 op1->type->refCount++;
7242 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7244 unsigned char value2 = op2->uc;
7247 exp->string = PrintUChar(op1->uc << value2);
7250 exp->expType = op1->type;
7252 op1->type->refCount++;
7257 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7259 int value2 = op2->i;
7262 exp->string = PrintInt(op1->i >> value2);
7265 exp->expType = op1->type;
7267 op1->type->refCount++;
7272 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7274 unsigned int value2 = op2->ui;
7277 exp->string = PrintUInt(op1->ui >> value2);
7280 exp->expType = op1->type;
7282 op1->type->refCount++;
7287 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7289 short value2 = op2->s;
7292 exp->string = PrintShort(op1->s >> value2);
7295 exp->expType = op1->type;
7297 op1->type->refCount++;
7302 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7304 unsigned short value2 = op2->us;
7307 exp->string = PrintUShort(op1->us >> value2);
7310 exp->expType = op1->type;
7312 op1->type->refCount++;
7317 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7319 char value2 = op2->c;
7322 exp->string = PrintChar(op1->c >> value2);
7325 exp->expType = op1->type;
7327 op1->type->refCount++;
7332 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7334 unsigned char value2 = op2->uc;
7337 exp->string = PrintUChar(op1->uc >> value2);
7340 exp->expType = op1->type;
7342 op1->type->refCount++;
7347 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7350 exp->string = PrintInt(~op1->i);
7353 exp->expType = op1->type;
7355 op1->type->refCount++;
7360 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7363 exp->string = PrintUInt(~op1->ui);
7366 exp->expType = op1->type;
7368 op1->type->refCount++;
7373 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7376 exp->string = PrintShort(~op1->s);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7389 exp->string = PrintUShort(~op1->us);
7392 exp->expType = op1->type;
7394 op1->type->refCount++;
7399 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7402 exp->string = PrintChar(~op1->c);
7405 exp->expType = op1->type;
7407 op1->type->refCount++;
7412 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7415 exp->string = PrintUChar(~op1->uc);
7418 exp->expType = op1->type;
7420 op1->type->refCount++;
7425 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7427 int value2 = op2->i;
7430 exp->string = PrintInt(op1->i &= value2);
7433 exp->expType = op1->type;
7435 op1->type->refCount++;
7440 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7442 unsigned int value2 = op2->ui;
7445 exp->string = PrintUInt(op1->ui &= value2);
7448 exp->expType = op1->type;
7450 op1->type->refCount++;
7455 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7457 short value2 = op2->s;
7460 exp->string = PrintShort(op1->s &= value2);
7463 exp->expType = op1->type;
7465 op1->type->refCount++;
7470 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7472 unsigned short value2 = op2->us;
7475 exp->string = PrintUShort(op1->us &= value2);
7478 exp->expType = op1->type;
7480 op1->type->refCount++;
7485 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7487 char value2 = op2->c;
7490 exp->string = PrintChar(op1->c &= value2);
7493 exp->expType = op1->type;
7495 op1->type->refCount++;
7500 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7502 unsigned char value2 = op2->uc;
7505 exp->string = PrintUChar(op1->uc &= value2);
7508 exp->expType = op1->type;
7510 op1->type->refCount++;
7515 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7517 int value2 = op2->i;
7520 exp->string = PrintInt(op1->i |= value2);
7523 exp->expType = op1->type;
7525 op1->type->refCount++;
7530 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7532 unsigned int value2 = op2->ui;
7535 exp->string = PrintUInt(op1->ui |= value2);
7538 exp->expType = op1->type;
7540 op1->type->refCount++;
7545 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7547 short value2 = op2->s;
7550 exp->string = PrintShort(op1->s |= value2);
7553 exp->expType = op1->type;
7555 op1->type->refCount++;
7560 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7562 unsigned short value2 = op2->us;
7565 exp->string = PrintUShort(op1->us |= value2);
7568 exp->expType = op1->type;
7570 op1->type->refCount++;
7575 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7577 char value2 = op2->c;
7580 exp->string = PrintChar(op1->c |= value2);
7583 exp->expType = op1->type;
7585 op1->type->refCount++;
7590 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7592 unsigned char value2 = op2->uc;
7595 exp->string = PrintUChar(op1->uc |= value2);
7598 exp->expType = op1->type;
7600 op1->type->refCount++;
7605 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7607 int value2 = op2->i;
7610 exp->string = PrintInt(op1->i ^= value2);
7613 exp->expType = op1->type;
7615 op1->type->refCount++;
7620 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7622 unsigned int value2 = op2->ui;
7625 exp->string = PrintUInt(op1->ui ^= value2);
7628 exp->expType = op1->type;
7630 op1->type->refCount++;
7635 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7637 short value2 = op2->s;
7640 exp->string = PrintShort(op1->s ^= value2);
7643 exp->expType = op1->type;
7645 op1->type->refCount++;
7650 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7652 unsigned short value2 = op2->us;
7655 exp->string = PrintUShort(op1->us ^= value2);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7667 char value2 = op2->c;
7670 exp->string = PrintChar(op1->c ^= value2);
7673 exp->expType = op1->type;
7675 op1->type->refCount++;
7680 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7682 unsigned char value2 = op2->uc;
7685 exp->string = PrintUChar(op1->uc ^= value2);
7688 exp->expType = op1->type;
7690 op1->type->refCount++;
7695 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7697 int value2 = op2->i;
7700 exp->string = PrintInt(op1->i <<= value2);
7703 exp->expType = op1->type;
7705 op1->type->refCount++;
7710 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7712 unsigned int value2 = op2->ui;
7715 exp->string = PrintUInt(op1->ui <<= value2);
7718 exp->expType = op1->type;
7720 op1->type->refCount++;
7725 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7727 short value2 = op2->s;
7730 exp->string = PrintShort(op1->s <<= value2);
7733 exp->expType = op1->type;
7735 op1->type->refCount++;
7740 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7742 unsigned short value2 = op2->us;
7745 exp->string = PrintUShort(op1->us <<= value2);
7748 exp->expType = op1->type;
7750 op1->type->refCount++;
7755 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7757 char value2 = op2->c;
7760 exp->string = PrintChar(op1->c <<= value2);
7763 exp->expType = op1->type;
7765 op1->type->refCount++;
7770 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7772 unsigned char value2 = op2->uc;
7775 exp->string = PrintUChar(op1->uc <<= value2);
7778 exp->expType = op1->type;
7780 op1->type->refCount++;
7785 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7787 int value2 = op2->i;
7790 exp->string = PrintInt(op1->i >>= value2);
7793 exp->expType = op1->type;
7795 op1->type->refCount++;
7800 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7802 unsigned int value2 = op2->ui;
7805 exp->string = PrintUInt(op1->ui >>= value2);
7808 exp->expType = op1->type;
7810 op1->type->refCount++;
7815 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7817 short value2 = op2->s;
7820 exp->string = PrintShort(op1->s >>= value2);
7823 exp->expType = op1->type;
7825 op1->type->refCount++;
7830 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7832 unsigned short value2 = op2->us;
7835 exp->string = PrintUShort(op1->us >>= value2);
7838 exp->expType = op1->type;
7840 op1->type->refCount++;
7845 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7847 char value2 = op2->c;
7850 exp->string = PrintChar(op1->c >>= value2);
7853 exp->expType = op1->type;
7855 op1->type->refCount++;
7860 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7862 unsigned char value2 = op2->uc;
7865 exp->string = PrintUChar(op1->uc >>= value2);
7868 exp->expType = op1->type;
7870 op1->type->refCount++;
7875 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7878 exp->string = PrintInt(!op1->i);
7881 exp->expType = op1->type;
7883 op1->type->refCount++;
7888 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7891 exp->string = PrintUInt(!op1->ui);
7894 exp->expType = op1->type;
7896 op1->type->refCount++;
7901 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7904 exp->string = PrintShort(!op1->s);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7917 exp->string = PrintUShort(!op1->us);
7920 exp->expType = op1->type;
7922 op1->type->refCount++;
7927 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7930 exp->string = PrintChar(!op1->c);
7933 exp->expType = op1->type;
7935 op1->type->refCount++;
7940 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7943 exp->string = PrintUChar(!op1->uc);
7946 exp->expType = op1->type;
7948 op1->type->refCount++;
7953 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7955 int value2 = op2->i;
7958 exp->string = PrintInt(op1->i == value2);
7961 exp->expType = op1->type;
7963 op1->type->refCount++;
7968 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7970 unsigned int value2 = op2->ui;
7973 exp->string = PrintUInt(op1->ui == value2);
7976 exp->expType = op1->type;
7978 op1->type->refCount++;
7983 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7985 short value2 = op2->s;
7988 exp->string = PrintShort(op1->s == value2);
7991 exp->expType = op1->type;
7993 op1->type->refCount++;
7998 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8000 unsigned short value2 = op2->us;
8003 exp->string = PrintUShort(op1->us == value2);
8006 exp->expType = op1->type;
8008 op1->type->refCount++;
8013 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8015 char value2 = op2->c;
8018 exp->string = PrintChar(op1->c == value2);
8021 exp->expType = op1->type;
8023 op1->type->refCount++;
8028 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8030 unsigned char value2 = op2->uc;
8033 exp->string = PrintUChar(op1->uc == value2);
8036 exp->expType = op1->type;
8038 op1->type->refCount++;
8043 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8045 float value2 = op2->f;
8048 exp->string = PrintFloat(op1->f == value2);
8051 exp->expType = op1->type;
8053 op1->type->refCount++;
8058 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8060 double value2 = op2->d;
8063 exp->string = PrintDouble(op1->d == value2);
8066 exp->expType = op1->type;
8068 op1->type->refCount++;
8073 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8075 int value2 = op2->i;
8078 exp->string = PrintInt(op1->i != value2);
8081 exp->expType = op1->type;
8083 op1->type->refCount++;
8088 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8090 unsigned int value2 = op2->ui;
8093 exp->string = PrintUInt(op1->ui != value2);
8096 exp->expType = op1->type;
8098 op1->type->refCount++;
8103 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8105 short value2 = op2->s;
8108 exp->string = PrintShort(op1->s != value2);
8111 exp->expType = op1->type;
8113 op1->type->refCount++;
8118 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8120 unsigned short value2 = op2->us;
8123 exp->string = PrintUShort(op1->us != value2);
8126 exp->expType = op1->type;
8128 op1->type->refCount++;
8133 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8135 char value2 = op2->c;
8138 exp->string = PrintChar(op1->c != value2);
8141 exp->expType = op1->type;
8143 op1->type->refCount++;
8148 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8150 unsigned char value2 = op2->uc;
8153 exp->string = PrintUChar(op1->uc != value2);
8156 exp->expType = op1->type;
8158 op1->type->refCount++;
8163 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8165 float value2 = op2->f;
8168 exp->string = PrintFloat(op1->f != value2);
8171 exp->expType = op1->type;
8173 op1->type->refCount++;
8178 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8180 double value2 = op2->d;
8183 exp->string = PrintDouble(op1->d != value2);
8186 exp->expType = op1->type;
8188 op1->type->refCount++;
8193 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8195 int value2 = op2->i;
8198 exp->string = PrintInt(op1->i && value2);
8201 exp->expType = op1->type;
8203 op1->type->refCount++;
8208 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8210 unsigned int value2 = op2->ui;
8213 exp->string = PrintUInt(op1->ui && value2);
8216 exp->expType = op1->type;
8218 op1->type->refCount++;
8223 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8225 short value2 = op2->s;
8228 exp->string = PrintShort(op1->s && value2);
8231 exp->expType = op1->type;
8233 op1->type->refCount++;
8238 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8240 unsigned short value2 = op2->us;
8243 exp->string = PrintUShort(op1->us && value2);
8246 exp->expType = op1->type;
8248 op1->type->refCount++;
8253 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8255 char value2 = op2->c;
8258 exp->string = PrintChar(op1->c && value2);
8261 exp->expType = op1->type;
8263 op1->type->refCount++;
8268 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8270 unsigned char value2 = op2->uc;
8273 exp->string = PrintUChar(op1->uc && value2);
8276 exp->expType = op1->type;
8278 op1->type->refCount++;
8283 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8285 float value2 = op2->f;
8288 exp->string = PrintFloat(op1->f && value2);
8291 exp->expType = op1->type;
8293 op1->type->refCount++;
8298 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8300 double value2 = op2->d;
8303 exp->string = PrintDouble(op1->d && value2);
8306 exp->expType = op1->type;
8308 op1->type->refCount++;
8313 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8315 int value2 = op2->i;
8318 exp->string = PrintInt(op1->i || value2);
8321 exp->expType = op1->type;
8323 op1->type->refCount++;
8328 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8330 unsigned int value2 = op2->ui;
8333 exp->string = PrintUInt(op1->ui || value2);
8336 exp->expType = op1->type;
8338 op1->type->refCount++;
8343 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8345 short value2 = op2->s;
8348 exp->string = PrintShort(op1->s || value2);
8351 exp->expType = op1->type;
8353 op1->type->refCount++;
8358 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8360 unsigned short value2 = op2->us;
8363 exp->string = PrintUShort(op1->us || value2);
8366 exp->expType = op1->type;
8368 op1->type->refCount++;
8373 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8375 char value2 = op2->c;
8378 exp->string = PrintChar(op1->c || value2);
8381 exp->expType = op1->type;
8383 op1->type->refCount++;
8388 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8390 unsigned char value2 = op2->uc;
8393 exp->string = PrintUChar(op1->uc || value2);
8396 exp->expType = op1->type;
8398 op1->type->refCount++;
8403 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8405 float value2 = op2->f;
8408 exp->string = PrintFloat(op1->f || value2);
8411 exp->expType = op1->type;
8413 op1->type->refCount++;
8418 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8420 double value2 = op2->d;
8423 exp->string = PrintDouble(op1->d || value2);
8426 exp->expType = op1->type;
8428 op1->type->refCount++;
8433 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8435 int value2 = op2->i;
8438 exp->string = PrintInt(op1->i > value2);
8441 exp->expType = op1->type;
8443 op1->type->refCount++;
8448 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8450 unsigned int value2 = op2->ui;
8453 exp->string = PrintUInt(op1->ui > value2);
8456 exp->expType = op1->type;
8458 op1->type->refCount++;
8463 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8465 short value2 = op2->s;
8468 exp->string = PrintShort(op1->s > value2);
8471 exp->expType = op1->type;
8473 op1->type->refCount++;
8478 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8480 unsigned short value2 = op2->us;
8483 exp->string = PrintUShort(op1->us > value2);
8486 exp->expType = op1->type;
8488 op1->type->refCount++;
8493 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8495 char value2 = op2->c;
8498 exp->string = PrintChar(op1->c > value2);
8501 exp->expType = op1->type;
8503 op1->type->refCount++;
8508 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8510 unsigned char value2 = op2->uc;
8513 exp->string = PrintUChar(op1->uc > value2);
8516 exp->expType = op1->type;
8518 op1->type->refCount++;
8523 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8525 float value2 = op2->f;
8528 exp->string = PrintFloat(op1->f > value2);
8531 exp->expType = op1->type;
8533 op1->type->refCount++;
8538 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8540 double value2 = op2->d;
8543 exp->string = PrintDouble(op1->d > value2);
8546 exp->expType = op1->type;
8548 op1->type->refCount++;
8553 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8555 int value2 = op2->i;
8558 exp->string = PrintInt(op1->i < value2);
8561 exp->expType = op1->type;
8563 op1->type->refCount++;
8568 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8570 unsigned int value2 = op2->ui;
8573 exp->string = PrintUInt(op1->ui < value2);
8576 exp->expType = op1->type;
8578 op1->type->refCount++;
8583 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8585 short value2 = op2->s;
8588 exp->string = PrintShort(op1->s < value2);
8591 exp->expType = op1->type;
8593 op1->type->refCount++;
8598 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8600 unsigned short value2 = op2->us;
8603 exp->string = PrintUShort(op1->us < value2);
8606 exp->expType = op1->type;
8608 op1->type->refCount++;
8613 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8615 char value2 = op2->c;
8618 exp->string = PrintChar(op1->c < value2);
8621 exp->expType = op1->type;
8623 op1->type->refCount++;
8628 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8630 unsigned char value2 = op2->uc;
8633 exp->string = PrintUChar(op1->uc < value2);
8636 exp->expType = op1->type;
8638 op1->type->refCount++;
8643 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8645 float value2 = op2->f;
8648 exp->string = PrintFloat(op1->f < value2);
8651 exp->expType = op1->type;
8653 op1->type->refCount++;
8658 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8660 double value2 = op2->d;
8663 exp->string = PrintDouble(op1->d < value2);
8666 exp->expType = op1->type;
8668 op1->type->refCount++;
8673 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8675 int value2 = op2->i;
8678 exp->string = PrintInt(op1->i >= value2);
8681 exp->expType = op1->type;
8683 op1->type->refCount++;
8688 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8690 unsigned int value2 = op2->ui;
8693 exp->string = PrintUInt(op1->ui >= value2);
8696 exp->expType = op1->type;
8698 op1->type->refCount++;
8703 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8705 short value2 = op2->s;
8708 exp->string = PrintShort(op1->s >= value2);
8711 exp->expType = op1->type;
8713 op1->type->refCount++;
8718 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8720 unsigned short value2 = op2->us;
8723 exp->string = PrintUShort(op1->us >= value2);
8726 exp->expType = op1->type;
8728 op1->type->refCount++;
8733 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8735 char value2 = op2->c;
8738 exp->string = PrintChar(op1->c >= value2);
8741 exp->expType = op1->type;
8743 op1->type->refCount++;
8748 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8750 unsigned char value2 = op2->uc;
8753 exp->string = PrintUChar(op1->uc >= value2);
8756 exp->expType = op1->type;
8758 op1->type->refCount++;
8763 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8765 float value2 = op2->f;
8768 exp->string = PrintFloat(op1->f >= value2);
8771 exp->expType = op1->type;
8773 op1->type->refCount++;
8778 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8780 double value2 = op2->d;
8783 exp->string = PrintDouble(op1->d >= value2);
8786 exp->expType = op1->type;
8788 op1->type->refCount++;
8793 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8795 int value2 = op2->i;
8798 exp->string = PrintInt(op1->i <= value2);
8801 exp->expType = op1->type;
8803 op1->type->refCount++;
8808 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8810 unsigned int value2 = op2->ui;
8813 exp->string = PrintUInt(op1->ui <= value2);
8816 exp->expType = op1->type;
8818 op1->type->refCount++;
8823 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8825 short value2 = op2->s;
8828 exp->string = PrintShort(op1->s <= value2);
8831 exp->expType = op1->type;
8833 op1->type->refCount++;
8838 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8840 unsigned short value2 = op2->us;
8843 exp->string = PrintUShort(op1->us <= value2);
8846 exp->expType = op1->type;
8848 op1->type->refCount++;
8853 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8855 char value2 = op2->c;
8858 exp->string = PrintChar(op1->c <= value2);
8861 exp->expType = op1->type;
8863 op1->type->refCount++;
8868 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8870 unsigned char value2 = op2->uc;
8873 exp->string = PrintUChar(op1->uc <= value2);
8876 exp->expType = op1->type;
8878 op1->type->refCount++;
8883 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8885 float value2 = op2->f;
8888 exp->string = PrintFloat(op1->f <= value2);
8891 exp->expType = op1->type;
8893 op1->type->refCount++;
8898 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8900 double value2 = op2->d;
8903 exp->string = PrintDouble(op1->d <= value2);
8906 exp->expType = op1->type;
8908 op1->type->refCount++;
8913 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8916 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8919 exp->expType = op1->type;
8921 op1->type->refCount++;
8926 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8929 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8932 exp->expType = op1->type;
8934 op1->type->refCount++;
8939 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8942 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8955 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8958 exp->expType = op1->type;
8960 op1->type->refCount++;
8965 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8968 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8971 exp->expType = op1->type;
8973 op1->type->refCount++;
8978 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8981 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8984 exp->expType = op1->type;
8986 op1->type->refCount++;
8991 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8994 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
8997 exp->expType = op1->type;
8999 op1->type->refCount++;
9004 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9007 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9010 exp->expType = op1->type;
9012 op1->type->refCount++;
9017 struct OpTable intOps =
9019 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
9022 struct OpTable uintOps =
9024 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
9027 struct OpTable shortOps =
9029 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
9032 struct OpTable ushortOps =
9034 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
9037 struct OpTable floatOps =
9039 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
9042 struct OpTable doubleOps =
9044 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
9047 struct OpTable charOps =
9049 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
9052 struct OpTable ucharOps =
9054 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
9057 void ReadString(char * output, char * string)
9059 int len = strlen(string);
9061 unsigned int quoted = 0x0, escaped = 0x0;
9063 for(c = 0; c < len; c++)
9065 char ch = string[c];
9121 extern double strtod(char * , char * * );
9123 struct Operand GetOperand(struct Expression * exp)
9129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9132 struct Type * type = exp->expType;
9136 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9138 if(!type->_class->registered->dataType)
9139 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9140 type = type->_class->registered->dataType;
9142 op.kind = type->kind;
9143 op.type = exp->expType;
9144 if(exp->isConstant && exp->type == 2)
9150 if(exp->constant[0] == '\'')
9151 op.c = exp->constant[1];
9152 else if(type->isSigned)
9154 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9159 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9167 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9172 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9180 op.i = strtol(exp->constant, (((void *)0)), 0);
9185 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9193 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9198 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9204 op.f = (float)strtod(exp->constant, (((void *)0)));
9208 op.d = (double)strtod(exp->constant, (((void *)0)));
9214 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9224 int __ecereVMethodID_class_OnGetString;
9226 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9228 static void UnusedFunction()
9232 ((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);
9235 extern int __ecereVMethodID_class_OnGetString;
9237 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9239 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9241 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9243 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9244 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9247 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9248 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9250 void * ptr = inst->data + dataMember->offset + offset;
9251 char * result = (((void *)0));
9253 exp->loc = member->loc = inst->loc;
9254 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9255 if(!dataMember->dataType)
9256 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9257 type = dataMember->dataType;
9260 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9262 if(_class->type == 4)
9264 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9268 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9269 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9271 for(item = e->values.first; item; item = item->next)
9273 if((int)item->data == *(int *)ptr)
9275 result = item->name;
9281 exp->identifier = MkIdentifier(result);
9283 exp->destType = MkClassType(_class->fullName);
9284 ProcessExpressionType(exp);
9288 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9290 if(!_class->dataType)
9291 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9292 type = _class->dataType;
9301 FreeExpContents(exp);
9302 exp->constant = PrintFloat(*(float *)ptr);
9308 FreeExpContents(exp);
9309 exp->constant = PrintDouble(*(double *)ptr);
9315 FreeExpContents(exp);
9316 exp->constant = PrintInt(*(int *)ptr);
9322 FreeExpContents(exp);
9323 exp->constant = PrintInt64(*(long long *)ptr);
9328 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9331 ListAdd(memberList, member);
9333 if(parentDataMember->type == 1)
9338 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9340 void PopulateInstance(struct Instantiation * inst)
9342 struct Symbol * classSym = inst->_class->symbol;
9343 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9344 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9345 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9347 inst->members = MkListOne(MkMembersInitList(memberList));
9348 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9350 if(!dataMember->isProperty)
9352 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9353 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9356 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9357 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9359 void * ptr = inst->data + dataMember->offset;
9360 char * result = (((void *)0));
9362 exp->loc = member->loc = inst->loc;
9363 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9364 if(!dataMember->dataType)
9365 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9366 type = dataMember->dataType;
9369 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9371 if(_class->type == 4)
9373 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9377 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9378 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9380 for(item = e->values.first; item; item = item->next)
9382 if((int)item->data == *(int *)ptr)
9384 result = item->name;
9391 exp->identifier = MkIdentifier(result);
9393 exp->destType = MkClassType(_class->fullName);
9394 ProcessExpressionType(exp);
9397 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9399 if(!_class->dataType)
9400 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9401 type = _class->dataType;
9410 exp->constant = PrintFloat(*(float *)ptr);
9416 exp->constant = PrintDouble(*(double *)ptr);
9422 exp->constant = PrintInt(*(int *)ptr);
9428 exp->constant = PrintInt64(*(long long *)ptr);
9433 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9436 ListAdd(memberList, member);
9442 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);
9444 extern void FreeInstance(struct Instantiation * inst);
9446 void ComputeInstantiation(struct Expression * exp)
9448 struct Instantiation * inst = exp->instance;
9449 struct MembersInit * members;
9450 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9451 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9452 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9453 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9454 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9455 int subMemberStackPos = 0;
9458 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9462 if(_class->type == 0 || _class->type == 5)
9463 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9465 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9469 for(members = (*inst->members).first; members; members = members->next)
9471 switch(members->type)
9475 if(members->dataMembers)
9477 struct MemberInit * member;
9479 for(member = (*members->dataMembers).first; member; member = member->next)
9481 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9482 unsigned int found = 0x0;
9483 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9484 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9485 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9486 unsigned int dataMemberOffset;
9490 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9493 if(curMember->isProperty)
9494 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9497 dataMember = curMember;
9498 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9505 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9509 if(prop->memberAccess == 1)
9511 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9512 curClass = prop->_class;
9517 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9518 int _subMemberStackPos = 0;
9520 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9524 if(dataMember->memberAccess == 1)
9526 curMember = dataMember;
9527 curClass = dataMember->_class;
9528 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9529 subMemberStackPos = _subMemberStackPos;
9534 if(found && member->initializer && member->initializer->type == 0)
9536 struct Expression * value = member->initializer->exp;
9537 struct Type * type = (((void *)0));
9541 type = prop->dataType;
9545 if(!dataMember->dataType)
9546 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9547 type = dataMember->dataType;
9549 if(ident && ident->next)
9551 for(ident = ident->next; ident && type; ident = ident->next)
9555 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9557 type = prop->dataType;
9560 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9562 type = dataMember->dataType;
9565 else if(type->kind == 9 || type->kind == 10)
9567 struct Type * memberType;
9569 for(memberType = type->members.first; memberType; memberType = memberType->next)
9571 if(!strcmp(memberType->name, ident->string))
9582 FreeType(value->destType);
9583 value->destType = type;
9586 ComputeExpression(value);
9588 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9592 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9594 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9596 if(!_class->dataType)
9597 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9598 type = _class->dataType;
9603 void * ptr = inst->data + dataMemberOffset;
9605 if(value->type == 2)
9611 GetInt(value, (int *)ptr);
9616 GetInt64(value, (long long *)ptr);
9621 GetFloat(value, (float *)ptr);
9626 GetDouble(value, (double *)ptr);
9631 else if(value->type == 1)
9635 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9637 if(_class->type == 1)
9639 ComputeTypeSize(type);
9640 if(value->instance->data)
9641 memcpy(ptr, value->instance->data, type->size);
9648 if(value->type == 1 && value->instance->data)
9650 void (* Set)(void *, void *) = (void *)prop->Set;
9652 Set(inst->data, value->instance->data);
9653 PopulateInstance(inst);
9655 else if(value->type == 2)
9661 void (* Set)(void *, double) = (void *)prop->Set;
9663 Set(inst->data, strtod(value->constant, (((void *)0))));
9668 void (* Set)(void *, float) = (void *)prop->Set;
9670 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9675 void (* Set)(void *, int) = (void *)prop->Set;
9677 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9682 void (* Set)(void *, long long) = (void *)prop->Set;
9684 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9689 else if(value->type == 3)
9693 ReadString(temp, value->string);
9694 prop->Set(inst->data, temp);
9698 else if(_class->type == 3)
9702 if(value->type == 2)
9706 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9708 if(_class->type == 3)
9710 if(!_class->dataType)
9711 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9712 type = _class->dataType;
9720 float (* Set)(float) = (void *)prop->Set;
9722 GetFloat(member->initializer->exp, &fValue);
9723 exp->constant = PrintFloat(Set(fValue));
9730 double (* Set)(double) = (void *)prop->Set;
9732 GetDouble(member->initializer->exp, &dValue);
9733 exp->constant = PrintDouble(Set(dValue));
9741 else if(_class->type == 2)
9745 if(value->type == 1 && value->instance->data)
9747 unsigned int (* Set)(void *) = (void *)prop->Set;
9749 bits = Set(value->instance->data);
9751 else if(value->type == 2)
9757 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9761 GetInt(value, &part);
9762 bits = (bits & ~bitMember->mask);
9763 if(!bitMember->dataType)
9764 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9765 type = bitMember->dataType;
9766 if(type->kind == 8 && type->_class && type->_class->registered)
9768 if(!type->_class->registered->dataType)
9769 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9770 type = type->_class->registered->dataType;
9776 bits |= ((char)part << bitMember->pos);
9778 bits |= ((unsigned char)part << bitMember->pos);
9782 bits |= ((short)part << bitMember->pos);
9784 bits |= ((unsigned short)part << bitMember->pos);
9789 bits |= (part << bitMember->pos);
9791 bits |= ((unsigned int)part << bitMember->pos);
9795 bits |= ((long long)part << bitMember->pos);
9797 bits |= ((uint64)part << bitMember->pos);
9805 if(_class && _class->type == 3)
9807 ComputeExpression(member->initializer->exp);
9808 exp->constant = member->initializer->exp->constant;
9810 member->initializer->exp->constant = (((void *)0));
9820 if(_class && _class->type == 2)
9822 exp->constant = PrintHexUInt(bits);
9831 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9833 if(exp->op.op == SIZEOF)
9835 FreeExpContents(exp);
9837 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9847 struct Expression * exp2 = exp->op.exp2;
9849 exp->op.exp2 = (((void *)0));
9850 FreeExpContents(exp);
9851 FreeType(exp->expType);
9852 FreeType(exp->destType);
9854 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9860 FreeExpContents(exp);
9861 op1->ops.Neg(exp, op1);
9867 FreeExpContents(exp);
9868 op1->ops.BitNot(exp, op1);
9874 FreeExpContents(exp);
9875 op1->ops.Not(exp, op1);
9887 FreeExpContents(exp);
9888 op1->ops.Add(exp, op1, op2);
9894 FreeExpContents(exp);
9895 op1->ops.Sub(exp, op1, op2);
9901 FreeExpContents(exp);
9902 op1->ops.Mul(exp, op1, op2);
9908 FreeExpContents(exp);
9909 op1->ops.Div(exp, op1, op2);
9915 FreeExpContents(exp);
9916 op1->ops.Mod(exp, op1, op2);
9924 FreeExpContents(exp);
9925 op1->ops.BitAnd(exp, op1, op2);
9932 FreeExpContents(exp);
9933 op1->ops.BitOr(exp, op1, op2);
9939 FreeExpContents(exp);
9940 op1->ops.BitXor(exp, op1, op2);
9946 FreeExpContents(exp);
9947 op1->ops.LShift(exp, op1, op2);
9953 FreeExpContents(exp);
9954 op1->ops.RShift(exp, op1, op2);
9960 FreeExpContents(exp);
9961 op1->ops.Equ(exp, op1, op2);
9967 FreeExpContents(exp);
9968 op1->ops.Nqu(exp, op1, op2);
9974 FreeExpContents(exp);
9975 op1->ops.And(exp, op1, op2);
9981 FreeExpContents(exp);
9982 op1->ops.Or(exp, op1, op2);
9988 FreeExpContents(exp);
9989 op1->ops.Grt(exp, op1, op2);
9995 FreeExpContents(exp);
9996 op1->ops.Sma(exp, op1, op2);
10000 if(op1->ops.GrtEqu)
10002 FreeExpContents(exp);
10003 op1->ops.GrtEqu(exp, op1, op2);
10007 if(op1->ops.SmaEqu)
10009 FreeExpContents(exp);
10010 op1->ops.SmaEqu(exp, op1, op2);
10018 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10020 void ComputeExpression(struct Expression * exp)
10022 char expString[10240];
10024 expString[0] = '\0';
10029 ComputeInstantiation(exp);
10034 struct Expression * exp1, * exp2 = (((void *)0));
10035 struct Operand op1 =
10039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10042 struct Operand op2 =
10046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10051 ComputeExpression(exp->op.exp2);
10054 ComputeExpression(exp->op.exp1);
10055 exp1 = exp->op.exp1;
10056 exp2 = exp->op.exp2;
10057 op1 = GetOperand(exp1);
10059 op1.type->refCount++;
10062 op2 = GetOperand(exp2);
10064 op2.type->refCount++;
10069 exp1 = exp->op.exp2;
10070 op1 = GetOperand(exp1);
10072 op1.type->refCount++;
10074 CallOperator(exp, exp1, exp2, &op1, &op2);
10076 FreeType(op1.type);
10078 FreeType(op2.type);
10084 struct Expression * e, * n;
10086 for(e = (*exp->list).first; e; e = n)
10091 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10093 ComputeExpression(e);
10094 FreeType(exp->expType);
10095 FreeType(exp->destType);
10097 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10098 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10109 struct Expression * memberExp = exp->member.exp;
10110 struct Identifier * memberID = exp->member.member;
10111 struct Type * type;
10113 ComputeExpression(exp->member.exp);
10114 type = exp->member.exp->expType;
10117 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)));
10118 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10119 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10120 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10122 if(type->kind == 19 && exp->member.exp->type == 26)
10123 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10127 struct Symbol * classSym;
10130 PrintType(type, string, 0x0, 0x1);
10131 classSym = FindClass(string);
10132 _class = classSym ? classSym->registered : (((void *)0));
10134 if(exp->member.member)
10136 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10138 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10140 if(!prop && !member && _class && exp->member.member)
10142 struct Symbol * classSym = FindClass(exp->member.member->string);
10144 convertTo = _class;
10145 _class = classSym ? classSym->registered : (((void *)0));
10146 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10152 struct Type * type = prop->dataType;
10154 if(_class->type == 3)
10156 if(type->kind == 8)
10158 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10160 if(_class->type == 3)
10162 if(!_class->dataType)
10163 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10164 type = _class->dataType;
10172 float (* Get)(float) = (void *)prop->Get;
10174 GetFloat(exp->member.exp, &value);
10175 exp->constant = PrintFloat(Get ? Get(value) : value);
10182 double (* Get)(double);
10184 GetDouble(exp->member.exp, &value);
10186 Get = (void *)prop->Set;
10188 Get = (void *)prop->Get;
10189 exp->constant = PrintDouble(Get ? Get(value) : value);
10199 struct Expression * value = exp->member.exp;
10200 struct Type * type;
10202 if(!prop->dataType)
10203 ProcessPropertyType(prop);
10204 type = prop->dataType;
10208 else if(_class->type == 1)
10214 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10216 if(propertyClass->type == 1 && value->type == 1)
10218 void (* Set)(void *, void *) = (void *)prop->Set;
10220 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10221 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10222 exp->instance->_class = MkSpecifierName(_class->fullName);
10223 exp->instance->loc = exp->loc;
10225 Set(exp->instance->data, value->instance->data);
10226 PopulateInstance(exp->instance);
10233 void (* Set)(void *, int) = (void *)prop->Set;
10235 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10236 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10237 exp->instance->_class = MkSpecifierName(_class->fullName);
10238 exp->instance->loc = exp->loc;
10240 GetInt(value, &intValue);
10241 Set(exp->instance->data, intValue);
10242 PopulateInstance(exp->instance);
10247 long long intValue;
10248 void (* Set)(void *, long long) = (void *)prop->Set;
10250 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10251 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10252 exp->instance->_class = MkSpecifierName(_class->fullName);
10253 exp->instance->loc = exp->loc;
10255 GetInt64(value, &intValue);
10256 Set(exp->instance->data, intValue);
10257 PopulateInstance(exp->instance);
10262 double doubleValue;
10263 void (* Set)(void *, double) = (void *)prop->Set;
10265 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10266 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10267 exp->instance->_class = MkSpecifierName(_class->fullName);
10268 exp->instance->loc = exp->loc;
10270 GetDouble(value, &doubleValue);
10271 Set(exp->instance->data, doubleValue);
10272 PopulateInstance(exp->instance);
10277 else if(_class->type == 2)
10283 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10285 if(propertyClass->type == 1 && value->instance->data)
10287 unsigned int (* Set)(void *) = (void *)prop->Set;
10288 unsigned int bits = Set(value->instance->data);
10290 exp->constant = PrintHexUInt(bits);
10294 else if(_class->type == 2)
10296 unsigned int value;
10297 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10300 GetUInt(exp->member.exp, &value);
10302 exp->constant = PrintHexUInt(bits);
10311 if(_class->type == 2)
10313 unsigned int value;
10315 GetUInt(exp->member.exp, &value);
10320 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10322 if(_class->type == 1)
10324 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10326 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10327 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10328 exp->instance->_class = MkSpecifierName(_class->fullName);
10329 exp->instance->loc = exp->loc;
10331 Get(value, exp->instance->data);
10332 PopulateInstance(exp->instance);
10334 else if(_class->type == 2)
10336 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10337 uint64 bits = Get(value);
10339 exp->constant = PrintHexUInt64(bits);
10346 else if(_class->type == 1)
10348 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10354 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10356 if(_class->type == 1 && value)
10358 void (* Get)(void *, void *) = (void *)prop->Get;
10360 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10361 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10362 exp->instance->_class = MkSpecifierName(_class->fullName);
10363 exp->instance->loc = exp->loc;
10365 Get(value, exp->instance->data);
10366 PopulateInstance(exp->instance);
10377 exp->isConstant = 0x0;
10386 FreeExpression(memberExp);
10387 FreeIdentifier(memberID);
10393 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10395 FreeExpContents(exp);
10396 exp->constant = PrintUInt(ComputeTypeSize(type));
10403 struct Symbol * classSym = exp->_class->symbol;
10405 if(classSym && classSym->registered)
10407 if(classSym->registered->fixed)
10409 FreeSpecifier(exp->_class);
10410 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10415 char className[1024];
10417 strcpy(className, "__ecereClass_");
10418 FullClassNameCat(className, classSym->string, 0x1);
10419 MangleClassName(className);
10420 FreeExpContents(exp);
10422 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10423 exp->member.member = MkIdentifier("structSize");
10430 struct Type * type;
10431 struct Expression * e = exp;
10433 if(exp->type == 11)
10436 ComputeExpression(exp->cast.exp);
10439 if(e && exp->expType)
10441 type = exp->expType;
10442 if(type->kind == 8)
10444 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10446 if(_class && (_class->type == 3 || _class->type == 2))
10448 if(!_class->dataType)
10449 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10450 type = _class->dataType;
10460 GetChar(e, &value);
10461 FreeExpContents(exp);
10462 exp->constant = PrintChar(value);
10467 unsigned char value;
10469 GetUChar(e, &value);
10470 FreeExpContents(exp);
10471 exp->constant = PrintUChar(value);
10480 GetShort(e, &value);
10481 FreeExpContents(exp);
10482 exp->constant = PrintShort(value);
10487 unsigned short value;
10489 GetUShort(e, &value);
10490 FreeExpContents(exp);
10491 exp->constant = PrintUShort(value);
10501 FreeExpContents(exp);
10502 exp->constant = PrintInt(value);
10507 unsigned int value;
10509 GetUInt(e, &value);
10510 FreeExpContents(exp);
10511 exp->constant = PrintUInt(value);
10520 GetInt64(e, &value);
10521 FreeExpContents(exp);
10522 exp->constant = PrintInt64(value);
10529 GetUInt64(e, &value);
10530 FreeExpContents(exp);
10531 exp->constant = PrintUInt64(value);
10539 GetFloat(e, &value);
10540 FreeExpContents(exp);
10541 exp->constant = PrintFloat(value);
10549 GetDouble(e, &value);
10550 FreeExpContents(exp);
10551 exp->constant = PrintDouble(value);
10561 struct Operand op1 =
10565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10568 struct Operand op2 =
10572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10575 struct Operand op3 =
10579 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10584 ComputeExpression((*exp->cond.exp).last);
10585 if(exp->cond.elseExp)
10586 ComputeExpression(exp->cond.elseExp);
10588 ComputeExpression(exp->cond.cond);
10589 op1 = GetOperand(exp->cond.cond);
10591 op1.type->refCount++;
10592 op2 = GetOperand((*exp->cond.exp).last);
10594 op2.type->refCount++;
10595 op3 = GetOperand(exp->cond.elseExp);
10597 op3.type->refCount++;
10600 FreeExpContents(exp);
10601 op1.ops.Cond(exp, &op1, &op2, &op3);
10604 FreeType(op1.type);
10606 FreeType(op2.type);
10608 FreeType(op3.type);
10614 void ApplyAnyObjectLogic(struct Expression * e);
10616 extern void CopyTypeInto(struct Type * type, struct Type * src);
10618 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10620 unsigned int result = 0x1;
10624 struct __ecereNameSpace__ecere__sys__OldList converts =
10628 struct Conversion * convert;
10630 if(destType->kind == 0)
10632 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10636 for(convert = converts.first; convert; convert = convert->next)
10638 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10642 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10643 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10646 newExp->destType = (((void *)0));
10650 exp->addedThis = 0x1;
10651 exp->member.exp = newExp;
10652 FreeType(exp->member.exp->expType);
10653 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10654 exp->member.exp->expType->classObjectType = objectType;
10655 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10656 exp->member.memberType = 1;
10657 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10658 exp->needCast = 0x1;
10660 exp->expType->refCount++;
10661 ApplyAnyObjectLogic(exp->member.exp);
10667 exp->addedThis = 0x1;
10668 exp->member.exp = newExp;
10669 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10671 newExp->byReference = 0x1;
10673 FreeType(exp->member.exp->expType);
10674 exp->member.exp->expType = (((void *)0));
10675 if(convert->convert->dataType)
10677 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10678 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10679 exp->member.exp->expType->refCount = 1;
10680 exp->member.exp->expType->classObjectType = objectType;
10681 ApplyAnyObjectLogic(exp->member.exp);
10683 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10684 exp->member.memberType = 4;
10685 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10686 exp->needCast = 0x1;
10687 if(convert->resultType)
10688 convert->resultType->refCount++;
10694 FreeType(exp->expType);
10697 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10698 exp->needCast = 0x1;
10700 exp->expType->refCount++;
10704 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10705 exp->needCast = 0x1;
10706 if(convert->resultType)
10707 convert->resultType->refCount++;
10711 if(exp->isConstant && inCompiler)
10712 ComputeExpression(exp);
10713 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10715 if(!result && exp->expType && converts.count)
10717 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10719 if(!result && exp->expType && exp->destType)
10721 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))
10728 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
10730 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10732 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10734 void CheckTemplateTypes(struct Expression * exp)
10736 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10738 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10739 struct Statement * compound;
10740 struct Context * context;
10744 exp->destType->refCount++;
10746 exp->expType->refCount++;
10747 newExp->prev = (((void *)0));
10748 newExp->next = (((void *)0));
10749 switch(exp->expType->kind)
10753 exp->op.exp1 = (((void *)0));
10754 context = PushContext();
10755 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpExtensionCompound(compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internal")))))))));
10756 compound->compound.context = context;
10757 PopContext(context);
10762 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10763 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10767 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10769 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10770 struct Statement * compound;
10771 struct Context * context;
10775 exp->destType->refCount++;
10777 exp->expType->refCount++;
10778 newExp->prev = (((void *)0));
10779 newExp->next = (((void *)0));
10780 switch(exp->expType->kind)
10784 exp->op.exp1 = (((void *)0));
10785 context = PushContext();
10786 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifier(DOUBLE)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpExtensionCompound(compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internal")))))))));
10787 compound->compound.context = context;
10788 PopContext(context);
10790 ProcessExpressionType(exp->op.exp2);
10794 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10797 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10798 ProcessExpressionType((*exp->list).first);
10804 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10805 newExp->needCast = 0x1;
10806 ProcessExpressionType((*exp->list).first);
10812 if(exp->expType->kind == 20)
10814 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10818 FreeType(exp->destType);
10819 FreeType(exp->expType);
10820 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10824 if(newExp->type == 8 && newExp->member.memberType == 3)
10828 exp->op.exp1 = (((void *)0));
10829 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10833 char typeString[1024];
10834 struct Declarator * decl;
10835 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10837 typeString[0] = '\0';
10838 PrintType(exp->expType, typeString, 0x0, 0x0);
10839 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10841 exp->cast.typeName = MkTypeName(specs, decl);
10842 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10843 exp->cast.exp->needCast = 0x1;
10851 extern int strncmp(const char * , const char * , int n);
10853 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
10855 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10857 int nsLen = strlen(nameSpace);
10858 struct Symbol * symbol;
10860 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)))
10862 char * s = symbol->string;
10864 if(!strncmp(s, nameSpace, nsLen))
10869 for(c = strlen(s) - 1; c >= 0; c--)
10872 namePart = s + c + 1;
10873 if(!strcmp(namePart, name))
10881 return (((void *)0));
10884 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10887 char nameSpace[1024];
10889 unsigned int gotColon = 0x0;
10891 nameSpace[0] = '\0';
10892 for(c = strlen(name) - 1; c >= 0; c--)
10898 namePart = name + c + 1;
10899 while(c >= 0 && name[c] == ':')
10903 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10907 memcpy(nameSpace, name, c + 1);
10908 nameSpace[c + 1] = (char)0;
10909 return ScanWithNameSpace(tree, nameSpace, namePart);
10913 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10919 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10923 return ScanWithNameSpace(tree, "", namePart);
10925 return (((void *)0));
10928 static void ProcessDeclaration(struct Declaration * decl);
10930 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10932 struct Context * ctx;
10933 struct Symbol * symbol = (((void *)0));
10935 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10937 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
10939 symbol = (((void *)0));
10942 char curName[1024];
10944 strcpy(curName, thisNameSpace);
10945 strcat(curName, "::");
10946 strcat(curName, name);
10947 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10950 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10953 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
10954 if(symbol || ctx == endContext)
10957 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10959 if(symbol->pointerExternal->type == 0)
10961 struct FunctionDefinition * function = symbol->pointerExternal->function;
10962 struct Context * tmpContext = curContext;
10964 curContext = (((void *)0));
10965 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
10966 curContext = tmpContext;
10967 symbol->pointerExternal->symbol = symbol;
10968 DeclareType(symbol->type, 0x1, 0x1);
10969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
10970 symbol->id = curExternal->symbol->idCode;
10972 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
10974 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
10975 symbol->id = curExternal->symbol->idCode;
10981 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
10983 if(!type->isSigned)
10984 ListAdd(specs, MkSpecifier(UNSIGNED));
10989 if(type->_class->registered)
10991 if(!type->_class->registered->dataType)
10992 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10993 GetTypeSpecs(type->_class->registered->dataType, specs);
10998 ListAdd(specs, MkSpecifier(DOUBLE));
11001 ListAdd(specs, MkSpecifier(FLOAT));
11004 ListAdd(specs, MkSpecifier(CHAR));
11007 ListAdd(specs, MkSpecifier(SHORT));
11010 ListAdd(specs, MkSpecifier(INT64));
11014 ListAdd(specs, MkSpecifier(INT));
11019 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11021 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11028 if(type->_class && type->_class->string)
11030 if(type->classObjectType == 2)
11031 strcat(string, "typed_object");
11033 strcat(string, type->_class->string);
11036 if(type->_class->registered)
11037 strcat(string, type->_class->registered->name);
11039 strcat(string, type->_class->string);
11046 _PrintType(type->type, string, 0x0, printFunction, fullName);
11047 strcat(string, " *");
11052 strcat(string, "void");
11055 strcat(string, type->isSigned ? "int" : "uint");
11058 strcat(string, type->isSigned ? "int64" : "uint64");
11061 strcat(string, type->isSigned ? "char" : "byte");
11064 strcat(string, type->isSigned ? "short" : "uint16");
11067 strcat(string, "float");
11070 strcat(string, "double");
11075 strcat(string, "struct ");
11076 strcat(string, type->enumName);
11078 else if(type->typeName)
11080 strcat(string, type->typeName);
11084 struct Type * member;
11086 strcat(string, "struct {");
11087 for(member = type->members.first; member; member = member->next)
11089 PrintType(member, string, 0x1, fullName);
11090 strcat(string, "; ");
11092 strcat(string, "}");
11098 strcat(string, "union ");
11099 strcat(string, type->enumName);
11101 else if(type->typeName)
11103 strcat(string, type->typeName);
11107 strcat(string, "union ");
11108 strcat(string, "(unnamed)");
11114 strcat(string, "enum ");
11115 strcat(string, type->enumName);
11117 else if(type->typeName)
11119 strcat(string, type->typeName);
11122 strcat(string, "enum");
11128 if(type->dllExport)
11129 strcat(string, "dllexport ");
11130 PrintType(type->returnType, string, 0x0, fullName);
11131 strcat(string, " ");
11138 strcat(string, type->name);
11141 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11147 strcat(string, name);
11153 struct Type * param;
11155 strcat(string, "(");
11156 for(param = type->params.first; param; param = param->next)
11158 PrintType(param, string, 0x1, fullName);
11160 strcat(string, ", ");
11162 strcat(string, ")");
11169 char baseType[1024], size[256];
11170 struct Type * arrayType = type;
11172 baseType[0] = '\0';
11174 while(arrayType->kind == 12)
11177 if(arrayType->enumClass)
11178 strcat(size, arrayType->enumClass->string);
11179 else if(arrayType->arraySizeExp)
11180 PrintExpression(arrayType->arraySizeExp, size);
11182 arrayType = arrayType->arrayType;
11184 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11185 strcat(string, baseType);
11186 strcat(string, size);
11192 strcat(string, "...");
11195 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11198 strcat(string, "subclass(");
11199 strcat(string, type->_class ? type->_class->string : "int");
11200 strcat(string, ")");
11203 strcat(string, type->templateParameter->identifier->string);
11206 strcat(string, "thisclass");
11209 strcat(string, "__builtin_va_list");
11212 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11214 strcat(string, " ");
11215 strcat(string, type->name);
11220 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11222 struct Type * funcType;
11224 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11226 if(funcType && funcType->kind == 11 && type != funcType)
11228 char typeString[1024];
11229 struct Type * param;
11231 PrintType(funcType->returnType, string, 0x0, fullName);
11232 strcat(string, "(");
11233 _PrintType(type, string, printName, 0x0, fullName);
11234 strcat(string, ")");
11235 strcat(string, "(");
11236 for(param = funcType->params.first; param; param = param->next)
11238 PrintType(param, string, 0x1, fullName);
11240 strcat(string, ", ");
11242 strcat(string, ")");
11245 _PrintType(type, string, printName, 0x1, fullName);
11246 if(type->bitFieldCount)
11250 sprintf(count, ":%d", type->bitFieldCount);
11251 strcat(string, count);
11255 static struct Type * FindMember(struct Type * type, char * string)
11257 struct Type * memberType;
11259 for(memberType = type->members.first; memberType; memberType = memberType->next)
11261 if(!memberType->name)
11263 struct Type * subType = FindMember(memberType, string);
11268 else if(!strcmp(memberType->name, string))
11271 return (((void *)0));
11274 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11276 struct Type * memberType;
11278 for(memberType = type->members.first; memberType; memberType = memberType->next)
11280 if(!memberType->name)
11282 struct Type * subType = FindMember(memberType, string);
11286 *offset += memberType->offset;
11290 else if(!strcmp(memberType->name, string))
11292 *offset += memberType->offset;
11296 return (((void *)0));
11299 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11301 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11303 struct Expression * ParseExpressionString(char * expression)
11305 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11306 ((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));
11307 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11309 parsedExpression = (((void *)0));
11311 expression_yyparse();
11312 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11313 return parsedExpression;
11316 extern char * QMkString(char * source);
11318 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11320 void * __ecereTemp1;
11321 struct Identifier * id = exp->identifier;
11322 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11323 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11324 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11325 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11327 if(_class && _class->type == 4)
11329 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11330 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11334 struct __ecereNameSpace__ecere__com__Class * baseClass;
11336 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11338 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11340 for(value = e->values.first; value; value = value->next)
11342 if(!strcmp(value->name, id->string))
11347 char constant[256];
11349 FreeExpContents(exp);
11351 exp->isConstant = 0x1;
11352 if(!strcmp(baseClass->dataTypeString, "int"))
11353 sprintf(constant, "%d", value->data);
11355 sprintf(constant, "0x%X", value->data);
11356 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11357 exp->expType = MkClassType(baseClass->fullName);
11365 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11367 ProcessMethodType(method);
11368 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));
11371 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11373 if(!prop->dataType)
11374 ProcessPropertyType(prop);
11375 exp->expType = prop->dataType;
11377 prop->dataType->refCount++;
11380 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11382 if(!member->dataType)
11383 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11384 exp->expType = member->dataType;
11385 if(member->dataType)
11386 member->dataType->refCount++;
11389 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11391 if(!classProp->dataType)
11392 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11393 if(classProp->constant)
11395 FreeExpContents(exp);
11396 exp->isConstant = 0x1;
11397 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11400 exp->constant = QMkString((char *)classProp->Get(_class));
11404 char constant[256];
11407 sprintf(constant, "%d", classProp->Get(_class));
11408 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11414 exp->expType = classProp->dataType;
11415 if(classProp->dataType)
11416 classProp->dataType->refCount++;
11422 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11424 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11425 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11426 struct __ecereNameSpace__ecere__com__NameSpace * child;
11430 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)))
11432 data = ScanGlobalData(child, name);
11440 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11442 extern char * strncpy(char * , const char * , int n);
11444 static struct GlobalData * FindGlobalData(char * name)
11447 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11449 nameSpace = globalData;
11450 for(c = 0; name[c]; c++)
11452 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11454 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11455 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11457 strncpy(spaceName, name + start, c - start);
11458 spaceName[c - start] = '\0';
11459 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11460 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11462 return (((void *)0));
11463 nameSpace = newSpace;
11471 return ScanGlobalData(nameSpace, name + start);
11473 return (((void *)0));
11476 static int definedExpStackPos;
11478 static void * definedExpStack[512];
11480 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11482 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11484 FreeExpContents(checkedExp);
11485 FreeType(checkedExp->expType);
11486 FreeType(checkedExp->destType);
11487 *checkedExp = *newExp;
11488 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11489 checkedExp->prev = prev;
11490 checkedExp->next = next;
11493 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11495 void __ecereMethod_Expression_Clear();
11497 void ApplyAnyObjectLogic(struct Expression * e)
11499 struct Type * destType = e->destType;
11501 if(destType && (destType->classObjectType == 3))
11503 if(e && e->expType)
11505 struct Type * type = e->expType;
11506 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11508 if(type->kind == 8 && type->_class && type->_class->registered)
11510 _class = type->_class->registered;
11512 else if(type->kind == 19)
11514 _class = FindClass("ecere::com::Class")->registered;
11518 char string[1024] = "";
11519 struct Symbol * classSym;
11521 PrintType(type, string, 0x0, 0x1);
11522 classSym = FindClass(string);
11524 _class = classSym->registered;
11526 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)))
11528 if(!_class || strcmp(_class->fullName, "char *"))
11530 struct Expression * checkedExp = e, * newExp;
11532 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11534 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11536 if(checkedExp->type == 25)
11538 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11541 checkedExp = (*checkedExp->list).last;
11543 else if(checkedExp->type == 11)
11544 checkedExp = checkedExp->cast.exp;
11546 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11548 newExp = checkedExp->op.exp2;
11549 checkedExp->op.exp2 = (((void *)0));
11550 FreeExpContents(checkedExp);
11551 if(e->expType && e->expType->passAsTemplate)
11555 ComputeTypeSize(e->expType);
11556 sprintf(size, "%d", e->expType->size);
11557 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))))));
11559 ReplaceExpContents(checkedExp, newExp);
11560 e->byReference = 0x1;
11562 else if(!e->byReference || (_class && _class->type == 5))
11564 struct Expression * checkedExp, * newExp;
11567 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;
11569 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11571 struct Context * context = PushContext();
11572 struct Declarator * decl;
11573 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11574 char typeString[1024];
11575 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11577 typeString[0] = '\0';
11579 newExp->prev = (((void *)0));
11580 newExp->next = (((void *)0));
11581 newExp->expType = (((void *)0));
11582 PrintType(e->expType, typeString, 0x0, 0x1);
11583 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11584 newExp->destType = ProcessType(specs, decl);
11585 curContext = context;
11587 e->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
11589 struct Type * type = e->destType;
11591 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11592 CopyTypeInto(e->destType, type);
11593 e->destType->refCount = 1;
11594 e->destType->classObjectType = 0;
11597 e->compound->compound.context = context;
11598 PopContext(context);
11599 curContext = context->parent;
11603 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11605 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11607 if(checkedExp->type == 25)
11609 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11612 checkedExp = (*checkedExp->list).last;
11614 else if(checkedExp->type == 11)
11615 checkedExp = checkedExp->cast.exp;
11618 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11620 *operand = *checkedExp;
11621 checkedExp->destType = (((void *)0));
11622 checkedExp->expType = (((void *)0));
11623 __ecereMethod_Expression_Clear(checkedExp);
11624 checkedExp->type = 4;
11625 checkedExp->op.op = '&';
11626 checkedExp->op.exp1 = (((void *)0));
11627 checkedExp->op.exp2 = operand;
11636 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))))
11638 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11644 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11647 thisExp->prev = (((void *)0));
11648 thisExp->next = (((void *)0));
11649 __ecereMethod_Expression_Clear(e);
11651 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11652 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11653 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11655 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11656 CopyTypeInto(e->expType, thisExp->expType);
11657 e->expType->byReference = 0x0;
11658 e->expType->refCount = 1;
11659 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))
11661 e->expType->classObjectType = 0;
11666 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11668 if(destType->kind == 14)
11670 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11672 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11674 unsigned int byReference = e->expType->byReference;
11675 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11676 struct Declarator * decl;
11677 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11678 char typeString[1024];
11679 struct Type * type;
11680 int backupClassObjectType;
11682 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11686 backupClassObjectType = type->classObjectType;
11687 type->classObjectType = 0;
11688 typeString[0] = '\0';
11689 PrintType(type, typeString, 0x0, 0x1);
11690 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11691 type->classObjectType = backupClassObjectType;
11693 thisExp->prev = (((void *)0));
11694 thisExp->next = (((void *)0));
11695 __ecereMethod_Expression_Clear(e);
11696 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)))
11700 e->op.exp1 = (((void *)0));
11701 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11706 e->cast.typeName = MkTypeName(specs, decl);
11707 e->cast.exp = thisExp;
11708 e->byReference = 0x1;
11711 e->destType = destType;
11713 destType->refCount++;
11718 extern char * strstr(char * , const char * );
11720 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11722 struct __ecereNameSpace__ecere__com__DefinedExpression
11724 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11725 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11728 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11731 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11733 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11735 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11737 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11739 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11741 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11743 extern struct Expression * CopyExpression(struct Expression * exp);
11745 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11747 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11749 static void ProcessStatement(struct Statement * stmt);
11751 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11753 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
11755 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
11757 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11759 void ProcessExpressionType(struct Expression * exp)
11761 void * __ecereTemp2;
11762 void * __ecereTemp1;
11763 unsigned int unresolved = 0x0;
11764 struct Location oldyylloc = yylloc;
11765 unsigned int notByReference = 0x0;
11767 if(!exp || exp->expType)
11774 struct Identifier * id = exp->identifier;
11778 if(id->_class && id->_class->name)
11780 id->classSym = id->_class->symbol;
11782 if(strstr(id->string, "__ecereClass") == id->string)
11784 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11787 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11789 ReplaceClassMembers(exp, thisClass);
11792 ProcessExpressionType(exp);
11795 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11800 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11804 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11810 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11813 ProcessExpressionType(exp);
11817 else if(currentClass && !id->_class)
11819 if(ResolveIdWithClass(exp, currentClass, 0x1))
11822 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11827 struct Type * type = symbol->type;
11828 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11830 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11832 struct Context * context = SetupTemplatesContext(_class);
11834 type = ReplaceThisClassType(_class);
11835 FinishTemplatesContext(context);
11837 type->refCount = 0;
11839 FreeSpecifier(id->_class);
11840 id->_class = (((void *)0));
11841 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11842 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11843 id->classSym = (((void *)0));
11844 exp->expType = type;
11847 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11848 exp->isConstant = 0x1;
11849 if(symbol->isParam || !strcmp(id->string, "this"))
11851 if(_class && _class->type == 1)
11852 exp->byReference = 0x1;
11854 if(symbol->isIterator)
11856 if(symbol->isIterator == 3)
11859 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11860 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11861 exp->expType = (((void *)0));
11862 ProcessExpressionType(exp);
11864 else if(symbol->isIterator != 4)
11867 exp->member.exp = MkExpIdentifier(exp->identifier);
11868 exp->member.exp->expType = exp->expType;
11869 exp->member.member = MkIdentifier("data");
11870 exp->expType = (((void *)0));
11871 ProcessExpressionType(exp);
11878 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11880 if(thisNameSpace && !(id->_class && !id->_class->name))
11884 strcpy(name, thisNameSpace);
11885 strcat(name, "::");
11886 strcat(name, id->string);
11887 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11890 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11895 for(c = 0; c < definedExpStackPos; c++)
11896 if(definedExpStack[c] == definedExp)
11898 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11900 struct Location backupYylloc = yylloc;
11902 definedExpStack[definedExpStackPos++] = definedExp;
11903 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11904 ((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));
11905 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11907 parsedExpression = (((void *)0));
11909 expression_yyparse();
11910 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11911 yylloc = backupYylloc;
11912 if(parsedExpression)
11914 FreeIdentifier(id);
11916 exp->list = MkListOne(parsedExpression);
11917 parsedExpression->loc = yylloc;
11918 ProcessExpressionType(exp);
11919 definedExpStackPos--;
11922 definedExpStackPos--;
11928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11934 struct GlobalData * data = (((void *)0));
11936 if(thisNameSpace && !(id->_class && !id->_class->name))
11940 strcpy(name, thisNameSpace);
11941 strcat(name, "::");
11942 strcat(name, id->string);
11943 data = FindGlobalData(name);
11946 data = FindGlobalData(id->string);
11949 DeclareGlobalData(data);
11950 exp->expType = data->dataType;
11952 data->dataType->refCount++;
11953 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11954 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11955 FreeSpecifier(id->_class);
11956 id->_class = (((void *)0));
11961 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11963 if(thisNameSpace && !(id->_class && !id->_class->name))
11967 strcpy(name, thisNameSpace);
11968 strcat(name, "::");
11969 strcat(name, id->string);
11970 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11973 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11978 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11979 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11981 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11982 strcpy(name, "__ecereFunction_");
11983 FullClassNameCat(name, id->string, 0x0);
11984 if(DeclareFunction(function, name))
11986 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11987 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11989 exp->expType = function->dataType;
11990 if(function->dataType)
11991 function->dataType->refCount++;
11992 FreeSpecifier(id->_class);
11993 id->_class = (((void *)0));
12005 struct __ecereNameSpace__ecere__com__Class * _class;
12007 if(!exp->instance->_class)
12009 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12011 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12014 ProcessInstantiationType(exp->instance);
12015 exp->isConstant = exp->instance->isConstant;
12016 if(exp->instance->_class)
12018 exp->expType = MkClassType(exp->instance->_class->name);
12026 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12028 exp->expType = type;
12029 if(exp->constant[0] == '\'')
12031 if((int)((unsigned char *)exp->constant)[1] > 127)
12034 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12037 ch = exp->constant[1];
12038 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12039 exp->constant = PrintUInt(ch);
12041 type->_class = FindClass("unichar");
12042 type->isSigned = 0x0;
12047 type->isSigned = 0x1;
12050 else if(strchr(exp->constant, '.'))
12052 char ch = exp->constant[strlen(exp->constant) - 1];
12058 type->isSigned = 0x1;
12062 if(exp->constant[0] == '0' && exp->constant[1])
12063 type->isSigned = 0x0;
12064 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12065 type->isSigned = 0x0;
12066 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12067 type->isSigned = 0x0;
12069 type->isSigned = 0x1;
12072 exp->isConstant = 0x1;
12078 exp->isConstant = 0x1;
12079 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));
12084 ProcessExpressionType(exp->_new.size);
12085 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));
12086 DeclareType(exp->expType->type, 0x0, 0x0);
12090 ProcessExpressionType(exp->_renew.size);
12091 ProcessExpressionType(exp->_renew.exp);
12092 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));
12093 DeclareType(exp->expType->type, 0x0, 0x0);
12097 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12098 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12099 unsigned int useDestType = 0x0, useSideType = 0x0;
12100 struct Location oldyylloc = yylloc;
12101 unsigned int useSideUnit = 0x0;
12102 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12144 if(exp->op.op != '*' || exp->op.exp1)
12151 if(exp->op.op == '&')
12153 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12155 struct Identifier * id = exp->op.exp2->identifier;
12156 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12158 if(symbol && symbol->isIterator == 2)
12161 exp->member.exp = exp->op.exp2;
12162 exp->member.member = MkIdentifier("key");
12163 exp->expType = (((void *)0));
12164 exp->op.exp2->expType = symbol->type;
12165 symbol->type->refCount++;
12166 ProcessExpressionType(exp);
12174 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))
12176 if(exp->op.exp1->destType)
12177 FreeType(exp->op.exp1->destType);
12178 exp->op.exp1->destType = exp->destType;
12180 exp->destType->refCount++;
12184 if(exp->op.exp1->destType)
12185 FreeType(exp->op.exp1->destType);
12186 exp->op.exp1->destType = dummy;
12189 if(exp->op.exp1->destType && exp->op.op != '=')
12190 exp->op.exp1->destType->count++;
12191 ProcessExpressionType(exp->op.exp1);
12192 if(exp->op.exp1->destType && exp->op.op != '=')
12193 exp->op.exp1->destType->count--;
12194 if(exp->op.exp1->destType == dummy)
12197 exp->op.exp1->destType = (((void *)0));
12199 type1 = exp->op.exp1->expType;
12203 char expString[10240];
12205 expString[0] = '\0';
12206 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12210 exp->op.exp2->destType = exp->op.exp1->expType;
12211 if(exp->op.exp1->expType)
12212 exp->op.exp1->expType->refCount++;
12216 exp->op.exp2->destType = exp->destType;
12218 exp->destType->refCount++;
12222 exp->expType = type1;
12227 PrintExpression(exp->op.exp2, expString);
12228 if(type1 && type1->kind == 13)
12230 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)
12231 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12232 else if(exp->op.op == '=')
12234 if(exp->op.exp2->destType)
12235 FreeType(exp->op.exp2->destType);
12236 exp->op.exp2->destType = type1;
12243 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)
12247 if(exp->op.exp2->destType)
12248 FreeType(exp->op.exp2->destType);
12249 exp->op.exp2->destType = type1;
12256 exp->expType = type1;
12258 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)))
12260 if(exp->op.exp2->destType)
12261 FreeType(exp->op.exp2->destType);
12262 exp->op.exp2->destType = exp->destType;
12264 exp->destType->refCount++;
12268 if(exp->op.exp2->destType)
12269 FreeType(exp->op.exp2->destType);
12270 exp->op.exp2->destType = dummy;
12273 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12275 FreeType(exp->op.exp2->destType);
12276 exp->op.exp2->destType = type1;
12279 if(exp->op.exp2->destType && exp->op.op != '=')
12280 exp->op.exp2->destType->count++;
12281 ProcessExpressionType(exp->op.exp2);
12282 if(exp->op.exp2->destType && exp->op.op != '=')
12283 exp->op.exp2->destType->count--;
12284 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12286 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)
12288 if(exp->op.op != '=' && type1->type->kind == 0)
12289 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12291 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)))
12293 if(exp->op.op == ADD_ASSIGN)
12294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12296 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))
12298 if(exp->op.op == ADD_ASSIGN)
12299 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12301 else if(inCompiler)
12303 char type1String[1024];
12304 char type2String[1024];
12306 type1String[0] = '\0';
12307 type2String[0] = '\0';
12308 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12309 PrintType(type1, type2String, 0x0, 0x1);
12310 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12311 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12314 if(exp->op.exp2->destType == dummy)
12317 exp->op.exp2->destType = (((void *)0));
12319 type2 = exp->op.exp2->expType;
12322 if(exp->op.op == SIZEOF)
12324 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12325 exp->isConstant = 0x1;
12327 else if(exp->op.op == '*' && !exp->op.exp1)
12329 exp->expType = Dereference(type2);
12330 if(type2 && type2->kind == 8)
12331 notByReference = 0x1;
12333 else if(exp->op.op == '&' && !exp->op.exp1)
12334 exp->expType = Reference(type2);
12341 if(exp->op.exp1->destType)
12342 FreeType(exp->op.exp1->destType);
12343 exp->op.exp1->destType = MkClassType("bool");
12344 exp->op.exp1->destType->truth = 0x1;
12345 if(!exp->op.exp1->expType)
12346 ProcessExpressionType(exp->op.exp1);
12348 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12349 FreeType(exp->op.exp1->expType);
12350 exp->op.exp1->expType = MkClassType("bool");
12351 exp->op.exp1->expType->truth = 0x1;
12355 if(exp->op.exp2->destType)
12356 FreeType(exp->op.exp2->destType);
12357 exp->op.exp2->destType = MkClassType("bool");
12358 exp->op.exp2->destType->truth = 0x1;
12359 if(!exp->op.exp2->expType)
12360 ProcessExpressionType(exp->op.exp2);
12362 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12363 FreeType(exp->op.exp2->expType);
12364 exp->op.exp2->expType = MkClassType("bool");
12365 exp->op.exp2->expType->truth = 0x1;
12368 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")))))
12370 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12372 if(exp->op.exp2->destType)
12373 FreeType(exp->op.exp2->destType);
12374 exp->op.exp2->destType = type1;
12376 if(exp->op.exp1->destType)
12377 FreeType(exp->op.exp1->destType);
12378 exp->op.exp1->destType = type2;
12380 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)
12381 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);
12382 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12384 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12388 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12390 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12391 ProcessExpressionType(exp->op.exp1);
12392 if(type2->kind != 13)
12394 ProcessExpressionType(classExp);
12395 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"))))))));
12396 if(!exp->op.exp2->expType)
12397 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12398 ProcessExpressionType(exp->op.exp2);
12402 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)))
12404 if(type1->kind != 8 && type1->type->kind == 0)
12405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12406 exp->expType = type1;
12410 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)))
12412 if(type2->kind != 8 && type2->type->kind == 0)
12413 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12414 exp->expType = type2;
12418 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))
12420 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12424 unsigned int success = 0x0;
12426 if(type1->kind == 13 && type2->kind == 13)
12428 if(exp->op.op == '+')
12429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12430 else if(exp->op.op == '-')
12432 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12434 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12436 if(type1->type->kind == 20)
12438 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12442 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12444 ProcessExpressionType(classExp);
12446 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")))))));
12447 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12455 if(!success && exp->op.exp1->type == 2)
12457 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12460 FreeType(exp->expType);
12461 exp->expType = exp->op.exp1->destType;
12462 if(exp->op.exp1->destType)
12463 exp->op.exp1->destType->refCount++;
12466 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12469 FreeType(exp->expType);
12470 exp->expType = exp->op.exp2->destType;
12471 if(exp->op.exp2->destType)
12472 exp->op.exp2->destType->refCount++;
12478 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12481 FreeType(exp->expType);
12482 exp->expType = exp->op.exp2->destType;
12483 if(exp->op.exp2->destType)
12484 exp->op.exp2->destType->refCount++;
12487 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12490 FreeType(exp->expType);
12491 exp->expType = exp->op.exp1->destType;
12492 if(exp->op.exp1->destType)
12493 exp->op.exp1->destType->refCount++;
12499 char expString1[10240];
12500 char expString2[10240];
12504 expString1[0] = '\0';
12505 expString2[0] = '\0';
12510 PrintExpression(exp->op.exp1, expString1);
12511 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12512 PrintExpression(exp->op.exp2, expString2);
12513 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12514 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12515 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12517 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12521 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12523 if(exp->op.exp1->destType)
12524 FreeType(exp->op.exp1->destType);
12525 exp->op.exp1->destType = type2->_class->registered->dataType;
12526 if(type2->_class->registered->dataType)
12527 type2->_class->registered->dataType->refCount++;
12528 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12529 exp->expType = type2;
12533 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12535 if(exp->op.exp2->destType)
12536 FreeType(exp->op.exp2->destType);
12537 exp->op.exp2->destType = type1->_class->registered->dataType;
12538 if(type1->_class->registered->dataType)
12539 type1->_class->registered->dataType->refCount++;
12540 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12541 exp->expType = type1;
12547 unsigned int valid = 0x0;
12549 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12551 if(exp->op.exp2->destType)
12552 FreeType(exp->op.exp2->destType);
12553 if(!type1->_class->registered->dataType)
12554 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12555 exp->op.exp2->destType = type1->_class->registered->dataType;
12556 exp->op.exp2->destType->refCount++;
12557 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12558 type2 = exp->op.exp2->destType;
12559 exp->expType = type2;
12562 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12564 if(exp->op.exp1->destType)
12565 FreeType(exp->op.exp1->destType);
12566 if(!type2->_class->registered->dataType)
12567 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12568 exp->op.exp1->destType = type2->_class->registered->dataType;
12569 exp->op.exp1->destType->refCount++;
12570 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12571 type1 = exp->op.exp1->destType;
12572 exp->expType = type1;
12575 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12577 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12579 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12582 FreeType(exp->expType);
12583 exp->expType = exp->op.exp1->expType;
12584 if(exp->op.exp2->expType)
12585 exp->op.exp1->expType->refCount++;
12589 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12591 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12594 FreeType(exp->expType);
12595 exp->expType = exp->op.exp2->expType;
12596 if(exp->op.exp2->expType)
12597 exp->op.exp2->expType->refCount++;
12604 if(exp->op.exp2->destType)
12605 FreeType(exp->op.exp2->destType);
12606 exp->op.exp2->destType = type1;
12608 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12611 FreeType(exp->expType);
12612 exp->expType = exp->op.exp2->destType;
12613 if(exp->op.exp2->destType)
12614 exp->op.exp2->destType->refCount++;
12616 else if(type1 && type2)
12618 char expString1[10240];
12619 char expString2[10240];
12620 char type1String[1024];
12621 char type2String[1024];
12623 expString1[0] = '\0';
12624 expString2[0] = '\0';
12625 type1String[0] = '\0';
12626 type2String[0] = '\0';
12629 PrintExpression(exp->op.exp1, expString1);
12630 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12631 PrintExpression(exp->op.exp2, expString2);
12632 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12633 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12634 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12636 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12637 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12639 exp->expType = exp->op.exp1->expType;
12640 if(exp->op.exp1->expType)
12641 exp->op.exp1->expType->refCount++;
12643 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12645 exp->expType = exp->op.exp2->expType;
12646 if(exp->op.exp2->expType)
12647 exp->op.exp2->expType->refCount++;
12654 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12656 struct Type * oldType = exp->op.exp1->expType;
12658 exp->op.exp1->expType = (((void *)0));
12659 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12662 exp->op.exp1->expType = oldType;
12664 if(exp->op.exp1->destType)
12665 FreeType(exp->op.exp1->destType);
12666 exp->op.exp1->destType = type2;
12668 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12671 FreeType(exp->expType);
12672 exp->expType = exp->op.exp1->destType;
12673 if(exp->op.exp1->destType)
12674 exp->op.exp1->destType->refCount++;
12678 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12680 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12682 if(exp->op.exp1->destType)
12683 FreeType(exp->op.exp1->destType);
12684 exp->op.exp1->destType = type2->_class->registered->dataType;
12685 if(type2->_class->registered->dataType)
12686 type2->_class->registered->dataType->refCount++;
12687 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12689 if(exp->op.op == '!')
12691 exp->expType = MkClassType("bool");
12692 exp->expType->truth = 0x1;
12696 exp->expType = type2;
12701 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12703 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12705 if(exp->op.exp2->destType)
12706 FreeType(exp->op.exp2->destType);
12707 exp->op.exp2->destType = type1->_class->registered->dataType;
12708 if(type1->_class->registered->dataType)
12709 type1->_class->registered->dataType->refCount++;
12710 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12712 exp->expType = type1;
12718 if(exp->op.exp1 && !exp->op.exp1->expType)
12720 char expString[10000];
12722 expString[0] = '\0';
12725 PrintExpression(exp->op.exp1, expString);
12726 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12729 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12731 if(exp->op.exp2 && !exp->op.exp2->expType)
12733 char expString[10240];
12735 expString[0] = '\0';
12738 PrintExpression(exp->op.exp2, expString);
12739 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12746 FreeType(exp->expType);
12747 exp->expType = MkClassType("bool");
12748 exp->expType->truth = 0x1;
12750 if(exp->op.op != SIZEOF)
12751 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12752 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12754 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12756 yylloc = oldyylloc;
12763 struct Expression * e;
12765 exp->isConstant = 0x1;
12766 for(e = (*exp->list).first; e; e = e->next)
12768 unsigned int inced = 0x0;
12772 FreeType(e->destType);
12773 e->destType = exp->destType;
12776 exp->destType->refCount++;
12777 e->destType->count++;
12781 ProcessExpressionType(e);
12783 exp->destType->count--;
12784 if(!exp->expType && !e->next)
12786 exp->expType = e->expType;
12788 e->expType->refCount++;
12791 exp->isConstant = 0x0;
12793 e = (*exp->list).first;
12794 if(!e->next && e->type == 8)
12796 struct Expression * next = exp->next, * prev = exp->prev;
12798 FreeType(exp->expType);
12799 FreeType(exp->destType);
12800 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12804 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12805 ProcessExpressionType(exp);
12811 struct Expression * e;
12813 exp->isConstant = 0x1;
12814 ProcessExpressionType(exp->index.exp);
12815 if(!exp->index.exp->isConstant)
12816 exp->isConstant = 0x0;
12817 if(exp->index.exp->expType)
12819 struct Type * source = exp->index.exp->expType;
12821 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)
12823 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12825 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12826 if(exp->index.index && (*exp->index.index).last)
12828 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12832 for(e = (*exp->index.index).first; e; e = e->next)
12834 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12837 FreeType(e->destType);
12838 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12840 ProcessExpressionType(e);
12845 exp->isConstant = 0x0;
12848 exp->expType = Dereference(exp->index.exp->expType);
12850 DeclareType(exp->expType, 0x0, 0x0);
12855 struct Expression * e;
12856 struct Type * functionType;
12857 struct Type * methodType = (((void *)0));
12863 PrintExpression(exp->call.exp, name);
12864 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12866 PrintExpression(exp->call.exp, name);
12869 if(exp->call.exp->type == 0)
12871 struct Expression * idExp = exp->call.exp;
12872 struct Identifier * id = idExp->identifier;
12874 if(!strcmp(id->string, "__ENDIAN_PAD"))
12876 exp->expType = ProcessTypeString("int", 0x1);
12877 if(exp->call.arguments && (*exp->call.arguments).first)
12878 ProcessExpressionType((*exp->call.arguments).first);
12881 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12883 struct Expression * a = (((void *)0));
12884 struct Expression * b = (((void *)0));
12885 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12887 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12889 a = (*exp->call.arguments).first;
12890 b = (*exp->call.arguments).last;
12894 else if((*exp->call.arguments).count == 1)
12896 a = (*exp->call.arguments).first;
12901 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12902 idExp->identifier = (((void *)0));
12903 FreeExpContents(exp);
12904 ProcessExpressionType(a);
12906 ProcessExpressionType(b);
12908 exp->list = MkList();
12909 if(a->expType && (!b || b->expType))
12911 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12915 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12916 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12917 struct Declaration * decl;
12918 char temp1[1024], temp2[1024];
12920 GetTypeSpecs(a->expType, specs);
12921 if(a && !a->isConstant && a->type != 0)
12923 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12924 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12925 tempExp1 = QMkExpId(temp1);
12926 tempExp1->expType = a->expType;
12928 a->expType->refCount++;
12929 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12931 if(b && !b->isConstant && b->type != 0)
12933 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12934 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12935 tempExp2 = QMkExpId(temp2);
12936 tempExp2->expType = b->expType;
12938 b->expType->refCount++;
12939 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12941 decl = MkDeclaration(specs, decls);
12942 if(!curCompound->compound.declarations)
12943 curCompound->compound.declarations = MkList();
12944 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12948 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12950 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12952 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12953 exp->expType = a->expType;
12955 a->expType->refCount++;
12957 else if(!strcmp(id->string, "Abs"))
12959 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12960 exp->expType = a->expType;
12962 a->expType->refCount++;
12964 else if(!strcmp(id->string, "Sgn"))
12966 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"))))));
12967 exp->expType = ProcessTypeString("int", 0x0);
12969 FreeExpression(tempExp1);
12971 FreeExpression(tempExp2);
12972 FreeIdentifier(id);
12978 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12980 if(!exp->call.exp->destType)
12982 exp->call.exp->destType = dummy;
12985 ProcessExpressionType(exp->call.exp);
12986 if(exp->call.exp->destType == dummy)
12989 exp->call.exp->destType = (((void *)0));
12993 functionType = exp->call.exp->expType;
12994 if(functionType && functionType->kind == 16)
12996 methodType = functionType;
12997 functionType = methodType->method->dataType;
12998 if(exp->call.exp->expType->usedClass)
13000 char typeString[1024];
13002 typeString[0] = '\0';
13003 PrintType(functionType, typeString, 0x1, 0x1);
13004 if(strstr(typeString, "thisclass"))
13006 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13007 struct Declarator * decl;
13010 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13012 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13013 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13014 thisClassParams = 0x0;
13015 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13017 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13019 thisClass = exp->call.exp->expType->usedClass;
13020 ProcessDeclarator(decl);
13021 thisClass = backupThisClass;
13023 thisClassParams = 0x1;
13024 functionType = ProcessType(specs, decl);
13025 functionType->refCount = 0;
13026 FinishTemplatesContext(context);
13028 FreeList(specs, FreeSpecifier);
13029 FreeDeclarator(decl);
13033 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13035 struct Type * type = functionType->type;
13037 if(!functionType->refCount)
13039 functionType->type = (((void *)0));
13040 FreeType(functionType);
13042 functionType = type;
13044 if(functionType && functionType->kind != 11)
13046 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13048 else if(functionType)
13050 unsigned int emptyParams = 0x0, noParams = 0x0;
13051 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13052 struct Type * type = functionType->params.first;
13053 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13055 struct Location oldyylloc = yylloc;
13059 if(functionType->extraParam && e)
13061 e->destType = MkClassType(functionType->thisClass->string);
13064 if(!functionType->staticMethod)
13066 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13068 type = MkClassType(memberExp->member.exp->expType->_class->string);
13071 e->destType = type;
13073 type = functionType->params.first;
13076 type->refCount = 0;
13078 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13080 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13083 e->destType = type;
13085 type = functionType->params.first;
13088 type->refCount = 0;
13091 if(type && type->kind == 0)
13094 if(!type->refCount)
13096 type = (((void *)0));
13098 for(; e; e = e->next)
13100 if(!type && !emptyParams)
13103 if(methodType && methodType->methodClass)
13104 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);
13106 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);
13109 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13111 struct Type * templatedType = (((void *)0));
13112 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13113 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13116 if(_class && _class->templateArgs)
13118 struct __ecereNameSpace__ecere__com__Class * sClass;
13120 for(sClass = _class; sClass; sClass = sClass->base)
13122 if(sClass->templateClass)
13123 sClass = sClass->templateClass;
13125 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13127 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13129 struct __ecereNameSpace__ecere__com__Class * nextClass;
13131 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13133 if(nextClass->templateClass)
13134 nextClass = nextClass->templateClass;
13135 id += nextClass->templateParams.count;
13145 if(curParam && _class->templateArgs[id].dataTypeString)
13147 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13150 struct Context * context = SetupTemplatesContext(_class);
13152 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13153 FinishTemplatesContext(context);
13155 e->destType = templatedType;
13158 templatedType->passAsTemplate = 0x1;
13163 e->destType = type;
13170 e->destType = type;
13174 if(type && type->kind != 14)
13176 struct Type * next = type->next;
13178 if(!type->refCount)
13183 if(type && type->kind != 14)
13185 if(methodType && methodType->methodClass)
13186 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);
13188 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);
13190 yylloc = oldyylloc;
13191 if(type && !type->refCount)
13196 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13197 if(exp->call.exp->type == 0)
13199 char * string = exp->call.exp->identifier->string;
13203 struct Symbol * symbol;
13204 struct Location oldyylloc = yylloc;
13206 yylloc = exp->call.exp->identifier->loc;
13207 if(strstr(string, "__builtin_") == string)
13210 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13211 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));
13212 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13213 if(strstr(symbol->string, "::"))
13214 globalContext->hasNameSpace = 0x1;
13215 yylloc = oldyylloc;
13218 else if(exp->call.exp->type == 8)
13222 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13223 if(!functionType->returnType)
13225 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13228 if(functionType && functionType->kind == 11)
13230 exp->expType = functionType->returnType;
13231 if(functionType->returnType)
13232 functionType->returnType->refCount++;
13233 if(!functionType->refCount)
13234 FreeType(functionType);
13236 if(exp->call.arguments)
13238 for(e = (*exp->call.arguments).first; e; e = e->next)
13240 struct Type * destType = e->destType;
13242 ProcessExpressionType(e);
13249 struct Type * type;
13250 struct Location oldyylloc = yylloc;
13251 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13253 exp->thisPtr = thisPtr;
13254 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13256 exp->member.member->classSym = exp->member.member->_class->symbol;
13258 ProcessExpressionType(exp->member.exp);
13259 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)
13261 exp->isConstant = 0x0;
13264 exp->isConstant = exp->member.exp->isConstant;
13265 type = exp->member.exp->expType;
13267 if(type && (type->kind == 20))
13269 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13270 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13274 for(param = _class->templateParams.first; param; param = param->next)
13276 if(param->type == 1 && !strcmp(param->name, exp->member.member->string))
13280 if(param && param->defaultArg.member)
13282 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13286 struct Expression * expMember = exp->member.exp;
13287 struct Declarator * decl;
13288 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13289 char thisClassTypeString[1024];
13291 FreeIdentifier(exp->member.member);
13292 ProcessExpressionType(argExp);
13294 char * colon = strstr(param->defaultArg.memberString, "::");
13298 char className[1024];
13299 struct __ecereNameSpace__ecere__com__Class * sClass;
13301 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13302 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13305 strcpy(thisClassTypeString, _class->fullName);
13307 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13308 exp->expType = ProcessType(specs, decl);
13309 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13311 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13312 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13314 int paramCount = 0;
13315 int lastParam = -1;
13316 char templateString[1024];
13317 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13319 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13320 for(cClass = expClass; cClass; cClass = cClass->base)
13324 for(param = cClass->templateParams.first; param; param = param->next)
13327 struct __ecereNameSpace__ecere__com__Class * sClass;
13328 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13330 for(sClass = cClass->base; sClass; sClass = sClass->base)
13331 id += sClass->templateParams.count;
13332 arg = expClass->templateArgs[id];
13333 for(sClass = _class; sClass; sClass = sClass->base)
13335 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13337 struct __ecereNameSpace__ecere__com__Class * nextClass;
13339 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13340 p += nextClass->templateParams.count;
13341 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13343 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13345 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13347 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13348 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13355 char argument[256];
13357 argument[0] = '\0';
13358 switch(param->type)
13362 char expString[1024];
13363 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13364 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13365 struct Expression * exp;
13366 char * string = PrintHexUInt64(arg.expression.ui64);
13368 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13369 ProcessExpressionType(exp);
13370 ComputeExpression(exp);
13371 expString[0] = '\0';
13372 PrintExpression(exp, expString);
13373 strcat(argument, expString);
13374 FreeExpression(exp);
13379 strcat(argument, arg.member->name);
13384 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13386 if(!strcmp(arg.dataTypeString, "thisclass"))
13387 strcat(argument, thisClassTypeString);
13389 strcat(argument, arg.dataTypeString);
13397 strcat(templateString, ", ");
13398 if(lastParam != p - 1)
13400 strcat(templateString, param->name);
13401 strcat(templateString, " = ");
13403 strcat(templateString, argument);
13412 int len = strlen(templateString);
13414 if(templateString[len - 1] == '>')
13415 templateString[len++] = ' ';
13416 templateString[len++] = '>';
13417 templateString[len++] = '\0';
13420 struct Context * context = SetupTemplatesContext(_class);
13422 FreeType(exp->expType);
13423 exp->expType = ProcessTypeString(templateString, 0x0);
13424 FinishTemplatesContext(context);
13428 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")))))))));
13431 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13433 type = ProcessTemplateParameterType(type->templateParameter);
13436 if(type && (type->kind == 20))
13438 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13440 struct Identifier * id = exp->member.member;
13441 int typeKind = type->kind;
13442 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));
13444 if(typeKind == 19 && exp->member.exp->type == 26)
13446 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13449 if(id && (typeKind == 3 || typeKind == 15))
13450 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13453 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13454 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13455 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13456 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13457 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13459 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13460 exp->member.memberType = 1;
13461 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13462 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13465 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13467 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13468 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13470 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13472 member = (((void *)0));
13474 if(!member && !prop)
13475 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13476 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13477 exp->member.thisPtr = 0x1;
13483 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13484 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13485 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13487 if(!prop && !member)
13489 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13492 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13493 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13494 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13499 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13500 prop = (((void *)0));
13502 member = (((void *)0));
13506 if(!prop && !member)
13507 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13508 if(!prop && !member && !method)
13512 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13515 exp->member.memberType = 5;
13516 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13520 char structName[1024];
13521 struct Identifier * id = exp->member.member;
13522 struct Expression * classExp = exp->member.exp;
13525 FreeType(classExp->expType);
13526 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13527 strcpy(structName, "__ecereClassData_");
13528 FullClassNameCat(structName, type->_class->string, 0x0);
13530 exp->member.member = id;
13531 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"))))))));
13533 ProcessExpressionType(exp);
13539 struct Symbol * classSym = FindClass(id->string);
13543 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13546 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13552 exp->member.memberType = 1;
13553 if(!prop->dataType)
13554 ProcessPropertyType(prop);
13555 exp->expType = prop->dataType;
13557 prop->dataType->refCount++;
13561 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13563 FreeExpContents(exp);
13565 exp->identifier = MkIdentifier("class");
13566 ProcessExpressionType(exp);
13569 exp->member.memberType = 3;
13570 DeclareStruct(_class->fullName, 0x0);
13571 if(!member->dataType)
13573 struct Context * context = SetupTemplatesContext(_class);
13575 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13576 FinishTemplatesContext(context);
13578 exp->expType = member->dataType;
13579 if(member->dataType)
13580 member->dataType->refCount++;
13582 else if(revConvert)
13584 exp->member.memberType = 4;
13585 exp->expType = MkClassType(revConvert->_class->fullName);
13591 exp->member.memberType = 2;
13593 if(!method->dataType)
13594 ProcessMethodType(method);
13595 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));
13596 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13597 exp->expType->usedClass = _class;
13599 else if(!classProp)
13601 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13603 FreeExpContents(exp);
13605 exp->identifier = MkIdentifier("class");
13606 ProcessExpressionType(exp);
13609 yylloc = exp->member.member->loc;
13610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13612 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13614 if(_class && exp->expType)
13616 struct __ecereNameSpace__ecere__com__Class * tClass;
13619 while(tClass && !tClass->templateClass)
13620 tClass = tClass->base;
13621 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13624 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13625 struct __ecereNameSpace__ecere__com__Class * sClass;
13627 for(sClass = tClass; sClass; sClass = sClass->base)
13630 if(sClass->templateClass)
13631 sClass = sClass->templateClass;
13632 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13634 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13636 for(sClass = sClass->base; sClass; sClass = sClass->base)
13637 id += sClass->templateParams.count;
13645 if(curParam && tClass->templateArgs[id].dataTypeString)
13647 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13648 struct Context * context = SetupTemplatesContext(tClass);
13650 FreeType(exp->expType);
13651 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13654 if(exp->expType->kind == 21)
13656 FreeType(exp->expType);
13657 exp->expType = ReplaceThisClassType(_class);
13659 if(tClass->templateClass)
13660 exp->expType->passAsTemplate = 0x1;
13663 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13664 if(exp->destType->kind == 21)
13666 FreeType(exp->destType);
13667 exp->destType = ReplaceThisClassType(_class);
13671 FinishTemplatesContext(context);
13674 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13677 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13678 struct __ecereNameSpace__ecere__com__Class * sClass;
13680 for(sClass = tClass; sClass; sClass = sClass->base)
13683 if(sClass->templateClass)
13684 sClass = sClass->templateClass;
13685 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13687 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13689 for(sClass = sClass->base; sClass; sClass = sClass->base)
13690 id += sClass->templateParams.count;
13700 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13701 struct Context * context = SetupTemplatesContext(tClass);
13702 struct Type * basicType;
13704 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13707 if(basicType->kind == 21)
13709 FreeType(basicType);
13710 basicType = ReplaceThisClassType(_class);
13712 FreeType(exp->expType);
13713 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));
13716 exp->destType = exp->expType;
13717 exp->destType->refCount++;
13720 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13721 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13722 struct Declarator * decl;
13724 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13727 exp->destType->refCount++;
13729 exp->expType->refCount++;
13731 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13732 exp->cast.exp = newExp;
13735 FinishTemplatesContext(context);
13738 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13740 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13744 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13747 int paramCount = 0;
13748 int lastParam = -1;
13749 char templateString[1024];
13750 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13752 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13753 while(cClass != expClass)
13755 struct __ecereNameSpace__ecere__com__Class * sClass;
13757 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13760 for(param = cClass->templateParams.first; param; param = param->next)
13762 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13765 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13766 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13768 while(cClassCur != tClass && !paramCur)
13770 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13772 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13774 cClassCur = sClassCur;
13775 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13777 if(!strcmp(paramCur->name, param->name))
13784 if(paramCur && paramCur->type == 0)
13785 arg = tClass->templateArgs[cp];
13787 arg = expClass->templateArgs[p];
13789 char argument[256];
13791 argument[0] = '\0';
13792 switch(param->type)
13796 char expString[1024];
13797 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13798 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13799 struct Expression * exp;
13800 char * string = PrintHexUInt64(arg.expression.ui64);
13802 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13803 ProcessExpressionType(exp);
13804 ComputeExpression(exp);
13805 expString[0] = '\0';
13806 PrintExpression(exp, expString);
13807 strcat(argument, expString);
13808 FreeExpression(exp);
13813 strcat(argument, arg.member->name);
13818 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13819 strcat(argument, arg.dataTypeString);
13826 strcat(templateString, ", ");
13827 if(lastParam != p - 1)
13829 strcat(templateString, param->name);
13830 strcat(templateString, " = ");
13832 strcat(templateString, argument);
13841 int len = strlen(templateString);
13843 if(templateString[len - 1] == '>')
13844 templateString[len++] = ' ';
13845 templateString[len++] = '>';
13846 templateString[len++] = '\0';
13848 FreeType(exp->expType);
13850 struct Context * context = SetupTemplatesContext(tClass);
13852 exp->expType = ProcessTypeString(templateString, 0x0);
13853 FinishTemplatesContext(context);
13860 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)");
13862 else if(type && (type->kind == 9 || type->kind == 10))
13864 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13868 exp->expType = memberType;
13870 memberType->refCount++;
13875 char expString[10240];
13877 expString[0] = '\0';
13880 PrintExpression(exp, expString);
13881 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13883 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13885 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13887 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13889 struct Identifier * id = exp->member.member;
13890 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));
13894 FreeType(exp->expType);
13895 exp->expType = ReplaceThisClassType(_class);
13899 yylloc = oldyylloc;
13904 struct Type * destType = exp->destType;
13906 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13908 exp->member.member->classSym = exp->member.member->_class->symbol;
13910 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13914 ProcessExpressionType(exp);
13921 struct Symbol * classSym = exp->_class->symbol;
13923 if(classSym && classSym->registered)
13925 if(classSym->registered->type == 5)
13930 DeclareStruct(classSym->string, 0x0);
13931 FreeSpecifier(exp->_class);
13933 FullClassNameCat(name, classSym->string, 0x0);
13934 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13938 if(classSym->registered->fixed)
13940 FreeSpecifier(exp->_class);
13941 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13946 char className[1024];
13948 strcpy(className, "__ecereClass_");
13949 FullClassNameCat(className, classSym->string, 0x1);
13950 MangleClassName(className);
13951 DeclareClass(classSym, className);
13952 FreeExpContents(exp);
13954 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13955 exp->member.member = MkIdentifier("structSize");
13959 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13964 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13966 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13967 exp->isConstant = 0x1;
13968 DeclareType(type, 0x0, 0x0);
13974 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13976 type->count = (unsigned int)1;
13977 FreeType(exp->cast.exp->destType);
13978 exp->cast.exp->destType = type;
13980 ProcessExpressionType(exp->cast.exp);
13981 type->count = (unsigned int)0;
13982 exp->expType = type;
13983 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13985 void * prev = exp->prev, * next = exp->next;
13986 struct Type * expType = exp->cast.exp->destType;
13987 struct Expression * castExp = exp->cast.exp;
13988 struct Type * destType = exp->destType;
13991 expType->refCount++;
13992 FreeType(exp->expType);
13993 FreeTypeName(exp->cast.typeName);
13995 FreeType(exp->expType);
13996 FreeType(exp->destType);
13997 exp->expType = expType;
13998 exp->destType = destType;
13999 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14005 exp->isConstant = exp->cast.exp->isConstant;
14011 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14014 exp->expType = type;
14019 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14021 ProcessExpressionType(exp->vaArg.exp);
14023 exp->expType = type;
14028 struct Expression * e;
14030 exp->isConstant = 0x1;
14031 FreeType(exp->cond.cond->destType);
14032 exp->cond.cond->destType = MkClassType("bool");
14033 exp->cond.cond->destType->truth = 0x1;
14034 ProcessExpressionType(exp->cond.cond);
14035 if(!exp->cond.cond->isConstant)
14036 exp->isConstant = 0x0;
14037 for(e = (*exp->cond.exp).first; e; e = e->next)
14041 FreeType(e->destType);
14042 e->destType = exp->destType;
14044 e->destType->refCount++;
14046 ProcessExpressionType(e);
14049 exp->expType = e->expType;
14051 e->expType->refCount++;
14054 exp->isConstant = 0x0;
14056 FreeType(exp->cond.elseExp->destType);
14057 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14058 if(exp->cond.elseExp->destType)
14059 exp->cond.elseExp->destType->refCount++;
14060 ProcessExpressionType(exp->cond.elseExp);
14061 if(!exp->cond.elseExp->isConstant)
14062 exp->isConstant = 0x0;
14067 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14069 struct Statement * last = (*exp->compound->compound.statements).last;
14071 if(last->type == 3 && last->expressions && (*last->expressions).last)
14073 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14075 exp->destType->refCount++;
14077 ProcessStatement(exp->compound);
14078 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14079 if(((struct Expression *)(*last->expressions).last)->expType)
14080 exp->expType->refCount++;
14086 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14088 if(spec && spec->type == 1)
14090 exp->expType = MkClassType(spec->name);
14091 exp->expType->kind = 19;
14092 exp->byReference = 0x1;
14096 exp->expType = MkClassType("ecere::com::Class");
14097 exp->byReference = 0x1;
14103 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14107 struct Identifier * id = exp->classData.id;
14108 char structName[1024];
14109 struct Expression * classExp;
14111 strcpy(structName, "__ecereClassData_");
14112 FullClassNameCat(structName, _class->fullName, 0x0);
14114 exp->member.member = id;
14115 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14116 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14118 classExp = MkExpIdentifier(MkIdentifier("class"));
14119 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"))))))));
14120 ProcessExpressionType(exp);
14127 struct Type * type = (((void *)0));
14128 char * typeString = (((void *)0));
14129 char typeStringBuf[1024];
14131 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))
14133 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14135 typeString = templateClass->templateArgs[2].dataTypeString;
14139 struct Expression * e;
14141 for(e = (*exp->list).first; e; e = e->next)
14143 ProcessExpressionType(e);
14153 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14157 e->expType = (((void *)0));
14158 e = (*exp->list).first;
14159 ProcessExpressionType(e);
14162 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14164 FreeType(e->expType);
14165 e->expType = (((void *)0));
14167 type = (((void *)0));
14175 FreeType(e->expType);
14176 e->expType = (((void *)0));
14182 typeStringBuf[0] = '\0';
14183 PrintType(type, typeStringBuf, 0x0, 0x1);
14184 typeString = typeStringBuf;
14186 type = (((void *)0));
14191 char templateString[1024];
14192 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14193 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14194 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14195 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14197 struct Expression * e;
14198 struct Expression * expExt;
14199 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14200 struct Context * context = PushContext();
14202 sprintf(templateString, "Container<%s>", typeString);
14203 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14204 sprintf(count, "%d", (*exp->list).count);
14205 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14206 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14207 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14208 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14211 type = ProcessTypeString(typeString, 0x0);
14212 while(e = (*exp->list).first)
14214 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14215 e->destType = type;
14217 ProcessExpressionType(e);
14218 ListAdd(initializers, MkInitializerAssignment(e));
14221 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14223 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14224 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14225 exp->expType = ProcessTypeString(templateString, 0x0);
14227 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14228 expExt->compound->compound.context = context;
14229 PopContext(context);
14230 ProcessExpressionType(expExt);
14234 exp->expType = ProcessTypeString("Container", 0x0);
14235 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14240 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14242 FreeType(exp->expType);
14243 exp->expType = ReplaceThisClassType(thisClass);
14245 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14247 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14251 if(exp->expType->kind != 15)
14253 struct Type * member;
14254 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14256 FreeType(exp->expType);
14257 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14258 exp->expType->kind = symbol->type->kind;
14259 exp->expType->refCount++;
14260 exp->expType->enumName = enumName;
14261 exp->expType->members = symbol->type->members;
14262 for(member = symbol->type->members.first; member; member = member->next)
14263 member->refCount++;
14267 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14269 for(member = symbol->type->members.first; member; member = member->next)
14271 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14279 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14281 else if(exp->destType && !exp->destType->keepCast)
14283 if(!CheckExpressionType(exp, exp->destType, 0x0))
14285 if(!exp->destType->count || unresolved)
14290 if(exp->destType->kind != 14)
14297 char expString[10240];
14299 expString[0] = '\0';
14300 PrintType(exp->destType, type2, 0x0, 0x1);
14303 PrintExpression(exp, expString);
14304 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14308 else if(exp->type != 16)
14309 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14314 char expString[10240];
14316 expString[0] = '\0';
14319 PrintExpression(exp, expString);
14320 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14323 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14324 else if(exp->type != 16)
14325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14337 PrintType(exp->expType, type1, 0x0, 0x1);
14338 PrintType(exp->destType, type2, 0x0, 0x1);
14340 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)))
14344 char expString[10240];
14346 expString[0] = '\0';
14349 PrintExpression(exp, expString);
14350 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14352 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14353 FreeType(exp->expType);
14354 exp->destType->refCount++;
14355 exp->expType = exp->destType;
14360 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14362 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14363 char typeString[1024];
14364 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14365 struct Declarator * decl;
14367 typeString[0] = '\0';
14370 exp->expType->refCount++;
14372 exp->expType->refCount++;
14374 newExp->destType = exp->expType;
14375 PrintType(exp->expType, typeString, 0x0, 0x0);
14376 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14377 exp->cast.typeName = MkTypeName(specs, decl);
14378 exp->cast.exp = newExp;
14381 else if(unresolved)
14383 if(exp->identifier->_class && exp->identifier->_class->name)
14384 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14385 else if(exp->identifier->string && exp->identifier->string[0])
14386 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14388 else if(!exp->expType && exp->type != 16)
14390 char expString[10240];
14392 expString[0] = '\0';
14395 PrintExpression(exp, expString);
14396 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14398 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14400 ApplyAnyObjectLogic(exp);
14401 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14403 exp->byReference = 0x1;
14405 yylloc = oldyylloc;
14408 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)
14412 *curMember = (*curMember)->next;
14413 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14415 *curMember = subMemberStack[--(*subMemberStackPos)];
14416 *curMember = (*curMember)->next;
14418 while((*curMember) && (*curMember)->isProperty)
14419 *curMember = (*curMember)->next;
14420 if(subMemberStackPos)
14422 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14424 subMemberStack[(*subMemberStackPos)++] = *curMember;
14425 *curMember = (*curMember)->members.first;
14426 while(*curMember && (*curMember)->isProperty)
14427 *curMember = (*curMember)->next;
14435 if(subMemberStackPos && *subMemberStackPos)
14437 *curMember = subMemberStack[--(*subMemberStackPos)];
14438 *curMember = (*curMember)->next;
14442 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14444 if(*curClass == _class)
14446 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14448 *curMember = (*curClass)->membersAndProperties.first;
14450 while((*curMember) && (*curMember)->isProperty)
14451 *curMember = (*curMember)->next;
14452 if(subMemberStackPos)
14454 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14456 subMemberStack[(*subMemberStackPos)++] = *curMember;
14457 *curMember = (*curMember)->members.first;
14458 while(*curMember && (*curMember)->isProperty)
14459 *curMember = (*curMember)->next;
14466 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14471 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14473 if(init->exp && !init->exp->destType)
14475 FreeType(init->exp->destType);
14476 init->exp->destType = type;
14482 ProcessExpressionType(init->exp);
14483 init->isConstant = init->exp->isConstant;
14489 struct Expression * exp = init->exp;
14490 struct Instantiation * inst = exp->instance;
14491 struct MembersInit * members;
14494 init->list = MkList();
14497 for(members = (*inst->members).first; members; members = members->next)
14499 if(members->type == 0)
14501 struct MemberInit * member;
14503 for(member = (*members->dataMembers).first; member; member = member->next)
14505 ListAdd(init->list, member->initializer);
14506 member->initializer = (((void *)0));
14511 FreeExpression(exp);
14515 struct Initializer * i;
14516 struct Type * initializerType = (((void *)0));
14517 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14518 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14519 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14520 int subMemberStackPos = 0;
14522 if(type && type->kind == 12)
14523 initializerType = Dereference(type);
14524 else if(type && (type->kind == 9 || type->kind == 10))
14525 initializerType = type->members.first;
14526 for(i = (*init->list).first; i; i = i->next)
14528 if(type && type->kind == 8 && type->_class && type->_class->registered)
14530 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14533 if(!curMember->dataType)
14534 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14535 initializerType = curMember->dataType;
14538 ProcessInitializer(i, initializerType);
14539 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14540 initializerType = initializerType->next;
14542 init->isConstant = 0x0;
14544 if(type && type->kind == 12)
14545 FreeType(initializerType);
14546 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14548 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14555 extern struct Symbol * FindType(struct Context * ctx, char * name);
14557 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14559 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14565 if(spec->specifier == THISCLASS)
14570 spec->name = ReplaceThisClass(thisClass);
14571 spec->symbol = FindClass(spec->name);
14572 ProcessSpecifier(spec, declareStruct);
14579 struct Symbol * symbol = FindType(curContext, spec->name);
14582 DeclareType(symbol->type, 0x1, 0x1);
14583 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14584 DeclareStruct(spec->name, 0x0);
14589 struct Enumerator * e;
14593 for(e = (*spec->list).first; e; e = e->next)
14596 ProcessExpressionType(e->exp);
14604 if(spec->definitions)
14606 struct ClassDef * def;
14607 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14609 ProcessClass(spec->definitions, symbol);
14616 static void ProcessDeclarator(struct Declarator * decl)
14621 if(decl->identifier->classSym)
14623 FreeSpecifier(decl->identifier->_class);
14624 decl->identifier->_class = (((void *)0));
14628 if(decl->array.exp)
14629 ProcessExpressionType(decl->array.exp);
14636 if(decl->declarator)
14637 ProcessDeclarator(decl->declarator);
14638 if(decl->type == 4)
14640 struct Identifier * id = GetDeclId(decl);
14642 if(id && id->_class)
14644 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14646 if(!decl->function.parameters)
14647 decl->function.parameters = MkList();
14648 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14649 id->_class = (((void *)0));
14651 if(decl->function.parameters)
14653 struct TypeName * param;
14655 for(param = (*decl->function.parameters).first; param; param = param->next)
14657 if(param->qualifiers && (*param->qualifiers).first)
14659 struct Specifier * spec = (*param->qualifiers).first;
14661 if(spec && spec->specifier == TYPED_OBJECT)
14663 struct Declarator * d = param->declarator;
14664 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);
14666 FreeList(param->qualifiers, FreeSpecifier);
14667 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14668 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14669 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14672 else if(spec && spec->specifier == ANY_OBJECT)
14674 struct Declarator * d = param->declarator;
14676 FreeList(param->qualifiers, FreeSpecifier);
14677 param->qualifiers = MkListOne(MkSpecifier(VOID));
14678 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14680 else if(spec->specifier == THISCLASS)
14685 spec->name = ReplaceThisClass(thisClass);
14686 spec->symbol = FindClass(spec->name);
14687 ProcessSpecifier(spec, 0x0);
14691 if(param->declarator)
14692 ProcessDeclarator(param->declarator);
14700 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14702 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14704 static void ProcessDeclaration(struct Declaration * decl)
14706 yylloc = decl->loc;
14711 unsigned int declareStruct = 0x0;
14713 if(decl->declarators)
14715 struct InitDeclarator * d;
14717 for(d = (*decl->declarators).first; d; d = d->next)
14719 struct Type * type, * subType;
14721 ProcessDeclarator(d->declarator);
14722 type = ProcessType(decl->specifiers, d->declarator);
14725 ProcessInitializer(d->initializer, type);
14726 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14728 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14730 struct Instantiation * inst = d->initializer->exp->instance;
14732 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14733 d->initializer->exp->instance = (((void *)0));
14734 if(decl->specifiers)
14735 FreeList(decl->specifiers, FreeSpecifier);
14736 FreeList(decl->declarators, FreeInitDeclarator);
14743 for(subType = type; subType; )
14745 if(subType->kind == 8)
14747 declareStruct = 0x1;
14750 else if(subType->kind == 13)
14752 else if(subType->kind == 12)
14753 subType = subType->arrayType;
14762 if(decl->specifiers)
14764 struct Specifier * s;
14766 for(s = (*decl->specifiers).first; s; s = s->next)
14768 ProcessSpecifier(s, declareStruct);
14775 ProcessInstantiationType(decl->inst);
14780 struct Specifier * spec;
14781 struct Declarator * d;
14782 unsigned int declareStruct = 0x0;
14784 if(decl->declarators)
14786 for(d = (*decl->declarators).first; d; d = d->next)
14788 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14789 struct Type * subType;
14791 ProcessDeclarator(d);
14792 for(subType = type; subType; )
14794 if(subType->kind == 8)
14796 declareStruct = 0x1;
14799 else if(subType->kind == 13)
14801 else if(subType->kind == 12)
14802 subType = subType->arrayType;
14809 if(decl->specifiers)
14811 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14812 ProcessSpecifier(spec, declareStruct);
14819 static struct FunctionDefinition * curFunction;
14821 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14823 char propName[1024], propNameM[1024];
14824 char getName[1024], setName[1024];
14825 struct __ecereNameSpace__ecere__sys__OldList * args;
14827 DeclareProperty(prop, setName, getName);
14828 strcpy(propName, "__ecereProp_");
14829 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14830 strcat(propName, "_");
14831 FullClassNameCat(propName, prop->name, 0x1);
14832 MangleClassName(propName);
14833 strcpy(propNameM, "__ecerePropM_");
14834 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14835 strcat(propNameM, "_");
14836 FullClassNameCat(propNameM, prop->name, 0x1);
14837 MangleClassName(propNameM);
14838 if(prop->isWatchable)
14841 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14842 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14843 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14845 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14846 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14847 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14851 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14852 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14853 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14855 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14856 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14857 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14859 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14860 curFunction->propSet->fireWatchersDone = 0x1;
14863 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14865 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14867 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14869 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14871 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14873 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14875 static void ProcessStatement(struct Statement * stmt)
14877 yylloc = stmt->loc;
14881 ProcessStatement(stmt->labeled.stmt);
14884 if(stmt->caseStmt.exp)
14886 FreeType(stmt->caseStmt.exp->destType);
14887 stmt->caseStmt.exp->destType = curSwitchType;
14889 curSwitchType->refCount++;
14890 ProcessExpressionType(stmt->caseStmt.exp);
14891 ComputeExpression(stmt->caseStmt.exp);
14893 if(stmt->caseStmt.stmt)
14894 ProcessStatement(stmt->caseStmt.stmt);
14898 if(stmt->compound.context)
14900 struct Declaration * decl;
14901 struct Statement * s;
14902 struct Statement * prevCompound = curCompound;
14903 struct Context * prevContext = curContext;
14905 if(!stmt->compound.isSwitch)
14907 curCompound = stmt;
14908 curContext = stmt->compound.context;
14910 if(stmt->compound.declarations)
14912 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14913 ProcessDeclaration(decl);
14915 if(stmt->compound.statements)
14917 for(s = (*stmt->compound.statements).first; s; s = s->next)
14918 ProcessStatement(s);
14920 curContext = prevContext;
14921 curCompound = prevCompound;
14927 struct Expression * exp;
14929 if(stmt->expressions)
14931 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14932 ProcessExpressionType(exp);
14938 struct Expression * exp;
14940 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14941 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14942 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14943 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14945 ProcessExpressionType(exp);
14947 if(stmt->ifStmt.stmt)
14948 ProcessStatement(stmt->ifStmt.stmt);
14949 if(stmt->ifStmt.elseStmt)
14950 ProcessStatement(stmt->ifStmt.elseStmt);
14955 struct Type * oldSwitchType = curSwitchType;
14957 if(stmt->switchStmt.exp)
14959 struct Expression * exp;
14961 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14965 ProcessExpressionType(exp);
14968 curSwitchType = exp->expType;
14971 ProcessStatement(stmt->switchStmt.stmt);
14972 curSwitchType = oldSwitchType;
14977 if(stmt->whileStmt.exp)
14979 struct Expression * exp;
14981 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14982 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14983 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14984 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14986 ProcessExpressionType(exp);
14989 if(stmt->whileStmt.stmt)
14990 ProcessStatement(stmt->whileStmt.stmt);
14995 if(stmt->doWhile.exp)
14997 struct Expression * exp;
14999 if((*stmt->doWhile.exp).last)
15001 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15002 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15003 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15005 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15007 ProcessExpressionType(exp);
15010 if(stmt->doWhile.stmt)
15011 ProcessStatement(stmt->doWhile.stmt);
15016 struct Expression * exp;
15018 if(stmt->forStmt.init)
15019 ProcessStatement(stmt->forStmt.init);
15020 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15022 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15023 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15024 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15026 if(stmt->forStmt.check)
15027 ProcessStatement(stmt->forStmt.check);
15028 if(stmt->forStmt.increment)
15030 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15031 ProcessExpressionType(exp);
15033 if(stmt->forStmt.stmt)
15034 ProcessStatement(stmt->forStmt.stmt);
15039 struct Identifier * id = stmt->forEachStmt.id;
15040 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15041 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15042 struct Statement * block = stmt->forEachStmt.stmt;
15043 char iteratorType[1024];
15044 struct Type * source;
15045 struct Expression * e;
15046 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));
15047 struct Expression * arrayExp;
15048 char * typeString = (((void *)0));
15049 int builtinCount = 0;
15051 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15055 FreeType(e->destType);
15056 e->destType = ProcessTypeString("Container", 0x0);
15058 if(!isBuiltin || e->next)
15059 ProcessExpressionType(e);
15061 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15062 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15064 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15065 struct Symbol * symbol;
15066 struct Expression * expIt = (((void *)0));
15067 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15068 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15069 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15070 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15073 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15074 stmt->compound.context->parent = curContext;
15075 curContext = stmt->compound.context;
15076 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15078 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15079 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15081 isCustomAVLTree = 0x1;
15082 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15084 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15087 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15089 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15091 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15094 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15098 struct Declarator * decl;
15099 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15101 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15102 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15103 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15107 struct Type * type = (((void *)0));
15108 char typeStringBuf[1024];
15110 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15111 if(((struct Expression *)(*exp).last)->type == 11)
15113 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15116 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15118 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)
15120 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15122 typeString = templateClass->templateArgs[2].dataTypeString;
15124 else if(arrayExp->list)
15126 struct Expression * e;
15128 for(e = (*arrayExp->list).first; e; e = e->next)
15130 ProcessExpressionType(e);
15140 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15144 e->expType = (((void *)0));
15145 e = (*arrayExp->list).first;
15146 ProcessExpressionType(e);
15149 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15151 FreeType(e->expType);
15152 e->expType = (((void *)0));
15154 type = (((void *)0));
15162 FreeType(e->expType);
15163 e->expType = (((void *)0));
15169 typeStringBuf[0] = '\0';
15170 PrintType(type, typeStringBuf, 0x0, 0x1);
15171 typeString = typeStringBuf;
15177 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15178 struct Declarator * decl;
15179 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15183 struct Expression * e;
15185 builtinCount = (*arrayExp->list).count;
15186 type = ProcessTypeString(typeString, 0x0);
15187 while(e = (*arrayExp->list).first)
15189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15190 e->destType = type;
15192 ProcessExpressionType(e);
15193 ListAdd(initializers, MkInitializerAssignment(e));
15196 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15198 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15199 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15200 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15201 FreeList(exp, FreeExpression);
15205 arrayExp->expType = ProcessTypeString("Container", 0x0);
15206 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15209 else if(isLinkList && !isList)
15211 struct Declarator * decl;
15212 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15214 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15215 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15216 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15218 else if(_class->templateArgs)
15221 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15223 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15224 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15226 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15227 if(block && block->type == 2 && block->compound.context)
15229 block->compound.context->parent = stmt->compound.context;
15233 block = MkIfStmt(filter, block, (((void *)0)));
15237 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));
15238 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15239 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15240 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15246 sprintf(count, "%d", builtinCount);
15247 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));
15248 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15249 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15250 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15252 else if(isLinkList && !isList)
15254 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15255 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15257 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15259 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));
15263 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15264 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15266 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));
15268 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15269 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15270 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15274 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15276 ProcessExpressionType(expIt);
15277 if((*stmt->compound.declarations).first)
15278 ProcessDeclaration((*stmt->compound.declarations).first);
15280 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15281 ProcessStatement(stmt);
15282 curContext = stmt->compound.context->parent;
15287 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15299 struct Expression * exp;
15301 if(stmt->expressions)
15303 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15307 if(curFunction && !curFunction->type)
15308 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15309 FreeType(exp->destType);
15310 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15312 exp->destType->refCount++;
15314 ProcessExpressionType(exp);
15321 ProcessDeclaration(stmt->decl);
15326 struct AsmField * field;
15328 if(stmt->asmStmt.inputFields)
15330 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15331 if(field->expression)
15332 ProcessExpressionType(field->expression);
15334 if(stmt->asmStmt.outputFields)
15336 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15337 if(field->expression)
15338 ProcessExpressionType(field->expression);
15340 if(stmt->asmStmt.clobberedFields)
15342 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15344 if(field->expression)
15345 ProcessExpressionType(field->expression);
15352 struct PropertyWatch * propWatch;
15353 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15354 struct Expression * object = stmt->_watch.object;
15355 struct Expression * watcher = stmt->_watch.watcher;
15358 ProcessExpressionType(watcher);
15360 ProcessExpressionType(object);
15363 if(watcher || thisClass)
15365 struct External * external = curExternal;
15366 struct Context * context = curContext;
15369 stmt->expressions = MkList();
15370 curExternal = external->prev;
15371 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15373 struct ClassFunction * func;
15374 char watcherName[1024];
15375 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15376 struct External * createdExternal;
15377 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15379 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15380 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15381 if(propWatch->deleteWatch)
15382 strcat(watcherName, "_delete");
15385 struct Identifier * propID;
15387 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15389 strcat(watcherName, "_");
15390 strcat(watcherName, propID->string);
15393 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15395 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15396 ProcessClassFunctionBody(func, propWatch->compound);
15397 propWatch->compound = (((void *)0));
15398 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15399 createdExternal->symbol->idCode = external->symbol->idCode;
15400 curExternal = createdExternal;
15401 ProcessFunction(createdExternal->function);
15403 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15405 externalDecl->declaration = decl;
15406 if(decl->symbol && !decl->symbol->pointerExternal)
15407 decl->symbol->pointerExternal = externalDecl;
15409 if(propWatch->deleteWatch)
15411 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15413 ListAdd(args, CopyExpression(object));
15414 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15415 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15416 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15420 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15421 struct Identifier * propID;
15423 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15425 char propName[1024];
15426 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15430 char getName[1024], setName[1024];
15431 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15433 DeclareProperty(prop, setName, getName);
15434 strcpy(propName, "__ecereProp_");
15435 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15436 strcat(propName, "_");
15437 FullClassNameCat(propName, prop->name, 0x1);
15438 ListAdd(args, CopyExpression(object));
15439 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15440 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15441 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15442 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15445 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15450 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15452 curExternal = external;
15453 curContext = context;
15455 FreeExpression(watcher);
15457 FreeExpression(object);
15458 FreeList(watches, FreePropertyWatch);
15461 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15465 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15467 ProcessStatement(propWatch->compound);
15474 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15475 struct Expression * object = stmt->_watch.object;
15476 struct __ecereNameSpace__ecere__com__Class * _class;
15479 ProcessExpressionType(object);
15482 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15485 struct Identifier * propID;
15488 stmt->expressions = MkList();
15489 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15491 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15498 for(propID = (*watches).first; propID; propID = propID->next)
15500 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15504 CreateFireWatcher(prop, object, stmt);
15507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15512 struct __ecereNameSpace__ecere__com__Property * prop;
15513 struct __ecereNameSpace__ecere__com__Class * base;
15515 for(base = _class; base; base = base->base)
15517 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15519 if(prop->isProperty && prop->isWatchable)
15521 CreateFireWatcher(prop, object, stmt);
15527 FreeExpression(object);
15528 FreeList(watches, FreeIdentifier);
15531 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15537 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15538 struct Expression * object = stmt->_watch.object;
15539 struct Expression * watcher = stmt->_watch.watcher;
15540 struct __ecereNameSpace__ecere__com__Class * _class;
15543 ProcessExpressionType(object);
15545 ProcessExpressionType(watcher);
15548 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15549 if(watcher || thisClass)
15553 struct Identifier * propID;
15556 stmt->expressions = MkList();
15559 struct __ecereNameSpace__ecere__sys__OldList * args;
15562 ListAdd(args, CopyExpression(object));
15563 ListAdd(args, MkExpConstant("0"));
15564 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15565 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15569 for(propID = (*watches).first; propID; propID = propID->next)
15571 char propName[1024];
15572 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15576 char getName[1024], setName[1024];
15577 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15579 DeclareProperty(prop, setName, getName);
15580 strcpy(propName, "__ecereProp_");
15581 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15582 strcat(propName, "_");
15583 FullClassNameCat(propName, prop->name, 0x1);
15584 MangleClassName(propName);
15585 ListAdd(args, CopyExpression(object));
15586 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15587 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15588 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15591 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15595 FreeExpression(object);
15597 FreeExpression(watcher);
15598 FreeList(watches, FreeIdentifier);
15601 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15611 extern struct Expression * QBrackets(struct Expression * exp);
15613 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15615 extern struct Declarator * QMkPtrDecl(char * id);
15617 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15619 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15621 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15623 static void ProcessFunction(struct FunctionDefinition * function)
15625 void * __ecereTemp2;
15626 void * __ecereTemp1;
15627 struct Identifier * id = GetDeclId(function->declarator);
15628 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15629 struct Type * type = symbol ? symbol->type : (((void *)0));
15630 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15631 struct Context * oldTopContext = topContext;
15633 yylloc = function->loc;
15634 if(type && type->thisClass)
15636 struct Symbol * classSym = type->thisClass;
15637 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15638 char className[1024];
15639 char structName[1024];
15640 struct Declarator * funcDecl;
15641 struct Symbol * thisSymbol;
15642 unsigned int typedObject = 0x0;
15644 if(_class && !_class->base)
15646 _class = currentClass;
15647 if(_class && !_class->symbol)
15648 _class->symbol = FindClass(_class->fullName);
15649 classSym = _class ? _class->symbol : (((void *)0));
15652 thisClass = _class;
15653 if(inCompiler && _class)
15655 if(type->kind == 11)
15657 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15659 struct Type * param = symbol->type->params.first;
15661 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15664 if(type->classObjectType != 1)
15666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15667 symbol->type->staticMethod = 0x1;
15668 symbol->type->thisClass = (((void *)0));
15669 symbol->type->extraParam = 0x0;
15672 strcpy(className, "__ecereClass_");
15673 FullClassNameCat(className, _class->fullName, 0x1);
15674 MangleClassName(className);
15675 structName[0] = (char)0;
15676 FullClassNameCat(structName, _class->fullName, 0x0);
15677 funcDecl = GetFuncDecl(function->declarator);
15680 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15682 struct TypeName * param = (*funcDecl->function.parameters).first;
15684 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15686 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15687 FreeTypeName(param);
15690 if(!function->propertyNoThis)
15692 struct TypeName * thisParam;
15694 if(type->classObjectType != 1)
15696 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15697 if(!funcDecl->function.parameters)
15698 funcDecl->function.parameters = MkList();
15699 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15703 if(type->classObjectType != 1)
15705 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15706 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15708 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));
15709 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15713 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15715 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15717 funcDecl = GetFuncDecl(initDecl->declarator);
15720 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15722 struct TypeName * param = (*funcDecl->function.parameters).first;
15724 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15726 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15727 FreeTypeName(param);
15730 if(type->classObjectType != 1)
15732 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15734 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15736 if(!funcDecl->function.parameters)
15737 funcDecl->function.parameters = MkList();
15738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15746 if(type->classObjectType != 1)
15748 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));
15749 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15750 if(typedObject && thisSymbol->type)
15752 thisSymbol->type->classObjectType = 2;
15753 thisSymbol->type->byReference = type->byReference;
15757 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15759 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15762 struct __ecereNameSpace__ecere__com__Class * base;
15764 for(base = _class; base && base->type != 1000; base = base->next)
15766 for(member = base->membersAndProperties.first; member; member = member->next)
15767 if(!member->isProperty)
15773 for(member = _class->membersAndProperties.first; member; member = member->next)
15774 if(!member->isProperty)
15778 char pointerName[1024];
15779 struct Declaration * decl;
15780 struct Initializer * initializer;
15781 struct Expression * exp, * bytePtr;
15783 strcpy(pointerName, "__ecerePointer_");
15784 FullClassNameCat(pointerName, _class->fullName, 0x0);
15786 char className[1024];
15788 strcpy(className, "__ecereClass_");
15789 FullClassNameCat(className, classSym->string, 0x1);
15790 MangleClassName(className);
15791 DeclareClass(classSym, className);
15793 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15798 sprintf(string, "%d", _class->offset);
15799 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15803 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15805 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15806 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));
15809 yylloc = function->body->loc;
15810 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15812 struct Context * prevContext = curContext;
15814 curContext = function->body->compound.context;
15815 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15816 curContext = prevContext;
15818 decl->symbol = (((void *)0));
15819 if(!function->body->compound.declarations)
15820 function->body->compound.declarations = MkList();
15821 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15827 thisClass = (((void *)0));
15830 FreeSpecifier(id->_class);
15831 id->_class = (((void *)0));
15832 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15834 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15836 id = GetDeclId(initDecl->declarator);
15837 FreeSpecifier(id->_class);
15838 id->_class = (((void *)0));
15842 topContext = function->body->compound.context;
15844 struct FunctionDefinition * oldFunction = curFunction;
15846 curFunction = function;
15848 ProcessStatement(function->body);
15849 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15851 struct Statement * prevCompound = curCompound;
15852 struct Context * prevContext = curContext;
15853 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15855 if(!function->body->compound.statements)
15856 function->body->compound.statements = MkList();
15857 ListAdd(function->body->compound.statements, fireWatchers);
15858 curCompound = function->body;
15859 curContext = function->body->compound.context;
15860 ProcessStatement(fireWatchers);
15861 curContext = prevContext;
15862 curCompound = prevCompound;
15864 curFunction = oldFunction;
15866 if(function->declarator)
15868 ProcessDeclarator(function->declarator);
15870 topContext = oldTopContext;
15871 thisClass = oldThisClass;
15874 extern void FreeSymbol(struct Symbol * symbol);
15876 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15878 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15880 struct ClassDef * def;
15881 struct External * external = curExternal;
15882 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15884 for(def = definitions->first; def; def = def->next)
15888 if(def->function->declarator)
15889 curExternal = def->function->declarator->symbol->pointerExternal;
15891 curExternal = external;
15892 ProcessFunction((struct FunctionDefinition *)def->function);
15894 else if(def->type == 2)
15896 if(def->decl->type == 2)
15898 thisClass = regClass;
15899 ProcessInstantiationType(def->decl->inst);
15900 thisClass = (((void *)0));
15904 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15907 thisClass = regClass;
15908 ProcessDeclaration(def->decl);
15909 thisClass = backThisClass;
15912 else if(def->type == 1 && def->defProperties)
15914 struct MemberInit * defProperty;
15915 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);
15917 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15918 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15920 thisClass = regClass;
15921 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15922 thisClass = (((void *)0));
15924 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15925 FreeSymbol(thisSymbol);
15927 else if(def->type == 3 && def->propertyDef)
15929 struct PropertyDef * prop = def->propertyDef;
15931 thisClass = regClass;
15936 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15938 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15940 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15941 ProcessStatement(prop->setStmt);
15947 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15949 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15951 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15952 ProcessStatement(prop->getStmt);
15954 if(prop->issetStmt)
15958 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15960 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15962 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15963 ProcessStatement(prop->issetStmt);
15965 thisClass = (((void *)0));
15967 else if(def->type == 4 && def->propertyWatch)
15969 struct PropertyWatch * propertyWatch = def->propertyWatch;
15971 thisClass = regClass;
15972 if(propertyWatch->compound)
15974 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
15976 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15977 curExternal = (((void *)0));
15978 ProcessStatement(propertyWatch->compound);
15980 thisClass = (((void *)0));
15985 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15987 void ComputeDataTypes()
15989 void * __ecereTemp1;
15990 struct External * external;
15991 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15993 currentClass = (((void *)0));
15994 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15995 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15996 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
15997 curExternal = temp;
15998 DeclareStruct("ecere::com::Class", 0x0);
15999 DeclareStruct("ecere::com::Instance", 0x0);
16000 DeclareStruct("ecere::com::Property", 0x0);
16001 DeclareStruct("ecere::com::DataMember", 0x0);
16002 DeclareStruct("ecere::com::Method", 0x0);
16003 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16004 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16006 for(external = (*ast).first; external; external = external->next)
16008 afterExternal = curExternal = external;
16009 if(external->type == 0)
16011 currentClass = external->function->_class;
16012 ProcessFunction(external->function);
16014 else if(external->type == 1)
16016 currentClass = (((void *)0));
16017 ProcessDeclaration(external->declaration);
16019 else if(external->type == 2)
16021 struct ClassDefinition * _class = external->_class;
16023 currentClass = external->symbol->registered;
16024 if(_class->definitions)
16026 ProcessClass(_class->definitions, _class->symbol);
16030 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16031 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16034 else if(external->type == 4)
16036 thisNameSpace = external->id->string;
16039 currentClass = (((void *)0));
16040 thisNameSpace = (((void *)0));
16041 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16042 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16045 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);
16047 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);
16049 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16051 struct __ecereNameSpace__ecere__com__Class * class;
16053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16086 __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);
16087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16090 __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);
16091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16103 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16104 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16105 __ecereClass_Conversion = class;
16106 __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);
16107 __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);
16108 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16109 __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);
16110 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16112 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16128 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)