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')
1232 *endString = string + c;
1243 *endString = string + c;
1247 return sign * value;
1250 uint64 _strtoui64(char * string, char ** endString, int base)
1257 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1269 if(ch == (char)0 && string[c + 1] == 'x')
1282 for(; (ch = string[c]); c++)
1286 else if(ch >= '1' && ch <= '9')
1288 else if(ch >= 'a' && ch <= 'z')
1290 else if(ch >= 'A' && ch <= 'Z')
1295 *endString = string + c;
1306 *endString = string + c;
1310 return sign * value;
1313 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1315 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1317 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1319 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1321 if(!param->baseType)
1323 if(param->dataTypeString)
1324 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1326 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1328 return param->baseType;
1330 return (((void *)0));
1333 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1335 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1337 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1341 if(type1->kind == type2->kind)
1349 if(type1->passAsTemplate && !type2->passAsTemplate)
1351 return type1->isSigned != type2->isSigned;
1353 return type1->_class != type2->_class;
1355 return NeedCast(type1->type, type2->type);
1363 extern int strcmp(const char * , const char * );
1365 extern struct Context * curContext;
1367 extern struct Context * topContext;
1369 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1371 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);
1373 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1375 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);
1377 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);
1379 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1381 struct __ecereNameSpace__ecere__com__ClassProperty
1384 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1385 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1386 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1388 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1389 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1390 char * dataTypeString;
1391 struct Type * dataType;
1392 unsigned int constant;
1395 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1397 extern struct Expression * QMkExpId(char * id);
1399 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1401 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1403 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1404 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1409 char * dataTypeString;
1412 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1414 char __ecere_padding[4];
1417 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1419 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1421 extern void FreeIdentifier(struct Identifier * id);
1423 void ProcessExpressionType(struct Expression * exp);
1425 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1427 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1429 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1431 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1433 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1435 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1437 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1439 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1441 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1443 if(exp->type == 0 && exp->identifier)
1445 struct Identifier * id = exp->identifier;
1446 struct Context * ctx;
1447 struct Symbol * symbol = (((void *)0));
1449 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1451 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1453 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1458 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1460 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1461 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1462 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1463 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1467 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1469 if(!prop && !method)
1470 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1471 if(!prop && !method && !member)
1473 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1475 if(prop || method || member || classProp)
1478 exp->member.member = id;
1479 exp->member.memberType = 0;
1480 exp->member.exp = QMkExpId("this");
1481 exp->addedThis = 0x1;
1483 else if(_class && _class->templateParams.first)
1485 struct __ecereNameSpace__ecere__com__Class * sClass;
1487 for(sClass = _class; sClass; sClass = sClass->base)
1489 if(sClass->templateParams.first)
1491 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1493 for(param = sClass->templateParams.first; param; param = param->next)
1495 if(param->type == 2 && !strcmp(param->name, id->string))
1497 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1501 struct Declarator * decl;
1502 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1504 FreeIdentifier(exp->member.member);
1505 ProcessExpressionType(argExp);
1506 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1507 exp->expType = ProcessType(specs, decl);
1509 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1520 extern int sprintf(char * , char * , ...);
1522 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1524 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1526 char * PrintInt(long long result)
1530 if(result > (((long long)0x7fffffffffffffffLL)))
1531 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1533 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1537 char * PrintUInt(uint64 result)
1541 if(result > (0xffffffff))
1542 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1543 else if(result > (((int)0x7fffffff)))
1544 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1546 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1547 return __ecereNameSpace__ecere__sys__CopyString(temp);
1550 char * PrintInt64(long long result)
1554 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1555 return __ecereNameSpace__ecere__sys__CopyString(temp);
1558 char * PrintUInt64(uint64 result)
1562 if(result > (((long long)0x7fffffffffffffffLL)))
1563 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1566 return __ecereNameSpace__ecere__sys__CopyString(temp);
1569 char * PrintHexUInt(uint64 result)
1573 if(result > (0xffffffff))
1574 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1576 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 char * PrintHexUInt64(uint64 result)
1584 if(result > (0xffffffff))
1585 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1587 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1588 return __ecereNameSpace__ecere__sys__CopyString(temp);
1591 char * PrintShort(short result)
1595 sprintf(temp, "%d", (unsigned short)result);
1596 return __ecereNameSpace__ecere__sys__CopyString(temp);
1599 char * PrintUShort(unsigned short result)
1603 if(result > (unsigned short)32767)
1604 sprintf(temp, "0x%X", (int)result);
1606 sprintf(temp, "%d", result);
1607 return __ecereNameSpace__ecere__sys__CopyString(temp);
1610 extern int isprint(int c);
1612 char * PrintChar(char result)
1616 if(result > (char)0 && isprint(result))
1617 sprintf(temp, "'%c'", result);
1618 else if(result < (char)0)
1619 sprintf(temp, "%d", result);
1621 sprintf(temp, "0x%X", (unsigned char)result);
1622 return __ecereNameSpace__ecere__sys__CopyString(temp);
1625 char * PrintUChar(unsigned char result)
1629 sprintf(temp, "0x%X", result);
1630 return __ecereNameSpace__ecere__sys__CopyString(temp);
1633 char * PrintFloat(float result)
1637 sprintf(temp, "%.16ff", result);
1638 return __ecereNameSpace__ecere__sys__CopyString(temp);
1641 char * PrintDouble(double result)
1645 sprintf(temp, "%.16f", result);
1646 return __ecereNameSpace__ecere__sys__CopyString(temp);
1649 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1653 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1654 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1655 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1657 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1658 unsigned int (* Neg)(struct Expression *, struct Operand *);
1659 unsigned int (* Inc)(struct Expression *, struct Operand *);
1660 unsigned int (* Dec)(struct Expression *, struct Operand *);
1661 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1664 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1670 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1673 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* Not)(struct Expression *, struct Operand *);
1679 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1680 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1681 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1682 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1683 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1684 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1685 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1686 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1687 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1690 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1696 unsigned int ptrSize;
1714 struct Operand GetOperand(struct Expression * exp);
1716 unsigned int GetInt(struct Expression * exp, int * value2)
1718 struct Operand op2 = GetOperand(exp);
1720 if(op2.kind == 3 && op2.type->isSigned)
1722 else if(op2.kind == 3)
1723 *value2 = (int)op2.ui;
1724 if(op2.kind == 4 && op2.type->isSigned)
1725 *value2 = (int)op2.i64;
1726 else if(op2.kind == 4)
1727 *value2 = (int)op2.ui64;
1728 else if(op2.kind == 2 && op2.type->isSigned)
1729 *value2 = (int)op2.s;
1730 else if(op2.kind == 2)
1731 *value2 = (int)op2.us;
1732 else if(op2.kind == 1 && op2.type->isSigned)
1733 *value2 = (int)op2.c;
1734 else if(op2.kind == 1)
1735 *value2 = (int)op2.uc;
1736 else if(op2.kind == 6)
1737 *value2 = (int)op2.f;
1738 else if(op2.kind == 7)
1739 *value2 = (int)op2.d;
1740 else if(op2.kind == 13)
1741 *value2 = (int)op2.ui;
1747 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1749 struct Operand op2 = GetOperand(exp);
1751 if(op2.kind == 3 && op2.type->isSigned)
1752 *value2 = (unsigned int)op2.i;
1753 else if(op2.kind == 3)
1755 if(op2.kind == 4 && op2.type->isSigned)
1756 *value2 = (unsigned int)op2.i64;
1757 else if(op2.kind == 4)
1758 *value2 = (unsigned int)op2.ui64;
1759 else if(op2.kind == 2 && op2.type->isSigned)
1760 *value2 = (unsigned int)op2.s;
1761 else if(op2.kind == 2)
1762 *value2 = (unsigned int)op2.us;
1763 else if(op2.kind == 1 && op2.type->isSigned)
1764 *value2 = (unsigned int)op2.c;
1765 else if(op2.kind == 1)
1766 *value2 = (unsigned int)op2.uc;
1767 else if(op2.kind == 6)
1768 *value2 = (unsigned int)op2.f;
1769 else if(op2.kind == 7)
1770 *value2 = (unsigned int)op2.d;
1771 else if(op2.kind == 13)
1778 unsigned int GetInt64(struct Expression * exp, long long * value2)
1780 struct Operand op2 = GetOperand(exp);
1782 if(op2.kind == 3 && op2.type->isSigned)
1783 *value2 = (long long)op2.i;
1784 else if(op2.kind == 3)
1785 *value2 = (long long)op2.ui;
1786 if(op2.kind == 4 && op2.type->isSigned)
1788 else if(op2.kind == 4)
1789 *value2 = (long long)op2.ui64;
1790 else if(op2.kind == 2 && op2.type->isSigned)
1791 *value2 = (long long)op2.s;
1792 else if(op2.kind == 2)
1793 *value2 = (long long)op2.us;
1794 else if(op2.kind == 1 && op2.type->isSigned)
1795 *value2 = (long long)op2.c;
1796 else if(op2.kind == 1)
1797 *value2 = (long long)op2.uc;
1798 else if(op2.kind == 6)
1799 *value2 = (long long)op2.f;
1800 else if(op2.kind == 7)
1801 *value2 = (long long)op2.d;
1802 else if(op2.kind == 13)
1803 *value2 = (long long)op2.ui;
1809 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1811 struct Operand op2 = GetOperand(exp);
1813 if(op2.kind == 3 && op2.type->isSigned)
1814 *value2 = (uint64)op2.i;
1815 else if(op2.kind == 3)
1816 *value2 = (uint64)op2.ui;
1817 if(op2.kind == 4 && op2.type->isSigned)
1818 *value2 = (uint64)op2.i64;
1819 else if(op2.kind == 4)
1821 else if(op2.kind == 2 && op2.type->isSigned)
1822 *value2 = (uint64)op2.s;
1823 else if(op2.kind == 2)
1824 *value2 = (uint64)op2.us;
1825 else if(op2.kind == 1 && op2.type->isSigned)
1826 *value2 = (uint64)op2.c;
1827 else if(op2.kind == 1)
1828 *value2 = (uint64)op2.uc;
1829 else if(op2.kind == 6)
1830 *value2 = (uint64)op2.f;
1831 else if(op2.kind == 7)
1832 *value2 = (uint64)op2.d;
1833 else if(op2.kind == 13)
1834 *value2 = (uint64)op2.ui;
1840 unsigned int GetShort(struct Expression * exp, short * value2)
1842 struct Operand op2 = GetOperand(exp);
1844 if(op2.kind == 3 && op2.type->isSigned)
1845 *value2 = (short)op2.i;
1846 else if(op2.kind == 3)
1847 *value2 = (short)op2.ui;
1848 if(op2.kind == 4 && op2.type->isSigned)
1849 *value2 = (short)op2.i64;
1850 else if(op2.kind == 4)
1851 *value2 = (short)op2.ui64;
1852 else if(op2.kind == 2 && op2.type->isSigned)
1854 else if(op2.kind == 2)
1855 *value2 = (short)op2.us;
1856 else if(op2.kind == 1 && op2.type->isSigned)
1857 *value2 = (short)op2.c;
1858 else if(op2.kind == 1)
1859 *value2 = (short)op2.uc;
1860 else if(op2.kind == 6)
1861 *value2 = (short)op2.f;
1862 else if(op2.kind == 7)
1863 *value2 = (short)op2.d;
1864 else if(op2.kind == 13)
1865 *value2 = (short)op2.ui;
1871 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1873 struct Operand op2 = GetOperand(exp);
1875 if(op2.kind == 3 && op2.type->isSigned)
1876 *value2 = (unsigned short)op2.i;
1877 else if(op2.kind == 3)
1878 *value2 = (unsigned short)op2.ui;
1879 if(op2.kind == 4 && op2.type->isSigned)
1880 *value2 = (unsigned short)op2.i64;
1881 else if(op2.kind == 4)
1882 *value2 = (unsigned short)op2.ui64;
1883 else if(op2.kind == 2 && op2.type->isSigned)
1884 *value2 = (unsigned short)op2.s;
1885 else if(op2.kind == 2)
1887 else if(op2.kind == 1 && op2.type->isSigned)
1888 *value2 = (unsigned short)op2.c;
1889 else if(op2.kind == 1)
1890 *value2 = (unsigned short)op2.uc;
1891 else if(op2.kind == 6)
1892 *value2 = (unsigned short)op2.f;
1893 else if(op2.kind == 7)
1894 *value2 = (unsigned short)op2.d;
1895 else if(op2.kind == 13)
1896 *value2 = (unsigned short)op2.ui;
1902 unsigned int GetChar(struct Expression * exp, char * value2)
1904 struct Operand op2 = GetOperand(exp);
1906 if(op2.kind == 3 && op2.type->isSigned)
1907 *value2 = (char)op2.i;
1908 else if(op2.kind == 3)
1909 *value2 = (char)op2.ui;
1910 if(op2.kind == 4 && op2.type->isSigned)
1911 *value2 = (char)op2.i64;
1912 else if(op2.kind == 4)
1913 *value2 = (char)op2.ui64;
1914 else if(op2.kind == 2 && op2.type->isSigned)
1915 *value2 = (char)op2.s;
1916 else if(op2.kind == 2)
1917 *value2 = (char)op2.us;
1918 else if(op2.kind == 1 && op2.type->isSigned)
1920 else if(op2.kind == 1)
1921 *value2 = (char)op2.uc;
1922 else if(op2.kind == 6)
1923 *value2 = (char)op2.f;
1924 else if(op2.kind == 7)
1925 *value2 = (char)op2.d;
1926 else if(op2.kind == 13)
1927 *value2 = (char)op2.ui;
1933 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1935 struct Operand op2 = GetOperand(exp);
1937 if(op2.kind == 3 && op2.type->isSigned)
1938 *value2 = (unsigned char)op2.i;
1939 else if(op2.kind == 3)
1940 *value2 = (unsigned char)op2.ui;
1941 if(op2.kind == 4 && op2.type->isSigned)
1942 *value2 = (unsigned char)op2.i64;
1943 else if(op2.kind == 4)
1944 *value2 = (unsigned char)op2.ui64;
1945 else if(op2.kind == 2 && op2.type->isSigned)
1946 *value2 = (unsigned char)op2.s;
1947 else if(op2.kind == 2)
1948 *value2 = (unsigned char)op2.us;
1949 else if(op2.kind == 1 && op2.type->isSigned)
1950 *value2 = (unsigned char)op2.c;
1951 else if(op2.kind == 1)
1953 else if(op2.kind == 6)
1954 *value2 = (unsigned char)op2.f;
1955 else if(op2.kind == 7)
1956 *value2 = (unsigned char)op2.d;
1957 else if(op2.kind == 13)
1958 *value2 = (unsigned char)op2.ui;
1964 unsigned int GetFloat(struct Expression * exp, float * value2)
1966 struct Operand op2 = GetOperand(exp);
1968 if(op2.kind == 3 && op2.type->isSigned)
1969 *value2 = (float)(float)op2.i;
1970 else if(op2.kind == 3)
1971 *value2 = (float)(float)op2.ui;
1972 if(op2.kind == 4 && op2.type->isSigned)
1973 *value2 = (float)(float)op2.i64;
1974 else if(op2.kind == 4)
1975 *value2 = (float)(float)op2.ui64;
1976 else if(op2.kind == 2 && op2.type->isSigned)
1977 *value2 = (float)(float)op2.s;
1978 else if(op2.kind == 2)
1979 *value2 = (float)(float)op2.us;
1980 else if(op2.kind == 1 && op2.type->isSigned)
1981 *value2 = (float)(float)op2.c;
1982 else if(op2.kind == 1)
1983 *value2 = (float)(float)op2.uc;
1984 else if(op2.kind == 6)
1985 *value2 = (float)op2.f;
1986 else if(op2.kind == 7)
1987 *value2 = (float)op2.d;
1988 else if(op2.kind == 13)
1989 *value2 = (float)(float)op2.ui;
1995 unsigned int GetDouble(struct Expression * exp, double * value2)
1997 struct Operand op2 = GetOperand(exp);
1999 if(op2.kind == 3 && op2.type->isSigned)
2000 *value2 = (double)(double)op2.i;
2001 else if(op2.kind == 3)
2002 *value2 = (double)(double)op2.ui;
2003 if(op2.kind == 4 && op2.type->isSigned)
2004 *value2 = (double)(double)op2.i64;
2005 else if(op2.kind == 4)
2006 *value2 = (double)(double)op2.ui64;
2007 else if(op2.kind == 2 && op2.type->isSigned)
2008 *value2 = (double)(double)op2.s;
2009 else if(op2.kind == 2)
2010 *value2 = (double)(double)op2.us;
2011 else if(op2.kind == 1 && op2.type->isSigned)
2012 *value2 = (double)(double)op2.c;
2013 else if(op2.kind == 1)
2014 *value2 = (double)(double)op2.uc;
2015 else if(op2.kind == 6)
2016 *value2 = (double)op2.f;
2017 else if(op2.kind == 7)
2018 *value2 = (double)op2.d;
2019 else if(op2.kind == 13)
2020 *value2 = (double)(double)op2.ui;
2026 void ComputeExpression(struct Expression * exp);
2028 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2030 int ComputeTypeSize(struct Type * type);
2032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2034 struct __ecereNameSpace__ecere__com__BitMember
2036 struct __ecereNameSpace__ecere__com__BitMember * prev;
2037 struct __ecereNameSpace__ecere__com__BitMember * next;
2039 unsigned int isProperty;
2042 struct __ecereNameSpace__ecere__com__Class * _class;
2043 char * dataTypeString;
2044 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2045 struct Type * dataType;
2052 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2054 struct __ecereNameSpace__ecere__sys__OldLink
2056 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2057 struct __ecereNameSpace__ecere__sys__OldLink * next;
2061 void FinishTemplatesContext(struct Context * context);
2063 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2065 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2066 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2068 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2071 int unionMemberOffset = 0;
2074 if(!member && _class->destructionWatchOffset)
2075 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2077 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2079 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2081 if(!dataMember->isProperty)
2083 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2085 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2091 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2093 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2095 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2097 if(!isMember && _class->type == 2 && dataMember->dataType)
2099 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2103 ComputeTypeSize(dataMember->dataType);
2104 if(bitMember->pos == -1)
2105 bitMember->pos = _class->memberOffset;
2106 if(!bitMember->size)
2107 bitMember->size = dataMember->dataType->size * 8;
2108 _class->memberOffset = bitMember->pos + bitMember->size;
2109 for(d = 0; d < bitMember->size; d++)
2115 bitMember->mask = mask << bitMember->pos;
2117 else if(dataMember->type == 0 && dataMember->dataType)
2122 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2123 ComputeTypeSize(dataMember->dataType);
2124 if(dataMember->dataType->bitFieldCount)
2126 bitFields += dataMember->dataType->bitFieldCount;
2133 int size = (bitFields + 7) / 8;
2137 int __simpleStruct0;
2141 int __simpleStruct0;
2143 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2144 if(member->memberOffset % alignment)
2145 member->memberOffset += alignment - (member->memberOffset % alignment);
2147 dataMember->offset = member->memberOffset;
2148 if(member->type == 1)
2149 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2152 member->memberOffset += size;
2159 int __simpleStruct0;
2161 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2162 if(_class->memberOffset % alignment)
2163 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2165 dataMember->offset = _class->memberOffset;
2166 _class->memberOffset += size;
2170 size = dataMember->dataType->size;
2171 alignment = dataMember->dataType->alignment;
2175 int __simpleStruct0;
2179 int __simpleStruct0;
2181 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2182 if(member->memberOffset % alignment)
2183 member->memberOffset += alignment - (member->memberOffset % alignment);
2185 dataMember->offset = member->memberOffset;
2186 if(member->type == 1)
2187 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2190 member->memberOffset += size;
2197 int __simpleStruct0;
2199 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2200 if(_class->memberOffset % alignment)
2201 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2203 dataMember->offset = _class->memberOffset;
2204 _class->memberOffset += size;
2209 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2212 int __simpleStruct2;
2213 int __simpleStruct0, __simpleStruct1;
2215 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2216 dataMember->offset = member->memberOffset;
2217 if(member->type == 1)
2218 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2220 member->memberOffset += dataMember->memberOffset;
2224 int __simpleStruct0, __simpleStruct1;
2226 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2227 dataMember->offset = _class->memberOffset;
2228 _class->memberOffset += dataMember->memberOffset;
2236 int size = (bitFields + 7) / 8;
2240 int __simpleStruct0;
2244 int __simpleStruct0;
2246 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2247 if(member->memberOffset % alignment)
2248 member->memberOffset += alignment - (member->memberOffset % alignment);
2250 if(member->type == 1)
2251 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2254 member->memberOffset += size;
2261 int __simpleStruct0;
2263 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2264 if(_class->memberOffset % alignment)
2265 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2267 _class->memberOffset += size;
2272 if(member && member->type == 1)
2274 member->memberOffset = unionMemberOffset;
2278 if(_class->type != 2)
2280 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2283 struct __ecereNameSpace__ecere__com__Property * prop;
2285 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2287 if(prop->isProperty && prop->isWatchable)
2289 prop->watcherOffset = _class->structSize;
2290 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2295 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2297 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2299 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2301 if(deriv->computeSize)
2303 deriv->offset = _class->structSize;
2304 deriv->memberOffset = 0;
2305 deriv->structSize = deriv->offset;
2306 ComputeClassMembers(deriv, 0x0);
2314 FinishTemplatesContext(context);
2317 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2319 struct __ecereNameSpace__ecere__com__NameSpace
2322 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2323 struct __ecereNameSpace__ecere__com__NameSpace * left;
2324 struct __ecereNameSpace__ecere__com__NameSpace * right;
2326 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2327 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2328 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2329 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2330 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2333 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2335 struct __ecereNameSpace__ecere__com__Module
2337 struct __ecereNameSpace__ecere__com__Instance * application;
2338 struct __ecereNameSpace__ecere__sys__OldList classes;
2339 struct __ecereNameSpace__ecere__sys__OldList defines;
2340 struct __ecereNameSpace__ecere__sys__OldList functions;
2341 struct __ecereNameSpace__ecere__sys__OldList modules;
2342 struct __ecereNameSpace__ecere__com__Instance * prev;
2343 struct __ecereNameSpace__ecere__com__Instance * next;
2349 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2350 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2353 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2355 struct __ecereNameSpace__ecere__com__Class * _class;
2356 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2358 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2359 ComputeModuleClasses(subModule->data);
2360 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2361 ComputeClassMembers(_class, 0x0);
2364 extern unsigned int inCompiler;
2366 extern void Compiler_Error(char * format, ...);
2368 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2370 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2372 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2374 int ComputeTypeSize(struct Type * type)
2376 unsigned int size = type ? type->size : 0;
2378 if(!size && type && !type->computing)
2380 type->computing = 0x1;
2384 type->alignment = size = sizeof(char);
2387 type->alignment = size = sizeof(int);
2390 type->alignment = size = sizeof(long long);
2393 type->alignment = size = sizeof(long);
2396 type->alignment = size = sizeof(short);
2399 type->alignment = size = sizeof(float);
2402 type->alignment = size = sizeof(double);
2406 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2408 if(_class && _class->type == 1)
2410 ComputeClassMembers(_class, 0x0);
2411 type->alignment = _class->structAlignment;
2412 size = _class->structSize;
2413 if(type->alignment && size % type->alignment)
2414 size += type->alignment - (size % type->alignment);
2416 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2418 if(!_class->dataType)
2419 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2420 size = type->alignment = ComputeTypeSize(_class->dataType);
2423 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2428 size = type->alignment = sizeof(void *);
2431 if(type->arraySizeExp)
2433 ProcessExpressionType(type->arraySizeExp);
2434 ComputeExpression(type->arraySizeExp);
2435 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)))
2437 struct Location oldLoc = yylloc;
2438 char expression[10240];
2440 expression[0] = '\0';
2441 type->arraySizeExp->expType = (((void *)0));
2442 yylloc = type->arraySizeExp->loc;
2444 PrintExpression(type->arraySizeExp, expression);
2445 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2448 GetInt(type->arraySizeExp, &type->arraySize);
2450 else if(type->enumClass)
2452 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2454 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2457 type->arraySize = 0;
2461 type->arraySize = 0;
2463 size = ComputeTypeSize(type->type) * type->arraySize;
2464 type->alignment = type->type->alignment;
2468 struct Type * member;
2470 for(member = type->members.first; member; member = member->next)
2472 int __simpleStruct0, __simpleStruct1;
2473 unsigned int addSize = ComputeTypeSize(member);
2475 member->offset = size;
2476 if(member->alignment && size % member->alignment)
2477 member->offset += member->alignment - (size % member->alignment);
2478 size = member->offset;
2479 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2482 if(type->alignment && size % type->alignment)
2483 size += type->alignment - (size % type->alignment);
2488 struct Type * member;
2490 for(member = type->members.first; member; member = member->next)
2492 int __simpleStruct0, __simpleStruct1;
2493 unsigned int addSize = ComputeTypeSize(member);
2495 member->offset = size;
2496 if(member->alignment && size % member->alignment)
2497 member->offset += member->alignment - (size % member->alignment);
2498 size = member->offset;
2499 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2500 size = ((size > addSize) ? size : addSize);
2502 if(type->alignment && size % type->alignment)
2503 size += type->alignment - (size % type->alignment);
2508 struct TemplateParameter * param = type->templateParameter;
2509 struct Type * baseType = ProcessTemplateParameterType(param);
2512 size = ComputeTypeSize(baseType);
2514 size = sizeof(uint64);
2527 size = sizeof(void *);
2532 type->computing = 0x0;
2537 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2539 extern struct Identifier * MkIdentifier(char * string);
2541 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2543 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2545 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2547 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2549 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2551 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2553 extern void FreeType(struct Type * type);
2555 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2557 extern struct Specifier * MkSpecifier(int specifier);
2559 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2561 extern struct Expression * MkExpConstant(char * string);
2563 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)
2565 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2566 unsigned int totalSize = 0;
2567 unsigned int maxSize = 0;
2568 int alignment, size;
2569 struct __ecereNameSpace__ecere__com__DataMember * member;
2570 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2572 if(!isMember && _class->base)
2574 maxSize = _class->structSize;
2576 if(_class->type == 1 || _class->type == 5)
2577 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2579 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2582 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2584 if(!member->isProperty)
2586 switch(member->type)
2590 if(member->dataTypeString)
2592 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2593 struct Declarator * decl;
2595 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2596 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2597 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2598 if(!member->dataType)
2599 member->dataType = ProcessType(specs, decl);
2600 ReplaceThisClassSpecifiers(specs, topClass);
2602 struct Type * type = ProcessType(specs, decl);
2604 DeclareType(member->dataType, 0x0, 0x0);
2607 ComputeTypeSize(member->dataType);
2608 size = member->dataType->size;
2609 alignment = member->dataType->alignment;
2612 if(totalSize % alignment)
2613 totalSize += alignment - (totalSize % alignment);
2622 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2625 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2626 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2627 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2628 alignment = member->structAlignment;
2631 if(totalSize % alignment)
2632 totalSize += alignment - (totalSize % alignment);
2642 unsigned int __simpleStruct0;
2644 if(topMember && topMember->type == 1)
2645 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2647 *retSize += totalSize;
2649 else if(totalSize < maxSize && _class->type != 1000)
2651 char sizeString[50];
2653 sprintf(sizeString, "%d", maxSize - totalSize);
2654 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2657 FinishTemplatesContext(context);
2658 return topMember ? topMember->memberID : _class->memberID;
2661 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2663 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2664 unsigned int totalSize = 0;
2665 struct __ecereNameSpace__ecere__com__DataMember * member;
2666 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2668 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2669 DeclareMembers(_class->base, 0x0);
2670 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2672 if(!member->isProperty)
2674 switch(member->type)
2678 if(!member->dataType && member->dataTypeString)
2679 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2680 if(member->dataType)
2681 DeclareType(member->dataType, 0x0, 0x0);
2687 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2694 FinishTemplatesContext(context);
2695 return topMember ? topMember->memberID : _class->memberID;
2698 extern struct Symbol * FindClass(char * name);
2700 extern char * strchr(char * , int);
2702 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2704 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2706 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2708 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2710 extern char * strcpy(char * , const char * );
2712 extern void MangleClassName(char * className);
2714 extern void DeclareClass(struct Symbol * classSym, char * className);
2716 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2718 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2720 void DeclareStruct(char * name, unsigned int skipNoHead)
2722 struct External * external = (((void *)0));
2723 struct Symbol * classSym = FindClass(name);
2725 if(!inCompiler || !classSym)
2726 return (((void *)0));
2727 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2728 return (((void *)0));
2729 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2731 struct Declaration * decl;
2732 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2733 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2734 char structName[1024];
2736 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2737 classSym->declaring++;
2738 if(strchr(classSym->string, '<'))
2740 if(classSym->registered->templateClass)
2742 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2743 classSym->declaring--;
2745 return (((void *)0));
2747 DeclareMembers(classSym->registered, 0x0);
2748 structName[0] = (char)0;
2749 FullClassNameCat(structName, name, 0x0);
2752 classSym->declaredStructSym = 0x1;
2753 declarations = MkList();
2754 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2755 if(!(*declarations).count)
2757 FreeList(declarations, (((void *)0)));
2758 declarations = (((void *)0));
2761 if(skipNoHead || declarations)
2763 if(external && external->declaration)
2765 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2766 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2768 if(classSym->structExternal)
2769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2770 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2771 classSym->id = curExternal->symbol->idCode;
2772 classSym->idCode = curExternal->symbol->idCode;
2778 external = MkExternalDeclaration((((void *)0)));
2779 specifiers = MkList();
2780 declarators = MkList();
2781 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2782 external->declaration = decl = MkDeclaration(specifiers, declarators);
2783 if(decl->symbol && !decl->symbol->pointerExternal)
2784 decl->symbol->pointerExternal = external;
2785 if(classSym->registered && classSym->registered->type == 1)
2787 char className[1024];
2789 strcpy(className, "__ecereClass_");
2790 FullClassNameCat(className, classSym->string, 0x1);
2791 MangleClassName(className);
2792 DeclareClass(classSym, className);
2793 external->symbol = classSym;
2794 classSym->pointerExternal = external;
2795 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2796 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2800 char className[1024];
2802 strcpy(className, "__ecereClass_");
2803 FullClassNameCat(className, classSym->string, 0x1);
2804 MangleClassName(className);
2805 classSym->structExternal = external;
2806 DeclareClass(classSym, className);
2807 external->symbol = classSym;
2809 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2812 classSym->declaring--;
2814 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2816 classSym->declaring++;
2818 if(classSym->registered)
2819 DeclareMembers(classSym->registered, 0x0);
2821 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2823 if(classSym->structExternal)
2824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2826 classSym->id = curExternal->symbol->idCode;
2827 classSym->idCode = curExternal->symbol->idCode;
2829 classSym->declaring--;
2833 extern char * strcat(char * , const char * );
2835 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2837 extern struct ModuleImport * mainModule;
2839 extern struct Specifier * MkSpecifierName(char * name);
2841 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2843 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2845 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2847 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2849 extern void FreeDeclarator(struct Declarator * decl);
2851 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2853 struct PropertyImport
2855 struct PropertyImport * prev;
2856 struct PropertyImport * next;
2858 unsigned int isVirtual;
2859 unsigned int hasSet;
2860 unsigned int hasGet;
2863 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2865 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2867 void * __ecereTemp1;
2868 struct Symbol * symbol = prop->symbol;
2869 char propName[1024];
2871 strcpy(setName, "__ecereProp_");
2872 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2873 strcat(setName, "_Set_");
2874 FullClassNameCat(setName, prop->name, 0x1);
2875 strcpy(getName, "__ecereProp_");
2876 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2877 strcat(getName, "_Get_");
2878 FullClassNameCat(getName, prop->name, 0x1);
2879 strcpy(propName, "__ecereProp_");
2880 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2881 strcat(propName, "_");
2882 FullClassNameCat(propName, prop->name, 0x1);
2883 MangleClassName(getName);
2884 MangleClassName(setName);
2885 MangleClassName(propName);
2886 if(prop->_class->type == 1)
2887 DeclareStruct(prop->_class->fullName, 0x0);
2888 if(!symbol || curExternal->symbol->idCode < symbol->id)
2890 unsigned int imported = 0x0;
2891 unsigned int dllImport = 0x0;
2893 if(!symbol || symbol->_import)
2897 struct Symbol * classSym;
2899 if(!prop->_class->symbol)
2900 prop->_class->symbol = FindClass(prop->_class->fullName);
2901 classSym = prop->_class->symbol;
2902 if(classSym && !classSym->_import)
2904 struct ModuleImport * module;
2906 if(prop->_class->module)
2907 module = FindModule(prop->_class->module);
2909 module = mainModule;
2910 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));
2911 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2913 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2914 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));
2916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2919 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2924 struct Context * context = SetupTemplatesContext(prop->_class);
2926 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2927 FinishTemplatesContext(context);
2931 if(!symbol->externalGet || symbol->externalGet->type == 0)
2933 struct Declaration * decl;
2934 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2935 struct Declarator * d;
2936 struct __ecereNameSpace__ecere__sys__OldList * params;
2937 struct Specifier * spec;
2938 struct External * external;
2939 struct Declarator * typeDecl;
2940 unsigned int simple = 0x0;
2942 specifiers = MkList();
2943 declarators = MkList();
2945 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2946 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2948 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2950 struct Context * context = SetupTemplatesContext(prop->_class);
2952 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2953 FinishTemplatesContext(context);
2955 for(spec = (*specifiers).first; spec; spec = spec->next)
2959 if((!typeDecl || typeDecl->type == 1))
2961 struct Symbol * classSym = spec->symbol;
2963 symbol->_class = classSym->registered;
2964 if(classSym->registered && classSym->registered->type == 1)
2966 DeclareStruct(spec->name, 0x0);
2973 d = PlugDeclarator(typeDecl, d);
2976 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2977 specifiers = MkList();
2979 d = MkDeclaratorFunction(d, params);
2981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
2982 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2985 ListAdd(specifiers, MkSpecifier(VOID));
2986 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2987 decl = MkDeclaration(specifiers, declarators);
2988 external = MkExternalDeclaration(decl);
2989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2990 external->symbol = symbol;
2991 symbol->externalGet = external;
2992 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2994 FreeDeclarator(typeDecl);
2998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3003 if(!symbol->externalSet || symbol->externalSet->type == 0)
3005 struct Declaration * decl;
3006 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3007 struct Declarator * d;
3008 struct __ecereNameSpace__ecere__sys__OldList * params;
3009 struct Specifier * spec;
3010 struct External * external;
3011 struct Declarator * typeDecl;
3013 declarators = MkList();
3015 if(!prop->conversion || prop->_class->type == 1)
3017 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3019 specifiers = MkList();
3021 struct Context * context = SetupTemplatesContext(prop->_class);
3023 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3024 FinishTemplatesContext(context);
3026 ListAdd(params, MkTypeName(specifiers, d));
3027 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3029 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3030 d = MkDeclaratorFunction(d, params);
3031 for(spec = (*specifiers).first; spec; spec = spec->next)
3035 if((!typeDecl || typeDecl->type == 1))
3037 struct Symbol * classSym = spec->symbol;
3039 symbol->_class = classSym->registered;
3040 if(classSym->registered && classSym->registered->type == 1)
3041 DeclareStruct(spec->name, 0x0);
3045 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3046 specifiers = MkList();
3048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3049 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3050 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3051 if(!prop->conversion || prop->_class->type == 1)
3052 ListAdd(specifiers, MkSpecifier(VOID));
3054 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3055 decl = MkDeclaration(specifiers, declarators);
3056 external = MkExternalDeclaration(decl);
3057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3058 external->symbol = symbol;
3059 symbol->externalSet = external;
3060 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3067 if(!symbol->externalPtr)
3069 struct Declaration * decl;
3070 struct External * external;
3071 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3074 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3076 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3077 ListAdd(specifiers, MkSpecifierName("Property"));
3079 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3081 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3084 strcpy(propName, "__ecerePropM_");
3085 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3086 strcat(propName, "_");
3087 FullClassNameCat(propName, prop->name, 0x1);
3088 MangleClassName(propName);
3089 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3091 decl = MkDeclaration(specifiers, list);
3093 external = MkExternalDeclaration(decl);
3094 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3095 external->symbol = symbol;
3096 symbol->externalPtr = external;
3100 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3102 symbol->id = curExternal->symbol->idCode;
3106 struct Type * Dereference(struct Type * source)
3108 void * __ecereTemp1;
3109 struct Type * type = (((void *)0));
3113 if(source->kind == 13 || source->kind == 12)
3115 type = source->type;
3116 source->type->refCount++;
3118 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3120 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3122 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3133 static struct Type * Reference(struct Type * source)
3135 void * __ecereTemp1;
3136 struct Type * type = (((void *)0));
3140 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));
3146 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);
3148 extern void * memcpy(void * , const void * , unsigned int size);
3150 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3152 extern void FreeExpression(struct Expression * exp);
3154 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3156 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);
3158 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3160 extern struct Type * MkClassType(char * name);
3162 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);
3164 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)
3166 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3167 unsigned int found = 0x0;
3168 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3169 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3170 unsigned int freeType = 0x0;
3172 yylloc = member->loc;
3177 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3181 dataMember = *curMember;
3187 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3188 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3189 int _subMemberStackPos = 0;
3192 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3195 dataMember = thisMember;
3196 if(curMember && thisMember->memberAccess == 1)
3198 *curMember = thisMember;
3199 *curClass = thisMember->_class;
3200 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3201 *subMemberStackPos = _subMemberStackPos;
3207 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3208 if(method && method->type == 1)
3211 method = (((void *)0));
3216 struct Type * type = (((void *)0));
3220 if(!dataMember->dataType && dataMember->dataTypeString)
3222 struct Context * context = SetupTemplatesContext(_class);
3224 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3225 FinishTemplatesContext(context);
3227 type = dataMember->dataType;
3231 if(!method->dataType)
3232 ProcessMethodType(method);
3233 type = method->dataType;
3235 if(ident && ident->next)
3237 for(ident = ident->next; ident && type; ident = ident->next)
3241 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3243 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3245 type = dataMember->dataType;
3247 else if(type->kind == 9 || type->kind == 10)
3249 struct Type * memberType;
3251 for(memberType = type->members.first; memberType; memberType = memberType->next)
3253 if(!strcmp(memberType->name, ident->string))
3262 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3265 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3266 struct __ecereNameSpace__ecere__com__Class * sClass;
3268 for(sClass = _class; sClass; sClass = sClass->base)
3271 if(sClass->templateClass)
3272 sClass = sClass->templateClass;
3273 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3275 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3277 for(sClass = sClass->base; sClass; sClass = sClass->base)
3279 if(sClass->templateClass)
3280 sClass = sClass->templateClass;
3281 id += sClass->templateParams.count;
3292 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3294 if(arg.dataTypeString)
3296 type = ProcessTypeString(arg.dataTypeString, 0x0);
3298 if(type && _class->templateClass)
3299 type->passAsTemplate = 0x1;
3306 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3308 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3309 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3313 char templateString[1024];
3314 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3316 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3317 for(cClass = expClass; cClass; cClass = cClass->base)
3321 if(cClass->templateClass)
3322 cClass = cClass->templateClass;
3323 for(param = cClass->templateParams.first; param; param = param->next)
3326 struct __ecereNameSpace__ecere__com__Class * sClass;
3327 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3329 for(sClass = cClass->base; sClass; sClass = sClass->base)
3331 if(sClass->templateClass)
3332 sClass = sClass->templateClass;
3333 id += sClass->templateParams.count;
3335 arg = expClass->templateArgs[id];
3336 for(sClass = _class; sClass; sClass = sClass->base)
3338 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3340 struct __ecereNameSpace__ecere__com__Class * nextClass;
3342 if(sClass->templateClass)
3343 sClass = sClass->templateClass;
3344 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3346 if(nextClass->templateClass)
3347 nextClass = nextClass->templateClass;
3348 p += nextClass->templateParams.count;
3350 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3352 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3354 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3356 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3357 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3371 char expString[1024];
3372 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3373 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3374 struct Expression * exp;
3375 char * string = PrintHexUInt64(arg.expression.ui64);
3377 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3378 ProcessExpressionType(exp);
3379 ComputeExpression(exp);
3380 expString[0] = '\0';
3381 PrintExpression(exp, expString);
3382 strcat(argument, expString);
3383 FreeExpression(exp);
3388 strcat(argument, arg.member->name);
3393 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3394 strcat(argument, arg.dataTypeString);
3401 strcat(templateString, ", ");
3402 if(lastParam != p - 1)
3404 strcat(templateString, param->name);
3405 strcat(templateString, " = ");
3407 strcat(templateString, argument);
3416 int len = strlen(templateString);
3418 if(templateString[len - 1] == '<')
3422 if(templateString[len - 1] == '>')
3423 templateString[len++] = ' ';
3424 templateString[len++] = '>';
3426 templateString[len++] = '\0';
3429 struct Context * context = SetupTemplatesContext(_class);
3433 type = ProcessTypeString(templateString, 0x0);
3435 FinishTemplatesContext(context);
3438 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3440 ProcessExpressionType(member->initializer->exp);
3441 if(!member->initializer->exp->expType)
3445 char expString[10240];
3447 expString[0] = '\0';
3448 PrintExpression(member->initializer->exp, expString);
3449 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3450 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3453 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3455 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3458 else if(member->initializer)
3460 ProcessInitializer(member->initializer, type);
3467 if(_class && _class->type == 3)
3469 if(member->initializer)
3471 struct Type * type = MkClassType(_class->fullName);
3473 ProcessInitializer(member->initializer, type);
3479 if(member->initializer)
3481 ProcessInitializer(member->initializer, (((void *)0)));
3487 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3491 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3493 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3497 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3502 extern struct Identifier * GetDeclId(struct Declarator * decl);
3504 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);
3506 extern void FreeSpecifier(struct Specifier * spec);
3508 static void ProcessFunction(struct FunctionDefinition * function);
3510 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3512 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3514 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3516 extern void FreeClassFunction(struct ClassFunction * func);
3518 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3520 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3522 void ProcessInstantiationType(struct Instantiation * inst)
3527 struct MembersInit * members;
3528 struct Symbol * classSym;
3529 struct __ecereNameSpace__ecere__com__Class * _class;
3531 classSym = inst->_class->symbol;
3532 _class = classSym ? classSym->registered : (((void *)0));
3533 if(!_class || _class->type != 5)
3534 DeclareStruct(inst->_class->name, 0x0);
3535 afterExternal = afterExternal ? afterExternal : curExternal;
3537 ProcessExpressionType(inst->exp);
3538 inst->isConstant = 0x1;
3541 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3542 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3543 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3544 int subMemberStackPos = 0;
3546 for(members = (*inst->members).first; members; members = members->next)
3548 switch(members->type)
3553 static unsigned int instMethodID = 0;
3554 struct External * external = curExternal;
3555 struct Context * context = curContext;
3556 struct Declarator * declarator = members->function->declarator;
3557 struct Identifier * nameID = GetDeclId(declarator);
3558 char * unmangled = nameID ? nameID->string : (((void *)0));
3559 struct Expression * exp;
3560 struct External * createdExternal = (((void *)0));
3566 strcpy(name, "__ecereInstMeth_");
3567 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3569 strcat(name, nameID->string);
3571 sprintf(number, "_%08d", instMethodID++);
3572 strcat(name, number);
3573 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3577 struct Symbol * symbol = declarator->symbol;
3578 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3580 if(method && method->type == 1)
3582 symbol->method = method;
3583 ProcessMethodType(method);
3584 if(!symbol->type->thisClass)
3586 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3588 if(!currentClass->symbol)
3589 currentClass->symbol = FindClass(currentClass->fullName);
3590 symbol->type->thisClass = currentClass->symbol;
3595 _class->symbol = FindClass(_class->fullName);
3596 symbol->type->thisClass = _class->symbol;
3599 DeclareType(symbol->type, 0x1, 0x1);
3603 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3606 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3609 FreeSpecifier(nameID->_class);
3610 nameID->_class = (((void *)0));
3614 struct Type * type = declarator->symbol->type;
3615 struct External * oldExternal = curExternal;
3617 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3619 struct External * externalDecl;
3621 externalDecl = MkExternalDeclaration((((void *)0)));
3622 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3623 if(createdExternal->function)
3625 ProcessFunction(createdExternal->function);
3627 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3629 externalDecl->declaration = decl;
3630 if(decl->symbol && !decl->symbol->pointerExternal)
3631 decl->symbol->pointerExternal = externalDecl;
3632 declarator->symbol->pointerExternal = externalDecl;
3639 curExternal = declarator->symbol->pointerExternal;
3640 ProcessFunction((struct FunctionDefinition *)members->function);
3642 curExternal = external;
3643 curContext = context;
3646 FreeClassFunction(members->function);
3647 exp = QMkExpId(name);
3649 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3650 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3656 if(members->dataMembers && classSym)
3658 struct MemberInit * member;
3659 struct Location oldyyloc = yylloc;
3661 for(member = (*members->dataMembers).first; member; member = member->next)
3663 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3664 if(member->initializer && !member->initializer->isConstant)
3665 inst->isConstant = 0x0;
3677 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3681 if(type->kind == 11)
3683 struct Type * param;
3687 for(param = type->params.first; param; param = param->next)
3688 DeclareType(param, declarePointers, 0x1);
3690 DeclareType(type->returnType, declarePointers, 0x1);
3692 else if(type->kind == 13 && declarePointers)
3693 DeclareType(type->type, declarePointers, 0x0);
3694 else if(type->kind == 8)
3696 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3697 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3699 else if(type->kind == 9 || type->kind == 10)
3701 struct Type * member;
3703 for(member = type->members.first; member; member = member->next)
3704 DeclareType(member, 0x0, 0x0);
3706 else if(type->kind == 12)
3707 DeclareType(type->arrayType, declarePointers, 0x0);
3711 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3713 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3715 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3717 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3718 struct __ecereNameSpace__ecere__com__Class * sClass;
3720 for(sClass = _class; sClass; sClass = sClass->base)
3723 if(sClass->templateClass)
3724 sClass = sClass->templateClass;
3725 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3727 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3729 for(sClass = sClass->base; sClass; sClass = sClass->base)
3731 if(sClass->templateClass)
3732 sClass = sClass->templateClass;
3733 id += sClass->templateParams.count;
3744 arg = &_class->templateArgs[id];
3745 if(arg && param->type == 0)
3746 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3751 extern struct Context * PushContext(void);
3753 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3755 struct TemplatedType
3758 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3759 struct __ecereNameSpace__ecere__sys__BTNode * left;
3760 struct __ecereNameSpace__ecere__sys__BTNode * right;
3762 struct TemplateParameter * param;
3765 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3767 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3769 void * __ecereTemp1;
3770 struct Context * context = PushContext();
3772 context->templateTypesOnly = 0x1;
3773 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3775 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3777 for(; param; param = param->next)
3779 if(param->type == 0 && param->identifier)
3781 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3783 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3789 struct __ecereNameSpace__ecere__com__Class * sClass;
3791 for(sClass = _class; sClass; sClass = sClass->base)
3793 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3795 for(p = sClass->templateParams.first; p; p = p->next)
3799 struct TemplateParameter * param = p->param;
3800 struct TemplatedType * type;
3804 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));
3806 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));
3807 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3815 extern void PopContext(struct Context * ctx);
3817 extern void FreeContext(struct Context * context);
3819 void FinishTemplatesContext(struct Context * context)
3821 PopContext(context);
3822 FreeContext(context);
3823 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3826 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3828 if(!method->dataType)
3830 struct Context * context = SetupTemplatesContext(method->_class);
3832 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3833 FinishTemplatesContext(context);
3834 if(method->type != 1 && method->dataType)
3836 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3838 if(!method->_class->symbol)
3839 method->_class->symbol = FindClass(method->_class->fullName);
3840 method->dataType->thisClass = method->_class->symbol;
3846 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3850 struct Context * context = SetupTemplatesContext(prop->_class);
3852 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3853 FinishTemplatesContext(context);
3857 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3859 extern void FreeTypeName(struct TypeName * typeName);
3861 static void ProcessDeclarator(struct Declarator * decl);
3863 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3865 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3869 struct MethodImport * prev;
3870 struct MethodImport * next;
3872 unsigned int isVirtual;
3875 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3877 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3879 void * __ecereTemp1;
3880 struct Symbol * symbol = method->symbol;
3882 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3884 unsigned int imported = 0x0;
3885 unsigned int dllImport = 0x0;
3887 if(!method->dataType)
3888 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3889 if(!symbol || symbol->_import || method->type == 1)
3891 if(!symbol || method->type == 1)
3893 struct Symbol * classSym;
3895 if(!method->_class->symbol)
3896 method->_class->symbol = FindClass(method->_class->fullName);
3897 classSym = method->_class->symbol;
3898 if(!classSym->_import)
3900 struct ModuleImport * module;
3902 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3903 module = FindModule(method->_class->module);
3905 module = mainModule;
3906 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));
3907 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3911 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3913 if(!symbol->_import)
3915 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));
3916 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3920 symbol->type = method->dataType;
3922 symbol->type->refCount++;
3925 if(!method->dataType->dllExport)
3928 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3932 if(method->type != 1 && method->dataType)
3933 DeclareType(method->dataType, 0x1, 0x1);
3934 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3936 struct Declaration * decl;
3937 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3938 struct Declarator * d;
3939 struct Declarator * funcDecl;
3940 struct External * external;
3942 specifiers = MkList();
3943 declarators = MkList();
3945 ListAdd(specifiers, MkSpecifier(EXTERN));
3946 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3947 ListAdd(specifiers, MkSpecifier(STATIC));
3948 if(method->type == 1)
3950 ListAdd(specifiers, MkSpecifier(INT));
3951 d = MkDeclaratorIdentifier(MkIdentifier(name));
3955 d = MkDeclaratorIdentifier(MkIdentifier(name));
3957 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3959 struct Context * context = SetupTemplatesContext(method->_class);
3961 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3962 FinishTemplatesContext(context);
3964 funcDecl = GetFuncDecl(d);
3967 struct Specifier * spec, * next;
3969 for(spec = (*specifiers).first; spec; spec = next)
3974 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3975 FreeSpecifier(spec);
3979 if(method->dataType && !method->dataType->staticMethod)
3981 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3983 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3984 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")));
3985 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3986 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3988 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
3990 struct TypeName * param = (*funcDecl->function.parameters).first;
3992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3993 FreeTypeName(param);
3995 if(!funcDecl->function.parameters)
3996 funcDecl->function.parameters = MkList();
3997 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4001 ProcessDeclarator(d);
4002 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4003 decl = MkDeclaration(specifiers, declarators);
4004 ReplaceThisClassSpecifiers(specifiers, method->_class);
4005 if(symbol->pointerExternal)
4007 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4010 *functionSymbol = *symbol;
4011 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4012 if(functionSymbol->type)
4013 functionSymbol->type->refCount++;
4015 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4016 symbol->pointerExternal->symbol = functionSymbol;
4018 external = MkExternalDeclaration(decl);
4020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4021 external->symbol = symbol;
4022 symbol->pointerExternal = external;
4026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4028 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4032 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4034 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4036 unsigned int first = 0x1;
4038 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4040 char className[1024];
4042 strcpy(className, _class->fullName);
4043 for(param = _class->templateParams.first; param; param = param->next)
4047 strcat(className, "<");
4049 strcat(className, ", ");
4050 if(lastParam + 1 != p)
4052 strcat(className, param->name);
4053 strcat(className, " = ");
4055 strcat(className, param->name);
4063 int len = strlen(className);
4065 if(className[len - 1] == '>')
4066 className[len++] = ' ';
4067 className[len++] = '>';
4068 className[len++] = '\0';
4070 return __ecereNameSpace__ecere__sys__CopyString(className);
4073 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4076 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4078 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4080 unsigned int first = 0x1;
4082 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4084 char className[1024];
4086 strcpy(className, _class->fullName);
4087 for(param = _class->templateParams.first; param; param = param->next)
4091 strcat(className, "<");
4093 strcat(className, ", ");
4094 if(lastParam + 1 != p)
4096 strcat(className, param->name);
4097 strcat(className, " = ");
4099 strcat(className, param->name);
4107 int len = strlen(className);
4109 if(className[len - 1] == '>')
4110 className[len++] = ' ';
4111 className[len++] = '>';
4112 className[len++] = '\0';
4114 return MkClassType(className);
4118 return MkClassType(_class->fullName);
4122 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4124 if(specs != (((void *)0)) && _class)
4126 struct Specifier * spec;
4128 for(spec = specs->first; spec; spec = spec->next)
4130 if(spec->type == 0 && spec->specifier == THISCLASS)
4133 spec->name = ReplaceThisClass(_class);
4134 spec->symbol = FindClass(spec->name);
4140 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4142 struct __ecereNameSpace__ecere__com__GlobalFunction
4144 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4145 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4148 struct __ecereNameSpace__ecere__com__Instance * module;
4149 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4150 char * dataTypeString;
4151 struct Type * dataType;
4155 extern struct Context * globalContext;
4157 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4159 struct FunctionImport
4161 struct FunctionImport * prev;
4162 struct FunctionImport * next;
4166 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4168 void * __ecereTemp1;
4169 struct Symbol * symbol = function->symbol;
4171 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4173 unsigned int imported = 0x0;
4174 unsigned int dllImport = 0x0;
4176 if(!function->dataType)
4178 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4179 if(!function->dataType->thisClass)
4180 function->dataType->staticMethod = 0x1;
4186 struct ModuleImport * module = FindModule(function->module);
4188 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4191 if(!function->dataType->dllExport)
4193 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));
4194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4198 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4199 if(!symbol->type->thisClass)
4200 symbol->type->staticMethod = 0x1;
4203 imported = symbol->_import ? 0x1 : 0x0;
4204 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4207 DeclareType(function->dataType, 0x1, 0x1);
4210 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4212 struct Declaration * decl;
4213 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4214 struct Declarator * d;
4215 struct Declarator * funcDecl;
4216 struct External * external;
4218 specifiers = MkList();
4219 declarators = MkList();
4220 ListAdd(specifiers, MkSpecifier(EXTERN));
4221 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4223 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4224 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4225 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4227 struct Specifier * spec;
4229 for(spec = (*specifiers).first; spec; spec = spec->next)
4230 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4233 FreeSpecifier(spec);
4237 funcDecl = GetFuncDecl(d);
4238 if(funcDecl && !funcDecl->function.parameters)
4240 funcDecl->function.parameters = MkList();
4241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4243 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4245 struct Context * oldCtx = curContext;
4247 curContext = globalContext;
4248 decl = MkDeclaration(specifiers, declarators);
4249 curContext = oldCtx;
4251 if(symbol->pointerExternal)
4253 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4256 *functionSymbol = *symbol;
4257 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4258 if(functionSymbol->type)
4259 functionSymbol->type->refCount++;
4261 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4262 symbol->pointerExternal->symbol = functionSymbol;
4264 external = MkExternalDeclaration(decl);
4266 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4267 external->symbol = symbol;
4268 symbol->pointerExternal = external;
4272 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4275 symbol->id = curExternal->symbol->idCode;
4278 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4281 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4286 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4287 struct __ecereNameSpace__ecere__sys__BTNode * left;
4288 struct __ecereNameSpace__ecere__sys__BTNode * right;
4290 struct __ecereNameSpace__ecere__com__Instance * module;
4291 char * dataTypeString;
4292 struct Type * dataType;
4297 void DeclareGlobalData(struct GlobalData * data)
4299 struct Symbol * symbol = data->symbol;
4301 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4306 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4309 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4310 DeclareType(data->dataType, 0x1, 0x1);
4313 if(!symbol->pointerExternal)
4315 struct Declaration * decl;
4316 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4317 struct Declarator * d;
4318 struct External * external;
4320 specifiers = MkList();
4321 declarators = MkList();
4322 ListAdd(specifiers, MkSpecifier(EXTERN));
4323 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4324 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4325 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4326 decl = MkDeclaration(specifiers, declarators);
4327 external = MkExternalDeclaration(decl);
4329 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4330 external->symbol = symbol;
4331 symbol->pointerExternal = external;
4335 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4338 symbol->id = curExternal->symbol->idCode;
4345 struct Conversion * prev, * next;
4346 struct __ecereNameSpace__ecere__com__Property * convert;
4348 struct Type * resultType;
4351 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4353 extern void Compiler_Warning(char * format, ...);
4355 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4357 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)
4361 if(source->kind == 20 && dest->kind != 20)
4363 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4368 if(dest->kind == 20 && source->kind != 20)
4370 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4375 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4379 if(source->classObjectType == 3 && dest->classObjectType != 2)
4383 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4385 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4388 if(dest->kind == 14 && source->kind != 0)
4390 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))
4392 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))
4394 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4396 if(source->_class->registered && source->_class->registered->type == 3)
4398 if(conversions != (((void *)0)))
4400 if(source->_class->registered == dest->_class->registered)
4405 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4407 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4409 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4411 if(sourceBase == destBase)
4415 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))
4419 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4421 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4428 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4432 if(source->kind == 8)
4434 struct __ecereNameSpace__ecere__com__Class * _class;
4436 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4438 struct __ecereNameSpace__ecere__com__Property * convert;
4440 for(convert = _class->conversions.first; convert; convert = convert->next)
4442 if(convert->memberAccess == 1 || _class->module == privateModule)
4444 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4446 if(!convert->dataType)
4447 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4448 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4450 if(!conversions && !convert->Get)
4452 else if(conversions != (((void *)0)))
4454 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))
4458 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4471 struct __ecereNameSpace__ecere__com__Class * _class;
4473 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4475 struct __ecereNameSpace__ecere__com__Property * convert;
4477 for(convert = _class->conversions.first; convert; convert = convert->next)
4479 if(convert->memberAccess == 1 || _class->module == privateModule)
4481 if(!convert->dataType)
4482 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4483 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4485 if(!conversions && !convert->Set)
4487 else if(conversions != (((void *)0)))
4489 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))
4493 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4495 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4503 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4505 if(!dest->_class->registered->dataType)
4506 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4507 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4509 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4516 if(source->kind == 8)
4518 struct __ecereNameSpace__ecere__com__Class * _class;
4520 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4522 struct __ecereNameSpace__ecere__com__Property * convert;
4524 for(convert = _class->conversions.first; convert; convert = convert->next)
4526 if(convert->memberAccess == 1 || _class->module == privateModule)
4528 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4530 if(!convert->dataType)
4531 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4532 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4534 if(!conversions && !convert->Get)
4536 else if(conversions != (((void *)0)))
4538 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))
4542 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4552 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4554 if(!source->_class->registered->dataType)
4555 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4556 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4563 if(source->kind == 8 || source->kind == 19)
4565 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4567 else if(dest->kind == 7 && source->kind == 6)
4569 else if(dest->kind == 2 && source->kind == 1)
4571 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4573 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4575 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4577 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4579 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)))
4581 struct Type * paramSource, * paramDest;
4583 if(dest->kind == 16)
4584 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4585 if(source->kind == 16)
4586 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4587 if(dest->kind == 13 && dest->type->kind == 11)
4589 if(source->kind == 13 && source->type->kind == 11)
4590 source = source->type;
4591 if(dest->kind == 16)
4592 dest = dest->method->dataType;
4593 if(source->kind == 16)
4594 source = source->method->dataType;
4595 paramSource = source->params.first;
4596 if(paramSource && paramSource->kind == 0)
4597 paramSource = (((void *)0));
4598 paramDest = dest->params.first;
4599 if(paramDest && paramDest->kind == 0)
4600 paramDest = (((void *)0));
4601 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4603 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))))
4605 if(paramDest && paramDest->kind == 8)
4606 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4608 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4611 paramDest = paramDest->next;
4613 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4615 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4619 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4627 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4630 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4632 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4636 paramSource = paramSource->next;
4642 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4644 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4650 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4652 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4658 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4660 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4663 for(; paramDest; paramDest = paramDest->next)
4667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4671 struct Type * paramDestType = paramDest;
4672 struct Type * paramSourceType = paramSource;
4673 struct Type * type = paramDestType;
4675 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4678 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
4679 struct __ecereNameSpace__ecere__com__Class * sClass;
4681 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4684 if(sClass->templateClass)
4685 sClass = sClass->templateClass;
4686 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4688 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4690 for(sClass = sClass->base; sClass; sClass = sClass->base)
4692 if(sClass->templateClass)
4693 sClass = sClass->templateClass;
4694 id += sClass->templateParams.count;
4705 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4707 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4710 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)))
4715 PrintType(paramDest, type, 0x0, 0x1);
4716 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4717 if(paramDestType != paramDest)
4718 FreeType(paramDestType);
4721 if(paramDestType != paramDest)
4722 FreeType(paramDestType);
4724 paramSource = paramSource->next;
4728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4733 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4737 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4739 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4746 static void FreeConvert(struct Conversion * convert)
4748 if(convert->resultType)
4749 FreeType(convert->resultType);
4752 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4754 struct __ecereNameSpace__ecere__com__BTNamedLink
4757 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4758 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4759 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4764 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4766 struct __ecereNameSpace__ecere__com__EnumClassData
4768 struct __ecereNameSpace__ecere__sys__OldList values;
4772 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4774 struct __ecereNameSpace__ecere__sys__NamedLink
4776 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4777 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4782 extern void FreeExpContents(struct Expression * exp);
4784 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4786 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4788 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4790 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4792 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4794 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4796 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4798 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)))
4800 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4802 if(_class->type == 4)
4804 struct __ecereNameSpace__ecere__sys__OldList converts =
4808 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4812 _class->symbol = FindClass(_class->fullName);
4813 type->_class = _class->symbol;
4814 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4816 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4817 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4821 struct __ecereNameSpace__ecere__com__Class * baseClass;
4823 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4825 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4827 for(value = e->values.first; value; value = value->next)
4829 if(!strcmp(value->name, string))
4834 FreeExpContents(sourceExp);
4835 FreeType(sourceExp->expType);
4836 sourceExp->isConstant = 0x1;
4837 sourceExp->expType = MkClassType(baseClass->fullName);
4841 sourceExp->type = 2;
4842 if(!strcmp(baseClass->dataTypeString, "int"))
4843 sprintf(constant, "%d", value->data);
4845 sprintf(constant, "0x%X", value->data);
4846 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4848 while(converts.first)
4850 struct Conversion * convert = converts.first;
4852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4853 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4855 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4862 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4863 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4866 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)))
4867 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4872 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4874 struct __ecereNameSpace__ecere__com__SubModule
4876 struct __ecereNameSpace__ecere__com__SubModule * prev;
4877 struct __ecereNameSpace__ecere__com__SubModule * next;
4878 struct __ecereNameSpace__ecere__com__Instance * module;
4882 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4884 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4886 if(searchFor == searchIn)
4888 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4890 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4892 if(ModuleVisibility(subModule->module, searchFor))
4899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4901 struct __ecereNameSpace__ecere__com__Application
4906 unsigned int isGUIApp;
4907 struct __ecereNameSpace__ecere__sys__OldList allModules;
4908 char * parsedCommand;
4909 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4912 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4914 struct __ecereNameSpace__ecere__com__Instance * module;
4916 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
4918 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4920 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4922 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4924 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4930 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
4932 void ReadString(char * output, char * string);
4934 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4936 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
4938 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4940 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4942 void * __ecereTemp1;
4943 struct Type * source = sourceExp->expType;
4944 struct Type * realDest = dest;
4946 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4948 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4950 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4952 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4954 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4956 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4958 if(sourceBase == destBase)
4964 struct __ecereNameSpace__ecere__sys__OldList * specs;
4965 unsigned int flag = 0x0;
4966 long long value = (((int)0x7fffffff));
4970 if(sourceExp->type == 2)
4972 if(source->isSigned)
4973 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4975 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4977 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4979 if(source->isSigned)
4980 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4982 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4984 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4987 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));
4991 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4993 if(_class && _class->type == 3)
4995 if(source->kind != 8)
4997 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4998 struct Type * tempDest, * tempSource;
5000 for(; _class->base->type != 1000; _class = _class->base)
5003 tempDest = tempType;
5006 _class->symbol = FindClass(_class->fullName);
5007 tempType->_class = _class->symbol;
5008 tempType->truth = dest->truth;
5009 if(tempType->_class)
5010 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5011 FreeType(sourceExp->expType);
5012 sourceExp->expType = dest;
5015 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5018 if(_class && _class->type == 2 && source->kind != 8)
5020 if(!dest->_class->registered->dataType)
5021 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5022 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5025 FreeType(sourceExp->expType);
5026 source = sourceExp->expType = MkClassType(dest->_class->string);
5030 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5033 struct Declarator * decl;
5036 ReadString(string, sourceExp->string);
5037 decl = SpecDeclFromString(string, specs, (((void *)0)));
5038 FreeExpContents(sourceExp);
5039 FreeType(sourceExp->expType);
5040 sourceExp->type = 26;
5041 sourceExp->_classExp.specifiers = specs;
5042 sourceExp->_classExp.decl = decl;
5043 sourceExp->expType = dest;
5050 else if(source->kind == 8)
5052 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5054 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5058 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5059 struct Type * tempDest, * tempSource;
5061 if(!source->_class->registered->dataType)
5062 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5063 for(; _class->base->type != 1000; _class = _class->base)
5066 tempSource = tempType;
5068 tempType->_class = FindClass(_class->fullName);
5069 tempType->truth = source->truth;
5070 tempType->classObjectType = source->classObjectType;
5071 if(tempType->_class)
5072 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5073 if(conversions->last)
5075 ((struct Conversion *)conversions->last)->resultType = dest;
5078 FreeType(sourceExp->expType);
5079 sourceExp->expType = MkClassType(_class->fullName);
5080 sourceExp->expType->truth = source->truth;
5081 sourceExp->expType->classObjectType = source->classObjectType;
5082 if(!sourceExp->destType)
5084 FreeType(sourceExp->destType);
5085 sourceExp->destType = sourceExp->expType;
5086 if(sourceExp->expType)
5087 sourceExp->expType->refCount++;
5089 if(!_class->dataType)
5090 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5092 dest = MkClassType(source->_class->string);
5093 dest->truth = source->truth;
5094 dest->classObjectType = source->classObjectType;
5096 source = _class->dataType;
5098 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5104 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5113 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5115 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5117 if(_class->type == 0 || _class->type == 5)
5119 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5121 *newExp = *sourceExp;
5122 if(sourceExp->destType)
5123 sourceExp->destType->refCount++;
5124 if(sourceExp->expType)
5125 sourceExp->expType->refCount++;
5126 sourceExp->type = 11;
5127 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5128 sourceExp->cast.exp = newExp;
5129 FreeType(sourceExp->expType);
5130 sourceExp->expType = (((void *)0));
5131 ProcessExpressionType(sourceExp);
5134 FreeType(sourceExp->expType);
5135 sourceExp->expType = dest;
5142 if(!_class->dataType)
5143 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5145 dest = _class->dataType;
5148 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5150 specs = MkListOne(MkSpecifier(DOUBLE));
5152 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5154 specs = MkListOne(MkSpecifier(FLOAT));
5156 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5160 ListAdd(specs, MkSpecifier(UNSIGNED));
5161 ListAdd(specs, MkSpecifier(INT64));
5163 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5167 ListAdd(specs, MkSpecifier(UNSIGNED));
5168 ListAdd(specs, MkSpecifier(INT));
5170 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5174 ListAdd(specs, MkSpecifier(UNSIGNED));
5175 ListAdd(specs, MkSpecifier(SHORT));
5177 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5181 ListAdd(specs, MkSpecifier(UNSIGNED));
5182 ListAdd(specs, MkSpecifier(CHAR));
5191 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))
5193 specs = MkListOne(MkSpecifier(DOUBLE));
5195 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5197 specs = MkListOne(MkSpecifier(FLOAT));
5199 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)))
5203 ListAdd(specs, MkSpecifier(UNSIGNED));
5204 ListAdd(specs, MkSpecifier(CHAR));
5206 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)))))
5210 ListAdd(specs, MkSpecifier(UNSIGNED));
5211 ListAdd(specs, MkSpecifier(SHORT));
5213 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5217 ListAdd(specs, MkSpecifier(UNSIGNED));
5218 ListAdd(specs, MkSpecifier(INT));
5220 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5224 ListAdd(specs, MkSpecifier(UNSIGNED));
5225 ListAdd(specs, MkSpecifier(INT64));
5227 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5229 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5239 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5241 *newExp = *sourceExp;
5242 newExp->prev = (((void *)0));
5243 newExp->next = (((void *)0));
5244 if(sourceExp->destType)
5245 sourceExp->destType->refCount++;
5246 if(sourceExp->expType)
5247 sourceExp->expType->refCount++;
5248 sourceExp->type = 11;
5249 if(realDest->kind == 8)
5251 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5252 FreeList(specs, FreeSpecifier);
5255 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5256 if(newExp->type == 4)
5258 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5261 sourceExp->cast.exp = newExp;
5262 FreeType(sourceExp->expType);
5263 sourceExp->expType = (((void *)0));
5264 ProcessExpressionType(sourceExp);
5267 FreeList(specs, FreeSpecifier);
5274 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5275 sourceExp = (*sourceExp->list).last;
5276 if(sourceExp->type == 0)
5278 struct Identifier * id = sourceExp->identifier;
5282 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5284 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5285 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5289 for(; _class && _class->type == 4; _class = _class->base)
5291 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5292 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5294 for(value = e->values.first; value; value = value->next)
5296 if(!strcmp(value->name, id->string))
5301 FreeExpContents(sourceExp);
5302 FreeType(sourceExp->expType);
5303 sourceExp->isConstant = 0x1;
5304 sourceExp->expType = MkClassType(_class->fullName);
5308 sourceExp->type = 2;
5309 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5310 sprintf(constant, "%d", value->data);
5312 sprintf(constant, "0x%X", value->data);
5313 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5321 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5328 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5330 int value2 = op2->i;
5333 exp->string = PrintInt(op1->i + value2);
5336 exp->expType = op1->type;
5338 op1->type->refCount++;
5343 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5345 unsigned int value2 = op2->ui;
5348 exp->string = PrintUInt(op1->ui + value2);
5351 exp->expType = op1->type;
5353 op1->type->refCount++;
5358 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5360 short value2 = op2->s;
5363 exp->string = PrintShort(op1->s + value2);
5366 exp->expType = op1->type;
5368 op1->type->refCount++;
5373 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5375 unsigned short value2 = op2->us;
5378 exp->string = PrintUShort(op1->us + value2);
5381 exp->expType = op1->type;
5383 op1->type->refCount++;
5388 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5390 char value2 = op2->c;
5393 exp->string = PrintChar(op1->c + value2);
5396 exp->expType = op1->type;
5398 op1->type->refCount++;
5403 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5405 unsigned char value2 = op2->uc;
5408 exp->string = PrintUChar(op1->uc + value2);
5411 exp->expType = op1->type;
5413 op1->type->refCount++;
5418 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5420 float value2 = op2->f;
5423 exp->string = PrintFloat(op1->f + value2);
5426 exp->expType = op1->type;
5428 op1->type->refCount++;
5433 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5435 double value2 = op2->d;
5438 exp->string = PrintDouble(op1->d + value2);
5441 exp->expType = op1->type;
5443 op1->type->refCount++;
5448 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5450 int value2 = op2->i;
5453 exp->string = PrintInt(op1->i - value2);
5456 exp->expType = op1->type;
5458 op1->type->refCount++;
5463 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5465 unsigned int value2 = op2->ui;
5468 exp->string = PrintUInt(op1->ui - value2);
5471 exp->expType = op1->type;
5473 op1->type->refCount++;
5478 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5480 short value2 = op2->s;
5483 exp->string = PrintShort(op1->s - value2);
5486 exp->expType = op1->type;
5488 op1->type->refCount++;
5493 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5495 unsigned short value2 = op2->us;
5498 exp->string = PrintUShort(op1->us - value2);
5501 exp->expType = op1->type;
5503 op1->type->refCount++;
5508 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5510 char value2 = op2->c;
5513 exp->string = PrintChar(op1->c - value2);
5516 exp->expType = op1->type;
5518 op1->type->refCount++;
5523 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5525 unsigned char value2 = op2->uc;
5528 exp->string = PrintUChar(op1->uc - value2);
5531 exp->expType = op1->type;
5533 op1->type->refCount++;
5538 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5540 float value2 = op2->f;
5543 exp->string = PrintFloat(op1->f - value2);
5546 exp->expType = op1->type;
5548 op1->type->refCount++;
5553 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5555 double value2 = op2->d;
5558 exp->string = PrintDouble(op1->d - value2);
5561 exp->expType = op1->type;
5563 op1->type->refCount++;
5568 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5570 int value2 = op2->i;
5573 exp->string = PrintInt(op1->i * value2);
5576 exp->expType = op1->type;
5578 op1->type->refCount++;
5583 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5585 unsigned int value2 = op2->ui;
5588 exp->string = PrintUInt(op1->ui * value2);
5591 exp->expType = op1->type;
5593 op1->type->refCount++;
5598 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5600 short value2 = op2->s;
5603 exp->string = PrintShort(op1->s * value2);
5606 exp->expType = op1->type;
5608 op1->type->refCount++;
5613 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5615 unsigned short value2 = op2->us;
5618 exp->string = PrintUShort(op1->us * value2);
5621 exp->expType = op1->type;
5623 op1->type->refCount++;
5628 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5630 char value2 = op2->c;
5633 exp->string = PrintChar(op1->c * value2);
5636 exp->expType = op1->type;
5638 op1->type->refCount++;
5643 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5645 unsigned char value2 = op2->uc;
5648 exp->string = PrintUChar(op1->uc * value2);
5651 exp->expType = op1->type;
5653 op1->type->refCount++;
5658 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5660 float value2 = op2->f;
5663 exp->string = PrintFloat(op1->f * value2);
5666 exp->expType = op1->type;
5668 op1->type->refCount++;
5673 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5675 double value2 = op2->d;
5678 exp->string = PrintDouble(op1->d * value2);
5681 exp->expType = op1->type;
5683 op1->type->refCount++;
5688 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5690 int value2 = op2->i;
5693 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5696 exp->expType = op1->type;
5698 op1->type->refCount++;
5703 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5705 unsigned int value2 = op2->ui;
5708 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5711 exp->expType = op1->type;
5713 op1->type->refCount++;
5718 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5720 short value2 = op2->s;
5723 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5726 exp->expType = op1->type;
5728 op1->type->refCount++;
5733 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5735 unsigned short value2 = op2->us;
5738 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5741 exp->expType = op1->type;
5743 op1->type->refCount++;
5748 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5750 char value2 = op2->c;
5753 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5756 exp->expType = op1->type;
5758 op1->type->refCount++;
5763 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5765 unsigned char value2 = op2->uc;
5768 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5771 exp->expType = op1->type;
5773 op1->type->refCount++;
5778 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5780 float value2 = op2->f;
5783 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5786 exp->expType = op1->type;
5788 op1->type->refCount++;
5793 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5795 double value2 = op2->d;
5798 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5801 exp->expType = op1->type;
5803 op1->type->refCount++;
5808 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5810 int value2 = op2->i;
5813 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5816 exp->expType = op1->type;
5818 op1->type->refCount++;
5823 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5825 unsigned int value2 = op2->ui;
5828 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5831 exp->expType = op1->type;
5833 op1->type->refCount++;
5838 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5840 short value2 = op2->s;
5843 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5846 exp->expType = op1->type;
5848 op1->type->refCount++;
5853 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5855 unsigned short value2 = op2->us;
5858 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5861 exp->expType = op1->type;
5863 op1->type->refCount++;
5868 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5870 char value2 = op2->c;
5873 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5876 exp->expType = op1->type;
5878 op1->type->refCount++;
5883 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5885 unsigned char value2 = op2->uc;
5888 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5891 exp->expType = op1->type;
5893 op1->type->refCount++;
5898 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5901 exp->string = PrintInt(-op1->i);
5904 exp->expType = op1->type;
5906 op1->type->refCount++;
5911 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5914 exp->string = PrintUInt(-op1->ui);
5917 exp->expType = op1->type;
5919 op1->type->refCount++;
5924 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5927 exp->string = PrintShort(-op1->s);
5930 exp->expType = op1->type;
5932 op1->type->refCount++;
5937 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5940 exp->string = PrintUShort(-op1->us);
5943 exp->expType = op1->type;
5945 op1->type->refCount++;
5950 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5953 exp->string = PrintChar(-op1->c);
5956 exp->expType = op1->type;
5958 op1->type->refCount++;
5963 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5966 exp->string = PrintUChar(-op1->uc);
5969 exp->expType = op1->type;
5971 op1->type->refCount++;
5976 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5979 exp->string = PrintFloat(-op1->f);
5982 exp->expType = op1->type;
5984 op1->type->refCount++;
5989 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5992 exp->string = PrintDouble(-op1->d);
5995 exp->expType = op1->type;
5997 op1->type->refCount++;
6002 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6005 exp->string = PrintInt(++op1->i);
6008 exp->expType = op1->type;
6010 op1->type->refCount++;
6015 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6018 exp->string = PrintUInt(++op1->ui);
6021 exp->expType = op1->type;
6023 op1->type->refCount++;
6028 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6031 exp->string = PrintShort(++op1->s);
6034 exp->expType = op1->type;
6036 op1->type->refCount++;
6041 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6044 exp->string = PrintUShort(++op1->us);
6047 exp->expType = op1->type;
6049 op1->type->refCount++;
6054 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6057 exp->string = PrintChar(++op1->c);
6060 exp->expType = op1->type;
6062 op1->type->refCount++;
6067 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6070 exp->string = PrintUChar(++op1->uc);
6073 exp->expType = op1->type;
6075 op1->type->refCount++;
6080 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6083 exp->string = PrintFloat(++op1->f);
6086 exp->expType = op1->type;
6088 op1->type->refCount++;
6093 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6096 exp->string = PrintDouble(++op1->d);
6099 exp->expType = op1->type;
6101 op1->type->refCount++;
6106 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6109 exp->string = PrintInt(--op1->i);
6112 exp->expType = op1->type;
6114 op1->type->refCount++;
6119 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6122 exp->string = PrintUInt(--op1->ui);
6125 exp->expType = op1->type;
6127 op1->type->refCount++;
6132 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6135 exp->string = PrintShort(--op1->s);
6138 exp->expType = op1->type;
6140 op1->type->refCount++;
6145 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6148 exp->string = PrintUShort(--op1->us);
6151 exp->expType = op1->type;
6153 op1->type->refCount++;
6158 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6161 exp->string = PrintChar(--op1->c);
6164 exp->expType = op1->type;
6166 op1->type->refCount++;
6171 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6174 exp->string = PrintUChar(--op1->uc);
6177 exp->expType = op1->type;
6179 op1->type->refCount++;
6184 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6187 exp->string = PrintFloat(--op1->f);
6190 exp->expType = op1->type;
6192 op1->type->refCount++;
6197 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6200 exp->string = PrintDouble(--op1->d);
6203 exp->expType = op1->type;
6205 op1->type->refCount++;
6210 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6212 int value2 = op2->i;
6215 exp->string = PrintInt(op1->i = value2);
6218 exp->expType = op1->type;
6220 op1->type->refCount++;
6225 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6227 unsigned int value2 = op2->ui;
6230 exp->string = PrintUInt(op1->ui = value2);
6233 exp->expType = op1->type;
6235 op1->type->refCount++;
6240 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6242 short value2 = op2->s;
6245 exp->string = PrintShort(op1->s = value2);
6248 exp->expType = op1->type;
6250 op1->type->refCount++;
6255 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6257 unsigned short value2 = op2->us;
6260 exp->string = PrintUShort(op1->us = value2);
6263 exp->expType = op1->type;
6265 op1->type->refCount++;
6270 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6272 char value2 = op2->c;
6275 exp->string = PrintChar(op1->c = value2);
6278 exp->expType = op1->type;
6280 op1->type->refCount++;
6285 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6287 unsigned char value2 = op2->uc;
6290 exp->string = PrintUChar(op1->uc = value2);
6293 exp->expType = op1->type;
6295 op1->type->refCount++;
6300 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6302 float value2 = op2->f;
6305 exp->string = PrintFloat(op1->f = value2);
6308 exp->expType = op1->type;
6310 op1->type->refCount++;
6315 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6317 double value2 = op2->d;
6320 exp->string = PrintDouble(op1->d = value2);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6332 int value2 = op2->i;
6335 exp->string = PrintInt(op1->i += value2);
6338 exp->expType = op1->type;
6340 op1->type->refCount++;
6345 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6347 unsigned int value2 = op2->ui;
6350 exp->string = PrintUInt(op1->ui += value2);
6353 exp->expType = op1->type;
6355 op1->type->refCount++;
6360 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6362 short value2 = op2->s;
6365 exp->string = PrintShort(op1->s += value2);
6368 exp->expType = op1->type;
6370 op1->type->refCount++;
6375 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6377 unsigned short value2 = op2->us;
6380 exp->string = PrintUShort(op1->us += value2);
6383 exp->expType = op1->type;
6385 op1->type->refCount++;
6390 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6392 char value2 = op2->c;
6395 exp->string = PrintChar(op1->c += value2);
6398 exp->expType = op1->type;
6400 op1->type->refCount++;
6405 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6407 unsigned char value2 = op2->uc;
6410 exp->string = PrintUChar(op1->uc += value2);
6413 exp->expType = op1->type;
6415 op1->type->refCount++;
6420 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6422 float value2 = op2->f;
6425 exp->string = PrintFloat(op1->f += value2);
6428 exp->expType = op1->type;
6430 op1->type->refCount++;
6435 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6437 double value2 = op2->d;
6440 exp->string = PrintDouble(op1->d += value2);
6443 exp->expType = op1->type;
6445 op1->type->refCount++;
6450 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6452 int value2 = op2->i;
6455 exp->string = PrintInt(op1->i -= value2);
6458 exp->expType = op1->type;
6460 op1->type->refCount++;
6465 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6467 unsigned int value2 = op2->ui;
6470 exp->string = PrintUInt(op1->ui -= value2);
6473 exp->expType = op1->type;
6475 op1->type->refCount++;
6480 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6482 short value2 = op2->s;
6485 exp->string = PrintShort(op1->s -= value2);
6488 exp->expType = op1->type;
6490 op1->type->refCount++;
6495 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6497 unsigned short value2 = op2->us;
6500 exp->string = PrintUShort(op1->us -= value2);
6503 exp->expType = op1->type;
6505 op1->type->refCount++;
6510 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6512 char value2 = op2->c;
6515 exp->string = PrintChar(op1->c -= value2);
6518 exp->expType = op1->type;
6520 op1->type->refCount++;
6525 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6527 unsigned char value2 = op2->uc;
6530 exp->string = PrintUChar(op1->uc -= value2);
6533 exp->expType = op1->type;
6535 op1->type->refCount++;
6540 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6542 float value2 = op2->f;
6545 exp->string = PrintFloat(op1->f -= value2);
6548 exp->expType = op1->type;
6550 op1->type->refCount++;
6555 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6557 double value2 = op2->d;
6560 exp->string = PrintDouble(op1->d -= value2);
6563 exp->expType = op1->type;
6565 op1->type->refCount++;
6570 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6572 int value2 = op2->i;
6575 exp->string = PrintInt(op1->i *= value2);
6578 exp->expType = op1->type;
6580 op1->type->refCount++;
6585 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6587 unsigned int value2 = op2->ui;
6590 exp->string = PrintUInt(op1->ui *= value2);
6593 exp->expType = op1->type;
6595 op1->type->refCount++;
6600 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6602 short value2 = op2->s;
6605 exp->string = PrintShort(op1->s *= value2);
6608 exp->expType = op1->type;
6610 op1->type->refCount++;
6615 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6617 unsigned short value2 = op2->us;
6620 exp->string = PrintUShort(op1->us *= value2);
6623 exp->expType = op1->type;
6625 op1->type->refCount++;
6630 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6632 char value2 = op2->c;
6635 exp->string = PrintChar(op1->c *= value2);
6638 exp->expType = op1->type;
6640 op1->type->refCount++;
6645 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6647 unsigned char value2 = op2->uc;
6650 exp->string = PrintUChar(op1->uc *= value2);
6653 exp->expType = op1->type;
6655 op1->type->refCount++;
6660 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6662 float value2 = op2->f;
6665 exp->string = PrintFloat(op1->f *= value2);
6668 exp->expType = op1->type;
6670 op1->type->refCount++;
6675 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6677 double value2 = op2->d;
6680 exp->string = PrintDouble(op1->d *= value2);
6683 exp->expType = op1->type;
6685 op1->type->refCount++;
6690 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6692 int value2 = op2->i;
6695 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6698 exp->expType = op1->type;
6700 op1->type->refCount++;
6705 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6707 unsigned int value2 = op2->ui;
6710 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6713 exp->expType = op1->type;
6715 op1->type->refCount++;
6720 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6722 short value2 = op2->s;
6725 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6728 exp->expType = op1->type;
6730 op1->type->refCount++;
6735 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6737 unsigned short value2 = op2->us;
6740 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6743 exp->expType = op1->type;
6745 op1->type->refCount++;
6750 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6752 char value2 = op2->c;
6755 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6758 exp->expType = op1->type;
6760 op1->type->refCount++;
6765 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6767 unsigned char value2 = op2->uc;
6770 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6773 exp->expType = op1->type;
6775 op1->type->refCount++;
6780 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6782 float value2 = op2->f;
6785 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6788 exp->expType = op1->type;
6790 op1->type->refCount++;
6795 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6797 double value2 = op2->d;
6800 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6803 exp->expType = op1->type;
6805 op1->type->refCount++;
6810 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6812 int value2 = op2->i;
6815 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6818 exp->expType = op1->type;
6820 op1->type->refCount++;
6825 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6827 unsigned int value2 = op2->ui;
6830 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6833 exp->expType = op1->type;
6835 op1->type->refCount++;
6840 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6842 short value2 = op2->s;
6845 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6848 exp->expType = op1->type;
6850 op1->type->refCount++;
6855 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6857 unsigned short value2 = op2->us;
6860 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6863 exp->expType = op1->type;
6865 op1->type->refCount++;
6870 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6872 char value2 = op2->c;
6875 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6878 exp->expType = op1->type;
6880 op1->type->refCount++;
6885 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6887 unsigned char value2 = op2->uc;
6890 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6893 exp->expType = op1->type;
6895 op1->type->refCount++;
6900 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6902 int value2 = op2->i;
6905 exp->string = PrintInt(op1->i & value2);
6908 exp->expType = op1->type;
6910 op1->type->refCount++;
6915 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6917 unsigned int value2 = op2->ui;
6920 exp->string = PrintUInt(op1->ui & value2);
6923 exp->expType = op1->type;
6925 op1->type->refCount++;
6930 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6932 short value2 = op2->s;
6935 exp->string = PrintShort(op1->s & value2);
6938 exp->expType = op1->type;
6940 op1->type->refCount++;
6945 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6947 unsigned short value2 = op2->us;
6950 exp->string = PrintUShort(op1->us & value2);
6953 exp->expType = op1->type;
6955 op1->type->refCount++;
6960 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6962 char value2 = op2->c;
6965 exp->string = PrintChar(op1->c & value2);
6968 exp->expType = op1->type;
6970 op1->type->refCount++;
6975 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6977 unsigned char value2 = op2->uc;
6980 exp->string = PrintUChar(op1->uc & value2);
6983 exp->expType = op1->type;
6985 op1->type->refCount++;
6990 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6992 int value2 = op2->i;
6995 exp->string = PrintInt(op1->i | value2);
6998 exp->expType = op1->type;
7000 op1->type->refCount++;
7005 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7007 unsigned int value2 = op2->ui;
7010 exp->string = PrintUInt(op1->ui | value2);
7013 exp->expType = op1->type;
7015 op1->type->refCount++;
7020 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7022 short value2 = op2->s;
7025 exp->string = PrintShort(op1->s | value2);
7028 exp->expType = op1->type;
7030 op1->type->refCount++;
7035 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7037 unsigned short value2 = op2->us;
7040 exp->string = PrintUShort(op1->us | value2);
7043 exp->expType = op1->type;
7045 op1->type->refCount++;
7050 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7052 char value2 = op2->c;
7055 exp->string = PrintChar(op1->c | value2);
7058 exp->expType = op1->type;
7060 op1->type->refCount++;
7065 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7067 unsigned char value2 = op2->uc;
7070 exp->string = PrintUChar(op1->uc | value2);
7073 exp->expType = op1->type;
7075 op1->type->refCount++;
7080 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7082 int value2 = op2->i;
7085 exp->string = PrintInt(op1->i ^ value2);
7088 exp->expType = op1->type;
7090 op1->type->refCount++;
7095 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7097 unsigned int value2 = op2->ui;
7100 exp->string = PrintUInt(op1->ui ^ value2);
7103 exp->expType = op1->type;
7105 op1->type->refCount++;
7110 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7112 short value2 = op2->s;
7115 exp->string = PrintShort(op1->s ^ value2);
7118 exp->expType = op1->type;
7120 op1->type->refCount++;
7125 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7127 unsigned short value2 = op2->us;
7130 exp->string = PrintUShort(op1->us ^ value2);
7133 exp->expType = op1->type;
7135 op1->type->refCount++;
7140 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7142 char value2 = op2->c;
7145 exp->string = PrintChar(op1->c ^ value2);
7148 exp->expType = op1->type;
7150 op1->type->refCount++;
7155 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7157 unsigned char value2 = op2->uc;
7160 exp->string = PrintUChar(op1->uc ^ value2);
7163 exp->expType = op1->type;
7165 op1->type->refCount++;
7170 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7172 int value2 = op2->i;
7175 exp->string = PrintInt(op1->i << value2);
7178 exp->expType = op1->type;
7180 op1->type->refCount++;
7185 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7187 unsigned int value2 = op2->ui;
7190 exp->string = PrintUInt(op1->ui << value2);
7193 exp->expType = op1->type;
7195 op1->type->refCount++;
7200 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7202 short value2 = op2->s;
7205 exp->string = PrintShort(op1->s << value2);
7208 exp->expType = op1->type;
7210 op1->type->refCount++;
7215 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7217 unsigned short value2 = op2->us;
7220 exp->string = PrintUShort(op1->us << value2);
7223 exp->expType = op1->type;
7225 op1->type->refCount++;
7230 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7232 char value2 = op2->c;
7235 exp->string = PrintChar(op1->c << value2);
7238 exp->expType = op1->type;
7240 op1->type->refCount++;
7245 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7247 unsigned char value2 = op2->uc;
7250 exp->string = PrintUChar(op1->uc << value2);
7253 exp->expType = op1->type;
7255 op1->type->refCount++;
7260 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7262 int value2 = op2->i;
7265 exp->string = PrintInt(op1->i >> value2);
7268 exp->expType = op1->type;
7270 op1->type->refCount++;
7275 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7277 unsigned int value2 = op2->ui;
7280 exp->string = PrintUInt(op1->ui >> value2);
7283 exp->expType = op1->type;
7285 op1->type->refCount++;
7290 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7292 short value2 = op2->s;
7295 exp->string = PrintShort(op1->s >> value2);
7298 exp->expType = op1->type;
7300 op1->type->refCount++;
7305 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7307 unsigned short value2 = op2->us;
7310 exp->string = PrintUShort(op1->us >> value2);
7313 exp->expType = op1->type;
7315 op1->type->refCount++;
7320 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7322 char value2 = op2->c;
7325 exp->string = PrintChar(op1->c >> value2);
7328 exp->expType = op1->type;
7330 op1->type->refCount++;
7335 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7337 unsigned char value2 = op2->uc;
7340 exp->string = PrintUChar(op1->uc >> value2);
7343 exp->expType = op1->type;
7345 op1->type->refCount++;
7350 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7353 exp->string = PrintInt(~op1->i);
7356 exp->expType = op1->type;
7358 op1->type->refCount++;
7363 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7366 exp->string = PrintUInt(~op1->ui);
7369 exp->expType = op1->type;
7371 op1->type->refCount++;
7376 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7379 exp->string = PrintShort(~op1->s);
7382 exp->expType = op1->type;
7384 op1->type->refCount++;
7389 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7392 exp->string = PrintUShort(~op1->us);
7395 exp->expType = op1->type;
7397 op1->type->refCount++;
7402 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7405 exp->string = PrintChar(~op1->c);
7408 exp->expType = op1->type;
7410 op1->type->refCount++;
7415 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7418 exp->string = PrintUChar(~op1->uc);
7421 exp->expType = op1->type;
7423 op1->type->refCount++;
7428 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7430 int value2 = op2->i;
7433 exp->string = PrintInt(op1->i &= value2);
7436 exp->expType = op1->type;
7438 op1->type->refCount++;
7443 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7445 unsigned int value2 = op2->ui;
7448 exp->string = PrintUInt(op1->ui &= value2);
7451 exp->expType = op1->type;
7453 op1->type->refCount++;
7458 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7460 short value2 = op2->s;
7463 exp->string = PrintShort(op1->s &= value2);
7466 exp->expType = op1->type;
7468 op1->type->refCount++;
7473 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7475 unsigned short value2 = op2->us;
7478 exp->string = PrintUShort(op1->us &= value2);
7481 exp->expType = op1->type;
7483 op1->type->refCount++;
7488 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7490 char value2 = op2->c;
7493 exp->string = PrintChar(op1->c &= value2);
7496 exp->expType = op1->type;
7498 op1->type->refCount++;
7503 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7505 unsigned char value2 = op2->uc;
7508 exp->string = PrintUChar(op1->uc &= value2);
7511 exp->expType = op1->type;
7513 op1->type->refCount++;
7518 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7520 int value2 = op2->i;
7523 exp->string = PrintInt(op1->i |= value2);
7526 exp->expType = op1->type;
7528 op1->type->refCount++;
7533 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7535 unsigned int value2 = op2->ui;
7538 exp->string = PrintUInt(op1->ui |= value2);
7541 exp->expType = op1->type;
7543 op1->type->refCount++;
7548 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7550 short value2 = op2->s;
7553 exp->string = PrintShort(op1->s |= value2);
7556 exp->expType = op1->type;
7558 op1->type->refCount++;
7563 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7565 unsigned short value2 = op2->us;
7568 exp->string = PrintUShort(op1->us |= value2);
7571 exp->expType = op1->type;
7573 op1->type->refCount++;
7578 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7580 char value2 = op2->c;
7583 exp->string = PrintChar(op1->c |= value2);
7586 exp->expType = op1->type;
7588 op1->type->refCount++;
7593 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7595 unsigned char value2 = op2->uc;
7598 exp->string = PrintUChar(op1->uc |= value2);
7601 exp->expType = op1->type;
7603 op1->type->refCount++;
7608 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7610 int value2 = op2->i;
7613 exp->string = PrintInt(op1->i ^= value2);
7616 exp->expType = op1->type;
7618 op1->type->refCount++;
7623 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7625 unsigned int value2 = op2->ui;
7628 exp->string = PrintUInt(op1->ui ^= value2);
7631 exp->expType = op1->type;
7633 op1->type->refCount++;
7638 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7640 short value2 = op2->s;
7643 exp->string = PrintShort(op1->s ^= value2);
7646 exp->expType = op1->type;
7648 op1->type->refCount++;
7653 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7655 unsigned short value2 = op2->us;
7658 exp->string = PrintUShort(op1->us ^= value2);
7661 exp->expType = op1->type;
7663 op1->type->refCount++;
7668 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7670 char value2 = op2->c;
7673 exp->string = PrintChar(op1->c ^= value2);
7676 exp->expType = op1->type;
7678 op1->type->refCount++;
7683 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7685 unsigned char value2 = op2->uc;
7688 exp->string = PrintUChar(op1->uc ^= value2);
7691 exp->expType = op1->type;
7693 op1->type->refCount++;
7698 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7700 int value2 = op2->i;
7703 exp->string = PrintInt(op1->i <<= value2);
7706 exp->expType = op1->type;
7708 op1->type->refCount++;
7713 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7715 unsigned int value2 = op2->ui;
7718 exp->string = PrintUInt(op1->ui <<= value2);
7721 exp->expType = op1->type;
7723 op1->type->refCount++;
7728 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7730 short value2 = op2->s;
7733 exp->string = PrintShort(op1->s <<= value2);
7736 exp->expType = op1->type;
7738 op1->type->refCount++;
7743 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7745 unsigned short value2 = op2->us;
7748 exp->string = PrintUShort(op1->us <<= value2);
7751 exp->expType = op1->type;
7753 op1->type->refCount++;
7758 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7760 char value2 = op2->c;
7763 exp->string = PrintChar(op1->c <<= value2);
7766 exp->expType = op1->type;
7768 op1->type->refCount++;
7773 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7775 unsigned char value2 = op2->uc;
7778 exp->string = PrintUChar(op1->uc <<= value2);
7781 exp->expType = op1->type;
7783 op1->type->refCount++;
7788 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7790 int value2 = op2->i;
7793 exp->string = PrintInt(op1->i >>= value2);
7796 exp->expType = op1->type;
7798 op1->type->refCount++;
7803 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7805 unsigned int value2 = op2->ui;
7808 exp->string = PrintUInt(op1->ui >>= value2);
7811 exp->expType = op1->type;
7813 op1->type->refCount++;
7818 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7820 short value2 = op2->s;
7823 exp->string = PrintShort(op1->s >>= value2);
7826 exp->expType = op1->type;
7828 op1->type->refCount++;
7833 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7835 unsigned short value2 = op2->us;
7838 exp->string = PrintUShort(op1->us >>= value2);
7841 exp->expType = op1->type;
7843 op1->type->refCount++;
7848 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7850 char value2 = op2->c;
7853 exp->string = PrintChar(op1->c >>= value2);
7856 exp->expType = op1->type;
7858 op1->type->refCount++;
7863 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7865 unsigned char value2 = op2->uc;
7868 exp->string = PrintUChar(op1->uc >>= value2);
7871 exp->expType = op1->type;
7873 op1->type->refCount++;
7878 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7881 exp->string = PrintInt(!op1->i);
7884 exp->expType = op1->type;
7886 op1->type->refCount++;
7891 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7894 exp->string = PrintUInt(!op1->ui);
7897 exp->expType = op1->type;
7899 op1->type->refCount++;
7904 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7907 exp->string = PrintShort(!op1->s);
7910 exp->expType = op1->type;
7912 op1->type->refCount++;
7917 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7920 exp->string = PrintUShort(!op1->us);
7923 exp->expType = op1->type;
7925 op1->type->refCount++;
7930 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7933 exp->string = PrintChar(!op1->c);
7936 exp->expType = op1->type;
7938 op1->type->refCount++;
7943 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7946 exp->string = PrintUChar(!op1->uc);
7949 exp->expType = op1->type;
7951 op1->type->refCount++;
7956 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7958 int value2 = op2->i;
7961 exp->string = PrintInt(op1->i == value2);
7964 exp->expType = op1->type;
7966 op1->type->refCount++;
7971 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7973 unsigned int value2 = op2->ui;
7976 exp->string = PrintUInt(op1->ui == value2);
7979 exp->expType = op1->type;
7981 op1->type->refCount++;
7986 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7988 short value2 = op2->s;
7991 exp->string = PrintShort(op1->s == value2);
7994 exp->expType = op1->type;
7996 op1->type->refCount++;
8001 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8003 unsigned short value2 = op2->us;
8006 exp->string = PrintUShort(op1->us == value2);
8009 exp->expType = op1->type;
8011 op1->type->refCount++;
8016 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8018 char value2 = op2->c;
8021 exp->string = PrintChar(op1->c == value2);
8024 exp->expType = op1->type;
8026 op1->type->refCount++;
8031 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8033 unsigned char value2 = op2->uc;
8036 exp->string = PrintUChar(op1->uc == value2);
8039 exp->expType = op1->type;
8041 op1->type->refCount++;
8046 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8048 float value2 = op2->f;
8051 exp->string = PrintFloat(op1->f == value2);
8054 exp->expType = op1->type;
8056 op1->type->refCount++;
8061 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8063 double value2 = op2->d;
8066 exp->string = PrintDouble(op1->d == value2);
8069 exp->expType = op1->type;
8071 op1->type->refCount++;
8076 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8078 int value2 = op2->i;
8081 exp->string = PrintInt(op1->i != value2);
8084 exp->expType = op1->type;
8086 op1->type->refCount++;
8091 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8093 unsigned int value2 = op2->ui;
8096 exp->string = PrintUInt(op1->ui != value2);
8099 exp->expType = op1->type;
8101 op1->type->refCount++;
8106 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8108 short value2 = op2->s;
8111 exp->string = PrintShort(op1->s != value2);
8114 exp->expType = op1->type;
8116 op1->type->refCount++;
8121 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8123 unsigned short value2 = op2->us;
8126 exp->string = PrintUShort(op1->us != value2);
8129 exp->expType = op1->type;
8131 op1->type->refCount++;
8136 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8138 char value2 = op2->c;
8141 exp->string = PrintChar(op1->c != value2);
8144 exp->expType = op1->type;
8146 op1->type->refCount++;
8151 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8153 unsigned char value2 = op2->uc;
8156 exp->string = PrintUChar(op1->uc != value2);
8159 exp->expType = op1->type;
8161 op1->type->refCount++;
8166 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8168 float value2 = op2->f;
8171 exp->string = PrintFloat(op1->f != value2);
8174 exp->expType = op1->type;
8176 op1->type->refCount++;
8181 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8183 double value2 = op2->d;
8186 exp->string = PrintDouble(op1->d != value2);
8189 exp->expType = op1->type;
8191 op1->type->refCount++;
8196 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8198 int value2 = op2->i;
8201 exp->string = PrintInt(op1->i && value2);
8204 exp->expType = op1->type;
8206 op1->type->refCount++;
8211 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8213 unsigned int value2 = op2->ui;
8216 exp->string = PrintUInt(op1->ui && value2);
8219 exp->expType = op1->type;
8221 op1->type->refCount++;
8226 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8228 short value2 = op2->s;
8231 exp->string = PrintShort(op1->s && value2);
8234 exp->expType = op1->type;
8236 op1->type->refCount++;
8241 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8243 unsigned short value2 = op2->us;
8246 exp->string = PrintUShort(op1->us && value2);
8249 exp->expType = op1->type;
8251 op1->type->refCount++;
8256 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8258 char value2 = op2->c;
8261 exp->string = PrintChar(op1->c && value2);
8264 exp->expType = op1->type;
8266 op1->type->refCount++;
8271 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8273 unsigned char value2 = op2->uc;
8276 exp->string = PrintUChar(op1->uc && value2);
8279 exp->expType = op1->type;
8281 op1->type->refCount++;
8286 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8288 float value2 = op2->f;
8291 exp->string = PrintFloat(op1->f && value2);
8294 exp->expType = op1->type;
8296 op1->type->refCount++;
8301 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8303 double value2 = op2->d;
8306 exp->string = PrintDouble(op1->d && value2);
8309 exp->expType = op1->type;
8311 op1->type->refCount++;
8316 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8318 int value2 = op2->i;
8321 exp->string = PrintInt(op1->i || value2);
8324 exp->expType = op1->type;
8326 op1->type->refCount++;
8331 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8333 unsigned int value2 = op2->ui;
8336 exp->string = PrintUInt(op1->ui || value2);
8339 exp->expType = op1->type;
8341 op1->type->refCount++;
8346 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8348 short value2 = op2->s;
8351 exp->string = PrintShort(op1->s || value2);
8354 exp->expType = op1->type;
8356 op1->type->refCount++;
8361 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8363 unsigned short value2 = op2->us;
8366 exp->string = PrintUShort(op1->us || value2);
8369 exp->expType = op1->type;
8371 op1->type->refCount++;
8376 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8378 char value2 = op2->c;
8381 exp->string = PrintChar(op1->c || value2);
8384 exp->expType = op1->type;
8386 op1->type->refCount++;
8391 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8393 unsigned char value2 = op2->uc;
8396 exp->string = PrintUChar(op1->uc || value2);
8399 exp->expType = op1->type;
8401 op1->type->refCount++;
8406 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8408 float value2 = op2->f;
8411 exp->string = PrintFloat(op1->f || value2);
8414 exp->expType = op1->type;
8416 op1->type->refCount++;
8421 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8423 double value2 = op2->d;
8426 exp->string = PrintDouble(op1->d || value2);
8429 exp->expType = op1->type;
8431 op1->type->refCount++;
8436 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8438 int value2 = op2->i;
8441 exp->string = PrintInt(op1->i > value2);
8444 exp->expType = op1->type;
8446 op1->type->refCount++;
8451 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8453 unsigned int value2 = op2->ui;
8456 exp->string = PrintUInt(op1->ui > value2);
8459 exp->expType = op1->type;
8461 op1->type->refCount++;
8466 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8468 short value2 = op2->s;
8471 exp->string = PrintShort(op1->s > value2);
8474 exp->expType = op1->type;
8476 op1->type->refCount++;
8481 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8483 unsigned short value2 = op2->us;
8486 exp->string = PrintUShort(op1->us > value2);
8489 exp->expType = op1->type;
8491 op1->type->refCount++;
8496 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8498 char value2 = op2->c;
8501 exp->string = PrintChar(op1->c > value2);
8504 exp->expType = op1->type;
8506 op1->type->refCount++;
8511 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8513 unsigned char value2 = op2->uc;
8516 exp->string = PrintUChar(op1->uc > value2);
8519 exp->expType = op1->type;
8521 op1->type->refCount++;
8526 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8528 float value2 = op2->f;
8531 exp->string = PrintFloat(op1->f > value2);
8534 exp->expType = op1->type;
8536 op1->type->refCount++;
8541 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8543 double value2 = op2->d;
8546 exp->string = PrintDouble(op1->d > value2);
8549 exp->expType = op1->type;
8551 op1->type->refCount++;
8556 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8558 int value2 = op2->i;
8561 exp->string = PrintInt(op1->i < value2);
8564 exp->expType = op1->type;
8566 op1->type->refCount++;
8571 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8573 unsigned int value2 = op2->ui;
8576 exp->string = PrintUInt(op1->ui < value2);
8579 exp->expType = op1->type;
8581 op1->type->refCount++;
8586 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8588 short value2 = op2->s;
8591 exp->string = PrintShort(op1->s < value2);
8594 exp->expType = op1->type;
8596 op1->type->refCount++;
8601 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8603 unsigned short value2 = op2->us;
8606 exp->string = PrintUShort(op1->us < value2);
8609 exp->expType = op1->type;
8611 op1->type->refCount++;
8616 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8618 char value2 = op2->c;
8621 exp->string = PrintChar(op1->c < value2);
8624 exp->expType = op1->type;
8626 op1->type->refCount++;
8631 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8633 unsigned char value2 = op2->uc;
8636 exp->string = PrintUChar(op1->uc < value2);
8639 exp->expType = op1->type;
8641 op1->type->refCount++;
8646 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8648 float value2 = op2->f;
8651 exp->string = PrintFloat(op1->f < value2);
8654 exp->expType = op1->type;
8656 op1->type->refCount++;
8661 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8663 double value2 = op2->d;
8666 exp->string = PrintDouble(op1->d < value2);
8669 exp->expType = op1->type;
8671 op1->type->refCount++;
8676 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8678 int value2 = op2->i;
8681 exp->string = PrintInt(op1->i >= value2);
8684 exp->expType = op1->type;
8686 op1->type->refCount++;
8691 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8693 unsigned int value2 = op2->ui;
8696 exp->string = PrintUInt(op1->ui >= value2);
8699 exp->expType = op1->type;
8701 op1->type->refCount++;
8706 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8708 short value2 = op2->s;
8711 exp->string = PrintShort(op1->s >= value2);
8714 exp->expType = op1->type;
8716 op1->type->refCount++;
8721 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8723 unsigned short value2 = op2->us;
8726 exp->string = PrintUShort(op1->us >= value2);
8729 exp->expType = op1->type;
8731 op1->type->refCount++;
8736 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8738 char value2 = op2->c;
8741 exp->string = PrintChar(op1->c >= value2);
8744 exp->expType = op1->type;
8746 op1->type->refCount++;
8751 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8753 unsigned char value2 = op2->uc;
8756 exp->string = PrintUChar(op1->uc >= value2);
8759 exp->expType = op1->type;
8761 op1->type->refCount++;
8766 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8768 float value2 = op2->f;
8771 exp->string = PrintFloat(op1->f >= value2);
8774 exp->expType = op1->type;
8776 op1->type->refCount++;
8781 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8783 double value2 = op2->d;
8786 exp->string = PrintDouble(op1->d >= value2);
8789 exp->expType = op1->type;
8791 op1->type->refCount++;
8796 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8798 int value2 = op2->i;
8801 exp->string = PrintInt(op1->i <= value2);
8804 exp->expType = op1->type;
8806 op1->type->refCount++;
8811 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8813 unsigned int value2 = op2->ui;
8816 exp->string = PrintUInt(op1->ui <= value2);
8819 exp->expType = op1->type;
8821 op1->type->refCount++;
8826 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8828 short value2 = op2->s;
8831 exp->string = PrintShort(op1->s <= value2);
8834 exp->expType = op1->type;
8836 op1->type->refCount++;
8841 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8843 unsigned short value2 = op2->us;
8846 exp->string = PrintUShort(op1->us <= value2);
8849 exp->expType = op1->type;
8851 op1->type->refCount++;
8856 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8858 char value2 = op2->c;
8861 exp->string = PrintChar(op1->c <= value2);
8864 exp->expType = op1->type;
8866 op1->type->refCount++;
8871 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8873 unsigned char value2 = op2->uc;
8876 exp->string = PrintUChar(op1->uc <= value2);
8879 exp->expType = op1->type;
8881 op1->type->refCount++;
8886 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8888 float value2 = op2->f;
8891 exp->string = PrintFloat(op1->f <= value2);
8894 exp->expType = op1->type;
8896 op1->type->refCount++;
8901 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8903 double value2 = op2->d;
8906 exp->string = PrintDouble(op1->d <= value2);
8909 exp->expType = op1->type;
8911 op1->type->refCount++;
8916 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8919 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8922 exp->expType = op1->type;
8924 op1->type->refCount++;
8929 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8932 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8935 exp->expType = op1->type;
8937 op1->type->refCount++;
8942 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8945 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8948 exp->expType = op1->type;
8950 op1->type->refCount++;
8955 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8958 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8961 exp->expType = op1->type;
8963 op1->type->refCount++;
8968 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8971 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8974 exp->expType = op1->type;
8976 op1->type->refCount++;
8981 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8984 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8987 exp->expType = op1->type;
8989 op1->type->refCount++;
8994 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8997 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9000 exp->expType = op1->type;
9002 op1->type->refCount++;
9007 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9010 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9013 exp->expType = op1->type;
9015 op1->type->refCount++;
9020 struct OpTable intOps =
9022 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
9025 struct OpTable uintOps =
9027 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
9030 struct OpTable shortOps =
9032 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
9035 struct OpTable ushortOps =
9037 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
9040 struct OpTable floatOps =
9042 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
9045 struct OpTable doubleOps =
9047 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
9050 struct OpTable charOps =
9052 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
9055 struct OpTable ucharOps =
9057 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
9060 void ReadString(char * output, char * string)
9062 int len = strlen(string);
9064 unsigned int quoted = 0x0, escaped = 0x0;
9066 for(c = 0; c < len; c++)
9068 char ch = string[c];
9124 extern double strtod(char * , char * * );
9126 struct Operand GetOperand(struct Expression * exp)
9132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9135 struct Type * type = exp->expType;
9139 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9141 if(!type->_class->registered->dataType)
9142 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9143 type = type->_class->registered->dataType;
9145 op.kind = type->kind;
9146 op.type = exp->expType;
9147 if(exp->isConstant && exp->type == 2)
9153 if(exp->constant[0] == '\'')
9154 op.c = exp->constant[1];
9155 else if(type->isSigned)
9157 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9162 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9170 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9175 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9183 op.i = strtol(exp->constant, (((void *)0)), 0);
9188 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9196 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9201 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9207 op.f = (float)strtod(exp->constant, (((void *)0)));
9211 op.d = (double)strtod(exp->constant, (((void *)0)));
9217 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9227 int __ecereVMethodID_class_OnGetString;
9229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9231 static void UnusedFunction()
9235 ((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);
9238 extern int __ecereVMethodID_class_OnGetString;
9240 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9242 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9244 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9246 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9247 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9250 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9251 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9253 void * ptr = inst->data + dataMember->offset + offset;
9254 char * result = (((void *)0));
9256 exp->loc = member->loc = inst->loc;
9257 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9258 if(!dataMember->dataType)
9259 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9260 type = dataMember->dataType;
9263 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9265 if(_class->type == 4)
9267 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9271 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9272 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9274 for(item = e->values.first; item; item = item->next)
9276 if((int)item->data == *(int *)ptr)
9278 result = item->name;
9284 exp->identifier = MkIdentifier(result);
9286 exp->destType = MkClassType(_class->fullName);
9287 ProcessExpressionType(exp);
9291 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9293 if(!_class->dataType)
9294 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9295 type = _class->dataType;
9304 FreeExpContents(exp);
9305 exp->constant = PrintFloat(*(float *)ptr);
9311 FreeExpContents(exp);
9312 exp->constant = PrintDouble(*(double *)ptr);
9318 FreeExpContents(exp);
9319 exp->constant = PrintInt(*(int *)ptr);
9325 FreeExpContents(exp);
9326 exp->constant = PrintInt64(*(long long *)ptr);
9331 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9334 ListAdd(memberList, member);
9336 if(parentDataMember->type == 1)
9341 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9343 void PopulateInstance(struct Instantiation * inst)
9345 struct Symbol * classSym = inst->_class->symbol;
9346 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9347 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9348 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9350 inst->members = MkListOne(MkMembersInitList(memberList));
9351 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9353 if(!dataMember->isProperty)
9355 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9356 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9359 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9360 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9362 void * ptr = inst->data + dataMember->offset;
9363 char * result = (((void *)0));
9365 exp->loc = member->loc = inst->loc;
9366 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9367 if(!dataMember->dataType)
9368 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9369 type = dataMember->dataType;
9372 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9374 if(_class->type == 4)
9376 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9380 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9381 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9383 for(item = e->values.first; item; item = item->next)
9385 if((int)item->data == *(int *)ptr)
9387 result = item->name;
9394 exp->identifier = MkIdentifier(result);
9396 exp->destType = MkClassType(_class->fullName);
9397 ProcessExpressionType(exp);
9400 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9402 if(!_class->dataType)
9403 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9404 type = _class->dataType;
9413 exp->constant = PrintFloat(*(float *)ptr);
9419 exp->constant = PrintDouble(*(double *)ptr);
9425 exp->constant = PrintInt(*(int *)ptr);
9431 exp->constant = PrintInt64(*(long long *)ptr);
9436 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9439 ListAdd(memberList, member);
9445 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);
9447 extern void FreeInstance(struct Instantiation * inst);
9449 void ComputeInstantiation(struct Expression * exp)
9451 struct Instantiation * inst = exp->instance;
9452 struct MembersInit * members;
9453 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9454 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9455 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9456 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9457 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9458 int subMemberStackPos = 0;
9461 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9465 if(_class->type == 0 || _class->type == 5)
9466 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9468 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9472 for(members = (*inst->members).first; members; members = members->next)
9474 switch(members->type)
9478 if(members->dataMembers)
9480 struct MemberInit * member;
9482 for(member = (*members->dataMembers).first; member; member = member->next)
9484 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9485 unsigned int found = 0x0;
9486 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9487 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9488 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9489 unsigned int dataMemberOffset;
9493 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9496 if(curMember->isProperty)
9497 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9500 dataMember = curMember;
9501 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9508 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9512 if(prop->memberAccess == 1)
9514 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9515 curClass = prop->_class;
9520 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9521 int _subMemberStackPos = 0;
9523 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9527 if(dataMember->memberAccess == 1)
9529 curMember = dataMember;
9530 curClass = dataMember->_class;
9531 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9532 subMemberStackPos = _subMemberStackPos;
9537 if(found && member->initializer && member->initializer->type == 0)
9539 struct Expression * value = member->initializer->exp;
9540 struct Type * type = (((void *)0));
9544 type = prop->dataType;
9548 if(!dataMember->dataType)
9549 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9550 type = dataMember->dataType;
9552 if(ident && ident->next)
9554 for(ident = ident->next; ident && type; ident = ident->next)
9558 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9560 type = prop->dataType;
9563 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9565 type = dataMember->dataType;
9568 else if(type->kind == 9 || type->kind == 10)
9570 struct Type * memberType;
9572 for(memberType = type->members.first; memberType; memberType = memberType->next)
9574 if(!strcmp(memberType->name, ident->string))
9585 FreeType(value->destType);
9586 value->destType = type;
9589 ComputeExpression(value);
9591 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9595 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9597 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9599 if(!_class->dataType)
9600 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9601 type = _class->dataType;
9606 void * ptr = inst->data + dataMemberOffset;
9608 if(value->type == 2)
9614 GetInt(value, (int *)ptr);
9619 GetInt64(value, (long long *)ptr);
9624 GetFloat(value, (float *)ptr);
9629 GetDouble(value, (double *)ptr);
9634 else if(value->type == 1)
9638 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9640 if(_class->type == 1)
9642 ComputeTypeSize(type);
9643 if(value->instance->data)
9644 memcpy(ptr, value->instance->data, type->size);
9651 if(value->type == 1 && value->instance->data)
9653 void (* Set)(void *, void *) = (void *)prop->Set;
9655 Set(inst->data, value->instance->data);
9656 PopulateInstance(inst);
9658 else if(value->type == 2)
9664 void (* Set)(void *, double) = (void *)prop->Set;
9666 Set(inst->data, strtod(value->constant, (((void *)0))));
9671 void (* Set)(void *, float) = (void *)prop->Set;
9673 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9678 void (* Set)(void *, int) = (void *)prop->Set;
9680 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9685 void (* Set)(void *, long long) = (void *)prop->Set;
9687 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9692 else if(value->type == 3)
9696 ReadString(temp, value->string);
9697 prop->Set(inst->data, temp);
9701 else if(_class->type == 3)
9705 if(value->type == 2)
9709 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9711 if(_class->type == 3)
9713 if(!_class->dataType)
9714 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9715 type = _class->dataType;
9723 float (* Set)(float) = (void *)prop->Set;
9725 GetFloat(member->initializer->exp, &fValue);
9726 exp->constant = PrintFloat(Set(fValue));
9733 double (* Set)(double) = (void *)prop->Set;
9735 GetDouble(member->initializer->exp, &dValue);
9736 exp->constant = PrintDouble(Set(dValue));
9744 else if(_class->type == 2)
9748 if(value->type == 1 && value->instance->data)
9750 unsigned int (* Set)(void *) = (void *)prop->Set;
9752 bits = Set(value->instance->data);
9754 else if(value->type == 2)
9760 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9764 GetInt(value, &part);
9765 bits = (bits & ~bitMember->mask);
9766 if(!bitMember->dataType)
9767 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9768 type = bitMember->dataType;
9769 if(type->kind == 8 && type->_class && type->_class->registered)
9771 if(!type->_class->registered->dataType)
9772 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9773 type = type->_class->registered->dataType;
9779 bits |= ((char)part << bitMember->pos);
9781 bits |= ((unsigned char)part << bitMember->pos);
9785 bits |= ((short)part << bitMember->pos);
9787 bits |= ((unsigned short)part << bitMember->pos);
9792 bits |= (part << bitMember->pos);
9794 bits |= ((unsigned int)part << bitMember->pos);
9798 bits |= ((long long)part << bitMember->pos);
9800 bits |= ((uint64)part << bitMember->pos);
9808 if(_class && _class->type == 3)
9810 ComputeExpression(member->initializer->exp);
9811 exp->constant = member->initializer->exp->constant;
9813 member->initializer->exp->constant = (((void *)0));
9823 if(_class && _class->type == 2)
9825 exp->constant = PrintHexUInt(bits);
9834 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9836 if(exp->op.op == SIZEOF)
9838 FreeExpContents(exp);
9840 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9850 struct Expression * exp2 = exp->op.exp2;
9852 exp->op.exp2 = (((void *)0));
9853 FreeExpContents(exp);
9854 FreeType(exp->expType);
9855 FreeType(exp->destType);
9857 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9863 FreeExpContents(exp);
9864 op1->ops.Neg(exp, op1);
9870 FreeExpContents(exp);
9871 op1->ops.BitNot(exp, op1);
9877 FreeExpContents(exp);
9878 op1->ops.Not(exp, op1);
9890 FreeExpContents(exp);
9891 op1->ops.Add(exp, op1, op2);
9897 FreeExpContents(exp);
9898 op1->ops.Sub(exp, op1, op2);
9904 FreeExpContents(exp);
9905 op1->ops.Mul(exp, op1, op2);
9911 FreeExpContents(exp);
9912 op1->ops.Div(exp, op1, op2);
9918 FreeExpContents(exp);
9919 op1->ops.Mod(exp, op1, op2);
9927 FreeExpContents(exp);
9928 op1->ops.BitAnd(exp, op1, op2);
9935 FreeExpContents(exp);
9936 op1->ops.BitOr(exp, op1, op2);
9942 FreeExpContents(exp);
9943 op1->ops.BitXor(exp, op1, op2);
9949 FreeExpContents(exp);
9950 op1->ops.LShift(exp, op1, op2);
9956 FreeExpContents(exp);
9957 op1->ops.RShift(exp, op1, op2);
9963 FreeExpContents(exp);
9964 op1->ops.Equ(exp, op1, op2);
9970 FreeExpContents(exp);
9971 op1->ops.Nqu(exp, op1, op2);
9977 FreeExpContents(exp);
9978 op1->ops.And(exp, op1, op2);
9984 FreeExpContents(exp);
9985 op1->ops.Or(exp, op1, op2);
9991 FreeExpContents(exp);
9992 op1->ops.Grt(exp, op1, op2);
9998 FreeExpContents(exp);
9999 op1->ops.Sma(exp, op1, op2);
10003 if(op1->ops.GrtEqu)
10005 FreeExpContents(exp);
10006 op1->ops.GrtEqu(exp, op1, op2);
10010 if(op1->ops.SmaEqu)
10012 FreeExpContents(exp);
10013 op1->ops.SmaEqu(exp, op1, op2);
10021 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10023 void ComputeExpression(struct Expression * exp)
10025 char expString[10240];
10027 expString[0] = '\0';
10032 ComputeInstantiation(exp);
10037 struct Expression * exp1, * exp2 = (((void *)0));
10038 struct Operand op1 =
10042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10045 struct Operand op2 =
10049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10054 ComputeExpression(exp->op.exp2);
10057 ComputeExpression(exp->op.exp1);
10058 exp1 = exp->op.exp1;
10059 exp2 = exp->op.exp2;
10060 op1 = GetOperand(exp1);
10062 op1.type->refCount++;
10065 op2 = GetOperand(exp2);
10067 op2.type->refCount++;
10072 exp1 = exp->op.exp2;
10073 op1 = GetOperand(exp1);
10075 op1.type->refCount++;
10077 CallOperator(exp, exp1, exp2, &op1, &op2);
10079 FreeType(op1.type);
10081 FreeType(op2.type);
10087 struct Expression * e, * n;
10089 for(e = (*exp->list).first; e; e = n)
10094 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10096 ComputeExpression(e);
10097 FreeType(exp->expType);
10098 FreeType(exp->destType);
10100 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10101 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10112 struct Expression * memberExp = exp->member.exp;
10113 struct Identifier * memberID = exp->member.member;
10114 struct Type * type;
10116 ComputeExpression(exp->member.exp);
10117 type = exp->member.exp->expType;
10120 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)));
10121 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10122 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10123 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10125 if(type->kind == 19 && exp->member.exp->type == 26)
10126 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10130 struct Symbol * classSym;
10133 PrintType(type, string, 0x0, 0x1);
10134 classSym = FindClass(string);
10135 _class = classSym ? classSym->registered : (((void *)0));
10137 if(exp->member.member)
10139 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10141 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10143 if(!prop && !member && _class && exp->member.member)
10145 struct Symbol * classSym = FindClass(exp->member.member->string);
10147 convertTo = _class;
10148 _class = classSym ? classSym->registered : (((void *)0));
10149 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10155 struct Type * type = prop->dataType;
10157 if(_class->type == 3)
10159 if(type->kind == 8)
10161 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10163 if(_class->type == 3)
10165 if(!_class->dataType)
10166 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10167 type = _class->dataType;
10175 float (* Get)(float) = (void *)prop->Get;
10177 GetFloat(exp->member.exp, &value);
10178 exp->constant = PrintFloat(Get ? Get(value) : value);
10185 double (* Get)(double);
10187 GetDouble(exp->member.exp, &value);
10189 Get = (void *)prop->Set;
10191 Get = (void *)prop->Get;
10192 exp->constant = PrintDouble(Get ? Get(value) : value);
10202 struct Expression * value = exp->member.exp;
10203 struct Type * type;
10205 if(!prop->dataType)
10206 ProcessPropertyType(prop);
10207 type = prop->dataType;
10211 else if(_class->type == 1)
10217 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10219 if(propertyClass->type == 1 && value->type == 1)
10221 void (* Set)(void *, void *) = (void *)prop->Set;
10223 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10224 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10225 exp->instance->_class = MkSpecifierName(_class->fullName);
10226 exp->instance->loc = exp->loc;
10228 Set(exp->instance->data, value->instance->data);
10229 PopulateInstance(exp->instance);
10236 void (* Set)(void *, int) = (void *)prop->Set;
10238 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10239 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10240 exp->instance->_class = MkSpecifierName(_class->fullName);
10241 exp->instance->loc = exp->loc;
10243 GetInt(value, &intValue);
10244 Set(exp->instance->data, intValue);
10245 PopulateInstance(exp->instance);
10250 long long intValue;
10251 void (* Set)(void *, long long) = (void *)prop->Set;
10253 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10254 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10255 exp->instance->_class = MkSpecifierName(_class->fullName);
10256 exp->instance->loc = exp->loc;
10258 GetInt64(value, &intValue);
10259 Set(exp->instance->data, intValue);
10260 PopulateInstance(exp->instance);
10265 double doubleValue;
10266 void (* Set)(void *, double) = (void *)prop->Set;
10268 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10269 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10270 exp->instance->_class = MkSpecifierName(_class->fullName);
10271 exp->instance->loc = exp->loc;
10273 GetDouble(value, &doubleValue);
10274 Set(exp->instance->data, doubleValue);
10275 PopulateInstance(exp->instance);
10280 else if(_class->type == 2)
10286 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10288 if(propertyClass->type == 1 && value->instance->data)
10290 unsigned int (* Set)(void *) = (void *)prop->Set;
10291 unsigned int bits = Set(value->instance->data);
10293 exp->constant = PrintHexUInt(bits);
10297 else if(_class->type == 2)
10299 unsigned int value;
10300 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10303 GetUInt(exp->member.exp, &value);
10305 exp->constant = PrintHexUInt(bits);
10314 if(_class->type == 2)
10316 unsigned int value;
10318 GetUInt(exp->member.exp, &value);
10323 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10325 if(_class->type == 1)
10327 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10329 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10330 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10331 exp->instance->_class = MkSpecifierName(_class->fullName);
10332 exp->instance->loc = exp->loc;
10334 Get(value, exp->instance->data);
10335 PopulateInstance(exp->instance);
10337 else if(_class->type == 2)
10339 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10340 uint64 bits = Get(value);
10342 exp->constant = PrintHexUInt64(bits);
10349 else if(_class->type == 1)
10351 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10357 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10359 if(_class->type == 1 && value)
10361 void (* Get)(void *, void *) = (void *)prop->Get;
10363 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10364 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10365 exp->instance->_class = MkSpecifierName(_class->fullName);
10366 exp->instance->loc = exp->loc;
10368 Get(value, exp->instance->data);
10369 PopulateInstance(exp->instance);
10380 exp->isConstant = 0x0;
10389 FreeExpression(memberExp);
10390 FreeIdentifier(memberID);
10396 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10398 FreeExpContents(exp);
10399 exp->constant = PrintUInt(ComputeTypeSize(type));
10406 struct Symbol * classSym = exp->_class->symbol;
10408 if(classSym && classSym->registered)
10410 if(classSym->registered->fixed)
10412 FreeSpecifier(exp->_class);
10413 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10418 char className[1024];
10420 strcpy(className, "__ecereClass_");
10421 FullClassNameCat(className, classSym->string, 0x1);
10422 MangleClassName(className);
10423 FreeExpContents(exp);
10425 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10426 exp->member.member = MkIdentifier("structSize");
10433 struct Type * type;
10434 struct Expression * e = exp;
10436 if(exp->type == 11)
10439 ComputeExpression(exp->cast.exp);
10442 if(e && exp->expType)
10444 type = exp->expType;
10445 if(type->kind == 8)
10447 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10449 if(_class && (_class->type == 3 || _class->type == 2))
10451 if(!_class->dataType)
10452 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10453 type = _class->dataType;
10463 GetChar(e, &value);
10464 FreeExpContents(exp);
10465 exp->constant = PrintChar(value);
10470 unsigned char value;
10472 GetUChar(e, &value);
10473 FreeExpContents(exp);
10474 exp->constant = PrintUChar(value);
10483 GetShort(e, &value);
10484 FreeExpContents(exp);
10485 exp->constant = PrintShort(value);
10490 unsigned short value;
10492 GetUShort(e, &value);
10493 FreeExpContents(exp);
10494 exp->constant = PrintUShort(value);
10504 FreeExpContents(exp);
10505 exp->constant = PrintInt(value);
10510 unsigned int value;
10512 GetUInt(e, &value);
10513 FreeExpContents(exp);
10514 exp->constant = PrintUInt(value);
10523 GetInt64(e, &value);
10524 FreeExpContents(exp);
10525 exp->constant = PrintInt64(value);
10532 GetUInt64(e, &value);
10533 FreeExpContents(exp);
10534 exp->constant = PrintUInt64(value);
10542 GetFloat(e, &value);
10543 FreeExpContents(exp);
10544 exp->constant = PrintFloat(value);
10552 GetDouble(e, &value);
10553 FreeExpContents(exp);
10554 exp->constant = PrintDouble(value);
10564 struct Operand op1 =
10568 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10571 struct Operand op2 =
10575 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10578 struct Operand op3 =
10582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10587 ComputeExpression((*exp->cond.exp).last);
10588 if(exp->cond.elseExp)
10589 ComputeExpression(exp->cond.elseExp);
10591 ComputeExpression(exp->cond.cond);
10592 op1 = GetOperand(exp->cond.cond);
10594 op1.type->refCount++;
10595 op2 = GetOperand((*exp->cond.exp).last);
10597 op2.type->refCount++;
10598 op3 = GetOperand(exp->cond.elseExp);
10600 op3.type->refCount++;
10603 FreeExpContents(exp);
10604 op1.ops.Cond(exp, &op1, &op2, &op3);
10607 FreeType(op1.type);
10609 FreeType(op2.type);
10611 FreeType(op3.type);
10617 void ApplyAnyObjectLogic(struct Expression * e);
10619 extern void CopyTypeInto(struct Type * type, struct Type * src);
10621 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10623 unsigned int result = 0x1;
10627 struct __ecereNameSpace__ecere__sys__OldList converts =
10631 struct Conversion * convert;
10633 if(destType->kind == 0)
10635 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10639 for(convert = converts.first; convert; convert = convert->next)
10641 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10645 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10646 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10649 newExp->destType = (((void *)0));
10653 exp->addedThis = 0x1;
10654 exp->member.exp = newExp;
10655 FreeType(exp->member.exp->expType);
10656 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10657 exp->member.exp->expType->classObjectType = objectType;
10658 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10659 exp->member.memberType = 1;
10660 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10661 exp->needCast = 0x1;
10663 exp->expType->refCount++;
10664 ApplyAnyObjectLogic(exp->member.exp);
10670 exp->addedThis = 0x1;
10671 exp->member.exp = newExp;
10672 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10674 newExp->byReference = 0x1;
10676 FreeType(exp->member.exp->expType);
10677 exp->member.exp->expType = (((void *)0));
10678 if(convert->convert->dataType)
10680 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10681 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10682 exp->member.exp->expType->refCount = 1;
10683 exp->member.exp->expType->classObjectType = objectType;
10684 ApplyAnyObjectLogic(exp->member.exp);
10686 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10687 exp->member.memberType = 4;
10688 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10689 exp->needCast = 0x1;
10690 if(convert->resultType)
10691 convert->resultType->refCount++;
10697 FreeType(exp->expType);
10700 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10701 exp->needCast = 0x1;
10703 exp->expType->refCount++;
10707 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10708 exp->needCast = 0x1;
10709 if(convert->resultType)
10710 convert->resultType->refCount++;
10714 if(exp->isConstant && inCompiler)
10715 ComputeExpression(exp);
10716 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10718 if(!result && exp->expType && converts.count)
10720 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10722 if(!result && exp->expType && exp->destType)
10724 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))
10731 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
10733 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10735 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10737 void CheckTemplateTypes(struct Expression * exp)
10739 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10741 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10742 struct Statement * compound;
10743 struct Context * context;
10747 exp->destType->refCount++;
10749 exp->expType->refCount++;
10750 newExp->prev = (((void *)0));
10751 newExp->next = (((void *)0));
10752 switch(exp->expType->kind)
10756 exp->op.exp1 = (((void *)0));
10757 context = PushContext();
10758 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")))))))));
10759 compound->compound.context = context;
10760 PopContext(context);
10765 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10766 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10770 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10772 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10773 struct Statement * compound;
10774 struct Context * context;
10778 exp->destType->refCount++;
10780 exp->expType->refCount++;
10781 newExp->prev = (((void *)0));
10782 newExp->next = (((void *)0));
10783 switch(exp->expType->kind)
10787 exp->op.exp1 = (((void *)0));
10788 context = PushContext();
10789 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")))))))));
10790 compound->compound.context = context;
10791 PopContext(context);
10793 ProcessExpressionType(exp->op.exp2);
10797 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10800 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10801 ProcessExpressionType((*exp->list).first);
10807 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10808 newExp->needCast = 0x1;
10809 ProcessExpressionType((*exp->list).first);
10815 if(exp->expType->kind == 20)
10817 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10821 FreeType(exp->destType);
10822 FreeType(exp->expType);
10823 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10827 if(newExp->type == 8 && newExp->member.memberType == 3)
10831 exp->op.exp1 = (((void *)0));
10832 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10836 char typeString[1024];
10837 struct Declarator * decl;
10838 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10840 typeString[0] = '\0';
10841 PrintType(exp->expType, typeString, 0x0, 0x0);
10842 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10844 exp->cast.typeName = MkTypeName(specs, decl);
10845 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10846 exp->cast.exp->needCast = 0x1;
10854 extern int strncmp(const char * , const char * , int n);
10856 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
10858 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10860 int nsLen = strlen(nameSpace);
10861 struct Symbol * symbol;
10863 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)))
10865 char * s = symbol->string;
10867 if(!strncmp(s, nameSpace, nsLen))
10872 for(c = strlen(s) - 1; c >= 0; c--)
10875 namePart = s + c + 1;
10876 if(!strcmp(namePart, name))
10884 return (((void *)0));
10887 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10890 char nameSpace[1024];
10892 unsigned int gotColon = 0x0;
10894 nameSpace[0] = '\0';
10895 for(c = strlen(name) - 1; c >= 0; c--)
10901 namePart = name + c + 1;
10902 while(c >= 0 && name[c] == ':')
10906 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
10910 memcpy(nameSpace, name, c + 1);
10911 nameSpace[c + 1] = (char)0;
10912 return ScanWithNameSpace(tree, nameSpace, namePart);
10916 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10922 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10926 return ScanWithNameSpace(tree, "", namePart);
10928 return (((void *)0));
10931 static void ProcessDeclaration(struct Declaration * decl);
10933 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10935 struct Context * ctx;
10936 struct Symbol * symbol = (((void *)0));
10938 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10940 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
10942 symbol = (((void *)0));
10945 char curName[1024];
10947 strcpy(curName, thisNameSpace);
10948 strcat(curName, "::");
10949 strcat(curName, name);
10950 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10953 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10956 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
10957 if(symbol || ctx == endContext)
10960 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10962 if(symbol->pointerExternal->type == 0)
10964 struct FunctionDefinition * function = symbol->pointerExternal->function;
10965 struct Context * tmpContext = curContext;
10967 curContext = (((void *)0));
10968 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
10969 curContext = tmpContext;
10970 symbol->pointerExternal->symbol = symbol;
10971 DeclareType(symbol->type, 0x1, 0x1);
10972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
10973 symbol->id = curExternal->symbol->idCode;
10975 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
10977 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
10978 symbol->id = curExternal->symbol->idCode;
10984 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
10986 if(!type->isSigned)
10987 ListAdd(specs, MkSpecifier(UNSIGNED));
10992 if(type->_class->registered)
10994 if(!type->_class->registered->dataType)
10995 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10996 GetTypeSpecs(type->_class->registered->dataType, specs);
11001 ListAdd(specs, MkSpecifier(DOUBLE));
11004 ListAdd(specs, MkSpecifier(FLOAT));
11007 ListAdd(specs, MkSpecifier(CHAR));
11010 ListAdd(specs, MkSpecifier(SHORT));
11013 ListAdd(specs, MkSpecifier(INT64));
11017 ListAdd(specs, MkSpecifier(INT));
11022 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11024 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11031 if(type->_class && type->_class->string)
11033 if(type->classObjectType == 2)
11034 strcat(string, "typed_object");
11036 strcat(string, type->_class->string);
11039 if(type->_class->registered)
11040 strcat(string, type->_class->registered->name);
11042 strcat(string, type->_class->string);
11049 _PrintType(type->type, string, 0x0, printFunction, fullName);
11050 strcat(string, " *");
11055 strcat(string, "void");
11058 strcat(string, type->isSigned ? "int" : "uint");
11061 strcat(string, type->isSigned ? "int64" : "uint64");
11064 strcat(string, type->isSigned ? "char" : "byte");
11067 strcat(string, type->isSigned ? "short" : "uint16");
11070 strcat(string, "float");
11073 strcat(string, "double");
11078 strcat(string, "struct ");
11079 strcat(string, type->enumName);
11081 else if(type->typeName)
11083 strcat(string, type->typeName);
11087 struct Type * member;
11089 strcat(string, "struct {");
11090 for(member = type->members.first; member; member = member->next)
11092 PrintType(member, string, 0x1, fullName);
11093 strcat(string, "; ");
11095 strcat(string, "}");
11101 strcat(string, "union ");
11102 strcat(string, type->enumName);
11104 else if(type->typeName)
11106 strcat(string, type->typeName);
11110 strcat(string, "union ");
11111 strcat(string, "(unnamed)");
11117 strcat(string, "enum ");
11118 strcat(string, type->enumName);
11120 else if(type->typeName)
11122 strcat(string, type->typeName);
11125 strcat(string, "enum");
11131 if(type->dllExport)
11132 strcat(string, "dllexport ");
11133 PrintType(type->returnType, string, 0x0, fullName);
11134 strcat(string, " ");
11141 strcat(string, type->name);
11144 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11150 strcat(string, name);
11156 struct Type * param;
11158 strcat(string, "(");
11159 for(param = type->params.first; param; param = param->next)
11161 PrintType(param, string, 0x1, fullName);
11163 strcat(string, ", ");
11165 strcat(string, ")");
11172 char baseType[1024], size[256];
11173 struct Type * arrayType = type;
11175 baseType[0] = '\0';
11177 while(arrayType->kind == 12)
11180 if(arrayType->enumClass)
11181 strcat(size, arrayType->enumClass->string);
11182 else if(arrayType->arraySizeExp)
11183 PrintExpression(arrayType->arraySizeExp, size);
11185 arrayType = arrayType->arrayType;
11187 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11188 strcat(string, baseType);
11189 strcat(string, size);
11195 strcat(string, "...");
11198 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11201 strcat(string, "subclass(");
11202 strcat(string, type->_class ? type->_class->string : "int");
11203 strcat(string, ")");
11206 strcat(string, type->templateParameter->identifier->string);
11209 strcat(string, "thisclass");
11212 strcat(string, "__builtin_va_list");
11215 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11217 strcat(string, " ");
11218 strcat(string, type->name);
11223 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11225 struct Type * funcType;
11227 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11229 if(funcType && funcType->kind == 11 && type != funcType)
11231 char typeString[1024];
11232 struct Type * param;
11234 PrintType(funcType->returnType, string, 0x0, fullName);
11235 strcat(string, "(");
11236 _PrintType(type, string, printName, 0x0, fullName);
11237 strcat(string, ")");
11238 strcat(string, "(");
11239 for(param = funcType->params.first; param; param = param->next)
11241 PrintType(param, string, 0x1, fullName);
11243 strcat(string, ", ");
11245 strcat(string, ")");
11248 _PrintType(type, string, printName, 0x1, fullName);
11249 if(type->bitFieldCount)
11253 sprintf(count, ":%d", type->bitFieldCount);
11254 strcat(string, count);
11258 static struct Type * FindMember(struct Type * type, char * string)
11260 struct Type * memberType;
11262 for(memberType = type->members.first; memberType; memberType = memberType->next)
11264 if(!memberType->name)
11266 struct Type * subType = FindMember(memberType, string);
11271 else if(!strcmp(memberType->name, string))
11274 return (((void *)0));
11277 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11279 struct Type * memberType;
11281 for(memberType = type->members.first; memberType; memberType = memberType->next)
11283 if(!memberType->name)
11285 struct Type * subType = FindMember(memberType, string);
11289 *offset += memberType->offset;
11293 else if(!strcmp(memberType->name, string))
11295 *offset += memberType->offset;
11299 return (((void *)0));
11302 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11304 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11306 struct Expression * ParseExpressionString(char * expression)
11308 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11309 ((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));
11310 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11312 parsedExpression = (((void *)0));
11314 expression_yyparse();
11315 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11316 return parsedExpression;
11319 extern char * QMkString(char * source);
11321 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11323 void * __ecereTemp1;
11324 struct Identifier * id = exp->identifier;
11325 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11326 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11327 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11328 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11330 if(_class && _class->type == 4)
11332 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11333 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11337 struct __ecereNameSpace__ecere__com__Class * baseClass;
11339 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11341 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11343 for(value = e->values.first; value; value = value->next)
11345 if(!strcmp(value->name, id->string))
11350 char constant[256];
11352 FreeExpContents(exp);
11354 exp->isConstant = 0x1;
11355 if(!strcmp(baseClass->dataTypeString, "int"))
11356 sprintf(constant, "%d", value->data);
11358 sprintf(constant, "0x%X", value->data);
11359 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11360 exp->expType = MkClassType(baseClass->fullName);
11368 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11370 ProcessMethodType(method);
11371 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));
11374 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11376 if(!prop->dataType)
11377 ProcessPropertyType(prop);
11378 exp->expType = prop->dataType;
11380 prop->dataType->refCount++;
11383 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11385 if(!member->dataType)
11386 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11387 exp->expType = member->dataType;
11388 if(member->dataType)
11389 member->dataType->refCount++;
11392 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11394 if(!classProp->dataType)
11395 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11396 if(classProp->constant)
11398 FreeExpContents(exp);
11399 exp->isConstant = 0x1;
11400 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11403 exp->constant = QMkString((char *)classProp->Get(_class));
11407 char constant[256];
11410 sprintf(constant, "%d", classProp->Get(_class));
11411 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11417 exp->expType = classProp->dataType;
11418 if(classProp->dataType)
11419 classProp->dataType->refCount++;
11425 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11427 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11428 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11429 struct __ecereNameSpace__ecere__com__NameSpace * child;
11433 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)))
11435 data = ScanGlobalData(child, name);
11443 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11445 extern char * strncpy(char * , const char * , int n);
11447 static struct GlobalData * FindGlobalData(char * name)
11450 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11452 nameSpace = globalData;
11453 for(c = 0; name[c]; c++)
11455 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11457 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11458 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11460 strncpy(spaceName, name + start, c - start);
11461 spaceName[c - start] = '\0';
11462 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11463 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11465 return (((void *)0));
11466 nameSpace = newSpace;
11474 return ScanGlobalData(nameSpace, name + start);
11476 return (((void *)0));
11479 static int definedExpStackPos;
11481 static void * definedExpStack[512];
11483 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11485 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11487 FreeExpContents(checkedExp);
11488 FreeType(checkedExp->expType);
11489 FreeType(checkedExp->destType);
11490 *checkedExp = *newExp;
11491 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11492 checkedExp->prev = prev;
11493 checkedExp->next = next;
11496 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11498 void __ecereMethod_Expression_Clear();
11500 void ApplyAnyObjectLogic(struct Expression * e)
11502 struct Type * destType = e->destType;
11504 if(destType && (destType->classObjectType == 3))
11506 if(e && e->expType)
11508 struct Type * type = e->expType;
11509 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11511 if(type->kind == 8 && type->_class && type->_class->registered)
11513 _class = type->_class->registered;
11515 else if(type->kind == 19)
11517 _class = FindClass("ecere::com::Class")->registered;
11521 char string[1024] = "";
11522 struct Symbol * classSym;
11524 PrintType(type, string, 0x0, 0x1);
11525 classSym = FindClass(string);
11527 _class = classSym->registered;
11529 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)))
11531 if(!_class || strcmp(_class->fullName, "char *"))
11533 struct Expression * checkedExp = e, * newExp;
11535 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11537 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11539 if(checkedExp->type == 25)
11541 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11544 checkedExp = (*checkedExp->list).last;
11546 else if(checkedExp->type == 11)
11547 checkedExp = checkedExp->cast.exp;
11549 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11551 newExp = checkedExp->op.exp2;
11552 checkedExp->op.exp2 = (((void *)0));
11553 FreeExpContents(checkedExp);
11554 if(e->expType && e->expType->passAsTemplate)
11558 ComputeTypeSize(e->expType);
11559 sprintf(size, "%d", e->expType->size);
11560 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))))));
11562 ReplaceExpContents(checkedExp, newExp);
11563 e->byReference = 0x1;
11565 else if(!e->byReference || (_class && _class->type == 5))
11567 struct Expression * checkedExp, * newExp;
11570 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;
11572 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11574 struct Context * context = PushContext();
11575 struct Declarator * decl;
11576 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11577 char typeString[1024];
11578 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11580 typeString[0] = '\0';
11582 newExp->prev = (((void *)0));
11583 newExp->next = (((void *)0));
11584 newExp->expType = (((void *)0));
11585 PrintType(e->expType, typeString, 0x0, 0x1);
11586 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11587 newExp->destType = ProcessType(specs, decl);
11588 curContext = context;
11590 e->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
11592 struct Type * type = e->destType;
11594 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11595 CopyTypeInto(e->destType, type);
11596 e->destType->refCount = 1;
11597 e->destType->classObjectType = 0;
11600 e->compound->compound.context = context;
11601 PopContext(context);
11602 curContext = context->parent;
11606 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11608 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11610 if(checkedExp->type == 25)
11612 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11615 checkedExp = (*checkedExp->list).last;
11617 else if(checkedExp->type == 11)
11618 checkedExp = checkedExp->cast.exp;
11621 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11623 *operand = *checkedExp;
11624 checkedExp->destType = (((void *)0));
11625 checkedExp->expType = (((void *)0));
11626 __ecereMethod_Expression_Clear(checkedExp);
11627 checkedExp->type = 4;
11628 checkedExp->op.op = '&';
11629 checkedExp->op.exp1 = (((void *)0));
11630 checkedExp->op.exp2 = operand;
11639 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))))
11641 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11647 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11650 thisExp->prev = (((void *)0));
11651 thisExp->next = (((void *)0));
11652 __ecereMethod_Expression_Clear(e);
11654 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11655 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11656 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11658 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11659 CopyTypeInto(e->expType, thisExp->expType);
11660 e->expType->byReference = 0x0;
11661 e->expType->refCount = 1;
11662 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))
11664 e->expType->classObjectType = 0;
11669 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11671 if(destType->kind == 14)
11673 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11675 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11677 unsigned int byReference = e->expType->byReference;
11678 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11679 struct Declarator * decl;
11680 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11681 char typeString[1024];
11682 struct Type * type;
11683 int backupClassObjectType;
11685 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11689 backupClassObjectType = type->classObjectType;
11690 type->classObjectType = 0;
11691 typeString[0] = '\0';
11692 PrintType(type, typeString, 0x0, 0x1);
11693 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11694 type->classObjectType = backupClassObjectType;
11696 thisExp->prev = (((void *)0));
11697 thisExp->next = (((void *)0));
11698 __ecereMethod_Expression_Clear(e);
11699 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)))
11703 e->op.exp1 = (((void *)0));
11704 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11709 e->cast.typeName = MkTypeName(specs, decl);
11710 e->cast.exp = thisExp;
11711 e->byReference = 0x1;
11714 e->destType = destType;
11716 destType->refCount++;
11721 extern char * strstr(char * , const char * );
11723 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11725 struct __ecereNameSpace__ecere__com__DefinedExpression
11727 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11728 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11731 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11734 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11736 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11738 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11740 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11742 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11744 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11746 extern struct Expression * CopyExpression(struct Expression * exp);
11748 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11750 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11752 static void ProcessStatement(struct Statement * stmt);
11754 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11756 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
11758 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
11760 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11762 void ProcessExpressionType(struct Expression * exp)
11764 void * __ecereTemp2;
11765 void * __ecereTemp1;
11766 unsigned int unresolved = 0x0;
11767 struct Location oldyylloc = yylloc;
11768 unsigned int notByReference = 0x0;
11770 if(!exp || exp->expType)
11777 struct Identifier * id = exp->identifier;
11781 if(id->_class && id->_class->name)
11783 id->classSym = id->_class->symbol;
11785 if(strstr(id->string, "__ecereClass") == id->string)
11787 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11790 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11792 ReplaceClassMembers(exp, thisClass);
11795 ProcessExpressionType(exp);
11798 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11803 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11807 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11813 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11816 ProcessExpressionType(exp);
11820 else if(currentClass && !id->_class)
11822 if(ResolveIdWithClass(exp, currentClass, 0x1))
11825 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11830 struct Type * type = symbol->type;
11831 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11833 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11835 struct Context * context = SetupTemplatesContext(_class);
11837 type = ReplaceThisClassType(_class);
11838 FinishTemplatesContext(context);
11840 type->refCount = 0;
11842 FreeSpecifier(id->_class);
11843 id->_class = (((void *)0));
11844 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11845 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11846 id->classSym = (((void *)0));
11847 exp->expType = type;
11850 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11851 exp->isConstant = 0x1;
11852 if(symbol->isParam || !strcmp(id->string, "this"))
11854 if(_class && _class->type == 1)
11855 exp->byReference = 0x1;
11857 if(symbol->isIterator)
11859 if(symbol->isIterator == 3)
11862 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11863 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11864 exp->expType = (((void *)0));
11865 ProcessExpressionType(exp);
11867 else if(symbol->isIterator != 4)
11870 exp->member.exp = MkExpIdentifier(exp->identifier);
11871 exp->member.exp->expType = exp->expType;
11872 exp->member.member = MkIdentifier("data");
11873 exp->expType = (((void *)0));
11874 ProcessExpressionType(exp);
11881 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11883 if(thisNameSpace && !(id->_class && !id->_class->name))
11887 strcpy(name, thisNameSpace);
11888 strcat(name, "::");
11889 strcat(name, id->string);
11890 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11893 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11898 for(c = 0; c < definedExpStackPos; c++)
11899 if(definedExpStack[c] == definedExp)
11901 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11903 struct Location backupYylloc = yylloc;
11905 definedExpStack[definedExpStackPos++] = definedExp;
11906 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11907 ((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));
11908 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11910 parsedExpression = (((void *)0));
11912 expression_yyparse();
11913 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11914 yylloc = backupYylloc;
11915 if(parsedExpression)
11917 FreeIdentifier(id);
11919 exp->list = MkListOne(parsedExpression);
11920 parsedExpression->loc = yylloc;
11921 ProcessExpressionType(exp);
11922 definedExpStackPos--;
11925 definedExpStackPos--;
11931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
11937 struct GlobalData * data = (((void *)0));
11939 if(thisNameSpace && !(id->_class && !id->_class->name))
11943 strcpy(name, thisNameSpace);
11944 strcat(name, "::");
11945 strcat(name, id->string);
11946 data = FindGlobalData(name);
11949 data = FindGlobalData(id->string);
11952 DeclareGlobalData(data);
11953 exp->expType = data->dataType;
11955 data->dataType->refCount++;
11956 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11957 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11958 FreeSpecifier(id->_class);
11959 id->_class = (((void *)0));
11964 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11966 if(thisNameSpace && !(id->_class && !id->_class->name))
11970 strcpy(name, thisNameSpace);
11971 strcat(name, "::");
11972 strcat(name, id->string);
11973 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11976 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11981 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11982 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11984 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11985 strcpy(name, "__ecereFunction_");
11986 FullClassNameCat(name, id->string, 0x0);
11987 if(DeclareFunction(function, name))
11989 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11990 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11992 exp->expType = function->dataType;
11993 if(function->dataType)
11994 function->dataType->refCount++;
11995 FreeSpecifier(id->_class);
11996 id->_class = (((void *)0));
12008 struct __ecereNameSpace__ecere__com__Class * _class;
12010 if(!exp->instance->_class)
12012 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12014 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12017 ProcessInstantiationType(exp->instance);
12018 exp->isConstant = exp->instance->isConstant;
12019 if(exp->instance->_class)
12021 exp->expType = MkClassType(exp->instance->_class->name);
12029 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12031 exp->expType = type;
12032 if(exp->constant[0] == '\'')
12034 if((int)((unsigned char *)exp->constant)[1] > 127)
12037 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12040 ch = exp->constant[1];
12041 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12042 exp->constant = PrintUInt(ch);
12044 type->_class = FindClass("unichar");
12045 type->isSigned = 0x0;
12050 type->isSigned = 0x1;
12053 else if(strchr(exp->constant, '.'))
12055 char ch = exp->constant[strlen(exp->constant) - 1];
12061 type->isSigned = 0x1;
12065 if(exp->constant[0] == '0' && exp->constant[1])
12066 type->isSigned = 0x0;
12067 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12068 type->isSigned = 0x0;
12069 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12070 type->isSigned = 0x0;
12072 type->isSigned = 0x1;
12075 exp->isConstant = 0x1;
12081 exp->isConstant = 0x1;
12082 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));
12087 ProcessExpressionType(exp->_new.size);
12088 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));
12089 DeclareType(exp->expType->type, 0x0, 0x0);
12093 ProcessExpressionType(exp->_renew.size);
12094 ProcessExpressionType(exp->_renew.exp);
12095 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));
12096 DeclareType(exp->expType->type, 0x0, 0x0);
12100 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12101 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12102 unsigned int useDestType = 0x0, useSideType = 0x0;
12103 struct Location oldyylloc = yylloc;
12104 unsigned int useSideUnit = 0x0;
12105 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12147 if(exp->op.op != '*' || exp->op.exp1)
12154 if(exp->op.op == '&')
12156 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12158 struct Identifier * id = exp->op.exp2->identifier;
12159 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12161 if(symbol && symbol->isIterator == 2)
12164 exp->member.exp = exp->op.exp2;
12165 exp->member.member = MkIdentifier("key");
12166 exp->expType = (((void *)0));
12167 exp->op.exp2->expType = symbol->type;
12168 symbol->type->refCount++;
12169 ProcessExpressionType(exp);
12177 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))
12179 if(exp->op.exp1->destType)
12180 FreeType(exp->op.exp1->destType);
12181 exp->op.exp1->destType = exp->destType;
12183 exp->destType->refCount++;
12187 if(exp->op.exp1->destType)
12188 FreeType(exp->op.exp1->destType);
12189 exp->op.exp1->destType = dummy;
12192 if(exp->op.exp1->destType && exp->op.op != '=')
12193 exp->op.exp1->destType->count++;
12194 ProcessExpressionType(exp->op.exp1);
12195 if(exp->op.exp1->destType && exp->op.op != '=')
12196 exp->op.exp1->destType->count--;
12197 if(exp->op.exp1->destType == dummy)
12200 exp->op.exp1->destType = (((void *)0));
12202 type1 = exp->op.exp1->expType;
12206 char expString[10240];
12208 expString[0] = '\0';
12209 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12213 exp->op.exp2->destType = exp->op.exp1->expType;
12214 if(exp->op.exp1->expType)
12215 exp->op.exp1->expType->refCount++;
12219 exp->op.exp2->destType = exp->destType;
12221 exp->destType->refCount++;
12225 exp->expType = type1;
12230 PrintExpression(exp->op.exp2, expString);
12231 if(type1 && type1->kind == 13)
12233 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)
12234 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12235 else if(exp->op.op == '=')
12237 if(exp->op.exp2->destType)
12238 FreeType(exp->op.exp2->destType);
12239 exp->op.exp2->destType = type1;
12246 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)
12250 if(exp->op.exp2->destType)
12251 FreeType(exp->op.exp2->destType);
12252 exp->op.exp2->destType = type1;
12259 exp->expType = type1;
12261 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)))
12263 if(exp->op.exp2->destType)
12264 FreeType(exp->op.exp2->destType);
12265 exp->op.exp2->destType = exp->destType;
12267 exp->destType->refCount++;
12271 if(exp->op.exp2->destType)
12272 FreeType(exp->op.exp2->destType);
12273 exp->op.exp2->destType = dummy;
12276 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12278 FreeType(exp->op.exp2->destType);
12279 exp->op.exp2->destType = type1;
12282 if(exp->op.exp2->destType && exp->op.op != '=')
12283 exp->op.exp2->destType->count++;
12284 ProcessExpressionType(exp->op.exp2);
12285 if(exp->op.exp2->destType && exp->op.op != '=')
12286 exp->op.exp2->destType->count--;
12287 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12289 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)
12291 if(exp->op.op != '=' && type1->type->kind == 0)
12292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12294 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)))
12296 if(exp->op.op == ADD_ASSIGN)
12297 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12299 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))
12301 if(exp->op.op == ADD_ASSIGN)
12302 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12304 else if(inCompiler)
12306 char type1String[1024];
12307 char type2String[1024];
12309 type1String[0] = '\0';
12310 type2String[0] = '\0';
12311 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12312 PrintType(type1, type2String, 0x0, 0x1);
12313 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12314 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12317 if(exp->op.exp2->destType == dummy)
12320 exp->op.exp2->destType = (((void *)0));
12322 type2 = exp->op.exp2->expType;
12325 if(exp->op.op == SIZEOF)
12327 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12328 exp->isConstant = 0x1;
12330 else if(exp->op.op == '*' && !exp->op.exp1)
12332 exp->expType = Dereference(type2);
12333 if(type2 && type2->kind == 8)
12334 notByReference = 0x1;
12336 else if(exp->op.op == '&' && !exp->op.exp1)
12337 exp->expType = Reference(type2);
12344 if(exp->op.exp1->destType)
12345 FreeType(exp->op.exp1->destType);
12346 exp->op.exp1->destType = MkClassType("bool");
12347 exp->op.exp1->destType->truth = 0x1;
12348 if(!exp->op.exp1->expType)
12349 ProcessExpressionType(exp->op.exp1);
12351 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12352 FreeType(exp->op.exp1->expType);
12353 exp->op.exp1->expType = MkClassType("bool");
12354 exp->op.exp1->expType->truth = 0x1;
12358 if(exp->op.exp2->destType)
12359 FreeType(exp->op.exp2->destType);
12360 exp->op.exp2->destType = MkClassType("bool");
12361 exp->op.exp2->destType->truth = 0x1;
12362 if(!exp->op.exp2->expType)
12363 ProcessExpressionType(exp->op.exp2);
12365 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12366 FreeType(exp->op.exp2->expType);
12367 exp->op.exp2->expType = MkClassType("bool");
12368 exp->op.exp2->expType->truth = 0x1;
12371 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")))))
12373 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12375 if(exp->op.exp2->destType)
12376 FreeType(exp->op.exp2->destType);
12377 exp->op.exp2->destType = type1;
12379 if(exp->op.exp1->destType)
12380 FreeType(exp->op.exp1->destType);
12381 exp->op.exp1->destType = type2;
12383 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)
12384 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);
12385 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12387 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12391 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12393 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12394 ProcessExpressionType(exp->op.exp1);
12395 if(type2->kind != 13)
12397 ProcessExpressionType(classExp);
12398 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"))))))));
12399 if(!exp->op.exp2->expType)
12400 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12401 ProcessExpressionType(exp->op.exp2);
12405 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)))
12407 if(type1->kind != 8 && type1->type->kind == 0)
12408 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12409 exp->expType = type1;
12413 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)))
12415 if(type2->kind != 8 && type2->type->kind == 0)
12416 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12417 exp->expType = type2;
12421 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))
12423 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12427 unsigned int success = 0x0;
12429 if(type1->kind == 13 && type2->kind == 13)
12431 if(exp->op.op == '+')
12432 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12433 else if(exp->op.op == '-')
12435 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12437 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12439 if(type1->type->kind == 20)
12441 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12445 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12447 ProcessExpressionType(classExp);
12449 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")))))));
12450 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12458 if(!success && exp->op.exp1->type == 2)
12460 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12463 FreeType(exp->expType);
12464 exp->expType = exp->op.exp1->destType;
12465 if(exp->op.exp1->destType)
12466 exp->op.exp1->destType->refCount++;
12469 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12472 FreeType(exp->expType);
12473 exp->expType = exp->op.exp2->destType;
12474 if(exp->op.exp2->destType)
12475 exp->op.exp2->destType->refCount++;
12481 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12484 FreeType(exp->expType);
12485 exp->expType = exp->op.exp2->destType;
12486 if(exp->op.exp2->destType)
12487 exp->op.exp2->destType->refCount++;
12490 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12493 FreeType(exp->expType);
12494 exp->expType = exp->op.exp1->destType;
12495 if(exp->op.exp1->destType)
12496 exp->op.exp1->destType->refCount++;
12502 char expString1[10240];
12503 char expString2[10240];
12507 expString1[0] = '\0';
12508 expString2[0] = '\0';
12513 PrintExpression(exp->op.exp1, expString1);
12514 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12515 PrintExpression(exp->op.exp2, expString2);
12516 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12517 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12518 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12520 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12524 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12526 if(exp->op.exp1->destType)
12527 FreeType(exp->op.exp1->destType);
12528 exp->op.exp1->destType = type2->_class->registered->dataType;
12529 if(type2->_class->registered->dataType)
12530 type2->_class->registered->dataType->refCount++;
12531 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12532 exp->expType = type2;
12536 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12538 if(exp->op.exp2->destType)
12539 FreeType(exp->op.exp2->destType);
12540 exp->op.exp2->destType = type1->_class->registered->dataType;
12541 if(type1->_class->registered->dataType)
12542 type1->_class->registered->dataType->refCount++;
12543 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12544 exp->expType = type1;
12550 unsigned int valid = 0x0;
12552 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12554 if(exp->op.exp2->destType)
12555 FreeType(exp->op.exp2->destType);
12556 if(!type1->_class->registered->dataType)
12557 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12558 exp->op.exp2->destType = type1->_class->registered->dataType;
12559 exp->op.exp2->destType->refCount++;
12560 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12561 type2 = exp->op.exp2->destType;
12562 exp->expType = type2;
12565 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12567 if(exp->op.exp1->destType)
12568 FreeType(exp->op.exp1->destType);
12569 if(!type2->_class->registered->dataType)
12570 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12571 exp->op.exp1->destType = type2->_class->registered->dataType;
12572 exp->op.exp1->destType->refCount++;
12573 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12574 type1 = exp->op.exp1->destType;
12575 exp->expType = type1;
12578 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12580 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12582 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12585 FreeType(exp->expType);
12586 exp->expType = exp->op.exp1->expType;
12587 if(exp->op.exp2->expType)
12588 exp->op.exp1->expType->refCount++;
12592 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12594 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12597 FreeType(exp->expType);
12598 exp->expType = exp->op.exp2->expType;
12599 if(exp->op.exp2->expType)
12600 exp->op.exp2->expType->refCount++;
12607 if(exp->op.exp2->destType)
12608 FreeType(exp->op.exp2->destType);
12609 exp->op.exp2->destType = type1;
12611 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12614 FreeType(exp->expType);
12615 exp->expType = exp->op.exp2->destType;
12616 if(exp->op.exp2->destType)
12617 exp->op.exp2->destType->refCount++;
12619 else if(type1 && type2)
12621 char expString1[10240];
12622 char expString2[10240];
12623 char type1String[1024];
12624 char type2String[1024];
12626 expString1[0] = '\0';
12627 expString2[0] = '\0';
12628 type1String[0] = '\0';
12629 type2String[0] = '\0';
12632 PrintExpression(exp->op.exp1, expString1);
12633 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12634 PrintExpression(exp->op.exp2, expString2);
12635 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12636 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12637 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12639 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12640 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12642 exp->expType = exp->op.exp1->expType;
12643 if(exp->op.exp1->expType)
12644 exp->op.exp1->expType->refCount++;
12646 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12648 exp->expType = exp->op.exp2->expType;
12649 if(exp->op.exp2->expType)
12650 exp->op.exp2->expType->refCount++;
12657 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12659 struct Type * oldType = exp->op.exp1->expType;
12661 exp->op.exp1->expType = (((void *)0));
12662 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12665 exp->op.exp1->expType = oldType;
12667 if(exp->op.exp1->destType)
12668 FreeType(exp->op.exp1->destType);
12669 exp->op.exp1->destType = type2;
12671 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12674 FreeType(exp->expType);
12675 exp->expType = exp->op.exp1->destType;
12676 if(exp->op.exp1->destType)
12677 exp->op.exp1->destType->refCount++;
12681 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12683 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12685 if(exp->op.exp1->destType)
12686 FreeType(exp->op.exp1->destType);
12687 exp->op.exp1->destType = type2->_class->registered->dataType;
12688 if(type2->_class->registered->dataType)
12689 type2->_class->registered->dataType->refCount++;
12690 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12692 if(exp->op.op == '!')
12694 exp->expType = MkClassType("bool");
12695 exp->expType->truth = 0x1;
12699 exp->expType = type2;
12704 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12706 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12708 if(exp->op.exp2->destType)
12709 FreeType(exp->op.exp2->destType);
12710 exp->op.exp2->destType = type1->_class->registered->dataType;
12711 if(type1->_class->registered->dataType)
12712 type1->_class->registered->dataType->refCount++;
12713 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12715 exp->expType = type1;
12721 if(exp->op.exp1 && !exp->op.exp1->expType)
12723 char expString[10000];
12725 expString[0] = '\0';
12728 PrintExpression(exp->op.exp1, expString);
12729 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12734 if(exp->op.exp2 && !exp->op.exp2->expType)
12736 char expString[10240];
12738 expString[0] = '\0';
12741 PrintExpression(exp->op.exp2, expString);
12742 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
12749 FreeType(exp->expType);
12750 exp->expType = MkClassType("bool");
12751 exp->expType->truth = 0x1;
12753 if(exp->op.op != SIZEOF)
12754 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12755 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
12757 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12759 yylloc = oldyylloc;
12766 struct Expression * e;
12768 exp->isConstant = 0x1;
12769 for(e = (*exp->list).first; e; e = e->next)
12771 unsigned int inced = 0x0;
12775 FreeType(e->destType);
12776 e->destType = exp->destType;
12779 exp->destType->refCount++;
12780 e->destType->count++;
12784 ProcessExpressionType(e);
12786 exp->destType->count--;
12787 if(!exp->expType && !e->next)
12789 exp->expType = e->expType;
12791 e->expType->refCount++;
12794 exp->isConstant = 0x0;
12796 e = (*exp->list).first;
12797 if(!e->next && e->type == 8)
12799 struct Expression * next = exp->next, * prev = exp->prev;
12801 FreeType(exp->expType);
12802 FreeType(exp->destType);
12803 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12807 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12808 ProcessExpressionType(exp);
12814 struct Expression * e;
12816 exp->isConstant = 0x1;
12817 ProcessExpressionType(exp->index.exp);
12818 if(!exp->index.exp->isConstant)
12819 exp->isConstant = 0x0;
12820 if(exp->index.exp->expType)
12822 struct Type * source = exp->index.exp->expType;
12824 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)
12826 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12828 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12829 if(exp->index.index && (*exp->index.index).last)
12831 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12835 for(e = (*exp->index.index).first; e; e = e->next)
12837 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12840 FreeType(e->destType);
12841 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12843 ProcessExpressionType(e);
12848 exp->isConstant = 0x0;
12851 exp->expType = Dereference(exp->index.exp->expType);
12853 DeclareType(exp->expType, 0x0, 0x0);
12858 struct Expression * e;
12859 struct Type * functionType;
12860 struct Type * methodType = (((void *)0));
12866 PrintExpression(exp->call.exp, name);
12867 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12869 PrintExpression(exp->call.exp, name);
12872 if(exp->call.exp->type == 0)
12874 struct Expression * idExp = exp->call.exp;
12875 struct Identifier * id = idExp->identifier;
12877 if(!strcmp(id->string, "__ENDIAN_PAD"))
12879 exp->expType = ProcessTypeString("int", 0x1);
12880 if(exp->call.arguments && (*exp->call.arguments).first)
12881 ProcessExpressionType((*exp->call.arguments).first);
12884 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12886 struct Expression * a = (((void *)0));
12887 struct Expression * b = (((void *)0));
12888 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12890 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12892 a = (*exp->call.arguments).first;
12893 b = (*exp->call.arguments).last;
12897 else if((*exp->call.arguments).count == 1)
12899 a = (*exp->call.arguments).first;
12904 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12905 idExp->identifier = (((void *)0));
12906 FreeExpContents(exp);
12907 ProcessExpressionType(a);
12909 ProcessExpressionType(b);
12911 exp->list = MkList();
12912 if(a->expType && (!b || b->expType))
12914 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12918 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12919 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12920 struct Declaration * decl;
12921 char temp1[1024], temp2[1024];
12923 GetTypeSpecs(a->expType, specs);
12924 if(a && !a->isConstant && a->type != 0)
12926 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12927 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12928 tempExp1 = QMkExpId(temp1);
12929 tempExp1->expType = a->expType;
12931 a->expType->refCount++;
12932 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12934 if(b && !b->isConstant && b->type != 0)
12936 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12937 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12938 tempExp2 = QMkExpId(temp2);
12939 tempExp2->expType = b->expType;
12941 b->expType->refCount++;
12942 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12944 decl = MkDeclaration(specs, decls);
12945 if(!curCompound->compound.declarations)
12946 curCompound->compound.declarations = MkList();
12947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12951 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12953 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12955 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12956 exp->expType = a->expType;
12958 a->expType->refCount++;
12960 else if(!strcmp(id->string, "Abs"))
12962 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12963 exp->expType = a->expType;
12965 a->expType->refCount++;
12967 else if(!strcmp(id->string, "Sgn"))
12969 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"))))));
12970 exp->expType = ProcessTypeString("int", 0x0);
12972 FreeExpression(tempExp1);
12974 FreeExpression(tempExp2);
12975 FreeIdentifier(id);
12981 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12983 if(!exp->call.exp->destType)
12985 exp->call.exp->destType = dummy;
12988 ProcessExpressionType(exp->call.exp);
12989 if(exp->call.exp->destType == dummy)
12992 exp->call.exp->destType = (((void *)0));
12996 functionType = exp->call.exp->expType;
12997 if(functionType && functionType->kind == 16)
12999 methodType = functionType;
13000 functionType = methodType->method->dataType;
13001 if(exp->call.exp->expType->usedClass)
13003 char typeString[1024];
13005 typeString[0] = '\0';
13006 PrintType(functionType, typeString, 0x1, 0x1);
13007 if(strstr(typeString, "thisclass"))
13009 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13010 struct Declarator * decl;
13013 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13015 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13016 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13017 thisClassParams = 0x0;
13018 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13020 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13022 thisClass = exp->call.exp->expType->usedClass;
13023 ProcessDeclarator(decl);
13024 thisClass = backupThisClass;
13026 thisClassParams = 0x1;
13027 functionType = ProcessType(specs, decl);
13028 functionType->refCount = 0;
13029 FinishTemplatesContext(context);
13031 FreeList(specs, FreeSpecifier);
13032 FreeDeclarator(decl);
13036 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13038 struct Type * type = functionType->type;
13040 if(!functionType->refCount)
13042 functionType->type = (((void *)0));
13043 FreeType(functionType);
13045 functionType = type;
13047 if(functionType && functionType->kind != 11)
13049 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13051 else if(functionType)
13053 unsigned int emptyParams = 0x0, noParams = 0x0;
13054 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13055 struct Type * type = functionType->params.first;
13056 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13058 struct Location oldyylloc = yylloc;
13062 if(functionType->extraParam && e)
13064 e->destType = MkClassType(functionType->thisClass->string);
13067 if(!functionType->staticMethod)
13069 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13071 type = MkClassType(memberExp->member.exp->expType->_class->string);
13074 e->destType = type;
13076 type = functionType->params.first;
13079 type->refCount = 0;
13081 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13083 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13086 e->destType = type;
13088 type = functionType->params.first;
13091 type->refCount = 0;
13094 if(type && type->kind == 0)
13097 if(!type->refCount)
13099 type = (((void *)0));
13101 for(; e; e = e->next)
13103 if(!type && !emptyParams)
13106 if(methodType && methodType->methodClass)
13107 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);
13109 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);
13112 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13114 struct Type * templatedType = (((void *)0));
13115 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13116 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13119 if(_class && _class->templateArgs)
13121 struct __ecereNameSpace__ecere__com__Class * sClass;
13123 for(sClass = _class; sClass; sClass = sClass->base)
13125 if(sClass->templateClass)
13126 sClass = sClass->templateClass;
13128 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13130 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13132 struct __ecereNameSpace__ecere__com__Class * nextClass;
13134 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13136 if(nextClass->templateClass)
13137 nextClass = nextClass->templateClass;
13138 id += nextClass->templateParams.count;
13148 if(curParam && _class->templateArgs[id].dataTypeString)
13150 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13153 struct Context * context = SetupTemplatesContext(_class);
13155 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13156 FinishTemplatesContext(context);
13158 e->destType = templatedType;
13161 templatedType->passAsTemplate = 0x1;
13166 e->destType = type;
13173 e->destType = type;
13177 if(type && type->kind != 14)
13179 struct Type * next = type->next;
13181 if(!type->refCount)
13186 if(type && type->kind != 14)
13188 if(methodType && methodType->methodClass)
13189 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);
13191 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);
13193 yylloc = oldyylloc;
13194 if(type && !type->refCount)
13199 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13200 if(exp->call.exp->type == 0)
13202 char * string = exp->call.exp->identifier->string;
13206 struct Symbol * symbol;
13207 struct Location oldyylloc = yylloc;
13209 yylloc = exp->call.exp->identifier->loc;
13210 if(strstr(string, "__builtin_") == string)
13213 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13214 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));
13215 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13216 if(strstr(symbol->string, "::"))
13217 globalContext->hasNameSpace = 0x1;
13218 yylloc = oldyylloc;
13221 else if(exp->call.exp->type == 8)
13225 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13226 if(!functionType->returnType)
13228 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13231 if(functionType && functionType->kind == 11)
13233 exp->expType = functionType->returnType;
13234 if(functionType->returnType)
13235 functionType->returnType->refCount++;
13236 if(!functionType->refCount)
13237 FreeType(functionType);
13239 if(exp->call.arguments)
13241 for(e = (*exp->call.arguments).first; e; e = e->next)
13243 struct Type * destType = e->destType;
13245 ProcessExpressionType(e);
13252 struct Type * type;
13253 struct Location oldyylloc = yylloc;
13254 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13256 exp->thisPtr = thisPtr;
13257 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13259 exp->member.member->classSym = exp->member.member->_class->symbol;
13261 ProcessExpressionType(exp->member.exp);
13262 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)
13264 exp->isConstant = 0x0;
13267 exp->isConstant = exp->member.exp->isConstant;
13268 type = exp->member.exp->expType;
13270 if(type && (type->kind == 20))
13272 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13273 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13277 for(param = _class->templateParams.first; param; param = param->next)
13279 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13283 if(param && param->defaultArg.member)
13285 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13289 struct Expression * expMember = exp->member.exp;
13290 struct Declarator * decl;
13291 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13292 char thisClassTypeString[1024];
13294 FreeIdentifier(exp->member.member);
13295 ProcessExpressionType(argExp);
13297 char * colon = strstr(param->defaultArg.memberString, "::");
13301 char className[1024];
13302 struct __ecereNameSpace__ecere__com__Class * sClass;
13304 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13305 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13308 strcpy(thisClassTypeString, _class->fullName);
13310 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13311 exp->expType = ProcessType(specs, decl);
13312 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13314 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13315 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13317 int paramCount = 0;
13318 int lastParam = -1;
13319 char templateString[1024];
13320 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13322 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13323 for(cClass = expClass; cClass; cClass = cClass->base)
13327 for(param = cClass->templateParams.first; param; param = param->next)
13330 struct __ecereNameSpace__ecere__com__Class * sClass;
13331 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13333 for(sClass = cClass->base; sClass; sClass = sClass->base)
13334 id += sClass->templateParams.count;
13335 arg = expClass->templateArgs[id];
13336 for(sClass = _class; sClass; sClass = sClass->base)
13338 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13340 struct __ecereNameSpace__ecere__com__Class * nextClass;
13342 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13343 p += nextClass->templateParams.count;
13344 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13346 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13348 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13350 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13351 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13358 char argument[256];
13360 argument[0] = '\0';
13361 switch(param->type)
13365 char expString[1024];
13366 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13367 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13368 struct Expression * exp;
13369 char * string = PrintHexUInt64(arg.expression.ui64);
13371 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13372 ProcessExpressionType(exp);
13373 ComputeExpression(exp);
13374 expString[0] = '\0';
13375 PrintExpression(exp, expString);
13376 strcat(argument, expString);
13377 FreeExpression(exp);
13382 strcat(argument, arg.member->name);
13387 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13389 if(!strcmp(arg.dataTypeString, "thisclass"))
13390 strcat(argument, thisClassTypeString);
13392 strcat(argument, arg.dataTypeString);
13400 strcat(templateString, ", ");
13401 if(lastParam != p - 1)
13403 strcat(templateString, param->name);
13404 strcat(templateString, " = ");
13406 strcat(templateString, argument);
13415 int len = strlen(templateString);
13417 if(templateString[len - 1] == '>')
13418 templateString[len++] = ' ';
13419 templateString[len++] = '>';
13420 templateString[len++] = '\0';
13423 struct Context * context = SetupTemplatesContext(_class);
13425 FreeType(exp->expType);
13426 exp->expType = ProcessTypeString(templateString, 0x0);
13427 FinishTemplatesContext(context);
13431 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")))))))));
13434 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13436 type = ProcessTemplateParameterType(type->templateParameter);
13439 if(type && (type->kind == 20))
13441 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13443 struct Identifier * id = exp->member.member;
13444 int typeKind = type->kind;
13445 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));
13447 if(typeKind == 19 && exp->member.exp->type == 26)
13449 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13452 if(id && (typeKind == 3 || typeKind == 15))
13453 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13456 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13457 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13458 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13459 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13460 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13462 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13463 exp->member.memberType = 1;
13464 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13465 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13468 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13470 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13471 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13473 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13475 member = (((void *)0));
13477 if(!member && !prop)
13478 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13479 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13480 exp->member.thisPtr = 0x1;
13486 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13487 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13488 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13490 if(!prop && !member)
13492 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13495 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13496 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13497 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13502 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13503 prop = (((void *)0));
13505 member = (((void *)0));
13509 if(!prop && !member)
13510 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13511 if(!prop && !member && !method)
13515 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13518 exp->member.memberType = 5;
13519 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13523 char structName[1024];
13524 struct Identifier * id = exp->member.member;
13525 struct Expression * classExp = exp->member.exp;
13528 FreeType(classExp->expType);
13529 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13530 strcpy(structName, "__ecereClassData_");
13531 FullClassNameCat(structName, type->_class->string, 0x0);
13533 exp->member.member = id;
13534 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"))))))));
13536 ProcessExpressionType(exp);
13542 struct Symbol * classSym = FindClass(id->string);
13546 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13549 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13555 exp->member.memberType = 1;
13556 if(!prop->dataType)
13557 ProcessPropertyType(prop);
13558 exp->expType = prop->dataType;
13560 prop->dataType->refCount++;
13564 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13566 FreeExpContents(exp);
13568 exp->identifier = MkIdentifier("class");
13569 ProcessExpressionType(exp);
13572 exp->member.memberType = 3;
13573 DeclareStruct(_class->fullName, 0x0);
13574 if(!member->dataType)
13576 struct Context * context = SetupTemplatesContext(_class);
13578 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13579 FinishTemplatesContext(context);
13581 exp->expType = member->dataType;
13582 if(member->dataType)
13583 member->dataType->refCount++;
13585 else if(revConvert)
13587 exp->member.memberType = 4;
13588 exp->expType = MkClassType(revConvert->_class->fullName);
13594 exp->member.memberType = 2;
13596 if(!method->dataType)
13597 ProcessMethodType(method);
13598 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));
13599 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13600 exp->expType->usedClass = _class;
13602 else if(!classProp)
13604 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13606 FreeExpContents(exp);
13608 exp->identifier = MkIdentifier("class");
13609 ProcessExpressionType(exp);
13612 yylloc = exp->member.member->loc;
13613 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13615 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13617 if(_class && exp->expType)
13619 struct __ecereNameSpace__ecere__com__Class * tClass;
13622 while(tClass && !tClass->templateClass)
13623 tClass = tClass->base;
13624 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13627 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13628 struct __ecereNameSpace__ecere__com__Class * sClass;
13630 for(sClass = tClass; sClass; sClass = sClass->base)
13633 if(sClass->templateClass)
13634 sClass = sClass->templateClass;
13635 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13637 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13639 for(sClass = sClass->base; sClass; sClass = sClass->base)
13640 id += sClass->templateParams.count;
13648 if(curParam && tClass->templateArgs[id].dataTypeString)
13650 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13651 struct Context * context = SetupTemplatesContext(tClass);
13653 FreeType(exp->expType);
13654 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13657 if(exp->expType->kind == 21)
13659 FreeType(exp->expType);
13660 exp->expType = ReplaceThisClassType(_class);
13662 if(tClass->templateClass)
13663 exp->expType->passAsTemplate = 0x1;
13666 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13667 if(exp->destType->kind == 21)
13669 FreeType(exp->destType);
13670 exp->destType = ReplaceThisClassType(_class);
13674 FinishTemplatesContext(context);
13677 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13680 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13681 struct __ecereNameSpace__ecere__com__Class * sClass;
13683 for(sClass = tClass; sClass; sClass = sClass->base)
13686 if(sClass->templateClass)
13687 sClass = sClass->templateClass;
13688 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13690 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13692 for(sClass = sClass->base; sClass; sClass = sClass->base)
13693 id += sClass->templateParams.count;
13703 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13704 struct Context * context = SetupTemplatesContext(tClass);
13705 struct Type * basicType;
13707 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13710 if(basicType->kind == 21)
13712 FreeType(basicType);
13713 basicType = ReplaceThisClassType(_class);
13715 FreeType(exp->expType);
13716 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));
13719 exp->destType = exp->expType;
13720 exp->destType->refCount++;
13723 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13724 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13725 struct Declarator * decl;
13727 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13730 exp->destType->refCount++;
13732 exp->expType->refCount++;
13734 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13735 exp->cast.exp = newExp;
13738 FinishTemplatesContext(context);
13741 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13743 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13747 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13750 int paramCount = 0;
13751 int lastParam = -1;
13752 char templateString[1024];
13753 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13755 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13756 while(cClass != expClass)
13758 struct __ecereNameSpace__ecere__com__Class * sClass;
13760 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13763 for(param = cClass->templateParams.first; param; param = param->next)
13765 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13768 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13769 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13771 while(cClassCur != tClass && !paramCur)
13773 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13775 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13777 cClassCur = sClassCur;
13778 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13780 if(!strcmp(paramCur->name, param->name))
13787 if(paramCur && paramCur->type == 0)
13788 arg = tClass->templateArgs[cp];
13790 arg = expClass->templateArgs[p];
13792 char argument[256];
13794 argument[0] = '\0';
13795 switch(param->type)
13799 char expString[1024];
13800 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13801 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13802 struct Expression * exp;
13803 char * string = PrintHexUInt64(arg.expression.ui64);
13805 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13806 ProcessExpressionType(exp);
13807 ComputeExpression(exp);
13808 expString[0] = '\0';
13809 PrintExpression(exp, expString);
13810 strcat(argument, expString);
13811 FreeExpression(exp);
13816 strcat(argument, arg.member->name);
13821 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13822 strcat(argument, arg.dataTypeString);
13829 strcat(templateString, ", ");
13830 if(lastParam != p - 1)
13832 strcat(templateString, param->name);
13833 strcat(templateString, " = ");
13835 strcat(templateString, argument);
13844 int len = strlen(templateString);
13846 if(templateString[len - 1] == '>')
13847 templateString[len++] = ' ';
13848 templateString[len++] = '>';
13849 templateString[len++] = '\0';
13851 FreeType(exp->expType);
13853 struct Context * context = SetupTemplatesContext(tClass);
13855 exp->expType = ProcessTypeString(templateString, 0x0);
13856 FinishTemplatesContext(context);
13863 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)");
13865 else if(type && (type->kind == 9 || type->kind == 10))
13867 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13871 exp->expType = memberType;
13873 memberType->refCount++;
13878 char expString[10240];
13880 expString[0] = '\0';
13883 PrintExpression(exp, expString);
13884 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
13888 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13890 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13892 struct Identifier * id = exp->member.member;
13893 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));
13897 FreeType(exp->expType);
13898 exp->expType = ReplaceThisClassType(_class);
13902 yylloc = oldyylloc;
13907 struct Type * destType = exp->destType;
13909 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13911 exp->member.member->classSym = exp->member.member->_class->symbol;
13913 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13917 ProcessExpressionType(exp);
13924 struct Symbol * classSym = exp->_class->symbol;
13926 if(classSym && classSym->registered)
13928 if(classSym->registered->type == 5)
13933 DeclareStruct(classSym->string, 0x0);
13934 FreeSpecifier(exp->_class);
13936 FullClassNameCat(name, classSym->string, 0x0);
13937 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13941 if(classSym->registered->fixed)
13943 FreeSpecifier(exp->_class);
13944 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13949 char className[1024];
13951 strcpy(className, "__ecereClass_");
13952 FullClassNameCat(className, classSym->string, 0x1);
13953 MangleClassName(className);
13954 DeclareClass(classSym, className);
13955 FreeExpContents(exp);
13957 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13958 exp->member.member = MkIdentifier("structSize");
13962 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13967 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13969 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13970 exp->isConstant = 0x1;
13971 DeclareType(type, 0x0, 0x0);
13977 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13979 type->count = (unsigned int)1;
13980 FreeType(exp->cast.exp->destType);
13981 exp->cast.exp->destType = type;
13983 ProcessExpressionType(exp->cast.exp);
13984 type->count = (unsigned int)0;
13985 exp->expType = type;
13986 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13988 void * prev = exp->prev, * next = exp->next;
13989 struct Type * expType = exp->cast.exp->destType;
13990 struct Expression * castExp = exp->cast.exp;
13991 struct Type * destType = exp->destType;
13994 expType->refCount++;
13995 FreeType(exp->expType);
13996 FreeTypeName(exp->cast.typeName);
13998 FreeType(exp->expType);
13999 FreeType(exp->destType);
14000 exp->expType = expType;
14001 exp->destType = destType;
14002 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14008 exp->isConstant = exp->cast.exp->isConstant;
14014 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14017 exp->expType = type;
14022 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14024 ProcessExpressionType(exp->vaArg.exp);
14026 exp->expType = type;
14031 struct Expression * e;
14033 exp->isConstant = 0x1;
14034 FreeType(exp->cond.cond->destType);
14035 exp->cond.cond->destType = MkClassType("bool");
14036 exp->cond.cond->destType->truth = 0x1;
14037 ProcessExpressionType(exp->cond.cond);
14038 if(!exp->cond.cond->isConstant)
14039 exp->isConstant = 0x0;
14040 for(e = (*exp->cond.exp).first; e; e = e->next)
14044 FreeType(e->destType);
14045 e->destType = exp->destType;
14047 e->destType->refCount++;
14049 ProcessExpressionType(e);
14052 exp->expType = e->expType;
14054 e->expType->refCount++;
14057 exp->isConstant = 0x0;
14059 FreeType(exp->cond.elseExp->destType);
14060 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14061 if(exp->cond.elseExp->destType)
14062 exp->cond.elseExp->destType->refCount++;
14063 ProcessExpressionType(exp->cond.elseExp);
14064 if(!exp->cond.elseExp->isConstant)
14065 exp->isConstant = 0x0;
14070 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14072 struct Statement * last = (*exp->compound->compound.statements).last;
14074 if(last->type == 3 && last->expressions && (*last->expressions).last)
14076 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14078 exp->destType->refCount++;
14080 ProcessStatement(exp->compound);
14081 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14082 if(((struct Expression *)(*last->expressions).last)->expType)
14083 exp->expType->refCount++;
14089 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14091 if(spec && spec->type == 1)
14093 exp->expType = MkClassType(spec->name);
14094 exp->expType->kind = 19;
14095 exp->byReference = 0x1;
14099 exp->expType = MkClassType("ecere::com::Class");
14100 exp->byReference = 0x1;
14106 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14110 struct Identifier * id = exp->classData.id;
14111 char structName[1024];
14112 struct Expression * classExp;
14114 strcpy(structName, "__ecereClassData_");
14115 FullClassNameCat(structName, _class->fullName, 0x0);
14117 exp->member.member = id;
14118 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14119 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14121 classExp = MkExpIdentifier(MkIdentifier("class"));
14122 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"))))))));
14123 ProcessExpressionType(exp);
14130 struct Type * type = (((void *)0));
14131 char * typeString = (((void *)0));
14132 char typeStringBuf[1024];
14134 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))
14136 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14138 typeString = templateClass->templateArgs[2].dataTypeString;
14142 struct Expression * e;
14144 for(e = (*exp->list).first; e; e = e->next)
14146 ProcessExpressionType(e);
14156 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14160 e->expType = (((void *)0));
14161 e = (*exp->list).first;
14162 ProcessExpressionType(e);
14165 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14167 FreeType(e->expType);
14168 e->expType = (((void *)0));
14170 type = (((void *)0));
14178 FreeType(e->expType);
14179 e->expType = (((void *)0));
14185 typeStringBuf[0] = '\0';
14186 PrintType(type, typeStringBuf, 0x0, 0x1);
14187 typeString = typeStringBuf;
14189 type = (((void *)0));
14194 char templateString[1024];
14195 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14196 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14197 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14198 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14200 struct Expression * e;
14201 struct Expression * expExt;
14202 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14203 struct Context * context = PushContext();
14205 sprintf(templateString, "Container<%s>", typeString);
14206 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14207 sprintf(count, "%d", (*exp->list).count);
14208 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14209 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14210 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14211 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14214 type = ProcessTypeString(typeString, 0x0);
14215 while(e = (*exp->list).first)
14217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14218 e->destType = type;
14220 ProcessExpressionType(e);
14221 ListAdd(initializers, MkInitializerAssignment(e));
14224 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14226 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14227 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14228 exp->expType = ProcessTypeString(templateString, 0x0);
14230 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14231 expExt->compound->compound.context = context;
14232 PopContext(context);
14233 ProcessExpressionType(expExt);
14237 exp->expType = ProcessTypeString("Container", 0x0);
14238 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14243 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14245 FreeType(exp->expType);
14246 exp->expType = ReplaceThisClassType(thisClass);
14248 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14250 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14254 if(exp->expType->kind != 15)
14256 struct Type * member;
14257 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14259 FreeType(exp->expType);
14260 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14261 exp->expType->kind = symbol->type->kind;
14262 exp->expType->refCount++;
14263 exp->expType->enumName = enumName;
14264 exp->expType->members = symbol->type->members;
14265 for(member = symbol->type->members.first; member; member = member->next)
14266 member->refCount++;
14270 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14272 for(member = symbol->type->members.first; member; member = member->next)
14274 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14282 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14284 else if(exp->destType && !exp->destType->keepCast)
14286 if(!CheckExpressionType(exp, exp->destType, 0x0))
14288 if(!exp->destType->count || unresolved)
14293 if(exp->destType->kind != 14)
14300 char expString[10240];
14302 expString[0] = '\0';
14303 PrintType(exp->destType, type2, 0x0, 0x1);
14306 PrintExpression(exp, expString);
14307 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14310 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14311 else if(exp->type != 16)
14312 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14317 char expString[10240];
14319 expString[0] = '\0';
14322 PrintExpression(exp, expString);
14323 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14327 else if(exp->type != 16)
14328 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14340 PrintType(exp->expType, type1, 0x0, 0x1);
14341 PrintType(exp->destType, type2, 0x0, 0x1);
14343 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)))
14347 char expString[10240];
14349 expString[0] = '\0';
14352 PrintExpression(exp, expString);
14353 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14355 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14356 FreeType(exp->expType);
14357 exp->destType->refCount++;
14358 exp->expType = exp->destType;
14363 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14365 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14366 char typeString[1024];
14367 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14368 struct Declarator * decl;
14370 typeString[0] = '\0';
14373 exp->expType->refCount++;
14375 exp->expType->refCount++;
14377 newExp->destType = exp->expType;
14378 PrintType(exp->expType, typeString, 0x0, 0x0);
14379 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14380 exp->cast.typeName = MkTypeName(specs, decl);
14381 exp->cast.exp = newExp;
14384 else if(unresolved)
14386 if(exp->identifier->_class && exp->identifier->_class->name)
14387 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14388 else if(exp->identifier->string && exp->identifier->string[0])
14389 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14391 else if(!exp->expType && exp->type != 16)
14393 char expString[10240];
14395 expString[0] = '\0';
14398 PrintExpression(exp, expString);
14399 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14401 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14403 ApplyAnyObjectLogic(exp);
14404 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14406 exp->byReference = 0x1;
14408 yylloc = oldyylloc;
14411 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)
14415 *curMember = (*curMember)->next;
14416 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14418 *curMember = subMemberStack[--(*subMemberStackPos)];
14419 *curMember = (*curMember)->next;
14421 while((*curMember) && (*curMember)->isProperty)
14422 *curMember = (*curMember)->next;
14423 if(subMemberStackPos)
14425 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14427 subMemberStack[(*subMemberStackPos)++] = *curMember;
14428 *curMember = (*curMember)->members.first;
14429 while(*curMember && (*curMember)->isProperty)
14430 *curMember = (*curMember)->next;
14438 if(subMemberStackPos && *subMemberStackPos)
14440 *curMember = subMemberStack[--(*subMemberStackPos)];
14441 *curMember = (*curMember)->next;
14445 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14447 if(*curClass == _class)
14449 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14451 *curMember = (*curClass)->membersAndProperties.first;
14453 while((*curMember) && (*curMember)->isProperty)
14454 *curMember = (*curMember)->next;
14455 if(subMemberStackPos)
14457 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14459 subMemberStack[(*subMemberStackPos)++] = *curMember;
14460 *curMember = (*curMember)->members.first;
14461 while(*curMember && (*curMember)->isProperty)
14462 *curMember = (*curMember)->next;
14469 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14474 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14476 if(init->exp && !init->exp->destType)
14478 FreeType(init->exp->destType);
14479 init->exp->destType = type;
14485 ProcessExpressionType(init->exp);
14486 init->isConstant = init->exp->isConstant;
14492 struct Expression * exp = init->exp;
14493 struct Instantiation * inst = exp->instance;
14494 struct MembersInit * members;
14497 init->list = MkList();
14500 for(members = (*inst->members).first; members; members = members->next)
14502 if(members->type == 0)
14504 struct MemberInit * member;
14506 for(member = (*members->dataMembers).first; member; member = member->next)
14508 ListAdd(init->list, member->initializer);
14509 member->initializer = (((void *)0));
14514 FreeExpression(exp);
14518 struct Initializer * i;
14519 struct Type * initializerType = (((void *)0));
14520 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14521 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14522 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14523 int subMemberStackPos = 0;
14525 if(type && type->kind == 12)
14526 initializerType = Dereference(type);
14527 else if(type && (type->kind == 9 || type->kind == 10))
14528 initializerType = type->members.first;
14529 for(i = (*init->list).first; i; i = i->next)
14531 if(type && type->kind == 8 && type->_class && type->_class->registered)
14533 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14536 if(!curMember->dataType)
14537 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14538 initializerType = curMember->dataType;
14541 ProcessInitializer(i, initializerType);
14542 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14543 initializerType = initializerType->next;
14545 init->isConstant = 0x0;
14547 if(type && type->kind == 12)
14548 FreeType(initializerType);
14549 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14551 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14558 extern struct Symbol * FindType(struct Context * ctx, char * name);
14560 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14562 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14568 if(spec->specifier == THISCLASS)
14573 spec->name = ReplaceThisClass(thisClass);
14574 spec->symbol = FindClass(spec->name);
14575 ProcessSpecifier(spec, declareStruct);
14582 struct Symbol * symbol = FindType(curContext, spec->name);
14585 DeclareType(symbol->type, 0x1, 0x1);
14586 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14587 DeclareStruct(spec->name, 0x0);
14592 struct Enumerator * e;
14596 for(e = (*spec->list).first; e; e = e->next)
14599 ProcessExpressionType(e->exp);
14607 if(spec->definitions)
14609 struct ClassDef * def;
14610 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14612 ProcessClass(spec->definitions, symbol);
14619 static void ProcessDeclarator(struct Declarator * decl)
14624 if(decl->identifier->classSym)
14626 FreeSpecifier(decl->identifier->_class);
14627 decl->identifier->_class = (((void *)0));
14631 if(decl->array.exp)
14632 ProcessExpressionType(decl->array.exp);
14639 if(decl->declarator)
14640 ProcessDeclarator(decl->declarator);
14641 if(decl->type == 4)
14643 struct Identifier * id = GetDeclId(decl);
14645 if(id && id->_class)
14647 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14649 if(!decl->function.parameters)
14650 decl->function.parameters = MkList();
14651 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14652 id->_class = (((void *)0));
14654 if(decl->function.parameters)
14656 struct TypeName * param;
14658 for(param = (*decl->function.parameters).first; param; param = param->next)
14660 if(param->qualifiers && (*param->qualifiers).first)
14662 struct Specifier * spec = (*param->qualifiers).first;
14664 if(spec && spec->specifier == TYPED_OBJECT)
14666 struct Declarator * d = param->declarator;
14667 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);
14669 FreeList(param->qualifiers, FreeSpecifier);
14670 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14671 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14672 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14675 else if(spec && spec->specifier == ANY_OBJECT)
14677 struct Declarator * d = param->declarator;
14679 FreeList(param->qualifiers, FreeSpecifier);
14680 param->qualifiers = MkListOne(MkSpecifier(VOID));
14681 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14683 else if(spec->specifier == THISCLASS)
14688 spec->name = ReplaceThisClass(thisClass);
14689 spec->symbol = FindClass(spec->name);
14690 ProcessSpecifier(spec, 0x0);
14694 if(param->declarator)
14695 ProcessDeclarator(param->declarator);
14703 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14705 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14707 static void ProcessDeclaration(struct Declaration * decl)
14709 yylloc = decl->loc;
14714 unsigned int declareStruct = 0x0;
14716 if(decl->declarators)
14718 struct InitDeclarator * d;
14720 for(d = (*decl->declarators).first; d; d = d->next)
14722 struct Type * type, * subType;
14724 ProcessDeclarator(d->declarator);
14725 type = ProcessType(decl->specifiers, d->declarator);
14728 ProcessInitializer(d->initializer, type);
14729 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14731 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14733 struct Instantiation * inst = d->initializer->exp->instance;
14735 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14736 d->initializer->exp->instance = (((void *)0));
14737 if(decl->specifiers)
14738 FreeList(decl->specifiers, FreeSpecifier);
14739 FreeList(decl->declarators, FreeInitDeclarator);
14746 for(subType = type; subType; )
14748 if(subType->kind == 8)
14750 declareStruct = 0x1;
14753 else if(subType->kind == 13)
14755 else if(subType->kind == 12)
14756 subType = subType->arrayType;
14765 if(decl->specifiers)
14767 struct Specifier * s;
14769 for(s = (*decl->specifiers).first; s; s = s->next)
14771 ProcessSpecifier(s, declareStruct);
14778 ProcessInstantiationType(decl->inst);
14783 struct Specifier * spec;
14784 struct Declarator * d;
14785 unsigned int declareStruct = 0x0;
14787 if(decl->declarators)
14789 for(d = (*decl->declarators).first; d; d = d->next)
14791 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14792 struct Type * subType;
14794 ProcessDeclarator(d);
14795 for(subType = type; subType; )
14797 if(subType->kind == 8)
14799 declareStruct = 0x1;
14802 else if(subType->kind == 13)
14804 else if(subType->kind == 12)
14805 subType = subType->arrayType;
14812 if(decl->specifiers)
14814 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14815 ProcessSpecifier(spec, declareStruct);
14822 static struct FunctionDefinition * curFunction;
14824 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14826 char propName[1024], propNameM[1024];
14827 char getName[1024], setName[1024];
14828 struct __ecereNameSpace__ecere__sys__OldList * args;
14830 DeclareProperty(prop, setName, getName);
14831 strcpy(propName, "__ecereProp_");
14832 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14833 strcat(propName, "_");
14834 FullClassNameCat(propName, prop->name, 0x1);
14835 MangleClassName(propName);
14836 strcpy(propNameM, "__ecerePropM_");
14837 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14838 strcat(propNameM, "_");
14839 FullClassNameCat(propNameM, prop->name, 0x1);
14840 MangleClassName(propNameM);
14841 if(prop->isWatchable)
14844 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14845 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14846 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14848 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14849 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14850 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14854 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14855 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14856 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14858 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14859 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14860 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14862 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14863 curFunction->propSet->fireWatchersDone = 0x1;
14866 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14868 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14870 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14872 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14874 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14876 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14878 static void ProcessStatement(struct Statement * stmt)
14880 yylloc = stmt->loc;
14884 ProcessStatement(stmt->labeled.stmt);
14887 if(stmt->caseStmt.exp)
14889 FreeType(stmt->caseStmt.exp->destType);
14890 stmt->caseStmt.exp->destType = curSwitchType;
14892 curSwitchType->refCount++;
14893 ProcessExpressionType(stmt->caseStmt.exp);
14894 ComputeExpression(stmt->caseStmt.exp);
14896 if(stmt->caseStmt.stmt)
14897 ProcessStatement(stmt->caseStmt.stmt);
14901 if(stmt->compound.context)
14903 struct Declaration * decl;
14904 struct Statement * s;
14905 struct Statement * prevCompound = curCompound;
14906 struct Context * prevContext = curContext;
14908 if(!stmt->compound.isSwitch)
14910 curCompound = stmt;
14911 curContext = stmt->compound.context;
14913 if(stmt->compound.declarations)
14915 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14916 ProcessDeclaration(decl);
14918 if(stmt->compound.statements)
14920 for(s = (*stmt->compound.statements).first; s; s = s->next)
14921 ProcessStatement(s);
14923 curContext = prevContext;
14924 curCompound = prevCompound;
14930 struct Expression * exp;
14932 if(stmt->expressions)
14934 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14935 ProcessExpressionType(exp);
14941 struct Expression * exp;
14943 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14944 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14945 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14946 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14948 ProcessExpressionType(exp);
14950 if(stmt->ifStmt.stmt)
14951 ProcessStatement(stmt->ifStmt.stmt);
14952 if(stmt->ifStmt.elseStmt)
14953 ProcessStatement(stmt->ifStmt.elseStmt);
14958 struct Type * oldSwitchType = curSwitchType;
14960 if(stmt->switchStmt.exp)
14962 struct Expression * exp;
14964 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14968 ProcessExpressionType(exp);
14971 curSwitchType = exp->expType;
14974 ProcessStatement(stmt->switchStmt.stmt);
14975 curSwitchType = oldSwitchType;
14980 if(stmt->whileStmt.exp)
14982 struct Expression * exp;
14984 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14985 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14986 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14987 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14989 ProcessExpressionType(exp);
14992 if(stmt->whileStmt.stmt)
14993 ProcessStatement(stmt->whileStmt.stmt);
14998 if(stmt->doWhile.exp)
15000 struct Expression * exp;
15002 if((*stmt->doWhile.exp).last)
15004 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15005 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15006 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15008 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15010 ProcessExpressionType(exp);
15013 if(stmt->doWhile.stmt)
15014 ProcessStatement(stmt->doWhile.stmt);
15019 struct Expression * exp;
15021 if(stmt->forStmt.init)
15022 ProcessStatement(stmt->forStmt.init);
15023 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15025 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15026 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15027 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15029 if(stmt->forStmt.check)
15030 ProcessStatement(stmt->forStmt.check);
15031 if(stmt->forStmt.increment)
15033 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15034 ProcessExpressionType(exp);
15036 if(stmt->forStmt.stmt)
15037 ProcessStatement(stmt->forStmt.stmt);
15042 struct Identifier * id = stmt->forEachStmt.id;
15043 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15044 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15045 struct Statement * block = stmt->forEachStmt.stmt;
15046 char iteratorType[1024];
15047 struct Type * source;
15048 struct Expression * e;
15049 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));
15050 struct Expression * arrayExp;
15051 char * typeString = (((void *)0));
15052 int builtinCount = 0;
15054 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15058 FreeType(e->destType);
15059 e->destType = ProcessTypeString("Container", 0x0);
15061 if(!isBuiltin || e->next)
15062 ProcessExpressionType(e);
15064 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15065 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15067 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15068 struct Symbol * symbol;
15069 struct Expression * expIt = (((void *)0));
15070 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15071 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15072 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15073 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15076 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15077 stmt->compound.context->parent = curContext;
15078 curContext = stmt->compound.context;
15079 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15081 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15082 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15084 isCustomAVLTree = 0x1;
15085 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15087 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15090 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15092 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15094 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15097 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15101 struct Declarator * decl;
15102 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15104 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15105 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15106 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15110 struct Type * type = (((void *)0));
15111 char typeStringBuf[1024];
15113 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15114 if(((struct Expression *)(*exp).last)->type == 11)
15116 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15119 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15121 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)
15123 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15125 typeString = templateClass->templateArgs[2].dataTypeString;
15127 else if(arrayExp->list)
15129 struct Expression * e;
15131 for(e = (*arrayExp->list).first; e; e = e->next)
15133 ProcessExpressionType(e);
15143 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15147 e->expType = (((void *)0));
15148 e = (*arrayExp->list).first;
15149 ProcessExpressionType(e);
15152 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15154 FreeType(e->expType);
15155 e->expType = (((void *)0));
15157 type = (((void *)0));
15165 FreeType(e->expType);
15166 e->expType = (((void *)0));
15172 typeStringBuf[0] = '\0';
15173 PrintType(type, typeStringBuf, 0x0, 0x1);
15174 typeString = typeStringBuf;
15180 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15181 struct Declarator * decl;
15182 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15186 struct Expression * e;
15188 builtinCount = (*arrayExp->list).count;
15189 type = ProcessTypeString(typeString, 0x0);
15190 while(e = (*arrayExp->list).first)
15192 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15193 e->destType = type;
15195 ProcessExpressionType(e);
15196 ListAdd(initializers, MkInitializerAssignment(e));
15199 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15201 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15202 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15203 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15204 FreeList(exp, FreeExpression);
15208 arrayExp->expType = ProcessTypeString("Container", 0x0);
15209 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15212 else if(isLinkList && !isList)
15214 struct Declarator * decl;
15215 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15217 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15218 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15219 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15221 else if(_class->templateArgs)
15224 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15226 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15227 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15229 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15230 if(block && block->type == 2 && block->compound.context)
15232 block->compound.context->parent = stmt->compound.context;
15236 block = MkIfStmt(filter, block, (((void *)0)));
15240 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));
15241 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15242 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15243 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15249 sprintf(count, "%d", builtinCount);
15250 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));
15251 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15252 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15253 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15255 else if(isLinkList && !isList)
15257 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15258 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15260 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15262 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));
15266 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15267 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15269 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));
15271 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15272 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15273 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15277 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15279 ProcessExpressionType(expIt);
15280 if((*stmt->compound.declarations).first)
15281 ProcessDeclaration((*stmt->compound.declarations).first);
15283 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15284 ProcessStatement(stmt);
15285 curContext = stmt->compound.context->parent;
15290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15302 struct Expression * exp;
15304 if(stmt->expressions)
15306 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15310 if(curFunction && !curFunction->type)
15311 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15312 FreeType(exp->destType);
15313 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15315 exp->destType->refCount++;
15317 ProcessExpressionType(exp);
15324 ProcessDeclaration(stmt->decl);
15329 struct AsmField * field;
15331 if(stmt->asmStmt.inputFields)
15333 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15334 if(field->expression)
15335 ProcessExpressionType(field->expression);
15337 if(stmt->asmStmt.outputFields)
15339 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15340 if(field->expression)
15341 ProcessExpressionType(field->expression);
15343 if(stmt->asmStmt.clobberedFields)
15345 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15347 if(field->expression)
15348 ProcessExpressionType(field->expression);
15355 struct PropertyWatch * propWatch;
15356 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15357 struct Expression * object = stmt->_watch.object;
15358 struct Expression * watcher = stmt->_watch.watcher;
15361 ProcessExpressionType(watcher);
15363 ProcessExpressionType(object);
15366 if(watcher || thisClass)
15368 struct External * external = curExternal;
15369 struct Context * context = curContext;
15372 stmt->expressions = MkList();
15373 curExternal = external->prev;
15374 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15376 struct ClassFunction * func;
15377 char watcherName[1024];
15378 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15379 struct External * createdExternal;
15380 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15382 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15383 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15384 if(propWatch->deleteWatch)
15385 strcat(watcherName, "_delete");
15388 struct Identifier * propID;
15390 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15392 strcat(watcherName, "_");
15393 strcat(watcherName, propID->string);
15396 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15398 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15399 ProcessClassFunctionBody(func, propWatch->compound);
15400 propWatch->compound = (((void *)0));
15401 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15402 createdExternal->symbol->idCode = external->symbol->idCode;
15403 curExternal = createdExternal;
15404 ProcessFunction(createdExternal->function);
15406 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15408 externalDecl->declaration = decl;
15409 if(decl->symbol && !decl->symbol->pointerExternal)
15410 decl->symbol->pointerExternal = externalDecl;
15412 if(propWatch->deleteWatch)
15414 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15416 ListAdd(args, CopyExpression(object));
15417 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15418 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15419 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15423 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15424 struct Identifier * propID;
15426 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15428 char propName[1024];
15429 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15433 char getName[1024], setName[1024];
15434 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15436 DeclareProperty(prop, setName, getName);
15437 strcpy(propName, "__ecereProp_");
15438 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15439 strcat(propName, "_");
15440 FullClassNameCat(propName, prop->name, 0x1);
15441 ListAdd(args, CopyExpression(object));
15442 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15443 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15444 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15445 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15448 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15453 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15455 curExternal = external;
15456 curContext = context;
15458 FreeExpression(watcher);
15460 FreeExpression(object);
15461 FreeList(watches, FreePropertyWatch);
15464 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15468 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15470 ProcessStatement(propWatch->compound);
15477 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15478 struct Expression * object = stmt->_watch.object;
15479 struct __ecereNameSpace__ecere__com__Class * _class;
15482 ProcessExpressionType(object);
15485 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15488 struct Identifier * propID;
15491 stmt->expressions = MkList();
15492 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15494 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15501 for(propID = (*watches).first; propID; propID = propID->next)
15503 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15507 CreateFireWatcher(prop, object, stmt);
15510 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15515 struct __ecereNameSpace__ecere__com__Property * prop;
15516 struct __ecereNameSpace__ecere__com__Class * base;
15518 for(base = _class; base; base = base->base)
15520 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15522 if(prop->isProperty && prop->isWatchable)
15524 CreateFireWatcher(prop, object, stmt);
15530 FreeExpression(object);
15531 FreeList(watches, FreeIdentifier);
15534 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15540 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15541 struct Expression * object = stmt->_watch.object;
15542 struct Expression * watcher = stmt->_watch.watcher;
15543 struct __ecereNameSpace__ecere__com__Class * _class;
15546 ProcessExpressionType(object);
15548 ProcessExpressionType(watcher);
15551 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15552 if(watcher || thisClass)
15556 struct Identifier * propID;
15559 stmt->expressions = MkList();
15562 struct __ecereNameSpace__ecere__sys__OldList * args;
15565 ListAdd(args, CopyExpression(object));
15566 ListAdd(args, MkExpConstant("0"));
15567 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15568 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15572 for(propID = (*watches).first; propID; propID = propID->next)
15574 char propName[1024];
15575 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15579 char getName[1024], setName[1024];
15580 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15582 DeclareProperty(prop, setName, getName);
15583 strcpy(propName, "__ecereProp_");
15584 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15585 strcat(propName, "_");
15586 FullClassNameCat(propName, prop->name, 0x1);
15587 MangleClassName(propName);
15588 ListAdd(args, CopyExpression(object));
15589 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15590 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15591 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15594 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15598 FreeExpression(object);
15600 FreeExpression(watcher);
15601 FreeList(watches, FreeIdentifier);
15604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15607 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15614 extern struct Expression * QBrackets(struct Expression * exp);
15616 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15618 extern struct Declarator * QMkPtrDecl(char * id);
15620 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15622 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15624 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15626 static void ProcessFunction(struct FunctionDefinition * function)
15628 void * __ecereTemp2;
15629 void * __ecereTemp1;
15630 struct Identifier * id = GetDeclId(function->declarator);
15631 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15632 struct Type * type = symbol ? symbol->type : (((void *)0));
15633 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15634 struct Context * oldTopContext = topContext;
15636 yylloc = function->loc;
15637 if(type && type->thisClass)
15639 struct Symbol * classSym = type->thisClass;
15640 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15641 char className[1024];
15642 char structName[1024];
15643 struct Declarator * funcDecl;
15644 struct Symbol * thisSymbol;
15645 unsigned int typedObject = 0x0;
15647 if(_class && !_class->base)
15649 _class = currentClass;
15650 if(_class && !_class->symbol)
15651 _class->symbol = FindClass(_class->fullName);
15652 classSym = _class ? _class->symbol : (((void *)0));
15655 thisClass = _class;
15656 if(inCompiler && _class)
15658 if(type->kind == 11)
15660 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15662 struct Type * param = symbol->type->params.first;
15664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15667 if(type->classObjectType != 1)
15669 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15670 symbol->type->staticMethod = 0x1;
15671 symbol->type->thisClass = (((void *)0));
15672 symbol->type->extraParam = 0x0;
15675 strcpy(className, "__ecereClass_");
15676 FullClassNameCat(className, _class->fullName, 0x1);
15677 MangleClassName(className);
15678 structName[0] = (char)0;
15679 FullClassNameCat(structName, _class->fullName, 0x0);
15680 funcDecl = GetFuncDecl(function->declarator);
15683 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15685 struct TypeName * param = (*funcDecl->function.parameters).first;
15687 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15690 FreeTypeName(param);
15693 if(!function->propertyNoThis)
15695 struct TypeName * thisParam;
15697 if(type->classObjectType != 1)
15699 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15700 if(!funcDecl->function.parameters)
15701 funcDecl->function.parameters = MkList();
15702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15706 if(type->classObjectType != 1)
15708 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15709 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15711 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));
15712 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15716 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15718 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15720 funcDecl = GetFuncDecl(initDecl->declarator);
15723 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15725 struct TypeName * param = (*funcDecl->function.parameters).first;
15727 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
15729 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15730 FreeTypeName(param);
15733 if(type->classObjectType != 1)
15735 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15737 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15739 if(!funcDecl->function.parameters)
15740 funcDecl->function.parameters = MkList();
15741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15749 if(type->classObjectType != 1)
15751 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));
15752 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15753 if(typedObject && thisSymbol->type)
15755 thisSymbol->type->classObjectType = 2;
15756 thisSymbol->type->byReference = type->byReference;
15760 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15762 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15765 struct __ecereNameSpace__ecere__com__Class * base;
15767 for(base = _class; base && base->type != 1000; base = base->next)
15769 for(member = base->membersAndProperties.first; member; member = member->next)
15770 if(!member->isProperty)
15776 for(member = _class->membersAndProperties.first; member; member = member->next)
15777 if(!member->isProperty)
15781 char pointerName[1024];
15782 struct Declaration * decl;
15783 struct Initializer * initializer;
15784 struct Expression * exp, * bytePtr;
15786 strcpy(pointerName, "__ecerePointer_");
15787 FullClassNameCat(pointerName, _class->fullName, 0x0);
15789 char className[1024];
15791 strcpy(className, "__ecereClass_");
15792 FullClassNameCat(className, classSym->string, 0x1);
15793 MangleClassName(className);
15794 DeclareClass(classSym, className);
15796 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15801 sprintf(string, "%d", _class->offset);
15802 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15806 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15808 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15809 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));
15812 yylloc = function->body->loc;
15813 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15815 struct Context * prevContext = curContext;
15817 curContext = function->body->compound.context;
15818 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15819 curContext = prevContext;
15821 decl->symbol = (((void *)0));
15822 if(!function->body->compound.declarations)
15823 function->body->compound.declarations = MkList();
15824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15830 thisClass = (((void *)0));
15833 FreeSpecifier(id->_class);
15834 id->_class = (((void *)0));
15835 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15837 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15839 id = GetDeclId(initDecl->declarator);
15840 FreeSpecifier(id->_class);
15841 id->_class = (((void *)0));
15845 topContext = function->body->compound.context;
15847 struct FunctionDefinition * oldFunction = curFunction;
15849 curFunction = function;
15851 ProcessStatement(function->body);
15852 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15854 struct Statement * prevCompound = curCompound;
15855 struct Context * prevContext = curContext;
15856 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15858 if(!function->body->compound.statements)
15859 function->body->compound.statements = MkList();
15860 ListAdd(function->body->compound.statements, fireWatchers);
15861 curCompound = function->body;
15862 curContext = function->body->compound.context;
15863 ProcessStatement(fireWatchers);
15864 curContext = prevContext;
15865 curCompound = prevCompound;
15867 curFunction = oldFunction;
15869 if(function->declarator)
15871 ProcessDeclarator(function->declarator);
15873 topContext = oldTopContext;
15874 thisClass = oldThisClass;
15877 extern void FreeSymbol(struct Symbol * symbol);
15879 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15881 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15883 struct ClassDef * def;
15884 struct External * external = curExternal;
15885 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15887 for(def = definitions->first; def; def = def->next)
15891 if(def->function->declarator)
15892 curExternal = def->function->declarator->symbol->pointerExternal;
15894 curExternal = external;
15895 ProcessFunction((struct FunctionDefinition *)def->function);
15897 else if(def->type == 2)
15899 if(def->decl->type == 2)
15901 thisClass = regClass;
15902 ProcessInstantiationType(def->decl->inst);
15903 thisClass = (((void *)0));
15907 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15910 thisClass = regClass;
15911 ProcessDeclaration(def->decl);
15912 thisClass = backThisClass;
15915 else if(def->type == 1 && def->defProperties)
15917 struct MemberInit * defProperty;
15918 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);
15920 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15921 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15923 thisClass = regClass;
15924 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15925 thisClass = (((void *)0));
15927 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15928 FreeSymbol(thisSymbol);
15930 else if(def->type == 3 && def->propertyDef)
15932 struct PropertyDef * prop = def->propertyDef;
15934 thisClass = regClass;
15939 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15943 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15944 ProcessStatement(prop->setStmt);
15950 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15952 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15954 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15955 ProcessStatement(prop->getStmt);
15957 if(prop->issetStmt)
15961 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15963 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15965 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15966 ProcessStatement(prop->issetStmt);
15968 thisClass = (((void *)0));
15970 else if(def->type == 4 && def->propertyWatch)
15972 struct PropertyWatch * propertyWatch = def->propertyWatch;
15974 thisClass = regClass;
15975 if(propertyWatch->compound)
15977 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
15979 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15980 curExternal = (((void *)0));
15981 ProcessStatement(propertyWatch->compound);
15983 thisClass = (((void *)0));
15988 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15990 void ComputeDataTypes()
15992 void * __ecereTemp1;
15993 struct External * external;
15994 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15996 currentClass = (((void *)0));
15997 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15998 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15999 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16000 curExternal = temp;
16001 DeclareStruct("ecere::com::Class", 0x0);
16002 DeclareStruct("ecere::com::Instance", 0x0);
16003 DeclareStruct("ecere::com::Property", 0x0);
16004 DeclareStruct("ecere::com::DataMember", 0x0);
16005 DeclareStruct("ecere::com::Method", 0x0);
16006 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16007 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16009 for(external = (*ast).first; external; external = external->next)
16011 afterExternal = curExternal = external;
16012 if(external->type == 0)
16014 currentClass = external->function->_class;
16015 ProcessFunction(external->function);
16017 else if(external->type == 1)
16019 currentClass = (((void *)0));
16020 ProcessDeclaration(external->declaration);
16022 else if(external->type == 2)
16024 struct ClassDefinition * _class = external->_class;
16026 currentClass = external->symbol->registered;
16027 if(_class->definitions)
16029 ProcessClass(_class->definitions, _class->symbol);
16033 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16034 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16037 else if(external->type == 4)
16039 thisNameSpace = external->id->string;
16042 currentClass = (((void *)0));
16043 thisNameSpace = (((void *)0));
16044 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16045 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16048 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);
16050 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);
16052 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16054 struct __ecereNameSpace__ecere__com__Class * class;
16056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16089 __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);
16090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16093 __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);
16094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16104 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16105 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16106 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16107 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16108 __ecereClass_Conversion = class;
16109 __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);
16110 __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);
16111 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16112 __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);
16113 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16114 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16115 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16116 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16117 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16118 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16119 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16120 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16121 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16122 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16123 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16124 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16125 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16126 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16127 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16128 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16131 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)