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, "gettext") == id->string)
11759 exp->expType = ProcessTypeString("char *(char *)", 0x1);
11762 else if(strstr(id->string, "__ecereClass") == id->string)
11764 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
11767 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
11769 ReplaceClassMembers(exp, thisClass);
11772 ProcessExpressionType(exp);
11775 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
11780 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11784 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
11790 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
11793 ProcessExpressionType(exp);
11797 else if(currentClass && !id->_class)
11799 if(ResolveIdWithClass(exp, currentClass, 0x1))
11802 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
11807 struct Type * type = symbol->type;
11808 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
11810 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
11812 struct Context * context = SetupTemplatesContext(_class);
11814 type = ReplaceThisClassType(_class);
11815 FinishTemplatesContext(context);
11817 type->refCount = 0;
11819 FreeSpecifier(id->_class);
11820 id->_class = (((void *)0));
11821 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11822 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
11823 id->classSym = (((void *)0));
11824 exp->expType = type;
11827 if(type && (type->kind == 15 || (_class && _class->type == 4)))
11828 exp->isConstant = 0x1;
11829 if(symbol->isParam || !strcmp(id->string, "this"))
11831 if(_class && _class->type == 1)
11832 exp->byReference = 0x1;
11834 if(symbol->isIterator)
11836 if(symbol->isIterator == 3)
11839 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
11840 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
11841 exp->expType = (((void *)0));
11842 ProcessExpressionType(exp);
11844 else if(symbol->isIterator != 4)
11847 exp->member.exp = MkExpIdentifier(exp->identifier);
11848 exp->member.exp->expType = exp->expType;
11849 exp->member.member = MkIdentifier("data");
11850 exp->expType = (((void *)0));
11851 ProcessExpressionType(exp);
11858 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
11860 if(thisNameSpace && !(id->_class && !id->_class->name))
11864 strcpy(name, thisNameSpace);
11865 strcat(name, "::");
11866 strcat(name, id->string);
11867 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
11870 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
11875 for(c = 0; c < definedExpStackPos; c++)
11876 if(definedExpStack[c] == definedExp)
11878 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
11880 struct Location backupYylloc = yylloc;
11882 definedExpStack[definedExpStackPos++] = definedExp;
11883 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11884 ((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));
11885 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11887 parsedExpression = (((void *)0));
11889 expression_yyparse();
11890 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11891 yylloc = backupYylloc;
11892 if(parsedExpression)
11894 FreeIdentifier(id);
11896 exp->list = MkListOne(parsedExpression);
11897 parsedExpression->loc = yylloc;
11898 ProcessExpressionType(exp);
11899 definedExpStackPos--;
11902 definedExpStackPos--;
11908 Compiler_Error("Recursion in defined expression %s\n", id->string);
11914 struct GlobalData * data = (((void *)0));
11916 if(thisNameSpace && !(id->_class && !id->_class->name))
11920 strcpy(name, thisNameSpace);
11921 strcat(name, "::");
11922 strcat(name, id->string);
11923 data = FindGlobalData(name);
11926 data = FindGlobalData(id->string);
11929 DeclareGlobalData(data);
11930 exp->expType = data->dataType;
11932 data->dataType->refCount++;
11933 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11934 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
11935 FreeSpecifier(id->_class);
11936 id->_class = (((void *)0));
11941 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
11943 if(thisNameSpace && !(id->_class && !id->_class->name))
11947 strcpy(name, thisNameSpace);
11948 strcat(name, "::");
11949 strcat(name, id->string);
11950 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
11953 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
11958 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11959 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
11961 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
11962 strcpy(name, "__ecereFunction_");
11963 FullClassNameCat(name, id->string, 0x0);
11964 if(DeclareFunction(function, name))
11966 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
11967 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
11969 exp->expType = function->dataType;
11970 if(function->dataType)
11971 function->dataType->refCount++;
11972 FreeSpecifier(id->_class);
11973 id->_class = (((void *)0));
11985 struct __ecereNameSpace__ecere__com__Class * _class;
11987 if(!exp->instance->_class)
11989 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
11991 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
11994 ProcessInstantiationType(exp->instance);
11995 exp->isConstant = exp->instance->isConstant;
11996 if(exp->instance->_class)
11998 exp->expType = MkClassType(exp->instance->_class->name);
12006 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12008 exp->expType = type;
12009 if(exp->constant[0] == '\'')
12011 if((int)((unsigned char *)exp->constant)[1] > 127)
12014 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12017 ch = exp->constant[1];
12018 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12019 exp->constant = PrintUInt(ch);
12021 type->_class = FindClass("unichar");
12022 type->isSigned = 0x0;
12027 type->isSigned = 0x1;
12030 else if(strchr(exp->constant, '.'))
12032 char ch = exp->constant[strlen(exp->constant) - 1];
12038 type->isSigned = 0x1;
12042 if(exp->constant[0] == '0' && exp->constant[1])
12043 type->isSigned = 0x0;
12044 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12045 type->isSigned = 0x0;
12046 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12047 type->isSigned = 0x0;
12049 type->isSigned = 0x1;
12052 exp->isConstant = 0x1;
12058 exp->isConstant = 0x1;
12059 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));
12064 ProcessExpressionType(exp->_new.size);
12065 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));
12066 DeclareType(exp->expType->type, 0x0, 0x0);
12070 ProcessExpressionType(exp->_renew.size);
12071 ProcessExpressionType(exp->_renew.exp);
12072 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));
12073 DeclareType(exp->expType->type, 0x0, 0x0);
12077 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12078 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12079 unsigned int useDestType = 0x0, useSideType = 0x0;
12080 struct Location oldyylloc = yylloc;
12081 unsigned int useSideUnit = 0x0;
12082 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12124 if(exp->op.op != '*' || exp->op.exp1)
12131 if(exp->op.op == '&')
12133 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12135 struct Identifier * id = exp->op.exp2->identifier;
12136 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12138 if(symbol && symbol->isIterator == 2)
12141 exp->member.exp = exp->op.exp2;
12142 exp->member.member = MkIdentifier("key");
12143 exp->expType = (((void *)0));
12144 exp->op.exp2->expType = symbol->type;
12145 symbol->type->refCount++;
12146 ProcessExpressionType(exp);
12154 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))
12156 if(exp->op.exp1->destType)
12157 FreeType(exp->op.exp1->destType);
12158 exp->op.exp1->destType = exp->destType;
12160 exp->destType->refCount++;
12164 if(exp->op.exp1->destType)
12165 FreeType(exp->op.exp1->destType);
12166 exp->op.exp1->destType = dummy;
12169 if(exp->op.exp1->destType && exp->op.op != '=')
12170 exp->op.exp1->destType->count++;
12171 ProcessExpressionType(exp->op.exp1);
12172 if(exp->op.exp1->destType && exp->op.op != '=')
12173 exp->op.exp1->destType->count--;
12174 if(exp->op.exp1->destType == dummy)
12177 exp->op.exp1->destType = (((void *)0));
12179 type1 = exp->op.exp1->expType;
12183 char expString[10240];
12185 expString[0] = '\0';
12186 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12190 exp->op.exp2->destType = exp->op.exp1->expType;
12191 if(exp->op.exp1->expType)
12192 exp->op.exp1->expType->refCount++;
12196 exp->op.exp2->destType = exp->destType;
12198 exp->destType->refCount++;
12202 exp->expType = type1;
12207 PrintExpression(exp->op.exp2, expString);
12208 if(type1 && type1->kind == 13)
12210 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)
12211 Compiler_Error("operator %s illegal on pointer\n", exp->op.op);
12212 else if(exp->op.op == '=')
12214 if(exp->op.exp2->destType)
12215 FreeType(exp->op.exp2->destType);
12216 exp->op.exp2->destType = type1;
12223 if(exp->op.op == 273 || exp->op.op == 274 || exp->op.op == 275 || exp->op.op == 278 || exp->op.op == 279)
12227 if(exp->op.exp2->destType)
12228 FreeType(exp->op.exp2->destType);
12229 exp->op.exp2->destType = type1;
12236 exp->expType = type1;
12238 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)))
12240 if(exp->op.exp2->destType)
12241 FreeType(exp->op.exp2->destType);
12242 exp->op.exp2->destType = exp->destType;
12244 exp->destType->refCount++;
12248 if(exp->op.exp2->destType)
12249 FreeType(exp->op.exp2->destType);
12250 exp->op.exp2->destType = dummy;
12253 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12255 FreeType(exp->op.exp2->destType);
12256 exp->op.exp2->destType = type1;
12259 if(exp->op.exp2->destType && exp->op.op != '=')
12260 exp->op.exp2->destType->count++;
12261 ProcessExpressionType(exp->op.exp2);
12262 if(exp->op.exp2->destType && exp->op.op != '=')
12263 exp->op.exp2->destType->count--;
12264 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12266 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)
12268 if(exp->op.op != '=' && type1->type->kind == 0)
12269 Compiler_Error("void *: unknown size\n");
12271 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)))
12273 if(exp->op.op == 276)
12274 Compiler_Error("cannot add two pointers\n");
12276 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))
12278 if(exp->op.op == 276)
12279 Compiler_Error("cannot add two pointers\n");
12281 else if(inCompiler)
12283 char type1String[1024];
12284 char type2String[1024];
12286 type1String[0] = '\0';
12287 type2String[0] = '\0';
12288 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12289 PrintType(type1, type2String, 0x0, 0x1);
12290 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12291 Compiler_Warning("incompatible expression %s (%s); expected %s\n", expString, type1String, type2String);
12294 if(exp->op.exp2->destType == dummy)
12297 exp->op.exp2->destType = (((void *)0));
12299 type2 = exp->op.exp2->expType;
12302 if(exp->op.op == 261)
12304 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12305 exp->isConstant = 0x1;
12307 else if(exp->op.op == '*' && !exp->op.exp1)
12309 exp->expType = Dereference(type2);
12310 if(type2 && type2->kind == 8)
12311 notByReference = 0x1;
12313 else if(exp->op.op == '&' && !exp->op.exp1)
12314 exp->expType = Reference(type2);
12321 if(exp->op.exp1->destType)
12322 FreeType(exp->op.exp1->destType);
12323 exp->op.exp1->destType = MkClassType("bool");
12324 exp->op.exp1->destType->truth = 0x1;
12325 if(!exp->op.exp1->expType)
12326 ProcessExpressionType(exp->op.exp1);
12328 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12329 FreeType(exp->op.exp1->expType);
12330 exp->op.exp1->expType = MkClassType("bool");
12331 exp->op.exp1->expType->truth = 0x1;
12335 if(exp->op.exp2->destType)
12336 FreeType(exp->op.exp2->destType);
12337 exp->op.exp2->destType = MkClassType("bool");
12338 exp->op.exp2->destType->truth = 0x1;
12339 if(!exp->op.exp2->expType)
12340 ProcessExpressionType(exp->op.exp2);
12342 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12343 FreeType(exp->op.exp2->expType);
12344 exp->op.exp2->expType = MkClassType("bool");
12345 exp->op.exp2->expType->truth = 0x1;
12348 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")))))
12350 if(type1 && type2 && ((type1->kind == 8 && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && strcmp(type2->_class->string, "String"))))
12352 if(exp->op.exp2->destType)
12353 FreeType(exp->op.exp2->destType);
12354 exp->op.exp2->destType = type1;
12356 if(exp->op.exp1->destType)
12357 FreeType(exp->op.exp1->destType);
12358 exp->op.exp1->destType = type2;
12360 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)
12361 Compiler_Warning("operating on %s and %s with an untyped result, assuming %s\n", type1->_class->string, type2->_class->string, type1->_class->string);
12362 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12364 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12368 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12370 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12371 ProcessExpressionType(exp->op.exp1);
12372 if(type2->kind != 13)
12374 ProcessExpressionType(classExp);
12375 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"))))))));
12376 if(!exp->op.exp2->expType)
12377 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12378 ProcessExpressionType(exp->op.exp2);
12382 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)))
12384 if(type1->kind != 8 && type1->type->kind == 0)
12385 Compiler_Error("void *: unknown size\n");
12386 exp->expType = type1;
12390 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)))
12392 if(type2->kind != 8 && type2->type->kind == 0)
12393 Compiler_Error("void *: unknown size\n");
12394 exp->expType = type2;
12398 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))
12400 Compiler_Warning("different levels of indirection\n");
12404 unsigned int success = 0x0;
12406 if(type1->kind == 13 && type2->kind == 13)
12408 if(exp->op.op == '+')
12409 Compiler_Error("cannot add two pointers\n");
12410 else if(exp->op.op == '-')
12412 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12414 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12416 if(type1->type->kind == 20)
12418 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12422 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12424 ProcessExpressionType(classExp);
12426 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")))))));
12427 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12435 if(!success && exp->op.exp1->type == 2)
12437 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12439 exp->expType = exp->op.exp1->destType;
12440 if(exp->op.exp1->destType)
12441 exp->op.exp1->destType->refCount++;
12444 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12446 exp->expType = exp->op.exp2->destType;
12447 if(exp->op.exp2->destType)
12448 exp->op.exp2->destType->refCount++;
12454 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12456 exp->expType = exp->op.exp2->destType;
12457 if(exp->op.exp2->destType)
12458 exp->op.exp2->destType->refCount++;
12461 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12463 exp->expType = exp->op.exp1->destType;
12464 if(exp->op.exp1->destType)
12465 exp->op.exp1->destType->refCount++;
12471 char expString1[10240];
12472 char expString2[10240];
12476 expString1[0] = '\0';
12477 expString2[0] = '\0';
12482 PrintExpression(exp->op.exp1, expString1);
12483 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12484 PrintExpression(exp->op.exp2, expString2);
12485 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12486 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12487 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12489 Compiler_Warning("incompatible expressions %s (%s) and %s (%s)\n", expString1, type1, expString2, type2);
12493 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12495 if(exp->op.exp1->destType)
12496 FreeType(exp->op.exp1->destType);
12497 exp->op.exp1->destType = type2->_class->registered->dataType;
12498 if(type2->_class->registered->dataType)
12499 type2->_class->registered->dataType->refCount++;
12500 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12501 exp->expType = type2;
12505 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12507 if(exp->op.exp2->destType)
12508 FreeType(exp->op.exp2->destType);
12509 exp->op.exp2->destType = type1->_class->registered->dataType;
12510 if(type1->_class->registered->dataType)
12511 type1->_class->registered->dataType->refCount++;
12512 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12513 exp->expType = type1;
12519 unsigned int valid = 0x0;
12521 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12523 if(exp->op.exp2->destType)
12524 FreeType(exp->op.exp2->destType);
12525 if(!type1->_class->registered->dataType)
12526 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12527 exp->op.exp2->destType = type1->_class->registered->dataType;
12528 exp->op.exp2->destType->refCount++;
12529 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12530 type2 = exp->op.exp2->destType;
12531 exp->expType = type2;
12534 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12536 if(exp->op.exp1->destType)
12537 FreeType(exp->op.exp1->destType);
12538 if(!type2->_class->registered->dataType)
12539 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12540 exp->op.exp1->destType = type2->_class->registered->dataType;
12541 exp->op.exp1->destType->refCount++;
12542 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12543 type1 = exp->op.exp1->destType;
12544 exp->expType = type1;
12547 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12549 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12551 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12553 exp->expType = exp->op.exp1->expType;
12554 if(exp->op.exp2->expType)
12555 exp->op.exp1->expType->refCount++;
12559 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12561 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12563 exp->expType = exp->op.exp2->expType;
12564 if(exp->op.exp2->expType)
12565 exp->op.exp2->expType->refCount++;
12572 if(exp->op.exp2->destType)
12573 FreeType(exp->op.exp2->destType);
12574 exp->op.exp2->destType = type1;
12576 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12578 exp->expType = exp->op.exp2->destType;
12579 if(exp->op.exp2->destType)
12580 exp->op.exp2->destType->refCount++;
12582 else if(type1 && type2)
12584 char expString1[10240];
12585 char expString2[10240];
12586 char type1String[1024];
12587 char type2String[1024];
12589 expString1[0] = '\0';
12590 expString2[0] = '\0';
12591 type1String[0] = '\0';
12592 type2String[0] = '\0';
12595 PrintExpression(exp->op.exp1, expString1);
12596 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12597 PrintExpression(exp->op.exp2, expString2);
12598 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12599 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12600 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12602 Compiler_Warning("incompatible expressions %s (%s) and %s (%s)\n", expString1, type1String, expString2, type2String);
12603 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12605 exp->expType = exp->op.exp1->expType;
12606 if(exp->op.exp1->expType)
12607 exp->op.exp1->expType->refCount++;
12609 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12611 exp->expType = exp->op.exp2->expType;
12612 if(exp->op.exp2->expType)
12613 exp->op.exp2->expType->refCount++;
12620 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12622 struct Type * oldType = exp->op.exp1->expType;
12624 exp->op.exp1->expType = (((void *)0));
12625 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12628 exp->op.exp1->expType = oldType;
12630 if(exp->op.exp1->destType)
12631 FreeType(exp->op.exp1->destType);
12632 exp->op.exp1->destType = type2;
12634 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12636 exp->expType = exp->op.exp1->destType;
12637 if(exp->op.exp1->destType)
12638 exp->op.exp1->destType->refCount++;
12642 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12644 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12646 if(exp->op.exp1->destType)
12647 FreeType(exp->op.exp1->destType);
12648 exp->op.exp1->destType = type2->_class->registered->dataType;
12649 if(type2->_class->registered->dataType)
12650 type2->_class->registered->dataType->refCount++;
12651 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12653 if(exp->op.op == '!')
12655 exp->expType = MkClassType("bool");
12656 exp->expType->truth = 0x1;
12660 exp->expType = type2;
12665 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
12667 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12669 if(exp->op.exp2->destType)
12670 FreeType(exp->op.exp2->destType);
12671 exp->op.exp2->destType = type1->_class->registered->dataType;
12672 if(type1->_class->registered->dataType)
12673 type1->_class->registered->dataType->refCount++;
12674 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12676 exp->expType = type1;
12682 if(exp->op.exp1 && !exp->op.exp1->expType)
12684 char expString[10000];
12686 expString[0] = '\0';
12689 PrintExpression(exp->op.exp1, expString);
12690 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12693 Compiler_Error("couldn't determine type of %s\n", expString);
12695 if(exp->op.exp2 && !exp->op.exp2->expType)
12697 char expString[10240];
12699 expString[0] = '\0';
12702 PrintExpression(exp->op.exp2, expString);
12703 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12706 Compiler_Error("couldn't determine type of %s\n", expString);
12710 FreeType(exp->expType);
12711 exp->expType = MkClassType("bool");
12712 exp->expType->truth = 0x1;
12714 if(exp->op.op != 261)
12715 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
12716 if(exp->op.op == 261 && exp->op.exp2->expType)
12718 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
12720 yylloc = oldyylloc;
12727 struct Expression * e;
12729 exp->isConstant = 0x1;
12730 for(e = (*exp->list).first; e; e = e->next)
12732 unsigned int inced = 0x0;
12736 FreeType(e->destType);
12737 e->destType = exp->destType;
12740 exp->destType->refCount++;
12741 e->destType->count++;
12745 ProcessExpressionType(e);
12747 exp->destType->count--;
12748 if(!exp->expType && !e->next)
12750 exp->expType = e->expType;
12752 e->expType->refCount++;
12755 exp->isConstant = 0x0;
12757 e = (*exp->list).first;
12758 if(!e->next && e->type == 8)
12760 struct Expression * next = exp->next, * prev = exp->prev;
12762 FreeType(exp->expType);
12763 FreeType(exp->destType);
12764 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
12768 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
12769 ProcessExpressionType(exp);
12775 struct Expression * e;
12777 exp->isConstant = 0x1;
12778 ProcessExpressionType(exp->index.exp);
12779 if(!exp->index.exp->isConstant)
12780 exp->isConstant = 0x0;
12781 if(exp->index.exp->expType)
12783 struct Type * source = exp->index.exp->expType;
12785 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)
12787 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
12789 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
12790 if(exp->index.index && (*exp->index.index).last)
12792 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
12796 for(e = (*exp->index.index).first; e; e = e->next)
12798 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
12801 FreeType(e->destType);
12802 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
12804 ProcessExpressionType(e);
12809 exp->isConstant = 0x0;
12812 exp->expType = Dereference(exp->index.exp->expType);
12814 DeclareType(exp->expType, 0x0, 0x0);
12819 struct Expression * e;
12820 struct Type * functionType;
12821 struct Type * methodType = (((void *)0));
12827 PrintExpression(exp->call.exp, name);
12828 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
12830 PrintExpression(exp->call.exp, name);
12833 if(exp->call.exp->type == 0)
12835 struct Expression * idExp = exp->call.exp;
12836 struct Identifier * id = idExp->identifier;
12838 if(!strcmp(id->string, "__ENDIAN_PAD"))
12840 exp->expType = ProcessTypeString("int", 0x1);
12841 if(exp->call.arguments && (*exp->call.arguments).first)
12842 ProcessExpressionType((*exp->call.arguments).first);
12845 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
12847 struct Expression * a = (((void *)0));
12848 struct Expression * b = (((void *)0));
12849 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
12851 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
12853 a = (*exp->call.arguments).first;
12854 b = (*exp->call.arguments).last;
12858 else if((*exp->call.arguments).count == 1)
12860 a = (*exp->call.arguments).first;
12865 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
12866 idExp->identifier = (((void *)0));
12867 FreeExpContents(exp);
12868 ProcessExpressionType(a);
12870 ProcessExpressionType(b);
12872 exp->list = MkList();
12873 if(a->expType && (!b || b->expType))
12875 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
12879 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12880 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
12881 struct Declaration * decl;
12882 char temp1[1024], temp2[1024];
12884 GetTypeSpecs(a->expType, specs);
12885 if(a && !a->isConstant && a->type != 0)
12887 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
12888 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
12889 tempExp1 = QMkExpId(temp1);
12890 tempExp1->expType = a->expType;
12892 a->expType->refCount++;
12893 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
12895 if(b && !b->isConstant && b->type != 0)
12897 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
12898 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
12899 tempExp2 = QMkExpId(temp2);
12900 tempExp2->expType = b->expType;
12902 b->expType->refCount++;
12903 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
12905 decl = MkDeclaration(specs, decls);
12906 if(!curCompound->compound.declarations)
12907 curCompound->compound.declarations = MkList();
12908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
12912 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
12914 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
12916 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
12917 exp->expType = a->expType;
12919 a->expType->refCount++;
12921 else if(!strcmp(id->string, "Abs"))
12923 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
12924 exp->expType = a->expType;
12926 a->expType->refCount++;
12928 else if(!strcmp(id->string, "Sgn"))
12930 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"))))));
12931 exp->expType = ProcessTypeString("int", 0x0);
12933 FreeExpression(tempExp1);
12935 FreeExpression(tempExp2);
12936 FreeIdentifier(id);
12942 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12944 if(!exp->call.exp->destType)
12946 exp->call.exp->destType = dummy;
12949 ProcessExpressionType(exp->call.exp);
12950 if(exp->call.exp->destType == dummy)
12953 exp->call.exp->destType = (((void *)0));
12957 functionType = exp->call.exp->expType;
12958 if(functionType && functionType->kind == 16)
12960 methodType = functionType;
12961 functionType = methodType->method->dataType;
12962 if(exp->call.exp->expType->usedClass)
12964 char typeString[1024];
12966 typeString[0] = '\0';
12967 PrintType(functionType, typeString, 0x1, 0x1);
12968 if(strstr(typeString, "thisclass"))
12970 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12971 struct Declarator * decl;
12974 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
12976 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12977 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
12978 thisClassParams = 0x0;
12979 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
12981 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
12983 thisClass = exp->call.exp->expType->usedClass;
12984 ProcessDeclarator(decl);
12985 thisClass = backupThisClass;
12987 thisClassParams = 0x1;
12988 functionType = ProcessType(specs, decl);
12989 functionType->refCount = 0;
12990 FinishTemplatesContext(context);
12992 FreeList(specs, FreeSpecifier);
12993 FreeDeclarator(decl);
12997 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
12999 struct Type * type = functionType->type;
13001 if(!functionType->refCount)
13003 functionType->type = (((void *)0));
13004 FreeType(functionType);
13006 functionType = type;
13008 if(functionType && functionType->kind != 11)
13010 Compiler_Error("called object %s is not a function\n", name);
13012 else if(functionType)
13014 unsigned int emptyParams = 0x0, noParams = 0x0;
13015 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13016 struct Type * type = functionType->params.first;
13017 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13019 struct Location oldyylloc = yylloc;
13023 if(functionType->extraParam && e)
13025 e->destType = MkClassType(functionType->thisClass->string);
13028 if(!functionType->staticMethod)
13030 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13032 type = MkClassType(memberExp->member.exp->expType->_class->string);
13035 e->destType = type;
13037 type = functionType->params.first;
13040 type->refCount = 0;
13042 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13044 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13047 e->destType = type;
13049 type = functionType->params.first;
13052 type->refCount = 0;
13055 if(type && type->kind == 0)
13058 if(!type->refCount)
13060 type = (((void *)0));
13062 for(; e; e = e->next)
13064 if(!type && !emptyParams)
13067 if(methodType && methodType->methodClass)
13068 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);
13070 Compiler_Error("too many arguments for function %s (%d given, expected %d)\n", name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13073 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13075 struct Type * templatedType = (((void *)0));
13076 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13077 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13080 if(_class && _class->templateArgs)
13082 struct __ecereNameSpace__ecere__com__Class * sClass;
13084 for(sClass = _class; sClass; sClass = sClass->base)
13086 if(sClass->templateClass)
13087 sClass = sClass->templateClass;
13089 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13091 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13093 struct __ecereNameSpace__ecere__com__Class * nextClass;
13095 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13097 if(nextClass->templateClass)
13098 nextClass = nextClass->templateClass;
13099 id += nextClass->templateParams.count;
13109 if(curParam && _class->templateArgs[id].dataTypeString)
13111 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13114 struct Context * context = SetupTemplatesContext(_class);
13116 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13117 FinishTemplatesContext(context);
13119 e->destType = templatedType;
13122 templatedType->passAsTemplate = 0x1;
13127 e->destType = type;
13134 e->destType = type;
13138 if(type && type->kind != 14)
13140 struct Type * next = type->next;
13142 if(!type->refCount)
13147 if(type && type->kind != 14)
13149 if(methodType && methodType->methodClass)
13150 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);
13152 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);
13154 yylloc = oldyylloc;
13155 if(type && !type->refCount)
13160 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13161 if(exp->call.exp->type == 0)
13163 char * string = exp->call.exp->identifier->string;
13167 struct Symbol * symbol;
13168 struct Location oldyylloc = yylloc;
13170 yylloc = exp->call.exp->identifier->loc;
13171 if(strstr(string, "__builtin_") == string)
13174 Compiler_Warning("%s undefined; assuming extern returning int\n", string);
13175 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));
13176 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13177 yylloc = oldyylloc;
13180 else if(exp->call.exp->type == 8)
13184 Compiler_Warning("callable object undefined; extern assuming returning int\n");
13185 if(!functionType->returnType)
13187 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13190 if(functionType && functionType->kind == 11)
13192 exp->expType = functionType->returnType;
13193 if(functionType->returnType)
13194 functionType->returnType->refCount++;
13195 if(!functionType->refCount)
13196 FreeType(functionType);
13198 if(exp->call.arguments)
13200 for(e = (*exp->call.arguments).first; e; e = e->next)
13202 struct Type * destType = e->destType;
13204 ProcessExpressionType(e);
13211 struct Type * type;
13212 struct Location oldyylloc = yylloc;
13213 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13215 exp->thisPtr = thisPtr;
13216 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13218 exp->member.member->classSym = exp->member.member->_class->symbol;
13220 ProcessExpressionType(exp->member.exp);
13221 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)
13223 exp->isConstant = 0x0;
13226 exp->isConstant = exp->member.exp->isConstant;
13227 type = exp->member.exp->expType;
13229 if(type && (type->kind == 20))
13231 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13232 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13236 for(param = _class->templateParams.first; param; param = param->next)
13238 if(param->type == 1 && !strcmp(param->name, exp->member.member->string))
13242 if(param && param->defaultArg.member)
13244 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13248 struct Expression * expMember = exp->member.exp;
13249 struct Declarator * decl;
13250 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13251 char thisClassTypeString[1024];
13253 FreeIdentifier(exp->member.member);
13254 ProcessExpressionType(argExp);
13256 char * colon = strstr(param->defaultArg.memberString, "::");
13260 char className[1024];
13261 struct __ecereNameSpace__ecere__com__Class * sClass;
13263 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13264 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13267 strcpy(thisClassTypeString, _class->fullName);
13269 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13270 exp->expType = ProcessType(specs, decl);
13271 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13273 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13274 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13276 int paramCount = 0;
13277 int lastParam = -1;
13278 char templateString[1024];
13279 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13281 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13282 for(cClass = expClass; cClass; cClass = cClass->base)
13286 for(param = cClass->templateParams.first; param; param = param->next)
13289 struct __ecereNameSpace__ecere__com__Class * sClass;
13290 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13292 for(sClass = cClass->base; sClass; sClass = sClass->base)
13293 id += sClass->templateParams.count;
13294 arg = expClass->templateArgs[id];
13295 for(sClass = _class; sClass; sClass = sClass->base)
13297 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13299 struct __ecereNameSpace__ecere__com__Class * nextClass;
13301 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13302 p += nextClass->templateParams.count;
13303 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13305 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13307 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13309 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13310 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13317 char argument[256];
13319 argument[0] = '\0';
13320 switch(param->type)
13324 char expString[1024];
13325 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13326 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13327 struct Expression * exp;
13328 char * string = PrintHexUInt64(arg.expression.ui64);
13330 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13331 ProcessExpressionType(exp);
13332 ComputeExpression(exp);
13333 expString[0] = '\0';
13334 PrintExpression(exp, expString);
13335 strcat(argument, expString);
13336 FreeExpression(exp);
13341 strcat(argument, arg.member->name);
13346 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13348 if(!strcmp(arg.dataTypeString, "thisclass"))
13349 strcat(argument, thisClassTypeString);
13351 strcat(argument, arg.dataTypeString);
13359 strcat(templateString, ", ");
13360 if(lastParam != p - 1)
13362 strcat(templateString, param->name);
13363 strcat(templateString, " = ");
13365 strcat(templateString, argument);
13374 int len = strlen(templateString);
13376 if(templateString[len - 1] == '>')
13377 templateString[len++] = ' ';
13378 templateString[len++] = '>';
13379 templateString[len++] = '\0';
13382 struct Context * context = SetupTemplatesContext(_class);
13384 FreeType(exp->expType);
13385 exp->expType = ProcessTypeString(templateString, 0x0);
13386 FinishTemplatesContext(context);
13390 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")))))))));
13393 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13395 type = ProcessTemplateParameterType(type->templateParameter);
13398 if(type && (type->kind == 20))
13400 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13402 struct Identifier * id = exp->member.member;
13403 int typeKind = type->kind;
13404 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));
13406 if(typeKind == 19 && exp->member.exp->type == 26)
13408 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13411 if(id && (typeKind == 3 || typeKind == 15))
13412 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13415 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13416 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13417 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13418 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13419 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13421 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13422 exp->member.memberType = 1;
13423 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13424 Compiler_Error("invalid class specifier %s for object of class %s\n", _class->fullName, type->_class->string);
13427 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13429 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13430 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13432 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13434 member = (((void *)0));
13436 if(!member && !prop)
13437 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13438 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13439 exp->member.thisPtr = 0x1;
13445 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13446 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13447 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13449 if(!prop && !member)
13451 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13454 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13455 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13456 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13461 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13462 prop = (((void *)0));
13464 member = (((void *)0));
13468 if(!prop && !member)
13469 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13470 if(!prop && !member && !method)
13474 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13477 exp->member.memberType = 5;
13478 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13482 char structName[1024];
13483 struct Identifier * id = exp->member.member;
13484 struct Expression * classExp = exp->member.exp;
13487 FreeType(classExp->expType);
13488 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13489 strcpy(structName, "__ecereClassData_");
13490 FullClassNameCat(structName, type->_class->string, 0x0);
13492 exp->member.member = id;
13493 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"))))))));
13495 ProcessExpressionType(exp);
13501 struct Symbol * classSym = FindClass(id->string);
13505 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13508 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13514 exp->member.memberType = 1;
13515 if(!prop->dataType)
13516 ProcessPropertyType(prop);
13517 exp->expType = prop->dataType;
13519 prop->dataType->refCount++;
13523 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13525 FreeExpContents(exp);
13527 exp->identifier = MkIdentifier("class");
13528 ProcessExpressionType(exp);
13531 exp->member.memberType = 3;
13532 DeclareStruct(_class->fullName, 0x0);
13533 if(!member->dataType)
13535 struct Context * context = SetupTemplatesContext(_class);
13537 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13538 FinishTemplatesContext(context);
13540 exp->expType = member->dataType;
13541 if(member->dataType)
13542 member->dataType->refCount++;
13544 else if(revConvert)
13546 exp->member.memberType = 4;
13547 exp->expType = MkClassType(revConvert->_class->fullName);
13553 exp->member.memberType = 2;
13555 if(!method->dataType)
13556 ProcessMethodType(method);
13557 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));
13558 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13559 exp->expType->usedClass = _class;
13561 else if(!classProp)
13563 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13565 FreeExpContents(exp);
13567 exp->identifier = MkIdentifier("class");
13568 ProcessExpressionType(exp);
13571 yylloc = exp->member.member->loc;
13572 Compiler_Error("couldn't find member %s in class %s\n", id->string, _class->fullName);
13574 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13576 if(_class && exp->expType)
13578 struct __ecereNameSpace__ecere__com__Class * tClass;
13581 while(tClass && !tClass->templateClass)
13582 tClass = tClass->base;
13583 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13586 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13587 struct __ecereNameSpace__ecere__com__Class * sClass;
13589 for(sClass = tClass; sClass; sClass = sClass->base)
13592 if(sClass->templateClass)
13593 sClass = sClass->templateClass;
13594 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13596 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13598 for(sClass = sClass->base; sClass; sClass = sClass->base)
13599 id += sClass->templateParams.count;
13607 if(curParam && tClass->templateArgs[id].dataTypeString)
13609 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13610 struct Context * context = SetupTemplatesContext(tClass);
13612 FreeType(exp->expType);
13613 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13616 if(exp->expType->kind == 21)
13618 FreeType(exp->expType);
13619 exp->expType = ReplaceThisClassType(_class);
13621 if(tClass->templateClass)
13622 exp->expType->passAsTemplate = 0x1;
13625 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13626 if(exp->destType->kind == 21)
13628 FreeType(exp->destType);
13629 exp->destType = ReplaceThisClassType(_class);
13633 FinishTemplatesContext(context);
13636 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13639 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam;
13640 struct __ecereNameSpace__ecere__com__Class * sClass;
13642 for(sClass = tClass; sClass; sClass = sClass->base)
13645 if(sClass->templateClass)
13646 sClass = sClass->templateClass;
13647 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13649 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
13651 for(sClass = sClass->base; sClass; sClass = sClass->base)
13652 id += sClass->templateParams.count;
13662 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13663 struct Context * context = SetupTemplatesContext(tClass);
13664 struct Type * basicType;
13666 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
13669 if(basicType->kind == 21)
13671 FreeType(basicType);
13672 basicType = ReplaceThisClassType(_class);
13674 FreeType(exp->expType);
13675 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));
13678 exp->destType = exp->expType;
13679 exp->destType->refCount++;
13682 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13683 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13684 struct Declarator * decl;
13686 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
13689 exp->destType->refCount++;
13691 exp->expType->refCount++;
13693 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
13694 exp->cast.exp = newExp;
13697 FinishTemplatesContext(context);
13700 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
13702 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13706 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13709 int paramCount = 0;
13710 int lastParam = -1;
13711 char templateString[1024];
13712 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13714 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13715 while(cClass != expClass)
13717 struct __ecereNameSpace__ecere__com__Class * sClass;
13719 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
13722 for(param = cClass->templateParams.first; param; param = param->next)
13724 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
13727 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
13728 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13730 while(cClassCur != tClass && !paramCur)
13732 struct __ecereNameSpace__ecere__com__Class * sClassCur;
13734 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
13736 cClassCur = sClassCur;
13737 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
13739 if(!strcmp(paramCur->name, param->name))
13746 if(paramCur && paramCur->type == 0)
13747 arg = tClass->templateArgs[cp];
13749 arg = expClass->templateArgs[p];
13751 char argument[256];
13753 argument[0] = '\0';
13754 switch(param->type)
13758 char expString[1024];
13759 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13760 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13761 struct Expression * exp;
13762 char * string = PrintHexUInt64(arg.expression.ui64);
13764 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13765 ProcessExpressionType(exp);
13766 ComputeExpression(exp);
13767 expString[0] = '\0';
13768 PrintExpression(exp, expString);
13769 strcat(argument, expString);
13770 FreeExpression(exp);
13775 strcat(argument, arg.member->name);
13780 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13781 strcat(argument, arg.dataTypeString);
13788 strcat(templateString, ", ");
13789 if(lastParam != p - 1)
13791 strcat(templateString, param->name);
13792 strcat(templateString, " = ");
13794 strcat(templateString, argument);
13803 int len = strlen(templateString);
13805 if(templateString[len - 1] == '>')
13806 templateString[len++] = ' ';
13807 templateString[len++] = '>';
13808 templateString[len++] = '\0';
13810 FreeType(exp->expType);
13812 struct Context * context = SetupTemplatesContext(tClass);
13814 exp->expType = ProcessTypeString(templateString, 0x0);
13815 FinishTemplatesContext(context);
13822 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)");
13824 else if(type && (type->kind == 9 || type->kind == 10))
13826 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
13830 exp->expType = memberType;
13832 memberType->refCount++;
13837 char expString[10240];
13839 expString[0] = '\0';
13842 PrintExpression(exp, expString);
13843 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13845 Compiler_Error("member operator on non-structure type expression %s\n", expString);
13847 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
13849 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13851 struct Identifier * id = exp->member.member;
13852 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));
13856 FreeType(exp->expType);
13857 exp->expType = ReplaceThisClassType(_class);
13861 yylloc = oldyylloc;
13866 struct Type * destType = exp->destType;
13868 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13870 exp->member.member->classSym = exp->member.member->_class->symbol;
13872 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
13876 ProcessExpressionType(exp);
13883 struct Symbol * classSym = exp->_class->symbol;
13885 if(classSym && classSym->registered)
13887 if(classSym->registered->type == 5)
13892 DeclareStruct(classSym->string, 0x0);
13893 FreeSpecifier(exp->_class);
13895 FullClassNameCat(name, classSym->string, 0x0);
13896 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
13900 if(classSym->registered->fixed)
13902 FreeSpecifier(exp->_class);
13903 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
13908 char className[1024];
13910 strcpy(className, "__ecereClass_");
13911 FullClassNameCat(className, classSym->string, 0x1);
13912 MangleClassName(className);
13913 DeclareClass(classSym, className);
13914 FreeExpContents(exp);
13916 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
13917 exp->member.member = MkIdentifier("structSize");
13921 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13926 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
13928 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13929 exp->isConstant = 0x1;
13930 DeclareType(type, 0x0, 0x0);
13936 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
13938 type->count = (unsigned int)1;
13939 FreeType(exp->cast.exp->destType);
13940 exp->cast.exp->destType = type;
13942 ProcessExpressionType(exp->cast.exp);
13943 type->count = (unsigned int)0;
13944 exp->expType = type;
13945 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
13947 void * prev = exp->prev, * next = exp->next;
13948 struct Type * expType = exp->cast.exp->destType;
13949 struct Expression * castExp = exp->cast.exp;
13950 struct Type * destType = exp->destType;
13953 expType->refCount++;
13954 FreeType(exp->expType);
13955 FreeTypeName(exp->cast.typeName);
13957 FreeType(exp->expType);
13958 FreeType(exp->destType);
13959 exp->expType = expType;
13960 exp->destType = destType;
13961 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
13967 exp->isConstant = exp->cast.exp->isConstant;
13973 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
13976 exp->expType = type;
13981 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
13983 ProcessExpressionType(exp->vaArg.exp);
13985 exp->expType = type;
13990 struct Expression * e;
13992 exp->isConstant = 0x1;
13993 FreeType(exp->cond.cond->destType);
13994 exp->cond.cond->destType = MkClassType("bool");
13995 exp->cond.cond->destType->truth = 0x1;
13996 ProcessExpressionType(exp->cond.cond);
13997 if(!exp->cond.cond->isConstant)
13998 exp->isConstant = 0x0;
13999 for(e = (*exp->cond.exp).first; e; e = e->next)
14003 FreeType(e->destType);
14004 e->destType = exp->destType;
14006 e->destType->refCount++;
14008 ProcessExpressionType(e);
14011 exp->expType = e->expType;
14013 e->expType->refCount++;
14016 exp->isConstant = 0x0;
14018 FreeType(exp->cond.elseExp->destType);
14019 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14020 if(exp->cond.elseExp->destType)
14021 exp->cond.elseExp->destType->refCount++;
14022 ProcessExpressionType(exp->cond.elseExp);
14023 if(!exp->cond.elseExp->isConstant)
14024 exp->isConstant = 0x0;
14029 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14031 struct Statement * last = (*exp->compound->compound.statements).last;
14033 if(last->type == 3 && last->expressions && (*last->expressions).last)
14035 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14037 exp->destType->refCount++;
14039 ProcessStatement(exp->compound);
14040 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14041 if(((struct Expression *)(*last->expressions).last)->expType)
14042 exp->expType->refCount++;
14048 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14050 if(spec && spec->type == 1)
14052 exp->expType = MkClassType(spec->name);
14053 exp->expType->kind = 19;
14054 exp->byReference = 0x1;
14058 exp->expType = MkClassType("ecere::com::Class");
14059 exp->byReference = 0x1;
14065 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14069 struct Identifier * id = exp->classData.id;
14070 char structName[1024];
14071 struct Expression * classExp;
14073 strcpy(structName, "__ecereClassData_");
14074 FullClassNameCat(structName, _class->fullName, 0x0);
14076 exp->member.member = id;
14077 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14078 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14080 classExp = MkExpIdentifier(MkIdentifier("class"));
14081 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"))))))));
14082 ProcessExpressionType(exp);
14089 struct Type * type = (((void *)0));
14090 char * typeString = (((void *)0));
14091 char typeStringBuf[1024];
14093 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))
14095 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14097 typeString = templateClass->templateArgs[2].dataTypeString;
14101 struct Expression * e;
14103 for(e = (*exp->list).first; e; e = e->next)
14105 ProcessExpressionType(e);
14115 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14119 e->expType = (((void *)0));
14120 e = (*exp->list).first;
14121 ProcessExpressionType(e);
14124 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14126 FreeType(e->expType);
14127 e->expType = (((void *)0));
14129 type = (((void *)0));
14137 FreeType(e->expType);
14138 e->expType = (((void *)0));
14144 typeStringBuf[0] = '\0';
14145 PrintType(type, typeStringBuf, 0x0, 0x1);
14146 typeString = typeStringBuf;
14148 type = (((void *)0));
14153 char templateString[1024];
14154 struct __ecereNameSpace__ecere__sys__OldList * declarations = MkList();
14155 struct __ecereNameSpace__ecere__sys__OldList * instMembers = MkList();
14156 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14157 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14159 struct Expression * e;
14160 struct Expression * expExt;
14161 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14162 struct Context * context = PushContext();
14164 sprintf(templateString, "Container<%s>", typeString);
14165 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("data")), MkInitializerAssignment(MkExpIdentifier(MkIdentifier("__internalList")))));
14166 sprintf(count, "%d", (*exp->list).count);
14167 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("count")), MkInitializerAssignment(MkExpConstant(count))));
14168 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("type")), MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl)))));
14169 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_vTbl")), MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl")))));
14170 ListAdd(instMembers, MkMemberInit(MkListOne(MkIdentifier("_class")), MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))))));
14173 type = ProcessTypeString(typeString, 0x0);
14174 while(e = (*exp->list).first)
14176 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14177 e->destType = type;
14179 ProcessExpressionType(e);
14180 ListAdd(initializers, MkInitializerAssignment(e));
14183 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14185 ListAdd(declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalList"))), (((void *)0))), MkInitializerList(initializers)))));
14186 ListAdd(declarations, MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName("BuiltInContainer")), MkExpIdentifier(MkIdentifier("__internalContainer")), MkListOne(MkMembersInitList(instMembers)))));
14187 exp->expType = ProcessTypeString(templateString, 0x0);
14189 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), (expExt = MkExpExtensionCompound(MkCompoundStmt(declarations, MkListOne(MkExpressionStmt(MkListOne(MkExpOp((((void *)0)), '&', MkExpIdentifier(MkIdentifier("__internalContainer")))))))))));
14190 expExt->compound->compound.context = context;
14191 PopContext(context);
14192 ProcessExpressionType(expExt);
14196 exp->expType = ProcessTypeString("Container", 0x0);
14197 Compiler_Error("Couldn't determine type of array elements\n");
14202 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14204 FreeType(exp->expType);
14205 exp->expType = ReplaceThisClassType(thisClass);
14207 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14209 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14213 if(exp->expType->kind != 15)
14215 struct Type * member;
14217 exp->expType->members = symbol->type->members;
14218 for(member = symbol->type->members.first; member; member = member->next)
14219 member->refCount++;
14223 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14225 for(member = symbol->type->members.first; member; member = member->next)
14227 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14235 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14237 else if(exp->destType && !exp->destType->keepCast)
14239 if(!CheckExpressionType(exp, exp->destType, 0x0))
14241 if(!exp->destType->count || unresolved)
14246 if(exp->destType->kind != 14)
14253 char expString[10240];
14255 expString[0] = '\0';
14256 PrintType(exp->destType, type2, 0x0, 0x1);
14259 PrintExpression(exp, expString);
14260 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14263 Compiler_Error("unresolved identifier %s; expected %s\n", expString, type2);
14264 else if(exp->type != 16)
14265 Compiler_Error("couldn't determine type of %s; expected %s\n", expString, type2);
14270 char expString[10240];
14272 expString[0] = '\0';
14275 PrintExpression(exp, expString);
14276 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14279 Compiler_Error("unresolved identifier %s\n", expString);
14280 else if(exp->type != 16)
14281 Compiler_Error("couldn't determine type of %s\n", expString);
14293 PrintType(exp->expType, type1, 0x0, 0x1);
14294 PrintType(exp->destType, type2, 0x0, 0x1);
14296 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)))
14300 char expString[10240];
14302 expString[0] = '\0';
14305 PrintExpression(exp, expString);
14306 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14308 Compiler_Warning("incompatible expression %s (%s); expected %s\n", expString, type1, type2);
14309 FreeType(exp->expType);
14310 exp->destType->refCount++;
14311 exp->expType = exp->destType;
14316 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14318 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14319 char typeString[1024];
14320 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14321 struct Declarator * decl;
14323 typeString[0] = '\0';
14326 exp->expType->refCount++;
14328 exp->expType->refCount++;
14330 newExp->destType = exp->expType;
14331 PrintType(exp->expType, typeString, 0x0, 0x0);
14332 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14333 exp->cast.typeName = MkTypeName(specs, decl);
14334 exp->cast.exp = newExp;
14337 else if(unresolved)
14339 if(exp->identifier->_class && exp->identifier->_class->name)
14340 Compiler_Error("unresolved identifier %s::%s\n", exp->identifier->_class->name, exp->identifier->string);
14341 else if(exp->identifier->string && exp->identifier->string[0])
14342 Compiler_Error("unresolved identifier %s\n", exp->identifier->string);
14344 else if(!exp->expType && exp->type != 16)
14346 char expString[10240];
14348 expString[0] = '\0';
14351 PrintExpression(exp, expString);
14352 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14354 Compiler_Error("couldn't determine type of %s\n", expString);
14356 ApplyAnyObjectLogic(exp);
14357 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14359 exp->byReference = 0x1;
14361 yylloc = oldyylloc;
14364 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)
14368 *curMember = (*curMember)->next;
14369 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14371 *curMember = subMemberStack[--(*subMemberStackPos)];
14372 *curMember = (*curMember)->next;
14374 while((*curMember) && (*curMember)->isProperty)
14375 *curMember = (*curMember)->next;
14376 if(subMemberStackPos)
14378 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14380 subMemberStack[(*subMemberStackPos)++] = *curMember;
14381 *curMember = (*curMember)->members.first;
14382 while(*curMember && (*curMember)->isProperty)
14383 *curMember = (*curMember)->next;
14391 if(subMemberStackPos && *subMemberStackPos)
14393 *curMember = subMemberStack[--(*subMemberStackPos)];
14394 *curMember = (*curMember)->next;
14398 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14400 if(*curClass == _class)
14402 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14404 *curMember = (*curClass)->membersAndProperties.first;
14406 while((*curMember) && (*curMember)->isProperty)
14407 *curMember = (*curMember)->next;
14408 if(subMemberStackPos)
14410 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14412 subMemberStack[(*subMemberStackPos)++] = *curMember;
14413 *curMember = (*curMember)->members.first;
14414 while(*curMember && (*curMember)->isProperty)
14415 *curMember = (*curMember)->next;
14422 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14427 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14429 if(init->exp && !init->exp->destType)
14431 FreeType(init->exp->destType);
14432 init->exp->destType = type;
14438 ProcessExpressionType(init->exp);
14439 init->isConstant = init->exp->isConstant;
14445 struct Expression * exp = init->exp;
14446 struct Instantiation * inst = exp->instance;
14447 struct MembersInit * members;
14450 init->list = MkList();
14453 for(members = (*inst->members).first; members; members = members->next)
14455 if(members->type == 0)
14457 struct MemberInit * member;
14459 for(member = (*members->dataMembers).first; member; member = member->next)
14461 ListAdd(init->list, member->initializer);
14462 member->initializer = (((void *)0));
14467 FreeExpression(exp);
14471 struct Initializer * i;
14472 struct Type * initializerType = (((void *)0));
14473 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14474 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14475 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14476 int subMemberStackPos = 0;
14478 if(type && type->kind == 12)
14479 initializerType = Dereference(type);
14480 else if(type && (type->kind == 9 || type->kind == 10))
14481 initializerType = type->members.first;
14482 for(i = (*init->list).first; i; i = i->next)
14484 if(type && type->kind == 8 && type->_class && type->_class->registered)
14486 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14489 if(!curMember->dataType)
14490 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14491 initializerType = curMember->dataType;
14494 ProcessInitializer(i, initializerType);
14495 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14496 initializerType = initializerType->next;
14498 init->isConstant = 0x0;
14500 if(type && type->kind == 12)
14501 FreeType(initializerType);
14502 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14504 Compiler_Error("Assigning list initializer to non list\n");
14511 extern struct Symbol * FindType(struct Context * ctx, char * name);
14513 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14515 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14521 if(spec->specifier == 321)
14526 spec->name = ReplaceThisClass(thisClass);
14527 spec->symbol = FindClass(spec->name);
14528 ProcessSpecifier(spec, declareStruct);
14535 struct Symbol * symbol = FindType(curContext, spec->name);
14538 DeclareType(symbol->type, 0x1, 0x1);
14539 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14540 DeclareStruct(spec->name, 0x0);
14545 struct Enumerator * e;
14549 for(e = (*spec->list).first; e; e = e->next)
14552 ProcessExpressionType(e->exp);
14560 if(spec->definitions)
14562 struct ClassDef * def;
14563 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14565 ProcessClass(spec->definitions, symbol);
14572 static void ProcessDeclarator(struct Declarator * decl)
14577 if(decl->identifier->classSym)
14579 FreeSpecifier(decl->identifier->_class);
14580 decl->identifier->_class = (((void *)0));
14584 if(decl->array.exp)
14585 ProcessExpressionType(decl->array.exp);
14592 if(decl->declarator)
14593 ProcessDeclarator(decl->declarator);
14594 if(decl->type == 4)
14596 struct Identifier * id = GetDeclId(decl);
14598 if(id && id->_class)
14600 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14602 if(!decl->function.parameters)
14603 decl->function.parameters = MkList();
14604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14605 id->_class = (((void *)0));
14607 if(decl->function.parameters)
14609 struct TypeName * param;
14611 for(param = (*decl->function.parameters).first; param; param = param->next)
14613 if(param->qualifiers && (*param->qualifiers).first)
14615 struct Specifier * spec = (*param->qualifiers).first;
14617 if(spec && spec->specifier == 337)
14619 struct Declarator * d = param->declarator;
14620 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);
14622 FreeList(param->qualifiers, FreeSpecifier);
14623 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14624 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14628 else if(spec && spec->specifier == 338)
14630 struct Declarator * d = param->declarator;
14632 FreeList(param->qualifiers, FreeSpecifier);
14633 param->qualifiers = MkListOne(MkSpecifier(301));
14634 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14636 else if(spec->specifier == 321)
14641 spec->name = ReplaceThisClass(thisClass);
14642 spec->symbol = FindClass(spec->name);
14643 ProcessSpecifier(spec, 0x0);
14647 if(param->declarator)
14648 ProcessDeclarator(param->declarator);
14656 extern struct Identifier * CopyIdentifier(struct Identifier * id);
14658 extern void FreeInitDeclarator(struct InitDeclarator * decl);
14660 static void ProcessDeclaration(struct Declaration * decl)
14662 yylloc = decl->loc;
14667 unsigned int declareStruct = 0x0;
14669 if(decl->declarators)
14671 struct InitDeclarator * d;
14673 for(d = (*decl->declarators).first; d; d = d->next)
14675 struct Type * type, * subType;
14677 ProcessDeclarator(d->declarator);
14678 type = ProcessType(decl->specifiers, d->declarator);
14681 ProcessInitializer(d->initializer, type);
14682 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
14684 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
14686 struct Instantiation * inst = d->initializer->exp->instance;
14688 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
14689 d->initializer->exp->instance = (((void *)0));
14690 if(decl->specifiers)
14691 FreeList(decl->specifiers, FreeSpecifier);
14692 FreeList(decl->declarators, FreeInitDeclarator);
14699 for(subType = type; subType; )
14701 if(subType->kind == 8)
14703 declareStruct = 0x1;
14706 else if(subType->kind == 13)
14708 else if(subType->kind == 12)
14709 subType = subType->arrayType;
14718 if(decl->specifiers)
14720 struct Specifier * s;
14722 for(s = (*decl->specifiers).first; s; s = s->next)
14724 ProcessSpecifier(s, declareStruct);
14731 ProcessInstantiationType(decl->inst);
14736 struct Specifier * spec;
14737 struct Declarator * d;
14738 unsigned int declareStruct = 0x0;
14740 if(decl->declarators)
14742 for(d = (*decl->declarators).first; d; d = d->next)
14744 struct Type * type = ProcessType(decl->specifiers, d->declarator);
14745 struct Type * subType;
14747 ProcessDeclarator(d);
14748 for(subType = type; subType; )
14750 if(subType->kind == 8)
14752 declareStruct = 0x1;
14755 else if(subType->kind == 13)
14757 else if(subType->kind == 12)
14758 subType = subType->arrayType;
14765 if(decl->specifiers)
14767 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
14768 ProcessSpecifier(spec, declareStruct);
14775 static struct FunctionDefinition * curFunction;
14777 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
14779 char propName[1024], propNameM[1024];
14780 char getName[1024], setName[1024];
14781 struct __ecereNameSpace__ecere__sys__OldList * args;
14783 DeclareProperty(prop, setName, getName);
14784 strcpy(propName, "__ecereProp_");
14785 FullClassNameCat(propName, prop->_class->fullName, 0x0);
14786 strcat(propName, "_");
14787 FullClassNameCat(propName, prop->name, 0x1);
14788 MangleClassName(propName);
14789 strcpy(propNameM, "__ecerePropM_");
14790 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
14791 strcat(propNameM, "_");
14792 FullClassNameCat(propNameM, prop->name, 0x1);
14793 MangleClassName(propNameM);
14794 if(prop->isWatchable)
14797 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14798 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14799 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14801 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14802 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14803 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
14807 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14808 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
14809 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14811 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
14812 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
14813 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
14815 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
14816 curFunction->propSet->fireWatchersDone = 0x1;
14819 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
14821 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
14823 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
14825 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
14827 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
14829 extern void FreePropertyWatch(struct PropertyWatch * watcher);
14831 static void ProcessStatement(struct Statement * stmt)
14833 yylloc = stmt->loc;
14837 ProcessStatement(stmt->labeled.stmt);
14840 if(stmt->caseStmt.exp)
14842 FreeType(stmt->caseStmt.exp->destType);
14843 stmt->caseStmt.exp->destType = curSwitchType;
14845 curSwitchType->refCount++;
14846 ProcessExpressionType(stmt->caseStmt.exp);
14847 ComputeExpression(stmt->caseStmt.exp);
14849 if(stmt->caseStmt.stmt)
14850 ProcessStatement(stmt->caseStmt.stmt);
14854 if(stmt->compound.context)
14856 struct Declaration * decl;
14857 struct Statement * s;
14858 struct Statement * prevCompound = curCompound;
14859 struct Context * prevContext = curContext;
14861 if(!stmt->compound.isSwitch)
14863 curCompound = stmt;
14864 curContext = stmt->compound.context;
14866 if(stmt->compound.declarations)
14868 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
14869 ProcessDeclaration(decl);
14871 if(stmt->compound.statements)
14873 for(s = (*stmt->compound.statements).first; s; s = s->next)
14874 ProcessStatement(s);
14876 curContext = prevContext;
14877 curCompound = prevCompound;
14883 struct Expression * exp;
14885 if(stmt->expressions)
14887 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
14888 ProcessExpressionType(exp);
14894 struct Expression * exp;
14896 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
14897 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
14898 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
14899 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
14901 ProcessExpressionType(exp);
14903 if(stmt->ifStmt.stmt)
14904 ProcessStatement(stmt->ifStmt.stmt);
14905 if(stmt->ifStmt.elseStmt)
14906 ProcessStatement(stmt->ifStmt.elseStmt);
14911 struct Type * oldSwitchType = curSwitchType;
14913 if(stmt->switchStmt.exp)
14915 struct Expression * exp;
14917 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
14921 ProcessExpressionType(exp);
14924 curSwitchType = exp->expType;
14927 ProcessStatement(stmt->switchStmt.stmt);
14928 curSwitchType = oldSwitchType;
14933 if(stmt->whileStmt.exp)
14935 struct Expression * exp;
14937 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
14938 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
14939 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
14940 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
14942 ProcessExpressionType(exp);
14945 if(stmt->whileStmt.stmt)
14946 ProcessStatement(stmt->whileStmt.stmt);
14951 if(stmt->doWhile.exp)
14953 struct Expression * exp;
14955 if((*stmt->doWhile.exp).last)
14957 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
14958 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
14959 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
14961 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
14963 ProcessExpressionType(exp);
14966 if(stmt->doWhile.stmt)
14967 ProcessStatement(stmt->doWhile.stmt);
14972 struct Expression * exp;
14974 if(stmt->forStmt.init)
14975 ProcessStatement(stmt->forStmt.init);
14976 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
14978 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
14979 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
14980 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
14982 if(stmt->forStmt.check)
14983 ProcessStatement(stmt->forStmt.check);
14984 if(stmt->forStmt.increment)
14986 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
14987 ProcessExpressionType(exp);
14989 if(stmt->forStmt.stmt)
14990 ProcessStatement(stmt->forStmt.stmt);
14995 struct Identifier * id = stmt->forEachStmt.id;
14996 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
14997 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
14998 struct Statement * block = stmt->forEachStmt.stmt;
14999 char iteratorType[1024];
15000 struct Type * source;
15001 struct Expression * e;
15002 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));
15003 struct Expression * arrayExp;
15004 char * typeString = (((void *)0));
15005 int builtinCount = 0;
15007 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15011 FreeType(e->destType);
15012 e->destType = ProcessTypeString("Container", 0x0);
15014 if(!isBuiltin || e->next)
15015 ProcessExpressionType(e);
15017 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15018 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15020 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15021 struct Symbol * symbol;
15022 struct Expression * expIt = (((void *)0));
15023 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15024 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15025 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15026 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15029 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15030 stmt->compound.context->parent = curContext;
15031 curContext = stmt->compound.context;
15032 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15034 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15035 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15037 isCustomAVLTree = 0x1;
15038 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15040 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15043 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15045 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15047 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15050 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15054 struct Declarator * decl;
15055 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15057 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15058 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15059 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15063 struct Type * type = (((void *)0));
15064 char typeStringBuf[1024];
15066 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15067 if(((struct Expression *)(*exp).last)->type == 11)
15069 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15072 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15074 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)
15076 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15078 typeString = templateClass->templateArgs[2].dataTypeString;
15080 else if(arrayExp->list)
15082 struct Expression * e;
15084 for(e = (*arrayExp->list).first; e; e = e->next)
15086 ProcessExpressionType(e);
15096 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15100 e->expType = (((void *)0));
15101 e = (*arrayExp->list).first;
15102 ProcessExpressionType(e);
15105 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15107 FreeType(e->expType);
15108 e->expType = (((void *)0));
15110 type = (((void *)0));
15118 FreeType(e->expType);
15119 e->expType = (((void *)0));
15125 typeStringBuf[0] = '\0';
15126 PrintType(type, typeStringBuf, 0x0, 0x1);
15127 typeString = typeStringBuf;
15133 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15134 struct Declarator * decl;
15135 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15139 struct Expression * e;
15141 builtinCount = (*arrayExp->list).count;
15142 type = ProcessTypeString(typeString, 0x0);
15143 while(e = (*arrayExp->list).first)
15145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15146 e->destType = type;
15148 ProcessExpressionType(e);
15149 ListAdd(initializers, MkInitializerAssignment(e));
15152 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15154 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15155 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15156 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15157 FreeList(exp, FreeExpression);
15161 arrayExp->expType = ProcessTypeString("Container", 0x0);
15162 Compiler_Error("Couldn't determine type of array elements\n");
15165 else if(isLinkList && !isList)
15167 struct Declarator * decl;
15168 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15170 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15171 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15172 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15174 else if(_class->templateArgs)
15177 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15179 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15180 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15182 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15183 if(block && block->type == 2 && block->compound.context)
15185 block->compound.context->parent = stmt->compound.context;
15189 block = MkIfStmt(filter, block, (((void *)0)));
15193 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));
15194 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15195 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15196 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15202 sprintf(count, "%d", builtinCount);
15203 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));
15204 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15205 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15206 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15208 else if(isLinkList && !isList)
15210 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15211 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15213 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15215 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));
15219 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15220 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15222 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));
15224 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15225 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15226 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15230 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15232 ProcessExpressionType(expIt);
15233 if((*stmt->compound.declarations).first)
15234 ProcessDeclaration((*stmt->compound.declarations).first);
15236 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15237 ProcessStatement(stmt);
15238 curContext = stmt->compound.context->parent;
15243 Compiler_Error("Expression is not a container\n");
15255 struct Expression * exp;
15257 if(stmt->expressions)
15259 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15263 if(curFunction && !curFunction->type)
15264 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15265 FreeType(exp->destType);
15266 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15268 exp->destType->refCount++;
15270 ProcessExpressionType(exp);
15277 ProcessDeclaration(stmt->decl);
15282 struct AsmField * field;
15284 if(stmt->asmStmt.inputFields)
15286 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15287 if(field->expression)
15288 ProcessExpressionType(field->expression);
15290 if(stmt->asmStmt.outputFields)
15292 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15293 if(field->expression)
15294 ProcessExpressionType(field->expression);
15296 if(stmt->asmStmt.clobberedFields)
15298 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15300 if(field->expression)
15301 ProcessExpressionType(field->expression);
15308 struct PropertyWatch * propWatch;
15309 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15310 struct Expression * object = stmt->_watch.object;
15311 struct Expression * watcher = stmt->_watch.watcher;
15314 ProcessExpressionType(watcher);
15316 ProcessExpressionType(object);
15319 if(watcher || thisClass)
15321 struct External * external = curExternal;
15322 struct Context * context = curContext;
15325 stmt->expressions = MkList();
15326 curExternal = external->prev;
15327 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15329 struct ClassFunction * func;
15330 char watcherName[1024];
15331 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15332 struct External * createdExternal;
15333 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15335 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15336 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15337 if(propWatch->deleteWatch)
15338 strcat(watcherName, "_delete");
15341 struct Identifier * propID;
15343 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15345 strcat(watcherName, "_");
15346 strcat(watcherName, propID->string);
15349 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15351 func = MkClassFunction(MkListOne(MkSpecifier(301)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15352 ProcessClassFunctionBody(func, propWatch->compound);
15353 propWatch->compound = (((void *)0));
15354 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15355 createdExternal->symbol->idCode = external->symbol->idCode;
15356 curExternal = createdExternal;
15357 ProcessFunction(createdExternal->function);
15359 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15361 externalDecl->declaration = decl;
15362 if(decl->symbol && !decl->symbol->pointerExternal)
15363 decl->symbol->pointerExternal = externalDecl;
15365 if(propWatch->deleteWatch)
15367 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15369 ListAdd(args, CopyExpression(object));
15370 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15371 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15372 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15376 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15377 struct Identifier * propID;
15379 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15381 char propName[1024];
15382 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15386 char getName[1024], setName[1024];
15387 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15389 DeclareProperty(prop, setName, getName);
15390 strcpy(propName, "__ecereProp_");
15391 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15392 strcat(propName, "_");
15393 FullClassNameCat(propName, prop->name, 0x1);
15394 ListAdd(args, CopyExpression(object));
15395 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15396 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15397 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15398 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15401 Compiler_Error("Property %s not found in class %s\n", prop->name, _class->fullName);
15406 Compiler_Error("Invalid watched object\n");
15408 curExternal = external;
15409 curContext = context;
15411 FreeExpression(watcher);
15413 FreeExpression(object);
15414 FreeList(watches, FreePropertyWatch);
15417 Compiler_Error("No observer specified and not inside a _class\n");
15421 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15423 ProcessStatement(propWatch->compound);
15430 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15431 struct Expression * object = stmt->_watch.object;
15432 struct __ecereNameSpace__ecere__com__Class * _class;
15435 ProcessExpressionType(object);
15438 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15441 struct Identifier * propID;
15444 stmt->expressions = MkList();
15445 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15447 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15454 for(propID = (*watches).first; propID; propID = propID->next)
15456 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15460 CreateFireWatcher(prop, object, stmt);
15463 Compiler_Error("Property %s not found in class %s\n", propID->string, _class->fullName);
15468 struct __ecereNameSpace__ecere__com__Property * prop;
15469 struct __ecereNameSpace__ecere__com__Class * base;
15471 for(base = _class; base; base = base->base)
15473 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15475 if(prop->isProperty && prop->isWatchable)
15477 CreateFireWatcher(prop, object, stmt);
15483 FreeExpression(object);
15484 FreeList(watches, FreeIdentifier);
15487 Compiler_Error("Invalid object specified and not inside a class\n");
15493 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15494 struct Expression * object = stmt->_watch.object;
15495 struct Expression * watcher = stmt->_watch.watcher;
15496 struct __ecereNameSpace__ecere__com__Class * _class;
15499 ProcessExpressionType(object);
15501 ProcessExpressionType(watcher);
15504 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15505 if(watcher || thisClass)
15509 struct Identifier * propID;
15512 stmt->expressions = MkList();
15515 struct __ecereNameSpace__ecere__sys__OldList * args;
15518 ListAdd(args, CopyExpression(object));
15519 ListAdd(args, MkExpConstant("0"));
15520 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15521 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15525 for(propID = (*watches).first; propID; propID = propID->next)
15527 char propName[1024];
15528 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15532 char getName[1024], setName[1024];
15533 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15535 DeclareProperty(prop, setName, getName);
15536 strcpy(propName, "__ecereProp_");
15537 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15538 strcat(propName, "_");
15539 FullClassNameCat(propName, prop->name, 0x1);
15540 MangleClassName(propName);
15541 ListAdd(args, CopyExpression(object));
15542 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15543 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15544 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15547 Compiler_Error("Property %s not found in class %s\n", prop->name, _class->fullName);
15551 FreeExpression(object);
15553 FreeExpression(watcher);
15554 FreeList(watches, FreeIdentifier);
15557 Compiler_Error("Invalid object specified and not inside a class\n");
15560 Compiler_Error("No observer specified and not inside a class\n");
15567 extern struct Expression * QBrackets(struct Expression * exp);
15569 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15571 extern struct Declarator * QMkPtrDecl(char * id);
15573 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15575 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15577 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15579 static void ProcessFunction(struct FunctionDefinition * function)
15581 void * __ecereTemp2;
15582 void * __ecereTemp1;
15583 struct Identifier * id = GetDeclId(function->declarator);
15584 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15585 struct Type * type = symbol ? symbol->type : (((void *)0));
15586 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15587 struct Context * oldTopContext = topContext;
15589 yylloc = function->loc;
15590 if(type && type->thisClass)
15592 struct Symbol * classSym = type->thisClass;
15593 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15594 char className[1024];
15595 char structName[1024];
15596 struct Declarator * funcDecl;
15597 struct Symbol * thisSymbol;
15598 unsigned int typedObject = 0x0;
15600 if(_class && !_class->base)
15602 _class = currentClass;
15603 if(_class && !_class->symbol)
15604 _class->symbol = FindClass(_class->fullName);
15605 classSym = _class ? _class->symbol : (((void *)0));
15608 thisClass = _class;
15609 if(inCompiler && _class)
15611 if(type->kind == 11)
15613 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15615 struct Type * param = symbol->type->params.first;
15617 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15620 if(type->classObjectType != 1)
15622 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15623 symbol->type->staticMethod = 0x1;
15624 symbol->type->thisClass = (((void *)0));
15625 symbol->type->extraParam = 0x0;
15628 strcpy(className, "__ecereClass_");
15629 FullClassNameCat(className, _class->fullName, 0x1);
15630 MangleClassName(className);
15631 structName[0] = (char)0;
15632 FullClassNameCat(structName, _class->fullName, 0x0);
15633 funcDecl = GetFuncDecl(function->declarator);
15636 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15638 struct TypeName * param = (*funcDecl->function.parameters).first;
15640 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == 301 && !param->declarator)
15642 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15643 FreeTypeName(param);
15646 if(!function->propertyNoThis)
15648 struct TypeName * thisParam;
15650 if(type->classObjectType != 1)
15652 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15653 if(!funcDecl->function.parameters)
15654 funcDecl->function.parameters = MkList();
15655 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15659 if(type->classObjectType != 1)
15661 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
15662 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
15664 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));
15665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15669 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15671 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15673 funcDecl = GetFuncDecl(initDecl->declarator);
15676 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15678 struct TypeName * param = (*funcDecl->function.parameters).first;
15680 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == 301 && !param->declarator)
15682 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
15683 FreeTypeName(param);
15686 if(type->classObjectType != 1)
15688 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
15690 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
15692 if(!funcDecl->function.parameters)
15693 funcDecl->function.parameters = MkList();
15694 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
15702 if(type->classObjectType != 1)
15704 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));
15705 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15706 if(typedObject && thisSymbol->type)
15708 thisSymbol->type->classObjectType = 2;
15709 thisSymbol->type->byReference = type->byReference;
15713 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
15715 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15718 struct __ecereNameSpace__ecere__com__Class * base;
15720 for(base = _class; base && base->type != 1000; base = base->next)
15722 for(member = base->membersAndProperties.first; member; member = member->next)
15723 if(!member->isProperty)
15729 for(member = _class->membersAndProperties.first; member; member = member->next)
15730 if(!member->isProperty)
15734 char pointerName[1024];
15735 struct Declaration * decl;
15736 struct Initializer * initializer;
15737 struct Expression * exp, * bytePtr;
15739 strcpy(pointerName, "__ecerePointer_");
15740 FullClassNameCat(pointerName, _class->fullName, 0x0);
15742 char className[1024];
15744 strcpy(className, "__ecereClass_");
15745 FullClassNameCat(className, classSym->string, 0x1);
15746 MangleClassName(className);
15747 DeclareClass(classSym, className);
15749 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
15754 sprintf(string, "%d", _class->offset);
15755 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
15759 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
15761 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
15762 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));
15765 yylloc = function->body->loc;
15766 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
15768 struct Context * prevContext = curContext;
15770 curContext = function->body->compound.context;
15771 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
15772 curContext = prevContext;
15774 decl->symbol = (((void *)0));
15775 if(!function->body->compound.declarations)
15776 function->body->compound.declarations = MkList();
15777 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
15783 thisClass = (((void *)0));
15786 FreeSpecifier(id->_class);
15787 id->_class = (((void *)0));
15788 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
15790 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
15792 id = GetDeclId(initDecl->declarator);
15793 FreeSpecifier(id->_class);
15794 id->_class = (((void *)0));
15798 topContext = function->body->compound.context;
15800 struct FunctionDefinition * oldFunction = curFunction;
15802 curFunction = function;
15804 ProcessStatement(function->body);
15805 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
15807 struct Statement * prevCompound = curCompound;
15808 struct Context * prevContext = curContext;
15809 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
15811 if(!function->body->compound.statements)
15812 function->body->compound.statements = MkList();
15813 ListAdd(function->body->compound.statements, fireWatchers);
15814 curCompound = function->body;
15815 curContext = function->body->compound.context;
15816 ProcessStatement(fireWatchers);
15817 curContext = prevContext;
15818 curCompound = prevCompound;
15820 curFunction = oldFunction;
15822 if(function->declarator)
15824 ProcessDeclarator(function->declarator);
15826 topContext = oldTopContext;
15827 thisClass = oldThisClass;
15830 extern void FreeSymbol(struct Symbol * symbol);
15832 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
15834 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
15836 struct ClassDef * def;
15837 struct External * external = curExternal;
15838 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
15840 for(def = definitions->first; def; def = def->next)
15844 if(def->function->declarator)
15845 curExternal = def->function->declarator->symbol->pointerExternal;
15847 curExternal = external;
15848 ProcessFunction((struct FunctionDefinition *)def->function);
15850 else if(def->type == 2)
15852 if(def->decl->type == 2)
15854 thisClass = regClass;
15855 ProcessInstantiationType(def->decl->inst);
15856 thisClass = (((void *)0));
15860 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
15863 thisClass = regClass;
15864 ProcessDeclaration(def->decl);
15865 thisClass = backThisClass;
15868 else if(def->type == 1 && def->defProperties)
15870 struct MemberInit * defProperty;
15871 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);
15873 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15874 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
15876 thisClass = regClass;
15877 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
15878 thisClass = (((void *)0));
15880 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15881 FreeSymbol(thisSymbol);
15883 else if(def->type == 3 && def->propertyDef)
15885 struct PropertyDef * prop = def->propertyDef;
15887 thisClass = regClass;
15892 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15894 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15896 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
15897 ProcessStatement(prop->setStmt);
15903 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15905 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15907 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
15908 ProcessStatement(prop->getStmt);
15910 if(prop->issetStmt)
15914 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15916 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15918 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
15919 ProcessStatement(prop->issetStmt);
15921 thisClass = (((void *)0));
15923 else if(def->type == 4 && def->propertyWatch)
15925 struct PropertyWatch * propertyWatch = def->propertyWatch;
15927 thisClass = regClass;
15928 if(propertyWatch->compound)
15930 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
15932 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
15933 curExternal = (((void *)0));
15934 ProcessStatement(propertyWatch->compound);
15936 thisClass = (((void *)0));
15941 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
15943 void ComputeDataTypes()
15945 void * __ecereTemp1;
15946 struct External * external;
15947 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
15949 currentClass = (((void *)0));
15950 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
15951 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
15952 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
15953 curExternal = temp;
15954 DeclareStruct("ecere::com::Class", 0x0);
15955 DeclareStruct("ecere::com::Instance", 0x0);
15956 DeclareStruct("ecere::com::Property", 0x0);
15957 DeclareStruct("ecere::com::DataMember", 0x0);
15958 DeclareStruct("ecere::com::Method", 0x0);
15959 DeclareStruct("ecere::com::SerialBuffer", 0x0);
15960 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
15961 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
15962 for(external = (*ast).first; external; external = external->next)
15964 afterExternal = curExternal = external;
15965 if(external->type == 0)
15967 currentClass = external->function->_class;
15968 ProcessFunction(external->function);
15970 else if(external->type == 1)
15972 currentClass = (((void *)0));
15973 ProcessDeclaration(external->declaration);
15975 else if(external->type == 2)
15977 struct ClassDefinition * _class = external->_class;
15979 currentClass = external->symbol->registered;
15980 if(_class->definitions)
15982 ProcessClass(_class->definitions, _class->symbol);
15986 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
15987 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
15990 else if(external->type == 4)
15992 thisNameSpace = external->id->string;
15995 currentClass = (((void *)0));
15996 thisNameSpace = (((void *)0));
15997 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
15998 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16001 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);
16003 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);
16005 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
16007 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16009 struct __ecereNameSpace__ecere__com__Class * class;
16011 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16012 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16014 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16044 __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);
16045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16048 __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);
16049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16061 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16062 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16063 __ecereClass_Conversion = class;
16064 __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);
16065 __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);
16066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16067 __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);
16068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16079 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16080 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16081 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16082 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16086 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)