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;
149 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
153 struct Instantiation * prev;
154 struct Instantiation * next;
156 struct Specifier * _class;
157 struct Expression * exp;
158 struct __ecereNameSpace__ecere__sys__OldList * members;
159 struct Symbol * symbol;
160 unsigned int fullSet;
161 unsigned int isConstant;
162 unsigned char * data;
163 struct Location nameLoc;
164 struct Location insideLoc;
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
172 struct Declaration * prev;
173 struct Declaration * next;
180 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
181 struct __ecereNameSpace__ecere__sys__OldList * declarators;
183 struct Instantiation * inst;
186 struct Identifier * id;
187 struct Expression * exp;
190 struct Specifier * extStorage;
191 struct Symbol * symbol;
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
199 struct Statement * prev;
200 struct Statement * next;
205 struct __ecereNameSpace__ecere__sys__OldList * expressions;
208 struct Identifier * id;
209 struct Statement * stmt;
213 struct Expression * exp;
214 struct Statement * stmt;
218 struct __ecereNameSpace__ecere__sys__OldList * declarations;
219 struct __ecereNameSpace__ecere__sys__OldList * statements;
220 struct Context * context;
221 unsigned int isSwitch;
225 struct __ecereNameSpace__ecere__sys__OldList * exp;
226 struct Statement * stmt;
227 struct Statement * elseStmt;
231 struct __ecereNameSpace__ecere__sys__OldList * exp;
232 struct Statement * stmt;
236 struct __ecereNameSpace__ecere__sys__OldList * exp;
237 struct Statement * stmt;
241 struct __ecereNameSpace__ecere__sys__OldList * exp;
242 struct Statement * stmt;
246 struct Statement * init;
247 struct Statement * check;
248 struct __ecereNameSpace__ecere__sys__OldList * increment;
249 struct Statement * stmt;
253 struct Identifier * id;
257 struct Specifier * spec;
259 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
260 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
261 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
265 struct Expression * watcher;
266 struct Expression * object;
267 struct __ecereNameSpace__ecere__sys__OldList * watches;
271 struct Identifier * id;
272 struct __ecereNameSpace__ecere__sys__OldList * exp;
273 struct __ecereNameSpace__ecere__sys__OldList * filter;
274 struct Statement * stmt;
276 struct Declaration * decl;
280 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
284 struct TypeName * prev;
285 struct TypeName * next;
287 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
288 struct Declarator * declarator;
290 struct Expression * bitCount;
293 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
297 struct Initializer * prev;
298 struct Initializer * next;
303 struct Expression * exp;
304 struct __ecereNameSpace__ecere__sys__OldList * list;
306 unsigned int isConstant;
309 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
311 struct __ecereNameSpace__ecere__com__DataValue
329 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
333 struct Expression * prev;
334 struct Expression * next;
342 struct Identifier * identifier;
344 struct Statement * compound;
345 struct Instantiation * instance;
347 struct __ecereNameSpace__ecere__sys__OldList * list;
350 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
351 struct Declarator * decl;
355 struct Identifier * id;
359 struct Expression * exp;
360 struct __ecereNameSpace__ecere__sys__OldList * arguments;
361 struct Location argLoc;
365 struct Expression * exp;
366 struct __ecereNameSpace__ecere__sys__OldList * index;
370 struct Expression * exp;
371 struct Identifier * member;
373 unsigned int thisPtr;
378 struct Expression * exp1;
379 struct Expression * exp2;
381 struct TypeName * typeName;
382 struct Specifier * _class;
385 struct TypeName * typeName;
386 struct Expression * exp;
390 struct Expression * cond;
391 struct __ecereNameSpace__ecere__sys__OldList * exp;
392 struct Expression * elseExp;
396 struct TypeName * typeName;
397 struct Expression * size;
401 struct TypeName * typeName;
402 struct Expression * size;
403 struct Expression * exp;
408 struct Identifier * id;
412 struct Expression * ds;
413 struct Expression * name;
417 struct TypeName * typeName;
418 struct Initializer * initializer;
422 struct Expression * exp;
423 struct TypeName * typeName;
426 unsigned int debugValue;
427 struct __ecereNameSpace__ecere__com__DataValue val;
428 unsigned int address;
429 unsigned int hasAddress;
430 struct Type * expType;
431 struct Type * destType;
434 unsigned int byReference;
435 unsigned int isConstant;
436 unsigned int addedThis;
437 unsigned int needCast;
438 unsigned int thisPtr;
441 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
443 struct TemplateDatatype
445 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
446 struct Declarator * decl;
449 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
451 struct TemplateArgument;
453 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
455 struct TemplateParameter
457 struct TemplateParameter * prev;
458 struct TemplateParameter * next;
461 struct Identifier * identifier;
464 struct TemplateDatatype * dataType;
467 struct TemplateArgument * defaultArgument;
468 char * dataTypeString;
469 struct Type * baseType;
472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
476 struct Specifier * prev;
477 struct Specifier * next;
486 struct Symbol * symbol;
487 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
491 struct Identifier * id;
492 struct __ecereNameSpace__ecere__sys__OldList * list;
493 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
494 struct __ecereNameSpace__ecere__sys__OldList * definitions;
495 unsigned int addNameSpace;
496 struct Context * ctx;
498 struct Expression * expression;
499 struct Specifier * _class;
500 struct TemplateParameter * templateParameter;
504 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
508 struct Identifier * prev;
509 struct Identifier * next;
511 struct Symbol * classSym;
512 struct Specifier * _class;
514 struct Identifier * badID;
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
521 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
525 struct Declarator * prev;
526 struct Declarator * next;
529 struct Symbol * symbol;
530 struct Declarator * declarator;
533 struct Identifier * identifier;
536 struct Expression * exp;
537 struct Expression * posExp;
542 struct Expression * exp;
543 struct Specifier * enumClass;
547 struct __ecereNameSpace__ecere__sys__OldList * parameters;
551 struct Pointer * pointer;
560 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
562 struct FunctionDefinition
564 struct FunctionDefinition * prev;
565 struct FunctionDefinition * next;
567 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
568 struct Declarator * declarator;
569 struct __ecereNameSpace__ecere__sys__OldList * declarations;
570 struct Statement * body;
571 struct __ecereNameSpace__ecere__com__Class * _class;
572 struct __ecereNameSpace__ecere__sys__OldList attached;
575 struct Symbol * propSet;
577 unsigned int propertyNoThis;
580 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
584 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
588 struct External * prev;
589 struct External * next;
592 struct Symbol * symbol;
595 struct FunctionDefinition * function;
596 struct ClassDefinition * _class;
597 struct Declaration * declaration;
599 struct Identifier * id;
600 struct DBTableDef * table;
605 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
609 struct ModuleImport * prev;
610 struct ModuleImport * next;
612 struct __ecereNameSpace__ecere__sys__OldList classes;
613 struct __ecereNameSpace__ecere__sys__OldList functions;
618 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
622 struct ClassImport * prev;
623 struct ClassImport * next;
625 struct __ecereNameSpace__ecere__sys__OldList methods;
626 struct __ecereNameSpace__ecere__sys__OldList properties;
628 unsigned int isRemote;
631 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
636 struct Symbol * parent;
637 struct Symbol * left;
638 struct Symbol * right;
643 struct __ecereNameSpace__ecere__com__Method * method;
644 struct __ecereNameSpace__ecere__com__Property * _property;
645 struct __ecereNameSpace__ecere__com__Class * registered;
653 struct External * pointerExternal;
654 struct External * structExternal;
658 struct External * externalGet;
659 struct External * externalSet;
660 struct External * externalPtr;
661 struct External * externalIsSet;
665 struct External * methodExternal;
666 struct External * methodCodeExternal;
669 unsigned int imported;
670 unsigned int declaredStructSym;
671 struct __ecereNameSpace__ecere__com__Class * _class;
672 unsigned int declaredStruct;
673 unsigned int needConstructor;
674 unsigned int needDestructor;
675 char * constructorName;
678 char * destructorName;
679 struct ModuleImport * module;
680 struct ClassImport * _import;
681 struct Location nameLoc;
682 unsigned int isParam;
683 unsigned int isRemote;
684 unsigned int isStruct;
685 unsigned int fireWatchersDone;
687 unsigned int classData;
688 unsigned int isStatic;
690 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
691 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
692 struct Context * ctx;
696 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
705 struct Symbol * _class;
708 struct __ecereNameSpace__ecere__sys__OldList members;
713 struct Type * returnType;
714 struct __ecereNameSpace__ecere__sys__OldList params;
715 struct Symbol * thisClass;
716 unsigned int staticMethod;
717 struct TemplateParameter * thisClassTemplate;
721 struct __ecereNameSpace__ecere__com__Method * method;
722 struct __ecereNameSpace__ecere__com__Class * methodClass;
723 struct __ecereNameSpace__ecere__com__Class * usedClass;
727 struct Type * arrayType;
729 struct Expression * arraySizeExp;
730 unsigned int freeExp;
731 struct Symbol * enumClass;
734 struct TemplateParameter * templateParameter;
736 unsigned int isSigned;
738 unsigned int constant;
745 unsigned int byReference;
746 unsigned int extraParam;
748 unsigned int directClassAccess;
749 unsigned int computing;
750 unsigned int dllExport;
752 unsigned int keepCast;
753 unsigned int passAsTemplate;
757 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
759 struct __ecereNameSpace__ecere__com__Class
761 struct __ecereNameSpace__ecere__com__Class * prev;
762 struct __ecereNameSpace__ecere__com__Class * next;
768 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
769 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
772 struct __ecereNameSpace__ecere__com__Class * base;
773 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
774 struct __ecereNameSpace__ecere__sys__BinaryTree members;
775 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
776 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
777 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
778 struct __ecereNameSpace__ecere__sys__OldList derivatives;
782 struct __ecereNameSpace__ecere__com__Instance * module;
783 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
784 char * dataTypeString;
785 struct Type * dataType;
787 int defaultAlignment;
788 void (* Initialize)();
790 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
791 char * designerClass;
792 unsigned int noExpansion;
793 char * defaultProperty;
794 unsigned int comRedefinition;
796 unsigned int isRemote;
797 unsigned int internalDecl;
799 unsigned int computeSize;
801 int destructionWatchOffset;
803 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
804 int inheritanceAccess;
807 struct __ecereNameSpace__ecere__sys__OldList conversions;
808 struct __ecereNameSpace__ecere__sys__OldList templateParams;
809 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
810 struct __ecereNameSpace__ecere__com__Class * templateClass;
811 struct __ecereNameSpace__ecere__sys__OldList templatized;
815 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
817 struct __ecereNameSpace__ecere__com__Instance
820 struct __ecereNameSpace__ecere__com__Class * _class;
824 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
826 struct __ecereNameSpace__ecere__com__DataMember
828 struct __ecereNameSpace__ecere__com__DataMember * prev;
829 struct __ecereNameSpace__ecere__com__DataMember * next;
831 unsigned int isProperty;
834 struct __ecereNameSpace__ecere__com__Class * _class;
835 char * dataTypeString;
836 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
837 struct Type * dataType;
841 struct __ecereNameSpace__ecere__sys__OldList members;
842 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
847 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
849 struct __ecereNameSpace__ecere__com__SerialBuffer
851 unsigned char * _buffer;
857 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
859 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
865 char * dataTypeString;
866 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
868 struct __ecereNameSpace__ecere__com__DataValue expression;
874 struct __ecereNameSpace__ecere__com__DataMember * member;
875 struct __ecereNameSpace__ecere__com__Property * prop;
876 struct __ecereNameSpace__ecere__com__Method * method;
882 typedef unsigned int size_t;
884 void exit(int status);
886 void * calloc(size_t nmemb, size_t size);
888 void free(void * ptr);
890 void * malloc(size_t size);
892 void * realloc(void * ptr, size_t size);
894 long int strtol(const char * nptr, char ** endptr, int base);
896 long long int strtoll(const char * nptr, char ** endptr, int base);
898 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
900 typedef union YYSTYPE
905 struct Identifier * id;
906 struct Expression * exp;
907 struct Specifier * specifier;
908 struct __ecereNameSpace__ecere__sys__OldList * list;
909 struct Enumerator * enumerator;
910 struct Declarator * declarator;
911 struct Pointer * pointer;
912 struct Initializer * initializer;
913 struct InitDeclarator * initDeclarator;
914 struct TypeName * typeName;
915 struct Declaration * declaration;
916 struct Statement * stmt;
917 struct FunctionDefinition * function;
918 struct External * external;
919 struct Context * context;
920 struct AsmField * asmField;
921 struct Instantiation * instance;
922 struct MembersInit * membersInit;
923 struct MemberInit * memberInit;
924 struct ClassFunction * classFunction;
925 struct ClassDefinition * _class;
926 struct ClassDef * classDef;
927 struct PropertyDef * prop;
929 struct Symbol * symbol;
930 struct PropertyWatch * propertyWatch;
931 struct TemplateParameter * templateParameter;
932 struct TemplateArgument * templateArgument;
933 struct TemplateDatatype * templateDatatype;
934 struct DBTableEntry * dbtableEntry;
935 struct DBIndexItem * dbindexItem;
936 struct DBTableDef * dbtableDef;
939 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
943 struct Enumerator * prev;
944 struct Enumerator * next;
946 struct Identifier * id;
947 struct Expression * exp;
950 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
952 struct InitDeclarator
954 struct InitDeclarator * prev;
955 struct InitDeclarator * next;
957 struct Declarator * declarator;
958 struct Initializer * initializer;
961 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
965 struct AsmField * prev;
966 struct AsmField * next;
969 struct Expression * expression;
972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
976 struct ClassFunction * prev;
977 struct ClassFunction * next;
979 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
980 struct Declarator * declarator;
981 struct __ecereNameSpace__ecere__sys__OldList * declarations;
982 struct Statement * body;
983 struct __ecereNameSpace__ecere__com__Class * _class;
984 struct __ecereNameSpace__ecere__sys__OldList attached;
987 struct Symbol * propSet;
988 unsigned int isVirtual;
989 unsigned int isConstructor;
990 unsigned int isDestructor;
991 unsigned int dontMangle;
996 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1000 struct MembersInit * prev;
1001 struct MembersInit * next;
1002 struct Location loc;
1006 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1007 struct ClassFunction * function;
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1015 struct MemberInit * prev;
1016 struct MemberInit * next;
1017 struct Location loc;
1018 struct Location realLoc;
1019 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1020 struct Initializer * initializer;
1022 unsigned int variable;
1023 unsigned int takeOutExp;
1026 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1030 struct PropertyDef * prev;
1031 struct PropertyDef * next;
1032 struct Location loc;
1033 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1034 struct Declarator * declarator;
1035 struct Identifier * id;
1036 struct Statement * getStmt;
1037 struct Statement * setStmt;
1038 struct Statement * issetStmt;
1039 struct Symbol * symbol;
1040 unsigned int conversion;
1041 unsigned int isWatchable;
1045 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1047 struct PropertyWatch
1049 struct PropertyWatch * prev;
1050 struct PropertyWatch * next;
1051 struct Location loc;
1052 struct Statement * compound;
1053 struct __ecereNameSpace__ecere__sys__OldList * properties;
1054 unsigned int deleteWatch;
1057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1061 struct ClassDef * prev;
1062 struct ClassDef * next;
1063 struct Location loc;
1067 struct Declaration * decl;
1068 struct ClassFunction * function;
1069 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1070 struct PropertyDef * propertyDef;
1071 struct PropertyWatch * propertyWatch;
1073 struct Identifier * defaultProperty;
1076 struct Identifier * id;
1077 struct Initializer * initializer;
1084 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1086 struct DBTableEntry;
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1092 extern YYSTYPE yylval;
1094 extern struct Location yylloc;
1096 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1098 extern int returnCode;
1100 extern struct Expression * parsedExpression;
1102 extern unsigned int yydebug;
1104 void SetYydebug(unsigned int b)
1109 extern unsigned int echoOn;
1111 void resetScanner();
1115 int expression_yyparse();
1117 static struct Statement * curCompound;
1119 struct External * curExternal, * afterExternal;
1121 static struct Type * curSwitchType;
1123 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1125 struct __ecereNameSpace__ecere__com__Class * thisClass;
1127 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1132 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1137 static char * thisNameSpace;
1139 struct __ecereNameSpace__ecere__com__Class * containerClass;
1141 unsigned int thisClassParams = 0x1;
1143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1145 struct __ecereNameSpace__ecere__sys__TempFile
1147 char __ecere_padding[24];
1150 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1152 extern int strlen(const char * );
1154 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1156 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1158 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1160 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1162 void PrintExpression(struct Expression * exp, char * string)
1165 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1169 OutputExpression(exp, f);
1170 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1171 count = strlen(string);
1172 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);
1173 string[count] = '\0';
1174 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1178 extern int isspace(int c);
1180 long long _strtoi64(char * string, char ** endString, int base)
1182 long long value = 0;
1187 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1199 if(ch == (char)0 && string[c + 1] == 'x')
1212 for(; (ch = string[c]); c++)
1216 else if(ch >= '1' && ch <= '9')
1218 else if(ch >= 'a' && ch <= 'z')
1220 else if(ch >= 'A' && ch <= 'Z')
1224 *endString = string + c;
1234 *endString = string + c;
1238 return sign * value;
1241 uint64 _strtoui64(char * string, char ** endString, int base)
1248 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1260 if(ch == (char)0 && string[c + 1] == 'x')
1273 for(; (ch = string[c]); c++)
1277 else if(ch >= '1' && ch <= '9')
1279 else if(ch >= 'a' && ch <= 'z')
1281 else if(ch >= 'A' && ch <= 'Z')
1286 *endString = string + c;
1297 *endString = string + c;
1301 return sign * value;
1304 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1306 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1308 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1310 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1312 if(!param->baseType)
1314 if(param->dataTypeString)
1315 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1317 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1319 return param->baseType;
1321 return (((void *)0));
1324 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1326 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1328 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1332 if(type1->kind == type2->kind)
1340 if(type1->passAsTemplate && !type2->passAsTemplate)
1342 return type1->isSigned != type2->isSigned;
1344 return type1->_class != type2->_class;
1346 return NeedCast(type1->type, type2->type);
1354 extern int strcmp(const char * , const char * );
1356 extern struct Context * curContext;
1358 extern struct Context * topContext;
1360 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1362 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);
1364 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1366 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);
1368 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);
1370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1372 struct __ecereNameSpace__ecere__com__ClassProperty
1375 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1376 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1377 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1379 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
1380 int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1381 char * dataTypeString;
1382 struct Type * dataType;
1383 unsigned int constant;
1386 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1388 extern struct Expression * QMkExpId(char * id);
1390 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1392 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1394 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1395 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1400 char * dataTypeString;
1403 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1405 char __ecere_padding[4];
1408 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1410 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1412 extern void FreeIdentifier(struct Identifier * id);
1414 void ProcessExpressionType(struct Expression * exp);
1416 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1418 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1420 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1422 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1424 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1426 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1428 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1430 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1432 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1434 if(exp->type == 0 && exp->identifier)
1436 struct Identifier * id = exp->identifier;
1437 struct Context * ctx;
1438 struct Symbol * symbol = (((void *)0));
1440 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1442 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1444 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1449 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1451 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1452 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1453 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1454 struct __ecereNameSpace__ecere__com__ClassProperty * classProp;
1458 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1460 if(!prop && !method)
1461 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1462 if(!prop && !method && !member)
1464 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1466 if(prop || method || member || classProp)
1469 exp->member.member = id;
1470 exp->member.memberType = 0;
1471 exp->member.exp = QMkExpId("this");
1472 exp->addedThis = 0x1;
1474 else if(_class && _class->templateParams.first)
1476 struct __ecereNameSpace__ecere__com__Class * sClass;
1478 for(sClass = _class; sClass; sClass = sClass->base)
1480 if(sClass->templateParams.first)
1482 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1484 for(param = sClass->templateParams.first; param; param = param->next)
1486 if(param->type == 2 && !strcmp(param->name, id->string))
1488 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1492 struct Declarator * decl;
1493 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1495 FreeIdentifier(exp->member.member);
1496 ProcessExpressionType(argExp);
1497 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1498 exp->expType = ProcessType(specs, decl);
1500 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1511 extern int sprintf(char * , char * , ...);
1513 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1515 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1517 char * PrintInt(long long result)
1521 if(result > (((long long)0x7fffffffffffffffLL)))
1522 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1525 return __ecereNameSpace__ecere__sys__CopyString(temp);
1528 char * PrintUInt(uint64 result)
1532 if(result > (0xffffffff))
1533 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1534 else if(result > (((int)0x7fffffff)))
1535 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1537 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1538 return __ecereNameSpace__ecere__sys__CopyString(temp);
1541 char * PrintInt64(long long result)
1545 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1546 return __ecereNameSpace__ecere__sys__CopyString(temp);
1549 char * PrintUInt64(uint64 result)
1553 if(result > (((long long)0x7fffffffffffffffLL)))
1554 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1556 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1557 return __ecereNameSpace__ecere__sys__CopyString(temp);
1560 char * PrintHexUInt(uint64 result)
1564 if(result > (0xffffffff))
1565 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1567 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1571 char * PrintHexUInt64(uint64 result)
1575 if(result > (0xffffffff))
1576 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1578 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1579 return __ecereNameSpace__ecere__sys__CopyString(temp);
1582 char * PrintShort(short result)
1586 sprintf(temp, "%d", (unsigned short)result);
1587 return __ecereNameSpace__ecere__sys__CopyString(temp);
1590 char * PrintUShort(unsigned short result)
1594 if(result > (unsigned short)32767)
1595 sprintf(temp, "0x%X", (int)result);
1597 sprintf(temp, "%d", result);
1598 return __ecereNameSpace__ecere__sys__CopyString(temp);
1601 extern int isprint(int c);
1603 char * PrintChar(char result)
1607 if(result > (char)0 && isprint(result))
1608 sprintf(temp, "'%c'", result);
1609 else if(result < (char)0)
1610 sprintf(temp, "%d", result);
1612 sprintf(temp, "0x%X", (unsigned char)result);
1613 return __ecereNameSpace__ecere__sys__CopyString(temp);
1616 char * PrintUChar(unsigned char result)
1620 sprintf(temp, "0x%X", result);
1621 return __ecereNameSpace__ecere__sys__CopyString(temp);
1624 char * PrintFloat(float result)
1628 sprintf(temp, "%.16ff", result);
1629 return __ecereNameSpace__ecere__sys__CopyString(temp);
1632 char * PrintDouble(double result)
1636 sprintf(temp, "%.16f", result);
1637 return __ecereNameSpace__ecere__sys__CopyString(temp);
1640 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1644 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1645 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1646 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1647 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1648 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1649 unsigned int (* Neg)(struct Expression *, struct Operand *);
1650 unsigned int (* Inc)(struct Expression *, struct Operand *);
1651 unsigned int (* Dec)(struct Expression *, struct Operand *);
1652 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1653 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1654 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1655 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1656 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1657 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1658 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1659 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1660 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1661 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1662 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1663 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1664 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1665 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1666 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1667 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1668 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1669 unsigned int (* Not)(struct Expression *, struct Operand *);
1670 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1671 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1672 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1673 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1674 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1675 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1676 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1677 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1678 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1681 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1687 unsigned int ptrSize;
1705 struct Operand GetOperand(struct Expression * exp);
1707 unsigned int GetInt(struct Expression * exp, int * value2)
1709 struct Operand op2 = GetOperand(exp);
1711 if(op2.kind == 3 && op2.type->isSigned)
1713 else if(op2.kind == 3)
1714 *value2 = (int)op2.ui;
1715 if(op2.kind == 4 && op2.type->isSigned)
1716 *value2 = (int)op2.i64;
1717 else if(op2.kind == 4)
1718 *value2 = (int)op2.ui64;
1719 else if(op2.kind == 2 && op2.type->isSigned)
1720 *value2 = (int)op2.s;
1721 else if(op2.kind == 2)
1722 *value2 = (int)op2.us;
1723 else if(op2.kind == 1 && op2.type->isSigned)
1724 *value2 = (int)op2.c;
1725 else if(op2.kind == 1)
1726 *value2 = (int)op2.uc;
1727 else if(op2.kind == 6)
1728 *value2 = (int)op2.f;
1729 else if(op2.kind == 7)
1730 *value2 = (int)op2.d;
1731 else if(op2.kind == 13)
1732 *value2 = (int)op2.ui;
1738 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1740 struct Operand op2 = GetOperand(exp);
1742 if(op2.kind == 3 && op2.type->isSigned)
1743 *value2 = (unsigned int)op2.i;
1744 else if(op2.kind == 3)
1746 if(op2.kind == 4 && op2.type->isSigned)
1747 *value2 = (unsigned int)op2.i64;
1748 else if(op2.kind == 4)
1749 *value2 = (unsigned int)op2.ui64;
1750 else if(op2.kind == 2 && op2.type->isSigned)
1751 *value2 = (unsigned int)op2.s;
1752 else if(op2.kind == 2)
1753 *value2 = (unsigned int)op2.us;
1754 else if(op2.kind == 1 && op2.type->isSigned)
1755 *value2 = (unsigned int)op2.c;
1756 else if(op2.kind == 1)
1757 *value2 = (unsigned int)op2.uc;
1758 else if(op2.kind == 6)
1759 *value2 = (unsigned int)op2.f;
1760 else if(op2.kind == 7)
1761 *value2 = (unsigned int)op2.d;
1762 else if(op2.kind == 13)
1769 unsigned int GetInt64(struct Expression * exp, long long * value2)
1771 struct Operand op2 = GetOperand(exp);
1773 if(op2.kind == 3 && op2.type->isSigned)
1774 *value2 = (long long)op2.i;
1775 else if(op2.kind == 3)
1776 *value2 = (long long)op2.ui;
1777 if(op2.kind == 4 && op2.type->isSigned)
1779 else if(op2.kind == 4)
1780 *value2 = (long long)op2.ui64;
1781 else if(op2.kind == 2 && op2.type->isSigned)
1782 *value2 = (long long)op2.s;
1783 else if(op2.kind == 2)
1784 *value2 = (long long)op2.us;
1785 else if(op2.kind == 1 && op2.type->isSigned)
1786 *value2 = (long long)op2.c;
1787 else if(op2.kind == 1)
1788 *value2 = (long long)op2.uc;
1789 else if(op2.kind == 6)
1790 *value2 = (long long)op2.f;
1791 else if(op2.kind == 7)
1792 *value2 = (long long)op2.d;
1793 else if(op2.kind == 13)
1794 *value2 = (long long)op2.ui;
1800 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1802 struct Operand op2 = GetOperand(exp);
1804 if(op2.kind == 3 && op2.type->isSigned)
1805 *value2 = (uint64)op2.i;
1806 else if(op2.kind == 3)
1807 *value2 = (uint64)op2.ui;
1808 if(op2.kind == 4 && op2.type->isSigned)
1809 *value2 = (uint64)op2.i64;
1810 else if(op2.kind == 4)
1812 else if(op2.kind == 2 && op2.type->isSigned)
1813 *value2 = (uint64)op2.s;
1814 else if(op2.kind == 2)
1815 *value2 = (uint64)op2.us;
1816 else if(op2.kind == 1 && op2.type->isSigned)
1817 *value2 = (uint64)op2.c;
1818 else if(op2.kind == 1)
1819 *value2 = (uint64)op2.uc;
1820 else if(op2.kind == 6)
1821 *value2 = (uint64)op2.f;
1822 else if(op2.kind == 7)
1823 *value2 = (uint64)op2.d;
1824 else if(op2.kind == 13)
1825 *value2 = (uint64)op2.ui;
1831 unsigned int GetShort(struct Expression * exp, short * value2)
1833 struct Operand op2 = GetOperand(exp);
1835 if(op2.kind == 3 && op2.type->isSigned)
1836 *value2 = (short)op2.i;
1837 else if(op2.kind == 3)
1838 *value2 = (short)op2.ui;
1839 if(op2.kind == 4 && op2.type->isSigned)
1840 *value2 = (short)op2.i64;
1841 else if(op2.kind == 4)
1842 *value2 = (short)op2.ui64;
1843 else if(op2.kind == 2 && op2.type->isSigned)
1845 else if(op2.kind == 2)
1846 *value2 = (short)op2.us;
1847 else if(op2.kind == 1 && op2.type->isSigned)
1848 *value2 = (short)op2.c;
1849 else if(op2.kind == 1)
1850 *value2 = (short)op2.uc;
1851 else if(op2.kind == 6)
1852 *value2 = (short)op2.f;
1853 else if(op2.kind == 7)
1854 *value2 = (short)op2.d;
1855 else if(op2.kind == 13)
1856 *value2 = (short)op2.ui;
1862 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1864 struct Operand op2 = GetOperand(exp);
1866 if(op2.kind == 3 && op2.type->isSigned)
1867 *value2 = (unsigned short)op2.i;
1868 else if(op2.kind == 3)
1869 *value2 = (unsigned short)op2.ui;
1870 if(op2.kind == 4 && op2.type->isSigned)
1871 *value2 = (unsigned short)op2.i64;
1872 else if(op2.kind == 4)
1873 *value2 = (unsigned short)op2.ui64;
1874 else if(op2.kind == 2 && op2.type->isSigned)
1875 *value2 = (unsigned short)op2.s;
1876 else if(op2.kind == 2)
1878 else if(op2.kind == 1 && op2.type->isSigned)
1879 *value2 = (unsigned short)op2.c;
1880 else if(op2.kind == 1)
1881 *value2 = (unsigned short)op2.uc;
1882 else if(op2.kind == 6)
1883 *value2 = (unsigned short)op2.f;
1884 else if(op2.kind == 7)
1885 *value2 = (unsigned short)op2.d;
1886 else if(op2.kind == 13)
1887 *value2 = (unsigned short)op2.ui;
1893 unsigned int GetChar(struct Expression * exp, char * value2)
1895 struct Operand op2 = GetOperand(exp);
1897 if(op2.kind == 3 && op2.type->isSigned)
1898 *value2 = (char)op2.i;
1899 else if(op2.kind == 3)
1900 *value2 = (char)op2.ui;
1901 if(op2.kind == 4 && op2.type->isSigned)
1902 *value2 = (char)op2.i64;
1903 else if(op2.kind == 4)
1904 *value2 = (char)op2.ui64;
1905 else if(op2.kind == 2 && op2.type->isSigned)
1906 *value2 = (char)op2.s;
1907 else if(op2.kind == 2)
1908 *value2 = (char)op2.us;
1909 else if(op2.kind == 1 && op2.type->isSigned)
1911 else if(op2.kind == 1)
1912 *value2 = (char)op2.uc;
1913 else if(op2.kind == 6)
1914 *value2 = (char)op2.f;
1915 else if(op2.kind == 7)
1916 *value2 = (char)op2.d;
1917 else if(op2.kind == 13)
1918 *value2 = (char)op2.ui;
1924 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
1926 struct Operand op2 = GetOperand(exp);
1928 if(op2.kind == 3 && op2.type->isSigned)
1929 *value2 = (unsigned char)op2.i;
1930 else if(op2.kind == 3)
1931 *value2 = (unsigned char)op2.ui;
1932 if(op2.kind == 4 && op2.type->isSigned)
1933 *value2 = (unsigned char)op2.i64;
1934 else if(op2.kind == 4)
1935 *value2 = (unsigned char)op2.ui64;
1936 else if(op2.kind == 2 && op2.type->isSigned)
1937 *value2 = (unsigned char)op2.s;
1938 else if(op2.kind == 2)
1939 *value2 = (unsigned char)op2.us;
1940 else if(op2.kind == 1 && op2.type->isSigned)
1941 *value2 = (unsigned char)op2.c;
1942 else if(op2.kind == 1)
1944 else if(op2.kind == 6)
1945 *value2 = (unsigned char)op2.f;
1946 else if(op2.kind == 7)
1947 *value2 = (unsigned char)op2.d;
1948 else if(op2.kind == 13)
1949 *value2 = (unsigned char)op2.ui;
1955 unsigned int GetFloat(struct Expression * exp, float * value2)
1957 struct Operand op2 = GetOperand(exp);
1959 if(op2.kind == 3 && op2.type->isSigned)
1960 *value2 = (float)(float)op2.i;
1961 else if(op2.kind == 3)
1962 *value2 = (float)(float)op2.ui;
1963 if(op2.kind == 4 && op2.type->isSigned)
1964 *value2 = (float)(float)op2.i64;
1965 else if(op2.kind == 4)
1966 *value2 = (float)(float)op2.ui64;
1967 else if(op2.kind == 2 && op2.type->isSigned)
1968 *value2 = (float)(float)op2.s;
1969 else if(op2.kind == 2)
1970 *value2 = (float)(float)op2.us;
1971 else if(op2.kind == 1 && op2.type->isSigned)
1972 *value2 = (float)(float)op2.c;
1973 else if(op2.kind == 1)
1974 *value2 = (float)(float)op2.uc;
1975 else if(op2.kind == 6)
1976 *value2 = (float)op2.f;
1977 else if(op2.kind == 7)
1978 *value2 = (float)op2.d;
1979 else if(op2.kind == 13)
1980 *value2 = (float)(float)op2.ui;
1986 unsigned int GetDouble(struct Expression * exp, double * value2)
1988 struct Operand op2 = GetOperand(exp);
1990 if(op2.kind == 3 && op2.type->isSigned)
1991 *value2 = (double)(double)op2.i;
1992 else if(op2.kind == 3)
1993 *value2 = (double)(double)op2.ui;
1994 if(op2.kind == 4 && op2.type->isSigned)
1995 *value2 = (double)(double)op2.i64;
1996 else if(op2.kind == 4)
1997 *value2 = (double)(double)op2.ui64;
1998 else if(op2.kind == 2 && op2.type->isSigned)
1999 *value2 = (double)(double)op2.s;
2000 else if(op2.kind == 2)
2001 *value2 = (double)(double)op2.us;
2002 else if(op2.kind == 1 && op2.type->isSigned)
2003 *value2 = (double)(double)op2.c;
2004 else if(op2.kind == 1)
2005 *value2 = (double)(double)op2.uc;
2006 else if(op2.kind == 6)
2007 *value2 = (double)op2.f;
2008 else if(op2.kind == 7)
2009 *value2 = (double)op2.d;
2010 else if(op2.kind == 13)
2011 *value2 = (double)(double)op2.ui;
2017 void ComputeExpression(struct Expression * exp);
2019 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2021 int ComputeTypeSize(struct Type * type);
2023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2025 struct __ecereNameSpace__ecere__com__BitMember
2027 struct __ecereNameSpace__ecere__com__BitMember * prev;
2028 struct __ecereNameSpace__ecere__com__BitMember * next;
2030 unsigned int isProperty;
2033 struct __ecereNameSpace__ecere__com__Class * _class;
2034 char * dataTypeString;
2035 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2036 struct Type * dataType;
2043 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2045 struct __ecereNameSpace__ecere__sys__OldLink
2047 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2048 struct __ecereNameSpace__ecere__sys__OldLink * next;
2052 void FinishTemplatesContext(struct Context * context);
2054 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2056 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2057 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2059 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2062 int unionMemberOffset = 0;
2065 if(!member && _class->destructionWatchOffset)
2066 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2068 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2070 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2072 if(!dataMember->isProperty)
2074 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2076 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2082 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2084 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2086 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2088 if(!isMember && _class->type == 2 && dataMember->dataType)
2090 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2094 ComputeTypeSize(dataMember->dataType);
2095 if(bitMember->pos == -1)
2096 bitMember->pos = _class->memberOffset;
2097 if(!bitMember->size)
2098 bitMember->size = dataMember->dataType->size * 8;
2099 _class->memberOffset = bitMember->pos + bitMember->size;
2100 for(d = 0; d < bitMember->size; d++)
2106 bitMember->mask = mask << bitMember->pos;
2108 else if(dataMember->type == 0 && dataMember->dataType)
2113 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2114 ComputeTypeSize(dataMember->dataType);
2115 if(dataMember->dataType->bitFieldCount)
2117 bitFields += dataMember->dataType->bitFieldCount;
2124 int size = (bitFields + 7) / 8;
2128 int __simpleStruct0;
2132 int __simpleStruct0;
2134 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2135 if(member->memberOffset % alignment)
2136 member->memberOffset += alignment - (member->memberOffset % alignment);
2138 dataMember->offset = member->memberOffset;
2139 if(member->type == 1)
2140 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2143 member->memberOffset += size;
2150 int __simpleStruct0;
2152 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2153 if(_class->memberOffset % alignment)
2154 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2156 dataMember->offset = _class->memberOffset;
2157 _class->memberOffset += size;
2161 size = dataMember->dataType->size;
2162 alignment = dataMember->dataType->alignment;
2166 int __simpleStruct0;
2170 int __simpleStruct0;
2172 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2173 if(member->memberOffset % alignment)
2174 member->memberOffset += alignment - (member->memberOffset % alignment);
2176 dataMember->offset = member->memberOffset;
2177 if(member->type == 1)
2178 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2181 member->memberOffset += size;
2188 int __simpleStruct0;
2190 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2191 if(_class->memberOffset % alignment)
2192 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2194 dataMember->offset = _class->memberOffset;
2195 _class->memberOffset += size;
2200 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2203 int __simpleStruct2;
2204 int __simpleStruct0, __simpleStruct1;
2206 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2207 dataMember->offset = member->memberOffset;
2208 if(member->type == 1)
2209 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2211 member->memberOffset += dataMember->memberOffset;
2215 int __simpleStruct0, __simpleStruct1;
2217 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2218 dataMember->offset = _class->memberOffset;
2219 _class->memberOffset += dataMember->memberOffset;
2227 int size = (bitFields + 7) / 8;
2231 int __simpleStruct0;
2235 int __simpleStruct0;
2237 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2238 if(member->memberOffset % alignment)
2239 member->memberOffset += alignment - (member->memberOffset % alignment);
2241 if(member->type == 1)
2242 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2245 member->memberOffset += size;
2252 int __simpleStruct0;
2254 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2255 if(_class->memberOffset % alignment)
2256 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2258 _class->memberOffset += size;
2263 if(member && member->type == 1)
2265 member->memberOffset = unionMemberOffset;
2269 if(_class->type != 2)
2271 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2274 struct __ecereNameSpace__ecere__com__Property * prop;
2276 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2278 if(prop->isProperty && prop->isWatchable)
2280 prop->watcherOffset = _class->structSize;
2281 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2286 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2288 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2290 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2292 if(deriv->computeSize)
2294 deriv->offset = _class->structSize;
2295 deriv->memberOffset = 0;
2296 deriv->structSize = deriv->offset;
2297 ComputeClassMembers(deriv, 0x0);
2305 FinishTemplatesContext(context);
2308 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2310 struct __ecereNameSpace__ecere__com__NameSpace
2313 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2314 struct __ecereNameSpace__ecere__com__NameSpace * left;
2315 struct __ecereNameSpace__ecere__com__NameSpace * right;
2317 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2318 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2319 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2320 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2321 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2324 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2326 struct __ecereNameSpace__ecere__com__Module
2328 struct __ecereNameSpace__ecere__com__Instance * application;
2329 struct __ecereNameSpace__ecere__sys__OldList classes;
2330 struct __ecereNameSpace__ecere__sys__OldList defines;
2331 struct __ecereNameSpace__ecere__sys__OldList functions;
2332 struct __ecereNameSpace__ecere__sys__OldList modules;
2333 struct __ecereNameSpace__ecere__com__Instance * prev;
2334 struct __ecereNameSpace__ecere__com__Instance * next;
2339 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2340 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2343 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2345 struct __ecereNameSpace__ecere__com__Class * _class;
2346 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2348 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2349 ComputeModuleClasses(subModule->data);
2350 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2351 ComputeClassMembers(_class, 0x0);
2354 extern unsigned int inCompiler;
2356 extern void Compiler_Error(char * format, ...);
2358 extern int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
2360 int ComputeTypeSize(struct Type * type)
2362 unsigned int size = type ? type->size : 0;
2364 if(!size && type && !type->computing)
2366 type->computing = 0x1;
2370 type->alignment = size = sizeof(char);
2373 type->alignment = size = sizeof(int);
2376 type->alignment = size = sizeof(long long);
2379 type->alignment = size = sizeof(long);
2382 type->alignment = size = sizeof(short);
2385 type->alignment = size = sizeof(float);
2388 type->alignment = size = sizeof(double);
2392 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2394 if(_class && _class->type == 1)
2396 ComputeClassMembers(_class, 0x0);
2397 type->alignment = _class->structAlignment;
2398 size = _class->structSize;
2399 if(type->alignment && size % type->alignment)
2400 size += type->alignment - (size % type->alignment);
2402 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2404 if(!_class->dataType)
2405 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2406 size = type->alignment = ComputeTypeSize(_class->dataType);
2409 size = type->alignment = sizeof(struct __ecereNameSpace__ecere__com__Instance **);
2414 size = type->alignment = sizeof(void *);
2417 if(type->arraySizeExp)
2419 ProcessExpressionType(type->arraySizeExp);
2420 ComputeExpression(type->arraySizeExp);
2421 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)))
2423 struct Location oldLoc = yylloc;
2424 char expression[10240];
2426 expression[0] = '\0';
2427 type->arraySizeExp->expType = (((void *)0));
2428 yylloc = type->arraySizeExp->loc;
2430 PrintExpression(type->arraySizeExp, expression);
2431 Compiler_Error("Array size not constant int (%s)\n", expression);
2434 GetInt(type->arraySizeExp, &type->arraySize);
2436 else if(type->enumClass)
2438 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2440 type->arraySize = __ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2443 type->arraySize = 0;
2447 type->arraySize = 0;
2449 size = ComputeTypeSize(type->type) * type->arraySize;
2450 type->alignment = type->type->alignment;
2454 struct Type * member;
2456 for(member = type->members.first; member; member = member->next)
2458 int __simpleStruct0, __simpleStruct1;
2459 unsigned int addSize = ComputeTypeSize(member);
2461 member->offset = size;
2462 if(member->alignment && size % member->alignment)
2463 member->offset += member->alignment - (size % member->alignment);
2464 size = member->offset;
2465 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2468 if(type->alignment && size % type->alignment)
2469 size += type->alignment - (size % type->alignment);
2474 struct Type * member;
2476 for(member = type->members.first; member; member = member->next)
2478 int __simpleStruct0, __simpleStruct1;
2479 unsigned int addSize = ComputeTypeSize(member);
2481 member->offset = size;
2482 if(member->alignment && size % member->alignment)
2483 member->offset += member->alignment - (size % member->alignment);
2484 size = member->offset;
2485 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2486 size = ((size > addSize) ? size : addSize);
2488 if(type->alignment && size % type->alignment)
2489 size += type->alignment - (size % type->alignment);
2494 struct TemplateParameter * param = type->templateParameter;
2495 struct Type * baseType = ProcessTemplateParameterType(param);
2498 size = ComputeTypeSize(baseType);
2500 size = sizeof(uint64);
2513 size = sizeof(void *);
2518 type->computing = 0x0;
2523 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2525 extern struct Identifier * MkIdentifier(char * string);
2527 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2529 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2531 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2533 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2535 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2537 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2539 extern void FreeType(struct Type * type);
2541 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2543 extern struct Specifier * MkSpecifier(int specifier);
2545 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2547 extern struct Expression * MkExpConstant(char * string);
2549 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)
2551 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2552 unsigned int totalSize = 0;
2553 unsigned int maxSize = 0;
2554 int alignment, size;
2555 struct __ecereNameSpace__ecere__com__DataMember * member;
2556 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2558 if(!isMember && _class->base)
2560 maxSize = _class->structSize;
2562 if(_class->type == 1 || _class->type == 5)
2563 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2565 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2568 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2570 if(!member->isProperty)
2572 switch(member->type)
2576 if(member->dataTypeString)
2578 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2579 struct Declarator * decl;
2581 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2582 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2583 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2584 if(!member->dataType)
2585 member->dataType = ProcessType(specs, decl);
2586 ReplaceThisClassSpecifiers(specs, topClass);
2588 struct Type * type = ProcessType(specs, decl);
2590 DeclareType(member->dataType, 0x0, 0x0);
2593 ComputeTypeSize(member->dataType);
2594 size = member->dataType->size;
2595 alignment = member->dataType->alignment;
2598 if(totalSize % alignment)
2599 totalSize += alignment - (totalSize % alignment);
2608 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2611 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2612 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2613 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2614 alignment = member->structAlignment;
2617 if(totalSize % alignment)
2618 totalSize += alignment - (totalSize % alignment);
2628 unsigned int __simpleStruct0;
2630 if(topMember && topMember->type == 1)
2631 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2633 *retSize += totalSize;
2635 else if(totalSize < maxSize && _class->type != 1000)
2637 char sizeString[50];
2639 sprintf(sizeString, "%d", maxSize - totalSize);
2640 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(289)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2643 FinishTemplatesContext(context);
2644 return topMember ? topMember->memberID : _class->memberID;
2647 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2649 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2650 unsigned int totalSize = 0;
2651 struct __ecereNameSpace__ecere__com__DataMember * member;
2652 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2654 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2655 DeclareMembers(_class->base, 0x0);
2656 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2658 if(!member->isProperty)
2660 switch(member->type)
2664 if(!member->dataType && member->dataTypeString)
2665 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2666 if(member->dataType)
2667 DeclareType(member->dataType, 0x0, 0x0);
2673 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2680 FinishTemplatesContext(context);
2681 return topMember ? topMember->memberID : _class->memberID;
2684 extern struct Symbol * FindClass(char * name);
2686 extern char * strchr(char * , int);
2688 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2690 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2692 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2694 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2696 extern char * strcpy(char * , const char * );
2698 extern void MangleClassName(char * className);
2700 extern void DeclareClass(struct Symbol * classSym, char * className);
2702 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2704 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2706 void DeclareStruct(char * name, unsigned int skipNoHead)
2708 struct External * external = (((void *)0));
2709 struct Symbol * classSym = FindClass(name);
2711 if(!inCompiler || !classSym)
2712 return (((void *)0));
2713 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2714 return (((void *)0));
2715 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2717 struct Declaration * decl;
2718 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2719 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2720 char structName[1024];
2722 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2723 classSym->declaring++;
2724 if(strchr(classSym->string, '<'))
2726 if(classSym->registered->templateClass)
2728 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2729 classSym->declaring--;
2731 return (((void *)0));
2733 DeclareMembers(classSym->registered, 0x0);
2734 structName[0] = (char)0;
2735 FullClassNameCat(structName, name, 0x0);
2738 classSym->declaredStructSym = 0x1;
2739 declarations = MkList();
2740 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2741 if(!(*declarations).count)
2743 FreeList(declarations, (((void *)0)));
2744 declarations = (((void *)0));
2747 if(skipNoHead || declarations)
2749 if(external && external->declaration)
2751 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2752 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2754 if(classSym->structExternal)
2755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2756 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2757 classSym->id = curExternal->symbol->idCode;
2758 classSym->idCode = curExternal->symbol->idCode;
2764 external = MkExternalDeclaration((((void *)0)));
2765 specifiers = MkList();
2766 declarators = MkList();
2767 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2768 external->declaration = decl = MkDeclaration(specifiers, declarators);
2769 if(decl->symbol && !decl->symbol->pointerExternal)
2770 decl->symbol->pointerExternal = external;
2771 if(classSym->registered && classSym->registered->type == 1)
2773 char className[1024];
2775 strcpy(className, "__ecereClass_");
2776 FullClassNameCat(className, classSym->string, 0x1);
2777 MangleClassName(className);
2778 DeclareClass(classSym, className);
2779 external->symbol = classSym;
2780 classSym->pointerExternal = external;
2781 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2782 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2786 char className[1024];
2788 strcpy(className, "__ecereClass_");
2789 FullClassNameCat(className, classSym->string, 0x1);
2790 MangleClassName(className);
2791 classSym->structExternal = external;
2792 DeclareClass(classSym, className);
2793 external->symbol = classSym;
2795 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2798 classSym->declaring--;
2800 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2802 classSym->declaring++;
2804 if(classSym->registered)
2805 DeclareMembers(classSym->registered, 0x0);
2807 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2809 if(classSym->structExternal)
2810 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2811 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2812 classSym->id = curExternal->symbol->idCode;
2813 classSym->idCode = curExternal->symbol->idCode;
2815 classSym->declaring--;
2819 extern char * strcat(char * , const char * );
2821 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
2823 extern struct ModuleImport * mainModule;
2825 extern struct Specifier * MkSpecifierName(char * name);
2827 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
2829 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
2831 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
2833 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
2835 extern void FreeDeclarator(struct Declarator * decl);
2837 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
2839 struct PropertyImport
2841 struct PropertyImport * prev;
2842 struct PropertyImport * next;
2844 unsigned int isVirtual;
2845 unsigned int hasSet;
2846 unsigned int hasGet;
2849 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
2851 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
2853 void * __ecereTemp1;
2854 struct Symbol * symbol = prop->symbol;
2855 char propName[1024];
2857 strcpy(setName, "__ecereProp_");
2858 FullClassNameCat(setName, prop->_class->fullName, 0x0);
2859 strcat(setName, "_Set_");
2860 FullClassNameCat(setName, prop->name, 0x1);
2861 strcpy(getName, "__ecereProp_");
2862 FullClassNameCat(getName, prop->_class->fullName, 0x0);
2863 strcat(getName, "_Get_");
2864 FullClassNameCat(getName, prop->name, 0x1);
2865 strcpy(propName, "__ecereProp_");
2866 FullClassNameCat(propName, prop->_class->fullName, 0x0);
2867 strcat(propName, "_");
2868 FullClassNameCat(propName, prop->name, 0x1);
2869 MangleClassName(getName);
2870 MangleClassName(setName);
2871 MangleClassName(propName);
2872 if(prop->_class->type == 1)
2873 DeclareStruct(prop->_class->fullName, 0x0);
2874 if(!symbol || curExternal->symbol->idCode < symbol->id)
2876 unsigned int imported = 0x0;
2877 unsigned int dllImport = 0x0;
2879 if(!symbol || symbol->_import)
2883 struct Symbol * classSym;
2885 if(!prop->_class->symbol)
2886 prop->_class->symbol = FindClass(prop->_class->fullName);
2887 classSym = prop->_class->symbol;
2888 if(classSym && !classSym->_import)
2890 struct ModuleImport * module;
2892 if(prop->_class->module)
2893 module = FindModule(prop->_class->module);
2895 module = mainModule;
2896 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));
2897 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
2899 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2900 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));
2902 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
2905 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
2910 struct Context * context = SetupTemplatesContext(prop->_class);
2912 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
2913 FinishTemplatesContext(context);
2917 if(!symbol->externalGet || symbol->externalGet->type == 0)
2919 struct Declaration * decl;
2920 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2921 struct Declarator * d;
2922 struct __ecereNameSpace__ecere__sys__OldList * params;
2923 struct Specifier * spec;
2924 struct External * external;
2925 struct Declarator * typeDecl;
2926 unsigned int simple = 0x0;
2928 specifiers = MkList();
2929 declarators = MkList();
2931 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
2932 d = MkDeclaratorIdentifier(MkIdentifier(getName));
2934 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
2936 struct Context * context = SetupTemplatesContext(prop->_class);
2938 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
2939 FinishTemplatesContext(context);
2941 for(spec = (*specifiers).first; spec; spec = spec->next)
2945 if((!typeDecl || typeDecl->type == 1))
2947 struct Symbol * classSym = spec->symbol;
2949 symbol->_class = classSym->registered;
2950 if(classSym->registered && classSym->registered->type == 1)
2952 DeclareStruct(spec->name, 0x0);
2959 d = PlugDeclarator(typeDecl, d);
2962 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
2963 specifiers = MkList();
2965 d = MkDeclaratorFunction(d, params);
2967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(285));
2968 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
2969 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(286));
2971 ListAdd(specifiers, MkSpecifier(301));
2972 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
2973 decl = MkDeclaration(specifiers, declarators);
2974 external = MkExternalDeclaration(decl);
2975 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
2976 external->symbol = symbol;
2977 symbol->externalGet = external;
2978 ReplaceThisClassSpecifiers(specifiers, prop->_class);
2980 FreeDeclarator(typeDecl);
2984 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
2989 if(!symbol->externalSet || symbol->externalSet->type == 0)
2991 struct Declaration * decl;
2992 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2993 struct Declarator * d;
2994 struct __ecereNameSpace__ecere__sys__OldList * params;
2995 struct Specifier * spec;
2996 struct External * external;
2997 struct Declarator * typeDecl;
2999 declarators = MkList();
3001 if(!prop->conversion || prop->_class->type == 1)
3003 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3005 specifiers = MkList();
3007 struct Context * context = SetupTemplatesContext(prop->_class);
3009 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3010 FinishTemplatesContext(context);
3012 ListAdd(params, MkTypeName(specifiers, d));
3013 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3015 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3016 d = MkDeclaratorFunction(d, params);
3017 for(spec = (*specifiers).first; spec; spec = spec->next)
3021 if((!typeDecl || typeDecl->type == 1))
3023 struct Symbol * classSym = spec->symbol;
3025 symbol->_class = classSym->registered;
3026 if(classSym->registered && classSym->registered->type == 1)
3027 DeclareStruct(spec->name, 0x0);
3031 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3032 specifiers = MkList();
3034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(285));
3035 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(286));
3037 if(!prop->conversion || prop->_class->type == 1)
3038 ListAdd(specifiers, MkSpecifier(301));
3040 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3041 decl = MkDeclaration(specifiers, declarators);
3042 external = MkExternalDeclaration(decl);
3043 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3044 external->symbol = symbol;
3045 symbol->externalSet = external;
3046 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3050 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3053 if(!symbol->externalPtr)
3055 struct Declaration * decl;
3056 struct External * external;
3057 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(285));
3062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(286));
3063 ListAdd(specifiers, MkSpecifierName("Property"));
3065 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3067 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3070 strcpy(propName, "__ecerePropM_");
3071 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3072 strcat(propName, "_");
3073 FullClassNameCat(propName, prop->name, 0x1);
3074 MangleClassName(propName);
3075 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3077 decl = MkDeclaration(specifiers, list);
3079 external = MkExternalDeclaration(decl);
3080 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3081 external->symbol = symbol;
3082 symbol->externalPtr = external;
3086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3088 symbol->id = curExternal->symbol->idCode;
3092 struct Type * Dereference(struct Type * source)
3094 void * __ecereTemp1;
3095 struct Type * type = (((void *)0));
3099 if(source->kind == 13 || source->kind == 12)
3101 type = source->type;
3102 source->type->refCount++;
3104 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3106 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3108 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3114 Compiler_Error("cannot dereference type\n");
3119 static struct Type * Reference(struct Type * source)
3121 void * __ecereTemp1;
3122 struct Type * type = (((void *)0));
3126 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));
3132 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);
3134 extern void * memcpy(void * , const void * , unsigned int size);
3136 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3138 extern void FreeExpression(struct Expression * exp);
3140 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3142 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);
3144 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3146 extern struct Type * MkClassType(char * name);
3148 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);
3150 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)
3152 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3153 unsigned int found = 0x0;
3154 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3155 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3156 unsigned int freeType = 0x0;
3158 yylloc = member->loc;
3163 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3167 dataMember = *curMember;
3173 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3174 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3175 int _subMemberStackPos = 0;
3178 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3181 dataMember = thisMember;
3182 if(curMember && thisMember->memberAccess == 1)
3184 *curMember = thisMember;
3185 *curClass = thisMember->_class;
3186 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3187 *subMemberStackPos = _subMemberStackPos;
3193 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3194 if(method && method->type == 1)
3197 method = (((void *)0));
3202 struct Type * type = (((void *)0));
3206 if(!dataMember->dataType && dataMember->dataTypeString)
3208 struct Context * context = SetupTemplatesContext(_class);
3210 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3211 FinishTemplatesContext(context);
3213 type = dataMember->dataType;
3217 if(!method->dataType)
3218 ProcessMethodType(method);
3219 type = method->dataType;
3221 if(ident && ident->next)
3223 for(ident = ident->next; ident && type; ident = ident->next)
3227 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3229 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3231 type = dataMember->dataType;
3233 else if(type->kind == 9 || type->kind == 10)
3235 struct Type * memberType;
3237 for(memberType = type->members.first; memberType; memberType = memberType->next)
3239 if(!strcmp(memberType->name, ident->string))
3248 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3251 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3252 struct __ecereNameSpace__ecere__com__Class * sClass;
3254 for(sClass = _class; sClass; sClass = sClass->base)
3257 if(sClass->templateClass)
3258 sClass = sClass->templateClass;
3259 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3261 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3263 for(sClass = sClass->base; sClass; sClass = sClass->base)
3265 if(sClass->templateClass)
3266 sClass = sClass->templateClass;
3267 id += sClass->templateParams.count;
3278 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3280 if(arg.dataTypeString)
3282 type = ProcessTypeString(arg.dataTypeString, 0x0);
3284 if(type && _class->templateClass)
3285 type->passAsTemplate = 0x1;
3292 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3294 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3295 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3299 char templateString[1024];
3300 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3302 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3303 for(cClass = expClass; cClass; cClass = cClass->base)
3307 if(cClass->templateClass)
3308 cClass = cClass->templateClass;
3309 for(param = cClass->templateParams.first; param; param = param->next)
3312 struct __ecereNameSpace__ecere__com__Class * sClass;
3313 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3315 for(sClass = cClass->base; sClass; sClass = sClass->base)
3317 if(sClass->templateClass)
3318 sClass = sClass->templateClass;
3319 id += sClass->templateParams.count;
3321 arg = expClass->templateArgs[id];
3322 for(sClass = _class; sClass; sClass = sClass->base)
3324 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3326 struct __ecereNameSpace__ecere__com__Class * nextClass;
3328 if(sClass->templateClass)
3329 sClass = sClass->templateClass;
3330 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3332 if(nextClass->templateClass)
3333 nextClass = nextClass->templateClass;
3334 p += nextClass->templateParams.count;
3336 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3338 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3340 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3342 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3343 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3357 char expString[1024];
3358 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3359 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3360 struct Expression * exp;
3361 char * string = PrintHexUInt64(arg.expression.ui64);
3363 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3364 ProcessExpressionType(exp);
3365 ComputeExpression(exp);
3366 expString[0] = '\0';
3367 PrintExpression(exp, expString);
3368 strcat(argument, expString);
3369 FreeExpression(exp);
3374 strcat(argument, arg.member->name);
3379 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3380 strcat(argument, arg.dataTypeString);
3387 strcat(templateString, ", ");
3388 if(lastParam != p - 1)
3390 strcat(templateString, param->name);
3391 strcat(templateString, " = ");
3393 strcat(templateString, argument);
3402 int len = strlen(templateString);
3404 if(templateString[len - 1] == '<')
3408 if(templateString[len - 1] == '>')
3409 templateString[len++] = ' ';
3410 templateString[len++] = '>';
3412 templateString[len++] = '\0';
3415 struct Context * context = SetupTemplatesContext(_class);
3419 type = ProcessTypeString(templateString, 0x0);
3421 FinishTemplatesContext(context);
3424 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3426 ProcessExpressionType(member->initializer->exp);
3427 if(!member->initializer->exp->expType)
3431 char expString[10240];
3433 expString[0] = '\0';
3434 PrintExpression(member->initializer->exp, expString);
3435 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3436 Compiler_Error("unresolved symbol used as an instance method %s\n", expString);
3439 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3441 Compiler_Error("incompatible instance method %s\n", ident->string);
3444 else if(member->initializer)
3446 ProcessInitializer(member->initializer, type);
3453 if(_class && _class->type == 3)
3455 if(member->initializer)
3457 struct Type * type = MkClassType(_class->fullName);
3459 ProcessInitializer(member->initializer, type);
3465 if(member->initializer)
3467 ProcessInitializer(member->initializer, (((void *)0)));
3473 Compiler_Error("couldn't find virtual method %s in class %s\n", ident->string, _class->fullName);
3477 Compiler_Error("couldn't find member %s in class %s\n", ident->string, _class->fullName);
3479 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3483 Compiler_Error("too many initializers for instantiation of class %s\n", _class->fullName);
3488 extern struct Identifier * GetDeclId(struct Declarator * decl);
3490 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);
3492 extern void FreeSpecifier(struct Specifier * spec);
3494 static void ProcessFunction(struct FunctionDefinition * function);
3496 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3498 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3500 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3502 extern void FreeClassFunction(struct ClassFunction * func);
3504 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3506 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3508 void ProcessInstantiationType(struct Instantiation * inst)
3513 struct MembersInit * members;
3514 struct Symbol * classSym;
3515 struct __ecereNameSpace__ecere__com__Class * _class;
3517 classSym = inst->_class->symbol;
3518 _class = classSym ? classSym->registered : (((void *)0));
3519 if(!_class || _class->type != 5)
3520 DeclareStruct(inst->_class->name, 0x0);
3521 afterExternal = afterExternal ? afterExternal : curExternal;
3523 ProcessExpressionType(inst->exp);
3524 inst->isConstant = 0x1;
3527 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3528 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3529 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3530 int subMemberStackPos = 0;
3532 for(members = (*inst->members).first; members; members = members->next)
3534 switch(members->type)
3539 static unsigned int instMethodID = 0;
3540 struct External * external = curExternal;
3541 struct Context * context = curContext;
3542 struct Declarator * declarator = members->function->declarator;
3543 struct Identifier * nameID = GetDeclId(declarator);
3544 char * unmangled = nameID ? nameID->string : (((void *)0));
3545 struct Expression * exp;
3546 struct External * createdExternal = (((void *)0));
3552 strcpy(name, "__ecereInstMeth_");
3553 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3555 strcat(name, nameID->string);
3557 sprintf(number, "_%08d", instMethodID++);
3558 strcat(name, number);
3559 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3563 struct Symbol * symbol = declarator->symbol;
3564 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3566 if(method && method->type == 1)
3568 symbol->method = method;
3569 ProcessMethodType(method);
3570 if(!symbol->type->thisClass)
3572 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3574 if(!currentClass->symbol)
3575 currentClass->symbol = FindClass(currentClass->fullName);
3576 symbol->type->thisClass = currentClass->symbol;
3581 _class->symbol = FindClass(_class->fullName);
3582 symbol->type->thisClass = _class->symbol;
3585 DeclareType(symbol->type, 0x1, 0x1);
3589 Compiler_Error("couldn't find virtual method %s in class %s\n", unmangled, classSym->string);
3592 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3595 FreeSpecifier(nameID->_class);
3596 nameID->_class = (((void *)0));
3600 struct Type * type = declarator->symbol->type;
3601 struct External * oldExternal = curExternal;
3603 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3605 struct External * externalDecl;
3607 externalDecl = MkExternalDeclaration((((void *)0)));
3608 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3609 if(createdExternal->function)
3611 ProcessFunction(createdExternal->function);
3613 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3615 externalDecl->declaration = decl;
3616 if(decl->symbol && !decl->symbol->pointerExternal)
3617 decl->symbol->pointerExternal = externalDecl;
3618 declarator->symbol->pointerExternal = externalDecl;
3625 curExternal = declarator->symbol->pointerExternal;
3626 ProcessFunction((struct FunctionDefinition *)members->function);
3628 curExternal = external;
3629 curContext = context;
3632 FreeClassFunction(members->function);
3633 exp = QMkExpId(name);
3635 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3636 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3642 if(members->dataMembers && classSym)
3644 struct MemberInit * member;
3645 struct Location oldyyloc = yylloc;
3647 for(member = (*members->dataMembers).first; member; member = member->next)
3649 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3650 if(member->initializer && !member->initializer->isConstant)
3651 inst->isConstant = 0x0;
3663 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3667 if(type->kind == 11)
3669 struct Type * param;
3673 for(param = type->params.first; param; param = param->next)
3674 DeclareType(param, declarePointers, 0x1);
3676 DeclareType(type->returnType, declarePointers, 0x1);
3678 else if(type->kind == 13 && declarePointers)
3679 DeclareType(type->type, declarePointers, 0x0);
3680 else if(type->kind == 8)
3682 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3683 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3685 else if(type->kind == 9 || type->kind == 10)
3687 struct Type * member;
3689 for(member = type->members.first; member; member = member->next)
3690 DeclareType(member, 0x0, 0x0);
3692 else if(type->kind == 12)
3693 DeclareType(type->arrayType, declarePointers, 0x0);
3697 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3699 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3701 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3703 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
3704 struct __ecereNameSpace__ecere__com__Class * sClass;
3706 for(sClass = _class; sClass; sClass = sClass->base)
3709 if(sClass->templateClass)
3710 sClass = sClass->templateClass;
3711 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3713 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3715 for(sClass = sClass->base; sClass; sClass = sClass->base)
3717 if(sClass->templateClass)
3718 sClass = sClass->templateClass;
3719 id += sClass->templateParams.count;
3730 arg = &_class->templateArgs[id];
3731 if(arg && param->type == 0)
3732 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3737 extern struct Context * PushContext(void);
3739 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3741 struct TemplatedType
3744 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3745 struct __ecereNameSpace__ecere__sys__BTNode * left;
3746 struct __ecereNameSpace__ecere__sys__BTNode * right;
3748 struct TemplateParameter * param;
3751 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3753 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3755 void * __ecereTemp1;
3756 struct Context * context = PushContext();
3758 context->templateTypesOnly = 0x1;
3759 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3761 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3763 for(; param; param = param->next)
3765 if(param->type == 0 && param->identifier)
3767 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (unsigned int)param->identifier->string, type->param = param, type);
3769 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3775 struct __ecereNameSpace__ecere__com__Class * sClass;
3777 for(sClass = _class; sClass; sClass = sClass->base)
3779 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3781 for(p = sClass->templateParams.first; p; p = p->next)
3785 struct TemplateParameter * param = p->param;
3786 struct TemplatedType * type;
3790 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));
3792 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));
3793 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3801 extern void PopContext(struct Context * ctx);
3803 extern void FreeContext(struct Context * context);
3805 void FinishTemplatesContext(struct Context * context)
3807 PopContext(context);
3808 FreeContext(context);
3809 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3812 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3814 if(!method->dataType)
3816 struct Context * context = SetupTemplatesContext(method->_class);
3818 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3819 FinishTemplatesContext(context);
3820 if(method->type != 1 && method->dataType)
3822 if(!method->dataType->thisClass && !method->dataType->staticMethod)
3824 if(!method->_class->symbol)
3825 method->_class->symbol = FindClass(method->_class->fullName);
3826 method->dataType->thisClass = method->_class->symbol;
3832 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
3836 struct Context * context = SetupTemplatesContext(prop->_class);
3838 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
3839 FinishTemplatesContext(context);
3843 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
3845 extern void FreeTypeName(struct TypeName * typeName);
3847 static void ProcessDeclarator(struct Declarator * decl);
3849 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
3851 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
3855 struct MethodImport * prev;
3856 struct MethodImport * next;
3858 unsigned int isVirtual;
3861 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3863 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
3865 void * __ecereTemp1;
3866 struct Symbol * symbol = method->symbol;
3868 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
3870 unsigned int imported = 0x0;
3871 unsigned int dllImport = 0x0;
3873 if(!method->dataType)
3874 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
3875 if(!symbol || symbol->_import || method->type == 1)
3877 if(!symbol || method->type == 1)
3879 struct Symbol * classSym;
3881 if(!method->_class->symbol)
3882 method->_class->symbol = FindClass(method->_class->fullName);
3883 classSym = method->_class->symbol;
3884 if(!classSym->_import)
3886 struct ModuleImport * module;
3888 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
3889 module = FindModule(method->_class->module);
3891 module = mainModule;
3892 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));
3893 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3897 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3899 if(!symbol->_import)
3901 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));
3902 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
3906 symbol->type = method->dataType;
3908 symbol->type->refCount++;
3911 if(!method->dataType->dllExport)
3914 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
3918 if(method->type != 1 && method->dataType)
3919 DeclareType(method->dataType, 0x1, 0x1);
3920 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
3922 struct Declaration * decl;
3923 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3924 struct Declarator * d;
3925 struct Declarator * funcDecl;
3926 struct External * external;
3928 specifiers = MkList();
3929 declarators = MkList();
3931 ListAdd(specifiers, MkSpecifier(285));
3932 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
3933 ListAdd(specifiers, MkSpecifier(286));
3934 if(method->type == 1)
3936 ListAdd(specifiers, MkSpecifier(291));
3937 d = MkDeclaratorIdentifier(MkIdentifier(name));
3941 d = MkDeclaratorIdentifier(MkIdentifier(name));
3943 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3945 struct Context * context = SetupTemplatesContext(method->_class);
3947 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
3948 FinishTemplatesContext(context);
3950 funcDecl = GetFuncDecl(d);
3953 struct Specifier * spec, * next;
3955 for(spec = (*specifiers).first; spec; spec = next)
3960 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
3961 FreeSpecifier(spec);
3965 if(method->dataType && !method->dataType->staticMethod)
3967 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
3969 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
3970 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")));
3971 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
3972 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
3974 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == 301 && !firstParam->declarator)
3976 struct TypeName * param = (*funcDecl->function.parameters).first;
3978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
3979 FreeTypeName(param);
3981 if(!funcDecl->function.parameters)
3982 funcDecl->function.parameters = MkList();
3983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
3987 ProcessDeclarator(d);
3988 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3989 decl = MkDeclaration(specifiers, declarators);
3990 ReplaceThisClassSpecifiers(specifiers, method->_class);
3991 if(symbol->pointerExternal)
3993 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3996 *functionSymbol = *symbol;
3997 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
3998 if(functionSymbol->type)
3999 functionSymbol->type->refCount++;
4001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4002 symbol->pointerExternal->symbol = functionSymbol;
4004 external = MkExternalDeclaration(decl);
4006 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4007 external->symbol = symbol;
4008 symbol->pointerExternal = external;
4012 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4014 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4018 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4020 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4022 unsigned int first = 0x1;
4024 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4026 char className[1024];
4028 strcpy(className, _class->fullName);
4029 for(param = _class->templateParams.first; param; param = param->next)
4033 strcat(className, "<");
4035 strcat(className, ", ");
4036 if(lastParam + 1 != p)
4038 strcat(className, param->name);
4039 strcat(className, " = ");
4041 strcat(className, param->name);
4049 int len = strlen(className);
4051 if(className[len - 1] == '>')
4052 className[len++] = ' ';
4053 className[len++] = '>';
4054 className[len++] = '\0';
4056 return __ecereNameSpace__ecere__sys__CopyString(className);
4059 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4062 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4064 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4066 unsigned int first = 0x1;
4068 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4070 char className[1024];
4072 strcpy(className, _class->fullName);
4073 for(param = _class->templateParams.first; param; param = param->next)
4077 strcat(className, "<");
4079 strcat(className, ", ");
4080 if(lastParam + 1 != p)
4082 strcat(className, param->name);
4083 strcat(className, " = ");
4085 strcat(className, param->name);
4093 int len = strlen(className);
4095 if(className[len - 1] == '>')
4096 className[len++] = ' ';
4097 className[len++] = '>';
4098 className[len++] = '\0';
4100 return MkClassType(className);
4104 return MkClassType(_class->fullName);
4108 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4110 if(specs != (((void *)0)) && _class)
4112 struct Specifier * spec;
4114 for(spec = specs->first; spec; spec = spec->next)
4116 if(spec->type == 0 && spec->specifier == 321)
4119 spec->name = ReplaceThisClass(_class);
4120 spec->symbol = FindClass(spec->name);
4126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4128 struct __ecereNameSpace__ecere__com__GlobalFunction
4130 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4131 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4134 struct __ecereNameSpace__ecere__com__Instance * module;
4135 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4136 char * dataTypeString;
4137 struct Type * dataType;
4141 extern struct Context * globalContext;
4143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4145 struct FunctionImport
4147 struct FunctionImport * prev;
4148 struct FunctionImport * next;
4152 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4154 void * __ecereTemp1;
4155 struct Symbol * symbol = function->symbol;
4157 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4159 unsigned int imported = 0x0;
4160 unsigned int dllImport = 0x0;
4162 if(!function->dataType)
4164 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4165 if(!function->dataType->thisClass)
4166 function->dataType->staticMethod = 0x1;
4172 struct ModuleImport * module = FindModule(function->module);
4174 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4177 if(!function->dataType->dllExport)
4179 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));
4180 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4184 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4185 if(!symbol->type->thisClass)
4186 symbol->type->staticMethod = 0x1;
4189 imported = symbol->_import ? 0x1 : 0x0;
4190 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4193 DeclareType(function->dataType, 0x1, 0x1);
4196 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4198 struct Declaration * decl;
4199 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4200 struct Declarator * d;
4201 struct Declarator * funcDecl;
4202 struct External * external;
4204 specifiers = MkList();
4205 declarators = MkList();
4206 ListAdd(specifiers, MkSpecifier(285));
4207 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4209 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4210 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4211 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4213 struct Specifier * spec;
4215 for(spec = (*specifiers).first; spec; spec = spec->next)
4216 if(spec->type == 5 && !strcmp(spec->name, "dllexport"))
4218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4219 FreeSpecifier(spec);
4223 funcDecl = GetFuncDecl(d);
4224 if(funcDecl && !funcDecl->function.parameters)
4226 funcDecl->function.parameters = MkList();
4227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(301)), (((void *)0))));
4229 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4231 struct Context * oldCtx = curContext;
4233 curContext = globalContext;
4234 decl = MkDeclaration(specifiers, declarators);
4235 curContext = oldCtx;
4237 if(symbol->pointerExternal)
4239 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4242 *functionSymbol = *symbol;
4243 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4244 if(functionSymbol->type)
4245 functionSymbol->type->refCount++;
4247 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4248 symbol->pointerExternal->symbol = functionSymbol;
4250 external = MkExternalDeclaration(decl);
4252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4253 external->symbol = symbol;
4254 symbol->pointerExternal = external;
4258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4261 symbol->id = curExternal->symbol->idCode;
4264 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4267 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4272 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4273 struct __ecereNameSpace__ecere__sys__BTNode * left;
4274 struct __ecereNameSpace__ecere__sys__BTNode * right;
4276 struct __ecereNameSpace__ecere__com__Instance * module;
4277 char * dataTypeString;
4278 struct Type * dataType;
4283 void DeclareGlobalData(struct GlobalData * data)
4285 struct Symbol * symbol = data->symbol;
4287 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4292 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4295 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4296 DeclareType(data->dataType, 0x1, 0x1);
4299 if(!symbol->pointerExternal)
4301 struct Declaration * decl;
4302 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4303 struct Declarator * d;
4304 struct External * external;
4306 specifiers = MkList();
4307 declarators = MkList();
4308 ListAdd(specifiers, MkSpecifier(285));
4309 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4310 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4311 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4312 decl = MkDeclaration(specifiers, declarators);
4313 external = MkExternalDeclaration(decl);
4315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4316 external->symbol = symbol;
4317 symbol->pointerExternal = external;
4321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4324 symbol->id = curExternal->symbol->idCode;
4331 struct Conversion * prev, * next;
4332 struct __ecereNameSpace__ecere__com__Property * convert;
4334 struct Type * resultType;
4337 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4339 extern void Compiler_Warning(char * format, ...);
4341 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4343 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)
4347 if(source->kind == 20 && dest->kind != 20)
4349 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4354 if(dest->kind == 20 && source->kind != 20)
4356 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4361 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4365 if(source->classObjectType == 3 && dest->classObjectType != 2)
4369 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4371 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4374 if(dest->kind == 14 && source->kind != 0)
4376 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))
4378 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))
4380 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4382 if(source->_class->registered && source->_class->registered->type == 3)
4384 if(conversions != (((void *)0)))
4386 if(source->_class->registered == dest->_class->registered)
4391 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4393 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4395 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4397 if(sourceBase == destBase)
4401 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))
4405 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4407 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4414 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4418 if(source->kind == 8)
4420 struct __ecereNameSpace__ecere__com__Class * _class;
4422 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4424 struct __ecereNameSpace__ecere__com__Property * convert;
4426 for(convert = _class->conversions.first; convert; convert = convert->next)
4428 if(convert->memberAccess == 1 || _class->module == privateModule)
4430 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4432 if(!convert->dataType)
4433 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4434 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4436 if(!conversions && !convert->Get)
4438 else if(conversions != (((void *)0)))
4440 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))
4444 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4446 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4457 struct __ecereNameSpace__ecere__com__Class * _class;
4459 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4461 struct __ecereNameSpace__ecere__com__Property * convert;
4463 for(convert = _class->conversions.first; convert; convert = convert->next)
4465 if(convert->memberAccess == 1 || _class->module == privateModule)
4467 if(!convert->dataType)
4468 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4469 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4471 if(!conversions && !convert->Set)
4473 else if(conversions != (((void *)0)))
4475 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))
4479 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4489 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4491 if(!dest->_class->registered->dataType)
4492 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4493 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4495 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4502 if(source->kind == 8)
4504 struct __ecereNameSpace__ecere__com__Class * _class;
4506 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4508 struct __ecereNameSpace__ecere__com__Property * convert;
4510 for(convert = _class->conversions.first; convert; convert = convert->next)
4512 if(convert->memberAccess == 1 || _class->module == privateModule)
4514 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4516 if(!convert->dataType)
4517 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4518 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4520 if(!conversions && !convert->Get)
4522 else if(conversions != (((void *)0)))
4524 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))
4528 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4538 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4540 if(!source->_class->registered->dataType)
4541 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4542 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4549 if(source->kind == 8 || source->kind == 19)
4551 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4553 else if(dest->kind == 7 && source->kind == 6)
4555 else if(dest->kind == 2 && source->kind == 1)
4557 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4559 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4561 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4))
4563 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || dest->kind == 4))
4565 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)))
4567 struct Type * paramSource, * paramDest;
4569 if(dest->kind == 16)
4570 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4571 if(source->kind == 16)
4572 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4573 if(dest->kind == 13 && dest->type->kind == 11)
4575 if(source->kind == 13 && source->type->kind == 11)
4576 source = source->type;
4577 if(dest->kind == 16)
4578 dest = dest->method->dataType;
4579 if(source->kind == 16)
4580 source = source->method->dataType;
4581 paramSource = source->params.first;
4582 if(paramSource && paramSource->kind == 0)
4583 paramSource = (((void *)0));
4584 paramDest = dest->params.first;
4585 if(paramDest && paramDest->kind == 0)
4586 paramDest = (((void *)0));
4587 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4589 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))))
4591 if(paramDest && paramDest->kind == 8)
4592 Compiler_Error("method class must be derived from %s\n", paramDest->_class->string);
4594 Compiler_Error("method class should not take an object\n");
4597 paramDest = paramDest->next;
4599 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4601 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4605 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4607 Compiler_Error("method class must be derived from %s\n", dest->thisClass->string);
4613 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4616 Compiler_Error("%s expected to be derived from method class\n", owningClassDest->fullName);
4618 Compiler_Error("overriding class expected to be derived from method class\n");
4622 paramSource = paramSource->next;
4628 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4630 Compiler_Error("method class must be derived from %s\n", dest->thisClass->string);
4636 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4638 Compiler_Error("%s expected to be derived from method class\n", source->thisClass->registered->fullName);
4644 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4646 Compiler_Warning("incompatible return type for function\n");
4649 for(; paramDest; paramDest = paramDest->next)
4653 Compiler_Error("not enough parameters\n");
4657 struct Type * paramDestType = paramDest;
4658 struct Type * paramSourceType = paramSource;
4659 struct Type * type = paramDestType;
4661 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4664 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
4665 struct __ecereNameSpace__ecere__com__Class * sClass;
4667 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4670 if(sClass->templateClass)
4671 sClass = sClass->templateClass;
4672 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4674 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4676 for(sClass = sClass->base; sClass; sClass = sClass->base)
4678 if(sClass->templateClass)
4679 sClass = sClass->templateClass;
4680 id += sClass->templateParams.count;
4691 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4693 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4696 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)))
4701 PrintType(paramDest, type, 0x0, 0x1);
4702 Compiler_Warning("incompatible parameter %s (expected %s)\n", paramSource->name, type);
4703 if(paramDestType != paramDest)
4704 FreeType(paramDestType);
4707 if(paramDestType != paramDest)
4708 FreeType(paramDestType);
4710 paramSource = paramSource->next;
4714 Compiler_Error("too many parameters\n");
4719 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4723 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4725 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4732 static void FreeConvert(struct Conversion * convert)
4734 if(convert->resultType)
4735 FreeType(convert->resultType);
4738 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4740 struct __ecereNameSpace__ecere__com__BTNamedLink
4743 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4744 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4745 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4750 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4752 struct __ecereNameSpace__ecere__com__EnumClassData
4754 struct __ecereNameSpace__ecere__sys__OldList values;
4758 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4760 struct __ecereNameSpace__ecere__sys__NamedLink
4762 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4763 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4768 extern void FreeExpContents(struct Expression * exp);
4770 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4772 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4774 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4776 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4778 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4780 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4782 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4784 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)))
4786 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4788 if(_class->type == 4)
4790 struct __ecereNameSpace__ecere__sys__OldList converts =
4794 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4798 _class->symbol = FindClass(_class->fullName);
4799 type->_class = _class->symbol;
4800 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4802 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4803 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4807 struct __ecereNameSpace__ecere__com__Class * baseClass;
4809 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4811 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4813 for(value = e->values.first; value; value = value->next)
4815 if(!strcmp(value->name, string))
4820 FreeExpContents(sourceExp);
4821 FreeType(sourceExp->expType);
4822 sourceExp->isConstant = 0x1;
4823 sourceExp->expType = MkClassType(baseClass->fullName);
4827 sourceExp->type = 2;
4828 if(!strcmp(baseClass->dataTypeString, "int"))
4829 sprintf(constant, "%d", value->data);
4831 sprintf(constant, "0x%X", value->data);
4832 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
4834 while(converts.first)
4836 struct Conversion * convert = converts.first;
4838 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
4839 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
4841 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4848 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
4849 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
4852 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)))
4853 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
4858 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
4860 struct __ecereNameSpace__ecere__com__SubModule
4862 struct __ecereNameSpace__ecere__com__SubModule * prev;
4863 struct __ecereNameSpace__ecere__com__SubModule * next;
4864 struct __ecereNameSpace__ecere__com__Instance * module;
4868 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
4870 struct __ecereNameSpace__ecere__com__SubModule * subModule;
4872 if(searchFor == searchIn)
4874 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
4876 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
4878 if(ModuleVisibility(subModule->module, searchFor))
4885 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
4887 struct __ecereNameSpace__ecere__com__Application
4892 unsigned int isGUIApp;
4893 struct __ecereNameSpace__ecere__sys__OldList allModules;
4894 char * parsedCommand;
4895 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
4898 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4900 struct __ecereNameSpace__ecere__com__Instance * module;
4902 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->systemNameSpace, sourceExp, dest, string, conversions))
4904 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
4906 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4908 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
4910 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
4916 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
4918 void ReadString(char * output, char * string);
4920 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
4922 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
4924 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
4926 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
4928 void * __ecereTemp1;
4929 struct Type * source = sourceExp->expType;
4930 struct Type * realDest = dest;
4932 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
4934 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
4936 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
4938 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4940 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4942 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
4944 if(sourceBase == destBase)
4950 struct __ecereNameSpace__ecere__sys__OldList * specs;
4951 unsigned int flag = 0x0;
4952 long long value = (((int)0x7fffffff));
4956 if(sourceExp->type == 2)
4958 if(source->isSigned)
4959 value = strtoll(sourceExp->constant, (((void *)0)), 0);
4961 value = strtoull(sourceExp->constant, (((void *)0)), 0);
4963 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
4965 if(source->isSigned)
4966 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
4968 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
4970 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
4973 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));
4977 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
4979 if(_class && _class->type == 3)
4981 if(source->kind != 8)
4983 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4984 struct Type * tempDest, * tempSource;
4986 for(; _class->base->type != 1000; _class = _class->base)
4989 tempDest = tempType;
4992 _class->symbol = FindClass(_class->fullName);
4993 tempType->_class = _class->symbol;
4994 tempType->truth = dest->truth;
4995 if(tempType->_class)
4996 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
4997 FreeType(sourceExp->expType);
4998 sourceExp->expType = dest;
5001 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5004 if(_class && _class->type == 2 && source->kind != 8)
5006 if(!dest->_class->registered->dataType)
5007 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5008 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5011 FreeType(sourceExp->expType);
5012 source = sourceExp->expType = MkClassType(dest->_class->string);
5016 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5018 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5019 struct Declarator * decl;
5022 ReadString(string, sourceExp->string);
5023 decl = SpecDeclFromString(string, specs, (((void *)0)));
5024 FreeExpContents(sourceExp);
5025 FreeType(sourceExp->expType);
5026 sourceExp->type = 26;
5027 sourceExp->_classExp.specifiers = specs;
5028 sourceExp->_classExp.decl = decl;
5029 sourceExp->expType = dest;
5034 else if(source->kind == 8)
5036 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5038 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5042 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5043 struct Type * tempDest, * tempSource;
5045 if(!source->_class->registered->dataType)
5046 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5047 for(; _class->base->type != 1000; _class = _class->base)
5050 tempSource = tempType;
5052 tempType->_class = FindClass(_class->fullName);
5053 tempType->truth = source->truth;
5054 tempType->classObjectType = source->classObjectType;
5055 if(tempType->_class)
5056 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5057 if(conversions->last)
5059 ((struct Conversion *)conversions->last)->resultType = dest;
5062 FreeType(sourceExp->expType);
5063 sourceExp->expType = MkClassType(_class->fullName);
5064 sourceExp->expType->truth = source->truth;
5065 sourceExp->expType->classObjectType = source->classObjectType;
5066 if(!sourceExp->destType)
5068 FreeType(sourceExp->destType);
5069 sourceExp->destType = sourceExp->expType;
5070 if(sourceExp->expType)
5071 sourceExp->expType->refCount++;
5073 if(!_class->dataType)
5074 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5076 dest = MkClassType(source->_class->string);
5077 dest->truth = source->truth;
5078 dest->classObjectType = source->classObjectType;
5080 source = _class->dataType;
5082 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5088 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5097 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5099 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5101 if(_class->type == 0 || _class->type == 5)
5103 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5105 *newExp = *sourceExp;
5106 if(sourceExp->destType)
5107 sourceExp->destType->refCount++;
5108 if(sourceExp->expType)
5109 sourceExp->expType->refCount++;
5110 sourceExp->type = 11;
5111 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(301)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5112 sourceExp->cast.exp = newExp;
5113 FreeType(sourceExp->expType);
5114 sourceExp->expType = (((void *)0));
5115 ProcessExpressionType(sourceExp);
5118 FreeType(sourceExp->expType);
5119 sourceExp->expType = dest;
5126 if(!_class->dataType)
5127 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5129 dest = _class->dataType;
5132 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5134 specs = MkListOne(MkSpecifier(298));
5136 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5138 specs = MkListOne(MkSpecifier(297));
5140 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5144 ListAdd(specs, MkSpecifier(296));
5145 ListAdd(specs, MkSpecifier(293));
5147 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5151 ListAdd(specs, MkSpecifier(296));
5152 ListAdd(specs, MkSpecifier(291));
5154 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5158 ListAdd(specs, MkSpecifier(296));
5159 ListAdd(specs, MkSpecifier(290));
5161 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5165 ListAdd(specs, MkSpecifier(296));
5166 ListAdd(specs, MkSpecifier(289));
5175 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))
5177 specs = MkListOne(MkSpecifier(298));
5179 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5181 specs = MkListOne(MkSpecifier(297));
5183 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)))
5187 ListAdd(specs, MkSpecifier(296));
5188 ListAdd(specs, MkSpecifier(289));
5190 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)))))
5194 ListAdd(specs, MkSpecifier(296));
5195 ListAdd(specs, MkSpecifier(290));
5197 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5201 ListAdd(specs, MkSpecifier(296));
5202 ListAdd(specs, MkSpecifier(291));
5204 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5208 ListAdd(specs, MkSpecifier(296));
5209 ListAdd(specs, MkSpecifier(293));
5211 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5213 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5223 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5225 *newExp = *sourceExp;
5226 newExp->prev = (((void *)0));
5227 newExp->next = (((void *)0));
5228 if(sourceExp->destType)
5229 sourceExp->destType->refCount++;
5230 if(sourceExp->expType)
5231 sourceExp->expType->refCount++;
5232 sourceExp->type = 11;
5233 if(realDest->kind == 8)
5235 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5236 FreeList(specs, FreeSpecifier);
5239 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5240 if(newExp->type == 4)
5242 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5245 sourceExp->cast.exp = newExp;
5246 FreeType(sourceExp->expType);
5247 sourceExp->expType = (((void *)0));
5248 ProcessExpressionType(sourceExp);
5251 FreeList(specs, FreeSpecifier);
5258 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5259 sourceExp = (*sourceExp->list).last;
5260 if(sourceExp->type == 0)
5262 struct Identifier * id = sourceExp->identifier;
5266 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5268 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5269 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5273 for(; _class && _class->type == 4; _class = _class->base)
5275 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5276 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5278 for(value = e->values.first; value; value = value->next)
5280 if(!strcmp(value->name, id->string))
5285 FreeExpContents(sourceExp);
5286 FreeType(sourceExp->expType);
5287 sourceExp->isConstant = 0x1;
5288 sourceExp->expType = MkClassType(_class->fullName);
5292 sourceExp->type = 2;
5293 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5294 sprintf(constant, "%d", value->data);
5296 sprintf(constant, "0x%X", value->data);
5297 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5305 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5312 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5314 int value2 = op2->i;
5317 exp->string = PrintInt(op1->i + value2);
5320 exp->expType = op1->type;
5322 op1->type->refCount++;
5327 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5329 unsigned int value2 = op2->ui;
5332 exp->string = PrintUInt(op1->ui + value2);
5335 exp->expType = op1->type;
5337 op1->type->refCount++;
5342 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5344 short value2 = op2->s;
5347 exp->string = PrintShort(op1->s + value2);
5350 exp->expType = op1->type;
5352 op1->type->refCount++;
5357 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5359 unsigned short value2 = op2->us;
5362 exp->string = PrintUShort(op1->us + value2);
5365 exp->expType = op1->type;
5367 op1->type->refCount++;
5372 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5374 char value2 = op2->c;
5377 exp->string = PrintChar(op1->c + value2);
5380 exp->expType = op1->type;
5382 op1->type->refCount++;
5387 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5389 unsigned char value2 = op2->uc;
5392 exp->string = PrintUChar(op1->uc + value2);
5395 exp->expType = op1->type;
5397 op1->type->refCount++;
5402 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5404 float value2 = op2->f;
5407 exp->string = PrintFloat(op1->f + value2);
5410 exp->expType = op1->type;
5412 op1->type->refCount++;
5417 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5419 double value2 = op2->d;
5422 exp->string = PrintDouble(op1->d + value2);
5425 exp->expType = op1->type;
5427 op1->type->refCount++;
5432 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5434 int value2 = op2->i;
5437 exp->string = PrintInt(op1->i - value2);
5440 exp->expType = op1->type;
5442 op1->type->refCount++;
5447 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5449 unsigned int value2 = op2->ui;
5452 exp->string = PrintUInt(op1->ui - value2);
5455 exp->expType = op1->type;
5457 op1->type->refCount++;
5462 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5464 short value2 = op2->s;
5467 exp->string = PrintShort(op1->s - value2);
5470 exp->expType = op1->type;
5472 op1->type->refCount++;
5477 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5479 unsigned short value2 = op2->us;
5482 exp->string = PrintUShort(op1->us - value2);
5485 exp->expType = op1->type;
5487 op1->type->refCount++;
5492 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5494 char value2 = op2->c;
5497 exp->string = PrintChar(op1->c - value2);
5500 exp->expType = op1->type;
5502 op1->type->refCount++;
5507 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5509 unsigned char value2 = op2->uc;
5512 exp->string = PrintUChar(op1->uc - value2);
5515 exp->expType = op1->type;
5517 op1->type->refCount++;
5522 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5524 float value2 = op2->f;
5527 exp->string = PrintFloat(op1->f - value2);
5530 exp->expType = op1->type;
5532 op1->type->refCount++;
5537 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5539 double value2 = op2->d;
5542 exp->string = PrintDouble(op1->d - value2);
5545 exp->expType = op1->type;
5547 op1->type->refCount++;
5552 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5554 int value2 = op2->i;
5557 exp->string = PrintInt(op1->i * value2);
5560 exp->expType = op1->type;
5562 op1->type->refCount++;
5567 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5569 unsigned int value2 = op2->ui;
5572 exp->string = PrintUInt(op1->ui * value2);
5575 exp->expType = op1->type;
5577 op1->type->refCount++;
5582 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5584 short value2 = op2->s;
5587 exp->string = PrintShort(op1->s * value2);
5590 exp->expType = op1->type;
5592 op1->type->refCount++;
5597 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5599 unsigned short value2 = op2->us;
5602 exp->string = PrintUShort(op1->us * value2);
5605 exp->expType = op1->type;
5607 op1->type->refCount++;
5612 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5614 char value2 = op2->c;
5617 exp->string = PrintChar(op1->c * value2);
5620 exp->expType = op1->type;
5622 op1->type->refCount++;
5627 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5629 unsigned char value2 = op2->uc;
5632 exp->string = PrintUChar(op1->uc * value2);
5635 exp->expType = op1->type;
5637 op1->type->refCount++;
5642 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5644 float value2 = op2->f;
5647 exp->string = PrintFloat(op1->f * value2);
5650 exp->expType = op1->type;
5652 op1->type->refCount++;
5657 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5659 double value2 = op2->d;
5662 exp->string = PrintDouble(op1->d * value2);
5665 exp->expType = op1->type;
5667 op1->type->refCount++;
5672 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5674 int value2 = op2->i;
5677 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5680 exp->expType = op1->type;
5682 op1->type->refCount++;
5687 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5689 unsigned int value2 = op2->ui;
5692 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5695 exp->expType = op1->type;
5697 op1->type->refCount++;
5702 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5704 short value2 = op2->s;
5707 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5710 exp->expType = op1->type;
5712 op1->type->refCount++;
5717 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5719 unsigned short value2 = op2->us;
5722 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5725 exp->expType = op1->type;
5727 op1->type->refCount++;
5732 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5734 char value2 = op2->c;
5737 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5740 exp->expType = op1->type;
5742 op1->type->refCount++;
5747 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5749 unsigned char value2 = op2->uc;
5752 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5755 exp->expType = op1->type;
5757 op1->type->refCount++;
5762 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5764 float value2 = op2->f;
5767 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5770 exp->expType = op1->type;
5772 op1->type->refCount++;
5777 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5779 double value2 = op2->d;
5782 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5785 exp->expType = op1->type;
5787 op1->type->refCount++;
5792 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5794 int value2 = op2->i;
5797 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5800 exp->expType = op1->type;
5802 op1->type->refCount++;
5807 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5809 unsigned int value2 = op2->ui;
5812 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
5815 exp->expType = op1->type;
5817 op1->type->refCount++;
5822 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5824 short value2 = op2->s;
5827 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
5830 exp->expType = op1->type;
5832 op1->type->refCount++;
5837 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5839 unsigned short value2 = op2->us;
5842 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
5845 exp->expType = op1->type;
5847 op1->type->refCount++;
5852 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5854 char value2 = op2->c;
5857 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
5860 exp->expType = op1->type;
5862 op1->type->refCount++;
5867 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5869 unsigned char value2 = op2->uc;
5872 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
5875 exp->expType = op1->type;
5877 op1->type->refCount++;
5882 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
5885 exp->string = PrintInt(-op1->i);
5888 exp->expType = op1->type;
5890 op1->type->refCount++;
5895 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
5898 exp->string = PrintUInt(-op1->ui);
5901 exp->expType = op1->type;
5903 op1->type->refCount++;
5908 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
5911 exp->string = PrintShort(-op1->s);
5914 exp->expType = op1->type;
5916 op1->type->refCount++;
5921 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
5924 exp->string = PrintUShort(-op1->us);
5927 exp->expType = op1->type;
5929 op1->type->refCount++;
5934 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
5937 exp->string = PrintChar(-op1->c);
5940 exp->expType = op1->type;
5942 op1->type->refCount++;
5947 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
5950 exp->string = PrintUChar(-op1->uc);
5953 exp->expType = op1->type;
5955 op1->type->refCount++;
5960 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
5963 exp->string = PrintFloat(-op1->f);
5966 exp->expType = op1->type;
5968 op1->type->refCount++;
5973 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
5976 exp->string = PrintDouble(-op1->d);
5979 exp->expType = op1->type;
5981 op1->type->refCount++;
5986 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
5989 exp->string = PrintInt(++op1->i);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6002 exp->string = PrintUInt(++op1->ui);
6005 exp->expType = op1->type;
6007 op1->type->refCount++;
6012 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6015 exp->string = PrintShort(++op1->s);
6018 exp->expType = op1->type;
6020 op1->type->refCount++;
6025 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6028 exp->string = PrintUShort(++op1->us);
6031 exp->expType = op1->type;
6033 op1->type->refCount++;
6038 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6041 exp->string = PrintChar(++op1->c);
6044 exp->expType = op1->type;
6046 op1->type->refCount++;
6051 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6054 exp->string = PrintUChar(++op1->uc);
6057 exp->expType = op1->type;
6059 op1->type->refCount++;
6064 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6067 exp->string = PrintFloat(++op1->f);
6070 exp->expType = op1->type;
6072 op1->type->refCount++;
6077 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6080 exp->string = PrintDouble(++op1->d);
6083 exp->expType = op1->type;
6085 op1->type->refCount++;
6090 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6093 exp->string = PrintInt(--op1->i);
6096 exp->expType = op1->type;
6098 op1->type->refCount++;
6103 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6106 exp->string = PrintUInt(--op1->ui);
6109 exp->expType = op1->type;
6111 op1->type->refCount++;
6116 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6119 exp->string = PrintShort(--op1->s);
6122 exp->expType = op1->type;
6124 op1->type->refCount++;
6129 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6132 exp->string = PrintUShort(--op1->us);
6135 exp->expType = op1->type;
6137 op1->type->refCount++;
6142 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6145 exp->string = PrintChar(--op1->c);
6148 exp->expType = op1->type;
6150 op1->type->refCount++;
6155 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6158 exp->string = PrintUChar(--op1->uc);
6161 exp->expType = op1->type;
6163 op1->type->refCount++;
6168 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6171 exp->string = PrintFloat(--op1->f);
6174 exp->expType = op1->type;
6176 op1->type->refCount++;
6181 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6184 exp->string = PrintDouble(--op1->d);
6187 exp->expType = op1->type;
6189 op1->type->refCount++;
6194 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6196 int value2 = op2->i;
6199 exp->string = PrintInt(op1->i = value2);
6202 exp->expType = op1->type;
6204 op1->type->refCount++;
6209 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 unsigned int value2 = op2->ui;
6214 exp->string = PrintUInt(op1->ui = value2);
6217 exp->expType = op1->type;
6219 op1->type->refCount++;
6224 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 short value2 = op2->s;
6229 exp->string = PrintShort(op1->s = value2);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 unsigned short value2 = op2->us;
6244 exp->string = PrintUShort(op1->us = value2);
6247 exp->expType = op1->type;
6249 op1->type->refCount++;
6254 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 char value2 = op2->c;
6259 exp->string = PrintChar(op1->c = value2);
6262 exp->expType = op1->type;
6264 op1->type->refCount++;
6269 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 unsigned char value2 = op2->uc;
6274 exp->string = PrintUChar(op1->uc = value2);
6277 exp->expType = op1->type;
6279 op1->type->refCount++;
6284 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 float value2 = op2->f;
6289 exp->string = PrintFloat(op1->f = value2);
6292 exp->expType = op1->type;
6294 op1->type->refCount++;
6299 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 double value2 = op2->d;
6304 exp->string = PrintDouble(op1->d = value2);
6307 exp->expType = op1->type;
6309 op1->type->refCount++;
6314 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 int value2 = op2->i;
6319 exp->string = PrintInt(op1->i += value2);
6322 exp->expType = op1->type;
6324 op1->type->refCount++;
6329 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 unsigned int value2 = op2->ui;
6334 exp->string = PrintUInt(op1->ui += value2);
6337 exp->expType = op1->type;
6339 op1->type->refCount++;
6344 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 short value2 = op2->s;
6349 exp->string = PrintShort(op1->s += value2);
6352 exp->expType = op1->type;
6354 op1->type->refCount++;
6359 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6361 unsigned short value2 = op2->us;
6364 exp->string = PrintUShort(op1->us += value2);
6367 exp->expType = op1->type;
6369 op1->type->refCount++;
6374 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6376 char value2 = op2->c;
6379 exp->string = PrintChar(op1->c += value2);
6382 exp->expType = op1->type;
6384 op1->type->refCount++;
6389 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6391 unsigned char value2 = op2->uc;
6394 exp->string = PrintUChar(op1->uc += value2);
6397 exp->expType = op1->type;
6399 op1->type->refCount++;
6404 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6406 float value2 = op2->f;
6409 exp->string = PrintFloat(op1->f += value2);
6412 exp->expType = op1->type;
6414 op1->type->refCount++;
6419 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6421 double value2 = op2->d;
6424 exp->string = PrintDouble(op1->d += value2);
6427 exp->expType = op1->type;
6429 op1->type->refCount++;
6434 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6436 int value2 = op2->i;
6439 exp->string = PrintInt(op1->i -= value2);
6442 exp->expType = op1->type;
6444 op1->type->refCount++;
6449 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6451 unsigned int value2 = op2->ui;
6454 exp->string = PrintUInt(op1->ui -= value2);
6457 exp->expType = op1->type;
6459 op1->type->refCount++;
6464 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6466 short value2 = op2->s;
6469 exp->string = PrintShort(op1->s -= value2);
6472 exp->expType = op1->type;
6474 op1->type->refCount++;
6479 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6481 unsigned short value2 = op2->us;
6484 exp->string = PrintUShort(op1->us -= value2);
6487 exp->expType = op1->type;
6489 op1->type->refCount++;
6494 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6496 char value2 = op2->c;
6499 exp->string = PrintChar(op1->c -= value2);
6502 exp->expType = op1->type;
6504 op1->type->refCount++;
6509 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6511 unsigned char value2 = op2->uc;
6514 exp->string = PrintUChar(op1->uc -= value2);
6517 exp->expType = op1->type;
6519 op1->type->refCount++;
6524 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6526 float value2 = op2->f;
6529 exp->string = PrintFloat(op1->f -= value2);
6532 exp->expType = op1->type;
6534 op1->type->refCount++;
6539 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6541 double value2 = op2->d;
6544 exp->string = PrintDouble(op1->d -= value2);
6547 exp->expType = op1->type;
6549 op1->type->refCount++;
6554 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6556 int value2 = op2->i;
6559 exp->string = PrintInt(op1->i *= value2);
6562 exp->expType = op1->type;
6564 op1->type->refCount++;
6569 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6571 unsigned int value2 = op2->ui;
6574 exp->string = PrintUInt(op1->ui *= value2);
6577 exp->expType = op1->type;
6579 op1->type->refCount++;
6584 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6586 short value2 = op2->s;
6589 exp->string = PrintShort(op1->s *= value2);
6592 exp->expType = op1->type;
6594 op1->type->refCount++;
6599 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6601 unsigned short value2 = op2->us;
6604 exp->string = PrintUShort(op1->us *= value2);
6607 exp->expType = op1->type;
6609 op1->type->refCount++;
6614 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6616 char value2 = op2->c;
6619 exp->string = PrintChar(op1->c *= value2);
6622 exp->expType = op1->type;
6624 op1->type->refCount++;
6629 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6631 unsigned char value2 = op2->uc;
6634 exp->string = PrintUChar(op1->uc *= value2);
6637 exp->expType = op1->type;
6639 op1->type->refCount++;
6644 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6646 float value2 = op2->f;
6649 exp->string = PrintFloat(op1->f *= value2);
6652 exp->expType = op1->type;
6654 op1->type->refCount++;
6659 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6661 double value2 = op2->d;
6664 exp->string = PrintDouble(op1->d *= value2);
6667 exp->expType = op1->type;
6669 op1->type->refCount++;
6674 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6676 int value2 = op2->i;
6679 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6682 exp->expType = op1->type;
6684 op1->type->refCount++;
6689 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6691 unsigned int value2 = op2->ui;
6694 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6697 exp->expType = op1->type;
6699 op1->type->refCount++;
6704 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6706 short value2 = op2->s;
6709 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6712 exp->expType = op1->type;
6714 op1->type->refCount++;
6719 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6721 unsigned short value2 = op2->us;
6724 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6727 exp->expType = op1->type;
6729 op1->type->refCount++;
6734 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6736 char value2 = op2->c;
6739 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6742 exp->expType = op1->type;
6744 op1->type->refCount++;
6749 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 unsigned char value2 = op2->uc;
6754 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6757 exp->expType = op1->type;
6759 op1->type->refCount++;
6764 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 float value2 = op2->f;
6769 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6772 exp->expType = op1->type;
6774 op1->type->refCount++;
6779 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 double value2 = op2->d;
6784 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6787 exp->expType = op1->type;
6789 op1->type->refCount++;
6794 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 int value2 = op2->i;
6799 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6802 exp->expType = op1->type;
6804 op1->type->refCount++;
6809 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 unsigned int value2 = op2->ui;
6814 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
6817 exp->expType = op1->type;
6819 op1->type->refCount++;
6824 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 short value2 = op2->s;
6829 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
6832 exp->expType = op1->type;
6834 op1->type->refCount++;
6839 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 unsigned short value2 = op2->us;
6844 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
6847 exp->expType = op1->type;
6849 op1->type->refCount++;
6854 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 char value2 = op2->c;
6859 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
6862 exp->expType = op1->type;
6864 op1->type->refCount++;
6869 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 unsigned char value2 = op2->uc;
6874 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
6877 exp->expType = op1->type;
6879 op1->type->refCount++;
6884 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 int value2 = op2->i;
6889 exp->string = PrintInt(op1->i & value2);
6892 exp->expType = op1->type;
6894 op1->type->refCount++;
6899 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 unsigned int value2 = op2->ui;
6904 exp->string = PrintUInt(op1->ui & value2);
6907 exp->expType = op1->type;
6909 op1->type->refCount++;
6914 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 short value2 = op2->s;
6919 exp->string = PrintShort(op1->s & value2);
6922 exp->expType = op1->type;
6924 op1->type->refCount++;
6929 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 unsigned short value2 = op2->us;
6934 exp->string = PrintUShort(op1->us & value2);
6937 exp->expType = op1->type;
6939 op1->type->refCount++;
6944 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 char value2 = op2->c;
6949 exp->string = PrintChar(op1->c & value2);
6952 exp->expType = op1->type;
6954 op1->type->refCount++;
6959 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 unsigned char value2 = op2->uc;
6964 exp->string = PrintUChar(op1->uc & value2);
6967 exp->expType = op1->type;
6969 op1->type->refCount++;
6974 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 int value2 = op2->i;
6979 exp->string = PrintInt(op1->i | value2);
6982 exp->expType = op1->type;
6984 op1->type->refCount++;
6989 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 unsigned int value2 = op2->ui;
6994 exp->string = PrintUInt(op1->ui | value2);
6997 exp->expType = op1->type;
6999 op1->type->refCount++;
7004 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 short value2 = op2->s;
7009 exp->string = PrintShort(op1->s | value2);
7012 exp->expType = op1->type;
7014 op1->type->refCount++;
7019 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 unsigned short value2 = op2->us;
7024 exp->string = PrintUShort(op1->us | value2);
7027 exp->expType = op1->type;
7029 op1->type->refCount++;
7034 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 char value2 = op2->c;
7039 exp->string = PrintChar(op1->c | value2);
7042 exp->expType = op1->type;
7044 op1->type->refCount++;
7049 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 unsigned char value2 = op2->uc;
7054 exp->string = PrintUChar(op1->uc | value2);
7057 exp->expType = op1->type;
7059 op1->type->refCount++;
7064 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 int value2 = op2->i;
7069 exp->string = PrintInt(op1->i ^ value2);
7072 exp->expType = op1->type;
7074 op1->type->refCount++;
7079 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 unsigned int value2 = op2->ui;
7084 exp->string = PrintUInt(op1->ui ^ value2);
7087 exp->expType = op1->type;
7089 op1->type->refCount++;
7094 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 short value2 = op2->s;
7099 exp->string = PrintShort(op1->s ^ value2);
7102 exp->expType = op1->type;
7104 op1->type->refCount++;
7109 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 unsigned short value2 = op2->us;
7114 exp->string = PrintUShort(op1->us ^ value2);
7117 exp->expType = op1->type;
7119 op1->type->refCount++;
7124 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 char value2 = op2->c;
7129 exp->string = PrintChar(op1->c ^ value2);
7132 exp->expType = op1->type;
7134 op1->type->refCount++;
7139 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 unsigned char value2 = op2->uc;
7144 exp->string = PrintUChar(op1->uc ^ value2);
7147 exp->expType = op1->type;
7149 op1->type->refCount++;
7154 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 int value2 = op2->i;
7159 exp->string = PrintInt(op1->i << value2);
7162 exp->expType = op1->type;
7164 op1->type->refCount++;
7169 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 unsigned int value2 = op2->ui;
7174 exp->string = PrintUInt(op1->ui << value2);
7177 exp->expType = op1->type;
7179 op1->type->refCount++;
7184 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 short value2 = op2->s;
7189 exp->string = PrintShort(op1->s << value2);
7192 exp->expType = op1->type;
7194 op1->type->refCount++;
7199 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 unsigned short value2 = op2->us;
7204 exp->string = PrintUShort(op1->us << value2);
7207 exp->expType = op1->type;
7209 op1->type->refCount++;
7214 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 char value2 = op2->c;
7219 exp->string = PrintChar(op1->c << value2);
7222 exp->expType = op1->type;
7224 op1->type->refCount++;
7229 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 unsigned char value2 = op2->uc;
7234 exp->string = PrintUChar(op1->uc << value2);
7237 exp->expType = op1->type;
7239 op1->type->refCount++;
7244 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 int value2 = op2->i;
7249 exp->string = PrintInt(op1->i >> value2);
7252 exp->expType = op1->type;
7254 op1->type->refCount++;
7259 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 unsigned int value2 = op2->ui;
7264 exp->string = PrintUInt(op1->ui >> value2);
7267 exp->expType = op1->type;
7269 op1->type->refCount++;
7274 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 short value2 = op2->s;
7279 exp->string = PrintShort(op1->s >> value2);
7282 exp->expType = op1->type;
7284 op1->type->refCount++;
7289 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 unsigned short value2 = op2->us;
7294 exp->string = PrintUShort(op1->us >> value2);
7297 exp->expType = op1->type;
7299 op1->type->refCount++;
7304 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 char value2 = op2->c;
7309 exp->string = PrintChar(op1->c >> value2);
7312 exp->expType = op1->type;
7314 op1->type->refCount++;
7319 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 unsigned char value2 = op2->uc;
7324 exp->string = PrintUChar(op1->uc >> value2);
7327 exp->expType = op1->type;
7329 op1->type->refCount++;
7334 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7337 exp->string = PrintInt(~op1->i);
7340 exp->expType = op1->type;
7342 op1->type->refCount++;
7347 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7350 exp->string = PrintUInt(~op1->ui);
7353 exp->expType = op1->type;
7355 op1->type->refCount++;
7360 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7363 exp->string = PrintShort(~op1->s);
7366 exp->expType = op1->type;
7368 op1->type->refCount++;
7373 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7376 exp->string = PrintUShort(~op1->us);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7389 exp->string = PrintChar(~op1->c);
7392 exp->expType = op1->type;
7394 op1->type->refCount++;
7399 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7402 exp->string = PrintUChar(~op1->uc);
7405 exp->expType = op1->type;
7407 op1->type->refCount++;
7412 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7414 int value2 = op2->i;
7417 exp->string = PrintInt(op1->i &= value2);
7420 exp->expType = op1->type;
7422 op1->type->refCount++;
7427 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7429 unsigned int value2 = op2->ui;
7432 exp->string = PrintUInt(op1->ui &= value2);
7435 exp->expType = op1->type;
7437 op1->type->refCount++;
7442 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7444 short value2 = op2->s;
7447 exp->string = PrintShort(op1->s &= value2);
7450 exp->expType = op1->type;
7452 op1->type->refCount++;
7457 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7459 unsigned short value2 = op2->us;
7462 exp->string = PrintUShort(op1->us &= value2);
7465 exp->expType = op1->type;
7467 op1->type->refCount++;
7472 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7474 char value2 = op2->c;
7477 exp->string = PrintChar(op1->c &= value2);
7480 exp->expType = op1->type;
7482 op1->type->refCount++;
7487 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7489 unsigned char value2 = op2->uc;
7492 exp->string = PrintUChar(op1->uc &= value2);
7495 exp->expType = op1->type;
7497 op1->type->refCount++;
7502 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7504 int value2 = op2->i;
7507 exp->string = PrintInt(op1->i |= value2);
7510 exp->expType = op1->type;
7512 op1->type->refCount++;
7517 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7519 unsigned int value2 = op2->ui;
7522 exp->string = PrintUInt(op1->ui |= value2);
7525 exp->expType = op1->type;
7527 op1->type->refCount++;
7532 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7534 short value2 = op2->s;
7537 exp->string = PrintShort(op1->s |= value2);
7540 exp->expType = op1->type;
7542 op1->type->refCount++;
7547 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7549 unsigned short value2 = op2->us;
7552 exp->string = PrintUShort(op1->us |= value2);
7555 exp->expType = op1->type;
7557 op1->type->refCount++;
7562 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7564 char value2 = op2->c;
7567 exp->string = PrintChar(op1->c |= value2);
7570 exp->expType = op1->type;
7572 op1->type->refCount++;
7577 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7579 unsigned char value2 = op2->uc;
7582 exp->string = PrintUChar(op1->uc |= value2);
7585 exp->expType = op1->type;
7587 op1->type->refCount++;
7592 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7594 int value2 = op2->i;
7597 exp->string = PrintInt(op1->i ^= value2);
7600 exp->expType = op1->type;
7602 op1->type->refCount++;
7607 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7609 unsigned int value2 = op2->ui;
7612 exp->string = PrintUInt(op1->ui ^= value2);
7615 exp->expType = op1->type;
7617 op1->type->refCount++;
7622 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7624 short value2 = op2->s;
7627 exp->string = PrintShort(op1->s ^= value2);
7630 exp->expType = op1->type;
7632 op1->type->refCount++;
7637 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7639 unsigned short value2 = op2->us;
7642 exp->string = PrintUShort(op1->us ^= value2);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7654 char value2 = op2->c;
7657 exp->string = PrintChar(op1->c ^= value2);
7660 exp->expType = op1->type;
7662 op1->type->refCount++;
7667 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7669 unsigned char value2 = op2->uc;
7672 exp->string = PrintUChar(op1->uc ^= value2);
7675 exp->expType = op1->type;
7677 op1->type->refCount++;
7682 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7684 int value2 = op2->i;
7687 exp->string = PrintInt(op1->i <<= value2);
7690 exp->expType = op1->type;
7692 op1->type->refCount++;
7697 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7699 unsigned int value2 = op2->ui;
7702 exp->string = PrintUInt(op1->ui <<= value2);
7705 exp->expType = op1->type;
7707 op1->type->refCount++;
7712 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7714 short value2 = op2->s;
7717 exp->string = PrintShort(op1->s <<= value2);
7720 exp->expType = op1->type;
7722 op1->type->refCount++;
7727 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7729 unsigned short value2 = op2->us;
7732 exp->string = PrintUShort(op1->us <<= value2);
7735 exp->expType = op1->type;
7737 op1->type->refCount++;
7742 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7744 char value2 = op2->c;
7747 exp->string = PrintChar(op1->c <<= value2);
7750 exp->expType = op1->type;
7752 op1->type->refCount++;
7757 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7759 unsigned char value2 = op2->uc;
7762 exp->string = PrintUChar(op1->uc <<= value2);
7765 exp->expType = op1->type;
7767 op1->type->refCount++;
7772 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7774 int value2 = op2->i;
7777 exp->string = PrintInt(op1->i >>= value2);
7780 exp->expType = op1->type;
7782 op1->type->refCount++;
7787 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7789 unsigned int value2 = op2->ui;
7792 exp->string = PrintUInt(op1->ui >>= value2);
7795 exp->expType = op1->type;
7797 op1->type->refCount++;
7802 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7804 short value2 = op2->s;
7807 exp->string = PrintShort(op1->s >>= value2);
7810 exp->expType = op1->type;
7812 op1->type->refCount++;
7817 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7819 unsigned short value2 = op2->us;
7822 exp->string = PrintUShort(op1->us >>= value2);
7825 exp->expType = op1->type;
7827 op1->type->refCount++;
7832 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7834 char value2 = op2->c;
7837 exp->string = PrintChar(op1->c >>= value2);
7840 exp->expType = op1->type;
7842 op1->type->refCount++;
7847 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7849 unsigned char value2 = op2->uc;
7852 exp->string = PrintUChar(op1->uc >>= value2);
7855 exp->expType = op1->type;
7857 op1->type->refCount++;
7862 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
7865 exp->string = PrintInt(!op1->i);
7868 exp->expType = op1->type;
7870 op1->type->refCount++;
7875 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
7878 exp->string = PrintUInt(!op1->ui);
7881 exp->expType = op1->type;
7883 op1->type->refCount++;
7888 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
7891 exp->string = PrintShort(!op1->s);
7894 exp->expType = op1->type;
7896 op1->type->refCount++;
7901 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
7904 exp->string = PrintUShort(!op1->us);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
7917 exp->string = PrintChar(!op1->c);
7920 exp->expType = op1->type;
7922 op1->type->refCount++;
7927 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
7930 exp->string = PrintUChar(!op1->uc);
7933 exp->expType = op1->type;
7935 op1->type->refCount++;
7940 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7942 int value2 = op2->i;
7945 exp->string = PrintInt(op1->i == value2);
7948 exp->expType = op1->type;
7950 op1->type->refCount++;
7955 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7957 unsigned int value2 = op2->ui;
7960 exp->string = PrintUInt(op1->ui == value2);
7963 exp->expType = op1->type;
7965 op1->type->refCount++;
7970 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7972 short value2 = op2->s;
7975 exp->string = PrintShort(op1->s == value2);
7978 exp->expType = op1->type;
7980 op1->type->refCount++;
7985 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7987 unsigned short value2 = op2->us;
7990 exp->string = PrintUShort(op1->us == value2);
7993 exp->expType = op1->type;
7995 op1->type->refCount++;
8000 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8002 char value2 = op2->c;
8005 exp->string = PrintChar(op1->c == value2);
8008 exp->expType = op1->type;
8010 op1->type->refCount++;
8015 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8017 unsigned char value2 = op2->uc;
8020 exp->string = PrintUChar(op1->uc == value2);
8023 exp->expType = op1->type;
8025 op1->type->refCount++;
8030 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8032 float value2 = op2->f;
8035 exp->string = PrintFloat(op1->f == value2);
8038 exp->expType = op1->type;
8040 op1->type->refCount++;
8045 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8047 double value2 = op2->d;
8050 exp->string = PrintDouble(op1->d == value2);
8053 exp->expType = op1->type;
8055 op1->type->refCount++;
8060 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8062 int value2 = op2->i;
8065 exp->string = PrintInt(op1->i != value2);
8068 exp->expType = op1->type;
8070 op1->type->refCount++;
8075 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8077 unsigned int value2 = op2->ui;
8080 exp->string = PrintUInt(op1->ui != value2);
8083 exp->expType = op1->type;
8085 op1->type->refCount++;
8090 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8092 short value2 = op2->s;
8095 exp->string = PrintShort(op1->s != value2);
8098 exp->expType = op1->type;
8100 op1->type->refCount++;
8105 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8107 unsigned short value2 = op2->us;
8110 exp->string = PrintUShort(op1->us != value2);
8113 exp->expType = op1->type;
8115 op1->type->refCount++;
8120 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8122 char value2 = op2->c;
8125 exp->string = PrintChar(op1->c != value2);
8128 exp->expType = op1->type;
8130 op1->type->refCount++;
8135 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8137 unsigned char value2 = op2->uc;
8140 exp->string = PrintUChar(op1->uc != value2);
8143 exp->expType = op1->type;
8145 op1->type->refCount++;
8150 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8152 float value2 = op2->f;
8155 exp->string = PrintFloat(op1->f != value2);
8158 exp->expType = op1->type;
8160 op1->type->refCount++;
8165 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8167 double value2 = op2->d;
8170 exp->string = PrintDouble(op1->d != value2);
8173 exp->expType = op1->type;
8175 op1->type->refCount++;
8180 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8182 int value2 = op2->i;
8185 exp->string = PrintInt(op1->i && value2);
8188 exp->expType = op1->type;
8190 op1->type->refCount++;
8195 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8197 unsigned int value2 = op2->ui;
8200 exp->string = PrintUInt(op1->ui && value2);
8203 exp->expType = op1->type;
8205 op1->type->refCount++;
8210 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8212 short value2 = op2->s;
8215 exp->string = PrintShort(op1->s && value2);
8218 exp->expType = op1->type;
8220 op1->type->refCount++;
8225 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8227 unsigned short value2 = op2->us;
8230 exp->string = PrintUShort(op1->us && value2);
8233 exp->expType = op1->type;
8235 op1->type->refCount++;
8240 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8242 char value2 = op2->c;
8245 exp->string = PrintChar(op1->c && value2);
8248 exp->expType = op1->type;
8250 op1->type->refCount++;
8255 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8257 unsigned char value2 = op2->uc;
8260 exp->string = PrintUChar(op1->uc && value2);
8263 exp->expType = op1->type;
8265 op1->type->refCount++;
8270 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8272 float value2 = op2->f;
8275 exp->string = PrintFloat(op1->f && value2);
8278 exp->expType = op1->type;
8280 op1->type->refCount++;
8285 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8287 double value2 = op2->d;
8290 exp->string = PrintDouble(op1->d && value2);
8293 exp->expType = op1->type;
8295 op1->type->refCount++;
8300 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8302 int value2 = op2->i;
8305 exp->string = PrintInt(op1->i || value2);
8308 exp->expType = op1->type;
8310 op1->type->refCount++;
8315 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8317 unsigned int value2 = op2->ui;
8320 exp->string = PrintUInt(op1->ui || value2);
8323 exp->expType = op1->type;
8325 op1->type->refCount++;
8330 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8332 short value2 = op2->s;
8335 exp->string = PrintShort(op1->s || value2);
8338 exp->expType = op1->type;
8340 op1->type->refCount++;
8345 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8347 unsigned short value2 = op2->us;
8350 exp->string = PrintUShort(op1->us || value2);
8353 exp->expType = op1->type;
8355 op1->type->refCount++;
8360 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8362 char value2 = op2->c;
8365 exp->string = PrintChar(op1->c || value2);
8368 exp->expType = op1->type;
8370 op1->type->refCount++;
8375 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8377 unsigned char value2 = op2->uc;
8380 exp->string = PrintUChar(op1->uc || value2);
8383 exp->expType = op1->type;
8385 op1->type->refCount++;
8390 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8392 float value2 = op2->f;
8395 exp->string = PrintFloat(op1->f || value2);
8398 exp->expType = op1->type;
8400 op1->type->refCount++;
8405 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8407 double value2 = op2->d;
8410 exp->string = PrintDouble(op1->d || value2);
8413 exp->expType = op1->type;
8415 op1->type->refCount++;
8420 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8422 int value2 = op2->i;
8425 exp->string = PrintInt(op1->i > value2);
8428 exp->expType = op1->type;
8430 op1->type->refCount++;
8435 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8437 unsigned int value2 = op2->ui;
8440 exp->string = PrintUInt(op1->ui > value2);
8443 exp->expType = op1->type;
8445 op1->type->refCount++;
8450 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8452 short value2 = op2->s;
8455 exp->string = PrintShort(op1->s > value2);
8458 exp->expType = op1->type;
8460 op1->type->refCount++;
8465 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8467 unsigned short value2 = op2->us;
8470 exp->string = PrintUShort(op1->us > value2);
8473 exp->expType = op1->type;
8475 op1->type->refCount++;
8480 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8482 char value2 = op2->c;
8485 exp->string = PrintChar(op1->c > value2);
8488 exp->expType = op1->type;
8490 op1->type->refCount++;
8495 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8497 unsigned char value2 = op2->uc;
8500 exp->string = PrintUChar(op1->uc > value2);
8503 exp->expType = op1->type;
8505 op1->type->refCount++;
8510 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8512 float value2 = op2->f;
8515 exp->string = PrintFloat(op1->f > value2);
8518 exp->expType = op1->type;
8520 op1->type->refCount++;
8525 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8527 double value2 = op2->d;
8530 exp->string = PrintDouble(op1->d > value2);
8533 exp->expType = op1->type;
8535 op1->type->refCount++;
8540 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8542 int value2 = op2->i;
8545 exp->string = PrintInt(op1->i < value2);
8548 exp->expType = op1->type;
8550 op1->type->refCount++;
8555 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8557 unsigned int value2 = op2->ui;
8560 exp->string = PrintUInt(op1->ui < value2);
8563 exp->expType = op1->type;
8565 op1->type->refCount++;
8570 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8572 short value2 = op2->s;
8575 exp->string = PrintShort(op1->s < value2);
8578 exp->expType = op1->type;
8580 op1->type->refCount++;
8585 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8587 unsigned short value2 = op2->us;
8590 exp->string = PrintUShort(op1->us < value2);
8593 exp->expType = op1->type;
8595 op1->type->refCount++;
8600 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8602 char value2 = op2->c;
8605 exp->string = PrintChar(op1->c < value2);
8608 exp->expType = op1->type;
8610 op1->type->refCount++;
8615 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8617 unsigned char value2 = op2->uc;
8620 exp->string = PrintUChar(op1->uc < value2);
8623 exp->expType = op1->type;
8625 op1->type->refCount++;
8630 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8632 float value2 = op2->f;
8635 exp->string = PrintFloat(op1->f < value2);
8638 exp->expType = op1->type;
8640 op1->type->refCount++;
8645 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8647 double value2 = op2->d;
8650 exp->string = PrintDouble(op1->d < value2);
8653 exp->expType = op1->type;
8655 op1->type->refCount++;
8660 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8662 int value2 = op2->i;
8665 exp->string = PrintInt(op1->i >= value2);
8668 exp->expType = op1->type;
8670 op1->type->refCount++;
8675 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8677 unsigned int value2 = op2->ui;
8680 exp->string = PrintUInt(op1->ui >= value2);
8683 exp->expType = op1->type;
8685 op1->type->refCount++;
8690 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8692 short value2 = op2->s;
8695 exp->string = PrintShort(op1->s >= value2);
8698 exp->expType = op1->type;
8700 op1->type->refCount++;
8705 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8707 unsigned short value2 = op2->us;
8710 exp->string = PrintUShort(op1->us >= value2);
8713 exp->expType = op1->type;
8715 op1->type->refCount++;
8720 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8722 char value2 = op2->c;
8725 exp->string = PrintChar(op1->c >= value2);
8728 exp->expType = op1->type;
8730 op1->type->refCount++;
8735 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8737 unsigned char value2 = op2->uc;
8740 exp->string = PrintUChar(op1->uc >= value2);
8743 exp->expType = op1->type;
8745 op1->type->refCount++;
8750 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8752 float value2 = op2->f;
8755 exp->string = PrintFloat(op1->f >= value2);
8758 exp->expType = op1->type;
8760 op1->type->refCount++;
8765 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8767 double value2 = op2->d;
8770 exp->string = PrintDouble(op1->d >= value2);
8773 exp->expType = op1->type;
8775 op1->type->refCount++;
8780 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8782 int value2 = op2->i;
8785 exp->string = PrintInt(op1->i <= value2);
8788 exp->expType = op1->type;
8790 op1->type->refCount++;
8795 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8797 unsigned int value2 = op2->ui;
8800 exp->string = PrintUInt(op1->ui <= value2);
8803 exp->expType = op1->type;
8805 op1->type->refCount++;
8810 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8812 short value2 = op2->s;
8815 exp->string = PrintShort(op1->s <= value2);
8818 exp->expType = op1->type;
8820 op1->type->refCount++;
8825 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8827 unsigned short value2 = op2->us;
8830 exp->string = PrintUShort(op1->us <= value2);
8833 exp->expType = op1->type;
8835 op1->type->refCount++;
8840 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8842 char value2 = op2->c;
8845 exp->string = PrintChar(op1->c <= value2);
8848 exp->expType = op1->type;
8850 op1->type->refCount++;
8855 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8857 unsigned char value2 = op2->uc;
8860 exp->string = PrintUChar(op1->uc <= value2);
8863 exp->expType = op1->type;
8865 op1->type->refCount++;
8870 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8872 float value2 = op2->f;
8875 exp->string = PrintFloat(op1->f <= value2);
8878 exp->expType = op1->type;
8880 op1->type->refCount++;
8885 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8887 double value2 = op2->d;
8890 exp->string = PrintDouble(op1->d <= value2);
8893 exp->expType = op1->type;
8895 op1->type->refCount++;
8900 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8903 exp->string = PrintInt(op1->i ? op2->i : op3->i);
8906 exp->expType = op1->type;
8908 op1->type->refCount++;
8913 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8916 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
8919 exp->expType = op1->type;
8921 op1->type->refCount++;
8926 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8929 exp->string = PrintShort(op1->s ? op2->s : op3->s);
8932 exp->expType = op1->type;
8934 op1->type->refCount++;
8939 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8942 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8955 exp->string = PrintChar(op1->c ? op2->c : op3->c);
8958 exp->expType = op1->type;
8960 op1->type->refCount++;
8965 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8968 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
8971 exp->expType = op1->type;
8973 op1->type->refCount++;
8978 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8981 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
8984 exp->expType = op1->type;
8986 op1->type->refCount++;
8991 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
8994 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
8997 exp->expType = op1->type;
8999 op1->type->refCount++;
9004 struct OpTable intOps =
9006 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
9009 struct OpTable uintOps =
9011 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
9014 struct OpTable shortOps =
9016 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
9019 struct OpTable ushortOps =
9021 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
9024 struct OpTable floatOps =
9026 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
9029 struct OpTable doubleOps =
9031 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
9034 struct OpTable charOps =
9036 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
9039 struct OpTable ucharOps =
9041 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
9044 void ReadString(char * output, char * string)
9046 int len = strlen(string);
9048 unsigned int quoted = 0x0, escaped = 0x0;
9050 for(c = 0; c < len; c++)
9052 char ch = string[c];
9108 extern double strtod(char * , char * * );
9110 struct Operand GetOperand(struct Expression * exp)
9116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9119 struct Type * type = exp->expType;
9123 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9125 if(!type->_class->registered->dataType)
9126 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9127 type = type->_class->registered->dataType;
9129 op.kind = type->kind;
9130 op.type = exp->expType;
9131 if(exp->isConstant && exp->type == 2)
9137 if(exp->constant[0] == '\'')
9138 op.c = exp->constant[1];
9139 else if(type->isSigned)
9141 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9146 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9154 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9159 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9167 op.i = strtol(exp->constant, (((void *)0)), 0);
9172 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9180 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9185 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9191 op.f = (float)strtod(exp->constant, (((void *)0)));
9195 op.d = (double)strtod(exp->constant, (((void *)0)));
9201 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9211 int __ecereVMethodID_class_OnGetString;
9213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9215 static void UnusedFunction()
9219 ((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);
9222 extern int __ecereVMethodID_class_OnGetString;
9224 extern int printf(char * , ...);
9226 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9228 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9230 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9232 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9233 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9236 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9237 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9239 void * ptr = inst->data + dataMember->offset + offset;
9240 char * result = (((void *)0));
9242 exp->loc = member->loc = inst->loc;
9243 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9244 if(!dataMember->dataType)
9245 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9246 type = dataMember->dataType;
9249 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9251 if(_class->type == 4)
9253 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9257 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9258 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9260 for(item = e->values.first; item; item = item->next)
9262 if((int)item->data == *(int *)ptr)
9264 result = item->name;
9270 exp->identifier = MkIdentifier(result);
9272 exp->destType = MkClassType(_class->fullName);
9273 ProcessExpressionType(exp);
9277 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9279 if(!_class->dataType)
9280 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9281 type = _class->dataType;
9290 FreeExpContents(exp);
9291 exp->constant = PrintFloat(*(float *)ptr);
9297 FreeExpContents(exp);
9298 exp->constant = PrintDouble(*(double *)ptr);
9304 FreeExpContents(exp);
9305 exp->constant = PrintInt(*(int *)ptr);
9311 FreeExpContents(exp);
9312 exp->constant = PrintInt64(*(long long *)ptr);
9317 printf("error: unhandled type populating instance\n");
9320 ListAdd(memberList, member);
9322 if(parentDataMember->type == 1)
9327 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9329 void PopulateInstance(struct Instantiation * inst)
9331 struct Symbol * classSym = inst->_class->symbol;
9332 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9333 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9334 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9336 inst->members = MkListOne(MkMembersInitList(memberList));
9337 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9339 if(!dataMember->isProperty)
9341 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9342 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9345 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9346 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9348 void * ptr = inst->data + dataMember->offset;
9349 char * result = (((void *)0));
9351 exp->loc = member->loc = inst->loc;
9352 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9353 if(!dataMember->dataType)
9354 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9355 type = dataMember->dataType;
9358 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9360 if(_class->type == 4)
9362 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9366 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9367 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9369 for(item = e->values.first; item; item = item->next)
9371 if((int)item->data == *(int *)ptr)
9373 result = item->name;
9380 exp->identifier = MkIdentifier(result);
9382 exp->destType = MkClassType(_class->fullName);
9383 ProcessExpressionType(exp);
9386 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9388 if(!_class->dataType)
9389 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9390 type = _class->dataType;
9399 exp->constant = PrintFloat(*(float *)ptr);
9405 exp->constant = PrintDouble(*(double *)ptr);
9411 exp->constant = PrintInt(*(int *)ptr);
9417 exp->constant = PrintInt64(*(long long *)ptr);
9422 printf("error: unhandled type populating instance\n");
9425 ListAdd(memberList, member);
9431 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);
9433 extern void FreeInstance(struct Instantiation * inst);
9435 void ComputeInstantiation(struct Expression * exp)
9437 struct Instantiation * inst = exp->instance;
9438 struct MembersInit * members;
9439 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9440 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9441 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9442 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9443 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9444 int subMemberStackPos = 0;
9447 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9451 if(_class->type == 0 || _class->type == 5)
9452 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9454 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9458 for(members = (*inst->members).first; members; members = members->next)
9460 switch(members->type)
9464 if(members->dataMembers)
9466 struct MemberInit * member;
9468 for(member = (*members->dataMembers).first; member; member = member->next)
9470 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9471 unsigned int found = 0x0;
9472 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9473 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9474 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9475 unsigned int dataMemberOffset;
9479 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9482 if(curMember->isProperty)
9483 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9486 dataMember = curMember;
9487 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9494 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9498 if(prop->memberAccess == 1)
9500 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9501 curClass = prop->_class;
9506 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9507 int _subMemberStackPos = 0;
9509 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9513 if(dataMember->memberAccess == 1)
9515 curMember = dataMember;
9516 curClass = dataMember->_class;
9517 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9518 subMemberStackPos = _subMemberStackPos;
9523 if(found && member->initializer && member->initializer->type == 0)
9525 struct Expression * value = member->initializer->exp;
9526 struct Type * type = (((void *)0));
9530 type = prop->dataType;
9534 if(!dataMember->dataType)
9535 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9536 type = dataMember->dataType;
9538 if(ident && ident->next)
9540 for(ident = ident->next; ident && type; ident = ident->next)
9544 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9546 type = prop->dataType;
9549 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9551 type = dataMember->dataType;
9554 else if(type->kind == 9 || type->kind == 10)
9556 struct Type * memberType;
9558 for(memberType = type->members.first; memberType; memberType = memberType->next)
9560 if(!strcmp(memberType->name, ident->string))
9571 FreeType(value->destType);
9572 value->destType = type;
9575 ComputeExpression(value);
9577 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9581 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9583 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9585 if(!_class->dataType)
9586 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9587 type = _class->dataType;
9592 void * ptr = inst->data + dataMemberOffset;
9594 if(value->type == 2)
9600 GetInt(value, (int *)ptr);
9605 GetInt64(value, (long long *)ptr);
9610 GetFloat(value, (float *)ptr);
9615 GetDouble(value, (double *)ptr);
9620 else if(value->type == 1)
9624 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9626 if(_class->type == 1)
9628 ComputeTypeSize(type);
9629 if(value->instance->data)
9630 memcpy(ptr, value->instance->data, type->size);
9637 if(value->type == 1 && value->instance->data)
9639 void (* Set)(void *, void *) = (void *)prop->Set;
9641 Set(inst->data, value->instance->data);
9642 PopulateInstance(inst);
9644 else if(value->type == 2)
9650 void (* Set)(void *, double) = (void *)prop->Set;
9652 Set(inst->data, strtod(value->constant, (((void *)0))));
9657 void (* Set)(void *, float) = (void *)prop->Set;
9659 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9664 void (* Set)(void *, int) = (void *)prop->Set;
9666 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9671 void (* Set)(void *, long long) = (void *)prop->Set;
9673 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9678 else if(value->type == 3)
9682 ReadString(temp, value->string);
9683 prop->Set(inst->data, temp);
9687 else if(_class->type == 3)
9691 if(value->type == 2)
9695 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9697 if(_class->type == 3)
9699 if(!_class->dataType)
9700 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9701 type = _class->dataType;
9709 float (* Set)(float) = (void *)prop->Set;
9711 GetFloat(member->initializer->exp, &fValue);
9712 exp->constant = PrintFloat(Set(fValue));
9719 double (* Set)(double) = (void *)prop->Set;
9721 GetDouble(member->initializer->exp, &dValue);
9722 exp->constant = PrintDouble(Set(dValue));
9730 else if(_class->type == 2)
9734 if(value->type == 1 && value->instance->data)
9736 unsigned int (* Set)(void *) = (void *)prop->Set;
9738 bits = Set(value->instance->data);
9740 else if(value->type == 2)
9746 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9750 GetInt(value, &part);
9751 bits = (bits & ~bitMember->mask);
9752 if(!bitMember->dataType)
9753 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9754 type = bitMember->dataType;
9755 if(type->kind == 8 && type->_class && type->_class->registered)
9757 if(!type->_class->registered->dataType)
9758 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9759 type = type->_class->registered->dataType;
9765 bits |= ((char)part << bitMember->pos);
9767 bits |= ((unsigned char)part << bitMember->pos);
9771 bits |= ((short)part << bitMember->pos);
9773 bits |= ((unsigned short)part << bitMember->pos);
9778 bits |= (part << bitMember->pos);
9780 bits |= ((unsigned int)part << bitMember->pos);
9784 bits |= ((long long)part << bitMember->pos);
9786 bits |= ((uint64)part << bitMember->pos);
9794 if(_class && _class->type == 3)
9796 ComputeExpression(member->initializer->exp);
9797 exp->constant = member->initializer->exp->constant;
9799 member->initializer->exp->constant = (((void *)0));
9809 if(_class && _class->type == 2)
9811 exp->constant = PrintHexUInt(bits);
9820 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
9822 if(exp->op.op == 261)
9824 FreeExpContents(exp);
9826 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
9836 struct Expression * exp2 = exp->op.exp2;
9838 exp->op.exp2 = (((void *)0));
9839 FreeExpContents(exp);
9840 FreeType(exp->expType);
9841 FreeType(exp->destType);
9843 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
9849 FreeExpContents(exp);
9850 op1->ops.Neg(exp, op1);
9856 FreeExpContents(exp);
9857 op1->ops.BitNot(exp, op1);
9863 FreeExpContents(exp);
9864 op1->ops.Not(exp, op1);
9876 FreeExpContents(exp);
9877 op1->ops.Add(exp, op1, op2);
9883 FreeExpContents(exp);
9884 op1->ops.Sub(exp, op1, op2);
9890 FreeExpContents(exp);
9891 op1->ops.Mul(exp, op1, op2);
9897 FreeExpContents(exp);
9898 op1->ops.Div(exp, op1, op2);
9904 FreeExpContents(exp);
9905 op1->ops.Mod(exp, op1, op2);
9913 FreeExpContents(exp);
9914 op1->ops.BitAnd(exp, op1, op2);
9921 FreeExpContents(exp);
9922 op1->ops.BitOr(exp, op1, op2);
9928 FreeExpContents(exp);
9929 op1->ops.BitXor(exp, op1, op2);
9935 FreeExpContents(exp);
9936 op1->ops.LShift(exp, op1, op2);
9942 FreeExpContents(exp);
9943 op1->ops.RShift(exp, op1, op2);
9949 FreeExpContents(exp);
9950 op1->ops.Equ(exp, op1, op2);
9956 FreeExpContents(exp);
9957 op1->ops.Nqu(exp, op1, op2);
9963 FreeExpContents(exp);
9964 op1->ops.And(exp, op1, op2);
9970 FreeExpContents(exp);
9971 op1->ops.Or(exp, op1, op2);
9977 FreeExpContents(exp);
9978 op1->ops.Grt(exp, op1, op2);
9984 FreeExpContents(exp);
9985 op1->ops.Sma(exp, op1, op2);
9991 FreeExpContents(exp);
9992 op1->ops.GrtEqu(exp, op1, op2);
9998 FreeExpContents(exp);
9999 op1->ops.SmaEqu(exp, op1, op2);
10007 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10009 void ComputeExpression(struct Expression * exp)
10011 char expString[10240];
10013 expString[0] = '\0';
10018 ComputeInstantiation(exp);
10023 struct Expression * exp1, * exp2 = (((void *)0));
10024 struct Operand op1 =
10028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10031 struct Operand op2 =
10035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10040 ComputeExpression(exp->op.exp2);
10043 ComputeExpression(exp->op.exp1);
10044 exp1 = exp->op.exp1;
10045 exp2 = exp->op.exp2;
10046 op1 = GetOperand(exp1);
10048 op1.type->refCount++;
10051 op2 = GetOperand(exp2);
10053 op2.type->refCount++;
10058 exp1 = exp->op.exp2;
10059 op1 = GetOperand(exp1);
10061 op1.type->refCount++;
10063 CallOperator(exp, exp1, exp2, &op1, &op2);
10065 FreeType(op1.type);
10067 FreeType(op2.type);
10073 struct Expression * e, * n;
10075 for(e = (*exp->list).first; e; e = n)
10080 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10082 ComputeExpression(e);
10083 FreeType(exp->expType);
10084 FreeType(exp->destType);
10086 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10087 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10098 struct Expression * memberExp = exp->member.exp;
10099 struct Identifier * memberID = exp->member.member;
10100 struct Type * type;
10102 ComputeExpression(exp->member.exp);
10103 type = exp->member.exp->expType;
10106 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)));
10107 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10108 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10109 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10111 if(type->kind == 19 && exp->member.exp->type == 26)
10112 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10116 struct Symbol * classSym;
10119 PrintType(type, string, 0x0, 0x1);
10120 classSym = FindClass(string);
10121 _class = classSym ? classSym->registered : (((void *)0));
10123 if(exp->member.member)
10125 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10127 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10129 if(!prop && !member && _class && exp->member.member)
10131 struct Symbol * classSym = FindClass(exp->member.member->string);
10133 convertTo = _class;
10134 _class = classSym ? classSym->registered : (((void *)0));
10135 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10141 struct Type * type = prop->dataType;
10143 if(_class->type == 3)
10145 if(type->kind == 8)
10147 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10149 if(_class->type == 3)
10151 if(!_class->dataType)
10152 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10153 type = _class->dataType;
10161 float (* Get)(float) = (void *)prop->Get;
10163 GetFloat(exp->member.exp, &value);
10164 exp->constant = PrintFloat(Get ? Get(value) : value);
10171 double (* Get)(double);
10173 GetDouble(exp->member.exp, &value);
10175 Get = (void *)prop->Set;
10177 Get = (void *)prop->Get;
10178 exp->constant = PrintDouble(Get ? Get(value) : value);
10188 struct Expression * value = exp->member.exp;
10189 struct Type * type;
10191 if(!prop->dataType)
10192 ProcessPropertyType(prop);
10193 type = prop->dataType;
10197 else if(_class->type == 1)
10203 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10205 if(propertyClass->type == 1 && value->type == 1)
10207 void (* Set)(void *, void *) = (void *)prop->Set;
10209 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10210 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10211 exp->instance->_class = MkSpecifierName(_class->fullName);
10212 exp->instance->loc = exp->loc;
10214 Set(exp->instance->data, value->instance->data);
10215 PopulateInstance(exp->instance);
10222 void (* Set)(void *, int) = (void *)prop->Set;
10224 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10225 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10226 exp->instance->_class = MkSpecifierName(_class->fullName);
10227 exp->instance->loc = exp->loc;
10229 GetInt(value, &intValue);
10230 Set(exp->instance->data, intValue);
10231 PopulateInstance(exp->instance);
10236 long long intValue;
10237 void (* Set)(void *, long long) = (void *)prop->Set;
10239 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10240 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10241 exp->instance->_class = MkSpecifierName(_class->fullName);
10242 exp->instance->loc = exp->loc;
10244 GetInt64(value, &intValue);
10245 Set(exp->instance->data, intValue);
10246 PopulateInstance(exp->instance);
10251 double doubleValue;
10252 void (* Set)(void *, double) = (void *)prop->Set;
10254 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10255 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10256 exp->instance->_class = MkSpecifierName(_class->fullName);
10257 exp->instance->loc = exp->loc;
10259 GetDouble(value, &doubleValue);
10260 Set(exp->instance->data, doubleValue);
10261 PopulateInstance(exp->instance);
10266 else if(_class->type == 2)
10272 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10274 if(propertyClass->type == 1 && value->instance->data)
10276 unsigned int (* Set)(void *) = (void *)prop->Set;
10277 unsigned int bits = Set(value->instance->data);
10279 exp->constant = PrintHexUInt(bits);
10283 else if(_class->type == 2)
10285 unsigned int value;
10286 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10289 GetUInt(exp->member.exp, &value);
10291 exp->constant = PrintHexUInt(bits);
10300 if(_class->type == 2)
10302 unsigned int value;
10304 GetUInt(exp->member.exp, &value);
10309 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10311 if(_class->type == 1)
10313 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10315 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10316 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10317 exp->instance->_class = MkSpecifierName(_class->fullName);
10318 exp->instance->loc = exp->loc;
10320 Get(value, exp->instance->data);
10321 PopulateInstance(exp->instance);
10323 else if(_class->type == 2)
10325 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10326 uint64 bits = Get(value);
10328 exp->constant = PrintHexUInt64(bits);
10335 else if(_class->type == 1)
10337 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10343 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10345 if(_class->type == 1 && value)
10347 void (* Get)(void *, void *) = (void *)prop->Get;
10349 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10350 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10351 exp->instance->_class = MkSpecifierName(_class->fullName);
10352 exp->instance->loc = exp->loc;
10354 Get(value, exp->instance->data);
10355 PopulateInstance(exp->instance);
10366 exp->isConstant = 0x0;
10375 FreeExpression(memberExp);
10376 FreeIdentifier(memberID);
10382 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10384 FreeExpContents(exp);
10385 exp->constant = PrintUInt(ComputeTypeSize(type));
10392 struct Symbol * classSym = exp->_class->symbol;
10394 if(classSym && classSym->registered)
10396 if(classSym->registered->fixed)
10398 FreeSpecifier(exp->_class);
10399 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10404 char className[1024];
10406 strcpy(className, "__ecereClass_");
10407 FullClassNameCat(className, classSym->string, 0x1);
10408 MangleClassName(className);
10409 FreeExpContents(exp);
10411 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10412 exp->member.member = MkIdentifier("structSize");
10419 struct Type * type;
10420 struct Expression * e = exp;
10422 if(exp->type == 11)
10425 ComputeExpression(exp->cast.exp);
10428 if(e && exp->expType)
10430 type = exp->expType;
10431 if(type->kind == 8)
10433 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10435 if(_class && (_class->type == 3 || _class->type == 2))
10437 if(!_class->dataType)
10438 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10439 type = _class->dataType;
10449 GetChar(e, &value);
10450 FreeExpContents(exp);
10451 exp->constant = PrintChar(value);
10456 unsigned char value;
10458 GetUChar(e, &value);
10459 FreeExpContents(exp);
10460 exp->constant = PrintUChar(value);
10469 GetShort(e, &value);
10470 FreeExpContents(exp);
10471 exp->constant = PrintShort(value);
10476 unsigned short value;
10478 GetUShort(e, &value);
10479 FreeExpContents(exp);
10480 exp->constant = PrintUShort(value);
10490 FreeExpContents(exp);
10491 exp->constant = PrintInt(value);
10496 unsigned int value;
10498 GetUInt(e, &value);
10499 FreeExpContents(exp);
10500 exp->constant = PrintUInt(value);
10509 GetInt64(e, &value);
10510 FreeExpContents(exp);
10511 exp->constant = PrintInt64(value);
10518 GetUInt64(e, &value);
10519 FreeExpContents(exp);
10520 exp->constant = PrintUInt64(value);
10528 GetFloat(e, &value);
10529 FreeExpContents(exp);
10530 exp->constant = PrintFloat(value);
10538 GetDouble(e, &value);
10539 FreeExpContents(exp);
10540 exp->constant = PrintDouble(value);
10550 struct Operand op1 =
10554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10557 struct Operand op2 =
10561 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10564 struct Operand op3 =
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
10573 ComputeExpression((*exp->cond.exp).last);
10574 if(exp->cond.elseExp)
10575 ComputeExpression(exp->cond.elseExp);
10577 ComputeExpression(exp->cond.cond);
10578 op1 = GetOperand(exp->cond.cond);
10580 op1.type->refCount++;
10581 op2 = GetOperand((*exp->cond.exp).last);
10583 op2.type->refCount++;
10584 op3 = GetOperand(exp->cond.elseExp);
10586 op3.type->refCount++;
10589 FreeExpContents(exp);
10590 op1.ops.Cond(exp, &op1, &op2, &op3);
10593 FreeType(op1.type);
10595 FreeType(op2.type);
10597 FreeType(op3.type);
10603 void ApplyAnyObjectLogic(struct Expression * e);
10605 extern void CopyTypeInto(struct Type * type, struct Type * src);
10607 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10609 unsigned int result = 0x1;
10613 struct __ecereNameSpace__ecere__sys__OldList converts =
10617 struct Conversion * convert;
10619 if(destType->kind == 0)
10621 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10625 for(convert = converts.first; convert; convert = convert->next)
10627 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10631 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10632 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10635 newExp->destType = (((void *)0));
10639 exp->addedThis = 0x1;
10640 exp->member.exp = newExp;
10641 FreeType(exp->member.exp->expType);
10642 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10643 exp->member.exp->expType->classObjectType = objectType;
10644 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10645 exp->member.memberType = 1;
10646 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10647 exp->needCast = 0x1;
10649 exp->expType->refCount++;
10650 ApplyAnyObjectLogic(exp->member.exp);
10656 exp->addedThis = 0x1;
10657 exp->member.exp = newExp;
10658 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10660 newExp->byReference = 0x1;
10662 FreeType(exp->member.exp->expType);
10663 exp->member.exp->expType = (((void *)0));
10664 if(convert->convert->dataType)
10666 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10667 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10668 exp->member.exp->expType->refCount = 1;
10669 exp->member.exp->expType->classObjectType = objectType;
10670 ApplyAnyObjectLogic(exp->member.exp);
10672 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10673 exp->member.memberType = 4;
10674 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10675 exp->needCast = 0x1;
10676 if(convert->resultType)
10677 convert->resultType->refCount++;
10683 FreeType(exp->expType);
10686 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10687 exp->needCast = 0x1;
10689 exp->expType->refCount++;
10693 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10694 exp->needCast = 0x1;
10695 if(convert->resultType)
10696 convert->resultType->refCount++;
10700 if(exp->isConstant && inCompiler)
10701 ComputeExpression(exp);
10702 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10704 if(!result && exp->expType && converts.count)
10706 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10708 if(!result && exp->expType && exp->destType)
10710 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))
10717 extern struct Expression * MkExpExtensionCompound(struct Statement * compound);
10719 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10721 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10723 void CheckTemplateTypes(struct Expression * exp)
10725 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10727 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10728 struct Statement * compound;
10729 struct Context * context;
10733 exp->destType->refCount++;
10735 exp->expType->refCount++;
10736 newExp->prev = (((void *)0));
10737 newExp->next = (((void *)0));
10738 switch(exp->expType->kind)
10742 exp->op.exp1 = (((void *)0));
10743 context = PushContext();
10744 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpExtensionCompound(compound = MkCompoundStmt(MkListOne(MkDeclaration(MkListOne(MkSpecifier(298)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internal")))))))));
10745 compound->compound.context = context;
10746 PopContext(context);
10751 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
10752 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10756 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
10758 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10759 struct Statement * compound;
10760 struct Context * context;
10764 exp->destType->refCount++;
10766 exp->expType->refCount++;
10767 newExp->prev = (((void *)0));
10768 newExp->next = (((void *)0));
10769 switch(exp->expType->kind)
10773 exp->op.exp1 = (((void *)0));
10774 context = PushContext();
10775 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifier(298)), 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")))))))));
10776 compound->compound.context = context;
10777 PopContext(context);
10779 ProcessExpressionType(exp->op.exp2);
10783 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
10786 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
10787 ProcessExpressionType((*exp->list).first);
10793 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
10794 newExp->needCast = 0x1;
10795 ProcessExpressionType((*exp->list).first);
10801 if(exp->expType->kind == 20)
10803 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
10807 FreeType(exp->destType);
10808 FreeType(exp->expType);
10809 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
10813 if(newExp->type == 8 && newExp->member.memberType == 3)
10817 exp->op.exp1 = (((void *)0));
10818 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
10822 char typeString[1024];
10823 struct Declarator * decl;
10824 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
10826 typeString[0] = '\0';
10827 PrintType(exp->expType, typeString, 0x0, 0x0);
10828 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
10830 exp->cast.typeName = MkTypeName(specs, decl);
10831 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
10832 exp->cast.exp->needCast = 0x1;
10840 extern int strncmp(const char * , const char * , int n);
10842 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
10844 struct Symbol * symbol;
10845 int nsLen = strlen(nameSpace);
10847 for(symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(tree); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
10849 if(!strncmp(symbol->string, nameSpace, nsLen))
10854 for(c = strlen(symbol->string) - 1; c >= 0; c--)
10855 if(symbol->string[c] == ':')
10857 namePart = symbol->string + c + 1;
10858 if(!strcmp(namePart, name))
10864 return (((void *)0));
10867 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
10870 char nameSpace[1024];
10872 unsigned int gotColon = 0x0;
10874 nameSpace[0] = '\0';
10875 for(c = strlen(name) - 1; c >= 0; c--)
10881 namePart = name + c + 1;
10882 while(c >= 0 && name[c] == ':')
10886 memcpy(nameSpace, name, c + 1);
10887 nameSpace[c + 1] = (char)0;
10888 return ScanWithNameSpace(tree, nameSpace, namePart);
10892 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
10897 return ScanWithNameSpace(tree, "", namePart);
10898 return (((void *)0));
10901 static void ProcessDeclaration(struct Declaration * decl);
10903 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
10905 struct Context * ctx;
10906 struct Symbol * symbol = (((void *)0));
10908 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
10910 if(ctx == globalContext && !globalNameSpace)
10912 symbol = (((void *)0));
10915 char curName[1024];
10917 strcpy(curName, thisNameSpace);
10918 strcat(curName, "::");
10919 strcat(curName, name);
10920 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
10923 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
10926 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->structSymbols, name);
10928 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, name);
10929 if(symbol || ctx == endContext)
10932 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
10934 if(symbol->pointerExternal->type == 0)
10936 struct FunctionDefinition * function = symbol->pointerExternal->function;
10937 struct Context * tmpContext = curContext;
10939 curContext = (((void *)0));
10940 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
10941 curContext = tmpContext;
10942 symbol->pointerExternal->symbol = symbol;
10943 DeclareType(symbol->type, 0x1, 0x1);
10944 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
10945 symbol->id = curExternal->symbol->idCode;
10947 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
10949 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
10950 symbol->id = curExternal->symbol->idCode;
10956 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
10958 if(!type->isSigned)
10959 ListAdd(specs, MkSpecifier(296));
10964 if(type->_class->registered)
10966 if(!type->_class->registered->dataType)
10967 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10968 GetTypeSpecs(type->_class->registered->dataType, specs);
10973 ListAdd(specs, MkSpecifier(298));
10976 ListAdd(specs, MkSpecifier(297));
10979 ListAdd(specs, MkSpecifier(289));
10982 ListAdd(specs, MkSpecifier(290));
10985 ListAdd(specs, MkSpecifier(293));
10989 ListAdd(specs, MkSpecifier(291));
10994 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
10996 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11003 if(type->_class && type->_class->string)
11005 if(type->classObjectType == 2)
11006 strcat(string, "typed_object");
11008 strcat(string, type->_class->string);
11011 if(type->_class->registered)
11012 strcat(string, type->_class->registered->name);
11014 strcat(string, type->_class->string);
11021 _PrintType(type->type, string, 0x0, printFunction, fullName);
11022 strcat(string, " *");
11027 strcat(string, "void");
11030 strcat(string, type->isSigned ? "int" : "uint");
11033 strcat(string, type->isSigned ? "int64" : "uint64");
11036 strcat(string, type->isSigned ? "char" : "byte");
11039 strcat(string, type->isSigned ? "short" : "uint16");
11042 strcat(string, "float");
11045 strcat(string, "double");
11050 strcat(string, "struct ");
11051 strcat(string, type->enumName);
11053 else if(type->typeName)
11055 strcat(string, type->typeName);
11059 struct Type * member;
11061 strcat(string, "struct {");
11062 for(member = type->members.first; member; member = member->next)
11064 PrintType(member, string, 0x1, fullName);
11065 strcat(string, "; ");
11067 strcat(string, "}");
11073 strcat(string, "union ");
11074 strcat(string, type->enumName);
11076 else if(type->typeName)
11078 strcat(string, type->typeName);
11082 strcat(string, "union ");
11083 strcat(string, "(unnamed)");
11089 strcat(string, "enum ");
11090 strcat(string, type->enumName);
11092 else if(type->typeName)
11094 strcat(string, type->typeName);
11097 strcat(string, "enum");
11103 if(type->dllExport)
11104 strcat(string, "dllexport ");
11105 PrintType(type->returnType, string, 0x0, fullName);
11106 strcat(string, " ");
11113 strcat(string, type->name);
11116 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11122 strcat(string, name);
11128 struct Type * param;
11130 strcat(string, "(");
11131 for(param = type->params.first; param; param = param->next)
11133 PrintType(param, string, 0x1, fullName);
11135 strcat(string, ", ");
11137 strcat(string, ")");
11144 char baseType[1024], size[256];
11145 struct Type * arrayType = type;
11147 baseType[0] = '\0';
11149 while(arrayType->kind == 12)
11152 if(arrayType->enumClass)
11153 strcat(size, arrayType->enumClass->string);
11154 else if(arrayType->arraySizeExp)
11155 PrintExpression(arrayType->arraySizeExp, size);
11157 arrayType = arrayType->arrayType;
11159 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11160 strcat(string, baseType);
11161 strcat(string, size);
11167 strcat(string, "...");
11170 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11173 strcat(string, "subclass(");
11174 strcat(string, type->_class ? type->_class->string : "int");
11175 strcat(string, ")");
11178 strcat(string, type->templateParameter->identifier->string);
11181 strcat(string, "thisclass");
11184 strcat(string, "__builtin_va_list");
11187 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11189 strcat(string, " ");
11190 strcat(string, type->name);
11195 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11197 struct Type * funcType;
11199 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11201 if(funcType && funcType->kind == 11 && type != funcType)
11203 char typeString[1024];
11204 struct Type * param;
11206 PrintType(funcType->returnType, string, 0x0, fullName);
11207 strcat(string, "(");
11208 _PrintType(type, string, printName, 0x0, fullName);
11209 strcat(string, ")");
11210 strcat(string, "(");
11211 for(param = funcType->params.first; param; param = param->next)
11213 PrintType(param, string, 0x1, fullName);
11215 strcat(string, ", ");
11217 strcat(string, ")");
11220 _PrintType(type, string, printName, 0x1, fullName);
11221 if(type->bitFieldCount)
11225 sprintf(count, ":%d", type->bitFieldCount);
11226 strcat(string, count);
11230 static struct Type * FindMember(struct Type * type, char * string)
11232 struct Type * memberType;
11234 for(memberType = type->members.first; memberType; memberType = memberType->next)
11236 if(!memberType->name)
11238 struct Type * subType = FindMember(memberType, string);
11243 else if(!strcmp(memberType->name, string))
11246 return (((void *)0));
11249 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11251 struct Type * memberType;
11253 for(memberType = type->members.first; memberType; memberType = memberType->next)
11255 if(!memberType->name)
11257 struct Type * subType = FindMember(memberType, string);
11261 *offset += memberType->offset;
11265 else if(!strcmp(memberType->name, string))
11267 *offset += memberType->offset;
11271 return (((void *)0));
11274 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11276 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11278 struct Expression * ParseExpressionString(char * expression)
11280 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11281 ((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));
11282 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11284 parsedExpression = (((void *)0));
11286 expression_yyparse();
11287 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11288 return parsedExpression;
11291 extern char * QMkString(char * source);
11293 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11295 void * __ecereTemp1;
11296 struct Identifier * id = exp->identifier;
11297 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11298 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11299 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11300 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11302 if(_class && _class->type == 4)
11304 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11305 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11309 struct __ecereNameSpace__ecere__com__Class * baseClass;
11311 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11313 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11315 for(value = e->values.first; value; value = value->next)
11317 if(!strcmp(value->name, id->string))
11322 char constant[256];
11324 FreeExpContents(exp);
11326 exp->isConstant = 0x1;
11327 if(!strcmp(baseClass->dataTypeString, "int"))
11328 sprintf(constant, "%d", value->data);
11330 sprintf(constant, "0x%X", value->data);
11331 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11332 exp->expType = MkClassType(baseClass->fullName);
11340 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11342 ProcessMethodType(method);
11343 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));
11346 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11348 if(!prop->dataType)
11349 ProcessPropertyType(prop);
11350 exp->expType = prop->dataType;
11352 prop->dataType->refCount++;
11355 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11357 if(!member->dataType)
11358 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11359 exp->expType = member->dataType;
11360 if(member->dataType)
11361 member->dataType->refCount++;
11364 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11366 if(!classProp->dataType)
11367 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11368 if(classProp->constant)
11370 FreeExpContents(exp);
11371 exp->isConstant = 0x1;
11372 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11375 exp->constant = QMkString((char *)classProp->Get(_class));
11379 char constant[256];
11382 sprintf(constant, "%d", classProp->Get(_class));
11383 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11389 exp->expType = classProp->dataType;
11390 if(classProp->dataType)
11391 classProp->dataType->refCount++;
11397 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11399 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11400 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11401 struct __ecereNameSpace__ecere__com__NameSpace * child;
11405 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)))
11407 data = ScanGlobalData(child, name);
11415 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11417 extern char * strncpy(char * , const char * , int n);
11419 static struct GlobalData * FindGlobalData(char * name)
11422 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11424 nameSpace = globalData;
11425 for(c = 0; name[c]; c++)
11427 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11429 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11430 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11432 strncpy(spaceName, name + start, c - start);
11433 spaceName[c - start] = '\0';
11434 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11435 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11437 return (((void *)0));
11438 nameSpace = newSpace;
11446 return ScanGlobalData(nameSpace, name + start);
11448 return (((void *)0));
11451 static int definedExpStackPos;
11453 static void * definedExpStack[512];
11455 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11457 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11459 FreeExpContents(checkedExp);
11460 FreeType(checkedExp->expType);
11461 FreeType(checkedExp->destType);
11462 *checkedExp = *newExp;
11463 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11464 checkedExp->prev = prev;
11465 checkedExp->next = next;
11468 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11470 void __ecereMethod_Expression_Clear();
11472 void ApplyAnyObjectLogic(struct Expression * e)
11474 struct Type * destType = e->destType;
11476 if(destType && (destType->classObjectType == 3))
11478 if(e && e->expType)
11480 struct Type * type = e->expType;
11481 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11483 if(type->kind == 8 && type->_class && type->_class->registered)
11485 _class = type->_class->registered;
11487 else if(type->kind == 19)
11489 _class = FindClass("ecere::com::Class")->registered;
11493 char string[1024] = "";
11494 struct Symbol * classSym;
11496 PrintType(type, string, 0x0, 0x1);
11497 classSym = FindClass(string);
11499 _class = classSym->registered;
11501 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)))
11503 if(!_class || strcmp(_class->fullName, "char *"))
11505 struct Expression * checkedExp = e, * newExp;
11507 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11509 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11511 if(checkedExp->type == 25)
11513 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11516 checkedExp = (*checkedExp->list).last;
11518 else if(checkedExp->type == 11)
11519 checkedExp = checkedExp->cast.exp;
11521 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11523 newExp = checkedExp->op.exp2;
11524 checkedExp->op.exp2 = (((void *)0));
11525 FreeExpContents(checkedExp);
11526 if(e->expType && e->expType->passAsTemplate)
11530 ComputeTypeSize(e->expType);
11531 sprintf(size, "%d", e->expType->size);
11532 newExp = MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(289)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp), '+', MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), MkListOne(MkExpConstant(size))))));
11534 ReplaceExpContents(checkedExp, newExp);
11535 e->byReference = 0x1;
11537 else if(!e->byReference || (_class && _class->type == 5))
11539 struct Expression * checkedExp, * newExp;
11542 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;
11544 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11546 struct Context * context = PushContext();
11547 struct Declarator * decl;
11548 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11549 char typeString[1024];
11550 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11552 typeString[0] = '\0';
11554 newExp->prev = (((void *)0));
11555 newExp->next = (((void *)0));
11556 newExp->expType = (((void *)0));
11557 PrintType(e->expType, typeString, 0x0, 0x1);
11558 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11559 newExp->destType = ProcessType(specs, decl);
11560 curContext = context;
11562 e->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalValue")), MkInitializerAssignment(newExp))))), MkListOne(MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier("__internalValue"))))));
11564 struct Type * type = e->destType;
11566 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11567 CopyTypeInto(e->destType, type);
11568 e->destType->refCount = 1;
11569 e->destType->classObjectType = 0;
11572 e->compound->compound.context = context;
11573 PopContext(context);
11574 curContext = context->parent;
11578 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11580 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11582 if(checkedExp->type == 25)
11584 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11587 checkedExp = (*checkedExp->list).last;
11589 else if(checkedExp->type == 11)
11590 checkedExp = checkedExp->cast.exp;
11593 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11595 *operand = *checkedExp;
11596 checkedExp->destType = (((void *)0));
11597 checkedExp->expType = (((void *)0));
11598 __ecereMethod_Expression_Clear(checkedExp);
11599 checkedExp->type = 4;
11600 checkedExp->op.op = '&';
11601 checkedExp->op.exp1 = (((void *)0));
11602 checkedExp->op.exp2 = operand;
11611 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))))
11613 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11619 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11622 thisExp->prev = (((void *)0));
11623 thisExp->next = (((void *)0));
11624 __ecereMethod_Expression_Clear(e);
11626 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11627 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11628 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11630 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11631 CopyTypeInto(e->expType, thisExp->expType);
11632 e->expType->byReference = 0x0;
11633 e->expType->refCount = 1;
11634 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))
11636 e->expType->classObjectType = 0;
11641 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11643 if(destType->kind == 14)
11645 Compiler_Error("Unspecified type\n");
11647 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11649 unsigned int byReference = e->expType->byReference;
11650 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11651 struct Declarator * decl;
11652 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11653 char typeString[1024];
11654 struct Type * type;
11655 int backupClassObjectType;
11657 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11661 backupClassObjectType = type->classObjectType;
11662 type->classObjectType = 0;
11663 typeString[0] = '\0';
11664 PrintType(type, typeString, 0x0, 0x1);
11665 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11666 type->classObjectType = backupClassObjectType;
11668 thisExp->prev = (((void *)0));
11669 thisExp->next = (((void *)0));
11670 __ecereMethod_Expression_Clear(e);
11671 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)))
11675 e->op.exp1 = (((void *)0));
11676 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
11681 e->cast.typeName = MkTypeName(specs, decl);
11682 e->cast.exp = thisExp;
11683 e->byReference = 0x1;
11686 e->destType = destType;
11688 destType->refCount++;
11693 extern char * strstr(char * , const char * );
11695 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
11697 struct __ecereNameSpace__ecere__com__DefinedExpression
11699 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
11700 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
11703 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11706 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11708 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
11710 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
11712 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
11714 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11716 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
11718 extern struct Expression * CopyExpression(struct Expression * exp);
11720 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
11722 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
11724 static void ProcessStatement(struct Statement * stmt);
11726 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
11728 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
11730 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
11732 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
11734 void ProcessExpressionType(struct Expression * exp)
11736 void * __ecereTemp2;
11737 void * __ecereTemp1;
11738 unsigned int unresolved = 0x0;
11739 struct Location oldyylloc = yylloc;
11740 unsigned int notByReference = 0x0;
11742 if(!exp || exp->expType)
11749 struct Identifier * id = exp->identifier;
11753 if(id->_class && id->_class->name)
11755 id->classSym = id->_class->symbol;
11757 if(strstr(id->string, "__ecereClass") == id->string)
11759 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11762 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11764 ReplaceClassMembers(exp, thisClass);
11767 ProcessExpressionType(exp);
11770 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11775 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11779 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11785 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11788 ProcessExpressionType(exp);
11792 else if(currentClass && !id->_class)
11794 if(ResolveIdWithClass(exp, currentClass, 0x1))
11797 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11802 struct Type * type = symbol->type;
11803 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11805 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11807 struct Context * context = SetupTemplatesContext(_class);
11809 type = ReplaceThisClassType(_class);
11810 FinishTemplatesContext(context);
11812 type->refCount = 0;
11814 FreeSpecifier(id->_class);
11815 id->_class = (((void *)0));
11816 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11817 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11818 id->classSym = (((void *)0));
11819 exp->expType = type;
11822 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11823 exp->isConstant = 0x1;
11824 if(symbol->isParam || !strcmp(id->string, "this"))
11826 if(_class && _class->type == 1)
11827 exp->byReference = 0x1;
11829 if(symbol->isIterator)
11831 if(symbol->isIterator == 3)
11834 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11835 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11836 exp->expType = (((void *)0));
11837 ProcessExpressionType(exp);
11839 else if(symbol->isIterator != 4)
11842 exp->member.exp = MkExpIdentifier(exp->identifier);
11843 exp->member.exp->expType = exp->expType;
11844 exp->member.member = MkIdentifier("data");
11845 exp->expType = (((void *)0));
11846 ProcessExpressionType(exp);
11853 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11855 if(thisNameSpace && !(id->_class && !id->_class->name))
11859 strcpy(name, thisNameSpace);
11860 strcat(name, "::");
11861 strcat(name, id->string);
11862 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11865 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11870 for(c = 0; c < definedExpStackPos; c++)
11871 if(definedExpStack[c] == definedExp)
11873 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11875 struct Location backupYylloc = yylloc;
11877 definedExpStack[definedExpStackPos++] = definedExp;
11878 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11879 ((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));
11880 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11882 parsedExpression = (((void *)0));
11884 expression_yyparse();
11885 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11886 yylloc = backupYylloc;
11887 if(parsedExpression)
11889 FreeIdentifier(id);
11891 exp->list = MkListOne(parsedExpression);
11892 parsedExpression->loc = yylloc;
11893 ProcessExpressionType(exp);
11894 definedExpStackPos--;
11897 definedExpStackPos--;
11903 Compiler_Error("Recursion in defined expression %s\n", id->string);
11909 struct GlobalData * data = (((void *)0));
11911 if(thisNameSpace && !(id->_class && !id->_class->name))
11915 strcpy(name, thisNameSpace);
11916 strcat(name, "::");
11917 strcat(name, id->string);
11918 data = FindGlobalData(name);
11921 data = FindGlobalData(id->string);
11924 DeclareGlobalData(data);
11925 exp->expType = data->dataType;
11927 data->dataType->refCount++;
11928 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11929 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11930 FreeSpecifier(id->_class);
11931 id->_class = (((void *)0));
11936 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11938 if(thisNameSpace && !(id->_class && !id->_class->name))
11942 strcpy(name, thisNameSpace);
11943 strcat(name, "::");
11944 strcat(name, id->string);
11945 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11948 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11953 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11954 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11956 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11957 strcpy(name, "__ecereFunction_");
11958 FullClassNameCat(name, id->string, 0x0);
11959 if(DeclareFunction(function, name))
11961 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11962 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11964 exp->expType = function->dataType;
11965 if(function->dataType)
11966 function->dataType->refCount++;
11967 FreeSpecifier(id->_class);
11968 id->_class = (((void *)0));
11980 struct __ecereNameSpace__ecere__com__Class * _class;
11982 if(!exp->instance->_class)
11984 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
11986 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
11989 ProcessInstantiationType(exp->instance);
11990 exp->isConstant = exp->instance->isConstant;
11991 if(exp->instance->_class)
11993 exp->expType = MkClassType(exp->instance->_class->name);
12001 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12003 exp->expType = type;
12004 if(exp->constant[0] == '\'')
12006 if((int)((unsigned char *)exp->constant)[1] > 127)
12009 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12012 ch = exp->constant[1];
12013 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12014 exp->constant = PrintUInt(ch);
12016 type->_class = FindClass("unichar");
12017 type->isSigned = 0x0;
12022 type->isSigned = 0x1;
12025 else if(strchr(exp->constant, '.'))
12027 char ch = exp->constant[strlen(exp->constant) - 1];
12033 type->isSigned = 0x1;
12037 if(exp->constant[0] == '0' && exp->constant[1])
12038 type->isSigned = 0x0;
12039 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12040 type->isSigned = 0x0;
12041 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12042 type->isSigned = 0x0;
12044 type->isSigned = 0x1;
12047 exp->isConstant = 0x1;
12053 exp->isConstant = 0x1;
12054 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));
12059 ProcessExpressionType(exp->_new.size);
12060 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));
12061 DeclareType(exp->expType->type, 0x0, 0x0);
12065 ProcessExpressionType(exp->_renew.size);
12066 ProcessExpressionType(exp->_renew.exp);
12067 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));
12068 DeclareType(exp->expType->type, 0x0, 0x0);
12072 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12073 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12074 unsigned int useDestType = 0x0, useSideType = 0x0;
12075 struct Location oldyylloc = yylloc;
12076 unsigned int useSideUnit = 0x0;
12077 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12119 if(exp->op.op != '*' || exp->op.exp1)
12126 if(exp->op.op == '&')
12128 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12130 struct Identifier * id = exp->op.exp2->identifier;
12131 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12133 if(symbol && symbol->isIterator == 2)
12136 exp->member.exp = exp->op.exp2;
12137 exp->member.member = MkIdentifier("key");
12138 exp->expType = (((void *)0));
12139 exp->op.exp2->expType = symbol->type;
12140 symbol->type->refCount++;
12141 ProcessExpressionType(exp);
12149 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))
12151 if(exp->op.exp1->destType)
12152 FreeType(exp->op.exp1->destType);
12153 exp->op.exp1->destType = exp->destType;
12155 exp->destType->refCount++;
12159 if(exp->op.exp1->destType)
12160 FreeType(exp->op.exp1->destType);
12161 exp->op.exp1->destType = dummy;
12164 if(exp->op.exp1->destType && exp->op.op != '=')
12165 exp->op.exp1->destType->count++;
12166 ProcessExpressionType(exp->op.exp1);
12167 if(exp->op.exp1->destType && exp->op.op != '=')
12168 exp->op.exp1->destType->count--;
12169 if(exp->op.exp1->destType == dummy)
12172 exp->op.exp1->destType = (((void *)0));
12174 type1 = exp->op.exp1->expType;
12178 char expString[10240];
12180 expString[0] = '\0';
12181 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12185 exp->op.exp2->destType = exp->op.exp1->expType;
12186 if(exp->op.exp1->expType)
12187 exp->op.exp1->expType->refCount++;
12191 exp->op.exp2->destType = exp->destType;
12193 exp->destType->refCount++;
12197 exp->expType = type1;
12202 PrintExpression(exp->op.exp2, expString);
12203 if(type1 && type1->kind == 13)
12205 if(exp->op.op == 273 || exp->op.op == 274 || exp->op.op == 275 || exp->op.op == 278 || exp->op.op == 279 || exp->op.op == 280 || exp->op.op == 282)
12206 Compiler_Error("operator %s illegal on pointer\n", exp->op.op);
12207 else if(exp->op.op == '=')
12209 if(exp->op.exp2->destType)
12210 FreeType(exp->op.exp2->destType);
12211 exp->op.exp2->destType = type1;
12218 if(exp->op.op == 273 || exp->op.op == 274 || exp->op.op == 275 || exp->op.op == 278 || exp->op.op == 279)
12222 if(exp->op.exp2->destType)
12223 FreeType(exp->op.exp2->destType);
12224 exp->op.exp2->destType = type1;
12231 exp->expType = type1;
12233 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)))
12235 if(exp->op.exp2->destType)
12236 FreeType(exp->op.exp2->destType);
12237 exp->op.exp2->destType = exp->destType;
12239 exp->destType->refCount++;
12243 if(exp->op.exp2->destType)
12244 FreeType(exp->op.exp2->destType);
12245 exp->op.exp2->destType = dummy;
12248 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12250 FreeType(exp->op.exp2->destType);
12251 exp->op.exp2->destType = type1;
12254 if(exp->op.exp2->destType && exp->op.op != '=')
12255 exp->op.exp2->destType->count++;
12256 ProcessExpressionType(exp->op.exp2);
12257 if(exp->op.exp2->destType && exp->op.op != '=')
12258 exp->op.exp2->destType->count--;
12259 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12261 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)
12263 if(exp->op.op != '=' && type1->type->kind == 0)
12264 Compiler_Error("void *: unknown size\n");
12266 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)))
12268 if(exp->op.op == 276)
12269 Compiler_Error("cannot add two pointers\n");
12271 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))
12273 if(exp->op.op == 276)
12274 Compiler_Error("cannot add two pointers\n");
12276 else if(inCompiler)
12278 char type1String[1024];
12279 char type2String[1024];
12281 type1String[0] = '\0';
12282 type2String[0] = '\0';
12283 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12284 PrintType(type1, type2String, 0x0, 0x1);
12285 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12286 Compiler_Warning("incompatible expression %s (%s); expected %s\n", expString, type1String, type2String);
12289 if(exp->op.exp2->destType == dummy)
12292 exp->op.exp2->destType = (((void *)0));
12294 type2 = exp->op.exp2->expType;
12297 if(exp->op.op == 261)
12299 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12300 exp->isConstant = 0x1;
12302 else if(exp->op.op == '*' && !exp->op.exp1)
12304 exp->expType = Dereference(type2);
12305 if(type2 && type2->kind == 8)
12306 notByReference = 0x1;
12308 else if(exp->op.op == '&' && !exp->op.exp1)
12309 exp->expType = Reference(type2);
12316 if(exp->op.exp1->destType)
12317 FreeType(exp->op.exp1->destType);
12318 exp->op.exp1->destType = MkClassType("bool");
12319 exp->op.exp1->destType->truth = 0x1;
12320 if(!exp->op.exp1->expType)
12321 ProcessExpressionType(exp->op.exp1);
12323 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12324 FreeType(exp->op.exp1->expType);
12325 exp->op.exp1->expType = MkClassType("bool");
12326 exp->op.exp1->expType->truth = 0x1;
12330 if(exp->op.exp2->destType)
12331 FreeType(exp->op.exp2->destType);
12332 exp->op.exp2->destType = MkClassType("bool");
12333 exp->op.exp2->destType->truth = 0x1;
12334 if(!exp->op.exp2->expType)
12335 ProcessExpressionType(exp->op.exp2);
12337 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12338 FreeType(exp->op.exp2->expType);
12339 exp->op.exp2->expType = MkClassType("bool");
12340 exp->op.exp2->expType->truth = 0x1;
12343 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")))))
12345 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12347 if(exp->op.exp2->destType)
12348 FreeType(exp->op.exp2->destType);
12349 exp->op.exp2->destType = type1;
12351 if(exp->op.exp1->destType)
12352 FreeType(exp->op.exp1->destType);
12353 exp->op.exp1->destType = type2;
12355 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)
12356 Compiler_Warning("operating on %s and %s with an untyped result, assuming %s\n", type1->_class->string, type2->_class->string, type1->_class->string);
12357 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12359 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12363 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12365 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12366 ProcessExpressionType(exp->op.exp1);
12367 if(type2->kind != 13)
12369 ProcessExpressionType(classExp);
12370 exp->op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), 269, MkExpConstant("5")), 272, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), 269, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(301)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
12371 if(!exp->op.exp2->expType)
12372 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12373 ProcessExpressionType(exp->op.exp2);
12377 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)))
12379 if(type1->kind != 8 && type1->type->kind == 0)
12380 Compiler_Error("void *: unknown size\n");
12381 exp->expType = type1;
12385 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)))
12387 if(type2->kind != 8 && type2->type->kind == 0)
12388 Compiler_Error("void *: unknown size\n");
12389 exp->expType = type2;
12393 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))
12395 Compiler_Warning("different levels of indirection\n");
12399 unsigned int success = 0x0;
12401 if(type1->kind == 13 && type2->kind == 13)
12403 if(exp->op.op == '+')
12404 Compiler_Error("cannot add two pointers\n");
12405 else if(exp->op.op == '-')
12407 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12409 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12411 if(type1->type->kind == 20)
12413 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12417 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12419 ProcessExpressionType(classExp);
12421 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")), 269, MkExpIdentifier(MkIdentifier("noHeadClass"))), 272, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), 269, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(301)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
12422 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12430 if(!success && exp->op.exp1->type == 2)
12432 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12434 exp->expType = exp->op.exp1->destType;
12435 if(exp->op.exp1->destType)
12436 exp->op.exp1->destType->refCount++;
12439 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12441 exp->expType = exp->op.exp2->destType;
12442 if(exp->op.exp2->destType)
12443 exp->op.exp2->destType->refCount++;
12449 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12451 exp->expType = exp->op.exp2->destType;
12452 if(exp->op.exp2->destType)
12453 exp->op.exp2->destType->refCount++;
12456 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12458 exp->expType = exp->op.exp1->destType;
12459 if(exp->op.exp1->destType)
12460 exp->op.exp1->destType->refCount++;
12466 char expString1[10240];
12467 char expString2[10240];
12471 expString1[0] = '\0';
12472 expString2[0] = '\0';
12477 PrintExpression(exp->op.exp1, expString1);
12478 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12479 PrintExpression(exp->op.exp2, expString2);
12480 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12481 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12482 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12484 Compiler_Warning("incompatible expressions %s (%s) and %s (%s)\n", expString1, type1, expString2, type2);
12488 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12490 if(exp->op.exp1->destType)
12491 FreeType(exp->op.exp1->destType);
12492 exp->op.exp1->destType = type2->_class->registered->dataType;
12493 if(type2->_class->registered->dataType)
12494 type2->_class->registered->dataType->refCount++;
12495 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12496 exp->expType = type2;
12500 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12502 if(exp->op.exp2->destType)
12503 FreeType(exp->op.exp2->destType);
12504 exp->op.exp2->destType = type1->_class->registered->dataType;
12505 if(type1->_class->registered->dataType)
12506 type1->_class->registered->dataType->refCount++;
12507 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12508 exp->expType = type1;
12514 unsigned int valid = 0x0;
12516 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12518 if(exp->op.exp2->destType)
12519 FreeType(exp->op.exp2->destType);
12520 if(!type1->_class->registered->dataType)
12521 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12522 exp->op.exp2->destType = type1->_class->registered->dataType;
12523 exp->op.exp2->destType->refCount++;
12524 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12525 type2 = exp->op.exp2->destType;
12526 exp->expType = type2;
12529 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12531 if(exp->op.exp1->destType)
12532 FreeType(exp->op.exp1->destType);
12533 if(!type2->_class->registered->dataType)
12534 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12535 exp->op.exp1->destType = type2->_class->registered->dataType;
12536 exp->op.exp1->destType->refCount++;
12537 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12538 type1 = exp->op.exp1->destType;
12539 exp->expType = type1;
12542 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12544 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12546 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12548 exp->expType = exp->op.exp1->expType;
12549 if(exp->op.exp2->expType)
12550 exp->op.exp1->expType->refCount++;
12554 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12556 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12558 exp->expType = exp->op.exp2->expType;
12559 if(exp->op.exp2->expType)
12560 exp->op.exp2->expType->refCount++;
12567 if(exp->op.exp2->destType)
12568 FreeType(exp->op.exp2->destType);
12569 exp->op.exp2->destType = type1;
12571 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12573 exp->expType = exp->op.exp2->destType;
12574 if(exp->op.exp2->destType)
12575 exp->op.exp2->destType->refCount++;
12577 else if(type1 && type2)
12579 char expString1[10240];
12580 char expString2[10240];
12581 char type1String[1024];
12582 char type2String[1024];
12584 expString1[0] = '\0';
12585 expString2[0] = '\0';
12586 type1String[0] = '\0';
12587 type2String[0] = '\0';
12590 PrintExpression(exp->op.exp1, expString1);
12591 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12592 PrintExpression(exp->op.exp2, expString2);
12593 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12594 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12595 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12597 Compiler_Warning("incompatible expressions %s (%s) and %s (%s)\n", expString1, type1String, expString2, type2String);
12598 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12600 exp->expType = exp->op.exp1->expType;
12601 if(exp->op.exp1->expType)
12602 exp->op.exp1->expType->refCount++;
12604 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12606 exp->expType = exp->op.exp2->expType;
12607 if(exp->op.exp2->expType)
12608 exp->op.exp2->expType->refCount++;
12615 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12617 struct Type * oldType = exp->op.exp1->expType;
12619 exp->op.exp1->expType = (((void *)0));
12620 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12623 exp->op.exp1->expType = oldType;
12625 if(exp->op.exp1->destType)
12626 FreeType(exp->op.exp1->destType);
12627 exp->op.exp1->destType = type2;
12629 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12631 exp->expType = exp->op.exp1->destType;
12632 if(exp->op.exp1->destType)
12633 exp->op.exp1->destType->refCount++;
12637 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12639 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12641 if(exp->op.exp1->destType)
12642 FreeType(exp->op.exp1->destType);
12643 exp->op.exp1->destType = type2->_class->registered->dataType;
12644 if(type2->_class->registered->dataType)
12645 type2->_class->registered->dataType->refCount++;
12646 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12648 if(exp->op.op == '!')
12650 exp->expType = MkClassType("bool");
12651 exp->expType->truth = 0x1;
12655 exp->expType = type2;
12660 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12662 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12664 if(exp->op.exp2->destType)
12665 FreeType(exp->op.exp2->destType);
12666 exp->op.exp2->destType = type1->_class->registered->dataType;
12667 if(type1->_class->registered->dataType)
12668 type1->_class->registered->dataType->refCount++;
12669 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12671 exp->expType = type1;
12677 if(exp->op.exp1 && !exp->op.exp1->expType)
12679 char expString[10000];
12681 expString[0] = '\0';
12684 PrintExpression(exp->op.exp1, expString);
12685 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12688 Compiler_Error("couldn't determine type of %s\n", expString);
12690 if(exp->op.exp2 && !exp->op.exp2->expType)
12692 char expString[10240];
12694 expString[0] = '\0';
12697 PrintExpression(exp->op.exp2, expString);
12698 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12701 Compiler_Error("couldn't determine type of %s\n", expString);
12705 FreeType(exp->expType);
12706 exp->expType = MkClassType("bool");
12707 exp->expType->truth = 0x1;
12709 if(exp->op.op != 261)
12710 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12711 if(exp->op.op == 261 && exp->op.exp2->expType)
12713 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12715 yylloc = oldyylloc;
12722 struct Expression * e;
12724 exp->isConstant = 0x1;
12725 for(e = (*exp->list).first; e; e = e->next)
12727 unsigned int inced = 0x0;
12731 FreeType(e->destType);
12732 e->destType = exp->destType;
12735 exp->destType->refCount++;
12736 e->destType->count++;
12740 ProcessExpressionType(e);
12742 exp->destType->count--;
12743 if(!exp->expType && !e->next)
12745 exp->expType = e->expType;
12747 e->expType->refCount++;
12750 exp->isConstant = 0x0;
12752 e = (*exp->list).first;
12753 if(!e->next && e->type == 8)
12755 struct Expression * next = exp->next, * prev = exp->prev;
12757 FreeType(exp->expType);
12758 FreeType(exp->destType);
12759 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12763 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12764 ProcessExpressionType(exp);
12770 struct Expression * e;
12772 exp->isConstant = 0x1;
12773 ProcessExpressionType(exp->index.exp);
12774 if(!exp->index.exp->isConstant)
12775 exp->isConstant = 0x0;
12776 if(exp->index.exp->expType)
12778 struct Type * source = exp->index.exp->expType;
12780 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)
12782 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12784 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12785 if(exp->index.index && (*exp->index.index).last)
12787 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12791 for(e = (*exp->index.index).first; e; e = e->next)
12793 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12796 FreeType(e->destType);
12797 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12799 ProcessExpressionType(e);
12804 exp->isConstant = 0x0;
12807 exp->expType = Dereference(exp->index.exp->expType);
12809 DeclareType(exp->expType, 0x0, 0x0);
12814 struct Expression * e;
12815 struct Type * functionType;
12816 struct Type * methodType = (((void *)0));
12822 PrintExpression(exp->call.exp, name);
12823 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12825 PrintExpression(exp->call.exp, name);
12828 if(exp->call.exp->type == 0)
12830 struct Expression * idExp = exp->call.exp;
12831 struct Identifier * id = idExp->identifier;
12833 if(!strcmp(id->string, "__ENDIAN_PAD"))
12835 exp->expType = ProcessTypeString("int", 0x1);
12836 if(exp->call.arguments && (*exp->call.arguments).first)
12837 ProcessExpressionType((*exp->call.arguments).first);
12840 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12842 struct Expression * a = (((void *)0));
12843 struct Expression * b = (((void *)0));
12844 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12846 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12848 a = (*exp->call.arguments).first;
12849 b = (*exp->call.arguments).last;
12853 else if((*exp->call.arguments).count == 1)
12855 a = (*exp->call.arguments).first;
12860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12861 idExp->identifier = (((void *)0));
12862 FreeExpContents(exp);
12863 ProcessExpressionType(a);
12865 ProcessExpressionType(b);
12867 exp->list = MkList();
12868 if(a->expType && (!b || b->expType))
12870 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12874 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12875 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12876 struct Declaration * decl;
12877 char temp1[1024], temp2[1024];
12879 GetTypeSpecs(a->expType, specs);
12880 if(a && !a->isConstant && a->type != 0)
12882 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12883 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12884 tempExp1 = QMkExpId(temp1);
12885 tempExp1->expType = a->expType;
12887 a->expType->refCount++;
12888 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12890 if(b && !b->isConstant && b->type != 0)
12892 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12893 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12894 tempExp2 = QMkExpId(temp2);
12895 tempExp2->expType = b->expType;
12897 b->expType->refCount++;
12898 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12900 decl = MkDeclaration(specs, decls);
12901 if(!curCompound->compound.declarations)
12902 curCompound->compound.declarations = MkList();
12903 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12907 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12909 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12911 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12912 exp->expType = a->expType;
12914 a->expType->refCount++;
12916 else if(!strcmp(id->string, "Abs"))
12918 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12919 exp->expType = a->expType;
12921 a->expType->refCount++;
12923 else if(!strcmp(id->string, "Sgn"))
12925 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"))))));
12926 exp->expType = ProcessTypeString("int", 0x0);
12928 FreeExpression(tempExp1);
12930 FreeExpression(tempExp2);
12931 FreeIdentifier(id);
12937 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12939 if(!exp->call.exp->destType)
12941 exp->call.exp->destType = dummy;
12944 ProcessExpressionType(exp->call.exp);
12945 if(exp->call.exp->destType == dummy)
12948 exp->call.exp->destType = (((void *)0));
12952 functionType = exp->call.exp->expType;
12953 if(functionType && functionType->kind == 16)
12955 methodType = functionType;
12956 functionType = methodType->method->dataType;
12957 if(exp->call.exp->expType->usedClass)
12959 char typeString[1024];
12961 typeString[0] = '\0';
12962 PrintType(functionType, typeString, 0x1, 0x1);
12963 if(strstr(typeString, "thisclass"))
12965 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12966 struct Declarator * decl;
12969 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
12971 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12972 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
12973 thisClassParams = 0x0;
12974 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
12976 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
12978 thisClass = exp->call.exp->expType->usedClass;
12979 ProcessDeclarator(decl);
12980 thisClass = backupThisClass;
12982 thisClassParams = 0x1;
12983 functionType = ProcessType(specs, decl);
12984 functionType->refCount = 0;
12985 FinishTemplatesContext(context);
12987 FreeList(specs, FreeSpecifier);
12988 FreeDeclarator(decl);
12992 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
12994 struct Type * type = functionType->type;
12996 if(!functionType->refCount)
12998 functionType->type = (((void *)0));
12999 FreeType(functionType);
13001 functionType = type;
13003 if(functionType && functionType->kind != 11)
13005 Compiler_Error("called object %s is not a function\n", name);
13007 else if(functionType)
13009 unsigned int emptyParams = 0x0, noParams = 0x0;
13010 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13011 struct Type * type = functionType->params.first;
13012 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13014 struct Location oldyylloc = yylloc;
13018 if(functionType->extraParam && e)
13020 e->destType = MkClassType(functionType->thisClass->string);
13023 if(!functionType->staticMethod)
13025 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13027 type = MkClassType(memberExp->member.exp->expType->_class->string);
13030 e->destType = type;
13032 type = functionType->params.first;
13035 type->refCount = 0;
13037 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13039 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13042 e->destType = type;
13044 type = functionType->params.first;
13047 type->refCount = 0;
13050 if(type && type->kind == 0)
13053 if(!type->refCount)
13055 type = (((void *)0));
13057 for(; e; e = e->next)
13059 if(!type && !emptyParams)
13062 if(methodType && methodType->methodClass)
13063 Compiler_Error("too many arguments for method %s::%s (%d given, expected %d)\n", methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13065 Compiler_Error("too many arguments for function %s (%d given, expected %d)\n", name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13068 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13070 struct Type * templatedType = (((void *)0));
13071 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13072 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13075 if(_class && _class->templateArgs)
13077 struct __ecereNameSpace__ecere__com__Class * sClass;
13079 for(sClass = _class; sClass; sClass = sClass->base)
13081 if(sClass->templateClass)
13082 sClass = sClass->templateClass;
13084 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13086 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13088 struct __ecereNameSpace__ecere__com__Class * nextClass;
13090 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13092 if(nextClass->templateClass)
13093 nextClass = nextClass->templateClass;
13094 id += nextClass->templateParams.count;
13104 if(curParam && _class->templateArgs[id].dataTypeString)
13106 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13109 struct Context * context = SetupTemplatesContext(_class);
13111 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13112 FinishTemplatesContext(context);
13114 e->destType = templatedType;
13117 templatedType->passAsTemplate = 0x1;
13122 e->destType = type;
13129 e->destType = type;
13133 if(type && type->kind != 14)
13135 struct Type * next = type->next;
13137 if(!type->refCount)
13142 if(type && type->kind != 14)
13144 if(methodType && methodType->methodClass)
13145 Compiler_Warning("not enough arguments for method %s::%s (%d given, expected %d)\n", methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13147 Compiler_Warning("not enough arguments for function %s (%d given, expected %d)\n", name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13149 yylloc = oldyylloc;
13150 if(type && !type->refCount)
13155 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13156 if(exp->call.exp->type == 0)
13158 char * string = exp->call.exp->identifier->string;
13162 struct Symbol * symbol;
13163 struct Location oldyylloc = yylloc;
13165 yylloc = exp->call.exp->identifier->loc;
13166 if(strstr(string, "__builtin_") == string)
13169 Compiler_Warning("%s undefined; assuming extern returning int\n", string);
13170 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));
13171 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13172 yylloc = oldyylloc;
13175 else if(exp->call.exp->type == 8)
13179 Compiler_Warning("callable object undefined; extern assuming returning int\n");
13180 if(!functionType->returnType)
13182 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13185 if(functionType && functionType->kind == 11)
13187 exp->expType = functionType->returnType;
13188 if(functionType->returnType)
13189 functionType->returnType->refCount++;
13190 if(!functionType->refCount)
13191 FreeType(functionType);
13193 if(exp->call.arguments)
13195 for(e = (*exp->call.arguments).first; e; e = e->next)
13197 struct Type * destType = e->destType;
13199 ProcessExpressionType(e);
13206 struct Type * type;
13207 struct Location oldyylloc = yylloc;
13208 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13210 exp->thisPtr = thisPtr;
13211 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13213 exp->member.member->classSym = exp->member.member->_class->symbol;
13215 ProcessExpressionType(exp->member.exp);
13216 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)
13218 exp->isConstant = 0x0;
13221 exp->isConstant = exp->member.exp->isConstant;
13222 type = exp->member.exp->expType;
13224 if(type && (type->kind == 20))
13226 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13227 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13231 for(param = _class->templateParams.first; param; param = param->next)
13233 if(param->type == 1 && !strcmp(param->name, exp->member.member->string))
13237 if(param && param->defaultArg.member)
13239 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13243 struct Expression * expMember = exp->member.exp;
13244 struct Declarator * decl;
13245 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13246 char thisClassTypeString[1024];
13248 FreeIdentifier(exp->member.member);
13249 ProcessExpressionType(argExp);
13251 char * colon = strstr(param->defaultArg.memberString, "::");
13255 char className[1024];
13256 struct __ecereNameSpace__ecere__com__Class * sClass;
13258 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13259 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13262 strcpy(thisClassTypeString, _class->fullName);
13264 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13265 exp->expType = ProcessType(specs, decl);
13266 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13268 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13269 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13271 int paramCount = 0;
13272 int lastParam = -1;
13273 char templateString[1024];
13274 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13276 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13277 for(cClass = expClass; cClass; cClass = cClass->base)
13281 for(param = cClass->templateParams.first; param; param = param->next)
13284 struct __ecereNameSpace__ecere__com__Class * sClass;
13285 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13287 for(sClass = cClass->base; sClass; sClass = sClass->base)
13288 id += sClass->templateParams.count;
13289 arg = expClass->templateArgs[id];
13290 for(sClass = _class; sClass; sClass = sClass->base)
13292 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13294 struct __ecereNameSpace__ecere__com__Class * nextClass;
13296 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13297 p += nextClass->templateParams.count;
13298 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13300 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13302 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13304 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13305 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13312 char argument[256];
13314 argument[0] = '\0';
13315 switch(param->type)
13319 char expString[1024];
13320 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13321 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13322 struct Expression * exp;
13323 char * string = PrintHexUInt64(arg.expression.ui64);
13325 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13326 ProcessExpressionType(exp);
13327 ComputeExpression(exp);
13328 expString[0] = '\0';
13329 PrintExpression(exp, expString);
13330 strcat(argument, expString);
13331 FreeExpression(exp);
13336 strcat(argument, arg.member->name);
13341 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13343 if(!strcmp(arg.dataTypeString, "thisclass"))
13344 strcat(argument, thisClassTypeString);
13346 strcat(argument, arg.dataTypeString);
13354 strcat(templateString, ", ");
13355 if(lastParam != p - 1)
13357 strcat(templateString, param->name);
13358 strcat(templateString, " = ");
13360 strcat(templateString, argument);
13369 int len = strlen(templateString);
13371 if(templateString[len - 1] == '>')
13372 templateString[len++] = ' ';
13373 templateString[len++] = '>';
13374 templateString[len++] = '\0';
13377 struct Context * context = SetupTemplatesContext(_class);
13379 FreeType(exp->expType);
13380 exp->expType = ProcessTypeString(templateString, 0x0);
13381 FinishTemplatesContext(context);
13385 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")))))))));
13388 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13390 type = ProcessTemplateParameterType(type->templateParameter);
13393 if(type && (type->kind == 20))
13395 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13397 struct Identifier * id = exp->member.member;
13398 int typeKind = type->kind;
13399 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));
13401 if(typeKind == 19 && exp->member.exp->type == 26)
13403 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13406 if(id && (typeKind == 3 || typeKind == 15))
13407 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13410 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13411 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13412 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13413 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13414 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13416 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13417 exp->member.memberType = 1;
13418 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13419 Compiler_Error("invalid class specifier %s for object of class %s\n", _class->fullName, type->_class->string);
13422 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13424 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13425 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13427 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13429 member = (((void *)0));
13431 if(!member && !prop)
13432 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13433 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13434 exp->member.thisPtr = 0x1;
13440 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13441 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13442 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13444 if(!prop && !member)
13446 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13449 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13450 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13451 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13456 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13457 prop = (((void *)0));
13459 member = (((void *)0));
13463 if(!prop && !member)
13464 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13465 if(!prop && !member && !method)
13469 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13472 exp->member.memberType = 5;
13473 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13477 char structName[1024];
13478 struct Identifier * id = exp->member.member;
13479 struct Expression * classExp = exp->member.exp;
13482 FreeType(classExp->expType);
13483 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13484 strcpy(structName, "__ecereClassData_");
13485 FullClassNameCat(structName, type->_class->string, 0x0);
13487 exp->member.member = id;
13488 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(289)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type->_class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
13490 ProcessExpressionType(exp);
13496 struct Symbol * classSym = FindClass(id->string);
13500 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13503 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13509 exp->member.memberType = 1;
13510 if(!prop->dataType)
13511 ProcessPropertyType(prop);
13512 exp->expType = prop->dataType;
13514 prop->dataType->refCount++;
13518 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13520 FreeExpContents(exp);
13522 exp->identifier = MkIdentifier("class");
13523 ProcessExpressionType(exp);
13526 exp->member.memberType = 3;
13527 DeclareStruct(_class->fullName, 0x0);
13528 if(!member->dataType)
13530 struct Context * context = SetupTemplatesContext(_class);
13532 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13533 FinishTemplatesContext(context);
13535 exp->expType = member->dataType;
13536 if(member->dataType)
13537 member->dataType->refCount++;
13539 else if(revConvert)
13541 exp->member.memberType = 4;
13542 exp->expType = MkClassType(revConvert->_class->fullName);
13548 exp->member.memberType = 2;
13550 if(!method->dataType)
13551 ProcessMethodType(method);
13552 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));
13553 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13554 exp->expType->usedClass = _class;
13556 else if(!classProp)
13558 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13560 FreeExpContents(exp);
13562 exp->identifier = MkIdentifier("class");
13563 ProcessExpressionType(exp);
13566 yylloc = exp->member.member->loc;
13567 Compiler_Error("couldn't find member %s in class %s\n", id->string, _class->fullName);
13569 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13571 if(_class && exp->expType)
13573 struct __ecereNameSpace__ecere__com__Class * tClass;
13576 while(tClass && !tClass->templateClass)
13577 tClass = tClass->base;
13578 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13581 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13582 struct __ecereNameSpace__ecere__com__Class * sClass;
13584 for(sClass = tClass; sClass; sClass = sClass->base)
13587 if(sClass->templateClass)
13588 sClass = sClass->templateClass;
13589 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13591 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13593 for(sClass = sClass->base; sClass; sClass = sClass->base)
13594 id += sClass->templateParams.count;
13602 if(curParam && tClass->templateArgs[id].dataTypeString)
13604 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13605 struct Context * context = SetupTemplatesContext(tClass);
13607 FreeType(exp->expType);
13608 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13611 if(exp->expType->kind == 21)
13613 FreeType(exp->expType);
13614 exp->expType = ReplaceThisClassType(_class);
13616 if(tClass->templateClass)
13617 exp->expType->passAsTemplate = 0x1;
13620 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13621 if(exp->destType->kind == 21)
13623 FreeType(exp->destType);
13624 exp->destType = ReplaceThisClassType(_class);
13628 FinishTemplatesContext(context);
13631 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13634 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13635 struct __ecereNameSpace__ecere__com__Class * sClass;
13637 for(sClass = tClass; sClass; sClass = sClass->base)
13640 if(sClass->templateClass)
13641 sClass = sClass->templateClass;
13642 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13644 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13646 for(sClass = sClass->base; sClass; sClass = sClass->base)
13647 id += sClass->templateParams.count;
13657 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13658 struct Context * context = SetupTemplatesContext(tClass);
13659 struct Type * basicType;
13661 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13664 if(basicType->kind == 21)
13666 FreeType(basicType);
13667 basicType = ReplaceThisClassType(_class);
13669 FreeType(exp->expType);
13670 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));
13673 exp->destType = exp->expType;
13674 exp->destType->refCount++;
13677 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13678 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13679 struct Declarator * decl;
13681 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13684 exp->destType->refCount++;
13686 exp->expType->refCount++;
13688 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13689 exp->cast.exp = newExp;
13692 FinishTemplatesContext(context);
13695 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13697 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13701 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13704 int paramCount = 0;
13705 int lastParam = -1;
13706 char templateString[1024];
13707 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13709 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13710 while(cClass != expClass)
13712 struct __ecereNameSpace__ecere__com__Class * sClass;
13714 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13717 for(param = cClass->templateParams.first; param; param = param->next)
13719 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13722 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13723 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13725 while(cClassCur != tClass && !paramCur)
13727 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13729 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13731 cClassCur = sClassCur;
13732 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13734 if(!strcmp(paramCur->name, param->name))
13741 if(paramCur && paramCur->type == 0)
13742 arg = tClass->templateArgs[cp];
13744 arg = expClass->templateArgs[p];
13746 char argument[256];
13748 argument[0] = '\0';
13749 switch(param->type)
13753 char expString[1024];
13754 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13755 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13756 struct Expression * exp;
13757 char * string = PrintHexUInt64(arg.expression.ui64);
13759 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13760 ProcessExpressionType(exp);
13761 ComputeExpression(exp);
13762 expString[0] = '\0';
13763 PrintExpression(exp, expString);
13764 strcat(argument, expString);
13765 FreeExpression(exp);
13770 strcat(argument, arg.member->name);
13775 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13776 strcat(argument, arg.dataTypeString);
13783 strcat(templateString, ", ");
13784 if(lastParam != p - 1)
13786 strcat(templateString, param->name);
13787 strcat(templateString, " = ");
13789 strcat(templateString, argument);
13798 int len = strlen(templateString);
13800 if(templateString[len - 1] == '>')
13801 templateString[len++] = ' ';
13802 templateString[len++] = '>';
13803 templateString[len++] = '\0';
13805 FreeType(exp->expType);
13807 struct Context * context = SetupTemplatesContext(tClass);
13809 exp->expType = ProcessTypeString(templateString, 0x0);
13810 FinishTemplatesContext(context);
13817 Compiler_Error("undefined class %s\n", (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
13819 else if(type && (type->kind == 9 || type->kind == 10))
13821 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13825 exp->expType = memberType;
13827 memberType->refCount++;
13832 char expString[10240];
13834 expString[0] = '\0';
13837 PrintExpression(exp, expString);
13838 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13840 Compiler_Error("member operator on non-structure type expression %s\n", expString);
13842 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13844 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13846 struct Identifier * id = exp->member.member;
13847 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));
13851 FreeType(exp->expType);
13852 exp->expType = ReplaceThisClassType(_class);
13856 yylloc = oldyylloc;
13861 struct Type * destType = exp->destType;
13863 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13865 exp->member.member->classSym = exp->member.member->_class->symbol;
13867 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13871 ProcessExpressionType(exp);
13878 struct Symbol * classSym = exp->_class->symbol;
13880 if(classSym && classSym->registered)
13882 if(classSym->registered->type == 5)
13887 DeclareStruct(classSym->string, 0x0);
13888 FreeSpecifier(exp->_class);
13890 FullClassNameCat(name, classSym->string, 0x0);
13891 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13895 if(classSym->registered->fixed)
13897 FreeSpecifier(exp->_class);
13898 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13903 char className[1024];
13905 strcpy(className, "__ecereClass_");
13906 FullClassNameCat(className, classSym->string, 0x1);
13907 MangleClassName(className);
13908 DeclareClass(classSym, className);
13909 FreeExpContents(exp);
13911 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13912 exp->member.member = MkIdentifier("structSize");
13916 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13921 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13923 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13924 exp->isConstant = 0x1;
13925 DeclareType(type, 0x0, 0x0);
13931 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13933 type->count = (unsigned int)1;
13934 FreeType(exp->cast.exp->destType);
13935 exp->cast.exp->destType = type;
13937 ProcessExpressionType(exp->cast.exp);
13938 type->count = (unsigned int)0;
13939 exp->expType = type;
13940 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13942 void * prev = exp->prev, * next = exp->next;
13943 struct Type * expType = exp->cast.exp->destType;
13944 struct Expression * castExp = exp->cast.exp;
13945 struct Type * destType = exp->destType;
13948 expType->refCount++;
13949 FreeType(exp->expType);
13950 FreeTypeName(exp->cast.typeName);
13952 FreeType(exp->expType);
13953 FreeType(exp->destType);
13954 exp->expType = expType;
13955 exp->destType = destType;
13956 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
13962 exp->isConstant = exp->cast.exp->isConstant;
13968 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
13971 exp->expType = type;
13976 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
13978 ProcessExpressionType(exp->vaArg.exp);
13980 exp->expType = type;
13985 struct Expression * e;
13987 exp->isConstant = 0x1;
13988 FreeType(exp->cond.cond->destType);
13989 exp->cond.cond->destType = MkClassType("bool");
13990 exp->cond.cond->destType->truth = 0x1;
13991 ProcessExpressionType(exp->cond.cond);
13992 if(!exp->cond.cond->isConstant)
13993 exp->isConstant = 0x0;
13994 for(e = (*exp->cond.exp).first; e; e = e->next)
13998 FreeType(e->destType);
13999 e->destType = exp->destType;
14001 e->destType->refCount++;
14003 ProcessExpressionType(e);
14006 exp->expType = e->expType;
14008 e->expType->refCount++;
14011 exp->isConstant = 0x0;
14013 FreeType(exp->cond.elseExp->destType);
14014 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14015 if(exp->cond.elseExp->destType)
14016 exp->cond.elseExp->destType->refCount++;
14017 ProcessExpressionType(exp->cond.elseExp);
14018 if(!exp->cond.elseExp->isConstant)
14019 exp->isConstant = 0x0;
14024 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14026 struct Statement * last = (*exp->compound->compound.statements).last;
14028 if(last->type == 3 && last->expressions && (*last->expressions).last)
14030 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14032 exp->destType->refCount++;
14034 ProcessStatement(exp->compound);
14035 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14036 if(((struct Expression *)(*last->expressions).last)->expType)
14037 exp->expType->refCount++;
14043 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14045 if(spec && spec->type == 1)
14047 exp->expType = MkClassType(spec->name);
14048 exp->expType->kind = 19;
14049 exp->byReference = 0x1;
14053 exp->expType = MkClassType("ecere::com::Class");
14054 exp->byReference = 0x1;
14060 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14064 struct Identifier * id = exp->classData.id;
14065 char structName[1024];
14066 struct Expression * classExp;
14068 strcpy(structName, "__ecereClassData_");
14069 FullClassNameCat(structName, _class->fullName, 0x0);
14071 exp->member.member = id;
14072 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14073 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14075 classExp = MkExpIdentifier(MkIdentifier("class"));
14076 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(289)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class->fullName)), (((void *)0))), MkIdentifier("offsetClass"))))))));
14077 ProcessExpressionType(exp);
14084 struct Type * type = (((void *)0));
14085 char * typeString = (((void *)0));
14086 char typeStringBuf[1024];
14088 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))
14090 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14092 typeString = templateClass->templateArgs[2].dataTypeString;
14096 struct Expression * e;
14098 for(e = (*exp->list).first; e; e = e->next)
14100 ProcessExpressionType(e);
14110 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14114 e->expType = (((void *)0));
14115 e = (*exp->list).first;
14116 ProcessExpressionType(e);
14119 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14121 FreeType(e->expType);
14122 e->expType = (((void *)0));
14124 type = (((void *)0));
14132 FreeType(e->expType);
14133 e->expType = (((void *)0));
14139 typeStringBuf[0] = '\0';
14140 PrintType(type, typeStringBuf, 0x0, 0x1);
14141 typeString = typeStringBuf;
14143 type = (((void *)0));
14148 char templateString[1024];
14149 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14150 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14151 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14152 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14154 struct Expression * e;
14155 struct Expression * expExt;
14156 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14157 struct Context * context = PushContext();
14159 sprintf(templateString, "Container<%s>", typeString);
14160 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14161 sprintf(count, "%d", (*exp->list).count);
14162 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14163 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14164 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14165 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14168 type = ProcessTypeString(typeString, 0x0);
14169 while(e = (*exp->list).first)
14171 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14172 e->destType = type;
14174 ProcessExpressionType(e);
14175 ListAdd(initializers, MkInitializerAssignment(e));
14178 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14180 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14181 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14182 exp->expType = ProcessTypeString(templateString, 0x0);
14184 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14185 expExt->compound->compound.context = context;
14186 PopContext(context);
14187 ProcessExpressionType(expExt);
14191 exp->expType = ProcessTypeString("Container", 0x0);
14192 Compiler_Error("Couldn't determine type of array elements\n");
14197 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14199 FreeType(exp->expType);
14200 exp->expType = ReplaceThisClassType(thisClass);
14202 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14204 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14208 if(exp->expType->kind != 15)
14210 struct Type * member;
14212 exp->expType->members = symbol->type->members;
14213 for(member = symbol->type->members.first; member; member = member->next)
14214 member->refCount++;
14218 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14220 for(member = symbol->type->members.first; member; member = member->next)
14222 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14224 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14230 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14232 else if(exp->destType && !exp->destType->keepCast)
14234 if(!CheckExpressionType(exp, exp->destType, 0x0))
14236 if(!exp->destType->count || unresolved)
14241 if(exp->destType->kind != 14)
14248 char expString[10240];
14250 expString[0] = '\0';
14251 PrintType(exp->destType, type2, 0x0, 0x1);
14254 PrintExpression(exp, expString);
14255 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14258 Compiler_Error("unresolved identifier %s; expected %s\n", expString, type2);
14259 else if(exp->type != 16)
14260 Compiler_Error("couldn't determine type of %s; expected %s\n", expString, type2);
14265 char expString[10240];
14267 expString[0] = '\0';
14270 PrintExpression(exp, expString);
14271 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14274 Compiler_Error("unresolved identifier %s\n", expString);
14275 else if(exp->type != 16)
14276 Compiler_Error("couldn't determine type of %s\n", expString);
14288 PrintType(exp->expType, type1, 0x0, 0x1);
14289 PrintType(exp->destType, type2, 0x0, 0x1);
14291 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)))
14295 char expString[10240];
14297 expString[0] = '\0';
14300 PrintExpression(exp, expString);
14301 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14303 Compiler_Warning("incompatible expression %s (%s); expected %s\n", expString, type1, type2);
14304 FreeType(exp->expType);
14305 exp->destType->refCount++;
14306 exp->expType = exp->destType;
14311 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14313 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14314 char typeString[1024];
14315 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14316 struct Declarator * decl;
14318 typeString[0] = '\0';
14321 exp->expType->refCount++;
14323 exp->expType->refCount++;
14325 newExp->destType = exp->expType;
14326 PrintType(exp->expType, typeString, 0x0, 0x0);
14327 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14328 exp->cast.typeName = MkTypeName(specs, decl);
14329 exp->cast.exp = newExp;
14332 else if(unresolved)
14334 if(exp->identifier->_class && exp->identifier->_class->name)
14335 Compiler_Error("unresolved identifier %s::%s\n", exp->identifier->_class->name, exp->identifier->string);
14336 else if(exp->identifier->string && exp->identifier->string[0])
14337 Compiler_Error("unresolved identifier %s\n", exp->identifier->string);
14339 else if(!exp->expType && exp->type != 16)
14341 char expString[10240];
14343 expString[0] = '\0';
14346 PrintExpression(exp, expString);
14347 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14349 Compiler_Error("couldn't determine type of %s\n", expString);
14351 ApplyAnyObjectLogic(exp);
14352 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14354 exp->byReference = 0x1;
14356 yylloc = oldyylloc;
14359 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)
14363 *curMember = (*curMember)->next;
14364 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14366 *curMember = subMemberStack[--(*subMemberStackPos)];
14367 *curMember = (*curMember)->next;
14369 while((*curMember) && (*curMember)->isProperty)
14370 *curMember = (*curMember)->next;
14371 if(subMemberStackPos)
14373 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14375 subMemberStack[(*subMemberStackPos)++] = *curMember;
14376 *curMember = (*curMember)->members.first;
14377 while(*curMember && (*curMember)->isProperty)
14378 *curMember = (*curMember)->next;
14386 if(subMemberStackPos && *subMemberStackPos)
14388 *curMember = subMemberStack[--(*subMemberStackPos)];
14389 *curMember = (*curMember)->next;
14393 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14395 if(*curClass == _class)
14397 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14399 *curMember = (*curClass)->membersAndProperties.first;
14401 while((*curMember) && (*curMember)->isProperty)
14402 *curMember = (*curMember)->next;
14403 if(subMemberStackPos)
14405 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14407 subMemberStack[(*subMemberStackPos)++] = *curMember;
14408 *curMember = (*curMember)->members.first;
14409 while(*curMember && (*curMember)->isProperty)
14410 *curMember = (*curMember)->next;
14417 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14422 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14424 if(init->exp && !init->exp->destType)
14426 FreeType(init->exp->destType);
14427 init->exp->destType = type;
14433 ProcessExpressionType(init->exp);
14434 init->isConstant = init->exp->isConstant;
14440 struct Expression * exp = init->exp;
14441 struct Instantiation * inst = exp->instance;
14442 struct MembersInit * members;
14445 init->list = MkList();
14448 for(members = (*inst->members).first; members; members = members->next)
14450 if(members->type == 0)
14452 struct MemberInit * member;
14454 for(member = (*members->dataMembers).first; member; member = member->next)
14456 ListAdd(init->list, member->initializer);
14457 member->initializer = (((void *)0));
14462 FreeExpression(exp);
14466 struct Initializer * i;
14467 struct Type * initializerType = (((void *)0));
14468 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14469 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14470 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14471 int subMemberStackPos = 0;
14473 if(type && type->kind == 12)
14474 initializerType = Dereference(type);
14475 else if(type && (type->kind == 9 || type->kind == 10))
14476 initializerType = type->members.first;
14477 for(i = (*init->list).first; i; i = i->next)
14479 if(type && type->kind == 8 && type->_class && type->_class->registered)
14481 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14484 if(!curMember->dataType)
14485 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14486 initializerType = curMember->dataType;
14489 ProcessInitializer(i, initializerType);
14490 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14491 initializerType = initializerType->next;
14493 init->isConstant = 0x0;
14495 if(type && type->kind == 12)
14496 FreeType(initializerType);
14497 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14499 Compiler_Error("Assigning list initializer to non list\n");
14506 extern struct Symbol * FindType(struct Context * ctx, char * name);
14508 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14510 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14516 if(spec->specifier == 321)
14521 spec->name = ReplaceThisClass(thisClass);
14522 spec->symbol = FindClass(spec->name);
14523 ProcessSpecifier(spec, declareStruct);
14530 struct Symbol * symbol = FindType(curContext, spec->name);
14533 DeclareType(symbol->type, 0x1, 0x1);
14534 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14535 DeclareStruct(spec->name, 0x0);
14540 struct Enumerator * e;
14544 for(e = (*spec->list).first; e; e = e->next)
14547 ProcessExpressionType(e->exp);
14555 if(spec->definitions)
14557 struct ClassDef * def;
14558 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14560 ProcessClass(spec->definitions, symbol);
14567 static void ProcessDeclarator(struct Declarator * decl)
14572 if(decl->identifier->classSym)
14574 FreeSpecifier(decl->identifier->_class);
14575 decl->identifier->_class = (((void *)0));
14579 if(decl->array.exp)
14580 ProcessExpressionType(decl->array.exp);
14587 if(decl->declarator)
14588 ProcessDeclarator(decl->declarator);
14589 if(decl->type == 4)
14591 struct Identifier * id = GetDeclId(decl);
14593 if(id && id->_class)
14595 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14597 if(!decl->function.parameters)
14598 decl->function.parameters = MkList();
14599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14600 id->_class = (((void *)0));
14602 if(decl->function.parameters)
14604 struct TypeName * param;
14606 for(param = (*decl->function.parameters).first; param; param = param->next)
14608 if(param->qualifiers && (*param->qualifiers).first)
14610 struct Specifier * spec = (*param->qualifiers).first;
14612 if(spec && spec->specifier == 337)
14614 struct Declarator * d = param->declarator;
14615 struct TypeName * newParam = (newParam = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), newParam->qualifiers = MkListOne(MkSpecifier(301)), newParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d), newParam);
14617 FreeList(param->qualifiers, FreeSpecifier);
14618 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14619 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14620 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14623 else if(spec && spec->specifier == 338)
14625 struct Declarator * d = param->declarator;
14627 FreeList(param->qualifiers, FreeSpecifier);
14628 param->qualifiers = MkListOne(MkSpecifier(301));
14629 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14631 else if(spec->specifier == 321)
14636 spec->name = ReplaceThisClass(thisClass);
14637 spec->symbol = FindClass(spec->name);
14638 ProcessSpecifier(spec, 0x0);
14642 if(param->declarator)
14643 ProcessDeclarator(param->declarator);
14651 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14653 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14655 static void ProcessDeclaration(struct Declaration * decl)
14657 yylloc = decl->loc;
14662 unsigned int declareStruct = 0x0;
14664 if(decl->declarators)
14666 struct InitDeclarator * d;
14668 for(d = (*decl->declarators).first; d; d = d->next)
14670 struct Type * type, * subType;
14672 ProcessDeclarator(d->declarator);
14673 type = ProcessType(decl->specifiers, d->declarator);
14676 ProcessInitializer(d->initializer, type);
14677 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14679 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14681 struct Instantiation * inst = d->initializer->exp->instance;
14683 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14684 d->initializer->exp->instance = (((void *)0));
14685 if(decl->specifiers)
14686 FreeList(decl->specifiers, FreeSpecifier);
14687 FreeList(decl->declarators, FreeInitDeclarator);
14694 for(subType = type; subType; )
14696 if(subType->kind == 8)
14698 declareStruct = 0x1;
14701 else if(subType->kind == 13)
14703 else if(subType->kind == 12)
14704 subType = subType->arrayType;
14713 if(decl->specifiers)
14715 struct Specifier * s;
14717 for(s = (*decl->specifiers).first; s; s = s->next)
14719 ProcessSpecifier(s, declareStruct);
14726 ProcessInstantiationType(decl->inst);
14731 struct Specifier * spec;
14732 struct Declarator * d;
14733 unsigned int declareStruct = 0x0;
14735 if(decl->declarators)
14737 for(d = (*decl->declarators).first; d; d = d->next)
14739 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14740 struct Type * subType;
14742 ProcessDeclarator(d);
14743 for(subType = type; subType; )
14745 if(subType->kind == 8)
14747 declareStruct = 0x1;
14750 else if(subType->kind == 13)
14752 else if(subType->kind == 12)
14753 subType = subType->arrayType;
14760 if(decl->specifiers)
14762 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14763 ProcessSpecifier(spec, declareStruct);
14770 static struct FunctionDefinition * curFunction;
14772 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14774 char propName[1024], propNameM[1024];
14775 char getName[1024], setName[1024];
14776 struct __ecereNameSpace__ecere__sys__OldList * args;
14778 DeclareProperty(prop, setName, getName);
14779 strcpy(propName, "__ecereProp_");
14780 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14781 strcat(propName, "_");
14782 FullClassNameCat(propName, prop->name, 0x1);
14783 MangleClassName(propName);
14784 strcpy(propNameM, "__ecerePropM_");
14785 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14786 strcat(propNameM, "_");
14787 FullClassNameCat(propNameM, prop->name, 0x1);
14788 MangleClassName(propNameM);
14789 if(prop->isWatchable)
14792 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14793 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14794 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14796 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14797 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14798 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14802 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14803 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14804 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14806 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14807 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14808 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14810 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14811 curFunction->propSet->fireWatchersDone = 0x1;
14814 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14816 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14818 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14820 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14822 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14824 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14826 static void ProcessStatement(struct Statement * stmt)
14828 yylloc = stmt->loc;
14832 ProcessStatement(stmt->labeled.stmt);
14835 if(stmt->caseStmt.exp)
14837 FreeType(stmt->caseStmt.exp->destType);
14838 stmt->caseStmt.exp->destType = curSwitchType;
14840 curSwitchType->refCount++;
14841 ProcessExpressionType(stmt->caseStmt.exp);
14842 ComputeExpression(stmt->caseStmt.exp);
14844 if(stmt->caseStmt.stmt)
14845 ProcessStatement(stmt->caseStmt.stmt);
14849 if(stmt->compound.context)
14851 struct Declaration * decl;
14852 struct Statement * s;
14853 struct Statement * prevCompound = curCompound;
14854 struct Context * prevContext = curContext;
14856 if(!stmt->compound.isSwitch)
14858 curCompound = stmt;
14859 curContext = stmt->compound.context;
14861 if(stmt->compound.declarations)
14863 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14864 ProcessDeclaration(decl);
14866 if(stmt->compound.statements)
14868 for(s = (*stmt->compound.statements).first; s; s = s->next)
14869 ProcessStatement(s);
14871 curContext = prevContext;
14872 curCompound = prevCompound;
14878 struct Expression * exp;
14880 if(stmt->expressions)
14882 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14883 ProcessExpressionType(exp);
14889 struct Expression * exp;
14891 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14892 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14893 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14894 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14896 ProcessExpressionType(exp);
14898 if(stmt->ifStmt.stmt)
14899 ProcessStatement(stmt->ifStmt.stmt);
14900 if(stmt->ifStmt.elseStmt)
14901 ProcessStatement(stmt->ifStmt.elseStmt);
14906 struct Type * oldSwitchType = curSwitchType;
14908 if(stmt->switchStmt.exp)
14910 struct Expression * exp;
14912 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14916 ProcessExpressionType(exp);
14919 curSwitchType = exp->expType;
14922 ProcessStatement(stmt->switchStmt.stmt);
14923 curSwitchType = oldSwitchType;
14928 if(stmt->whileStmt.exp)
14930 struct Expression * exp;
14932 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14933 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14934 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14935 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14937 ProcessExpressionType(exp);
14940 if(stmt->whileStmt.stmt)
14941 ProcessStatement(stmt->whileStmt.stmt);
14946 if(stmt->doWhile.exp)
14948 struct Expression * exp;
14950 if((*stmt->doWhile.exp).last)
14952 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
14953 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
14954 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
14956 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
14958 ProcessExpressionType(exp);
14961 if(stmt->doWhile.stmt)
14962 ProcessStatement(stmt->doWhile.stmt);
14967 struct Expression * exp;
14969 if(stmt->forStmt.init)
14970 ProcessStatement(stmt->forStmt.init);
14971 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
14973 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
14974 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
14975 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
14977 if(stmt->forStmt.check)
14978 ProcessStatement(stmt->forStmt.check);
14979 if(stmt->forStmt.increment)
14981 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
14982 ProcessExpressionType(exp);
14984 if(stmt->forStmt.stmt)
14985 ProcessStatement(stmt->forStmt.stmt);
14990 struct Identifier * id = stmt->forEachStmt.id;
14991 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
14992 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
14993 struct Statement * block = stmt->forEachStmt.stmt;
14994 char iteratorType[1024];
14995 struct Type * source;
14996 struct Expression * e;
14997 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));
14998 struct Expression * arrayExp;
14999 char * typeString = (((void *)0));
15000 int builtinCount = 0;
15002 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15006 FreeType(e->destType);
15007 e->destType = ProcessTypeString("Container", 0x0);
15009 if(!isBuiltin || e->next)
15010 ProcessExpressionType(e);
15012 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15013 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15015 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15016 struct Symbol * symbol;
15017 struct Expression * expIt = (((void *)0));
15018 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15019 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15020 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15021 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15024 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15025 stmt->compound.context->parent = curContext;
15026 curContext = stmt->compound.context;
15027 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15029 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15030 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15032 isCustomAVLTree = 0x1;
15033 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15035 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15038 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15040 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15042 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15045 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15049 struct Declarator * decl;
15050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15052 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15053 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15054 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15058 struct Type * type = (((void *)0));
15059 char typeStringBuf[1024];
15061 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15062 if(((struct Expression *)(*exp).last)->type == 11)
15064 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15067 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15069 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)
15071 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15073 typeString = templateClass->templateArgs[2].dataTypeString;
15075 else if(arrayExp->list)
15077 struct Expression * e;
15079 for(e = (*arrayExp->list).first; e; e = e->next)
15081 ProcessExpressionType(e);
15091 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15095 e->expType = (((void *)0));
15096 e = (*arrayExp->list).first;
15097 ProcessExpressionType(e);
15100 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15102 FreeType(e->expType);
15103 e->expType = (((void *)0));
15105 type = (((void *)0));
15113 FreeType(e->expType);
15114 e->expType = (((void *)0));
15120 typeStringBuf[0] = '\0';
15121 PrintType(type, typeStringBuf, 0x0, 0x1);
15122 typeString = typeStringBuf;
15128 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15129 struct Declarator * decl;
15130 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15134 struct Expression * e;
15136 builtinCount = (*arrayExp->list).count;
15137 type = ProcessTypeString(typeString, 0x0);
15138 while(e = (*arrayExp->list).first)
15140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15141 e->destType = type;
15143 ProcessExpressionType(e);
15144 ListAdd(initializers, MkInitializerAssignment(e));
15147 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15149 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15150 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15151 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15152 FreeList(exp, FreeExpression);
15156 arrayExp->expType = ProcessTypeString("Container", 0x0);
15157 Compiler_Error("Couldn't determine type of array elements\n");
15160 else if(isLinkList && !isList)
15162 struct Declarator * decl;
15163 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15165 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15166 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15167 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15169 else if(_class->templateArgs)
15172 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15174 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15175 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15177 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15178 if(block && block->type == 2 && block->compound.context)
15180 block->compound.context->parent = stmt->compound.context;
15184 block = MkIfStmt(filter, block, (((void *)0)));
15188 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)), 263, (((void *)0)))), block));
15189 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15190 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15191 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15197 sprintf(count, "%d", builtinCount);
15198 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)), 263, (((void *)0)))), block));
15199 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15200 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15201 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15203 else if(isLinkList && !isList)
15205 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15206 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15208 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15210 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));
15214 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15215 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15217 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));
15219 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15220 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15221 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15225 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15227 ProcessExpressionType(expIt);
15228 if((*stmt->compound.declarations).first)
15229 ProcessDeclaration((*stmt->compound.declarations).first);
15231 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15232 ProcessStatement(stmt);
15233 curContext = stmt->compound.context->parent;
15238 Compiler_Error("Expression is not a container\n");
15250 struct Expression * exp;
15252 if(stmt->expressions)
15254 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15258 if(curFunction && !curFunction->type)
15259 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15260 FreeType(exp->destType);
15261 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15263 exp->destType->refCount++;
15265 ProcessExpressionType(exp);
15272 ProcessDeclaration(stmt->decl);
15277 struct AsmField * field;
15279 if(stmt->asmStmt.inputFields)
15281 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15282 if(field->expression)
15283 ProcessExpressionType(field->expression);
15285 if(stmt->asmStmt.outputFields)
15287 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15288 if(field->expression)
15289 ProcessExpressionType(field->expression);
15291 if(stmt->asmStmt.clobberedFields)
15293 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15295 if(field->expression)
15296 ProcessExpressionType(field->expression);
15303 struct PropertyWatch * propWatch;
15304 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15305 struct Expression * object = stmt->_watch.object;
15306 struct Expression * watcher = stmt->_watch.watcher;
15309 ProcessExpressionType(watcher);
15311 ProcessExpressionType(object);
15314 if(watcher || thisClass)
15316 struct External * external = curExternal;
15317 struct Context * context = curContext;
15320 stmt->expressions = MkList();
15321 curExternal = external->prev;
15322 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15324 struct ClassFunction * func;
15325 char watcherName[1024];
15326 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15327 struct External * createdExternal;
15328 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15330 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15331 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15332 if(propWatch->deleteWatch)
15333 strcat(watcherName, "_delete");
15336 struct Identifier * propID;
15338 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15340 strcat(watcherName, "_");
15341 strcat(watcherName, propID->string);
15344 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15346 func = MkClassFunction(MkListOne(MkSpecifier(301)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15347 ProcessClassFunctionBody(func, propWatch->compound);
15348 propWatch->compound = (((void *)0));
15349 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15350 createdExternal->symbol->idCode = external->symbol->idCode;
15351 curExternal = createdExternal;
15352 ProcessFunction(createdExternal->function);
15354 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15356 externalDecl->declaration = decl;
15357 if(decl->symbol && !decl->symbol->pointerExternal)
15358 decl->symbol->pointerExternal = externalDecl;
15360 if(propWatch->deleteWatch)
15362 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15364 ListAdd(args, CopyExpression(object));
15365 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15366 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15367 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15371 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15372 struct Identifier * propID;
15374 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15376 char propName[1024];
15377 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15381 char getName[1024], setName[1024];
15382 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15384 DeclareProperty(prop, setName, getName);
15385 strcpy(propName, "__ecereProp_");
15386 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15387 strcat(propName, "_");
15388 FullClassNameCat(propName, prop->name, 0x1);
15389 ListAdd(args, CopyExpression(object));
15390 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15391 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15392 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15393 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15396 Compiler_Error("Property %s not found in class %s\n", prop->name, _class->fullName);
15401 Compiler_Error("Invalid watched object\n");
15403 curExternal = external;
15404 curContext = context;
15406 FreeExpression(watcher);
15408 FreeExpression(object);
15409 FreeList(watches, FreePropertyWatch);
15412 Compiler_Error("No observer specified and not inside a _class\n");
15416 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15418 ProcessStatement(propWatch->compound);
15425 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15426 struct Expression * object = stmt->_watch.object;
15427 struct __ecereNameSpace__ecere__com__Class * _class;
15430 ProcessExpressionType(object);
15433 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15436 struct Identifier * propID;
15439 stmt->expressions = MkList();
15440 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15442 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15449 for(propID = (*watches).first; propID; propID = propID->next)
15451 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15455 CreateFireWatcher(prop, object, stmt);
15458 Compiler_Error("Property %s not found in class %s\n", propID->string, _class->fullName);
15463 struct __ecereNameSpace__ecere__com__Property * prop;
15464 struct __ecereNameSpace__ecere__com__Class * base;
15466 for(base = _class; base; base = base->base)
15468 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15470 if(prop->isProperty && prop->isWatchable)
15472 CreateFireWatcher(prop, object, stmt);
15478 FreeExpression(object);
15479 FreeList(watches, FreeIdentifier);
15482 Compiler_Error("Invalid object specified and not inside a class\n");
15488 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15489 struct Expression * object = stmt->_watch.object;
15490 struct Expression * watcher = stmt->_watch.watcher;
15491 struct __ecereNameSpace__ecere__com__Class * _class;
15494 ProcessExpressionType(object);
15496 ProcessExpressionType(watcher);
15499 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15500 if(watcher || thisClass)
15504 struct Identifier * propID;
15507 stmt->expressions = MkList();
15510 struct __ecereNameSpace__ecere__sys__OldList * args;
15513 ListAdd(args, CopyExpression(object));
15514 ListAdd(args, MkExpConstant("0"));
15515 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15516 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15520 for(propID = (*watches).first; propID; propID = propID->next)
15522 char propName[1024];
15523 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15527 char getName[1024], setName[1024];
15528 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15530 DeclareProperty(prop, setName, getName);
15531 strcpy(propName, "__ecereProp_");
15532 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15533 strcat(propName, "_");
15534 FullClassNameCat(propName, prop->name, 0x1);
15535 MangleClassName(propName);
15536 ListAdd(args, CopyExpression(object));
15537 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15538 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15539 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15542 Compiler_Error("Property %s not found in class %s\n", prop->name, _class->fullName);
15546 FreeExpression(object);
15548 FreeExpression(watcher);
15549 FreeList(watches, FreeIdentifier);
15552 Compiler_Error("Invalid object specified and not inside a class\n");
15555 Compiler_Error("No observer specified and not inside a class\n");
15562 extern struct Expression * QBrackets(struct Expression * exp);
15564 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15566 extern struct Declarator * QMkPtrDecl(char * id);
15568 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15570 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15572 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15574 static void ProcessFunction(struct FunctionDefinition * function)
15576 void * __ecereTemp2;
15577 void * __ecereTemp1;
15578 struct Identifier * id = GetDeclId(function->declarator);
15579 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15580 struct Type * type = symbol ? symbol->type : (((void *)0));
15581 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15582 struct Context * oldTopContext = topContext;
15584 yylloc = function->loc;
15585 if(type && type->thisClass)
15587 struct Symbol * classSym = type->thisClass;
15588 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15589 char className[1024];
15590 char structName[1024];
15591 struct Declarator * funcDecl;
15592 struct Symbol * thisSymbol;
15593 unsigned int typedObject = 0x0;
15595 if(_class && !_class->base)
15597 _class = currentClass;
15598 if(_class && !_class->symbol)
15599 _class->symbol = FindClass(_class->fullName);
15600 classSym = _class ? _class->symbol : (((void *)0));
15603 thisClass = _class;
15604 if(inCompiler && _class)
15606 if(type->kind == 11)
15608 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15610 struct Type * param = symbol->type->params.first;
15612 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15615 if(type->classObjectType != 1)
15617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15618 symbol->type->staticMethod = 0x1;
15619 symbol->type->thisClass = (((void *)0));
15620 symbol->type->extraParam = 0x0;
15623 strcpy(className, "__ecereClass_");
15624 FullClassNameCat(className, _class->fullName, 0x1);
15625 MangleClassName(className);
15626 structName[0] = (char)0;
15627 FullClassNameCat(structName, _class->fullName, 0x0);
15628 funcDecl = GetFuncDecl(function->declarator);
15631 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15633 struct TypeName * param = (*funcDecl->function.parameters).first;
15635 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == 301 && !param->declarator)
15637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15638 FreeTypeName(param);
15641 if(!function->propertyNoThis)
15643 struct TypeName * thisParam;
15645 if(type->classObjectType != 1)
15647 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15648 if(!funcDecl->function.parameters)
15649 funcDecl->function.parameters = MkList();
15650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15654 if(type->classObjectType != 1)
15656 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15657 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15659 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));
15660 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15664 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15666 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15668 funcDecl = GetFuncDecl(initDecl->declarator);
15671 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15673 struct TypeName * param = (*funcDecl->function.parameters).first;
15675 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == 301 && !param->declarator)
15677 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15678 FreeTypeName(param);
15681 if(type->classObjectType != 1)
15683 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15685 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15687 if(!funcDecl->function.parameters)
15688 funcDecl->function.parameters = MkList();
15689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15697 if(type->classObjectType != 1)
15699 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));
15700 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15701 if(typedObject && thisSymbol->type)
15703 thisSymbol->type->classObjectType = 2;
15704 thisSymbol->type->byReference = type->byReference;
15708 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15710 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15713 struct __ecereNameSpace__ecere__com__Class * base;
15715 for(base = _class; base && base->type != 1000; base = base->next)
15717 for(member = base->membersAndProperties.first; member; member = member->next)
15718 if(!member->isProperty)
15724 for(member = _class->membersAndProperties.first; member; member = member->next)
15725 if(!member->isProperty)
15729 char pointerName[1024];
15730 struct Declaration * decl;
15731 struct Initializer * initializer;
15732 struct Expression * exp, * bytePtr;
15734 strcpy(pointerName, "__ecerePointer_");
15735 FullClassNameCat(pointerName, _class->fullName, 0x0);
15737 char className[1024];
15739 strcpy(className, "__ecereClass_");
15740 FullClassNameCat(className, classSym->string, 0x1);
15741 MangleClassName(className);
15742 DeclareClass(classSym, className);
15744 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15749 sprintf(string, "%d", _class->offset);
15750 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15754 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15756 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15757 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));
15760 yylloc = function->body->loc;
15761 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15763 struct Context * prevContext = curContext;
15765 curContext = function->body->compound.context;
15766 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15767 curContext = prevContext;
15769 decl->symbol = (((void *)0));
15770 if(!function->body->compound.declarations)
15771 function->body->compound.declarations = MkList();
15772 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15778 thisClass = (((void *)0));
15781 FreeSpecifier(id->_class);
15782 id->_class = (((void *)0));
15783 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15785 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15787 id = GetDeclId(initDecl->declarator);
15788 FreeSpecifier(id->_class);
15789 id->_class = (((void *)0));
15793 topContext = function->body->compound.context;
15795 struct FunctionDefinition * oldFunction = curFunction;
15797 curFunction = function;
15799 ProcessStatement(function->body);
15800 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15802 struct Statement * prevCompound = curCompound;
15803 struct Context * prevContext = curContext;
15804 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15806 if(!function->body->compound.statements)
15807 function->body->compound.statements = MkList();
15808 ListAdd(function->body->compound.statements, fireWatchers);
15809 curCompound = function->body;
15810 curContext = function->body->compound.context;
15811 ProcessStatement(fireWatchers);
15812 curContext = prevContext;
15813 curCompound = prevCompound;
15815 curFunction = oldFunction;
15817 if(function->declarator)
15819 ProcessDeclarator(function->declarator);
15821 topContext = oldTopContext;
15822 thisClass = oldThisClass;
15825 extern void FreeSymbol(struct Symbol * symbol);
15827 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15829 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15831 struct ClassDef * def;
15832 struct External * external = curExternal;
15833 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15835 for(def = definitions->first; def; def = def->next)
15839 if(def->function->declarator)
15840 curExternal = def->function->declarator->symbol->pointerExternal;
15842 curExternal = external;
15843 ProcessFunction((struct FunctionDefinition *)def->function);
15845 else if(def->type == 2)
15847 if(def->decl->type == 2)
15849 thisClass = regClass;
15850 ProcessInstantiationType(def->decl->inst);
15851 thisClass = (((void *)0));
15855 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15858 thisClass = regClass;
15859 ProcessDeclaration(def->decl);
15860 thisClass = backThisClass;
15863 else if(def->type == 1 && def->defProperties)
15865 struct MemberInit * defProperty;
15866 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);
15868 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15869 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15871 thisClass = regClass;
15872 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15873 thisClass = (((void *)0));
15875 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15876 FreeSymbol(thisSymbol);
15878 else if(def->type == 3 && def->propertyDef)
15880 struct PropertyDef * prop = def->propertyDef;
15882 thisClass = regClass;
15887 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15889 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15891 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15892 ProcessStatement(prop->setStmt);
15898 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15900 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15902 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15903 ProcessStatement(prop->getStmt);
15905 if(prop->issetStmt)
15909 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15911 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15913 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15914 ProcessStatement(prop->issetStmt);
15916 thisClass = (((void *)0));
15918 else if(def->type == 4 && def->propertyWatch)
15920 struct PropertyWatch * propertyWatch = def->propertyWatch;
15922 thisClass = regClass;
15923 if(propertyWatch->compound)
15925 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);
15927 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15928 curExternal = (((void *)0));
15929 ProcessStatement(propertyWatch->compound);
15931 thisClass = (((void *)0));
15936 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15938 void ComputeDataTypes()
15940 void * __ecereTemp1;
15941 struct External * external;
15942 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15944 currentClass = (((void *)0));
15945 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15946 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15947 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
15948 curExternal = temp;
15949 DeclareStruct("ecere::com::Class", 0x0);
15950 DeclareStruct("ecere::com::Instance", 0x0);
15951 DeclareStruct("ecere::com::Property", 0x0);
15952 DeclareStruct("ecere::com::DataMember", 0x0);
15953 DeclareStruct("ecere::com::Method", 0x0);
15954 DeclareStruct("ecere::com::SerialBuffer", 0x0);
15955 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
15956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
15957 for(external = (*ast).first; external; external = external->next)
15959 afterExternal = curExternal = external;
15960 if(external->type == 0)
15962 currentClass = external->function->_class;
15963 ProcessFunction(external->function);
15965 else if(external->type == 1)
15967 currentClass = (((void *)0));
15968 ProcessDeclaration(external->declaration);
15970 else if(external->type == 2)
15972 struct ClassDefinition * _class = external->_class;
15974 currentClass = external->symbol->registered;
15975 if(_class->definitions)
15977 ProcessClass(_class->definitions, _class->symbol);
15981 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15982 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15985 else if(external->type == 4)
15987 thisNameSpace = external->id->string;
15990 currentClass = (((void *)0));
15991 thisNameSpace = (((void *)0));
15992 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
15993 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
15996 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);
15998 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);
16000 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
16002 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16004 struct __ecereNameSpace__ecere__com__Class * class;
16006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16008 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16009 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16010 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16039 __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);
16040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16043 __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);
16044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16056 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16057 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16058 __ecereClass_Conversion = class;
16059 __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);
16060 __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);
16061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16062 __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);
16063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16081 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)